@webjskit/cli 0.1.2 → 0.1.4
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/lib/create.js +4 -4
- package/package.json +2 -2
- package/templates/.cursorrules +2 -2
- package/templates/.github/copilot-instructions.md +2 -2
- package/templates/.github/pull_request_template.md +3 -3
- package/templates/.windsurfrules +2 -2
- package/templates/AGENTS.md +1 -1
- package/templates/CLAUDE.md +9 -9
- package/templates/CONVENTIONS.md +4 -4
- package/templates/test/browser/example.test.js +1 -1
- package/templates/test/e2e/example.test.ts +1 -1
- package/templates/test/unit/example.test.ts +1 -1
- package/templates/web-test-runner.config.js +3 -3
package/lib/create.js
CHANGED
|
@@ -433,8 +433,8 @@ export default function Home() {
|
|
|
433
433
|
\${displayH1(html\`Hello from <span class="text-accent italic">${name}</span>.\`)}
|
|
434
434
|
<p class="text-lede leading-[1.5] text-fg-muted max-w-[56ch] m-0">
|
|
435
435
|
Edit <code class="font-mono text-[0.9em]">app/page.ts</code> to get started.
|
|
436
|
-
Run \${accentLink('#', '
|
|
437
|
-
\${accentLink('#', '
|
|
436
|
+
Run \${accentLink('#', 'webjs test')} to run tests and
|
|
437
|
+
\${accentLink('#', 'webjs check')} to validate conventions.
|
|
438
438
|
</p>
|
|
439
439
|
</section>
|
|
440
440
|
|
|
@@ -572,7 +572,7 @@ ThemeToggle.register('theme-toggle');
|
|
|
572
572
|
console.log(`Next steps:
|
|
573
573
|
cd ${name}
|
|
574
574
|
npm install${isSaas ? '\n npx prisma migrate dev --name init' : ''}
|
|
575
|
-
|
|
575
|
+
webjs dev
|
|
576
576
|
|
|
577
577
|
AI-driven development (enforced for all AI agents):
|
|
578
578
|
✓ Tests auto-generated with every feature
|
|
@@ -580,6 +580,6 @@ AI-driven development (enforced for all AI agents):
|
|
|
580
580
|
✓ Git merges/pushes to main require approval
|
|
581
581
|
✓ Commits are automatic, small, and meaningful
|
|
582
582
|
✓ No AI attribution in commit messages
|
|
583
|
-
✓ Convention validation via \`
|
|
583
|
+
✓ Convention validation via \`webjs check\`
|
|
584
584
|
`);
|
|
585
585
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webjskit/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "webjs CLI — dev, start, create, db",
|
|
6
6
|
"bin": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"README.md"
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@webjskit/server": "0.1.
|
|
16
|
+
"@webjskit/server": "0.1.1"
|
|
17
17
|
},
|
|
18
18
|
"publishConfig": {
|
|
19
19
|
"access": "public"
|
package/templates/.cursorrules
CHANGED
|
@@ -28,13 +28,13 @@ Quality bar stays the same — just no blocking on questions.
|
|
|
28
28
|
## Mandatory workflow (never skip)
|
|
29
29
|
|
|
30
30
|
1. TESTS: Server tests in test/unit/ (node:test), browser tests in
|
|
31
|
-
test/browser/ (WTR + Playwright, real Chromium). Run `
|
|
31
|
+
test/browser/ (WTR + Playwright, real Chromium). Run `webjs test`
|
|
32
32
|
after every change. Never deliver code without passing tests.
|
|
33
33
|
|
|
34
34
|
2. DOCS: Update AGENTS.md for API changes. Update docs/ and website/ if
|
|
35
35
|
they exist. The user should never have to ask for tests or docs.
|
|
36
36
|
|
|
37
|
-
3. CONVENTIONS: Run `
|
|
37
|
+
3. CONVENTIONS: Run `webjs check` and fix violations before committing.
|
|
38
38
|
|
|
39
39
|
## Git rules
|
|
40
40
|
|
|
@@ -27,7 +27,7 @@ Every code change must include:
|
|
|
27
27
|
2. Server tests in test/unit/*.test.ts (node:test for actions, queries, utilities)
|
|
28
28
|
3. Browser tests in test/browser/*.test.js (WTR + Playwright, real Chromium)
|
|
29
29
|
4. Documentation updates (AGENTS.md for API, docs/ for user guides)
|
|
30
|
-
5. Convention validation: `
|
|
30
|
+
5. Convention validation: `webjs check` must pass
|
|
31
31
|
|
|
32
32
|
## Git rules
|
|
33
33
|
|
|
@@ -38,7 +38,7 @@ Every code change must include:
|
|
|
38
38
|
- NEVER merge any branch without explicit user permission. Always ask:
|
|
39
39
|
"Ready to merge <branch> into <target>? Delete or keep <branch> after?"
|
|
40
40
|
Wait for approval AND the delete/keep preference. Applies to ALL merges.
|
|
41
|
-
- Run `
|
|
41
|
+
- Run `webjs test` before every commit
|
|
42
42
|
|
|
43
43
|
## Code patterns
|
|
44
44
|
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
## Test plan
|
|
6
6
|
|
|
7
|
-
- [ ] Unit tests added/updated (`
|
|
8
|
-
- [ ] E2E tests added/updated for user-facing changes (`
|
|
9
|
-
- [ ] `
|
|
7
|
+
- [ ] Unit tests added/updated (`webjs test` passes)
|
|
8
|
+
- [ ] E2E tests added/updated for user-facing changes (`webjs test --e2e` passes)
|
|
9
|
+
- [ ] `webjs check` passes (no convention violations)
|
|
10
10
|
|
|
11
11
|
## Documentation
|
|
12
12
|
|
package/templates/.windsurfrules
CHANGED
|
@@ -26,7 +26,7 @@ Every code change must include:
|
|
|
26
26
|
1. Server tests in test/unit/*.test.ts (node:test)
|
|
27
27
|
2. Browser tests in test/browser/*.test.js (WTR + Playwright, real Chromium)
|
|
28
28
|
3. Documentation updates (AGENTS.md, docs/, website/ if they exist)
|
|
29
|
-
4. Convention check: `
|
|
29
|
+
4. Convention check: `webjs check` must pass
|
|
30
30
|
|
|
31
31
|
The user should never have to ask for tests or documentation.
|
|
32
32
|
|
|
@@ -41,7 +41,7 @@ The user should never have to ask for tests or documentation.
|
|
|
41
41
|
- NEVER merge any branch without explicit user permission. Always ask:
|
|
42
42
|
"Ready to merge <branch> into <target>? Delete or keep <branch> after?"
|
|
43
43
|
Wait for approval AND the delete/keep preference. Applies to ALL merges.
|
|
44
|
-
- Run `
|
|
44
|
+
- Run `webjs test` before every commit
|
|
45
45
|
|
|
46
46
|
## Framework specifics
|
|
47
47
|
|
package/templates/AGENTS.md
CHANGED
|
@@ -186,7 +186,7 @@ absolute URLs from `ctx.url`).
|
|
|
186
186
|
|
|
187
187
|
1. Branch before editing — never push to `main` directly.
|
|
188
188
|
2. Every code change comes with: unit test(s), AGENTS.md / docs updates if
|
|
189
|
-
the feature surface changed, `
|
|
189
|
+
the feature surface changed, `webjs check` passing.
|
|
190
190
|
3. Commit and push after each logical unit. No AI attribution trailers.
|
|
191
191
|
4. When unsure how a framework feature works, `grep` or `cat` the
|
|
192
192
|
relevant `node_modules/@webjskit/*/src/` file before asking the user.
|
package/templates/CLAUDE.md
CHANGED
|
@@ -32,8 +32,8 @@ This is automatic — the user should never have to ask.
|
|
|
32
32
|
- **Bug fix** → add regression test proving the fix
|
|
33
33
|
- **Refactor** → run existing tests, ensure they pass
|
|
34
34
|
|
|
35
|
-
After writing code, ALWAYS run `
|
|
36
|
-
also run `
|
|
35
|
+
After writing code, ALWAYS run `webjs test`. If E2E-relevant,
|
|
36
|
+
also run `webjs test --browser`. Never report a task as done with
|
|
37
37
|
failing tests.
|
|
38
38
|
|
|
39
39
|
### 3. Documentation (mandatory, never skip)
|
|
@@ -52,18 +52,18 @@ If this project has a **website/** directory, also:
|
|
|
52
52
|
|
|
53
53
|
### 4. Convention validation
|
|
54
54
|
|
|
55
|
-
After making changes, run `
|
|
55
|
+
After making changes, run `webjs check` and fix any violations before
|
|
56
56
|
reporting the task as done.
|
|
57
57
|
|
|
58
58
|
## Quick reference
|
|
59
59
|
|
|
60
60
|
```sh
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
webjs dev # dev server with live reload
|
|
62
|
+
webjs test # run unit tests
|
|
63
|
+
webjs test --browser # run unit + E2E tests
|
|
64
|
+
webjs check # validate conventions
|
|
65
|
+
webjs build # (optional) production bundle
|
|
66
|
+
webjs start # production server
|
|
67
67
|
```
|
|
68
68
|
|
|
69
69
|
All API details, recipes, and feature documentation → see **[AGENTS.md](./AGENTS.md)**.
|
package/templates/CONVENTIONS.md
CHANGED
|
@@ -33,7 +33,7 @@ even if the user doesn't explicitly ask.**
|
|
|
33
33
|
|
|
34
34
|
2. **Tests** — Unit test for logic, E2E test for user-facing behavior.
|
|
35
35
|
See the "Testing" section below for what type of test each change needs.
|
|
36
|
-
Run `
|
|
36
|
+
Run `webjs test` after every change. Never mark work as done with
|
|
37
37
|
failing tests.
|
|
38
38
|
|
|
39
39
|
3. **Documentation updates** — When adding or modifying features:
|
|
@@ -43,7 +43,7 @@ even if the user doesn't explicitly ask.**
|
|
|
43
43
|
- If a `website/` directory exists, update the landing page for
|
|
44
44
|
user-facing features.
|
|
45
45
|
|
|
46
|
-
3. **Convention check** — Run `
|
|
46
|
+
3. **Convention check** — Run `webjs check` after changes and fix
|
|
47
47
|
any violations before reporting the task as done.
|
|
48
48
|
|
|
49
49
|
### Autonomous mode (sandbox / bypass permissions)
|
|
@@ -529,8 +529,8 @@ This project enforces a git workflow via agent-specific config files
|
|
|
529
529
|
`.github/copilot-instructions.md`.
|
|
530
530
|
|
|
531
531
|
**Pre-commit checks:**
|
|
532
|
-
- `
|
|
533
|
-
- `
|
|
532
|
+
- `webjs test` must pass
|
|
533
|
+
- `webjs check` must pass
|
|
534
534
|
- No unrelated files in the commit
|
|
535
535
|
|
|
536
536
|
---
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* Chromium via Playwright. Server tests (actions, queries) use node:test.
|
|
6
6
|
*
|
|
7
7
|
* Run:
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* webjs test # runs both server + browser tests
|
|
9
|
+
* webjs test --browser # browser tests only
|
|
10
|
+
* webjs test --server # server tests only
|
|
11
11
|
*/
|
|
12
12
|
import { playwrightLauncher } from '@web/test-runner-playwright';
|
|
13
13
|
|