wp-typia 0.19.0 → 0.20.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.
Files changed (43) hide show
  1. package/README.md +4 -2
  2. package/dist-bunli/.bunli/commands.gen.js +2117 -1465
  3. package/dist-bunli/.bunli/commands.gen.js.map +42 -35
  4. package/dist-bunli/cli-03j0axbt.js +163 -0
  5. package/dist-bunli/cli-03j0axbt.js.map +11 -0
  6. package/dist-bunli/{cli-yw0mq0wq.js → cli-93wd227r.js} +108 -3
  7. package/dist-bunli/cli-93wd227r.js.map +10 -0
  8. package/dist-bunli/{cli-kan7a6db.js → cli-a6dwqnhq.js} +24 -2
  9. package/dist-bunli/cli-a6dwqnhq.js.map +11 -0
  10. package/dist-bunli/{cli-add-j2c81sh1.js → cli-add-gcwww85p.js} +263 -250
  11. package/dist-bunli/cli-add-gcwww85p.js.map +18 -0
  12. package/dist-bunli/{cli-7svz19s1.js → cli-cfx3gm1r.js} +417 -129
  13. package/dist-bunli/{cli-7svz19s1.js.map → cli-cfx3gm1r.js.map} +18 -15
  14. package/dist-bunli/{cli-diagnostics-c65hhyhx.js → cli-diagnostics-e5gxeprp.js} +8 -4
  15. package/dist-bunli/{cli-diagnostics-c65hhyhx.js.map → cli-diagnostics-e5gxeprp.js.map} +1 -1
  16. package/dist-bunli/{cli-doctor-hft0wr0e.js → cli-doctor-qk6fwpds.js} +14 -13
  17. package/dist-bunli/{cli-doctor-hft0wr0e.js.map → cli-doctor-qk6fwpds.js.map} +3 -3
  18. package/dist-bunli/{cli-572d6g4m.js → cli-hv2yedw2.js} +2 -157
  19. package/dist-bunli/{cli-572d6g4m.js.map → cli-hv2yedw2.js.map} +4 -6
  20. package/dist-bunli/cli-mgh3f3k5.js +427 -0
  21. package/dist-bunli/cli-mgh3f3k5.js.map +12 -0
  22. package/dist-bunli/{cli-scaffold-vcg6wem5.js → cli-scaffold-f1bdt68d.js} +9 -7
  23. package/dist-bunli/cli-scaffold-f1bdt68d.js.map +10 -0
  24. package/dist-bunli/cli-t73q5aqz.js +103 -0
  25. package/dist-bunli/cli-t73q5aqz.js.map +10 -0
  26. package/dist-bunli/{cli-templates-4qxszbmc.js → cli-templates-j65r4k9v.js} +1 -1
  27. package/dist-bunli/{cli-wtrvnce5.js → cli-w4r0rr8a.js} +8 -8
  28. package/dist-bunli/cli-w4r0rr8a.js.map +10 -0
  29. package/dist-bunli/cli.js +127 -2863
  30. package/dist-bunli/cli.js.map +5 -56
  31. package/dist-bunli/command-list-66cqt7y8.js +2485 -0
  32. package/dist-bunli/command-list-66cqt7y8.js.map +58 -0
  33. package/dist-bunli/node-cli.js +432 -323
  34. package/dist-bunli/node-cli.js.map +11 -10
  35. package/dist-bunli/{sync-x91y9jtv.js → sync-k2k8svyc.js} +3 -2
  36. package/dist-bunli/{sync-x91y9jtv.js.map → sync-k2k8svyc.js.map} +1 -1
  37. package/package.json +6 -3
  38. package/dist-bunli/cli-add-j2c81sh1.js.map +0 -16
  39. package/dist-bunli/cli-kan7a6db.js.map +0 -11
  40. package/dist-bunli/cli-scaffold-vcg6wem5.js.map +0 -10
  41. package/dist-bunli/cli-wtrvnce5.js.map +0 -10
  42. package/dist-bunli/cli-yw0mq0wq.js.map +0 -10
  43. /package/dist-bunli/{cli-templates-4qxszbmc.js.map → cli-templates-j65r4k9v.js.map} +0 -0
@@ -0,0 +1,427 @@
1
+ // @bun
2
+ import {
3
+ exports_external
4
+ } from "./cli-hv2yedw2.js";
5
+ // package.json
6
+ var package_default = {
7
+ name: "wp-typia",
8
+ version: "0.20.1",
9
+ description: "Canonical CLI package for wp-typia scaffolding and project workflows",
10
+ packageManager: "bun@1.3.11",
11
+ type: "module",
12
+ bin: {
13
+ "wp-typia": "bin/wp-typia.js"
14
+ },
15
+ files: [
16
+ "bin/",
17
+ "dist-bunli/",
18
+ "README.md",
19
+ "package.json"
20
+ ],
21
+ scripts: {
22
+ generate: "bun scripts/generate-bunli-metadata.ts",
23
+ build: "bun run generate && bun scripts/build-bunli-runtime.ts",
24
+ "build:standalone": "bun scripts/build-standalone-runtime.ts --targets native --outdir ./dist-standalone",
25
+ "build:standalone:release": "bun scripts/build-standalone-runtime.ts --targets darwin-arm64,darwin-x64,linux-arm64,linux-x64,windows-x64 --outdir ./.cache/standalone/raw",
26
+ "bunli:generate": "bun run generate",
27
+ "bunli:build": "bun run build",
28
+ "bunli:dev": "bun src/cli.ts",
29
+ "bunli:test": "bun test tests/*.test.ts",
30
+ dev: "bun run build && node bin/wp-typia.js",
31
+ "standalone:prepare-release-assets": "bun scripts/prepare-standalone-release-assets.ts --input-dir ./.cache/standalone/raw --outdir ./.cache/standalone/release-assets",
32
+ test: "cd ../wp-typia-project-tools && bun run build && cd ../wp-typia && bun run build && bun test tests/*.test.ts",
33
+ "test:coverage": "cd ../wp-typia-project-tools && bun run build && cd ../wp-typia && bun run build && bun test tests/*.test.ts --coverage --coverage-reporter=lcov --coverage-dir=coverage",
34
+ clean: "rm -rf .bunli .cache/standalone dist-bunli dist-standalone",
35
+ prepack: "bun run build"
36
+ },
37
+ keywords: [
38
+ "wordpress",
39
+ "gutenberg",
40
+ "typia",
41
+ "cli",
42
+ "scaffold",
43
+ "templates"
44
+ ],
45
+ author: "imjlk",
46
+ license: "GPL-2.0-or-later",
47
+ repository: {
48
+ type: "git",
49
+ url: "git+https://github.com/imjlk/wp-typia.git",
50
+ directory: "packages/wp-typia"
51
+ },
52
+ bugs: {
53
+ url: "https://github.com/imjlk/wp-typia/issues"
54
+ },
55
+ homepage: "https://github.com/imjlk/wp-typia/tree/main/packages/wp-typia#readme",
56
+ publishConfig: {
57
+ access: "public"
58
+ },
59
+ engines: {
60
+ bun: ">=1.3.11",
61
+ node: ">=20.0.0",
62
+ npm: ">=10.0.0"
63
+ },
64
+ dependencies: {
65
+ "@bunli/core": "0.9.0",
66
+ "@bunli/plugin-ai-detect": "0.6.4",
67
+ "@bunli/plugin-completions": "0.3.5",
68
+ "@bunli/plugin-config": "0.4.4",
69
+ "@bunli/plugin-mcp": "0.2.5",
70
+ "@bunli/plugin-skills": "0.1.0",
71
+ "@bunli/runtime": "0.3.1",
72
+ "@bunli/tui": "0.6.0",
73
+ "@bunli/utils": "0.6.0",
74
+ "@wp-typia/api-client": "^0.4.5",
75
+ "@wp-typia/project-tools": "0.19.2",
76
+ "better-result": "^2.7.0",
77
+ react: "^19.2.5",
78
+ "react-dom": "^19.2.5",
79
+ zod: "4.3.6"
80
+ },
81
+ devDependencies: {
82
+ "@bunli/generator": "0.6.5",
83
+ "@bunli/test": "0.6.0",
84
+ bunli: "0.9.0",
85
+ typescript: "^5.9.2"
86
+ },
87
+ optionalDependencies: {
88
+ "@opentui/core-darwin-arm64": "0.1.97",
89
+ "@opentui/core-darwin-x64": "0.1.97",
90
+ "@opentui/core-linux-arm64": "0.1.97",
91
+ "@opentui/core-linux-x64": "0.1.97",
92
+ "@opentui/core-win32-arm64": "0.1.97",
93
+ "@opentui/core-win32-x64": "0.1.97"
94
+ }
95
+ };
96
+
97
+ // src/config.ts
98
+ import fs from "fs/promises";
99
+ import os from "os";
100
+ import path from "path";
101
+ import { isPlainObject as isRecord } from "@wp-typia/api-client/runtime-primitives";
102
+ var WP_TYPIA_CONFIG_SOURCES = [
103
+ "~/.config/wp-typia/config.json",
104
+ ".wp-typiarc",
105
+ ".wp-typiarc.json"
106
+ ];
107
+ function deepMerge(base, incoming) {
108
+ const merged = { ...base };
109
+ for (const [key, value] of Object.entries(incoming)) {
110
+ if (Array.isArray(value)) {
111
+ merged[key] = value.slice();
112
+ continue;
113
+ }
114
+ if (isRecord(value) && isRecord(merged[key])) {
115
+ merged[key] = deepMerge(merged[key], value);
116
+ continue;
117
+ }
118
+ merged[key] = value;
119
+ }
120
+ return merged;
121
+ }
122
+ async function readJsonFile(filePath) {
123
+ try {
124
+ const source = await fs.readFile(filePath, "utf8");
125
+ const parsed = JSON.parse(source);
126
+ return isRecord(parsed) ? parsed : null;
127
+ } catch (error) {
128
+ if (typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT") {
129
+ return null;
130
+ }
131
+ throw error;
132
+ }
133
+ }
134
+ function resolveConfigPath(cwd, source) {
135
+ if (source.startsWith("~/")) {
136
+ return path.join(os.homedir(), source.slice(2));
137
+ }
138
+ return path.resolve(cwd, source);
139
+ }
140
+ function mergeWpTypiaUserConfig(base, incoming) {
141
+ return deepMerge(base, incoming);
142
+ }
143
+ async function loadWpTypiaUserConfigFromSource(cwd, source) {
144
+ const config = await readJsonFile(resolveConfigPath(cwd, source));
145
+ return config ?? {};
146
+ }
147
+ async function loadWpTypiaUserConfig(cwd) {
148
+ let merged = {};
149
+ for (const source of WP_TYPIA_CONFIG_SOURCES) {
150
+ const configPath = resolveConfigPath(cwd, source);
151
+ const config = await readJsonFile(configPath);
152
+ if (config) {
153
+ merged = deepMerge(merged, config);
154
+ }
155
+ }
156
+ const packageJson = await readJsonFile(path.join(cwd, "package.json"));
157
+ if (packageJson && isRecord(packageJson["wp-typia"])) {
158
+ merged = deepMerge(merged, packageJson["wp-typia"]);
159
+ }
160
+ return merged;
161
+ }
162
+ function getCreateDefaults(config) {
163
+ return config.create ?? {};
164
+ }
165
+ function getAddBlockDefaults(config) {
166
+ return config.add?.block ?? {};
167
+ }
168
+ function getMcpSchemaSources(config) {
169
+ return config.mcp?.schemaSources ?? [];
170
+ }
171
+
172
+ // ../../node_modules/.bun/@bunli+core@0.9.0+44deef6f8e4a2f18/node_modules/@bunli/core/src/plugin/create.ts
173
+ function createPlugin(input) {
174
+ return input;
175
+ }
176
+ // src/command-option-metadata.ts
177
+ var CREATE_OPTION_METADATA = {
178
+ "alternate-render-targets": {
179
+ description: "Comma-separated alternate render targets for dynamic block scaffolds (email,mjml,plain-text).",
180
+ type: "string"
181
+ },
182
+ "data-storage": {
183
+ description: "Persistence storage mode for persistence-capable templates.",
184
+ type: "string"
185
+ },
186
+ "dry-run": {
187
+ argumentKind: "flag",
188
+ description: "Preview scaffold output for a logical <project-dir> without writing files to the target directory.",
189
+ type: "boolean"
190
+ },
191
+ "external-layer-id": {
192
+ description: "Explicit layer id when an external layer package exposes multiple selectable layers.",
193
+ type: "string"
194
+ },
195
+ "external-layer-source": {
196
+ description: "Local path, GitHub locator, or npm package that exposes wp-typia.layers.json for built-in templates.",
197
+ type: "string"
198
+ },
199
+ "inner-blocks-preset": {
200
+ description: "Compound-only InnerBlocks preset (freeform, ordered, horizontal, locked-structure).",
201
+ type: "string"
202
+ },
203
+ namespace: {
204
+ description: "Override the default block namespace.",
205
+ type: "string"
206
+ },
207
+ "no-install": {
208
+ argumentKind: "flag",
209
+ description: "Skip dependency installation after scaffold.",
210
+ type: "boolean"
211
+ },
212
+ "package-manager": {
213
+ description: "Package manager to use for install and scripts.",
214
+ short: "p",
215
+ type: "string"
216
+ },
217
+ "persistence-policy": {
218
+ description: "Authenticated or public write policy for persistence-capable templates.",
219
+ type: "string"
220
+ },
221
+ "php-prefix": {
222
+ description: "Custom PHP symbol prefix.",
223
+ type: "string"
224
+ },
225
+ "query-post-type": {
226
+ description: "Default post type assigned to Query Loop variation scaffolds.",
227
+ type: "string"
228
+ },
229
+ template: {
230
+ description: "Template id or external template package.",
231
+ short: "t",
232
+ type: "string"
233
+ },
234
+ "text-domain": {
235
+ description: "Custom text domain for the generated project.",
236
+ type: "string"
237
+ },
238
+ variant: {
239
+ description: "Optional template variant identifier.",
240
+ type: "string"
241
+ },
242
+ "with-migration-ui": {
243
+ argumentKind: "flag",
244
+ description: "Enable migration UI support when the template supports it.",
245
+ type: "boolean"
246
+ },
247
+ "with-test-preset": {
248
+ argumentKind: "flag",
249
+ description: "Include the Playwright smoke-test preset.",
250
+ type: "boolean"
251
+ },
252
+ "with-wp-env": {
253
+ argumentKind: "flag",
254
+ description: "Include a local wp-env preset.",
255
+ type: "boolean"
256
+ },
257
+ yes: {
258
+ argumentKind: "flag",
259
+ description: "Accept defaults without prompt fallbacks.",
260
+ short: "y",
261
+ type: "boolean"
262
+ }
263
+ };
264
+ var ADD_OPTION_METADATA = {
265
+ "alternate-render-targets": {
266
+ description: "Comma-separated alternate render targets for dynamic block scaffolds (email,mjml,plain-text).",
267
+ type: "string"
268
+ },
269
+ anchor: {
270
+ description: "Anchor block name for hooked-block workflows.",
271
+ type: "string"
272
+ },
273
+ block: {
274
+ description: "Target block slug for variation workflows.",
275
+ type: "string"
276
+ },
277
+ "data-storage": {
278
+ description: "Persistence storage mode for persistence-capable templates.",
279
+ type: "string"
280
+ },
281
+ "dry-run": {
282
+ argumentKind: "flag",
283
+ description: "Preview workspace file updates and completion guidance without writing them.",
284
+ type: "boolean"
285
+ },
286
+ "external-layer-id": {
287
+ description: "Explicit layer id when an external layer package exposes multiple selectable layers.",
288
+ type: "string"
289
+ },
290
+ "external-layer-source": {
291
+ description: "Local path, GitHub locator, or npm package that exposes wp-typia.layers.json for built-in block templates.",
292
+ type: "string"
293
+ },
294
+ "inner-blocks-preset": {
295
+ description: "Compound-only InnerBlocks preset (freeform, ordered, horizontal, locked-structure).",
296
+ type: "string"
297
+ },
298
+ methods: {
299
+ description: "Comma-separated REST resource methods for rest-resource workflows.",
300
+ type: "string"
301
+ },
302
+ namespace: {
303
+ description: "REST namespace for rest-resource workflows.",
304
+ type: "string"
305
+ },
306
+ "persistence-policy": {
307
+ description: "Persistence write policy for persistence-capable templates.",
308
+ type: "string"
309
+ },
310
+ position: {
311
+ description: "Hook position for hooked-block workflows.",
312
+ type: "string"
313
+ },
314
+ slot: {
315
+ description: "Document editor shell slot for editor-plugin workflows.",
316
+ type: "string"
317
+ },
318
+ template: {
319
+ description: "Built-in block family for the new block.",
320
+ type: "string"
321
+ }
322
+ };
323
+ var MIGRATE_OPTION_METADATA = {
324
+ all: {
325
+ argumentKind: "flag",
326
+ description: "Run across every configured migration version and block target.",
327
+ type: "boolean"
328
+ },
329
+ "current-migration-version": {
330
+ description: "Current migration version label for `migrate init`.",
331
+ type: "string"
332
+ },
333
+ force: {
334
+ argumentKind: "flag",
335
+ description: "Force overwrite behavior where supported.",
336
+ type: "boolean"
337
+ },
338
+ "from-migration-version": {
339
+ description: "Source migration version label.",
340
+ type: "string"
341
+ },
342
+ iterations: {
343
+ description: "Iteration count for `migrate fuzz`.",
344
+ type: "string"
345
+ },
346
+ "migration-version": {
347
+ description: "Version label to capture with `migrate snapshot`.",
348
+ type: "string"
349
+ },
350
+ seed: {
351
+ description: "Deterministic fuzz seed.",
352
+ type: "string"
353
+ },
354
+ "to-migration-version": {
355
+ description: "Target migration version label.",
356
+ type: "string"
357
+ }
358
+ };
359
+ var TEMPLATES_OPTION_METADATA = {
360
+ id: {
361
+ description: "Template id for `templates inspect`.",
362
+ type: "string"
363
+ }
364
+ };
365
+ var GLOBAL_OPTION_METADATA = {
366
+ config: {
367
+ description: "Config override file path.",
368
+ short: "c",
369
+ type: "string"
370
+ },
371
+ format: {
372
+ description: "Output format for supported commands.",
373
+ type: "string"
374
+ },
375
+ id: {
376
+ description: "Template id for top-level `templates inspect` convenience.",
377
+ type: "string"
378
+ },
379
+ "output-dir": {
380
+ description: "Output directory for generated MCP metadata.",
381
+ type: "string"
382
+ }
383
+ };
384
+ function buildCommandOptions(metadata) {
385
+ return Object.fromEntries(Object.entries(metadata).map(([name, option]) => [
386
+ name,
387
+ {
388
+ ...option.argumentKind ? { argumentKind: option.argumentKind } : {},
389
+ description: option.description,
390
+ schema: option.type === "boolean" ? exports_external.boolean().default(false) : exports_external.string().optional(),
391
+ ...option.short ? { short: option.short } : {}
392
+ }
393
+ ]));
394
+ }
395
+ function collectOptionNamesByType(metadata, type) {
396
+ return Object.entries(metadata).filter(([, option]) => option.type === type).map(([name]) => name);
397
+ }
398
+ function buildCommandOptionParser(...metadataMaps) {
399
+ const metadata = Object.assign({}, ...metadataMaps);
400
+ return {
401
+ booleanOptionNames: new Set(collectOptionNamesByType(metadata, "boolean")),
402
+ shortFlagMap: new Map(Object.entries(metadata).flatMap(([name, option]) => option.short ? [[option.short, { name, type: option.type }]] : [])),
403
+ stringOptionNames: new Set(collectOptionNamesByType(metadata, "string"))
404
+ };
405
+ }
406
+ function resolveCommandOptionValues(metadata, options) {
407
+ const resolved = {};
408
+ const optionNames = options.optionNames ?? Object.keys(metadata);
409
+ for (const optionName of optionNames) {
410
+ const name = String(optionName);
411
+ const descriptor = metadata[name];
412
+ if (!descriptor) {
413
+ continue;
414
+ }
415
+ const value = options.flags?.[name] ?? options.defaults?.[name];
416
+ if (descriptor.type === "boolean") {
417
+ resolved[name] = Boolean(value ?? false);
418
+ continue;
419
+ }
420
+ resolved[name] = typeof value === "string" ? value : undefined;
421
+ }
422
+ return resolved;
423
+ }
424
+
425
+ export { createPlugin, package_default, CREATE_OPTION_METADATA, ADD_OPTION_METADATA, MIGRATE_OPTION_METADATA, TEMPLATES_OPTION_METADATA, GLOBAL_OPTION_METADATA, buildCommandOptions, collectOptionNamesByType, buildCommandOptionParser, resolveCommandOptionValues, WP_TYPIA_CONFIG_SOURCES, mergeWpTypiaUserConfig, loadWpTypiaUserConfigFromSource, loadWpTypiaUserConfig, getCreateDefaults, getAddBlockDefaults, getMcpSchemaSources };
426
+
427
+ //# debugId=8B53E867A839C4BD64756E2164756E21
@@ -0,0 +1,12 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/config.ts", "../../../node_modules/.bun/@bunli+core@0.9.0+44deef6f8e4a2f18/node_modules/@bunli/core/src/plugin/create.ts", "../src/command-option-metadata.ts"],
4
+ "sourcesContent": [
5
+ "import fs from \"node:fs/promises\";\nimport os from \"node:os\";\nimport path from \"node:path\";\n\nimport { isPlainObject as isRecord } from \"@wp-typia/api-client/runtime-primitives\";\n\nexport type WpTypiaSchemaSource = {\n\tnamespace: string;\n\tpath: string;\n};\n\nexport type WpTypiaUserConfig = {\n\tcreate?: {\n\t\t\"alternate-render-targets\"?: string;\n\t\t\"inner-blocks-preset\"?: string;\n\t\t\"data-storage\"?: string;\n\t\t\"dry-run\"?: boolean;\n\t\t\"external-layer-id\"?: string;\n\t\t\"external-layer-source\"?: string;\n\t\tnamespace?: string;\n\t\t\"no-install\"?: boolean;\n\t\t\"package-manager\"?: string;\n\t\t\"persistence-policy\"?: string;\n\t\t\"php-prefix\"?: string;\n\t\t\"query-post-type\"?: string;\n\t\ttemplate?: string;\n\t\t\"text-domain\"?: string;\n\t\tvariant?: string;\n\t\t\"with-migration-ui\"?: boolean;\n\t\t\"with-test-preset\"?: boolean;\n\t\t\"with-wp-env\"?: boolean;\n\t\tyes?: boolean;\n\t};\n\tadd?: {\n\t\tblock?: {\n\t\t\t\"alternate-render-targets\"?: string;\n\t\t\t\"data-storage\"?: string;\n\t\t\t\"external-layer-id\"?: string;\n\t\t\t\"external-layer-source\"?: string;\n\t\t\t\"inner-blocks-preset\"?: string;\n\t\t\t\"persistence-policy\"?: string;\n\t\t\ttemplate?: string;\n\t\t};\n\t};\n\tmcp?: {\n\t\tschemaSources?: WpTypiaSchemaSource[];\n\t};\n};\n\nexport const WP_TYPIA_CONFIG_SOURCES = [\n\t\"~/.config/wp-typia/config.json\",\n\t\".wp-typiarc\",\n\t\".wp-typiarc.json\",\n] as const;\ntype JsonRecord = Record<string, unknown>;\n\nfunction deepMerge<T extends JsonRecord>(base: T, incoming: JsonRecord): T {\n\tconst merged: JsonRecord = { ...base };\n\n\tfor (const [key, value] of Object.entries(incoming)) {\n\t\tif (Array.isArray(value)) {\n\t\t\tmerged[key] = value.slice();\n\t\t\tcontinue;\n\t\t}\n\t\tif (isRecord(value) && isRecord(merged[key])) {\n\t\t\tmerged[key] = deepMerge(merged[key] as JsonRecord, value);\n\t\t\tcontinue;\n\t\t}\n\t\tmerged[key] = value;\n\t}\n\n\treturn merged as T;\n}\n\nasync function readJsonFile(filePath: string): Promise<JsonRecord | null> {\n\ttry {\n\t\tconst source = await fs.readFile(filePath, \"utf8\");\n\t\tconst parsed = JSON.parse(source);\n\t\treturn isRecord(parsed) ? parsed : null;\n\t} catch (error) {\n\t\tif (\n\t\t\ttypeof error === \"object\" &&\n\t\t\terror !== null &&\n\t\t\t\"code\" in error &&\n\t\t\terror.code === \"ENOENT\"\n\t\t) {\n\t\t\treturn null;\n\t\t}\n\t\tthrow error;\n\t}\n}\n\nfunction resolveConfigPath(cwd: string, source: string): string {\n\tif (source.startsWith(\"~/\")) {\n\t\treturn path.join(os.homedir(), source.slice(2));\n\t}\n\treturn path.resolve(cwd, source);\n}\n\nexport function mergeWpTypiaUserConfig(\n\tbase: WpTypiaUserConfig,\n\tincoming: WpTypiaUserConfig,\n): WpTypiaUserConfig {\n\treturn deepMerge(base as JsonRecord, incoming as JsonRecord) as WpTypiaUserConfig;\n}\n\nexport async function loadWpTypiaUserConfigFromSource(\n\tcwd: string,\n\tsource: string,\n): Promise<WpTypiaUserConfig> {\n\tconst config = await readJsonFile(resolveConfigPath(cwd, source));\n\treturn (config ?? {}) as WpTypiaUserConfig;\n}\n\nexport async function loadWpTypiaUserConfig(cwd: string): Promise<WpTypiaUserConfig> {\n\tlet merged: JsonRecord = {};\n\n\tfor (const source of WP_TYPIA_CONFIG_SOURCES) {\n\t\tconst configPath = resolveConfigPath(cwd, source);\n\t\tconst config = await readJsonFile(configPath);\n\t\tif (config) {\n\t\t\tmerged = deepMerge(merged, config);\n\t\t}\n\t}\n\n\tconst packageJson = await readJsonFile(path.join(cwd, \"package.json\"));\n\tif (packageJson && isRecord(packageJson[\"wp-typia\"])) {\n\t\tmerged = deepMerge(merged, packageJson[\"wp-typia\"] as JsonRecord);\n\t}\n\n\treturn merged as WpTypiaUserConfig;\n}\n\nexport function getCreateDefaults(config: WpTypiaUserConfig): NonNullable<WpTypiaUserConfig[\"create\"]> {\n\treturn config.create ?? {};\n}\n\nexport function getAddBlockDefaults(\n\tconfig: WpTypiaUserConfig,\n): NonNullable<NonNullable<WpTypiaUserConfig[\"add\"]>[\"block\"]> {\n\treturn config.add?.block ?? {};\n}\n\nexport function getMcpSchemaSources(config: WpTypiaUserConfig): WpTypiaSchemaSource[] {\n\treturn config.mcp?.schemaSources ?? [];\n}\n",
6
+ "/**\n * Plugin development utilities\n */\n\nimport type { BunliPlugin, PluginFactory, MergeStores } from './types.js'\n\n/**\n * Create a plugin - supports both direct plugins and plugin factories\n * \n * @example Direct plugin with explicit store type:\n * ```typescript\n * interface MyStore {\n * count: number\n * message: string\n * }\n * \n * const myPlugin = createPlugin<MyStore>({\n * name: 'my-plugin',\n * store: {\n * count: 0,\n * message: ''\n * },\n * beforeCommand(context) {\n * context.store.count++ // TypeScript knows the type!\n * }\n * })\n * ```\n * \n * @example Plugin factory with options:\n * ```typescript\n * const myPlugin = createPlugin((options: { prefix: string }) => ({\n * name: 'my-plugin',\n * store: {\n * count: 0\n * },\n * beforeCommand(context) {\n * console.log(`${options.prefix}: ${context.store.count}`)\n * }\n * } satisfies BunliPlugin<{ count: number }>))\n * \n * // Use it:\n * myPlugin({ prefix: 'Hello' })\n * ```\n */\nexport function createPlugin<TOptions, TStore = {}>(\n factory: (options: TOptions) => BunliPlugin<TStore>\n): (options: TOptions) => BunliPlugin<TStore>\n\n// Overload for direct plugin\nexport function createPlugin<TStore = {}>(\n plugin: BunliPlugin<TStore>\n): BunliPlugin<TStore>\n\nexport function createPlugin<T>(\n input: T\n): T {\n return input\n}\n\n/**\n * Infer plugin options type from a plugin factory\n * \n * @example\n * ```typescript\n * type Options = InferPluginOptions<typeof myPlugin>\n * ```\n */\nexport type InferPluginOptions<T> = T extends PluginFactory<infer O, any> ? O : never\n\n/**\n * Infer plugin store type\n * \n * @example\n * ```typescript\n * type Store = InferPluginStore<typeof myPlugin>\n * ```\n */\nexport type InferPluginStore<T> = T extends BunliPlugin<infer S> ? S : T extends PluginFactory<any, infer S> ? S : {}\n\n/**\n * Create a test plugin for development and testing\n * \n * @example\n * ```typescript\n * const testPlugin = createTestPlugin(\n * { count: 0, message: '' },\n * {\n * beforeCommand(context) {\n * context.store.count++\n * console.log(`Count: ${context.store.count}`)\n * }\n * }\n * )\n * ```\n */\nexport function createTestPlugin<TStore = {}>(\n store: TStore,\n hooks: Partial<BunliPlugin<TStore>>\n): BunliPlugin<TStore> {\n return {\n name: 'test-plugin',\n version: '1.0.0',\n store,\n ...hooks\n }\n}\n\n/**\n * Compose multiple plugins into a single plugin\n * \n * @example\n * ```typescript\n * const composedPlugin = composePlugins(\n * authPlugin({ provider: 'github' }),\n * loggingPlugin({ level: 'debug' }),\n * metricsPlugin({ enabled: true })\n * )\n * ```\n */\nexport function composePlugins<T extends BunliPlugin[]>(\n ...plugins: T\n): BunliPlugin<MergeStores<T>> {\n const composedStore = plugins.reduce((acc, plugin) => {\n if (plugin.store) {\n return { ...acc, ...plugin.store }\n }\n return acc\n }, {} as MergeStores<T>)\n\n return {\n name: 'composed-plugin',\n version: '1.0.0',\n store: composedStore,\n async setup(context) {\n for (const plugin of plugins) {\n if (plugin.setup) {\n await plugin.setup(context)\n }\n }\n },\n async configResolved(config) {\n for (const plugin of plugins) {\n if (plugin.configResolved) {\n await plugin.configResolved(config)\n }\n }\n },\n async beforeCommand(context) {\n for (const plugin of plugins) {\n if (plugin.beforeCommand) {\n await plugin.beforeCommand(context)\n }\n }\n },\n async afterCommand(context) {\n for (const plugin of plugins) {\n if (plugin.afterCommand) {\n await plugin.afterCommand(context)\n }\n }\n }\n }\n}\n",
7
+ "import { z } from \"zod\";\n\nexport type CommandOptionMetadata = {\n\targumentKind?: \"flag\";\n\tdescription: string;\n\tshort?: string;\n\ttype: \"boolean\" | \"string\";\n};\n\ntype CommandOptionMetadataMap = Record<string, CommandOptionMetadata>;\ntype ParsedCommandArgv = {\n\tflags: Record<string, unknown>;\n\tpositionals: string[];\n};\ntype ShortOptionDescriptor = {\n\tname: string;\n\ttype: CommandOptionMetadata[\"type\"];\n};\ntype CommandOptionParser = {\n\tbooleanOptionNames: Set<string>;\n\tshortFlagMap: Map<string, ShortOptionDescriptor>;\n\tstringOptionNames: Set<string>;\n};\n\n/**\n * Shared `wp-typia create` option metadata used by both the Bunli command\n * definitions and the Node fallback parser/help surface.\n */\nexport const CREATE_OPTION_METADATA = {\n\t\"alternate-render-targets\": {\n\t\tdescription:\n\t\t\t\"Comma-separated alternate render targets for dynamic block scaffolds (email,mjml,plain-text).\",\n\t\ttype: \"string\",\n\t},\n\t\"data-storage\": {\n\t\tdescription: \"Persistence storage mode for persistence-capable templates.\",\n\t\ttype: \"string\",\n\t},\n\t\"dry-run\": {\n\t\targumentKind: \"flag\",\n\t\tdescription:\n\t\t\t\"Preview scaffold output for a logical <project-dir> without writing files to the target directory.\",\n\t\ttype: \"boolean\",\n\t},\n\t\"external-layer-id\": {\n\t\tdescription: \"Explicit layer id when an external layer package exposes multiple selectable layers.\",\n\t\ttype: \"string\",\n\t},\n\t\"external-layer-source\": {\n\t\tdescription: \"Local path, GitHub locator, or npm package that exposes wp-typia.layers.json for built-in templates.\",\n\t\ttype: \"string\",\n\t},\n\t\"inner-blocks-preset\": {\n\t\tdescription:\n\t\t\t\"Compound-only InnerBlocks preset (freeform, ordered, horizontal, locked-structure).\",\n\t\ttype: \"string\",\n\t},\n\tnamespace: {\n\t\tdescription: \"Override the default block namespace.\",\n\t\ttype: \"string\",\n\t},\n\t\"no-install\": {\n\t\targumentKind: \"flag\",\n\t\tdescription: \"Skip dependency installation after scaffold.\",\n\t\ttype: \"boolean\",\n\t},\n\t\"package-manager\": {\n\t\tdescription: \"Package manager to use for install and scripts.\",\n\t\tshort: \"p\",\n\t\ttype: \"string\",\n\t},\n\t\"persistence-policy\": {\n\t\tdescription: \"Authenticated or public write policy for persistence-capable templates.\",\n\t\ttype: \"string\",\n\t},\n\t\"php-prefix\": {\n\t\tdescription: \"Custom PHP symbol prefix.\",\n\t\ttype: \"string\",\n\t},\n\t\"query-post-type\": {\n\t\tdescription: \"Default post type assigned to Query Loop variation scaffolds.\",\n\t\ttype: \"string\",\n\t},\n\ttemplate: {\n\t\tdescription: \"Template id or external template package.\",\n\t\tshort: \"t\",\n\t\ttype: \"string\",\n\t},\n\t\"text-domain\": {\n\t\tdescription: \"Custom text domain for the generated project.\",\n\t\ttype: \"string\",\n\t},\n\tvariant: {\n\t\tdescription: \"Optional template variant identifier.\",\n\t\ttype: \"string\",\n\t},\n\t\"with-migration-ui\": {\n\t\targumentKind: \"flag\",\n\t\tdescription: \"Enable migration UI support when the template supports it.\",\n\t\ttype: \"boolean\",\n\t},\n\t\"with-test-preset\": {\n\t\targumentKind: \"flag\",\n\t\tdescription: \"Include the Playwright smoke-test preset.\",\n\t\ttype: \"boolean\",\n\t},\n\t\"with-wp-env\": {\n\t\targumentKind: \"flag\",\n\t\tdescription: \"Include a local wp-env preset.\",\n\t\ttype: \"boolean\",\n\t},\n\tyes: {\n\t\targumentKind: \"flag\",\n\t\tdescription: \"Accept defaults without prompt fallbacks.\",\n\t\tshort: \"y\",\n\t\ttype: \"boolean\",\n\t},\n} as const satisfies CommandOptionMetadataMap;\n\n/**\n * Shared `wp-typia add` option metadata used by both runtime entry paths.\n */\nexport const ADD_OPTION_METADATA = {\n\t\"alternate-render-targets\": {\n\t\tdescription:\n\t\t\t\"Comma-separated alternate render targets for dynamic block scaffolds (email,mjml,plain-text).\",\n\t\ttype: \"string\",\n\t},\n\tanchor: {\n\t\tdescription: \"Anchor block name for hooked-block workflows.\",\n\t\ttype: \"string\",\n\t},\n\tblock: {\n\t\tdescription: \"Target block slug for variation workflows.\",\n\t\ttype: \"string\",\n\t},\n\t\"data-storage\": {\n\t\tdescription: \"Persistence storage mode for persistence-capable templates.\",\n\t\ttype: \"string\",\n\t},\n\t\"dry-run\": {\n\t\targumentKind: \"flag\",\n\t\tdescription:\n\t\t\t\"Preview workspace file updates and completion guidance without writing them.\",\n\t\ttype: \"boolean\",\n\t},\n\t\"external-layer-id\": {\n\t\tdescription: \"Explicit layer id when an external layer package exposes multiple selectable layers.\",\n\t\ttype: \"string\",\n\t},\n\t\"external-layer-source\": {\n\t\tdescription: \"Local path, GitHub locator, or npm package that exposes wp-typia.layers.json for built-in block templates.\",\n\t\ttype: \"string\",\n\t},\n\t\"inner-blocks-preset\": {\n\t\tdescription:\n\t\t\t\"Compound-only InnerBlocks preset (freeform, ordered, horizontal, locked-structure).\",\n\t\ttype: \"string\",\n\t},\n\tmethods: {\n\t\tdescription: \"Comma-separated REST resource methods for rest-resource workflows.\",\n\t\ttype: \"string\",\n\t},\n\tnamespace: {\n\t\tdescription: \"REST namespace for rest-resource workflows.\",\n\t\ttype: \"string\",\n\t},\n\t\"persistence-policy\": {\n\t\tdescription: \"Persistence write policy for persistence-capable templates.\",\n\t\ttype: \"string\",\n\t},\n\tposition: {\n\t\tdescription: \"Hook position for hooked-block workflows.\",\n\t\ttype: \"string\",\n\t},\n\tslot: {\n\t\tdescription: \"Document editor shell slot for editor-plugin workflows.\",\n\t\ttype: \"string\",\n\t},\n\ttemplate: {\n\t\tdescription: \"Built-in block family for the new block.\",\n\t\ttype: \"string\",\n\t},\n} as const satisfies CommandOptionMetadataMap;\n\n/**\n * Shared `wp-typia migrate` option metadata used by both runtime entry paths.\n */\nexport const MIGRATE_OPTION_METADATA = {\n\tall: {\n\t\targumentKind: \"flag\",\n\t\tdescription: \"Run across every configured migration version and block target.\",\n\t\ttype: \"boolean\",\n\t},\n\t\"current-migration-version\": {\n\t\tdescription: \"Current migration version label for `migrate init`.\",\n\t\ttype: \"string\",\n\t},\n\tforce: {\n\t\targumentKind: \"flag\",\n\t\tdescription: \"Force overwrite behavior where supported.\",\n\t\ttype: \"boolean\",\n\t},\n\t\"from-migration-version\": {\n\t\tdescription: \"Source migration version label.\",\n\t\ttype: \"string\",\n\t},\n\titerations: {\n\t\tdescription: \"Iteration count for `migrate fuzz`.\",\n\t\ttype: \"string\",\n\t},\n\t\"migration-version\": {\n\t\tdescription: \"Version label to capture with `migrate snapshot`.\",\n\t\ttype: \"string\",\n\t},\n\tseed: {\n\t\tdescription: \"Deterministic fuzz seed.\",\n\t\ttype: \"string\",\n\t},\n\t\"to-migration-version\": {\n\t\tdescription: \"Target migration version label.\",\n\t\ttype: \"string\",\n\t},\n} as const satisfies CommandOptionMetadataMap;\n\n/**\n * Shared `wp-typia templates` option metadata.\n */\nexport const TEMPLATES_OPTION_METADATA = {\n\tid: {\n\t\tdescription: \"Template id for `templates inspect`.\",\n\t\ttype: \"string\",\n\t},\n} as const satisfies CommandOptionMetadataMap;\n\n/**\n * Global option metadata used by Node fallback parsing before command dispatch.\n */\nexport const GLOBAL_OPTION_METADATA = {\n\tconfig: {\n\t\tdescription: \"Config override file path.\",\n\t\tshort: \"c\",\n\t\ttype: \"string\",\n\t},\n\tformat: {\n\t\tdescription: \"Output format for supported commands.\",\n\t\ttype: \"string\",\n\t},\n\tid: {\n\t\tdescription: \"Template id for top-level `templates inspect` convenience.\",\n\t\ttype: \"string\",\n\t},\n\t\"output-dir\": {\n\t\tdescription: \"Output directory for generated MCP metadata.\",\n\t\ttype: \"string\",\n\t},\n} as const satisfies CommandOptionMetadataMap;\n\nexport function buildCommandOptions<TOptions extends CommandOptionMetadataMap>(\n\tmetadata: TOptions,\n): Record<string, {\n\targumentKind?: \"flag\";\n\tdescription: string;\n\tschema: z.ZodDefault<z.ZodBoolean> | z.ZodOptional<z.ZodString>;\n\tshort?: string;\n}> {\n\treturn Object.fromEntries(\n\t\tObject.entries(metadata).map(([name, option]) => [\n\t\t\tname,\n\t\t\t{\n\t\t\t\t...(option.argumentKind ? { argumentKind: option.argumentKind } : {}),\n\t\t\t\tdescription: option.description,\n\t\t\t\tschema:\n\t\t\t\t\toption.type === \"boolean\"\n\t\t\t\t\t\t? z.boolean().default(false)\n\t\t\t\t\t\t: z.string().optional(),\n\t\t\t\t...(option.short ? { short: option.short } : {}),\n\t\t\t},\n\t\t]),\n\t);\n}\n\nexport function collectOptionNamesByType(\n\tmetadata: CommandOptionMetadataMap,\n\ttype: CommandOptionMetadata[\"type\"],\n): string[] {\n\treturn Object.entries(metadata)\n\t\t.filter(([, option]) => option.type === type)\n\t\t.map(([name]) => name);\n}\n\nexport function formatNodeFallbackOptionHelp(\n\tmetadata: CommandOptionMetadataMap,\n): string[] {\n\treturn Object.entries(metadata).map(([name, option]) => {\n\t\tconst short = option.short ? `, -${option.short}` : \"\";\n\t\treturn `- --${name}${short}: ${option.description}`;\n\t});\n}\n\nexport function buildCommandOptionParser(\n\t...metadataMaps: CommandOptionMetadataMap[]\n): CommandOptionParser {\n\tconst metadata: CommandOptionMetadataMap = Object.assign({}, ...metadataMaps);\n\n\treturn {\n\t\tbooleanOptionNames: new Set(collectOptionNamesByType(metadata, \"boolean\")),\n\t\tshortFlagMap: new Map<string, ShortOptionDescriptor>(\n\t\t\tObject.entries(metadata).flatMap(([name, option]) =>\n\t\t\t\toption.short\n\t\t\t\t\t? [[option.short, { name, type: option.type }] as const]\n\t\t\t\t\t: [],\n\t\t\t),\n\t\t),\n\t\tstringOptionNames: new Set(collectOptionNamesByType(metadata, \"string\")),\n\t};\n}\n\nexport function parseCommandArgvWithMetadata(\n\targv: string[],\n\toptions: {\n\t\textraBooleanOptionNames?: Iterable<string>;\n\t\tparser: CommandOptionParser;\n\t},\n): ParsedCommandArgv {\n\tconst flags: Record<string, unknown> = {};\n\tconst positionals: string[] = [];\n\tconst booleanOptionNames = new Set(options.parser.booleanOptionNames);\n\n\tfor (const optionName of options.extraBooleanOptionNames ?? []) {\n\t\tbooleanOptionNames.add(optionName);\n\t}\n\n\tfor (let index = 0; index < argv.length; index += 1) {\n\t\tconst arg = argv[index];\n\t\tif (!arg) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (arg === \"--\") {\n\t\t\tpositionals.push(...argv.slice(index + 1));\n\t\t\tbreak;\n\t\t}\n\n\t\tif (arg.length === 2 && arg.startsWith(\"-\")) {\n\t\t\tconst shortFlag = options.parser.shortFlagMap.get(arg.slice(1));\n\t\t\tif (!shortFlag) {\n\t\t\t\tthrow new Error(`Unknown option \\`${arg}\\`.`);\n\t\t\t}\n\t\t\tif (shortFlag.type === \"boolean\") {\n\t\t\t\tflags[shortFlag.name] = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst next = argv[index + 1];\n\t\t\tif (!next || next.startsWith(\"-\")) {\n\t\t\t\tthrow new Error(`\\`${arg}\\` requires a value.`);\n\t\t\t}\n\t\t\tflags[shortFlag.name] = next;\n\t\t\tindex += 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (arg.startsWith(\"--\")) {\n\t\t\tconst option = arg.slice(2);\n\t\t\tconst separatorIndex = option.indexOf(\"=\");\n\t\t\tconst rawName =\n\t\t\t\tseparatorIndex === -1 ? option : option.slice(0, separatorIndex);\n\t\t\tconst inlineValue =\n\t\t\t\tseparatorIndex === -1 ? undefined : option.slice(separatorIndex + 1);\n\t\t\tif (booleanOptionNames.has(rawName)) {\n\t\t\t\tflags[rawName] = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!options.parser.stringOptionNames.has(rawName)) {\n\t\t\t\tthrow new Error(`Unknown option \\`--${rawName}\\`.`);\n\t\t\t}\n\t\t\tif (inlineValue !== undefined) {\n\t\t\t\tif (!inlineValue) {\n\t\t\t\t\tthrow new Error(`\\`--${rawName}\\` requires a value.`);\n\t\t\t\t}\n\t\t\t\tflags[rawName] = inlineValue;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst next = argv[index + 1];\n\t\t\tif (!next || next.startsWith(\"-\")) {\n\t\t\t\tthrow new Error(`\\`--${rawName}\\` requires a value.`);\n\t\t\t}\n\t\t\tflags[rawName] = next;\n\t\t\tindex += 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (arg.startsWith(\"-\")) {\n\t\t\tthrow new Error(`Unknown option \\`${arg}\\`.`);\n\t\t}\n\n\t\tpositionals.push(arg);\n\t}\n\n\treturn {\n\t\tflags,\n\t\tpositionals,\n\t};\n}\n\nexport function resolveCommandOptionValues<\n\tTMetadata extends CommandOptionMetadataMap,\n>(\n\tmetadata: TMetadata,\n\toptions: {\n\t\tdefaults?: Record<string, unknown>;\n\t\tflags?: Record<string, unknown>;\n\t\toptionNames?: Iterable<keyof TMetadata | string>;\n\t},\n): Record<string, string | boolean | undefined> {\n\tconst resolved: Record<string, string | boolean | undefined> = {};\n\tconst optionNames =\n\t\toptions.optionNames ?? (Object.keys(metadata) as Array<keyof TMetadata>);\n\n\tfor (const optionName of optionNames) {\n\t\tconst name = String(optionName);\n\t\tconst descriptor = metadata[name];\n\t\tif (!descriptor) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst value = options.flags?.[name] ?? options.defaults?.[name];\n\t\tif (descriptor.type === \"boolean\") {\n\t\t\tresolved[name] = Boolean(value ?? false);\n\t\t\tcontinue;\n\t\t}\n\n\t\tresolved[name] = typeof value === \"string\" ? value : undefined;\n\t}\n\n\treturn resolved;\n}\n"
8
+ ],
9
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AAEA,0BAAS;AA6CF,IAAM,0BAA0B;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AACD;AAGA,SAAS,SAA+B,CAAC,MAAS,UAAyB;AAAA,EAC1E,MAAM,SAAqB,KAAK,KAAK;AAAA,EAErC,YAAY,KAAK,UAAU,OAAO,QAAQ,QAAQ,GAAG;AAAA,IACpD,IAAI,MAAM,QAAQ,KAAK,GAAG;AAAA,MACzB,OAAO,OAAO,MAAM,MAAM;AAAA,MAC1B;AAAA,IACD;AAAA,IACA,IAAI,SAAS,KAAK,KAAK,SAAS,OAAO,IAAI,GAAG;AAAA,MAC7C,OAAO,OAAO,UAAU,OAAO,MAAoB,KAAK;AAAA,MACxD;AAAA,IACD;AAAA,IACA,OAAO,OAAO;AAAA,EACf;AAAA,EAEA,OAAO;AAAA;AAGR,eAAe,YAAY,CAAC,UAA8C;AAAA,EACzE,IAAI;AAAA,IACH,MAAM,SAAS,MAAM,GAAG,SAAS,UAAU,MAAM;AAAA,IACjD,MAAM,SAAS,KAAK,MAAM,MAAM;AAAA,IAChC,OAAO,SAAS,MAAM,IAAI,SAAS;AAAA,IAClC,OAAO,OAAO;AAAA,IACf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"names": []
12
+ }
@@ -18,26 +18,28 @@ import {
18
18
  resolvePackageManagerId,
19
19
  resolveTemplateId,
20
20
  scaffoldProject
21
- } from "./cli-7svz19s1.js";
21
+ } from "./cli-cfx3gm1r.js";
22
22
  import"./cli-jmtpd5ft.js";
23
23
  import"./cli-bq2v559b.js";
24
24
  import {
25
25
  formatInstallCommand,
26
26
  formatRunScript
27
27
  } from "./cli-1b5jx6j9.js";
28
- import"./cli-wtrvnce5.js";
28
+ import"./cli-w4r0rr8a.js";
29
29
  import {
30
30
  OFFICIAL_WORKSPACE_TEMPLATE_PACKAGE,
31
31
  isBuiltInTemplateId
32
- } from "./cli-kan7a6db.js";
32
+ } from "./cli-a6dwqnhq.js";
33
33
  import"./cli-rg481yks.js";
34
+ import {
35
+ createManagedTempRoot
36
+ } from "./cli-t73q5aqz.js";
34
37
  import"./cli-pd5pqgre.js";
35
38
  import"./cli-xnn9xjcy.js";
36
39
 
37
40
  // ../wp-typia-project-tools/src/runtime/cli-scaffold.ts
38
41
  import fs from "fs";
39
42
  import { promises as fsp } from "fs";
40
- import os from "os";
41
43
  import path from "path";
42
44
  async function listRelativeProjectFiles(rootDir) {
43
45
  const relativeFiles = [];
@@ -86,7 +88,7 @@ async function buildScaffoldDryRunPlan({
86
88
  withWpEnv
87
89
  }) {
88
90
  await assertDryRunTargetDirectoryReady(projectDir, allowExistingDir);
89
- const tempRoot = await fsp.mkdtemp(path.join(os.tmpdir(), "wp-typia-scaffold-plan-"));
91
+ const { path: tempRoot, cleanup } = await createManagedTempRoot("wp-typia-scaffold-plan-");
90
92
  const previewProjectDir = path.join(tempRoot, "preview-project");
91
93
  try {
92
94
  const result = await scaffoldProject({
@@ -119,7 +121,7 @@ async function buildScaffoldDryRunPlan({
119
121
  result
120
122
  };
121
123
  } finally {
122
- await fsp.rm(tempRoot, { force: true, recursive: true });
124
+ await cleanup();
123
125
  }
124
126
  }
125
127
  function validateCreateProjectInput(projectInput) {
@@ -546,4 +548,4 @@ export {
546
548
  getNextSteps
547
549
  };
548
550
 
549
- //# debugId=B3C0A5165543AD8064756E2164756E21
551
+ //# debugId=47C9FBD37EC1603F64756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../wp-typia-project-tools/src/runtime/cli-scaffold.ts"],
4
+ "sourcesContent": [
5
+ "import fs from \"node:fs\";\nimport { promises as fsp } from \"node:fs\";\nimport path from \"node:path\";\n\nimport {\n\tcollectScaffoldAnswers,\n\tDATA_STORAGE_MODES,\n\tPERSISTENCE_POLICIES,\n\tisDataStorageMode,\n\tisPersistencePolicy,\n\tresolvePackageManagerId,\n\tresolveTemplateId,\n\tscaffoldProject,\n} from \"./scaffold.js\";\nimport { parseAlternateRenderTargets } from \"./alternate-render-targets.js\";\nimport { parseCompoundInnerBlocksPreset } from \"./compound-inner-blocks.js\";\nimport {\n\tformatInstallCommand,\n\tformatRunScript,\n} from \"./package-managers.js\";\nimport type {\n\tDataStorageMode,\n\tPersistencePolicy,\n\tScaffoldProgressEvent,\n} from \"./scaffold.js\";\nimport type { PackageManagerId } from \"./package-managers.js\";\nimport { getPrimaryDevelopmentScript } from \"./local-dev-presets.js\";\nimport { createManagedTempRoot } from \"./temp-roots.js\";\nimport {\n\tgetOptionalOnboardingNote,\n\tgetOptionalOnboardingSteps,\n} from \"./scaffold-onboarding.js\";\nimport { formatNonEmptyTargetDirectoryError } from \"./scaffold-bootstrap.js\";\nimport {\n\tOFFICIAL_WORKSPACE_TEMPLATE_PACKAGE,\n\tisBuiltInTemplateId,\n} from \"./template-registry.js\";\nimport {\n\tresolveOptionalInteractiveExternalLayerId,\n\ttype ExternalLayerSelectionOption,\n} from \"./external-layer-selection.js\";\nimport type { TemplateDefinition } from \"./template-registry.js\";\nimport {\n\tassertBuiltInTemplateVariantAllowed,\n\tresolveLocalCliPathOption,\n\tnormalizeOptionalCliString,\n} from \"./cli-validation.js\";\n\ninterface GetNextStepsOptions {\n\tnoInstall: boolean;\n\tpackageManager: PackageManagerId;\n\tprojectDir: string;\n\tprojectInput: string;\n\ttemplateId: string;\n}\n\ninterface GetOptionalOnboardingOptions {\n\tavailableScripts?: string[];\n\tpackageManager: PackageManagerId;\n\ttemplateId: string;\n\tcompoundPersistenceEnabled?: boolean;\n}\n\ninterface OptionalOnboardingGuidance {\n\tnote: string;\n\tsteps: string[];\n}\n\nexport interface ScaffoldDryRunPlan {\n\tdependencyInstall: \"skipped-by-flag\" | \"would-install\";\n\tfiles: string[];\n}\n\ninterface RunScaffoldFlowOptions {\n\tallowExistingDir?: boolean;\n\talternateRenderTargets?: string;\n\tcwd?: string;\n\tdataStorageMode?: string;\n\tdryRun?: boolean;\n\texternalLayerId?: string;\n\texternalLayerSource?: string;\n\tinstallDependencies?: Parameters<typeof scaffoldProject>[0][\"installDependencies\"];\n\tinnerBlocksPreset?: string;\n\tisInteractive?: boolean;\n\tnamespace?: string;\n\tnoInstall?: boolean;\n\tonProgress?: ((event: ScaffoldProgressEvent) => void | Promise<void>) | undefined;\n\tpackageManager?: string;\n\tphpPrefix?: string;\n\tprojectInput: string;\n\tpromptText?: Parameters<typeof collectScaffoldAnswers>[0][\"promptText\"];\n\tqueryPostType?: string;\n\tselectDataStorage?: () => Promise<DataStorageMode>;\n\tselectExternalLayerId?: (\n\t\toptions: ExternalLayerSelectionOption[],\n\t) => Promise<string>;\n\tselectPackageManager?: () => Promise<PackageManagerId>;\n\tselectPersistencePolicy?: () => Promise<PersistencePolicy>;\n\tselectTemplate?: () => Promise<TemplateDefinition[\"id\"]>;\n\tselectWithMigrationUi?: () => Promise<boolean>;\n\tselectWithTestPreset?: () => Promise<boolean>;\n\tselectWithWpEnv?: () => Promise<boolean>;\n\ttemplateId?: string;\n\ttextDomain?: string;\n\tvariant?: string;\n\tpersistencePolicy?: string;\n\twithMigrationUi?: boolean;\n\twithTestPreset?: boolean;\n\twithWpEnv?: boolean;\n\tyes?: boolean;\n}\n\nasync function listRelativeProjectFiles(rootDir: string): Promise<string[]> {\n\tconst relativeFiles: string[] = [];\n\n\tasync function visit(currentDir: string): Promise<void> {\n\t\tconst entries = await fsp.readdir(currentDir, { withFileTypes: true });\n\t\tfor (const entry of entries) {\n\t\t\tconst absolutePath = path.join(currentDir, entry.name);\n\t\t\tif (entry.isDirectory()) {\n\t\t\t\tawait visit(absolutePath);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\trelativeFiles.push(\n\t\t\t\tpath\n\t\t\t\t\t.relative(rootDir, absolutePath)\n\t\t\t\t\t.replace(path.sep === \"\\\\\" ? /\\\\/gu : /\\//gu, \"/\"),\n\t\t\t);\n\t\t}\n\t}\n\n\tawait visit(rootDir);\n\treturn relativeFiles.sort((left, right) => left.localeCompare(right));\n}\n\nasync function assertDryRunTargetDirectoryReady(\n\tprojectDir: string,\n\tallowExistingDir: boolean,\n): Promise<void> {\n\tif (!fs.existsSync(projectDir) || allowExistingDir) {\n\t\treturn;\n\t}\n\n\tconst entries = await fsp.readdir(projectDir);\n\tif (entries.length > 0) {\n\t\tthrow new Error(formatNonEmptyTargetDirectoryError(projectDir));\n\t}\n}\n\nasync function buildScaffoldDryRunPlan({\n\tallowExistingDir,\n\talternateRenderTargets,\n\tanswers,\n\tcwd,\n\tdataStorageMode,\n\texternalLayerId,\n\texternalLayerSource,\n\texternalLayerSourceLabel,\n\tinstallDependencies,\n\tnoInstall,\n\tonProgress,\n\tpackageManager,\n\tpersistencePolicy,\n\tprojectDir,\n\ttemplateId,\n\tvariant,\n\twithMigrationUi,\n\twithTestPreset,\n\twithWpEnv,\n}: {\n\tallowExistingDir: boolean;\n\talternateRenderTargets?: Parameters<typeof scaffoldProject>[0][\"alternateRenderTargets\"];\n\tanswers: Parameters<typeof scaffoldProject>[0][\"answers\"];\n\tcwd: string;\n\tdataStorageMode?: Parameters<typeof scaffoldProject>[0][\"dataStorageMode\"];\n\texternalLayerId?: string;\n\texternalLayerSource?: string;\n\texternalLayerSourceLabel?: string;\n\tinstallDependencies?: Parameters<typeof scaffoldProject>[0][\"installDependencies\"];\n\tnoInstall: boolean;\n\tonProgress?: RunScaffoldFlowOptions[\"onProgress\"];\n\tpackageManager: PackageManagerId;\n\tpersistencePolicy?: Parameters<typeof scaffoldProject>[0][\"persistencePolicy\"];\n\tprojectDir: string;\n\ttemplateId: string;\n\tvariant?: string;\n\twithMigrationUi: boolean;\n\twithTestPreset: boolean;\n\twithWpEnv: boolean;\n}): Promise<{\n\tplan: ScaffoldDryRunPlan;\n\tresult: Awaited<ReturnType<typeof scaffoldProject>>;\n}> {\n\tawait assertDryRunTargetDirectoryReady(projectDir, allowExistingDir);\n\tconst { path: tempRoot, cleanup } = await createManagedTempRoot(\n\t\t\"wp-typia-scaffold-plan-\",\n\t);\n\tconst previewProjectDir = path.join(tempRoot, \"preview-project\");\n\n\ttry {\n\t\tconst result = await scaffoldProject({\n\t\t\tallowExistingDir: false,\n\t\t\talternateRenderTargets,\n\t\t\tanswers,\n\t\t\tcwd,\n\t\t\tdataStorageMode,\n\t\t\texternalLayerId,\n\t\t\texternalLayerSource,\n\t\t\texternalLayerSourceLabel,\n\t\t\tinstallDependencies,\n\t\t\tnoInstall: true,\n\t\t\tonProgress,\n\t\t\tpackageManager,\n\t\t\tpersistencePolicy,\n\t\t\tprojectDir: previewProjectDir,\n\t\t\ttemplateId,\n\t\t\tvariant,\n\t\t\twithMigrationUi,\n\t\t\twithTestPreset,\n\t\t\twithWpEnv,\n\t\t});\n\t\tconst files = await listRelativeProjectFiles(previewProjectDir);\n\n\t\treturn {\n\t\t\tplan: {\n\t\t\t\tdependencyInstall: noInstall ? \"skipped-by-flag\" : \"would-install\",\n\t\t\t\tfiles,\n\t\t\t},\n\t\t\tresult,\n\t\t};\n\t} finally {\n\t\tawait cleanup();\n\t}\n}\n\nfunction validateCreateProjectInput(projectInput: string) {\n\tconst normalizedProjectInput = projectInput.trim();\n\tif (normalizedProjectInput.length === 0) {\n\t\tthrow new Error(\n\t\t\t\"Project directory is required. Usage: wp-typia create <project-dir> (or wp-typia <project-dir> when <project-dir> is the only positional argument).\",\n\t\t);\n\t}\n\n\tconst normalizedProjectPath =\n\t\tpath.normalize(normalizedProjectInput).replace(/[\\\\/]+$/u, \"\") ||\n\t\tpath.normalize(normalizedProjectInput);\n\tif (normalizedProjectPath === \".\" || normalizedProjectPath === \"..\") {\n\t\tthrow new Error(\n\t\t\t\"`wp-typia create` requires a new project directory. Use an explicit child directory instead of `.` or `..`.\",\n\t\t);\n\t}\n}\n\nfunction collectProjectDirectoryWarnings(projectDir: string): string[] {\n\tconst warnings: string[] = [];\n\tconst projectName = path.basename(projectDir);\n\tif (/\\s/u.test(projectName)) {\n\t\twarnings.push(\n\t\t\t`Project directory \"${projectName}\" contains spaces. The generated next-step commands will be quoted, but a simple kebab-case directory name is usually easier to use with shells and downstream tooling.`,\n\t\t);\n\t}\n\n\tconst shellSensitiveCharacters = Array.from(\n\t\tnew Set(projectName.match(/[^A-Za-z0-9._ -]/gu) ?? []),\n\t);\n\tif (shellSensitiveCharacters.length > 0) {\n\t\twarnings.push(\n\t\t\t`Project directory \"${projectName}\" contains shell-sensitive characters (${shellSensitiveCharacters.join(\", \")}). Prefer letters, numbers, \".\", \"_\" and \"-\" when possible.`,\n\t\t);\n\t}\n\n\treturn warnings;\n}\n\nfunction templateUsesPersistenceSettings(\n\ttemplateId: string,\n\toptions: {\n\t\tdataStorageMode?: string;\n\t\tpersistencePolicy?: string;\n\t},\n): boolean {\n\tif (templateId === \"persistence\") {\n\t\treturn true;\n\t}\n\n\tif (templateId !== \"compound\") {\n\t\treturn false;\n\t}\n\n\treturn Boolean(options.dataStorageMode || options.persistencePolicy);\n}\n\nfunction templateSupportsPersistenceFlags(templateId: string): boolean {\n\treturn templateId === \"persistence\" || templateId === \"compound\";\n}\n\nfunction templateSupportsCompoundInnerBlocksPreset(templateId: string): boolean {\n\treturn templateId === \"compound\";\n}\n\nfunction createTemplateLabel(templateId: string): string {\n\treturn templateId === OFFICIAL_WORKSPACE_TEMPLATE_PACKAGE\n\t\t? \"`--template workspace`\"\n\t\t: `\"${templateId}\"`;\n}\n\nfunction collectTemplateCapabilityWarnings(options: {\n\tqueryPostType?: string;\n\ttemplateId: string;\n\twithMigrationUi?: boolean;\n}): string[] {\n\tconst warnings: string[] = [];\n\tconst trimmedQueryPostType = options.queryPostType?.trim();\n\n\tif (\n\t\ttrimmedQueryPostType &&\n\t\toptions.templateId !== \"query-loop\" &&\n\t\t(isBuiltInTemplateId(options.templateId) ||\n\t\t\toptions.templateId === OFFICIAL_WORKSPACE_TEMPLATE_PACKAGE)\n\t) {\n\t\twarnings.push(\n\t\t\t`\\`--query-post-type\\` only applies to \\`wp-typia create --template query-loop\\`, which scaffolds a create-time \\`core/query\\` variation instead of a standalone block. ${createTemplateLabel(options.templateId)} will ignore \"${trimmedQueryPostType}\".`,\n\t\t);\n\t}\n\n\tif (\n\t\toptions.withMigrationUi === true &&\n\t\t!isBuiltInTemplateId(options.templateId) &&\n\t\toptions.templateId !== OFFICIAL_WORKSPACE_TEMPLATE_PACKAGE\n\t) {\n\t\twarnings.push(\n\t\t\t`\\`--with-migration-ui\\` was ignored for ${createTemplateLabel(options.templateId)}. Migration UI currently scaffolds built-in templates and the official \\`--template workspace\\` flow; external templates still need to opt into that surface explicitly.`,\n\t\t);\n\t}\n\n\treturn warnings;\n}\n\nfunction templateSupportsAlternateRenderTargets(options: {\n\talternateRenderTargets?: string;\n\tdataStorageMode?: string;\n\tpersistencePolicy?: string;\n\ttemplateId: string;\n}): boolean {\n\tif (!options.alternateRenderTargets) {\n\t\treturn false;\n\t}\n\n\tif (options.templateId === \"persistence\") {\n\t\treturn true;\n\t}\n\n\tif (options.templateId !== \"compound\") {\n\t\treturn false;\n\t}\n\n\treturn templateUsesPersistenceSettings(options.templateId, {\n\t\tdataStorageMode: options.dataStorageMode,\n\t\tpersistencePolicy: options.persistencePolicy,\n\t});\n}\n\nfunction validateCreateFlagContract(options: {\n\talternateRenderTargets?: string;\n\tdataStorageMode?: string;\n\tinnerBlocksPreset?: string;\n\tpersistencePolicy?: string;\n\ttemplateId: string;\n\tvariant?: string;\n}) {\n\tconst {\n\t\talternateRenderTargets,\n\t\tdataStorageMode,\n\t\tinnerBlocksPreset,\n\t\tpersistencePolicy,\n\t\ttemplateId,\n\t\tvariant,\n\t} = options;\n\tif (\n\t\t(dataStorageMode || persistencePolicy) &&\n\t\t!templateSupportsPersistenceFlags(templateId)\n\t) {\n\t\tthrow new Error(\n\t\t\t\"`--data-storage` and `--persistence-policy` are supported only for `wp-typia create --template persistence` or `--template compound`.\",\n\t\t);\n\t}\n\tif (\n\t\talternateRenderTargets &&\n\t\t!templateSupportsAlternateRenderTargets({\n\t\t\talternateRenderTargets,\n\t\t\tdataStorageMode,\n\t\t\tpersistencePolicy,\n\t\t\ttemplateId,\n\t\t})\n\t) {\n\t\tif (templateId === \"compound\") {\n\t\t\tthrow new Error(\n\t\t\t\t\"`--alternate-render-targets` on `wp-typia create --template compound` requires the persistence-enabled server render path. Add `--data-storage <post-meta|custom-table>` or `--persistence-policy <authenticated|public>` first.\",\n\t\t\t);\n\t\t}\n\t\tthrow new Error(\n\t\t\t\"`--alternate-render-targets` is supported only for `wp-typia create --template persistence` or persistence-enabled `--template compound` scaffolds.\",\n\t\t);\n\t}\n\tparseAlternateRenderTargets(alternateRenderTargets);\n\tif (\n\t\tinnerBlocksPreset &&\n\t\t!templateSupportsCompoundInnerBlocksPreset(templateId)\n\t) {\n\t\tthrow new Error(\n\t\t\t\"`--inner-blocks-preset` is supported only for `wp-typia create --template compound`.\",\n\t\t);\n\t}\n\tparseCompoundInnerBlocksPreset(innerBlocksPreset);\n\n\tif (isBuiltInTemplateId(templateId)) {\n\t\tassertBuiltInTemplateVariantAllowed({\n\t\t\ttemplateId,\n\t\t\tvariant,\n\t\t});\n\t}\n}\n\nfunction parseSelectableValue<T extends string>(\n\tlabel: string,\n\tvalue: string,\n\tisValue: (input: string) => input is T,\n\tallowedValues: readonly T[],\n): T {\n\tif (isValue(value)) {\n\t\treturn value;\n\t}\n\n\tthrow new Error(\n\t\t`Unsupported ${label} \"${value}\". Expected one of: ${allowedValues.join(\", \")}`,\n\t);\n}\n\nasync function resolveOptionalSelection<T extends string>({\n\tdefaultValue,\n\texplicitValue,\n\tisInteractive,\n\tisValue,\n\tlabel,\n\tallowedValues,\n\tselect,\n\tshouldResolve = true,\n\tyes,\n}: {\n\tdefaultValue: T;\n\texplicitValue?: string;\n\tisInteractive: boolean;\n\tisValue: (input: string) => input is T;\n\tlabel: string;\n\tallowedValues: readonly T[];\n\tselect?: () => Promise<T>;\n\tshouldResolve?: boolean;\n\tyes: boolean;\n}): Promise<T | undefined> {\n\tif (!shouldResolve) {\n\t\treturn undefined;\n\t}\n\n\tif (explicitValue) {\n\t\treturn parseSelectableValue(label, explicitValue, isValue, allowedValues);\n\t}\n\n\tif (yes) {\n\t\treturn defaultValue;\n\t}\n\n\tif (isInteractive && select) {\n\t\treturn select();\n\t}\n\n\treturn defaultValue;\n}\n\nasync function resolveOptionalBooleanFlag({\n\tdefaultValue = false,\n\tdisabled = false,\n\texplicitValue,\n\tisInteractive,\n\tselect,\n\tyes,\n}: {\n\tdefaultValue?: boolean;\n\tdisabled?: boolean;\n\texplicitValue?: boolean;\n\tisInteractive: boolean;\n\tselect?: () => Promise<boolean>;\n\tyes: boolean;\n}): Promise<boolean> {\n\tif (disabled) {\n\t\treturn defaultValue;\n\t}\n\n\tif (typeof explicitValue === \"boolean\") {\n\t\treturn explicitValue;\n\t}\n\n\tif (yes) {\n\t\treturn defaultValue;\n\t}\n\n\tif (isInteractive && select) {\n\t\treturn select();\n\t}\n\n\treturn defaultValue;\n}\n\nfunction quoteShellValue(value: string): string {\n\tif (\n\t\t!value.startsWith(\"-\") &&\n\t\t/^[A-Za-z0-9._/@:-]+(?:\\/[A-Za-z0-9._@:-]+)*$/.test(value)\n\t) {\n\t\treturn value;\n\t}\n\n\treturn `'${value.replace(/'/g, `'\\\"'\\\"'`)}'`;\n}\n\n/**\n * Build the printed next-step commands for a scaffolded project.\n *\n * @param options Project location and package-manager details used to format\n * next-step commands.\n * @returns Ordered shell commands shown after scaffolding succeeds.\n */\nexport function getNextSteps({\n\tprojectInput,\n\tprojectDir,\n\tpackageManager,\n\tnoInstall,\n\ttemplateId,\n}: GetNextStepsOptions): string[] {\n\tconst cdTarget = path.isAbsolute(projectInput) ? projectDir : projectInput;\n\tconst steps = [`cd ${quoteShellValue(cdTarget)}`];\n\n\tif (noInstall) {\n\t\tsteps.push(formatInstallCommand(packageManager));\n\t}\n\n\tsteps.push(formatRunScript(packageManager, getPrimaryDevelopmentScript(templateId)));\n\treturn steps;\n}\n\n/**\n * Compute optional onboarding guidance shown after scaffolding completes.\n *\n * @param options Package-manager and template context for optional guidance.\n * @returns Optional onboarding note and step list.\n */\nexport function getOptionalOnboarding({\n\tavailableScripts,\n\tpackageManager,\n\ttemplateId,\n\tcompoundPersistenceEnabled = false,\n}: GetOptionalOnboardingOptions): OptionalOnboardingGuidance {\n\treturn {\n\t\tnote: getOptionalOnboardingNote(packageManager, templateId, {\n\t\t\tavailableScripts,\n\t\t\tcompoundPersistenceEnabled,\n\t\t}),\n\t\tsteps: getOptionalOnboardingSteps(packageManager, templateId, {\n\t\t\tavailableScripts,\n\t\t\tcompoundPersistenceEnabled,\n\t\t}),\n\t};\n}\n\n/**\n * Resolve scaffold options, prompts, and follow-up steps for one CLI run.\n *\n * @param options CLI/runtime inputs used to collect answers and scaffold a\n * project.\n * @returns The scaffold result together with next-step guidance.\n */\nexport async function runScaffoldFlow({\n\tprojectInput,\n\tcwd = process.cwd(),\n\ttemplateId,\n\talternateRenderTargets,\n\tdataStorageMode,\n\tdryRun = false,\n\texternalLayerId,\n\texternalLayerSource,\n\tinnerBlocksPreset,\n\tpersistencePolicy,\n\tpackageManager,\n\tnamespace,\n\ttextDomain,\n\tphpPrefix,\n\tqueryPostType,\n\tyes = false,\n\tnoInstall = false,\n\tonProgress,\n\tisInteractive = false,\n\tallowExistingDir = false,\n\tselectTemplate,\n\tselectDataStorage,\n\tselectExternalLayerId,\n\tselectPersistencePolicy,\n\tselectPackageManager,\n\tpromptText,\n\tinstallDependencies = undefined,\n\tvariant,\n\tselectWithTestPreset,\n\tselectWithWpEnv,\n\tselectWithMigrationUi,\n\twithMigrationUi,\n\twithTestPreset,\n\twithWpEnv,\n}: RunScaffoldFlowOptions) {\n\tconst normalizedExternalLayerId =\n\t\tnormalizeOptionalCliString(externalLayerId);\n\tconst normalizedExternalLayerSource = resolveLocalCliPathOption({\n\t\tcwd,\n\t\tlabel: \"--external-layer-source\",\n\t\tvalue: externalLayerSource,\n\t});\n\n\tvalidateCreateProjectInput(projectInput);\n\n\tconst resolvedTemplateId = await resolveTemplateId({\n\t\ttemplateId,\n\t\tyes,\n\t\tisInteractive,\n\t\tselectTemplate,\n\t});\n\tvalidateCreateFlagContract({\n\t\talternateRenderTargets,\n\t\tdataStorageMode,\n\t\tinnerBlocksPreset,\n\t\tpersistencePolicy,\n\t\ttemplateId: resolvedTemplateId,\n\t\tvariant,\n\t});\n\tconst resolvedInnerBlocksPreset =\n\t\tparseCompoundInnerBlocksPreset(innerBlocksPreset);\n\tconst resolvedExternalLayerSelection =\n\t\tisBuiltInTemplateId(resolvedTemplateId) && isInteractive\n\t\t\t? await resolveOptionalInteractiveExternalLayerId({\n\t\t\t\t\tcallerCwd: cwd,\n\t\t\t\t\texternalLayerId: normalizedExternalLayerId,\n\t\t\t\t\texternalLayerSource: normalizedExternalLayerSource,\n\t\t\t\t\tselectExternalLayerId,\n\t\t\t\t})\n\t\t\t: {\n\t\t\t\t\texternalLayerId: normalizedExternalLayerId,\n\t\t\t\t\texternalLayerSource: normalizedExternalLayerSource,\n\t\t\t\t};\n\ttry {\n\t\tconst shouldResolvePersistence = templateUsesPersistenceSettings(resolvedTemplateId, {\n\t\t\tdataStorageMode,\n\t\t\tpersistencePolicy,\n\t\t});\n\t\tconst resolvedDataStorage = await resolveOptionalSelection({\n\t\t\tallowedValues: DATA_STORAGE_MODES,\n\t\t\tdefaultValue: \"custom-table\",\n\t\t\texplicitValue: dataStorageMode,\n\t\t\tisInteractive,\n\t\t\tisValue: isDataStorageMode,\n\t\t\tlabel: \"data storage mode\",\n\t\t\tselect: selectDataStorage,\n\t\t\tshouldResolve: shouldResolvePersistence,\n\t\t\tyes,\n\t\t});\n\t\tconst resolvedPersistencePolicy = await resolveOptionalSelection({\n\t\t\tallowedValues: PERSISTENCE_POLICIES,\n\t\t\tdefaultValue: \"authenticated\",\n\t\t\texplicitValue: persistencePolicy,\n\t\t\tisInteractive,\n\t\t\tisValue: isPersistencePolicy,\n\t\t\tlabel: \"persistence policy\",\n\t\t\tselect: selectPersistencePolicy,\n\t\t\tshouldResolve: shouldResolvePersistence,\n\t\t\tyes,\n\t\t});\n\t\tconst resolvedPackageManager = await resolvePackageManagerId({\n\t\t\tpackageManager,\n\t\t\tyes,\n\t\t\tisInteractive,\n\t\t\tselectPackageManager,\n\t\t});\n\t\tconst resolvedWithWpEnv = await resolveOptionalBooleanFlag({\n\t\t\texplicitValue: withWpEnv,\n\t\t\tisInteractive,\n\t\t\tselect: selectWithWpEnv,\n\t\t\tyes,\n\t\t});\n\t\tconst resolvedWithTestPreset = await resolveOptionalBooleanFlag({\n\t\t\texplicitValue: withTestPreset,\n\t\t\tisInteractive,\n\t\t\tselect: selectWithTestPreset,\n\t\t\tyes,\n\t\t});\n\t\tconst resolvedWithMigrationUi = await resolveOptionalBooleanFlag({\n\t\t\tdisabled:\n\t\t\t\t!isBuiltInTemplateId(resolvedTemplateId) &&\n\t\t\t\tresolvedTemplateId !== OFFICIAL_WORKSPACE_TEMPLATE_PACKAGE,\n\t\t\texplicitValue: withMigrationUi,\n\t\t\tisInteractive,\n\t\t\tselect: selectWithMigrationUi,\n\t\t\tyes,\n\t\t});\n\t\tconst projectDir = path.resolve(cwd, projectInput);\n\t\tconst projectName = path.basename(projectDir);\n\t\tconst answers = await collectScaffoldAnswers({\n\t\t\tdataStorageMode: resolvedDataStorage,\n\t\t\tnamespace,\n\t\t\tpersistencePolicy: resolvedPersistencePolicy,\n\t\t\tphpPrefix,\n\t\t\tprojectName,\n\t\t\tqueryPostType,\n\t\t\ttemplateId: resolvedTemplateId,\n\t\t\ttextDomain,\n\t\t\tyes,\n\t\t\tpromptText,\n\t\t});\n\t\tif (resolvedTemplateId === \"compound\" && resolvedInnerBlocksPreset) {\n\t\t\tanswers.compoundInnerBlocksPreset = resolvedInnerBlocksPreset;\n\t\t}\n\n\t\tconst resolvedResult = dryRun\n\t\t\t? await buildScaffoldDryRunPlan({\n\t\t\t\t\tallowExistingDir,\n\t\t\t\t\talternateRenderTargets,\n\t\t\t\t\tanswers,\n\t\t\t\t\tcwd,\n\t\t\t\t\tdataStorageMode: resolvedDataStorage,\n\t\t\t\t\texternalLayerId: resolvedExternalLayerSelection.externalLayerId,\n\t\t\t\t\texternalLayerSource:\n\t\t\t\t\t\tresolvedExternalLayerSelection.externalLayerSource,\n\t\t\t\t\texternalLayerSourceLabel: normalizedExternalLayerSource,\n\t\t\t\t\tinstallDependencies,\n\t\t\t\t\tnoInstall,\n\t\t\t\t\tonProgress,\n\t\t\t\t\tpackageManager: resolvedPackageManager,\n\t\t\t\t\tpersistencePolicy: resolvedPersistencePolicy,\n\t\t\t\t\tprojectDir,\n\t\t\t\t\ttemplateId: resolvedTemplateId,\n\t\t\t\t\tvariant,\n\t\t\t\t\twithMigrationUi: resolvedWithMigrationUi,\n\t\t\t\t\twithTestPreset: resolvedWithTestPreset,\n\t\t\t\t\twithWpEnv: resolvedWithWpEnv,\n\t\t\t\t})\n\t\t\t: {\n\t\t\t\t\tplan: undefined,\n\t\t\t\t\tresult: await scaffoldProject({\n\t\t\t\t\t\talternateRenderTargets,\n\t\t\t\t\t\tanswers,\n\t\t\t\t\t\tallowExistingDir,\n\t\t\t\t\t\tcwd,\n\t\t\t\t\t\tdataStorageMode: resolvedDataStorage,\n\t\t\t\t\t\texternalLayerId: resolvedExternalLayerSelection.externalLayerId,\n\t\t\t\t\t\texternalLayerSource:\n\t\t\t\t\t\t\tresolvedExternalLayerSelection.externalLayerSource,\n\t\t\t\t\t\texternalLayerSourceLabel: normalizedExternalLayerSource,\n\t\t\t\t\t\tinstallDependencies,\n\t\t\t\t\t\tnoInstall,\n\t\t\t\t\t\tonProgress,\n\t\t\t\t\t\tpackageManager: resolvedPackageManager,\n\t\t\t\t\t\tpersistencePolicy: resolvedPersistencePolicy,\n\t\t\t\t\t\tprojectDir,\n\t\t\t\t\t\ttemplateId: resolvedTemplateId,\n\t\t\t\t\t\tvariant,\n\t\t\t\t\t\twithMigrationUi: resolvedWithMigrationUi,\n\t\t\t\t\t\twithTestPreset: resolvedWithTestPreset,\n\t\t\t\t\t\twithWpEnv: resolvedWithWpEnv,\n\t\t\t\t\t}),\n\t\t\t\t};\n\t\tlet availableScripts: string[] | undefined;\n\t\tif (!dryRun) {\n\t\t\ttry {\n\t\t\t\tconst parsedPackageJson = JSON.parse(\n\t\t\t\t\tfs.readFileSync(path.join(projectDir, \"package.json\"), \"utf8\"),\n\t\t\t\t) as {\n\t\t\t\t\tscripts?: unknown;\n\t\t\t\t};\n\t\t\t\tconst scripts =\n\t\t\t\t\tparsedPackageJson.scripts &&\n\t\t\t\t\ttypeof parsedPackageJson.scripts === \"object\" &&\n\t\t\t\t\t!Array.isArray(parsedPackageJson.scripts)\n\t\t\t\t\t\t? parsedPackageJson.scripts\n\t\t\t\t\t\t: {};\n\t\t\t\tavailableScripts = Object.entries(scripts)\n\t\t\t\t\t.filter(([, value]) => typeof value === \"string\")\n\t\t\t\t\t.map(([scriptName]) => scriptName);\n\t\t\t} catch {\n\t\t\t\tavailableScripts = undefined;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tdryRun,\n\t\t\toptionalOnboarding: getOptionalOnboarding({\n\t\t\t\tavailableScripts,\n\t\t\t\tpackageManager: resolvedPackageManager,\n\t\t\t\ttemplateId: resolvedTemplateId,\n\t\t\t\tcompoundPersistenceEnabled:\n\t\t\t\t\tresolvedResult.result.variables.compoundPersistenceEnabled === \"true\",\n\t\t\t}),\n\t\t\tplan: resolvedResult.plan,\n\t\t\tprojectDir,\n\t\t\tprojectInput,\n\t\t\tpackageManager: resolvedPackageManager,\n\t\t\tnextSteps: getNextSteps({\n\t\t\t\tprojectInput,\n\t\t\t\tprojectDir,\n\t\t\t\tpackageManager: resolvedPackageManager,\n\t\t\t\tnoInstall,\n\t\t\t\ttemplateId: resolvedTemplateId,\n\t\t\t}),\n\t\t\tresult: {\n\t\t\t\t...resolvedResult.result,\n\t\t\t\twarnings: [\n\t\t\t\t\t...resolvedResult.result.warnings,\n\t\t\t\t\t...collectTemplateCapabilityWarnings({\n\t\t\t\t\t\tqueryPostType,\n\t\t\t\t\t\ttemplateId: resolvedTemplateId,\n\t\t\t\t\t\twithMigrationUi,\n\t\t\t\t\t}),\n\t\t\t\t\t...collectProjectDirectoryWarnings(projectDir),\n\t\t\t\t],\n\t\t\t},\n\t\t};\n\t} finally {\n\t\tawait resolvedExternalLayerSelection.cleanup?.();\n\t}\n}\n"
6
+ ],
7
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA,qBAAS;AACT;AA8GA,eAAe,wBAAwB,CAAC,SAAoC;AAAA,EAC3E,MAAM,gBAA0B,CAAC;AAAA,EAEjC,eAAe,KAAK,CAAC,YAAmC;AAAA,IACvD,MAAM,UAAU,MAAM,IAAI,QAAQ,YAAY,EAAE,eAAe,KAAK,CAAC;AAAA,IACrE,WAAW,SAAS,SAAS;AAAA,MAC5B,MAAM,eAAe,KAAK,KAAK,YAAY,MAAM,IAAI;AAAA,MACrD,IAAI,MAAM,YAAY,GAAG;AAAA,QACxB,MAAM,MAAM,YAAY;AAAA,QACxB;AAAA,MACD;AAAA,MAEA,cAAc,KACb,KACE,SAAS,SAAS,YAAY,EAC9B,QAAQ,KAAK,QAAQ,OAAO,SAAS,QAAQ,GAAG,CACnD;AAAA,IACD;AAAA;AAAA,EAGD,MAAM,MAAM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