@zero2webmaster/starter-kit 0.1.1 → 0.2.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/README.md +22 -7
- package/dist/brand.d.ts +0 -1
- package/dist/brand.js +0 -1
- package/dist/brief.d.ts +2 -3
- package/dist/brief.js +11 -5
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +190 -13
- package/dist/confirm.d.ts +11 -1
- package/dist/confirm.js +27 -6
- package/dist/index.d.ts +20 -2
- package/dist/index.js +1 -3
- package/dist/license.d.ts +97 -0
- package/dist/license.js +472 -0
- package/dist/parse-brief.d.ts +19 -2
- package/dist/parse-brief.js +213 -21
- package/dist/scaffolders/cf-pages.d.ts +0 -1
- package/dist/scaffolders/cf-pages.js +0 -1
- package/dist/scaffolders/cf-worker.d.ts +0 -1
- package/dist/scaffolders/cf-worker.js +0 -1
- package/dist/scaffolders/common.d.ts +13 -2
- package/dist/scaffolders/common.js +217 -12
- package/dist/scaffolders/index.d.ts +0 -1
- package/dist/scaffolders/index.js +0 -1
- package/dist/scaffolders/library.d.ts +0 -1
- package/dist/scaffolders/library.js +0 -1
- package/dist/scaffolders/nextjs.d.ts +0 -1
- package/dist/scaffolders/nextjs.js +6 -3
- package/dist/scaffolders/pro-seo-extension.d.ts +11 -0
- package/dist/scaffolders/pro-seo-extension.js +782 -0
- package/dist/scaffolders/protocol-repo.d.ts +0 -1
- package/dist/scaffolders/protocol-repo.js +0 -1
- package/dist/scaffolders/python-service.d.ts +0 -1
- package/dist/scaffolders/python-service.js +6 -2
- package/dist/scaffolders/wp-plugin.d.ts +0 -1
- package/dist/scaffolders/wp-plugin.js +8 -9
- package/dist/standards.d.ts +1 -2
- package/dist/standards.js +41 -3
- package/dist/substitute.d.ts +8 -1
- package/dist/substitute.js +11 -1
- package/dist/summary.d.ts +0 -1
- package/dist/summary.js +4 -4
- package/dist/templates.d.ts +73 -1
- package/dist/templates.js +174 -3
- package/dist/with-init.d.ts +16 -0
- package/dist/with-init.js +82 -0
- package/dist/wizard.d.ts +0 -1
- package/dist/wizard.js +0 -1
- package/dist/writer.d.ts +16 -3
- package/dist/writer.js +38 -10
- package/package.json +4 -3
- package/dist/brand.d.ts.map +0 -1
- package/dist/brand.js.map +0 -1
- package/dist/brief.d.ts.map +0 -1
- package/dist/brief.js.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/confirm.d.ts.map +0 -1
- package/dist/confirm.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/parse-brief.d.ts.map +0 -1
- package/dist/parse-brief.js.map +0 -1
- package/dist/scaffolders/cf-pages.d.ts.map +0 -1
- package/dist/scaffolders/cf-pages.js.map +0 -1
- package/dist/scaffolders/cf-worker.d.ts.map +0 -1
- package/dist/scaffolders/cf-worker.js.map +0 -1
- package/dist/scaffolders/common.d.ts.map +0 -1
- package/dist/scaffolders/common.js.map +0 -1
- package/dist/scaffolders/index.d.ts.map +0 -1
- package/dist/scaffolders/index.js.map +0 -1
- package/dist/scaffolders/library.d.ts.map +0 -1
- package/dist/scaffolders/library.js.map +0 -1
- package/dist/scaffolders/nextjs.d.ts.map +0 -1
- package/dist/scaffolders/nextjs.js.map +0 -1
- package/dist/scaffolders/protocol-repo.d.ts.map +0 -1
- package/dist/scaffolders/protocol-repo.js.map +0 -1
- package/dist/scaffolders/python-service.d.ts.map +0 -1
- package/dist/scaffolders/python-service.js.map +0 -1
- package/dist/scaffolders/wp-plugin.d.ts.map +0 -1
- package/dist/scaffolders/wp-plugin.js.map +0 -1
- package/dist/standards.d.ts.map +0 -1
- package/dist/standards.js.map +0 -1
- package/dist/substitute.d.ts.map +0 -1
- package/dist/substitute.js.map +0 -1
- package/dist/summary.d.ts.map +0 -1
- package/dist/summary.js.map +0 -1
- package/dist/templates.d.ts.map +0 -1
- package/dist/templates.js.map +0 -1
- package/dist/wizard.d.ts.map +0 -1
- package/dist/wizard.js.map +0 -1
- package/dist/writer.d.ts.map +0 -1
- package/dist/writer.js.map +0 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { ScaffoldInputs } from "../index.js";
|
|
2
2
|
import { type ScaffoldFile, type ScaffolderOptions } from "./common.js";
|
|
3
3
|
export declare function scaffoldProtocolRepo(inputs: ScaffoldInputs, opts?: ScaffolderOptions): ScaffoldFile[];
|
|
4
|
-
//# sourceMappingURL=protocol-repo.d.ts.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { ScaffoldInputs } from "../index.js";
|
|
2
2
|
import { type ScaffoldFile, type ScaffolderOptions } from "./common.js";
|
|
3
3
|
export declare function scaffoldPythonService(inputs: ScaffoldInputs, opts?: ScaffolderOptions): ScaffoldFile[];
|
|
4
|
-
//# sourceMappingURL=python-service.d.ts.map
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// check is needed, add a `/health/deep` per the neon-careful pattern.
|
|
7
7
|
//
|
|
8
8
|
// NOT subject to SEO baseline (API-only service, no public HTML surface).
|
|
9
|
-
import { commonBaseFiles, resolveBrandSpec, sub, } from "./common.js";
|
|
9
|
+
import { commonBaseFiles, localEnvFrom, resolveBrandSpec, sub, } from "./common.js";
|
|
10
10
|
const NARRATIVE = `## What this is
|
|
11
11
|
|
|
12
12
|
\`{{slug}}\` is a Python FastAPI service scaffolded under the {{brand_name}} brand. API-only — no public HTML surface, no SEO baseline.
|
|
@@ -139,6 +139,10 @@ export function scaffoldPythonService(inputs, opts) {
|
|
|
139
139
|
},
|
|
140
140
|
{ path: ".env.example", content: sub(ENV_EXAMPLE_TEMPLATE, inputs, opts, spec) },
|
|
141
141
|
];
|
|
142
|
+
// Python's local-env convention is `.env` (gitignored), not `.env.local`.
|
|
143
|
+
typeSpecific.push({
|
|
144
|
+
path: ".env",
|
|
145
|
+
content: localEnvFrom(sub(ENV_EXAMPLE_TEMPLATE, inputs, opts, spec), ".env"),
|
|
146
|
+
});
|
|
142
147
|
return [...base, ...typeSpecific];
|
|
143
148
|
}
|
|
144
|
-
//# sourceMappingURL=python-service.js.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { ScaffoldInputs } from "../index.js";
|
|
2
2
|
import { type ScaffoldFile, type ScaffolderOptions } from "./common.js";
|
|
3
3
|
export declare function scaffoldWpPlugin(inputs: ScaffoldInputs, opts?: ScaffolderOptions): ScaffoldFile[];
|
|
4
|
-
//# sourceMappingURL=wp-plugin.d.ts.map
|
|
@@ -53,14 +53,14 @@ if (!defined('ABSPATH')) {
|
|
|
53
53
|
exit;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
define('{{
|
|
57
|
-
define('{{
|
|
58
|
-
define('{{
|
|
59
|
-
define('{{
|
|
60
|
-
define('{{
|
|
56
|
+
define('{{slug_const}}_VERSION', '{{version}}');
|
|
57
|
+
define('{{slug_const}}_FILE', __FILE__);
|
|
58
|
+
define('{{slug_const}}_PATH', plugin_dir_path(__FILE__));
|
|
59
|
+
define('{{slug_const}}_URL', plugin_dir_url(__FILE__));
|
|
60
|
+
define('{{slug_const}}_SLUG', '{{slug}}');
|
|
61
61
|
|
|
62
|
-
require_once {{
|
|
63
|
-
require_once {{
|
|
62
|
+
require_once {{slug_const}}_PATH . 'includes/class-{{slug}}-activator.php';
|
|
63
|
+
require_once {{slug_const}}_PATH . 'includes/class-{{slug}}-module-loader.php';
|
|
64
64
|
|
|
65
65
|
register_activation_hook(__FILE__, ['{{slug_camel}}_Activator', 'activate']);
|
|
66
66
|
|
|
@@ -185,7 +185,7 @@ class {{slug_camel}}_Activator {
|
|
|
185
185
|
// dbDelta($sql);
|
|
186
186
|
|
|
187
187
|
// Bump a version option so future activations can run migrations.
|
|
188
|
-
update_option('{{slug_under}}_version', {{
|
|
188
|
+
update_option('{{slug_under}}_version', {{slug_const}}_VERSION);
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
`;
|
|
@@ -265,4 +265,3 @@ export function scaffoldWpPlugin(inputs, opts) {
|
|
|
265
265
|
];
|
|
266
266
|
return [...base, ...typeSpecific];
|
|
267
267
|
}
|
|
268
|
-
//# sourceMappingURL=wp-plugin.js.map
|
package/dist/standards.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ProjectType, ScaffoldInputs } from "./index.js";
|
|
2
2
|
import { type SubstitutionOptions } from "./substitute.js";
|
|
3
|
-
export type StandardKey = "portable-stack" | "fathom" | "uptime-kuma" | "neon-careful" | "agent-coordination" | "seo-baseline" | "email-service" | "text-size";
|
|
3
|
+
export type StandardKey = "skill-vault" | "portable-stack" | "fathom" | "uptime-kuma" | "neon-careful" | "agent-coordination" | "seo-baseline" | "email-service" | "text-size";
|
|
4
4
|
export type StandardDecisionState = "inserted-inline" | "skipped-not-applicable";
|
|
5
5
|
export interface StandardDecision {
|
|
6
6
|
key: StandardKey;
|
|
@@ -62,4 +62,3 @@ export declare function resolveStandards(inputs: ScaffoldInputs, opts?: ResolveS
|
|
|
62
62
|
* call on any file).
|
|
63
63
|
*/
|
|
64
64
|
export declare function applyStandardsBlock(claudeMd: string, resolution: StandardsResolution): string;
|
|
65
|
-
//# sourceMappingURL=standards.d.ts.map
|
package/dist/standards.js
CHANGED
|
@@ -7,8 +7,13 @@
|
|
|
7
7
|
// [[instantiate-z2w-project]] skill v1.1.0 Step 6.
|
|
8
8
|
//
|
|
9
9
|
// Standards covered (per skill v1.1.0, including the 2026-05-30 SEO baseline
|
|
10
|
-
// + email-service-router additions):
|
|
10
|
+
// + email-service-router additions, and the 2026-06-15 skill-vault addition):
|
|
11
11
|
//
|
|
12
|
+
// - skill-vault — always (Z2W standing org rule); rendered FIRST so
|
|
13
|
+
// every scaffolded project knows the Skill Vault path
|
|
14
|
+
// before any other standard (Kerry directive 2026-06-15:
|
|
15
|
+
// "skill vault awareness should always come first … unless
|
|
16
|
+
// more important issues exist")
|
|
12
17
|
// - portable-stack — always for non-WP types
|
|
13
18
|
// - fathom — if hasWebUi=true
|
|
14
19
|
// - uptime-kuma — any deploy target (cf-worker, cf-pages, nextjs, python-service)
|
|
@@ -22,8 +27,14 @@
|
|
|
22
27
|
// The Step 6 writer composes this resolver's output with the per-type scaffolder
|
|
23
28
|
// output by `.replace()`ing the marker.
|
|
24
29
|
import { applySubstitutions } from "./substitute.js";
|
|
25
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Order standards appear in the rendered body + the decisions log.
|
|
32
|
+
* `skill-vault` is intentionally FIRST (Kerry directive 2026-06-15): every
|
|
33
|
+
* scaffolded project should know the Skill Vault location before anything else,
|
|
34
|
+
* "unless more important issues exist" — which the body text defers to.
|
|
35
|
+
*/
|
|
26
36
|
const STANDARD_ORDER = [
|
|
37
|
+
"skill-vault",
|
|
27
38
|
"portable-stack",
|
|
28
39
|
"fathom",
|
|
29
40
|
"uptime-kuma",
|
|
@@ -34,6 +45,7 @@ const STANDARD_ORDER = [
|
|
|
34
45
|
"text-size",
|
|
35
46
|
];
|
|
36
47
|
const TITLES = {
|
|
48
|
+
"skill-vault": "Skill Vault awareness",
|
|
37
49
|
"portable-stack": "Portable-stack defaults (non-WP)",
|
|
38
50
|
fathom: "Fathom analytics",
|
|
39
51
|
"uptime-kuma": "Uptime Kuma monitor",
|
|
@@ -64,6 +76,16 @@ function checkPortableStack(inputs) {
|
|
|
64
76
|
};
|
|
65
77
|
}
|
|
66
78
|
function checkFathom(inputs) {
|
|
79
|
+
// WordPress sites get Fathom via the Fathom WP plugin, NOT the env-var
|
|
80
|
+
// client-script pattern this standards block describes. A wp-plugin with an
|
|
81
|
+
// admin UI sets hasWebUi=true, so gate on the type explicitly (2026-06-03
|
|
82
|
+
// dogfood finding #6 — Fathom was wrongly inserted for a wp-plugin scaffold).
|
|
83
|
+
if (inputs.projectType === "wp-plugin") {
|
|
84
|
+
return {
|
|
85
|
+
applies: false,
|
|
86
|
+
reason: "wp-plugin uses the Fathom WP plugin, not the env-var client script",
|
|
87
|
+
};
|
|
88
|
+
}
|
|
67
89
|
if (!inputs.hasWebUi) {
|
|
68
90
|
return { applies: false, reason: "hasWebUi=false — no analytics surface" };
|
|
69
91
|
}
|
|
@@ -141,6 +163,12 @@ function checkEmailService(inputs) {
|
|
|
141
163
|
function checkTextSize() {
|
|
142
164
|
return { applies: true, reason: "Z2W standing org rule — applies to every project" };
|
|
143
165
|
}
|
|
166
|
+
function checkSkillVault() {
|
|
167
|
+
return {
|
|
168
|
+
applies: true,
|
|
169
|
+
reason: "Z2W standing org rule — every project agent should know the Skill Vault path",
|
|
170
|
+
};
|
|
171
|
+
}
|
|
144
172
|
/**
|
|
145
173
|
* Fathom env var name per framework. Mirrors skill v1.1.0's Step 6 conditional
|
|
146
174
|
* wording: `NEXT_PUBLIC_FATHOM_SITE_ID` for Next.js, hard-coded inline for
|
|
@@ -160,6 +188,15 @@ export function fathomEnvVarFor(projectType) {
|
|
|
160
188
|
// [[instantiate-z2w-project]] skill v1.1.0 → "Standards block reference".
|
|
161
189
|
// Bodies use `{{placeholder}}` tokens where substitution is needed; everything
|
|
162
190
|
// else is verbatim from the skill.
|
|
191
|
+
// Canonical Skill Vault paragraph — the SINGLE SOURCE OF TRUTH for this text.
|
|
192
|
+
// The same wording is mirrored (by hand, kept in sync) into Kerry's global
|
|
193
|
+
// ~/.claude/CLAUDE.md and the [[instantiate-z2w-project]] SKILL.md standards
|
|
194
|
+
// resolver. If you edit this body, update those two sites in the same change.
|
|
195
|
+
const SKILL_VAULT_BODY = `### Skill Vault awareness (always — read first)
|
|
196
|
+
|
|
197
|
+
> **Skill Vault:** Kerry's portfolio-wide library of reusable Claude Code / Cursor skills lives at \`~/Desktop/Zero2Webmaster/AI/Skill Vault/\`. Each subfolder is the canonical source for one skill's \`SKILL.md\` body (api-key-field-standard, capture-learning, email-service-router, fathom-analytics, neon-postgres, portable-stack, symlink-safety, uptime-kuma-monitor, and more); \`~/.claude/skills/*\` and \`~/.cursor/skills/*\` symlink into it via the vault's \`sync.sh\`. **When Kerry says "we need a skill created or edited," look there first — you do not need to be given a path.** The skills usable in this session are listed by the harness (the available-skills reminder); the Vault is where their source bodies live and where new skills are authored. See [[capture-learning]] for the rule on when a learning becomes a new Vault skill versus a project-local note.
|
|
198
|
+
>
|
|
199
|
+
> This awareness is listed **first** among standards by deliberate org rule — *unless* a more urgent safety, secret-handling, or data-integrity concern takes precedence in the moment, that always wins.`;
|
|
163
200
|
const PORTABLE_STACK_BODY = `### Portable-stack defaults (non-WP)
|
|
164
201
|
|
|
165
202
|
> **Portability posture:** standard Postgres (not Neon Auth / Supabase Edge Functions / Vercel Postgres / Cloudflare D1 / branded SQL); S3-compatible storage (not Vercel Blob / Supabase Storage); Node runtime over Edge unless required; dotenv-style config (not UI-only secrets); written exit plan from day one. See [[portable-stack]] for the full posture.`;
|
|
@@ -244,6 +281,7 @@ const TEXT_SIZE_BODY = `### Text size (always)
|
|
|
244
281
|
|
|
245
282
|
> **Readability:** per Z2W standing org rule, all public-facing pages and documents use large, easy-to-read type. Body text 18px+ baseline; headings proportionally larger; line-height ≥ 1.5.`;
|
|
246
283
|
const BODIES = {
|
|
284
|
+
"skill-vault": SKILL_VAULT_BODY,
|
|
247
285
|
"portable-stack": PORTABLE_STACK_BODY,
|
|
248
286
|
fathom: FATHOM_BODY,
|
|
249
287
|
"uptime-kuma": UPTIME_KUMA_BODY,
|
|
@@ -254,6 +292,7 @@ const BODIES = {
|
|
|
254
292
|
"text-size": TEXT_SIZE_BODY,
|
|
255
293
|
};
|
|
256
294
|
const APPLICABILITY = {
|
|
295
|
+
"skill-vault": checkSkillVault,
|
|
257
296
|
"portable-stack": checkPortableStack,
|
|
258
297
|
fathom: checkFathom,
|
|
259
298
|
"uptime-kuma": checkUptimeKuma,
|
|
@@ -332,4 +371,3 @@ export function resolveStandards(inputs, opts = {}) {
|
|
|
332
371
|
export function applyStandardsBlock(claudeMd, resolution) {
|
|
333
372
|
return claudeMd.replace(/<!-- STANDARDS_BLOCK -->/g, resolution.body.trimEnd());
|
|
334
373
|
}
|
|
335
|
-
//# sourceMappingURL=standards.js.map
|
package/dist/substitute.d.ts
CHANGED
|
@@ -16,6 +16,14 @@ export declare function todayISODate(): string;
|
|
|
16
16
|
export declare function underscoredSlug(slug: string): string;
|
|
17
17
|
/** `my-tool` -> `MyTool` (for PHP class names). */
|
|
18
18
|
export declare function pascalCaseFromSlug(slug: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* `my-tool` -> `MY_TOOL` (for PHP/WordPress constant prefixes). WordPress
|
|
21
|
+
* convention is UPPER_SNAKE for `define()`d constants (`MY_TOOL_VERSION`),
|
|
22
|
+
* distinct from the PascalCase used for class names. Before v0.2.1 the
|
|
23
|
+
* wp-plugin scaffolder reused `slug_camel` for constants, producing
|
|
24
|
+
* `MyTool_VERSION` — the 2026-06-03 dogfood finding #7.
|
|
25
|
+
*/
|
|
26
|
+
export declare function upperSnakeFromSlug(slug: string): string;
|
|
19
27
|
/**
|
|
20
28
|
* Framework version embedded in the scaffolded CLAUDE.md header. WordPress
|
|
21
29
|
* plugins inherit from the WP AGENTS template (v3.1.0); everything else
|
|
@@ -34,4 +42,3 @@ export declare function buildSubstitutionMap(inputs: ScaffoldInputs, opts?: Subs
|
|
|
34
42
|
* the caller can detect drift between templates and the substitution map.
|
|
35
43
|
*/
|
|
36
44
|
export declare function applySubstitutions(template: string, inputs: ScaffoldInputs, opts?: SubstitutionOptions): string;
|
|
37
|
-
//# sourceMappingURL=substitute.d.ts.map
|
package/dist/substitute.js
CHANGED
|
@@ -33,6 +33,16 @@ export function pascalCaseFromSlug(slug) {
|
|
|
33
33
|
.map((part) => part[0].toUpperCase() + part.slice(1))
|
|
34
34
|
.join("");
|
|
35
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* `my-tool` -> `MY_TOOL` (for PHP/WordPress constant prefixes). WordPress
|
|
38
|
+
* convention is UPPER_SNAKE for `define()`d constants (`MY_TOOL_VERSION`),
|
|
39
|
+
* distinct from the PascalCase used for class names. Before v0.2.1 the
|
|
40
|
+
* wp-plugin scaffolder reused `slug_camel` for constants, producing
|
|
41
|
+
* `MyTool_VERSION` — the 2026-06-03 dogfood finding #7.
|
|
42
|
+
*/
|
|
43
|
+
export function upperSnakeFromSlug(slug) {
|
|
44
|
+
return underscoredSlug(slug).toUpperCase();
|
|
45
|
+
}
|
|
36
46
|
/**
|
|
37
47
|
* Framework version embedded in the scaffolded CLAUDE.md header. WordPress
|
|
38
48
|
* plugins inherit from the WP AGENTS template (v3.1.0); everything else
|
|
@@ -67,6 +77,7 @@ export function buildSubstitutionMap(inputs, opts = {}) {
|
|
|
67
77
|
slug: inputs.slug,
|
|
68
78
|
slug_under: underscoredSlug(inputs.slug),
|
|
69
79
|
slug_camel: pascalCaseFromSlug(inputs.slug),
|
|
80
|
+
slug_const: upperSnakeFromSlug(inputs.slug),
|
|
70
81
|
description: inputs.description,
|
|
71
82
|
brand_name: spec.brandName,
|
|
72
83
|
brand_name_rule: spec.brandNameRule,
|
|
@@ -95,4 +106,3 @@ export function applySubstitutions(template, inputs, opts) {
|
|
|
95
106
|
return match;
|
|
96
107
|
});
|
|
97
108
|
}
|
|
98
|
-
//# sourceMappingURL=substitute.js.map
|
package/dist/summary.d.ts
CHANGED
package/dist/summary.js
CHANGED
|
@@ -57,12 +57,13 @@ function isDecisionInserted(decisions, key) {
|
|
|
57
57
|
}
|
|
58
58
|
function buildNextActions(inputs, result) {
|
|
59
59
|
const actions = [
|
|
60
|
-
{ label: `cd ${result.targetPath}` },
|
|
61
60
|
{
|
|
62
|
-
label: `git init && git add . && git commit -m "
|
|
61
|
+
label: `cd ${result.targetPath} && git init -b main && git config user.email "kerry@zero2webmaster.com" && git add . && git commit -m "Initial scaffold"`,
|
|
62
|
+
note: "RUN THIS FROM INSIDE THE PROJECT DIRECTORY ABOVE — never run `git init`/`git add` from your home directory (a bare `git add -A` in ~ stages credentials, .ssh, and every .env). The cd is baked into this command so it's safe to paste as-is. The repo-local user.email is the Vercel-Hobby commit-author workaround per [[z2w-magic-link-auth]] §8.",
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
|
-
label: `gh repo create ${inputs.githubOrg}/${inputs.slug} --private`,
|
|
65
|
+
label: `gh repo create ${inputs.githubOrg}/${inputs.slug} --private --source=. --push`,
|
|
66
|
+
note: `run from inside ${result.targetPath}; add --description "…" and then \`gh repo edit --add-topic …\` to set the repo's About blurb + topics`,
|
|
66
67
|
},
|
|
67
68
|
];
|
|
68
69
|
const installCmd = installCommandFor(inputs.projectType);
|
|
@@ -188,4 +189,3 @@ export function renderSummary(inputs, result, opts = {}) {
|
|
|
188
189
|
sections.push(renderNextActionsSection(chalk, inputs, result));
|
|
189
190
|
output.write("\n" + sections.join("\n\n") + "\n");
|
|
190
191
|
}
|
|
191
|
-
//# sourceMappingURL=summary.js.map
|
package/dist/templates.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export declare const DEFAULT_TEMPLATES_PATH: string;
|
|
2
2
|
export declare const REQUIRED_FILES: readonly string[];
|
|
3
3
|
export declare const REQUIRED_DIRECTORIES: readonly string[];
|
|
4
|
+
export declare const MIRROR_URL = "https://templates.z2w.us";
|
|
5
|
+
export declare const CACHE_DIR: string;
|
|
6
|
+
/** Cache TTL: 24 hours in milliseconds. */
|
|
7
|
+
export declare const CACHE_TTL_MS: number;
|
|
4
8
|
export declare class TemplatesError extends Error {
|
|
5
9
|
constructor(message: string);
|
|
6
10
|
}
|
|
@@ -27,4 +31,72 @@ export declare function resolveTemplatesPath(override?: string): Promise<string>
|
|
|
27
31
|
* Templates root, or otherwise cannot be read.
|
|
28
32
|
*/
|
|
29
33
|
export declare function readTemplate(name: string, templatesPath?: string): Promise<string>;
|
|
30
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Where a template came from. Surfaced for observability + tests.
|
|
36
|
+
*/
|
|
37
|
+
export type TemplateSource = "local-folder" | "fresh-cache" | "mirror" | "stale-cache";
|
|
38
|
+
/**
|
|
39
|
+
* Options for {@link readTemplateWithFallback} and {@link fetchFromMirror}.
|
|
40
|
+
* Every field is optional; defaults preserve the documented production behavior.
|
|
41
|
+
*/
|
|
42
|
+
export interface ReadTemplateOptions {
|
|
43
|
+
/**
|
|
44
|
+
* Explicit Templates folder path (e.g. from `--templates-path`).
|
|
45
|
+
* When set, the fallback chain is BYPASSED — only this folder is consulted.
|
|
46
|
+
* If the path is invalid or the file is missing there, the call throws.
|
|
47
|
+
*/
|
|
48
|
+
templatesPath?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Force-bypass the local cache and fetch from the mirror unconditionally
|
|
51
|
+
* (e.g. from `--refresh-templates`). Falls back to stale cache only if the
|
|
52
|
+
* mirror is unreachable.
|
|
53
|
+
*/
|
|
54
|
+
refreshTemplates?: boolean;
|
|
55
|
+
/** Override the mirror URL (tests). Default {@link MIRROR_URL}. */
|
|
56
|
+
mirrorUrl?: string;
|
|
57
|
+
/** Override the cache directory (tests). Default {@link CACHE_DIR}. */
|
|
58
|
+
cacheDir?: string;
|
|
59
|
+
/** Override the fetch implementation (tests). Default global `fetch`. */
|
|
60
|
+
fetchImpl?: typeof fetch;
|
|
61
|
+
/** Override the clock (tests). Default `() => Date.now()`. */
|
|
62
|
+
now?: () => number;
|
|
63
|
+
/** Where to write user-facing warnings (e.g. stale-cache fallback). */
|
|
64
|
+
onWarn?: (message: string) => void;
|
|
65
|
+
/**
|
|
66
|
+
* Internal: force-skip the local-folder check (Step 2) and go straight to
|
|
67
|
+
* cache/mirror. Used by tests so the DEFAULT_TEMPLATES_PATH on the runner's
|
|
68
|
+
* machine doesn't short-circuit the fallback chain.
|
|
69
|
+
*/
|
|
70
|
+
skipLocalFolder?: boolean;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Reads a template name walking the v0.2.0 resolution chain:
|
|
74
|
+
*
|
|
75
|
+
* 1. Explicit `templatesPath` override → strict, no fallback
|
|
76
|
+
* 2. Local Templates folder at the default path → use it
|
|
77
|
+
* 3. Fresh local cache (mtime < 24h) → use it
|
|
78
|
+
* 4. Mirror fetch → cache + return
|
|
79
|
+
* 5. Stale local cache (with warning) → use it
|
|
80
|
+
* 6. Hard fail with `--templates-path <path>` hint
|
|
81
|
+
*
|
|
82
|
+
* Each TemplateSource case is observable via the second return tuple element
|
|
83
|
+
* so the CLI can surface "loaded from mirror / cache / local" to the user.
|
|
84
|
+
*
|
|
85
|
+
* Step 2 only kicks in when {@link resolveTemplatesPath} succeeds — i.e. the
|
|
86
|
+
* folder exists AND has the required AGENTS bodies + Resources/ subdir. A
|
|
87
|
+
* half-present folder falls through to the mirror so the user is never blocked
|
|
88
|
+
* by an inconsistent local state.
|
|
89
|
+
*/
|
|
90
|
+
export declare function readTemplateWithFallback(name: string, opts?: ReadTemplateOptions): Promise<{
|
|
91
|
+
content: string;
|
|
92
|
+
source: TemplateSource;
|
|
93
|
+
}>;
|
|
94
|
+
/**
|
|
95
|
+
* Fetches a single template file from the hosted mirror.
|
|
96
|
+
*
|
|
97
|
+
* @param name - the template file name (e.g. "AGENTS_v2.13.0.md",
|
|
98
|
+
* "Resources/README.md"). Path-traversal sequences are refused.
|
|
99
|
+
* @returns the file contents as a UTF-8 string.
|
|
100
|
+
* @throws TemplatesError on network failure, non-2xx response, or unsafe name.
|
|
101
|
+
*/
|
|
102
|
+
export declare function fetchFromMirror(name: string, opts?: Pick<ReadTemplateOptions, "mirrorUrl" | "fetchImpl">): Promise<string>;
|
package/dist/templates.js
CHANGED
|
@@ -5,8 +5,15 @@
|
|
|
5
5
|
// template files fresh from disk on every call.
|
|
6
6
|
//
|
|
7
7
|
// Per CLAUDE.md Operating Principle #1: never cache or embed Templates
|
|
8
|
-
// content. Every readTemplate() call hits the disk so
|
|
9
|
-
// version bumps (e.g. AGENTS_WP_v3.1.0 → v3.2.0) are
|
|
8
|
+
// content in the SOURCE TREE. Every readTemplate() call hits the disk so
|
|
9
|
+
// upstream Template version bumps (e.g. AGENTS_WP_v3.1.0 → v3.2.0) are
|
|
10
|
+
// picked up automatically.
|
|
11
|
+
//
|
|
12
|
+
// v0.2.0 adds a hosted-mirror fallback: when no local Templates folder is
|
|
13
|
+
// present, `readTemplateWithFallback` resolves via local cache (24h TTL)
|
|
14
|
+
// → mirror fetch from `https://templates.z2w.us` → stale cache (with
|
|
15
|
+
// warning) → hard fail (with `--templates-path` hint). This is what makes
|
|
16
|
+
// the CLI work on machines that don't have Kerry's local Templates folder.
|
|
10
17
|
import { promises as fs } from "node:fs";
|
|
11
18
|
import * as path from "node:path";
|
|
12
19
|
import * as os from "node:os";
|
|
@@ -16,6 +23,10 @@ export const REQUIRED_FILES = [
|
|
|
16
23
|
"AGENTS_WP_v3.1.0.md",
|
|
17
24
|
];
|
|
18
25
|
export const REQUIRED_DIRECTORIES = ["Resources"];
|
|
26
|
+
export const MIRROR_URL = "https://templates.z2w.us";
|
|
27
|
+
export const CACHE_DIR = path.join(os.homedir(), ".cache", "z2w-templates");
|
|
28
|
+
/** Cache TTL: 24 hours in milliseconds. */
|
|
29
|
+
export const CACHE_TTL_MS = 24 * 60 * 60 * 1000;
|
|
19
30
|
export class TemplatesError extends Error {
|
|
20
31
|
constructor(message) {
|
|
21
32
|
super(message);
|
|
@@ -120,4 +131,164 @@ export async function readTemplate(name, templatesPath) {
|
|
|
120
131
|
throw new TemplatesError(`Failed to read template "${name}": ${err.message}`);
|
|
121
132
|
}
|
|
122
133
|
}
|
|
123
|
-
|
|
134
|
+
/**
|
|
135
|
+
* Reads a template name walking the v0.2.0 resolution chain:
|
|
136
|
+
*
|
|
137
|
+
* 1. Explicit `templatesPath` override → strict, no fallback
|
|
138
|
+
* 2. Local Templates folder at the default path → use it
|
|
139
|
+
* 3. Fresh local cache (mtime < 24h) → use it
|
|
140
|
+
* 4. Mirror fetch → cache + return
|
|
141
|
+
* 5. Stale local cache (with warning) → use it
|
|
142
|
+
* 6. Hard fail with `--templates-path <path>` hint
|
|
143
|
+
*
|
|
144
|
+
* Each TemplateSource case is observable via the second return tuple element
|
|
145
|
+
* so the CLI can surface "loaded from mirror / cache / local" to the user.
|
|
146
|
+
*
|
|
147
|
+
* Step 2 only kicks in when {@link resolveTemplatesPath} succeeds — i.e. the
|
|
148
|
+
* folder exists AND has the required AGENTS bodies + Resources/ subdir. A
|
|
149
|
+
* half-present folder falls through to the mirror so the user is never blocked
|
|
150
|
+
* by an inconsistent local state.
|
|
151
|
+
*/
|
|
152
|
+
export async function readTemplateWithFallback(name, opts = {}) {
|
|
153
|
+
if (typeof name !== "string" || name.length === 0) {
|
|
154
|
+
throw new TemplatesError(`readTemplateWithFallback() requires a non-empty name; got ${JSON.stringify(name)}.`);
|
|
155
|
+
}
|
|
156
|
+
// Step 1: explicit override → strict semantics (caller asked for this exact location).
|
|
157
|
+
if (opts.templatesPath) {
|
|
158
|
+
const content = await readTemplate(name, opts.templatesPath);
|
|
159
|
+
return { content, source: "local-folder" };
|
|
160
|
+
}
|
|
161
|
+
// Step 2: local Templates folder? (Skipped in tests via skipLocalFolder.)
|
|
162
|
+
if (!opts.skipLocalFolder) {
|
|
163
|
+
let localPath = null;
|
|
164
|
+
try {
|
|
165
|
+
localPath = await resolveTemplatesPath();
|
|
166
|
+
}
|
|
167
|
+
catch (err) {
|
|
168
|
+
if (!(err instanceof TemplatesError))
|
|
169
|
+
throw err;
|
|
170
|
+
// No (or incomplete) local folder — fall through to cache/mirror chain.
|
|
171
|
+
}
|
|
172
|
+
if (localPath) {
|
|
173
|
+
const content = await readTemplate(name, localPath);
|
|
174
|
+
return { content, source: "local-folder" };
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
const cacheDir = opts.cacheDir ?? CACHE_DIR;
|
|
178
|
+
const now = opts.now ?? Date.now;
|
|
179
|
+
const cached = opts.refreshTemplates
|
|
180
|
+
? null
|
|
181
|
+
: await readFromCache(name, cacheDir);
|
|
182
|
+
// Step 3: fresh cache hit?
|
|
183
|
+
if (cached && now() - cached.mtimeMs < CACHE_TTL_MS) {
|
|
184
|
+
return { content: cached.content, source: "fresh-cache" };
|
|
185
|
+
}
|
|
186
|
+
// Step 4: mirror fetch.
|
|
187
|
+
try {
|
|
188
|
+
const content = await fetchFromMirror(name, opts);
|
|
189
|
+
await writeToCache(name, content, cacheDir);
|
|
190
|
+
return { content, source: "mirror" };
|
|
191
|
+
}
|
|
192
|
+
catch (fetchErr) {
|
|
193
|
+
if (!(fetchErr instanceof TemplatesError))
|
|
194
|
+
throw fetchErr;
|
|
195
|
+
// Step 5: stale cache? (Either a stale cached copy, OR a cache we refused
|
|
196
|
+
// in Step 3 because --refresh-templates was set — both are usable
|
|
197
|
+
// now that the mirror is down.)
|
|
198
|
+
const fallbackCached = cached ?? (await readFromCache(name, cacheDir));
|
|
199
|
+
if (fallbackCached) {
|
|
200
|
+
const onWarn = opts.onWarn ?? defaultWarn;
|
|
201
|
+
onWarn(`⚠ Using stale cached copy of "${name}" — mirror fetch failed. ` +
|
|
202
|
+
`Run with --refresh-templates when network is restored.`);
|
|
203
|
+
return { content: fallbackCached.content, source: "stale-cache" };
|
|
204
|
+
}
|
|
205
|
+
// Step 6: hard fail.
|
|
206
|
+
const mirrorUrl = opts.mirrorUrl ?? MIRROR_URL;
|
|
207
|
+
throw new TemplatesError(`Cannot resolve template "${name}".\n` +
|
|
208
|
+
` • No local Templates folder at ${DEFAULT_TEMPLATES_PATH}\n` +
|
|
209
|
+
` • No cached copy at ${cacheDir}\n` +
|
|
210
|
+
` • Mirror at ${mirrorUrl} is unreachable: ${fetchErr.message}\n\n` +
|
|
211
|
+
`If you have a Templates folder elsewhere, pass --templates-path <absolute-path>.\n` +
|
|
212
|
+
`Otherwise restore your network connection and retry.`);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Fetches a single template file from the hosted mirror.
|
|
217
|
+
*
|
|
218
|
+
* @param name - the template file name (e.g. "AGENTS_v2.13.0.md",
|
|
219
|
+
* "Resources/README.md"). Path-traversal sequences are refused.
|
|
220
|
+
* @returns the file contents as a UTF-8 string.
|
|
221
|
+
* @throws TemplatesError on network failure, non-2xx response, or unsafe name.
|
|
222
|
+
*/
|
|
223
|
+
export async function fetchFromMirror(name, opts = {}) {
|
|
224
|
+
if (typeof name !== "string" || name.length === 0) {
|
|
225
|
+
throw new TemplatesError(`fetchFromMirror() requires a non-empty name; got ${JSON.stringify(name)}.`);
|
|
226
|
+
}
|
|
227
|
+
if (name.startsWith("/") ||
|
|
228
|
+
name.includes("..") ||
|
|
229
|
+
name.startsWith("\\")) {
|
|
230
|
+
throw new TemplatesError(`Template name "${name}" contains path-traversal characters; refusing to fetch.`);
|
|
231
|
+
}
|
|
232
|
+
const mirrorUrl = (opts.mirrorUrl ?? MIRROR_URL).replace(/\/+$/, "");
|
|
233
|
+
const fetchImpl = opts.fetchImpl ?? globalThis.fetch;
|
|
234
|
+
if (typeof fetchImpl !== "function") {
|
|
235
|
+
throw new TemplatesError(`fetch() is not available in this runtime. Upgrade to Node 20+ or pass opts.fetchImpl.`);
|
|
236
|
+
}
|
|
237
|
+
const url = `${mirrorUrl}/${encodeURI(name)}`;
|
|
238
|
+
let response;
|
|
239
|
+
try {
|
|
240
|
+
response = await fetchImpl(url);
|
|
241
|
+
}
|
|
242
|
+
catch (err) {
|
|
243
|
+
throw new TemplatesError(`Failed to fetch "${name}" from mirror ${mirrorUrl}: ${err.message}`);
|
|
244
|
+
}
|
|
245
|
+
if (!response.ok) {
|
|
246
|
+
throw new TemplatesError(`Mirror returned ${response.status} ${response.statusText || ""} for "${name}" (${url}).`);
|
|
247
|
+
}
|
|
248
|
+
try {
|
|
249
|
+
return await response.text();
|
|
250
|
+
}
|
|
251
|
+
catch (err) {
|
|
252
|
+
throw new TemplatesError(`Failed to read response body for "${name}": ${err.message}`);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
async function readFromCache(name, cacheDir) {
|
|
256
|
+
const cachePath = resolveCachePath(name, cacheDir);
|
|
257
|
+
if (cachePath === null)
|
|
258
|
+
return null;
|
|
259
|
+
try {
|
|
260
|
+
const stat = await fs.stat(cachePath);
|
|
261
|
+
if (!stat.isFile())
|
|
262
|
+
return null;
|
|
263
|
+
const content = await fs.readFile(cachePath, "utf8");
|
|
264
|
+
return { content, mtimeMs: stat.mtimeMs };
|
|
265
|
+
}
|
|
266
|
+
catch {
|
|
267
|
+
return null;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
async function writeToCache(name, content, cacheDir) {
|
|
271
|
+
const cachePath = resolveCachePath(name, cacheDir);
|
|
272
|
+
if (cachePath === null) {
|
|
273
|
+
throw new TemplatesError(`Refusing to cache "${name}" — name resolves outside the cache directory.`);
|
|
274
|
+
}
|
|
275
|
+
await fs.mkdir(path.dirname(cachePath), { recursive: true });
|
|
276
|
+
await fs.writeFile(cachePath, content, "utf8");
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Resolves a template name to its on-disk cache path, refusing anything that
|
|
280
|
+
* escapes `cacheDir`. Returns null when the name would escape.
|
|
281
|
+
*/
|
|
282
|
+
function resolveCachePath(name, cacheDir) {
|
|
283
|
+
const root = path.resolve(cacheDir);
|
|
284
|
+
const fullPath = path.resolve(root, name);
|
|
285
|
+
const rootWithSep = root.endsWith(path.sep) ? root : root + path.sep;
|
|
286
|
+
if (fullPath !== root && !fullPath.startsWith(rootWithSep)) {
|
|
287
|
+
return null;
|
|
288
|
+
}
|
|
289
|
+
return fullPath;
|
|
290
|
+
}
|
|
291
|
+
function defaultWarn(message) {
|
|
292
|
+
// eslint-disable-next-line no-console
|
|
293
|
+
console.warn(message);
|
|
294
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import type { ScaffoldInputs } from "./index.js";
|
|
3
|
+
export interface WithInitOptions {
|
|
4
|
+
stdout?: NodeJS.WritableStream;
|
|
5
|
+
stderr?: NodeJS.WritableStream;
|
|
6
|
+
/** Override the spawner (tests). Default `node:child_process.spawn`. */
|
|
7
|
+
spawnImpl?: typeof spawn;
|
|
8
|
+
}
|
|
9
|
+
export declare class WithInitError extends Error {
|
|
10
|
+
constructor(message: string);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Runs the post-scaffold git + gh chain. Assumes the caller has already
|
|
14
|
+
* verified that paid features are allowed (cli.ts does this before calling).
|
|
15
|
+
*/
|
|
16
|
+
export declare function runWithInit(inputs: ScaffoldInputs, targetPath: string, opts?: WithInitOptions): Promise<void>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// z2w-starter-kit --with-init paid feature.
|
|
2
|
+
//
|
|
3
|
+
// After a successful scaffold, runs:
|
|
4
|
+
// git init
|
|
5
|
+
// git add .
|
|
6
|
+
// git commit -m "Initial scaffold via @zero2webmaster/starter-kit"
|
|
7
|
+
// gh repo create {githubOrg}/{slug} --private --source=. --remote=origin
|
|
8
|
+
// git push -u origin <default-branch>
|
|
9
|
+
//
|
|
10
|
+
// This is the side-effectful workflow CLAUDE.md OP #3 explicitly forbids by
|
|
11
|
+
// default in v0.1.x/v0.2.x. It is gated by a runtime license check in
|
|
12
|
+
// src/cli.ts before this module is invoked.
|
|
13
|
+
//
|
|
14
|
+
// `gh` is invoked, not the GitHub REST API, so the user's existing
|
|
15
|
+
// `gh auth login` credentials are honored (no token plumbing required). The
|
|
16
|
+
// CLI surfaces clear errors when `gh` is missing or unauthenticated.
|
|
17
|
+
import { spawn } from "node:child_process";
|
|
18
|
+
export class WithInitError extends Error {
|
|
19
|
+
constructor(message) {
|
|
20
|
+
super(message);
|
|
21
|
+
this.name = "WithInitError";
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function runCommand(command, args, cwd, spawnImpl) {
|
|
25
|
+
return new Promise((resolve, reject) => {
|
|
26
|
+
const child = spawnImpl(command, args, { cwd, stdio: ["ignore", "pipe", "pipe"] });
|
|
27
|
+
let stdout = "";
|
|
28
|
+
let stderr = "";
|
|
29
|
+
child.stdout?.on("data", (chunk) => {
|
|
30
|
+
stdout += chunk.toString("utf8");
|
|
31
|
+
});
|
|
32
|
+
child.stderr?.on("data", (chunk) => {
|
|
33
|
+
stderr += chunk.toString("utf8");
|
|
34
|
+
});
|
|
35
|
+
child.on("error", (err) => reject(err));
|
|
36
|
+
child.on("close", (code) => resolve({ code: code ?? 1, stdout, stderr }));
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
async function step(label, command, args, cwd, spawnImpl, stdout) {
|
|
40
|
+
stdout.write(`\n ${label}: ${command} ${args.join(" ")}\n`);
|
|
41
|
+
let result;
|
|
42
|
+
try {
|
|
43
|
+
result = await runCommand(command, args, cwd, spawnImpl);
|
|
44
|
+
}
|
|
45
|
+
catch (err) {
|
|
46
|
+
const message = err.code === "ENOENT"
|
|
47
|
+
? `${command} not found on PATH. Install it and re-run.`
|
|
48
|
+
: err.message;
|
|
49
|
+
throw new WithInitError(`${label} failed: ${message}`);
|
|
50
|
+
}
|
|
51
|
+
if (result.code !== 0) {
|
|
52
|
+
const detail = (result.stderr || result.stdout || "").trim();
|
|
53
|
+
throw new WithInitError(`${label} exited with code ${result.code}${detail ? `: ${detail}` : ""}`);
|
|
54
|
+
}
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Runs the post-scaffold git + gh chain. Assumes the caller has already
|
|
59
|
+
* verified that paid features are allowed (cli.ts does this before calling).
|
|
60
|
+
*/
|
|
61
|
+
export async function runWithInit(inputs, targetPath, opts = {}) {
|
|
62
|
+
const stdout = opts.stdout ?? process.stdout;
|
|
63
|
+
const stderr = opts.stderr ?? process.stderr;
|
|
64
|
+
const spawnImpl = opts.spawnImpl ?? spawn;
|
|
65
|
+
const repoRef = `${inputs.githubOrg}/${inputs.slug}`;
|
|
66
|
+
const commitMessage = `Initial scaffold via @zero2webmaster/starter-kit (${inputs.slug})`;
|
|
67
|
+
stdout.write(`\n--with-init: setting up ${repoRef} ...\n`);
|
|
68
|
+
await step("git init", "git", ["init", "-b", "main"], targetPath, spawnImpl, stdout);
|
|
69
|
+
await step("git add", "git", ["add", "."], targetPath, spawnImpl, stdout);
|
|
70
|
+
await step("git commit", "git", ["commit", "-m", commitMessage], targetPath, spawnImpl, stdout);
|
|
71
|
+
await step("gh repo create", "gh", [
|
|
72
|
+
"repo",
|
|
73
|
+
"create",
|
|
74
|
+
repoRef,
|
|
75
|
+
"--private",
|
|
76
|
+
"--source=.",
|
|
77
|
+
"--remote=origin",
|
|
78
|
+
"--push",
|
|
79
|
+
], targetPath, spawnImpl, stdout);
|
|
80
|
+
stdout.write(`\n--with-init: ${repoRef} is live at https://github.com/${repoRef} (private).\n`);
|
|
81
|
+
stderr; // (touch: stderr is reserved for future surfacing)
|
|
82
|
+
}
|