Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,32 @@ jobs:
run-tests:
name: Run tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: node
steps:
- uses: actions/setup-node@v7
with:
node-version: '22'
- name: Check out Git repository
uses: actions/checkout@v7
- name: Install dependencies
run: npm install
run: npm ci
- name: Run tests
run: npm run test-ci
run-lint:
name: Run lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: node
steps:
- uses: actions/setup-node@v7
with:
node-version: '22'
- name: Check out Git repository
uses: actions/checkout@v7
- name: Install dependencies
run: npm install
run: npm ci
- name: Run lint
run: npm run lint
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,4 @@ bower_components/
main/static/assets/img2

*storybook.log
node/storybook-static/
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ repos:
hooks:
- id: codespell
args: [-I, .codespell_ignore.txt]
exclude: ^main/static/assets/|^package-lock.json$|^direct_webapp/fixtures/framework-2-0.json$
exclude: ^main/static/assets/|^node/package-lock.json$|^direct_webapp/fixtures/framework-2-0.json$
- repo: https://github.com/djlint/djLint
rev: v1.47.1
hooks:
Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,14 @@ Versions can be restricted from updating within the `pyproject.toml` using stand

## Frontend Node

This project includes an NPM-based setup for managing front-end assets like styles, scripts, and other resources. The `package.json` file contains predefined scripts to help with building and managing assets. You don't need to run these NPM commands if you are developing the Django app locally. You should only run these commands when needed, for example if you are changing javascript dependencies or modifying SCSS files.
The front-end build is contained in [node/](node/README.md), including its package
manifest, lockfile, tooling configuration, sources and tests. You do not need
Node.js to develop Django pages using the committed assets. Only rebuild when
changing front-end sources or dependencies.

Run npm commands from `node/`, or use `npm --prefix node` from the repository root.
Built assets remain in `main/static/assets/`; Django deployment still consumes
those assets without running npm.

See [Frontend Node](node/README.md) for details on working with the NPM-based frontend asset pipeline.

Expand Down
5 changes: 3 additions & 2 deletions docs/dev-guide/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,16 @@ Run the configured `djlint-django` and `djlint-reformat-django` pre-commit hooks
for changed templates. Use `pyproject.toml` as the authority for djlint rules and
existing exceptions; do not add a separate formatting convention.

For unavoidable SCSS changes, use the existing stylesheet scripts:
For unavoidable SCSS changes, use the existing stylesheet scripts from `node/`:

```bash
npm run styles:expanded
npm run styles:minified
```

These scripts lint SCSS with Stylelint before compiling the theme. Stylelint
rules live in `.stylelintrc.json`. The broader `npm run build` also builds
rules live in `node/.stylelintrc.json`. From the repository root, use
`npm --prefix node run <script>` instead. The broader `npm run build` also builds
JavaScript and is not a CSS-only check.

Inspect any generated stylesheet changes, exercise affected templates with the
Expand Down
Loading
Loading