wp-typia 0.24.2 → 0.24.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-bunli/.bunli/commands.gen.js +382 -296
- package/dist-bunli/{cli-6mr6vja7.js → cli-368d4cgy.js} +8 -4
- package/dist-bunli/{cli-vxd8eyax.js → cli-377p86mf.js} +1 -1
- package/dist-bunli/{cli-wfvf3tv1.js → cli-84c7wff4.js} +1 -1
- package/dist-bunli/{cli-add-r4c15g7g.js → cli-add-qjd3ba8j.js} +21 -10
- package/dist-bunli/{cli-doctor-fd6mfx0f.js → cli-doctor-6fyxq940.js} +2 -2
- package/dist-bunli/{cli-kbqztfkt.js → cli-fv4h3ydt.js} +33 -31
- package/dist-bunli/{cli-init-kmredfj7.js → cli-init-7avk42dh.js} +2 -2
- package/dist-bunli/{cli-4eqznv15.js → cli-kfm9mm68.js} +3130 -3132
- package/dist-bunli/{cli-scaffold-b49zc1rw.js → cli-scaffold-0bb6pr3w.js} +95 -133
- package/dist-bunli/{cli-6ys6d16y.js → cli-tj7ajdvf.js} +1 -1
- package/dist-bunli/cli.js +2 -2
- package/dist-bunli/{command-list-rqt03qqy.js → command-list-y3g7e9rb.js} +110 -15
- package/dist-bunli/{migrations-zhd03hvy.js → migrations-3vngdy51.js} +2 -2
- package/dist-bunli/node-cli.js +110 -11
- package/package.json +2 -2
|
@@ -21,19 +21,19 @@ import {
|
|
|
21
21
|
resolvePackageManagerId,
|
|
22
22
|
resolveTemplateId,
|
|
23
23
|
scaffoldProject
|
|
24
|
-
} from "./cli-
|
|
24
|
+
} from "./cli-kfm9mm68.js";
|
|
25
25
|
import"./cli-9fx0qgb7.js";
|
|
26
|
-
import"./cli-
|
|
27
|
-
import"./cli-
|
|
26
|
+
import"./cli-377p86mf.js";
|
|
27
|
+
import"./cli-84c7wff4.js";
|
|
28
28
|
import {
|
|
29
29
|
OFFICIAL_WORKSPACE_TEMPLATE_PACKAGE,
|
|
30
30
|
isBuiltInTemplateId
|
|
31
31
|
} from "./cli-8hxf9qw6.js";
|
|
32
|
-
import"./cli-
|
|
32
|
+
import"./cli-tj7ajdvf.js";
|
|
33
33
|
import"./cli-e4bwd81c.js";
|
|
34
34
|
import {
|
|
35
35
|
pathExists
|
|
36
|
-
} from "./cli-
|
|
36
|
+
} from "./cli-fv4h3ydt.js";
|
|
37
37
|
import"./cli-cvxvcw7c.js";
|
|
38
38
|
import {
|
|
39
39
|
createManagedTempRoot
|
|
@@ -52,6 +52,12 @@ import"./cli-rdcga1bd.js";
|
|
|
52
52
|
import"./cli-xnn9xjcy.js";
|
|
53
53
|
|
|
54
54
|
// ../wp-typia-project-tools/src/runtime/cli-scaffold.ts
|
|
55
|
+
import path5 from "path";
|
|
56
|
+
|
|
57
|
+
// ../wp-typia-project-tools/src/runtime/cli-scaffold-emission.ts
|
|
58
|
+
import path2 from "path";
|
|
59
|
+
|
|
60
|
+
// ../wp-typia-project-tools/src/runtime/cli-scaffold-files.ts
|
|
55
61
|
import { promises as fsp } from "fs";
|
|
56
62
|
import path from "path";
|
|
57
63
|
async function listRelativeProjectFiles(rootDir) {
|
|
@@ -79,58 +85,37 @@ async function assertDryRunTargetDirectoryReady(projectDir, allowExistingDir) {
|
|
|
79
85
|
throw new Error(formatNonEmptyTargetDirectoryError(projectDir));
|
|
80
86
|
}
|
|
81
87
|
}
|
|
82
|
-
async function
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
withMigrationUi,
|
|
101
|
-
withTestPreset,
|
|
102
|
-
withWpEnv
|
|
103
|
-
}) {
|
|
104
|
-
await assertDryRunTargetDirectoryReady(projectDir, allowExistingDir);
|
|
88
|
+
async function readGeneratedPackageScripts(projectDir) {
|
|
89
|
+
try {
|
|
90
|
+
const parsedPackageJson = await readJsonFile(path.join(projectDir, "package.json"), {
|
|
91
|
+
context: "generated package manifest"
|
|
92
|
+
});
|
|
93
|
+
const scripts = parsedPackageJson.scripts && typeof parsedPackageJson.scripts === "object" && !Array.isArray(parsedPackageJson.scripts) ? parsedPackageJson.scripts : {};
|
|
94
|
+
return Object.entries(scripts).filter(([, value]) => typeof value === "string").map(([scriptName]) => scriptName);
|
|
95
|
+
} catch {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// ../wp-typia-project-tools/src/runtime/cli-scaffold-emission.ts
|
|
101
|
+
async function emitScaffoldProject(options) {
|
|
102
|
+
return scaffoldProject(options);
|
|
103
|
+
}
|
|
104
|
+
async function buildScaffoldDryRunPlan(options) {
|
|
105
|
+
await assertDryRunTargetDirectoryReady(options.projectDir, options.allowExistingDir);
|
|
105
106
|
const { path: tempRoot, cleanup } = await createManagedTempRoot("wp-typia-scaffold-plan-");
|
|
106
|
-
const previewProjectDir =
|
|
107
|
+
const previewProjectDir = path2.join(tempRoot, "preview-project");
|
|
107
108
|
try {
|
|
108
|
-
const result = await
|
|
109
|
+
const result = await emitScaffoldProject({
|
|
110
|
+
...options,
|
|
109
111
|
allowExistingDir: false,
|
|
110
|
-
alternateRenderTargets,
|
|
111
|
-
answers,
|
|
112
|
-
cwd,
|
|
113
|
-
dataStorageMode,
|
|
114
|
-
externalLayerId,
|
|
115
|
-
externalLayerSource,
|
|
116
|
-
externalLayerSourceLabel,
|
|
117
|
-
installDependencies,
|
|
118
112
|
noInstall: true,
|
|
119
|
-
|
|
120
|
-
packageManager,
|
|
121
|
-
persistencePolicy,
|
|
122
|
-
profile,
|
|
123
|
-
projectDir: previewProjectDir,
|
|
124
|
-
templateId,
|
|
125
|
-
variant,
|
|
126
|
-
withMigrationUi,
|
|
127
|
-
withTestPreset,
|
|
128
|
-
withWpEnv
|
|
113
|
+
projectDir: previewProjectDir
|
|
129
114
|
});
|
|
130
115
|
const files = await listRelativeProjectFiles(previewProjectDir);
|
|
131
116
|
return {
|
|
132
117
|
plan: {
|
|
133
|
-
dependencyInstall: noInstall ? "skipped-by-flag" : "would-install",
|
|
118
|
+
dependencyInstall: options.noInstall ? "skipped-by-flag" : "would-install",
|
|
134
119
|
files
|
|
135
120
|
},
|
|
136
121
|
result
|
|
@@ -139,19 +124,67 @@ async function buildScaffoldDryRunPlan({
|
|
|
139
124
|
await cleanup();
|
|
140
125
|
}
|
|
141
126
|
}
|
|
127
|
+
|
|
128
|
+
// ../wp-typia-project-tools/src/runtime/cli-scaffold-output.ts
|
|
129
|
+
import path3 from "path";
|
|
130
|
+
function quoteShellValue(value) {
|
|
131
|
+
if (!value.startsWith("-") && /^[A-Za-z0-9._/@:-]+(?:\/[A-Za-z0-9._@:-]+)*$/.test(value)) {
|
|
132
|
+
return value;
|
|
133
|
+
}
|
|
134
|
+
return `'${value.replace(/'/g, `'"'"'`)}'`;
|
|
135
|
+
}
|
|
136
|
+
function getNextSteps({
|
|
137
|
+
projectInput,
|
|
138
|
+
projectDir,
|
|
139
|
+
packageManager,
|
|
140
|
+
noInstall,
|
|
141
|
+
templateId
|
|
142
|
+
}) {
|
|
143
|
+
const cdTarget = path3.isAbsolute(projectInput) ? projectDir : projectInput;
|
|
144
|
+
const steps = [`cd ${quoteShellValue(cdTarget)}`];
|
|
145
|
+
if (noInstall) {
|
|
146
|
+
steps.push(formatInstallCommand(packageManager));
|
|
147
|
+
}
|
|
148
|
+
steps.push(formatRunScript(packageManager, getPrimaryDevelopmentScript(templateId)));
|
|
149
|
+
return steps;
|
|
150
|
+
}
|
|
151
|
+
function getOptionalOnboarding({
|
|
152
|
+
availableScripts,
|
|
153
|
+
packageManager,
|
|
154
|
+
templateId,
|
|
155
|
+
compoundPersistenceEnabled = false
|
|
156
|
+
}) {
|
|
157
|
+
return {
|
|
158
|
+
note: getOptionalOnboardingNote(packageManager, templateId, {
|
|
159
|
+
availableScripts,
|
|
160
|
+
compoundPersistenceEnabled
|
|
161
|
+
}),
|
|
162
|
+
shortNote: getOptionalOnboardingShortNote(packageManager, templateId, {
|
|
163
|
+
availableScripts,
|
|
164
|
+
compoundPersistenceEnabled
|
|
165
|
+
}),
|
|
166
|
+
steps: getOptionalOnboardingSteps(packageManager, templateId, {
|
|
167
|
+
availableScripts,
|
|
168
|
+
compoundPersistenceEnabled
|
|
169
|
+
})
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// ../wp-typia-project-tools/src/runtime/cli-scaffold-validation.ts
|
|
174
|
+
import path4 from "path";
|
|
142
175
|
function validateCreateProjectInput(projectInput) {
|
|
143
176
|
const normalizedProjectInput = projectInput.trim();
|
|
144
177
|
if (normalizedProjectInput.length === 0) {
|
|
145
178
|
throw new Error("Project directory is required. Usage: wp-typia create <project-dir> (or wp-typia <project-dir> when <project-dir> is the only positional argument).");
|
|
146
179
|
}
|
|
147
|
-
const normalizedProjectPath =
|
|
180
|
+
const normalizedProjectPath = path4.normalize(normalizedProjectInput).replace(/[\\/]+$/u, "") || path4.normalize(normalizedProjectInput);
|
|
148
181
|
if (normalizedProjectPath === "." || normalizedProjectPath === "..") {
|
|
149
182
|
throw new Error("`wp-typia create` requires a new project directory. Use an explicit child directory instead of `.` or `..`.");
|
|
150
183
|
}
|
|
151
184
|
}
|
|
152
185
|
function collectProjectDirectoryWarnings(projectDir) {
|
|
153
186
|
const warnings = [];
|
|
154
|
-
const projectName =
|
|
187
|
+
const projectName = path4.basename(projectDir);
|
|
155
188
|
if (/\s/u.test(projectName)) {
|
|
156
189
|
warnings.push(`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.`);
|
|
157
190
|
}
|
|
@@ -260,7 +293,7 @@ async function resolveOptionalSelection({
|
|
|
260
293
|
if (!shouldResolve) {
|
|
261
294
|
return;
|
|
262
295
|
}
|
|
263
|
-
if (explicitValue) {
|
|
296
|
+
if (explicitValue !== undefined) {
|
|
264
297
|
return parseSelectableValue(label, explicitValue, isValue, allowedValues);
|
|
265
298
|
}
|
|
266
299
|
if (yes) {
|
|
@@ -293,48 +326,8 @@ async function resolveOptionalBooleanFlag({
|
|
|
293
326
|
}
|
|
294
327
|
return defaultValue;
|
|
295
328
|
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
return value;
|
|
299
|
-
}
|
|
300
|
-
return `'${value.replace(/'/g, `'"'"'`)}'`;
|
|
301
|
-
}
|
|
302
|
-
function getNextSteps({
|
|
303
|
-
projectInput,
|
|
304
|
-
projectDir,
|
|
305
|
-
packageManager,
|
|
306
|
-
noInstall,
|
|
307
|
-
templateId
|
|
308
|
-
}) {
|
|
309
|
-
const cdTarget = path.isAbsolute(projectInput) ? projectDir : projectInput;
|
|
310
|
-
const steps = [`cd ${quoteShellValue(cdTarget)}`];
|
|
311
|
-
if (noInstall) {
|
|
312
|
-
steps.push(formatInstallCommand(packageManager));
|
|
313
|
-
}
|
|
314
|
-
steps.push(formatRunScript(packageManager, getPrimaryDevelopmentScript(templateId)));
|
|
315
|
-
return steps;
|
|
316
|
-
}
|
|
317
|
-
function getOptionalOnboarding({
|
|
318
|
-
availableScripts,
|
|
319
|
-
packageManager,
|
|
320
|
-
templateId,
|
|
321
|
-
compoundPersistenceEnabled = false
|
|
322
|
-
}) {
|
|
323
|
-
return {
|
|
324
|
-
note: getOptionalOnboardingNote(packageManager, templateId, {
|
|
325
|
-
availableScripts,
|
|
326
|
-
compoundPersistenceEnabled
|
|
327
|
-
}),
|
|
328
|
-
shortNote: getOptionalOnboardingShortNote(packageManager, templateId, {
|
|
329
|
-
availableScripts,
|
|
330
|
-
compoundPersistenceEnabled
|
|
331
|
-
}),
|
|
332
|
-
steps: getOptionalOnboardingSteps(packageManager, templateId, {
|
|
333
|
-
availableScripts,
|
|
334
|
-
compoundPersistenceEnabled
|
|
335
|
-
})
|
|
336
|
-
};
|
|
337
|
-
}
|
|
329
|
+
|
|
330
|
+
// ../wp-typia-project-tools/src/runtime/cli-scaffold.ts
|
|
338
331
|
async function runScaffoldFlow({
|
|
339
332
|
projectInput,
|
|
340
333
|
cwd = process.cwd(),
|
|
@@ -456,8 +449,8 @@ async function runScaffoldFlow({
|
|
|
456
449
|
select: selectWithMigrationUi,
|
|
457
450
|
yes
|
|
458
451
|
});
|
|
459
|
-
const projectDir =
|
|
460
|
-
const projectName =
|
|
452
|
+
const projectDir = path5.resolve(cwd, projectInput);
|
|
453
|
+
const projectName = path5.basename(projectDir);
|
|
461
454
|
const answers = await collectScaffoldAnswers({
|
|
462
455
|
dataStorageMode: resolvedDataStorage,
|
|
463
456
|
namespace,
|
|
@@ -473,7 +466,7 @@ async function runScaffoldFlow({
|
|
|
473
466
|
if (resolvedTemplateId === "compound" && resolvedInnerBlocksPreset) {
|
|
474
467
|
answers.compoundInnerBlocksPreset = resolvedInnerBlocksPreset;
|
|
475
468
|
}
|
|
476
|
-
const
|
|
469
|
+
const emissionOptions = {
|
|
477
470
|
allowExistingDir,
|
|
478
471
|
alternateRenderTargets,
|
|
479
472
|
answers,
|
|
@@ -494,43 +487,12 @@ async function runScaffoldFlow({
|
|
|
494
487
|
withMigrationUi: resolvedWithMigrationUi,
|
|
495
488
|
withTestPreset: resolvedWithTestPreset,
|
|
496
489
|
withWpEnv: resolvedWithWpEnv
|
|
497
|
-
}
|
|
490
|
+
};
|
|
491
|
+
const resolvedResult = dryRun ? await buildScaffoldDryRunPlan(emissionOptions) : {
|
|
498
492
|
plan: undefined,
|
|
499
|
-
result: await
|
|
500
|
-
alternateRenderTargets,
|
|
501
|
-
answers,
|
|
502
|
-
allowExistingDir,
|
|
503
|
-
cwd,
|
|
504
|
-
dataStorageMode: resolvedDataStorage,
|
|
505
|
-
externalLayerId: resolvedExternalLayerSelection.externalLayerId,
|
|
506
|
-
externalLayerSource: resolvedExternalLayerSelection.externalLayerSource,
|
|
507
|
-
externalLayerSourceLabel: normalizedExternalLayerSource,
|
|
508
|
-
installDependencies,
|
|
509
|
-
noInstall,
|
|
510
|
-
onProgress,
|
|
511
|
-
packageManager: resolvedPackageManager,
|
|
512
|
-
persistencePolicy: resolvedPersistencePolicy,
|
|
513
|
-
profile: resolvedProfile,
|
|
514
|
-
projectDir,
|
|
515
|
-
templateId: resolvedTemplateId,
|
|
516
|
-
variant,
|
|
517
|
-
withMigrationUi: resolvedWithMigrationUi,
|
|
518
|
-
withTestPreset: resolvedWithTestPreset,
|
|
519
|
-
withWpEnv: resolvedWithWpEnv
|
|
520
|
-
})
|
|
493
|
+
result: await emitScaffoldProject(emissionOptions)
|
|
521
494
|
};
|
|
522
|
-
|
|
523
|
-
if (!dryRun) {
|
|
524
|
-
try {
|
|
525
|
-
const parsedPackageJson = await readJsonFile(path.join(projectDir, "package.json"), {
|
|
526
|
-
context: "generated package manifest"
|
|
527
|
-
});
|
|
528
|
-
const scripts = parsedPackageJson.scripts && typeof parsedPackageJson.scripts === "object" && !Array.isArray(parsedPackageJson.scripts) ? parsedPackageJson.scripts : {};
|
|
529
|
-
availableScripts = Object.entries(scripts).filter(([, value]) => typeof value === "string").map(([scriptName]) => scriptName);
|
|
530
|
-
} catch {
|
|
531
|
-
availableScripts = undefined;
|
|
532
|
-
}
|
|
533
|
-
}
|
|
495
|
+
const availableScripts = dryRun ? undefined : await readGeneratedPackageScripts(projectDir);
|
|
534
496
|
return {
|
|
535
497
|
dryRun,
|
|
536
498
|
optionalOnboarding: getOptionalOnboarding({
|
|
@@ -573,4 +535,4 @@ export {
|
|
|
573
535
|
getNextSteps
|
|
574
536
|
};
|
|
575
537
|
|
|
576
|
-
//# debugId=
|
|
538
|
+
//# debugId=3CB466F01953BF7F64756E2164756E21
|
package/dist-bunli/cli.js
CHANGED
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
package_default,
|
|
23
23
|
validateCliOutputFormatArgv,
|
|
24
24
|
writeStructuredCliDiagnosticError
|
|
25
|
-
} from "./cli-
|
|
25
|
+
} from "./cli-368d4cgy.js";
|
|
26
26
|
import"./cli-03j0axbt.js";
|
|
27
27
|
import {
|
|
28
28
|
GLOBAL_FLAGS,
|
|
@@ -2460,7 +2460,7 @@ async function formatCliError(error) {
|
|
|
2460
2460
|
}
|
|
2461
2461
|
async function createWpTypiaCli(options = {}) {
|
|
2462
2462
|
applyStandaloneSupportLayoutEnv();
|
|
2463
|
-
const { wpTypiaCommands } = await import("./command-list-
|
|
2463
|
+
const { wpTypiaCommands } = await import("./command-list-y3g7e9rb.js");
|
|
2464
2464
|
const cli = await createCLI({
|
|
2465
2465
|
...bunliConfig,
|
|
2466
2466
|
description: package_default.description,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
package_default,
|
|
20
20
|
prefersStructuredCliOutput,
|
|
21
21
|
resolveCommandOptionValues
|
|
22
|
-
} from "./cli-
|
|
22
|
+
} from "./cli-368d4cgy.js";
|
|
23
23
|
import {
|
|
24
24
|
Result,
|
|
25
25
|
TaggedError,
|
|
@@ -120,7 +120,9 @@ var PATTERN_CATALOG_VISIBLE_FIELDS = [
|
|
|
120
120
|
"name",
|
|
121
121
|
"scope",
|
|
122
122
|
"section-role",
|
|
123
|
-
"catalog-title"
|
|
123
|
+
"catalog-title",
|
|
124
|
+
"tags",
|
|
125
|
+
"thumbnail-url"
|
|
124
126
|
];
|
|
125
127
|
var NAME_SOURCE_VISIBLE_FIELDS = [
|
|
126
128
|
"kind",
|
|
@@ -591,6 +593,10 @@ var contractAddKindEntry = defineAddKindRegistryEntry({
|
|
|
591
593
|
var CORE_VARIATION_MISSING_NAME_MESSAGE = "`wp-typia add core-variation` requires <name>. Usage: wp-typia add core-variation <block-name> <name> or wp-typia add core-variation <name> --block <namespace/block>.";
|
|
592
594
|
var CORE_VARIATION_MISSING_BLOCK_MESSAGE = "`wp-typia add core-variation` requires <block-name>. Usage: wp-typia add core-variation <block-name> <name> or wp-typia add core-variation <name> --block <namespace/block>.";
|
|
593
595
|
var CORE_VARIATION_BLOCK_NAME_PATTERN = /^[^/\s]+\/[^/\s]+$/u;
|
|
596
|
+
var CORE_VARIATION_POSITIONAL_TARGET_DIAGNOSTICS = {
|
|
597
|
+
empty: () => "The first positional argument (target block name) requires a block name.",
|
|
598
|
+
invalidFormat: () => "The first positional argument (target block name) must use <namespace/block-slug> format."
|
|
599
|
+
};
|
|
594
600
|
function formatCoreVariationMissingPositionalNameMessage(blockName) {
|
|
595
601
|
return [
|
|
596
602
|
`\`wp-typia add core-variation ${blockName}\` is missing <name>.`,
|
|
@@ -608,6 +614,7 @@ function resolveCoreVariationInputs(context) {
|
|
|
608
614
|
}
|
|
609
615
|
return {
|
|
610
616
|
targetBlockName: positionalTargetBlockName,
|
|
617
|
+
targetBlockNameDiagnostics: CORE_VARIATION_POSITIONAL_TARGET_DIAGNOSTICS,
|
|
611
618
|
variationName: positionalVariationName
|
|
612
619
|
};
|
|
613
620
|
}
|
|
@@ -622,6 +629,7 @@ function resolveCoreVariationInputs(context) {
|
|
|
622
629
|
}
|
|
623
630
|
return {
|
|
624
631
|
targetBlockName: targetBlockFlag,
|
|
632
|
+
targetBlockNameDiagnostics: "--block",
|
|
625
633
|
variationName
|
|
626
634
|
};
|
|
627
635
|
}
|
|
@@ -641,11 +649,12 @@ var coreVariationAddKindEntry = defineAddKindRegistryEntry({
|
|
|
641
649
|
description: "Add an editor-side variation for an existing core or external block",
|
|
642
650
|
nameLabel: "Variation name",
|
|
643
651
|
async prepareExecution(context) {
|
|
644
|
-
const { targetBlockName, variationName } = resolveCoreVariationInputs(context);
|
|
652
|
+
const { targetBlockName, targetBlockNameDiagnostics, variationName } = resolveCoreVariationInputs(context);
|
|
645
653
|
return createNamedExecutionPlan(context, {
|
|
646
654
|
execute: ({ cwd, name }) => context.addRuntime.runAddCoreVariationCommand({
|
|
647
655
|
cwd,
|
|
648
656
|
targetBlockName,
|
|
657
|
+
targetBlockNameDiagnostics,
|
|
649
658
|
variationName: name
|
|
650
659
|
}),
|
|
651
660
|
getValues: (result) => ({
|
|
@@ -820,15 +829,19 @@ var patternAddKindEntry = defineAddKindRegistryEntry({
|
|
|
820
829
|
title: "Added workspace pattern"
|
|
821
830
|
},
|
|
822
831
|
description: "Add a PHP block pattern shell",
|
|
823
|
-
hiddenStringSubmitFields: ["tag"
|
|
832
|
+
hiddenStringSubmitFields: ["tag"],
|
|
824
833
|
nameLabel: "Pattern name",
|
|
825
834
|
async prepareExecution(context) {
|
|
826
835
|
const name = requireAddKindName(context, PATTERN_MISSING_NAME_MESSAGE);
|
|
836
|
+
const rawScope = typeof context.flags.scope === "string" ? context.flags.scope : undefined;
|
|
837
|
+
const rawSectionRole = typeof context.flags["section-role"] === "string" ? context.flags["section-role"] : undefined;
|
|
838
|
+
const rawCatalogTitle = typeof context.flags["catalog-title"] === "string" ? context.flags["catalog-title"] : undefined;
|
|
839
|
+
const rawThumbnailUrl = typeof context.flags["thumbnail-url"] === "string" ? context.flags["thumbnail-url"] : undefined;
|
|
827
840
|
const scope = resolvePatternScopeFlag(context);
|
|
828
841
|
const sectionRole = resolvePatternSectionRoleFlag(context, scope);
|
|
829
|
-
const catalogTitle =
|
|
842
|
+
const catalogTitle = rawCatalogTitle;
|
|
830
843
|
const tags = normalizePatternTagFlags(context.flags.tags, context.flags.tag);
|
|
831
|
-
const thumbnailUrl =
|
|
844
|
+
const thumbnailUrl = rawThumbnailUrl;
|
|
832
845
|
return {
|
|
833
846
|
execute: (cwd) => context.addRuntime.runAddPatternCommand({
|
|
834
847
|
catalogTitle,
|
|
@@ -839,6 +852,13 @@ var patternAddKindEntry = defineAddKindRegistryEntry({
|
|
|
839
852
|
tags,
|
|
840
853
|
thumbnailUrl
|
|
841
854
|
}),
|
|
855
|
+
getDryRunSummaryLines: (result) => buildPatternCatalogDryRunSummaryLines(result, {
|
|
856
|
+
rawCatalogTitle,
|
|
857
|
+
rawScope,
|
|
858
|
+
rawSectionRole,
|
|
859
|
+
rawTags: tags,
|
|
860
|
+
rawThumbnailUrl
|
|
861
|
+
}),
|
|
842
862
|
getValues: (result) => ({
|
|
843
863
|
contentFile: result.contentFile,
|
|
844
864
|
patternSlug: result.patternSlug,
|
|
@@ -902,6 +922,75 @@ function normalizePatternTagFlags(tagsFlag, tagFlag) {
|
|
|
902
922
|
];
|
|
903
923
|
return tags.length > 0 ? tags : undefined;
|
|
904
924
|
}
|
|
925
|
+
function quoteValue(value) {
|
|
926
|
+
return `"${value}"`;
|
|
927
|
+
}
|
|
928
|
+
function formatTags(tags) {
|
|
929
|
+
return tags.length > 0 ? tags.join(", ") : "no tags";
|
|
930
|
+
}
|
|
931
|
+
function collectPatternTagTokens(tags) {
|
|
932
|
+
return (tags ?? []).flatMap((tag) => tag.split(",")).map((tag) => tag.trim()).filter((tag) => tag.length > 0);
|
|
933
|
+
}
|
|
934
|
+
function valuesMatch(left, right) {
|
|
935
|
+
return left.length === right.length && left.every((value, index) => value === right[index]);
|
|
936
|
+
}
|
|
937
|
+
function createNormalizationNote(options) {
|
|
938
|
+
const rawValue = options.rawValue;
|
|
939
|
+
if (rawValue === undefined || rawValue.trim().length === 0 || !options.resolvedValue || rawValue === options.resolvedValue) {
|
|
940
|
+
return;
|
|
941
|
+
}
|
|
942
|
+
return `${options.fieldLabel} normalized from ${quoteValue(rawValue)} to ${quoteValue(options.resolvedValue)}.`;
|
|
943
|
+
}
|
|
944
|
+
function collectPatternCatalogNormalizationNotes(result, options) {
|
|
945
|
+
const notes = [
|
|
946
|
+
createNormalizationNote({
|
|
947
|
+
fieldLabel: "Scope",
|
|
948
|
+
rawValue: options.rawScope,
|
|
949
|
+
resolvedValue: result.patternScope
|
|
950
|
+
}),
|
|
951
|
+
createNormalizationNote({
|
|
952
|
+
fieldLabel: "Section role",
|
|
953
|
+
rawValue: options.rawSectionRole,
|
|
954
|
+
resolvedValue: result.sectionRole
|
|
955
|
+
}),
|
|
956
|
+
createNormalizationNote({
|
|
957
|
+
fieldLabel: "Title",
|
|
958
|
+
rawValue: options.rawCatalogTitle,
|
|
959
|
+
resolvedValue: result.title
|
|
960
|
+
}),
|
|
961
|
+
createNormalizationNote({
|
|
962
|
+
fieldLabel: "Thumbnail URL",
|
|
963
|
+
rawValue: options.rawThumbnailUrl,
|
|
964
|
+
resolvedValue: result.thumbnailUrl
|
|
965
|
+
})
|
|
966
|
+
].filter((note) => typeof note === "string");
|
|
967
|
+
const rawTags = collectPatternTagTokens(options.rawTags);
|
|
968
|
+
if (rawTags.length > 0 && !valuesMatch(rawTags, result.tags)) {
|
|
969
|
+
notes.push(`Tags normalized from ${quoteValue(formatTags(rawTags))} to ${quoteValue(formatTags(result.tags))}.`);
|
|
970
|
+
}
|
|
971
|
+
return notes;
|
|
972
|
+
}
|
|
973
|
+
function buildPatternCatalogDryRunSummaryLines(result, options) {
|
|
974
|
+
const catalogLines = [
|
|
975
|
+
"",
|
|
976
|
+
"Catalog metadata:",
|
|
977
|
+
` Scope: ${result.patternScope}`,
|
|
978
|
+
...result.sectionRole ? [` Section role: ${result.sectionRole}`] : [],
|
|
979
|
+
` Title: ${result.title}`,
|
|
980
|
+
...result.tags.length > 0 ? [` Tags: ${formatTags(result.tags)}`] : [],
|
|
981
|
+
...result.thumbnailUrl ? [` Thumbnail URL: ${result.thumbnailUrl}`] : []
|
|
982
|
+
];
|
|
983
|
+
const normalizationNotes = collectPatternCatalogNormalizationNotes(result, options);
|
|
984
|
+
if (normalizationNotes.length === 0) {
|
|
985
|
+
return catalogLines;
|
|
986
|
+
}
|
|
987
|
+
return [
|
|
988
|
+
...catalogLines,
|
|
989
|
+
"",
|
|
990
|
+
"Normalization notes:",
|
|
991
|
+
...normalizationNotes.map((note) => ` ${note}`)
|
|
992
|
+
];
|
|
993
|
+
}
|
|
905
994
|
|
|
906
995
|
// src/add-kinds/post-meta.ts
|
|
907
996
|
var POST_META_MISSING_NAME_MESSAGE = "`wp-typia add post-meta` requires <name>. Usage: wp-typia add post-meta <name> --post-type <post-type> [--type <ExportedTypeName>] [--meta-key <meta-key>].";
|
|
@@ -1731,12 +1820,16 @@ function buildAddCompletionPayload(options, markerOptions) {
|
|
|
1731
1820
|
}
|
|
1732
1821
|
function buildAddDryRunPayload(options, markerOptions) {
|
|
1733
1822
|
const normalizedTitle = stripLeadingOutputMarker(options.completion.title, "success").replace(/^Added\s*/u, "");
|
|
1823
|
+
const summaryLines = [
|
|
1824
|
+
...options.completion.summaryLines ?? [],
|
|
1825
|
+
...options.summaryLines ?? []
|
|
1826
|
+
];
|
|
1734
1827
|
return {
|
|
1735
1828
|
optionalLines: options.fileOperations,
|
|
1736
1829
|
optionalNote: "No workspace files were changed because --dry-run was enabled. Re-run without --dry-run to apply this add command.",
|
|
1737
1830
|
optionalTitle: `Planned workspace updates (${options.fileOperations.length}):`,
|
|
1738
1831
|
preambleLines: options.completion.preambleLines,
|
|
1739
|
-
summaryLines:
|
|
1832
|
+
summaryLines: summaryLines.length > 0 ? summaryLines : undefined,
|
|
1740
1833
|
title: formatOutputMarker("dryRun", `Dry run for ${normalizedTitle || "workspace add command"}`, markerOptions),
|
|
1741
1834
|
warningLines: options.completion.warningLines
|
|
1742
1835
|
};
|
|
@@ -1856,7 +1949,7 @@ function pushFlag(argv, name, value) {
|
|
|
1856
1949
|
}
|
|
1857
1950
|
|
|
1858
1951
|
// src/runtime-bridge-add.ts
|
|
1859
|
-
var loadCliAddRuntime = () => import("./cli-add-
|
|
1952
|
+
var loadCliAddRuntime = () => import("./cli-add-qjd3ba8j.js");
|
|
1860
1953
|
var loadCliPromptRuntime = () => import("./cli-prompt-ncyg68rn.js");
|
|
1861
1954
|
async function executeWorkspaceAddWithOptionalDryRun(options) {
|
|
1862
1955
|
const simulated = options.dryRun ? await simulateWorkspaceAddDryRun({
|
|
@@ -1874,7 +1967,8 @@ async function executeWorkspaceAddWithOptionalDryRun(options) {
|
|
|
1874
1967
|
}
|
|
1875
1968
|
return emitCompletion(buildAddDryRunPayload({
|
|
1876
1969
|
completion,
|
|
1877
|
-
fileOperations: simulated.fileOperations
|
|
1970
|
+
fileOperations: simulated.fileOperations,
|
|
1971
|
+
summaryLines: options.buildDryRunSummaryLines?.(result)
|
|
1878
1972
|
}), {
|
|
1879
1973
|
emitOutput: options.emitOutput ?? true,
|
|
1880
1974
|
printLine: options.printLine,
|
|
@@ -1889,6 +1983,7 @@ function executePreparedAddKind(kind, context, plan) {
|
|
|
1889
1983
|
values: plan.getValues(result),
|
|
1890
1984
|
warnings: plan.getWarnings?.(result)
|
|
1891
1985
|
}),
|
|
1986
|
+
buildDryRunSummaryLines: (result) => plan.getDryRunSummaryLines?.(result),
|
|
1892
1987
|
cwd: context.cwd,
|
|
1893
1988
|
dryRun: context.dryRun,
|
|
1894
1989
|
emitOutput: context.emitOutput,
|
|
@@ -1966,7 +2061,7 @@ async function executeAddCommand({
|
|
|
1966
2061
|
}
|
|
1967
2062
|
// src/runtime-bridge-create.ts
|
|
1968
2063
|
var loadCliPromptRuntime2 = () => import("./cli-prompt-ncyg68rn.js");
|
|
1969
|
-
var loadCliScaffoldRuntime = () => import("./cli-scaffold-
|
|
2064
|
+
var loadCliScaffoldRuntime = () => import("./cli-scaffold-0bb6pr3w.js");
|
|
1970
2065
|
var loadCliTemplatesRuntime = () => import("./cli-templates-g8t4fm11.js");
|
|
1971
2066
|
var loadCreateTemplateValidationRuntime = () => import("./create-template-validation-4fr851vg.js");
|
|
1972
2067
|
var PACKAGE_MANAGER_PROMPT_OPTIONS = [
|
|
@@ -2087,7 +2182,7 @@ async function executeCreateCommand({
|
|
|
2087
2182
|
}
|
|
2088
2183
|
}
|
|
2089
2184
|
// src/runtime-bridge-doctor.ts
|
|
2090
|
-
var loadCliDoctorRuntime = () => import("./cli-doctor-
|
|
2185
|
+
var loadCliDoctorRuntime = () => import("./cli-doctor-6fyxq940.js");
|
|
2091
2186
|
async function executeDoctorCommand(cwd, options = {}) {
|
|
2092
2187
|
try {
|
|
2093
2188
|
const { runDoctor } = await loadCliDoctorRuntime();
|
|
@@ -2098,7 +2193,7 @@ async function executeDoctorCommand(cwd, options = {}) {
|
|
|
2098
2193
|
}
|
|
2099
2194
|
// src/runtime-bridge-init.ts
|
|
2100
2195
|
import path2 from "path";
|
|
2101
|
-
var loadCliInitRuntime = () => import("./cli-init-
|
|
2196
|
+
var loadCliInitRuntime = () => import("./cli-init-7avk42dh.js");
|
|
2102
2197
|
async function executeInitCommand({ apply, cwd, packageManager, projectDir }, options = {}) {
|
|
2103
2198
|
try {
|
|
2104
2199
|
const { runInitCommand } = await loadCliInitRuntime();
|
|
@@ -2124,7 +2219,7 @@ async function executeInitCommand({ apply, cwd, packageManager, projectDir }, op
|
|
|
2124
2219
|
}
|
|
2125
2220
|
}
|
|
2126
2221
|
// src/runtime-bridge-migrate.ts
|
|
2127
|
-
var loadMigrationsRuntime = () => import("./migrations-
|
|
2222
|
+
var loadMigrationsRuntime = () => import("./migrations-3vngdy51.js");
|
|
2128
2223
|
var defaultPrintLine2 = (line) => {
|
|
2129
2224
|
process.stdout.write(`${line}
|
|
2130
2225
|
`);
|
|
@@ -3020,7 +3115,7 @@ var doctorCommand = defineCommand({
|
|
|
3020
3115
|
createDoctorRunSummary,
|
|
3021
3116
|
getDoctorChecks,
|
|
3022
3117
|
getDoctorExitFailureDetailLines
|
|
3023
|
-
} = await import("./cli-doctor-
|
|
3118
|
+
} = await import("./cli-doctor-6fyxq940.js");
|
|
3024
3119
|
const checks = await getDoctorChecks(args.cwd);
|
|
3025
3120
|
const summary = createDoctorRunSummary(checks, {
|
|
3026
3121
|
exitPolicy: doctorExitPolicy
|
|
@@ -3915,4 +4010,4 @@ export {
|
|
|
3915
4010
|
wpTypiaCommands
|
|
3916
4011
|
};
|
|
3917
4012
|
|
|
3918
|
-
//# debugId=
|
|
4013
|
+
//# debugId=3C2BF11DC520694164756E2164756E21
|
|
@@ -15,9 +15,9 @@ import {
|
|
|
15
15
|
snapshotProjectVersion,
|
|
16
16
|
verifyProjectMigrations,
|
|
17
17
|
wizardProjectMigrations
|
|
18
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-tj7ajdvf.js";
|
|
19
19
|
import"./cli-e4bwd81c.js";
|
|
20
|
-
import"./cli-
|
|
20
|
+
import"./cli-fv4h3ydt.js";
|
|
21
21
|
import"./cli-cvxvcw7c.js";
|
|
22
22
|
import"./cli-bajwv85z.js";
|
|
23
23
|
import"./cli-tq730sqt.js";
|