@zero2webmaster/starter-kit 0.1.0
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/LICENSE +38 -0
- package/README.md +89 -0
- package/dist/brand.d.ts +72 -0
- package/dist/brand.d.ts.map +1 -0
- package/dist/brand.js +198 -0
- package/dist/brand.js.map +1 -0
- package/dist/brief.d.ts +14 -0
- package/dist/brief.d.ts.map +1 -0
- package/dist/brief.js +47 -0
- package/dist/brief.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +82 -0
- package/dist/cli.js.map +1 -0
- package/dist/confirm.d.ts +45 -0
- package/dist/confirm.d.ts.map +1 -0
- package/dist/confirm.js +382 -0
- package/dist/confirm.js.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/parse-brief.d.ts +32 -0
- package/dist/parse-brief.d.ts.map +1 -0
- package/dist/parse-brief.js +298 -0
- package/dist/parse-brief.js.map +1 -0
- package/dist/scaffolders/cf-pages.d.ts +9 -0
- package/dist/scaffolders/cf-pages.d.ts.map +1 -0
- package/dist/scaffolders/cf-pages.js +259 -0
- package/dist/scaffolders/cf-pages.js.map +1 -0
- package/dist/scaffolders/cf-worker.d.ts +4 -0
- package/dist/scaffolders/cf-worker.d.ts.map +1 -0
- package/dist/scaffolders/cf-worker.js +112 -0
- package/dist/scaffolders/cf-worker.js.map +1 -0
- package/dist/scaffolders/common.d.ts +39 -0
- package/dist/scaffolders/common.d.ts.map +1 -0
- package/dist/scaffolders/common.js +441 -0
- package/dist/scaffolders/common.js.map +1 -0
- package/dist/scaffolders/index.d.ts +18 -0
- package/dist/scaffolders/index.d.ts.map +1 -0
- package/dist/scaffolders/index.js +40 -0
- package/dist/scaffolders/index.js.map +1 -0
- package/dist/scaffolders/library.d.ts +4 -0
- package/dist/scaffolders/library.d.ts.map +1 -0
- package/dist/scaffolders/library.js +122 -0
- package/dist/scaffolders/library.js.map +1 -0
- package/dist/scaffolders/nextjs.d.ts +10 -0
- package/dist/scaffolders/nextjs.d.ts.map +1 -0
- package/dist/scaffolders/nextjs.js +395 -0
- package/dist/scaffolders/nextjs.js.map +1 -0
- package/dist/scaffolders/protocol-repo.d.ts +4 -0
- package/dist/scaffolders/protocol-repo.d.ts.map +1 -0
- package/dist/scaffolders/protocol-repo.js +162 -0
- package/dist/scaffolders/protocol-repo.js.map +1 -0
- package/dist/scaffolders/python-service.d.ts +4 -0
- package/dist/scaffolders/python-service.d.ts.map +1 -0
- package/dist/scaffolders/python-service.js +144 -0
- package/dist/scaffolders/python-service.js.map +1 -0
- package/dist/scaffolders/wp-plugin.d.ts +4 -0
- package/dist/scaffolders/wp-plugin.d.ts.map +1 -0
- package/dist/scaffolders/wp-plugin.js +268 -0
- package/dist/scaffolders/wp-plugin.js.map +1 -0
- package/dist/standards.d.ts +65 -0
- package/dist/standards.d.ts.map +1 -0
- package/dist/standards.js +335 -0
- package/dist/standards.js.map +1 -0
- package/dist/substitute.d.ts +37 -0
- package/dist/substitute.d.ts.map +1 -0
- package/dist/substitute.js +98 -0
- package/dist/substitute.js.map +1 -0
- package/dist/summary.d.ts +20 -0
- package/dist/summary.d.ts.map +1 -0
- package/dist/summary.js +191 -0
- package/dist/summary.js.map +1 -0
- package/dist/templates.d.ts +30 -0
- package/dist/templates.d.ts.map +1 -0
- package/dist/templates.js +123 -0
- package/dist/templates.js.map +1 -0
- package/dist/wizard.d.ts +12 -0
- package/dist/wizard.d.ts.map +1 -0
- package/dist/wizard.js +158 -0
- package/dist/wizard.js.map +1 -0
- package/dist/writer.d.ts +62 -0
- package/dist/writer.d.ts.map +1 -0
- package/dist/writer.js +367 -0
- package/dist/writer.js.map +1 -0
- package/package.json +72 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// Scaffolder: `cf-worker` — Cloudflare Worker (no public HTML).
|
|
2
|
+
//
|
|
3
|
+
// Wrangler-config-driven Worker with a DB-free `/health` route. Not subject
|
|
4
|
+
// to the SEO baseline (no indexable HTML surface). Compatibility date pinned
|
|
5
|
+
// to {{date}} so scaffolded projects start on the user's scaffold day, not
|
|
6
|
+
// some hardcoded past day.
|
|
7
|
+
import { commonBaseFiles, resolveBrandSpec, sub, } from "./common.js";
|
|
8
|
+
const NARRATIVE = `## What this is
|
|
9
|
+
|
|
10
|
+
\`{{slug}}\` is a Cloudflare Worker scaffolded under the {{brand_name}} brand. The Worker has no public HTML surface — it's an API / edge handler.
|
|
11
|
+
|
|
12
|
+
**Quick start for contributors:**
|
|
13
|
+
|
|
14
|
+
\`\`\`bash
|
|
15
|
+
npm install
|
|
16
|
+
npx wrangler dev # local dev server at http://localhost:8787
|
|
17
|
+
npx wrangler deploy # deploy to Cloudflare
|
|
18
|
+
\`\`\`
|
|
19
|
+
|
|
20
|
+
**Health endpoint:** \`GET /health\` returns \`{ "status": "ok" }\`. **Do NOT** make this endpoint touch the database — even on Neon-careful projects (per [[neon-postgres]]).
|
|
21
|
+
|
|
22
|
+
**Secrets:** local secrets live in \`.dev.vars\` (gitignored). Production secrets via \`wrangler secret put\`.
|
|
23
|
+
|
|
24
|
+
**Observability:** enabled in \`wrangler.jsonc\`.
|
|
25
|
+
`;
|
|
26
|
+
const WRANGLER_TEMPLATE = `{
|
|
27
|
+
"$schema": "node_modules/wrangler/config-schema.json",
|
|
28
|
+
"name": "{{slug}}",
|
|
29
|
+
"main": "src/index.ts",
|
|
30
|
+
"compatibility_date": "{{date}}",
|
|
31
|
+
"compatibility_flags": ["nodejs_compat"],
|
|
32
|
+
"observability": {
|
|
33
|
+
"enabled": true
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
const SRC_INDEX_TEMPLATE = `// {{slug}} — Cloudflare Worker entry.
|
|
38
|
+
//
|
|
39
|
+
// {{description}}
|
|
40
|
+
|
|
41
|
+
export interface Env {
|
|
42
|
+
// Add bindings here as the Worker grows.
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default {
|
|
46
|
+
async fetch(request: Request, _env: Env, _ctx: ExecutionContext): Promise<Response> {
|
|
47
|
+
const url = new URL(request.url);
|
|
48
|
+
|
|
49
|
+
if (url.pathname === "/health") {
|
|
50
|
+
// DB-free health endpoint — do NOT add a DB roundtrip here.
|
|
51
|
+
return Response.json({ status: "ok" });
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return new Response("Not Found", { status: 404 });
|
|
55
|
+
},
|
|
56
|
+
} satisfies ExportedHandler<Env>;
|
|
57
|
+
`;
|
|
58
|
+
const PACKAGE_JSON_TEMPLATE = `{
|
|
59
|
+
"name": "{{slug}}",
|
|
60
|
+
"version": "{{version}}",
|
|
61
|
+
"description": "{{description}}",
|
|
62
|
+
"private": true,
|
|
63
|
+
"type": "module",
|
|
64
|
+
"scripts": {
|
|
65
|
+
"dev": "wrangler dev",
|
|
66
|
+
"deploy": "wrangler deploy",
|
|
67
|
+
"typecheck": "tsc --noEmit"
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"@cloudflare/workers-types": "^4.20240620.0",
|
|
71
|
+
"typescript": "^5.4.0",
|
|
72
|
+
"wrangler": "^3.60.0"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
`;
|
|
76
|
+
const TSCONFIG_TEMPLATE = `{
|
|
77
|
+
"compilerOptions": {
|
|
78
|
+
"target": "ES2022",
|
|
79
|
+
"module": "ESNext",
|
|
80
|
+
"moduleResolution": "Bundler",
|
|
81
|
+
"lib": ["ES2022"],
|
|
82
|
+
"types": ["@cloudflare/workers-types"],
|
|
83
|
+
"strict": true,
|
|
84
|
+
"esModuleInterop": true,
|
|
85
|
+
"skipLibCheck": true,
|
|
86
|
+
"forceConsistentCasingInFileNames": true,
|
|
87
|
+
"noEmit": true,
|
|
88
|
+
"resolveJsonModule": true
|
|
89
|
+
},
|
|
90
|
+
"include": ["src/**/*"],
|
|
91
|
+
"exclude": ["node_modules"]
|
|
92
|
+
}
|
|
93
|
+
`;
|
|
94
|
+
const DEV_VARS_TEMPLATE = `# Local development secrets for {{slug}} (gitignored).
|
|
95
|
+
# Production secrets: \`wrangler secret put <NAME>\`.
|
|
96
|
+
#
|
|
97
|
+
# Example:
|
|
98
|
+
# MY_API_KEY="sk_test_..."
|
|
99
|
+
`;
|
|
100
|
+
export function scaffoldCfWorker(inputs, opts) {
|
|
101
|
+
const spec = resolveBrandSpec(inputs);
|
|
102
|
+
const base = commonBaseFiles(inputs, opts, NARRATIVE);
|
|
103
|
+
const typeSpecific = [
|
|
104
|
+
{ path: "wrangler.jsonc", content: sub(WRANGLER_TEMPLATE, inputs, opts, spec) },
|
|
105
|
+
{ path: "src/index.ts", content: sub(SRC_INDEX_TEMPLATE, inputs, opts, spec) },
|
|
106
|
+
{ path: "package.json", content: sub(PACKAGE_JSON_TEMPLATE, inputs, opts, spec) },
|
|
107
|
+
{ path: "tsconfig.json", content: sub(TSCONFIG_TEMPLATE, inputs, opts, spec) },
|
|
108
|
+
{ path: ".dev.vars", content: sub(DEV_VARS_TEMPLATE, inputs, opts, spec) },
|
|
109
|
+
];
|
|
110
|
+
return [...base, ...typeSpecific];
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=cf-worker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cf-worker.js","sourceRoot":"","sources":["../../src/scaffolders/cf-worker.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,EAAE;AACF,4EAA4E;AAC5E,6EAA6E;AAC7E,2EAA2E;AAC3E,2BAA2B;AAI3B,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,GAAG,GAGJ,MAAM,aAAa,CAAC;AAErB,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;CAiBjB,CAAC;AAEF,MAAM,iBAAiB,GAAG;;;;;;;;;;CAUzB,CAAC;AAEF,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;CAoB1B,CAAC;AAEF,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;CAiB7B,CAAC;AAEF,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;CAiBzB,CAAC;AAEF,MAAM,iBAAiB,GAAG;;;;;CAKzB,CAAC;AAEF,MAAM,UAAU,gBAAgB,CAC9B,MAAsB,EACtB,IAAwB;IAExB,MAAM,IAAI,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACtC,MAAM,IAAI,GAAG,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;IACtD,MAAM,YAAY,GAAmB;QACnC,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,GAAG,CAAC,iBAAiB,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;QAC/E,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,CAAC,kBAAkB,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;QAC9E,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,CAAC,qBAAqB,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;QACjF,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,CAAC,iBAAiB,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;QAC9E,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,CAAC,iBAAiB,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;KAC3E,CAAC;IACF,OAAO,CAAC,GAAG,IAAI,EAAE,GAAG,YAAY,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { BrandPresetSpec } from "../brand.js";
|
|
2
|
+
import type { ScaffoldInputs } from "../index.js";
|
|
3
|
+
import { type SubstitutionOptions } from "../substitute.js";
|
|
4
|
+
export interface ScaffoldFile {
|
|
5
|
+
path: string;
|
|
6
|
+
content: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ScaffolderOptions extends SubstitutionOptions {
|
|
9
|
+
}
|
|
10
|
+
export declare const STANDARDS_BLOCK_MARKER = "<!-- STANDARDS_BLOCK -->";
|
|
11
|
+
export declare const AGENTS_BODY_MARKER = "<!-- AGENTS_BODY -->";
|
|
12
|
+
export declare function resolveBrandSpec(inputs: ScaffoldInputs): BrandPresetSpec;
|
|
13
|
+
export declare function sub(template: string, inputs: ScaffoldInputs, opts: ScaffolderOptions | undefined, spec: BrandPresetSpec): string;
|
|
14
|
+
export declare function buildClaudeMd(inputs: ScaffoldInputs, opts: ScaffolderOptions | undefined, spec: BrandPresetSpec, perTypeNarrative: string): ScaffoldFile;
|
|
15
|
+
export declare function commonReadme(inputs: ScaffoldInputs, opts: ScaffolderOptions | undefined, spec: BrandPresetSpec): ScaffoldFile;
|
|
16
|
+
export declare function commonRoadmap(inputs: ScaffoldInputs, opts: ScaffolderOptions | undefined, spec: BrandPresetSpec): ScaffoldFile;
|
|
17
|
+
export declare function commonStatus(inputs: ScaffoldInputs, opts: ScaffolderOptions | undefined, spec: BrandPresetSpec): ScaffoldFile;
|
|
18
|
+
export declare function commonHandoff(inputs: ScaffoldInputs, opts: ScaffolderOptions | undefined, spec: BrandPresetSpec): ScaffoldFile;
|
|
19
|
+
export declare function commonTroubleshooting(inputs: ScaffoldInputs, opts: ScaffolderOptions | undefined, spec: BrandPresetSpec): ScaffoldFile;
|
|
20
|
+
export declare function commonChangelog(inputs: ScaffoldInputs, opts: ScaffolderOptions | undefined, spec: BrandPresetSpec): ScaffoldFile;
|
|
21
|
+
export declare function commonVersion(): ScaffoldFile;
|
|
22
|
+
export declare function commonCursorignore(): ScaffoldFile;
|
|
23
|
+
export declare function commonDirective(inputs: ScaffoldInputs, opts: ScaffolderOptions | undefined, spec: BrandPresetSpec): ScaffoldFile;
|
|
24
|
+
/**
|
|
25
|
+
* Per-type `.gitignore` body. Sources: skill's "Inline mini-templates"
|
|
26
|
+
* section. Each variant is the verbatim block from there.
|
|
27
|
+
*/
|
|
28
|
+
export declare function gitignoreFor(projectType: ScaffoldInputs["projectType"]): ScaffoldFile;
|
|
29
|
+
/**
|
|
30
|
+
* Common base files every scaffolded project gets — CLAUDE.md, README.md,
|
|
31
|
+
* ROADMAP.md, STATUS.md, HANDOFF.md, TROUBLESHOOTING.md, CHANGELOG.md,
|
|
32
|
+
* VERSION, .cursorignore, .gitignore, directives/system-architecture.md.
|
|
33
|
+
*
|
|
34
|
+
* Callers pass in the per-type CLAUDE.md narrative chunk; everything else is
|
|
35
|
+
* generic across project types. Type-specific files (package.json, wrangler,
|
|
36
|
+
* etc.) are appended by the per-type scaffolder.
|
|
37
|
+
*/
|
|
38
|
+
export declare function commonBaseFiles(inputs: ScaffoldInputs, opts: ScaffolderOptions | undefined, perTypeNarrative: string): ScaffoldFile[];
|
|
39
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/scaffolders/common.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAsB,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEhF,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAkB,SAAQ,mBAAmB;CAK7D;AAED,eAAO,MAAM,sBAAsB,6BAA6B,CAAC;AACjE,eAAO,MAAM,kBAAkB,yBAAyB,CAAC;AAEzD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,cAAc,GAAG,eAAe,CAExE;AAED,wBAAgB,GAAG,CACjB,QAAQ,EAAE,MAAM,EAChB,M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gB,YAAY,CAAC,WAAW,EAAE,cAAc,CAAC,aAAa,CAAC,GAAG,YAAY,CAwDrF;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,iBAAiB,GAAG,SAAS,EACnC,gBAAgB,EAAE,MAAM,GACvB,YAAY,EAAE,CAehB"}
|
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
// Shared scaffolder helpers.
|
|
2
|
+
//
|
|
3
|
+
// Each function returns a single ScaffoldFile (or the body of one) so the
|
|
4
|
+
// per-type scaffolders can compose the file list they want. Inline templates
|
|
5
|
+
// here mirror the [[instantiate-z2w-project]] skill's "Inline mini-templates"
|
|
6
|
+
// section, with substitutions applied via {@link applySubstitutions}.
|
|
7
|
+
//
|
|
8
|
+
// CLAUDE.md uses two marker comments for layering by later ROADMAP steps:
|
|
9
|
+
// - `<!-- STANDARDS_BLOCK -->` is replaced by Step 5 (standards resolver).
|
|
10
|
+
// - `<!-- AGENTS_BODY -->` is replaced by Step 6 (writer) with the
|
|
11
|
+
// canonical AGENTS body read from `~/Desktop/Zero2Webmaster/AI/Templates/`.
|
|
12
|
+
// Step 4 scaffolders emit the markers verbatim so they're easy to grep and
|
|
13
|
+
// trivially testable without a Templates dependency.
|
|
14
|
+
import { getBrandSpec, renderBrandBlock } from "../brand.js";
|
|
15
|
+
import { applySubstitutions } from "../substitute.js";
|
|
16
|
+
export const STANDARDS_BLOCK_MARKER = "<!-- STANDARDS_BLOCK -->";
|
|
17
|
+
export const AGENTS_BODY_MARKER = "<!-- AGENTS_BODY -->";
|
|
18
|
+
export function resolveBrandSpec(inputs) {
|
|
19
|
+
return getBrandSpec(inputs.brand, inputs.customBrand, inputs.githubOrg);
|
|
20
|
+
}
|
|
21
|
+
export function sub(template, inputs, opts, spec) {
|
|
22
|
+
return applySubstitutions(template, inputs, { ...opts, brandSpec: spec });
|
|
23
|
+
}
|
|
24
|
+
const README_TEMPLATE = `# {{slug}}
|
|
25
|
+
|
|
26
|
+
**Version:** {{version}} | **Framework:** {{framework_version}}
|
|
27
|
+
|
|
28
|
+
> {{description}}
|
|
29
|
+
|
|
30
|
+
**Brand:** {{brand_name}}
|
|
31
|
+
|
|
32
|
+
## Overview
|
|
33
|
+
|
|
34
|
+
[1-2 paragraph project description — fill in after scaffold]
|
|
35
|
+
|
|
36
|
+
## Quick start
|
|
37
|
+
|
|
38
|
+
[Per project type — fill in after scaffold]
|
|
39
|
+
|
|
40
|
+
## License
|
|
41
|
+
|
|
42
|
+
Proprietary — © {{year}} {{author}}, Zero2Webmaster. All rights reserved.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
*Scaffolded {{date}} via [[instantiate-z2w-project]] v1 — mirrored by \`@zero2webmaster/starter-kit\`.*
|
|
47
|
+
`;
|
|
48
|
+
const TROUBLESHOOTING_TEMPLATE = `# Troubleshooting
|
|
49
|
+
|
|
50
|
+
Living document for {{slug}}. Add an entry whenever a problem takes >15 minutes to solve.
|
|
51
|
+
|
|
52
|
+
## Entry template
|
|
53
|
+
|
|
54
|
+
### [Date] — Brief problem description
|
|
55
|
+
|
|
56
|
+
**Symptom:** What was observed.
|
|
57
|
+
|
|
58
|
+
**Root cause:** What was actually wrong.
|
|
59
|
+
|
|
60
|
+
**Fix:** What change resolved it.
|
|
61
|
+
|
|
62
|
+
**Prevention:** What to check next time / what convention this becomes.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Entries
|
|
67
|
+
|
|
68
|
+
*(none yet)*
|
|
69
|
+
`;
|
|
70
|
+
const CHANGELOG_TEMPLATE = `# Changelog
|
|
71
|
+
|
|
72
|
+
All notable changes to {{slug}}.
|
|
73
|
+
|
|
74
|
+
Format: [Semantic Versioning](https://semver.org/).
|
|
75
|
+
|
|
76
|
+
## [{{version}}] — {{date}}
|
|
77
|
+
|
|
78
|
+
### Added
|
|
79
|
+
- Initial scaffold via \`@zero2webmaster/starter-kit\` (mirrors [[instantiate-z2w-project]]).
|
|
80
|
+
- Brand: {{brand_name}}.
|
|
81
|
+
`;
|
|
82
|
+
const ROADMAP_TEMPLATE = `# Project Roadmap
|
|
83
|
+
|
|
84
|
+
**Project:** {{slug}}
|
|
85
|
+
**Goal:** {{description}}
|
|
86
|
+
**Created:** {{date}}
|
|
87
|
+
**Last Updated:** {{date}}
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Overview
|
|
92
|
+
|
|
93
|
+
This roadmap breaks the v{{version}} ship into atomic, testable steps. Each step should be completable in a single focused chat session.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Step 1: First milestone (placeholder)
|
|
98
|
+
|
|
99
|
+
**Goal:** Replace this with your first concrete deliverable.
|
|
100
|
+
|
|
101
|
+
**Tasks:**
|
|
102
|
+
- [ ] [Task 1]
|
|
103
|
+
|
|
104
|
+
**Verification:**
|
|
105
|
+
- [ ] [How will you know it's done?]
|
|
106
|
+
|
|
107
|
+
**Status:** 📋 Pending
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Status Indicators
|
|
112
|
+
|
|
113
|
+
- 📋 **Pending** - Not started yet
|
|
114
|
+
- ⏳ **In Progress** - Currently working on
|
|
115
|
+
- ✅ **Complete** - Verified and working
|
|
116
|
+
- 🚫 **Blocked** - Cannot proceed (see STATUS.md for details)
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
*This roadmap is a living document. Update it as the project evolves.*
|
|
121
|
+
`;
|
|
122
|
+
const STATUS_TEMPLATE = `# Project Status
|
|
123
|
+
|
|
124
|
+
**Project:** {{slug}}
|
|
125
|
+
**Last Updated:** {{date}}
|
|
126
|
+
**Current Step:** Step 0 — initial scaffold landed.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## 🚫 Blockers
|
|
131
|
+
|
|
132
|
+
*(none)*
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## 🧭 Decisions
|
|
137
|
+
|
|
138
|
+
*(none yet — record decisions here as the project evolves)*
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## ✅ Next Actions
|
|
143
|
+
|
|
144
|
+
1. ⏳ Replace this scaffold's placeholder content with project-specific details.
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## 🔧 Tech Debt
|
|
149
|
+
|
|
150
|
+
*(none yet)*
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## 📊 Quick Stats
|
|
155
|
+
|
|
156
|
+
- **ROADMAP Steps:** 0 of 1 complete (0%)
|
|
157
|
+
- **Tests Passing:** n/a
|
|
158
|
+
- **Build Status:** n/a
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## 🔄 Recent Updates
|
|
163
|
+
|
|
164
|
+
### {{date}}
|
|
165
|
+
- Initial scaffold via \`@zero2webmaster/starter-kit\`.
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
*This status file provides quick context for resuming work after breaks. Keep it concise and action-oriented.*
|
|
170
|
+
`;
|
|
171
|
+
const HANDOFF_TEMPLATE = `# Session Handoff Document
|
|
172
|
+
|
|
173
|
+
**Project:** {{slug}}
|
|
174
|
+
**Session Date:** {{date}}
|
|
175
|
+
**Branch:** \`main\`
|
|
176
|
+
**Version:** {{version}} | Framework {{framework_version}}
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## State
|
|
181
|
+
|
|
182
|
+
Initial scaffold complete. No application code yet.
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## 📚 Reading Order for Next Agent
|
|
187
|
+
|
|
188
|
+
1. **This file (HANDOFF.md)** — current state
|
|
189
|
+
2. **[STATUS.md](STATUS.md)** — decisions, next actions, recent updates
|
|
190
|
+
3. **[ROADMAP.md](ROADMAP.md)** — atomic steps to v{{version}}
|
|
191
|
+
4. **[CLAUDE.md](CLAUDE.md)** — operating rules
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## 🚀 Starting Prompt for Next Session
|
|
196
|
+
|
|
197
|
+
\`\`\`
|
|
198
|
+
I'm picking up {{slug}}. Read HANDOFF.md, STATUS.md, ROADMAP.md, then begin
|
|
199
|
+
ROADMAP Step 1.
|
|
200
|
+
\`\`\`
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
**Handoff Status:** ✅ CLEAN
|
|
205
|
+
**Ready for Next Session:** ✅ YES
|
|
206
|
+
`;
|
|
207
|
+
const CURSORIGNORE_TEMPLATE = `# Files Cursor should ignore (per project type).
|
|
208
|
+
.DS_Store
|
|
209
|
+
.tmp/
|
|
210
|
+
node_modules/
|
|
211
|
+
dist/
|
|
212
|
+
.next/
|
|
213
|
+
.wrangler/
|
|
214
|
+
.venv/
|
|
215
|
+
venv/
|
|
216
|
+
__pycache__/
|
|
217
|
+
*.pyc
|
|
218
|
+
*.zip
|
|
219
|
+
.specstory/
|
|
220
|
+
.vscode/
|
|
221
|
+
.cursorindexingignore
|
|
222
|
+
`;
|
|
223
|
+
const DIRECTIVE_TEMPLATE = `# System Architecture — {{slug}}
|
|
224
|
+
|
|
225
|
+
**Version:** {{version}} | **Last updated:** {{date}}
|
|
226
|
+
|
|
227
|
+
This document describes the 3-layer architecture for {{slug}} per the Z2W canonical AGENTS contract. Fill in concrete details as the project takes shape.
|
|
228
|
+
|
|
229
|
+
## Layer 1: Directive (What to do)
|
|
230
|
+
|
|
231
|
+
SOPs live in \`directives/\`. Currently:
|
|
232
|
+
|
|
233
|
+
- \`system-architecture.md\` (this file)
|
|
234
|
+
|
|
235
|
+
## Layer 2: Orchestration (Decision making)
|
|
236
|
+
|
|
237
|
+
[Describe how the orchestration layer routes work for this project. For a web app this is your route handlers / page components. For a WP plugin this is your module loader. For a CLI this is your command dispatcher.]
|
|
238
|
+
|
|
239
|
+
## Layer 3: Execution (Doing the work)
|
|
240
|
+
|
|
241
|
+
[Describe the deterministic execution layer for this project. For a web app this is your data-access functions, API clients, etc. For a WP plugin this is the WP API + WC API calls. For a CLI this is the filesystem / shell calls.]
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
*Generated {{date}} via \`@zero2webmaster/starter-kit\`.*
|
|
246
|
+
`;
|
|
247
|
+
const PROJECT_NARRATIVE_PLACEHOLDER = `## What this repo is
|
|
248
|
+
|
|
249
|
+
> [TODO — fill in a 1-2 paragraph project description after scaffold.]
|
|
250
|
+
|
|
251
|
+
This project was scaffolded via \`@zero2webmaster/starter-kit\` on {{date}}. Read the [README.md](README.md) for the user-facing overview, [ROADMAP.md](ROADMAP.md) for the atomic build steps, and [STATUS.md](STATUS.md) for the current state.
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
## Operating Principles
|
|
256
|
+
|
|
257
|
+
**1. Verify dates from the OS, not from training data.** Use \`new Date()\` (JS/TS), \`datetime.now(timezone.utc)\` (Python), or \`date('Y-m-d')\` (PHP). Convert any user-provided relative dates ("next Thursday") to absolute YYYY-MM-DD before writing.
|
|
258
|
+
|
|
259
|
+
**2. Focus on ONE primary goal per chat session.** When multiple things compete for attention, finish the one already in flight before starting the next.
|
|
260
|
+
|
|
261
|
+
**3. Side-effectful commands are opt-in only.** Don't run \`git init\`, \`gh repo create\`, package installs, or migrations without explicit user instruction.
|
|
262
|
+
|
|
263
|
+
**4. Validate inputs aggressively.** Don't trust user-supplied strings without normalizing slugs, paths, and identifiers.
|
|
264
|
+
|
|
265
|
+
**5. Self-anneal.** When something breaks, fix it AND update the relevant directive so the same break never happens twice.
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
`;
|
|
269
|
+
export function buildClaudeMd(inputs, opts, spec, perTypeNarrative) {
|
|
270
|
+
const brandBlock = renderBrandBlock(spec).trimEnd();
|
|
271
|
+
const template = `# Agent Instructions — {{slug}}
|
|
272
|
+
|
|
273
|
+
**Project Version:** {{version}} | **Framework:** {{framework_version}} | **Last Updated:** {{date}}
|
|
274
|
+
|
|
275
|
+
> Scaffolded {{date}} via \`@zero2webmaster/starter-kit\` (mirrors [[instantiate-z2w-project]]).
|
|
276
|
+
> CLAUDE.md is the source-of-truth file for this project. If \`AGENTS.md\` or \`GEMINI.md\` exist in the same directory, mirror changes to them; do not create them just to hold this content.
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
${brandBlock}
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
${perTypeNarrative.trim()}
|
|
285
|
+
|
|
286
|
+
${PROJECT_NARRATIVE_PLACEHOLDER.trim()}
|
|
287
|
+
|
|
288
|
+
## Standards block
|
|
289
|
+
|
|
290
|
+
${STANDARDS_BLOCK_MARKER}
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
## Generic AGENTS — 3-layer system reference
|
|
295
|
+
|
|
296
|
+
The canonical AGENTS body for framework v{{framework_version}} is embedded below by the writer at scaffold time. The project-specific guidance above takes precedence on conflict.
|
|
297
|
+
|
|
298
|
+
${AGENTS_BODY_MARKER}
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
*Scaffolded {{date}} via \`@zero2webmaster/starter-kit\` (mirrors [[instantiate-z2w-project]] v1).*
|
|
303
|
+
*Version: {{version}} | Framework: {{framework_version}} | Last Updated: {{date}}*
|
|
304
|
+
`;
|
|
305
|
+
return {
|
|
306
|
+
path: "CLAUDE.md",
|
|
307
|
+
content: sub(template, inputs, opts, spec),
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
export function commonReadme(inputs, opts, spec) {
|
|
311
|
+
return { path: "README.md", content: sub(README_TEMPLATE, inputs, opts, spec) };
|
|
312
|
+
}
|
|
313
|
+
export function commonRoadmap(inputs, opts, spec) {
|
|
314
|
+
return {
|
|
315
|
+
path: "ROADMAP.md",
|
|
316
|
+
content: sub(ROADMAP_TEMPLATE, inputs, opts, spec),
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
export function commonStatus(inputs, opts, spec) {
|
|
320
|
+
return {
|
|
321
|
+
path: "STATUS.md",
|
|
322
|
+
content: sub(STATUS_TEMPLATE, inputs, opts, spec),
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
export function commonHandoff(inputs, opts, spec) {
|
|
326
|
+
return {
|
|
327
|
+
path: "HANDOFF.md",
|
|
328
|
+
content: sub(HANDOFF_TEMPLATE, inputs, opts, spec),
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
export function commonTroubleshooting(inputs, opts, spec) {
|
|
332
|
+
return {
|
|
333
|
+
path: "TROUBLESHOOTING.md",
|
|
334
|
+
content: sub(TROUBLESHOOTING_TEMPLATE, inputs, opts, spec),
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
export function commonChangelog(inputs, opts, spec) {
|
|
338
|
+
return {
|
|
339
|
+
path: "CHANGELOG.md",
|
|
340
|
+
content: sub(CHANGELOG_TEMPLATE, inputs, opts, spec),
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
export function commonVersion() {
|
|
344
|
+
return { path: "VERSION", content: "0.1.0\n" };
|
|
345
|
+
}
|
|
346
|
+
export function commonCursorignore() {
|
|
347
|
+
return { path: ".cursorignore", content: CURSORIGNORE_TEMPLATE };
|
|
348
|
+
}
|
|
349
|
+
export function commonDirective(inputs, opts, spec) {
|
|
350
|
+
return {
|
|
351
|
+
path: "directives/system-architecture.md",
|
|
352
|
+
content: sub(DIRECTIVE_TEMPLATE, inputs, opts, spec),
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Per-type `.gitignore` body. Sources: skill's "Inline mini-templates"
|
|
357
|
+
* section. Each variant is the verbatim block from there.
|
|
358
|
+
*/
|
|
359
|
+
export function gitignoreFor(projectType) {
|
|
360
|
+
const base = {
|
|
361
|
+
"wp-plugin": `.DS_Store
|
|
362
|
+
.tmp/
|
|
363
|
+
*.zip
|
|
364
|
+
node_modules/
|
|
365
|
+
vendor/
|
|
366
|
+
.env
|
|
367
|
+
.env.local
|
|
368
|
+
`,
|
|
369
|
+
"cf-worker": `.DS_Store
|
|
370
|
+
node_modules/
|
|
371
|
+
.wrangler/
|
|
372
|
+
dist/
|
|
373
|
+
.dev.vars
|
|
374
|
+
.env
|
|
375
|
+
.env.local
|
|
376
|
+
`,
|
|
377
|
+
"cf-pages": `.DS_Store
|
|
378
|
+
node_modules/
|
|
379
|
+
.wrangler/
|
|
380
|
+
dist/
|
|
381
|
+
.dev.vars
|
|
382
|
+
.env
|
|
383
|
+
.env.local
|
|
384
|
+
`,
|
|
385
|
+
nextjs: `.DS_Store
|
|
386
|
+
node_modules/
|
|
387
|
+
.next/
|
|
388
|
+
out/
|
|
389
|
+
.env
|
|
390
|
+
.env.local
|
|
391
|
+
.env*.local
|
|
392
|
+
`,
|
|
393
|
+
"python-service": `.DS_Store
|
|
394
|
+
__pycache__/
|
|
395
|
+
*.pyc
|
|
396
|
+
.venv/
|
|
397
|
+
venv/
|
|
398
|
+
.env
|
|
399
|
+
dist/
|
|
400
|
+
build/
|
|
401
|
+
*.egg-info/
|
|
402
|
+
`,
|
|
403
|
+
library: `.DS_Store
|
|
404
|
+
node_modules/
|
|
405
|
+
dist/
|
|
406
|
+
.env
|
|
407
|
+
`,
|
|
408
|
+
"protocol-repo": `.DS_Store
|
|
409
|
+
.tmp/
|
|
410
|
+
.env
|
|
411
|
+
node_modules/
|
|
412
|
+
`,
|
|
413
|
+
}[projectType];
|
|
414
|
+
return { path: ".gitignore", content: base };
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Common base files every scaffolded project gets — CLAUDE.md, README.md,
|
|
418
|
+
* ROADMAP.md, STATUS.md, HANDOFF.md, TROUBLESHOOTING.md, CHANGELOG.md,
|
|
419
|
+
* VERSION, .cursorignore, .gitignore, directives/system-architecture.md.
|
|
420
|
+
*
|
|
421
|
+
* Callers pass in the per-type CLAUDE.md narrative chunk; everything else is
|
|
422
|
+
* generic across project types. Type-specific files (package.json, wrangler,
|
|
423
|
+
* etc.) are appended by the per-type scaffolder.
|
|
424
|
+
*/
|
|
425
|
+
export function commonBaseFiles(inputs, opts, perTypeNarrative) {
|
|
426
|
+
const spec = resolveBrandSpec(inputs);
|
|
427
|
+
return [
|
|
428
|
+
buildClaudeMd(inputs, opts, spec, perTypeNarrative),
|
|
429
|
+
commonReadme(inputs, opts, spec),
|
|
430
|
+
commonRoadmap(inputs, opts, spec),
|
|
431
|
+
commonStatus(inputs, opts, spec),
|
|
432
|
+
commonHandoff(inputs, opts, spec),
|
|
433
|
+
commonTroubleshooting(inputs, opts, spec),
|
|
434
|
+
commonChangelog(inputs, opts, spec),
|
|
435
|
+
commonVersion(),
|
|
436
|
+
commonCursorignore(),
|
|
437
|
+
gitignoreFor(inputs.projectType),
|
|
438
|
+
commonDirective(inputs, opts, spec),
|
|
439
|
+
];
|
|
440
|
+
}
|
|
441
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/scaffolders/common.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,EAAE;AACF,0EAA0E;AAC1E,6EAA6E;AAC7E,8EAA8E;AAC9E,sEAAsE;AACtE,EAAE;AACF,0EAA0E;AAC1E,6EAA6E;AAC7E,yEAAyE;AACzE,gFAAgF;AAChF,2EAA2E;AAC3E,qDAAqD;AAGrD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE7D,OAAO,EAAE,kBAAkB,EAA4B,MAAM,kBAAkB,CAAC;AAchF,MAAM,CAAC,MAAM,sBAAsB,GAAG,0BAA0B,CAAC;AACjE,MAAM,CAAC,MAAM,kBAAkB,GAAG,sBAAsB,CAAC;AAEzD,MAAM,UAAU,gBAAgB,CAAC,MAAsB;IACrD,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Y,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC;QAChC,aAAa,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC;QACjC,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC;QAChC,aAAa,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC;QACjC,qBAAqB,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC;QACzC,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC;QACnC,aAAa,EAAE;QACf,kBAAkB,EAAE;QACpB,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC;QAChC,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC;KACpC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ScaffoldInputs } from "../index.js";
|
|
2
|
+
export type { ScaffoldFile, ScaffolderOptions } from "./common.js";
|
|
3
|
+
export { scaffoldCfPages } from "./cf-pages.js";
|
|
4
|
+
export { scaffoldCfWorker } from "./cf-worker.js";
|
|
5
|
+
export { scaffoldLibrary } from "./library.js";
|
|
6
|
+
export { scaffoldNextjs, NEXTJS_SEO_BASELINE_PATHS } from "./nextjs.js";
|
|
7
|
+
export { scaffoldProtocolRepo } from "./protocol-repo.js";
|
|
8
|
+
export { scaffoldPythonService } from "./python-service.js";
|
|
9
|
+
export { scaffoldWpPlugin } from "./wp-plugin.js";
|
|
10
|
+
export { CF_PAGES_SEO_BASELINE_PATHS } from "./cf-pages.js";
|
|
11
|
+
import type { ScaffoldFile, ScaffolderOptions } from "./common.js";
|
|
12
|
+
/**
|
|
13
|
+
* Dispatch to the per-type scaffolder. Single entry point used by the CLI's
|
|
14
|
+
* scaffold pipeline (Step 6 writer); kept side-effect-free so tests can
|
|
15
|
+
* snapshot the full file list per project type without any FS dependency.
|
|
16
|
+
*/
|
|
17
|
+
export declare function scaffoldByType(inputs: ScaffoldInputs, opts?: ScaffolderOptions): ScaffoldFile[];
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scaffolders/index.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,aAAa,CAAC;AAU/D,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAE5D,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEnE;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,cAAc,EACtB,IAAI,CAAC,EAAE,iBAAiB,GACvB,YAAY,EAAE,CAchB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Per-type scaffolder dispatcher.
|
|
2
|
+
//
|
|
3
|
+
// Each scaffolder is a pure function over {@link ScaffoldInputs} that returns
|
|
4
|
+
// the full file list for that project type as `Array<{ path; content }>`.
|
|
5
|
+
// Used by the writer (ROADMAP Step 6) which performs the actual filesystem
|
|
6
|
+
// writes; pure-functional today so Step 4 tests can snapshot output without
|
|
7
|
+
// any FS dependency.
|
|
8
|
+
import { scaffoldCfPages } from "./cf-pages.js";
|
|
9
|
+
import { scaffoldCfWorker } from "./cf-worker.js";
|
|
10
|
+
import { scaffoldLibrary } from "./library.js";
|
|
11
|
+
import { scaffoldNextjs } from "./nextjs.js";
|
|
12
|
+
import { scaffoldProtocolRepo } from "./protocol-repo.js";
|
|
13
|
+
import { scaffoldPythonService } from "./python-service.js";
|
|
14
|
+
import { scaffoldWpPlugin } from "./wp-plugin.js";
|
|
15
|
+
export { scaffoldCfPages } from "./cf-pages.js";
|
|
16
|
+
export { scaffoldCfWorker } from "./cf-worker.js";
|
|
17
|
+
export { scaffoldLibrary } from "./library.js";
|
|
18
|
+
export { scaffoldNextjs, NEXTJS_SEO_BASELINE_PATHS } from "./nextjs.js";
|
|
19
|
+
export { scaffoldProtocolRepo } from "./protocol-repo.js";
|
|
20
|
+
export { scaffoldPythonService } from "./python-service.js";
|
|
21
|
+
export { scaffoldWpPlugin } from "./wp-plugin.js";
|
|
22
|
+
export { CF_PAGES_SEO_BASELINE_PATHS } from "./cf-pages.js";
|
|
23
|
+
/**
|
|
24
|
+
* Dispatch to the per-type scaffolder. Single entry point used by the CLI's
|
|
25
|
+
* scaffold pipeline (Step 6 writer); kept side-effect-free so tests can
|
|
26
|
+
* snapshot the full file list per project type without any FS dependency.
|
|
27
|
+
*/
|
|
28
|
+
export function scaffoldByType(inputs, opts) {
|
|
29
|
+
const dispatch = {
|
|
30
|
+
library: scaffoldLibrary,
|
|
31
|
+
"cf-worker": scaffoldCfWorker,
|
|
32
|
+
nextjs: scaffoldNextjs,
|
|
33
|
+
"cf-pages": scaffoldCfPages,
|
|
34
|
+
"python-service": scaffoldPythonService,
|
|
35
|
+
"wp-plugin": scaffoldWpPlugin,
|
|
36
|
+
"protocol-repo": scaffoldProtocolRepo,
|
|
37
|
+
};
|
|
38
|
+
return dispatch[inputs.projectType](inputs, opts);
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scaffolders/index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,WAAW,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ScaffoldInputs } from "../index.js";
|
|
2
|
+
import { type ScaffoldFile, type ScaffolderOptions } from "./common.js";
|
|
3
|
+
export declare function scaffoldLibrary(inputs: ScaffoldInputs, opts?: ScaffolderOptions): ScaffoldFile[];
|
|
4
|
+
//# sourceMappingURL=library.d.ts.map
|