consolidate readmes + mise config, add prek
This commit is contained in:
@@ -0,0 +1,36 @@
|
|||||||
|
# neuf-www
|
||||||
|
|
||||||
|
The neuf.no website. Wagtail CMS backend (`dnscms/`) feeding a Next.js frontend (`web/`) over GraphQL.
|
||||||
|
|
||||||
|
Tools are managed by [mise](https://mise.jdx.dev/). Run `mise install` to get python, uv, node, and prek.
|
||||||
|
|
||||||
|
## Backend (`dnscms/`)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd dnscms
|
||||||
|
uv sync
|
||||||
|
uv run ./manage.py migrate
|
||||||
|
uv run ./manage.py runserver
|
||||||
|
uv run pytest
|
||||||
|
```
|
||||||
|
|
||||||
|
GraphQL endpoint: <http://127.0.0.1:8000/api/graphql/>.
|
||||||
|
|
||||||
|
## Frontend (`web/`)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd web
|
||||||
|
npm install
|
||||||
|
npm run dev # http://localhost:3000
|
||||||
|
npm run codegen # regenerate GraphQL types (needs the backend running)
|
||||||
|
npm run build
|
||||||
|
```
|
||||||
|
|
||||||
|
## Pre-commit hooks
|
||||||
|
|
||||||
|
[prek](https://github.com/j178/prek) runs ruff lint + format on `dnscms/**/*.py` plus a few sanity hooks. Hooks are configured in [prek.toml](prek.toml).
|
||||||
|
|
||||||
|
```bash
|
||||||
|
prek install # registers the git hook
|
||||||
|
prek run --all-files # run on everything
|
||||||
|
```
|
||||||
@@ -4,7 +4,6 @@ version = "0.1.0"
|
|||||||
description = ""
|
description = ""
|
||||||
authors = [{ name = "EDB", email = "edb@neuf.no" }]
|
authors = [{ name = "EDB", email = "edb@neuf.no" }]
|
||||||
requires-python = ">=3.14, <3.15"
|
requires-python = ">=3.14, <3.15"
|
||||||
readme = "README.md"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"wagtail>=7.4,<8",
|
"wagtail>=7.4,<8",
|
||||||
"wagtail-grapple>=0.31.0,<0.32",
|
"wagtail-grapple>=0.31.0,<0.32",
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
[tools]
|
[tools]
|
||||||
python = "3.14"
|
python = "3.14"
|
||||||
uv = "latest"
|
uv = "latest"
|
||||||
|
node = "24"
|
||||||
|
prek = "latest"
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
[[repos]]
|
||||||
|
repo = "https://github.com/pre-commit/pre-commit-hooks"
|
||||||
|
rev = "v6.0.0"
|
||||||
|
hooks = [
|
||||||
|
{ id = "end-of-file-fixer" },
|
||||||
|
{ id = "trailing-whitespace" },
|
||||||
|
{ id = "check-yaml" },
|
||||||
|
{ id = "check-toml" },
|
||||||
|
{ id = "check-merge-conflict" },
|
||||||
|
{ id = "check-added-large-files" },
|
||||||
|
{ id = "debug-statements" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[repos]]
|
||||||
|
repo = "https://github.com/astral-sh/ruff-pre-commit"
|
||||||
|
rev = "v0.15.13"
|
||||||
|
|
||||||
|
[[repos.hooks]]
|
||||||
|
id = "ruff-check"
|
||||||
|
args = ["--fix"]
|
||||||
|
files = '^dnscms/.*\.py$'
|
||||||
|
exclude = '/migrations/'
|
||||||
|
|
||||||
|
[[repos.hooks]]
|
||||||
|
id = "ruff-format"
|
||||||
|
files = '^dnscms/.*\.py$'
|
||||||
|
exclude = '/migrations/'
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
|
|
||||||
|
|
||||||
## Development
|
|
||||||
|
|
||||||
Run the development server:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run dev
|
|
||||||
```
|
|
||||||
|
|
||||||
Update GraphQL definitions from `http://127.0.0.1:8000/api/graphql/`:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run codegen
|
|
||||||
```
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
[tools]
|
|
||||||
node = "24"
|
|
||||||
Reference in New Issue
Block a user