@webjsdev/cli 0.8.3 → 0.8.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 +41 -33
- package/package.json +1 -1
package/lib/create.js
CHANGED
|
@@ -891,6 +891,36 @@ ThemeToggle.register('theme-toggle');
|
|
|
891
891
|
CONVENTIONS.md, AGENTS.md, CLAUDE.md
|
|
892
892
|
`);
|
|
893
893
|
}
|
|
894
|
+
// AI-agent guidance comes first so it scrolls past in the terminal
|
|
895
|
+
// (long reading material, not actionable). The actionable run
|
|
896
|
+
// command lands LAST in the output so it is the final thing on
|
|
897
|
+
// screen after the install completes.
|
|
898
|
+
console.log(`AI-driven development (enforced for all AI agents):
|
|
899
|
+
✓ Tests auto-generated with every feature
|
|
900
|
+
✓ Docs auto-updated with every change
|
|
901
|
+
✓ Git merges/pushes to main require approval
|
|
902
|
+
✓ Commits are automatic, small, and meaningful
|
|
903
|
+
✓ No AI attribution in commit messages
|
|
904
|
+
✓ Convention validation via \`webjs check\`
|
|
905
|
+
|
|
906
|
+
For AI agents, read this before editing scaffolded files:
|
|
907
|
+
• The example layout / page / components / schema are REFERENCE ONLY.
|
|
908
|
+
Replace them with the app the user actually asked for. Don't ship
|
|
909
|
+
the scaffold's example User model or "Hello from …" page as the
|
|
910
|
+
final product.
|
|
911
|
+
• Use Prisma + SQLite for app data. It's already wired up. Define
|
|
912
|
+
real models in prisma/schema.prisma and run \`webjs db migrate\`.
|
|
913
|
+
NEVER store app data in JSON files, in-memory arrays, or
|
|
914
|
+
localStorage as a substitute for the database.
|
|
915
|
+
• Only three scaffolds exist: full-stack (default), api, saas. Don't
|
|
916
|
+
invent template names. If you need a different kind of app, pick
|
|
917
|
+
the closest scaffold and adapt it.
|
|
918
|
+
• Read AGENTS.md + CONVENTIONS.md in the new project before writing
|
|
919
|
+
any code. They are the contract.
|
|
920
|
+
• Need more detail? Full hosted docs are at https://docs.webjs.com
|
|
921
|
+
(every API, directive, recipe, and deployment guide).
|
|
922
|
+
`);
|
|
923
|
+
|
|
894
924
|
// Auto-install (default). Detect the package manager from the env so
|
|
895
925
|
// pnpm / yarn / bun users get their own. Pass `--no-install` (or
|
|
896
926
|
// `{ install: false }` to scaffoldApp) to opt out, e.g. for CI tests
|
|
@@ -898,19 +928,21 @@ ThemeToggle.register('theme-toggle');
|
|
|
898
928
|
const pm = detectPackageManager();
|
|
899
929
|
let installed = false;
|
|
900
930
|
if (shouldInstall) {
|
|
901
|
-
console.log(
|
|
931
|
+
console.log(`Running '${pm} install' in ${name}/ ...\n`);
|
|
902
932
|
installed = runInstall(appDir, pm);
|
|
903
933
|
if (!installed) {
|
|
904
934
|
console.log(`\n[warn] ${pm} install failed. Run '${pm} install' manually in ${name}/ to finish setup.\n`);
|
|
905
935
|
}
|
|
906
936
|
}
|
|
907
937
|
|
|
908
|
-
//
|
|
909
|
-
//
|
|
910
|
-
//
|
|
911
|
-
//
|
|
912
|
-
//
|
|
913
|
-
//
|
|
938
|
+
// Next-steps banner prints LAST so the actionable command is the
|
|
939
|
+
// final thing on screen, never buried above the AI-agent guidance.
|
|
940
|
+
// Single copy-paste line so the user can move from "scaffold done"
|
|
941
|
+
// to "dev server up" in one command. The full-stack and saas
|
|
942
|
+
// templates ship with @webjsdev/ui already initialised; the api
|
|
943
|
+
// template has no UI but may add one later. Saas needs a one-time
|
|
944
|
+
// prisma migrate before the first run (the example User model wants
|
|
945
|
+
// its table to exist).
|
|
914
946
|
const installSegment = installed ? '' : `${pm} install && `;
|
|
915
947
|
const prismaSegment = isSaas ? `npx prisma migrate dev --name init && ` : '';
|
|
916
948
|
const runCommand = `cd ${name} && ${installSegment}${prismaSegment}${pm} run dev`;
|
|
@@ -918,36 +950,12 @@ ThemeToggle.register('theme-toggle');
|
|
|
918
950
|
? `# If you later add a UI to this API project:
|
|
919
951
|
# npx webjs ui init && npx webjs ui add button card dialog`
|
|
920
952
|
: `npx webjs ui add <name> # add more ui-* components later`;
|
|
921
|
-
console.log(`
|
|
953
|
+
console.log(`
|
|
954
|
+
Next steps:
|
|
922
955
|
${runCommand}
|
|
923
956
|
# → http://localhost:3000
|
|
924
957
|
|
|
925
958
|
Optional:
|
|
926
959
|
${uiNote}
|
|
927
|
-
|
|
928
|
-
AI-driven development (enforced for all AI agents):
|
|
929
|
-
✓ Tests auto-generated with every feature
|
|
930
|
-
✓ Docs auto-updated with every change
|
|
931
|
-
✓ Git merges/pushes to main require approval
|
|
932
|
-
✓ Commits are automatic, small, and meaningful
|
|
933
|
-
✓ No AI attribution in commit messages
|
|
934
|
-
✓ Convention validation via \`webjs check\`
|
|
935
|
-
|
|
936
|
-
For AI agents, read this before editing scaffolded files:
|
|
937
|
-
• The example layout / page / components / schema are REFERENCE ONLY.
|
|
938
|
-
Replace them with the app the user actually asked for. Don't ship
|
|
939
|
-
the scaffold's example User model or "Hello from …" page as the
|
|
940
|
-
final product.
|
|
941
|
-
• Use Prisma + SQLite for app data. It's already wired up. Define
|
|
942
|
-
real models in prisma/schema.prisma and run \`webjs db migrate\`.
|
|
943
|
-
NEVER store app data in JSON files, in-memory arrays, or
|
|
944
|
-
localStorage as a substitute for the database.
|
|
945
|
-
• Only three scaffolds exist: full-stack (default), api, saas. Don't
|
|
946
|
-
invent template names. If you need a different kind of app, pick
|
|
947
|
-
the closest scaffold and adapt it.
|
|
948
|
-
• Read AGENTS.md + CONVENTIONS.md in the new project before writing
|
|
949
|
-
any code. They are the contract.
|
|
950
|
-
• Need more detail? Full hosted docs are at https://docs.webjs.com
|
|
951
|
-
(every API, directive, recipe, and deployment guide).
|
|
952
960
|
`);
|
|
953
961
|
}
|