@cubocicloide/stack-react-django 3.3.0 → 3.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cubocicloide/stack-react-django",
3
- "version": "3.3.0",
3
+ "version": "3.4.1",
4
4
  "description": "React (Vite) + Django REST Framework stack plugin for the dude CLI.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -20,7 +20,7 @@
20
20
  "openapi-typescript": "^7.13.0",
21
21
  "pathe": "^1.1.2",
22
22
  "yaml": "^2.6.0",
23
- "@cubocicloide/dude": "0.16.0"
23
+ "@cubocicloide/dude": "0.17.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/node": "^26.1.2",
@@ -29,7 +29,7 @@
29
29
  "vitest": "^2.1.9"
30
30
  },
31
31
  "engines": {
32
- "node": ">=20"
32
+ "node": ">=20.19"
33
33
  },
34
34
  "scripts": {
35
35
  "build": "tsup",
@@ -138,16 +138,16 @@ Run on the consolidated branch (or the single agent branch):
138
138
  dude lint
139
139
  ```
140
140
 
141
- If the project has a test command (check `Makefile`, `package.json` scripts, or
142
- `dude help`), run it next:
141
+ Run the project's own test suite next:
143
142
 
144
143
  ```bash
145
- dude test # if available
146
- # or:
147
- cd backend && python -m pytest
148
- cd frontend && pnpm test
144
+ dude test
149
145
  ```
150
146
 
147
+ `dude help test` lists the suites this project actually exposes (`--backend`,
148
+ `--e2e`, …) — they differ per stack. If the change is scoped to one suite, run
149
+ that one rather than the lot.
150
+
151
151
  If any step fails, report the output and stop — do **not** create a PR.
152
152
 
153
153
  ---
@@ -0,0 +1,34 @@
1
+ # PRJ001 — Example project rule
2
+
3
+ This file is the prose half of the example project check
4
+ (`.dude/lint/checks/PRJ/001.ts`). Rename, edit or delete both together.
5
+
6
+ ## What it does
7
+
8
+ Nothing yet — the shipped check returns no diagnostics. It exists so you have a
9
+ working pair to copy: a rule module, and the Markdown that explains it.
10
+
11
+ ## Why the file is here
12
+
13
+ `dude explain PRJ001` prints **this file**, and `dude cheatsheet` uses its first
14
+ heading as the rule's one-line title. A project rule with no Markdown beside it
15
+ still runs, but it can only ever be listed as a bare code — which tells whoever
16
+ hits the diagnostic (a teammate, or a coding agent) nothing about how to fix it.
17
+
18
+ The convention is a sibling file, matching the check's path:
19
+
20
+ ```
21
+ .dude/lint/checks/PRJ/001.ts ← the rule
22
+ .dude/lint/checks/PRJ/001.md ← this file
23
+ ```
24
+
25
+ `dude lint` ignores non-module files, so the Markdown never runs as a check.
26
+
27
+ > Stack rules follow the mirror-image convention — their prose lives under
28
+ > `.claude/rules/<GROUP>/<NNN>.md`. Both are served by `dude explain <CODE>`.
29
+
30
+ ## How to fix a violation
31
+
32
+ Describe the fix here, concretely enough that someone can act on it without
33
+ opening the check's source. Start the file with `# <CODE> — <title>` so the
34
+ title is picked up.
@@ -38,9 +38,26 @@ export default function check(root: string): RawDiagnostic[] {
38
38
  Checks are loaded with [jiti](https://github.com/unjs/jiti), so you can write
39
39
  real TypeScript and `import` any package you add to the project.
40
40
 
41
- You can document a rule with a Markdown file next to it
42
- (`PRJ/001.md`) — `dude lint` ignores non-module files. Co-located tests
43
- (`001.test.ts`) are ignored too.
41
+ ## Documenting a rule
42
+
43
+ Put a Markdown file next to the check, named after it:
44
+
45
+ ```
46
+ .dude/lint/checks/PRJ/001.ts ← the rule
47
+ .dude/lint/checks/PRJ/001.md ← what it means and how to fix it
48
+ ```
49
+
50
+ `dude explain PRJ001` prints that file, and `dude cheatsheet` uses its first
51
+ heading (`# PRJ001 — <title>`) as the rule's one-line title. Without it the rule
52
+ still runs, but it can only be reported as a bare code — which tells whoever hits
53
+ the diagnostic nothing about how to fix it. The shipped `PRJ/001.md` is a worked
54
+ example.
55
+
56
+ `dude lint` ignores non-module files, so the Markdown never runs as a check.
57
+ Co-located tests (`001.test.ts`) are ignored too.
58
+
59
+ > Stack rules use the mirror-image location, `.claude/rules/<GROUP>/<NNN>.md`.
60
+ > `dude explain <CODE>` serves both.
44
61
 
45
62
  ## Choosing codes
46
63
 
@@ -4,7 +4,7 @@ version = "0.0.1"
4
4
  description = "Django REST Framework backend for {{projectName}}"
5
5
  requires-python = ">=3.13"
6
6
  dependencies = [
7
- "django>=5.1",
7
+ "django>=5.1,<6.0",
8
8
  "djangorestframework>=3.15.0",
9
9
  "drf-spectacular>=0.28.0",
10
10
  "django-environ>=0.11.0",
@@ -94,6 +94,7 @@ defines every service.
94
94
  | Command | Description |
95
95
  |---------|-------------|
96
96
  | `dude lint` | Run all structural lint checks (naming, layout conventions) |
97
+ | `dude explain <CODE>` | Print the prose behind a lint code — why the rule exists and how to fix it |
97
98
  | `dude format` | Format code — `ruff` (backend) + `prettier` (frontend) |
98
99
  | `dude upgrade` | Update the pinned `dude` CLI and stack versions for this project |
99
100
  | `dude review` | Run lint + ESLint + API contract review in one pass |
@@ -103,13 +104,29 @@ defines every service.
103
104
  `dude lint` also runs any rules you define under `.dude/lint/checks/` — the
104
105
  rule code is derived from the path (`.dude/lint/checks/PRJ/001.ts` → `PRJ001`)
105
106
  and the contract is the same one the stack's own checks use. See
106
- `.dude/lint/checks/README.md` and the `PRJ/001.ts` example. To disable a
107
- built-in rule, list its code in `dude.json`:
107
+ `.dude/lint/checks/README.md` and the `PRJ/001.ts` example. Document a rule with
108
+ a Markdown file next to it (`PRJ/001.md`) and `dude explain PRJ001` serves it.
109
+ To disable a built-in rule, list its code in `dude.json`:
108
110
 
109
111
  ```json
110
112
  { "lint": { "disable": ["BE003"] } }
111
113
  ```
112
114
 
115
+ ### Verifying your work mechanically
116
+
117
+ `dude lint` and `dude explain` are designed to be used together — the fastest
118
+ loop for anyone, human or coding agent, working in this project:
119
+
120
+ ```bash
121
+ dude lint --format json # what broke, where, and under which rule code
122
+ dude explain BE003 # why that rule exists and how to satisfy it
123
+ ```
124
+
125
+ `--format json` writes nothing but the JSON document to stdout, so it pipes
126
+ cleanly (`dude lint --format json | jq '.diagnostics[].code'`). Exit codes are
127
+ the same as the human format: non-zero only when there is at least one error.
128
+ Run `dude explain` with no code to list every rule that applies here.
129
+
113
130
  ### Upgrading pinned versions
114
131
 
115
132
  `dude upgrade` updates version pins only. It does **not** migrate existing