@pantoken/scaffold 1.2.0 → 1.3.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/dist/cli.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as scaffoldProject, i as resolveScaffoldPlatform, o as ThemeMode, r as isScaffoldPlatform, s as ThemeVariant, t as SCAFFOLD_PLATFORMS } from "./index-D2-Dhvt8.mjs";
1
+ import { a as resolveScaffoldPlatform, d as ThemeMode, f as ThemeVariant, i as isScaffoldPlatform, l as installAgentAssets, n as ScaffoldPackageManager, o as scaffoldProject, t as SCAFFOLD_PLATFORMS } from "./index-rJolJRZa.mjs";
2
2
  import { Command } from "commander";
3
3
  //#region src/locale.d.ts
4
4
  /** Every locale tag pantoken supports, as `--lang` accepts them. */
@@ -87,6 +87,19 @@ export interface ResolveScaffoldTargetOptions {
87
87
  isTTY?: boolean;
88
88
  t: LocaleLookup["t"];
89
89
  }
90
+ /**
91
+ * Resolves whether to install AI agent assets alongside the scaffold: `--no-ai` always wins
92
+ * (returns false); otherwise defaults to `true`, prompting via clack `confirm()` on a TTY (not
93
+ * --yes) to let the user opt out interactively.
94
+ *
95
+ * @throws ScaffoldCliError when the prompt is cancelled
96
+ */
97
+ export declare function resolveAiAssets(opts: {
98
+ yes?: boolean;
99
+ isTTY: boolean;
100
+ noAi?: boolean;
101
+ t: LocaleLookup["t"];
102
+ }): Promise<boolean>;
90
103
  /**
91
104
  * Resolves platform + directory: prompts via clack select()/text() when omitted on a TTY
92
105
  * (not --yes); throws ScaffoldCliError with a clear, localized message when a required
@@ -116,6 +129,7 @@ export declare function scaffoldWithSpinner(platform: string, dir: string, t: Lo
116
129
  mode?: ThemeMode;
117
130
  cdn?: string;
118
131
  locale?: string;
132
+ packageManager?: ScaffoldPackageManager;
119
133
  }): Promise<string[]>;
120
134
  /** Package managers `detectPackageManager` can identify. */
121
135
  export type PackageManager = "npm" | "pnpm" | "yarn" | "bun" | "deno" | "vp";
@@ -139,6 +153,10 @@ export declare function detectPackageManager(env?: NodeJS.ProcessEnv, execPath?:
139
153
  export declare function buildCreateUsageCommand(pm?: PackageManager): string;
140
154
  /**
141
155
  * Runs the detected package manager's install command in `dir`, wrapped in a clack spinner.
156
+ * Runs via async `spawn` (not `execFileSync`) so the spinner can actually animate while installing
157
+ * — a synchronous child process blocks the event loop and freezes the spinner's frames, making the
158
+ * CLI look hung even though it's working. Output is still suppressed (`stdio: "ignore"`); only the
159
+ * spinner's own text animates, updated periodically with the elapsed time.
142
160
  * Failures are reported but non-fatal — the project is still usable, just not installed — so the
143
161
  * caller decides how `printNextSteps` should reflect the outcome via the returned boolean.
144
162
  *
@@ -147,7 +165,7 @@ export declare function buildCreateUsageCommand(pm?: PackageManager): string;
147
165
  * @param t - Localized string lookup
148
166
  * @returns Whether the install command exited successfully
149
167
  */
150
- export declare function installWithSpinner(dir: string, pm: PackageManager | undefined, t: LocaleLookup["t"]): boolean;
168
+ export declare function installWithSpinner(dir: string, pm: PackageManager | undefined, t: LocaleLookup["t"]): Promise<boolean>;
151
169
  /**
152
170
  * Prints the post-scaffold "Next steps" block (plus any template-authored notes/caveats).
153
171
  *
@@ -156,7 +174,8 @@ export declare function installWithSpinner(dir: string, pm: PackageManager | und
156
174
  * needed — regardless of platform. Otherwise, when `platform` has a `scaffold.json`-derived entry in
157
175
  * `SCAFFOLD_METADATA`, next steps/notes/caveats are rendered from its (localized, `{{var}}`-
158
176
  * substituted) authored strings; failing that, a generic cd/install/run-script fallback is used,
159
- * with the run script itself detected from the scaffolded `package.json` (`dev`, else `preview`).
177
+ * with the run script itself detected from the scaffolded `package.json` (`dev`, else `preview`)
178
+ * or defaulted to `dev` for scaffolded app templates.
160
179
  *
161
180
  * @param dir - The scaffold directory
162
181
  * @param written - The paths written by scaffoldProject
@@ -207,4 +226,4 @@ export declare function runScaffoldCli(argv: string[], options: {
207
226
  version?: string;
208
227
  }): Promise<void>;
209
228
  //#endregion
210
- export { type LocaleLookup, SCAFFOLD_PLATFORMS, isScaffoldPlatform, resolveScaffoldPlatform, scaffoldProject };
229
+ export { type LocaleLookup, SCAFFOLD_PLATFORMS, installAgentAssets, isScaffoldPlatform, resolveScaffoldPlatform, scaffoldProject };