@webjsdev/cli 0.10.40 → 0.10.41

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.
Files changed (69) hide show
  1. package/bin/webjs.js +4 -46
  2. package/lib/create.js +282 -479
  3. package/lib/doctor.js +1 -38
  4. package/package.json +5 -1
  5. package/templates/.agents/rules/workflow.md +61 -271
  6. package/templates/.agents/skills/webjs/SKILL.md +226 -0
  7. package/templates/.agents/skills/webjs/references/auth-and-sessions.md +220 -0
  8. package/templates/.agents/skills/webjs/references/built-ins.md +200 -0
  9. package/templates/.agents/skills/webjs/references/client-router-and-streaming.md +204 -0
  10. package/templates/.agents/skills/webjs/references/components.md +167 -0
  11. package/templates/.agents/skills/webjs/references/data-and-actions.md +187 -0
  12. package/templates/.agents/skills/webjs/references/muscle-memory-gotchas.md +170 -0
  13. package/templates/.agents/skills/webjs/references/optimistic-ui.md +128 -0
  14. package/templates/.agents/skills/webjs/references/routing-and-pages.md +158 -0
  15. package/templates/.agents/skills/webjs/references/runtime.md +80 -0
  16. package/templates/.agents/skills/webjs/references/service-worker.md +78 -0
  17. package/templates/.agents/skills/webjs/references/styling.md +123 -0
  18. package/templates/.agents/skills/webjs/references/testing.md +125 -0
  19. package/templates/.agents/skills/webjs/references/typescript.md +148 -0
  20. package/templates/.claude/hooks/check-server-imports.mjs +1 -1
  21. package/templates/.claude/hooks/require-tests-with-src.sh +1 -1
  22. package/templates/.claude/settings.json +0 -14
  23. package/templates/.cursorrules +21 -189
  24. package/templates/.github/copilot-instructions.md +7 -185
  25. package/templates/.github/pull_request_template.md +1 -1
  26. package/templates/AGENTS.md +59 -1494
  27. package/templates/CLAUDE.md +0 -1
  28. package/templates/CONVENTIONS.md +32 -1383
  29. package/templates/GEMINI.md +11 -0
  30. package/templates/gallery/app/apple-icon.ts +0 -1
  31. package/templates/gallery/app/examples/todo/page.ts +0 -1
  32. package/templates/gallery/app/features/async-render/page.ts +0 -1
  33. package/templates/gallery/app/features/boundaries/page.ts +0 -1
  34. package/templates/gallery/app/features/broadcast/page.ts +0 -1
  35. package/templates/gallery/app/features/caching/page.ts +0 -1
  36. package/templates/gallery/app/features/client-router/page.ts +0 -1
  37. package/templates/gallery/app/features/client-router/second/page.ts +0 -1
  38. package/templates/gallery/app/features/components/page.ts +0 -1
  39. package/templates/gallery/app/features/directives/page.ts +0 -1
  40. package/templates/gallery/app/features/env/page.ts +0 -1
  41. package/templates/gallery/app/features/file-storage/page.ts +0 -1
  42. package/templates/gallery/app/features/forms/page.ts +0 -1
  43. package/templates/gallery/app/features/metadata/page.ts +0 -1
  44. package/templates/gallery/app/features/optimistic-ui/page.ts +0 -1
  45. package/templates/gallery/app/features/rate-limit/page.ts +0 -1
  46. package/templates/gallery/app/features/route-handler/page.ts +0 -1
  47. package/templates/gallery/app/features/routing/page.ts +0 -1
  48. package/templates/gallery/app/features/server-actions/page.ts +0 -1
  49. package/templates/gallery/app/features/service-worker/page.ts +0 -1
  50. package/templates/gallery/app/features/sessions/page.ts +0 -1
  51. package/templates/gallery/app/features/websockets/page.ts +0 -1
  52. package/templates/gallery/app/global-error.ts +0 -1
  53. package/templates/gallery/app/global-not-found.ts +0 -1
  54. package/templates/gallery/app/icon.ts +0 -1
  55. package/templates/gallery/app/manifest.ts +0 -1
  56. package/templates/gallery/app/opengraph-image.ts +0 -1
  57. package/templates/gallery/app/robots.ts +0 -1
  58. package/templates/gallery/app/sitemap.ts +0 -1
  59. package/templates/gallery/app/twitter-image.ts +0 -1
  60. package/templates/public/favicon.svg +5 -0
  61. package/templates/public/sw.js +1 -1
  62. package/templates/scripts/clear-gallery.mjs +95 -0
  63. package/lib/clear-placeholders.js +0 -98
  64. package/lib/design-bar.js +0 -67
  65. package/templates/.claude/hooks/design-review-before-stop.sh +0 -36
  66. package/templates/.claude/hooks/route-skills.sh +0 -35
  67. package/templates/.claude/skills/webjs-design-review/SKILL.md +0 -84
  68. package/templates/LAYOUT-REFERENCE.md +0 -96
  69. package/templates/lib/utils/ui.ts +0 -83
package/bin/webjs.js CHANGED
@@ -4,7 +4,6 @@ import { spawn } from 'node:child_process';
4
4
  import { fileURLToPath } from 'node:url';
5
5
  import { resolveBin } from '../lib/resolve-bin.js';
6
6
  import { dbGenerateTtyHint } from '../lib/db-hints.js';
7
- import { DESIGN_REMINDER, hasUiLayout } from '../lib/design-bar.js';
8
7
  import { checkNodeInline, nodeInlineMessage } from '../lib/node-preflight.js';
9
8
  import { loadAppEnv, resolvePort } from '../lib/port.js';
10
9
  import { planDevSupervisor } from '../lib/dev-supervisor.js';
@@ -47,7 +46,7 @@ const USAGE = `webjs commands:
47
46
  (--no-hot: run in-process, no hot-reload supervisor)
48
47
  webjs start [--port 8080] Start production server (serves source directly, no build step)
49
48
  webjs test [--server|--browser] Run server + browser tests
50
- webjs check [--json] [--clear-placeholders] Run correctness checks (--json emits structured violations; --clear-placeholders strips scaffold markers)
49
+ webjs check [--json] Run correctness checks (--json emits structured violations)
51
50
  webjs mcp Start the read-only MCP server (routes / actions / components / check)
52
51
  webjs doctor Verify project health (Node, tsconfig, env, vendor pins, importmap coherence, @webjsdev versions, git hook, page/layout elision)
53
52
  webjs types Generate .webjs/routes.d.ts (typed Route union + per-route params)
@@ -412,37 +411,12 @@ async function main() {
412
411
  case 'check': {
413
412
  const { checkConventions, RULES } = await import('@webjsdev/server/check');
414
413
 
415
- // --clear-placeholders: acknowledge the whole scaffold gallery in one
416
- // command (strip the marker comment lines, keep the demo code), instead of
417
- // one hand-edit per file. The gate then reflects only real violations.
418
- if (rest.includes('--clear-placeholders')) {
419
- const { clearPlaceholders } = await import('../lib/clear-placeholders.js');
420
- const report = clearPlaceholders(process.cwd());
421
- const total = report.reduce((n, r) => n + r.markers, 0);
422
- if (report.length === 0) {
423
- console.log('webjs check: no scaffold-placeholder markers found (nothing to clear).');
424
- } else {
425
- console.log(`webjs check: cleared ${total} scaffold-placeholder marker(s) across ${report.length} file(s):`);
426
- for (const r of report) console.log(` ${r.file}`);
427
- console.log('\nThe demo code is kept. Delete any gallery route/module you do not want, then re-run `webjs check`.');
428
- // Re-surface the design bar the cleared markers carried. The
429
- // layout/home marker was the just-in-time "adapt this chrome" reminder;
430
- // stripping it silently is how an app ends up shipping the scaffold
431
- // shell. Print the bar so clearing the markers cannot quietly drop it,
432
- // but only for a UI app (the api template has no layout / no chrome).
433
- if (hasUiLayout(process.cwd())) console.log(DESIGN_REMINDER);
434
- }
435
- break;
436
- }
437
-
438
414
  if (rest.includes('--rules')) {
439
415
  console.log('webjs check, correctness rules:');
440
416
  console.log(' Every rule catches code that is wrong to ship: a crash, a');
441
- console.log(' security leak, a build/type-strip failure, or (the one');
442
- console.log(' sentinel-based rule, no-scaffold-placeholder) unreplaced');
443
- console.log(' scaffold example content. They always run. Project');
444
- console.log(' conventions (layout, style, process) are guidance in');
445
- console.log(' CONVENTIONS.md, not rules here.\n');
417
+ console.log(' security leak, or a build/type-strip failure. They always');
418
+ console.log(' run. Project conventions (layout, style, process) are');
419
+ console.log(' guidance in CONVENTIONS.md, not rules here.\n');
446
420
  for (const r of RULES) {
447
421
  console.log(` ${r.name.padEnd(30)} ${r.description}`);
448
422
  }
@@ -469,28 +443,12 @@ async function main() {
469
443
  console.log('webjs check: all checks pass ✓');
470
444
  } else {
471
445
  console.log(`webjs check: ${violations.length} violation(s) found\n`);
472
- // A fresh scaffold trips no-scaffold-placeholder on every unadapted demo
473
- // file at once. Printing an identical block per file drowns the real
474
- // feature violations, so collapse the sentinel to ONE grouped summary
475
- // (with a one-command clear) and print every other rule per-violation.
476
- // The returned violations and --json are unchanged; only this human
477
- // printout groups, so agents/tools still see one entry per file.
478
- const PLACEHOLDER = 'no-scaffold-placeholder';
479
- const placeholders = violations.filter((v) => v.rule === PLACEHOLDER);
480
446
  for (const v of violations) {
481
- if (v.rule === PLACEHOLDER) continue;
482
447
  console.log(` ✗ [${v.rule}] ${v.file}`);
483
448
  console.log(` ${v.message}`);
484
449
  if (v.fix) console.log(` Fix: ${v.fix}`);
485
450
  console.log();
486
451
  }
487
- if (placeholders.length > 0) {
488
- console.log(` ✗ [${PLACEHOLDER}] ${placeholders.length} file(s) still carry scaffold example content:`);
489
- for (const v of placeholders) console.log(` ${v.file}`);
490
- console.log(' Fix: adapt or delete each file, then remove its marker comment line.');
491
- console.log(' Keeping the gallery? Run `webjs check --clear-placeholders` to clear all markers at once.');
492
- console.log();
493
- }
494
452
  process.exit(1);
495
453
  }
496
454
  break;