wp-typia 0.24.3 → 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 +121 -13
- package/dist-bunli/{cli-4pzxbk4s.js → cli-368d4cgy.js} +8 -4
- package/dist-bunli/{cli-add-mxxk5rep.js → cli-add-qjd3ba8j.js} +16 -5
- package/dist-bunli/cli.js +2 -2
- package/dist-bunli/{command-list-bgwaa2f4.js → command-list-y3g7e9rb.js} +101 -8
- package/dist-bunli/node-cli.js +106 -9
- package/package.json +2 -2
|
@@ -239228,13 +239228,23 @@ var init_cli_add_workspace_binding_source_source_emitters = __esm(() => {
|
|
|
239228
239228
|
});
|
|
239229
239229
|
|
|
239230
239230
|
// ../wp-typia-project-tools/src/runtime/block-targets.ts
|
|
239231
|
-
function
|
|
239231
|
+
function resolveFullBlockNameDiagnostics(diagnostics) {
|
|
239232
|
+
if (typeof diagnostics !== "string") {
|
|
239233
|
+
return diagnostics;
|
|
239234
|
+
}
|
|
239235
|
+
return {
|
|
239236
|
+
empty: () => `\`${diagnostics}\` requires a block name.`,
|
|
239237
|
+
invalidFormat: () => `\`${diagnostics}\` must use <namespace/block-slug> format.`
|
|
239238
|
+
};
|
|
239239
|
+
}
|
|
239240
|
+
function assertFullBlockName(blockName, diagnostics) {
|
|
239241
|
+
const messages = resolveFullBlockNameDiagnostics(diagnostics);
|
|
239232
239242
|
const trimmed = blockName.trim();
|
|
239233
239243
|
if (!trimmed) {
|
|
239234
|
-
throw new Error(
|
|
239244
|
+
throw new Error(messages.empty());
|
|
239235
239245
|
}
|
|
239236
239246
|
if (!FULL_BLOCK_NAME_PATTERN.test(trimmed)) {
|
|
239237
|
-
throw new Error(
|
|
239247
|
+
throw new Error(messages.invalidFormat());
|
|
239238
239248
|
}
|
|
239239
239249
|
return trimmed;
|
|
239240
239250
|
}
|
|
@@ -241523,10 +241533,11 @@ async function writeCoreVariationRegistry(projectDir, targetBlockName, textDomai
|
|
|
241523
241533
|
async function runAddCoreVariationCommand({
|
|
241524
241534
|
cwd = process.cwd(),
|
|
241525
241535
|
targetBlockName,
|
|
241536
|
+
targetBlockNameDiagnostics = "core-variation target",
|
|
241526
241537
|
variationName
|
|
241527
241538
|
}) {
|
|
241528
241539
|
const workspace = resolveWorkspaceProject(cwd);
|
|
241529
|
-
const resolvedTargetBlockName = assertFullBlockName(targetBlockName,
|
|
241540
|
+
const resolvedTargetBlockName = assertFullBlockName(targetBlockName, targetBlockNameDiagnostics);
|
|
241530
241541
|
const variationSlug = assertValidGeneratedSlug("Core variation name", normalizeBlockSlug(variationName), CORE_VARIATION_USAGE);
|
|
241531
241542
|
const unknownCoreTargetWarning = getUnknownCoreVariationTargetWarning(resolvedTargetBlockName);
|
|
241532
241543
|
assertCoreVariationSlugIsNotRegistryIndex(variationSlug);
|
|
@@ -300143,7 +300154,11 @@ function resolveCommandOptionValues(metadata2, options) {
|
|
|
300143
300154
|
continue;
|
|
300144
300155
|
}
|
|
300145
300156
|
if (descriptor.repeatable && Array.isArray(value2)) {
|
|
300146
|
-
|
|
300157
|
+
if (!value2.every((item) => typeof item === "string")) {
|
|
300158
|
+
resolved[name2] = undefined;
|
|
300159
|
+
continue;
|
|
300160
|
+
}
|
|
300161
|
+
resolved[name2] = options.preserveArrays ? [...value2] : value2.join(",");
|
|
300147
300162
|
continue;
|
|
300148
300163
|
}
|
|
300149
300164
|
resolved[name2] = typeof value2 === "string" ? value2 : undefined;
|
|
@@ -300812,6 +300827,10 @@ init_cli_diagnostics();
|
|
|
300812
300827
|
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>.";
|
|
300813
300828
|
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>.";
|
|
300814
300829
|
var CORE_VARIATION_BLOCK_NAME_PATTERN = /^[^/\s]+\/[^/\s]+$/u;
|
|
300830
|
+
var CORE_VARIATION_POSITIONAL_TARGET_DIAGNOSTICS = {
|
|
300831
|
+
empty: () => "The first positional argument (target block name) requires a block name.",
|
|
300832
|
+
invalidFormat: () => "The first positional argument (target block name) must use <namespace/block-slug> format."
|
|
300833
|
+
};
|
|
300815
300834
|
function formatCoreVariationMissingPositionalNameMessage(blockName) {
|
|
300816
300835
|
return [
|
|
300817
300836
|
`\`wp-typia add core-variation ${blockName}\` is missing <name>.`,
|
|
@@ -300829,6 +300848,7 @@ function resolveCoreVariationInputs(context) {
|
|
|
300829
300848
|
}
|
|
300830
300849
|
return {
|
|
300831
300850
|
targetBlockName: positionalTargetBlockName,
|
|
300851
|
+
targetBlockNameDiagnostics: CORE_VARIATION_POSITIONAL_TARGET_DIAGNOSTICS,
|
|
300832
300852
|
variationName: positionalVariationName
|
|
300833
300853
|
};
|
|
300834
300854
|
}
|
|
@@ -300843,6 +300863,7 @@ function resolveCoreVariationInputs(context) {
|
|
|
300843
300863
|
}
|
|
300844
300864
|
return {
|
|
300845
300865
|
targetBlockName: targetBlockFlag,
|
|
300866
|
+
targetBlockNameDiagnostics: "--block",
|
|
300846
300867
|
variationName
|
|
300847
300868
|
};
|
|
300848
300869
|
}
|
|
@@ -300862,11 +300883,12 @@ var coreVariationAddKindEntry = defineAddKindRegistryEntry({
|
|
|
300862
300883
|
description: "Add an editor-side variation for an existing core or external block",
|
|
300863
300884
|
nameLabel: "Variation name",
|
|
300864
300885
|
async prepareExecution(context) {
|
|
300865
|
-
const { targetBlockName, variationName } = resolveCoreVariationInputs(context);
|
|
300886
|
+
const { targetBlockName, targetBlockNameDiagnostics, variationName } = resolveCoreVariationInputs(context);
|
|
300866
300887
|
return createNamedExecutionPlan(context, {
|
|
300867
300888
|
execute: ({ cwd, name: name2 }) => context.addRuntime.runAddCoreVariationCommand({
|
|
300868
300889
|
cwd,
|
|
300869
300890
|
targetBlockName,
|
|
300891
|
+
targetBlockNameDiagnostics,
|
|
300870
300892
|
variationName: name2
|
|
300871
300893
|
}),
|
|
300872
300894
|
getValues: (result) => ({
|
|
@@ -301046,11 +301068,15 @@ var patternAddKindEntry = defineAddKindRegistryEntry({
|
|
|
301046
301068
|
nameLabel: "Pattern name",
|
|
301047
301069
|
async prepareExecution(context) {
|
|
301048
301070
|
const name2 = requireAddKindName(context, PATTERN_MISSING_NAME_MESSAGE);
|
|
301071
|
+
const rawScope = typeof context.flags.scope === "string" ? context.flags.scope : undefined;
|
|
301072
|
+
const rawSectionRole = typeof context.flags["section-role"] === "string" ? context.flags["section-role"] : undefined;
|
|
301073
|
+
const rawCatalogTitle = typeof context.flags["catalog-title"] === "string" ? context.flags["catalog-title"] : undefined;
|
|
301074
|
+
const rawThumbnailUrl = typeof context.flags["thumbnail-url"] === "string" ? context.flags["thumbnail-url"] : undefined;
|
|
301049
301075
|
const scope = resolvePatternScopeFlag(context);
|
|
301050
301076
|
const sectionRole = resolvePatternSectionRoleFlag(context, scope);
|
|
301051
|
-
const catalogTitle =
|
|
301077
|
+
const catalogTitle = rawCatalogTitle;
|
|
301052
301078
|
const tags = normalizePatternTagFlags(context.flags.tags, context.flags.tag);
|
|
301053
|
-
const thumbnailUrl =
|
|
301079
|
+
const thumbnailUrl = rawThumbnailUrl;
|
|
301054
301080
|
return {
|
|
301055
301081
|
execute: (cwd) => context.addRuntime.runAddPatternCommand({
|
|
301056
301082
|
catalogTitle,
|
|
@@ -301061,6 +301087,13 @@ var patternAddKindEntry = defineAddKindRegistryEntry({
|
|
|
301061
301087
|
tags,
|
|
301062
301088
|
thumbnailUrl
|
|
301063
301089
|
}),
|
|
301090
|
+
getDryRunSummaryLines: (result) => buildPatternCatalogDryRunSummaryLines(result, {
|
|
301091
|
+
rawCatalogTitle,
|
|
301092
|
+
rawScope,
|
|
301093
|
+
rawSectionRole,
|
|
301094
|
+
rawTags: tags,
|
|
301095
|
+
rawThumbnailUrl
|
|
301096
|
+
}),
|
|
301064
301097
|
getValues: (result) => ({
|
|
301065
301098
|
contentFile: result.contentFile,
|
|
301066
301099
|
patternSlug: result.patternSlug,
|
|
@@ -301124,6 +301157,75 @@ function normalizePatternTagFlags(tagsFlag, tagFlag) {
|
|
|
301124
301157
|
];
|
|
301125
301158
|
return tags.length > 0 ? tags : undefined;
|
|
301126
301159
|
}
|
|
301160
|
+
function quoteValue(value2) {
|
|
301161
|
+
return `"${value2}"`;
|
|
301162
|
+
}
|
|
301163
|
+
function formatTags(tags) {
|
|
301164
|
+
return tags.length > 0 ? tags.join(", ") : "no tags";
|
|
301165
|
+
}
|
|
301166
|
+
function collectPatternTagTokens(tags) {
|
|
301167
|
+
return (tags ?? []).flatMap((tag) => tag.split(",")).map((tag) => tag.trim()).filter((tag) => tag.length > 0);
|
|
301168
|
+
}
|
|
301169
|
+
function valuesMatch(left, right) {
|
|
301170
|
+
return left.length === right.length && left.every((value2, index) => value2 === right[index]);
|
|
301171
|
+
}
|
|
301172
|
+
function createNormalizationNote(options) {
|
|
301173
|
+
const rawValue = options.rawValue;
|
|
301174
|
+
if (rawValue === undefined || rawValue.trim().length === 0 || !options.resolvedValue || rawValue === options.resolvedValue) {
|
|
301175
|
+
return;
|
|
301176
|
+
}
|
|
301177
|
+
return `${options.fieldLabel} normalized from ${quoteValue(rawValue)} to ${quoteValue(options.resolvedValue)}.`;
|
|
301178
|
+
}
|
|
301179
|
+
function collectPatternCatalogNormalizationNotes(result, options) {
|
|
301180
|
+
const notes = [
|
|
301181
|
+
createNormalizationNote({
|
|
301182
|
+
fieldLabel: "Scope",
|
|
301183
|
+
rawValue: options.rawScope,
|
|
301184
|
+
resolvedValue: result.patternScope
|
|
301185
|
+
}),
|
|
301186
|
+
createNormalizationNote({
|
|
301187
|
+
fieldLabel: "Section role",
|
|
301188
|
+
rawValue: options.rawSectionRole,
|
|
301189
|
+
resolvedValue: result.sectionRole
|
|
301190
|
+
}),
|
|
301191
|
+
createNormalizationNote({
|
|
301192
|
+
fieldLabel: "Title",
|
|
301193
|
+
rawValue: options.rawCatalogTitle,
|
|
301194
|
+
resolvedValue: result.title
|
|
301195
|
+
}),
|
|
301196
|
+
createNormalizationNote({
|
|
301197
|
+
fieldLabel: "Thumbnail URL",
|
|
301198
|
+
rawValue: options.rawThumbnailUrl,
|
|
301199
|
+
resolvedValue: result.thumbnailUrl
|
|
301200
|
+
})
|
|
301201
|
+
].filter((note) => typeof note === "string");
|
|
301202
|
+
const rawTags = collectPatternTagTokens(options.rawTags);
|
|
301203
|
+
if (rawTags.length > 0 && !valuesMatch(rawTags, result.tags)) {
|
|
301204
|
+
notes.push(`Tags normalized from ${quoteValue(formatTags(rawTags))} to ${quoteValue(formatTags(result.tags))}.`);
|
|
301205
|
+
}
|
|
301206
|
+
return notes;
|
|
301207
|
+
}
|
|
301208
|
+
function buildPatternCatalogDryRunSummaryLines(result, options) {
|
|
301209
|
+
const catalogLines = [
|
|
301210
|
+
"",
|
|
301211
|
+
"Catalog metadata:",
|
|
301212
|
+
` Scope: ${result.patternScope}`,
|
|
301213
|
+
...result.sectionRole ? [` Section role: ${result.sectionRole}`] : [],
|
|
301214
|
+
` Title: ${result.title}`,
|
|
301215
|
+
...result.tags.length > 0 ? [` Tags: ${formatTags(result.tags)}`] : [],
|
|
301216
|
+
...result.thumbnailUrl ? [` Thumbnail URL: ${result.thumbnailUrl}`] : []
|
|
301217
|
+
];
|
|
301218
|
+
const normalizationNotes = collectPatternCatalogNormalizationNotes(result, options);
|
|
301219
|
+
if (normalizationNotes.length === 0) {
|
|
301220
|
+
return catalogLines;
|
|
301221
|
+
}
|
|
301222
|
+
return [
|
|
301223
|
+
...catalogLines,
|
|
301224
|
+
"",
|
|
301225
|
+
"Normalization notes:",
|
|
301226
|
+
...normalizationNotes.map((note) => ` ${note}`)
|
|
301227
|
+
];
|
|
301228
|
+
}
|
|
301127
301229
|
|
|
301128
301230
|
// src/add-kinds/post-meta.ts
|
|
301129
301231
|
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>].";
|
|
@@ -301872,7 +301974,7 @@ function buildStructuredInitSuccessPayload(plan) {
|
|
|
301872
301974
|
// package.json
|
|
301873
301975
|
var package_default2 = {
|
|
301874
301976
|
name: "wp-typia",
|
|
301875
|
-
version: "0.24.
|
|
301977
|
+
version: "0.24.4",
|
|
301876
301978
|
description: "Canonical CLI package for wp-typia scaffolding and project workflows",
|
|
301877
301979
|
packageManager: "bun@1.3.11",
|
|
301878
301980
|
type: "module",
|
|
@@ -301942,7 +302044,7 @@ var package_default2 = {
|
|
|
301942
302044
|
"@bunli/tui": "0.6.0",
|
|
301943
302045
|
"@bunli/utils": "0.6.0",
|
|
301944
302046
|
"@wp-typia/api-client": "^0.4.5",
|
|
301945
|
-
"@wp-typia/project-tools": "0.24.
|
|
302047
|
+
"@wp-typia/project-tools": "0.24.4",
|
|
301946
302048
|
"better-result": "^2.7.0",
|
|
301947
302049
|
react: "^19.2.5",
|
|
301948
302050
|
"react-dom": "^19.2.5",
|
|
@@ -302053,12 +302155,16 @@ function buildAddCompletionPayload(options, markerOptions) {
|
|
|
302053
302155
|
}
|
|
302054
302156
|
function buildAddDryRunPayload(options, markerOptions) {
|
|
302055
302157
|
const normalizedTitle = stripLeadingOutputMarker(options.completion.title, "success").replace(/^Added\s*/u, "");
|
|
302158
|
+
const summaryLines = [
|
|
302159
|
+
...options.completion.summaryLines ?? [],
|
|
302160
|
+
...options.summaryLines ?? []
|
|
302161
|
+
];
|
|
302056
302162
|
return {
|
|
302057
302163
|
optionalLines: options.fileOperations,
|
|
302058
302164
|
optionalNote: "No workspace files were changed because --dry-run was enabled. Re-run without --dry-run to apply this add command.",
|
|
302059
302165
|
optionalTitle: `Planned workspace updates (${options.fileOperations.length}):`,
|
|
302060
302166
|
preambleLines: options.completion.preambleLines,
|
|
302061
|
-
summaryLines:
|
|
302167
|
+
summaryLines: summaryLines.length > 0 ? summaryLines : undefined,
|
|
302062
302168
|
title: formatOutputMarker("dryRun", `Dry run for ${normalizedTitle || "workspace add command"}`, markerOptions),
|
|
302063
302169
|
warningLines: options.completion.warningLines
|
|
302064
302170
|
};
|
|
@@ -302196,7 +302302,8 @@ async function executeWorkspaceAddWithOptionalDryRun(options) {
|
|
|
302196
302302
|
}
|
|
302197
302303
|
return emitCompletion(buildAddDryRunPayload({
|
|
302198
302304
|
completion,
|
|
302199
|
-
fileOperations: simulated.fileOperations
|
|
302305
|
+
fileOperations: simulated.fileOperations,
|
|
302306
|
+
summaryLines: options.buildDryRunSummaryLines?.(result)
|
|
302200
302307
|
}), {
|
|
302201
302308
|
emitOutput: options.emitOutput ?? true,
|
|
302202
302309
|
printLine: options.printLine,
|
|
@@ -302211,6 +302318,7 @@ function executePreparedAddKind(kind, context, plan) {
|
|
|
302211
302318
|
values: plan.getValues(result),
|
|
302212
302319
|
warnings: plan.getWarnings?.(result)
|
|
302213
302320
|
}),
|
|
302321
|
+
buildDryRunSummaryLines: (result) => plan.getDryRunSummaryLines?.(result),
|
|
302214
302322
|
cwd: context.cwd,
|
|
302215
302323
|
dryRun: context.dryRun,
|
|
302216
302324
|
emitOutput: context.emitOutput,
|
|
@@ -304330,4 +304438,4 @@ export {
|
|
|
304330
304438
|
cli
|
|
304331
304439
|
};
|
|
304332
304440
|
|
|
304333
|
-
//# debugId=
|
|
304441
|
+
//# debugId=C8CAA6A09EF0F81764756E2164756E21
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
// package.json
|
|
15
15
|
var package_default = {
|
|
16
16
|
name: "wp-typia",
|
|
17
|
-
version: "0.24.
|
|
17
|
+
version: "0.24.4",
|
|
18
18
|
description: "Canonical CLI package for wp-typia scaffolding and project workflows",
|
|
19
19
|
packageManager: "bun@1.3.11",
|
|
20
20
|
type: "module",
|
|
@@ -84,7 +84,7 @@ var package_default = {
|
|
|
84
84
|
"@bunli/tui": "0.6.0",
|
|
85
85
|
"@bunli/utils": "0.6.0",
|
|
86
86
|
"@wp-typia/api-client": "^0.4.5",
|
|
87
|
-
"@wp-typia/project-tools": "0.24.
|
|
87
|
+
"@wp-typia/project-tools": "0.24.4",
|
|
88
88
|
"better-result": "^2.7.0",
|
|
89
89
|
react: "^19.2.5",
|
|
90
90
|
"react-dom": "^19.2.5",
|
|
@@ -755,7 +755,11 @@ function resolveCommandOptionValues(metadata, options) {
|
|
|
755
755
|
continue;
|
|
756
756
|
}
|
|
757
757
|
if (descriptor.repeatable && Array.isArray(value)) {
|
|
758
|
-
|
|
758
|
+
if (!value.every((item) => typeof item === "string")) {
|
|
759
|
+
resolved[name] = undefined;
|
|
760
|
+
continue;
|
|
761
|
+
}
|
|
762
|
+
resolved[name] = options.preserveArrays ? [...value] : value.join(",");
|
|
759
763
|
continue;
|
|
760
764
|
}
|
|
761
765
|
resolved[name] = typeof value === "string" ? value : undefined;
|
|
@@ -1228,4 +1232,4 @@ function createPlugin(input) {
|
|
|
1228
1232
|
}
|
|
1229
1233
|
export { createPlugin, package_default, collectPositionalIndexes, findFirstPositionalIndex, ADD_OPTION_METADATA, CREATE_OPTION_METADATA, DOCTOR_OPTION_METADATA, GLOBAL_OPTION_METADATA, INIT_OPTION_METADATA, MCP_OPTION_METADATA, MIGRATE_OPTION_METADATA, SYNC_OPTION_METADATA, TEMPLATES_OPTION_METADATA, COMMAND_OPTION_METADATA_BY_GROUP, ALL_COMMAND_OPTION_METADATA, buildCommandOptions, collectOptionNamesByType, buildCommandOptionParser, COMMAND_ROUTING_METADATA, createMissingOptionValueError, extractKnownOptionValuesFromArgv, resolveCommandOptionValues, normalizeCliOutputFormatArgv, validateCliOutputFormatArgv, prefersStructuredCliOutput, emitCliDiagnosticFailure, writeStructuredCliDiagnosticError, formatAddKindList, formatAddKindUsagePlaceholder, WP_TYPIA_CANONICAL_CREATE_USAGE, WP_TYPIA_RESERVED_TOP_LEVEL_COMMAND_NAMES, WP_TYPIA_TOP_LEVEL_COMMAND_NAMES, WP_TYPIA_COMMAND_OPTION_GROUP_NAMES_BY_TOP_LEVEL_COMMAND, WP_TYPIA_CONFIG_SOURCES, mergeWpTypiaUserConfig, loadWpTypiaUserConfigFromSource, loadWpTypiaUserConfig, getCreateDefaults, getAddBlockDefaults, getMcpSchemaSources };
|
|
1230
1234
|
|
|
1231
|
-
//# debugId=
|
|
1235
|
+
//# debugId=213462D0D4B1919364756E2164756E21
|
|
@@ -6124,13 +6124,23 @@ registerBlockBindingsSource( {
|
|
|
6124
6124
|
|
|
6125
6125
|
// ../wp-typia-project-tools/src/runtime/block-targets.ts
|
|
6126
6126
|
var FULL_BLOCK_NAME_PATTERN = /^[a-z0-9-]+\/[a-z0-9-]+$/u;
|
|
6127
|
-
function
|
|
6127
|
+
function resolveFullBlockNameDiagnostics(diagnostics) {
|
|
6128
|
+
if (typeof diagnostics !== "string") {
|
|
6129
|
+
return diagnostics;
|
|
6130
|
+
}
|
|
6131
|
+
return {
|
|
6132
|
+
empty: () => `\`${diagnostics}\` requires a block name.`,
|
|
6133
|
+
invalidFormat: () => `\`${diagnostics}\` must use <namespace/block-slug> format.`
|
|
6134
|
+
};
|
|
6135
|
+
}
|
|
6136
|
+
function assertFullBlockName(blockName, diagnostics) {
|
|
6137
|
+
const messages = resolveFullBlockNameDiagnostics(diagnostics);
|
|
6128
6138
|
const trimmed = blockName.trim();
|
|
6129
6139
|
if (!trimmed) {
|
|
6130
|
-
throw new Error(
|
|
6140
|
+
throw new Error(messages.empty());
|
|
6131
6141
|
}
|
|
6132
6142
|
if (!FULL_BLOCK_NAME_PATTERN.test(trimmed)) {
|
|
6133
|
-
throw new Error(
|
|
6143
|
+
throw new Error(messages.invalidFormat());
|
|
6134
6144
|
}
|
|
6135
6145
|
return trimmed;
|
|
6136
6146
|
}
|
|
@@ -8230,10 +8240,11 @@ async function writeCoreVariationRegistry(projectDir, targetBlockName, textDomai
|
|
|
8230
8240
|
async function runAddCoreVariationCommand({
|
|
8231
8241
|
cwd = process.cwd(),
|
|
8232
8242
|
targetBlockName,
|
|
8243
|
+
targetBlockNameDiagnostics = "core-variation target",
|
|
8233
8244
|
variationName
|
|
8234
8245
|
}) {
|
|
8235
8246
|
const workspace = resolveWorkspaceProject(cwd);
|
|
8236
|
-
const resolvedTargetBlockName = assertFullBlockName(targetBlockName,
|
|
8247
|
+
const resolvedTargetBlockName = assertFullBlockName(targetBlockName, targetBlockNameDiagnostics);
|
|
8237
8248
|
const variationSlug = assertValidGeneratedSlug("Core variation name", normalizeBlockSlug(variationName), CORE_VARIATION_USAGE);
|
|
8238
8249
|
const unknownCoreTargetWarning = getUnknownCoreVariationTargetWarning(resolvedTargetBlockName);
|
|
8239
8250
|
assertCoreVariationSlugIsNotRegistryIndex(variationSlug);
|
|
@@ -10657,4 +10668,4 @@ export {
|
|
|
10657
10668
|
ADD_BLOCK_TEMPLATE_IDS
|
|
10658
10669
|
};
|
|
10659
10670
|
|
|
10660
|
-
//# debugId=
|
|
10671
|
+
//# debugId=8D1F1CF635D9D28D64756E2164756E21
|
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,
|
|
@@ -593,6 +593,10 @@ var contractAddKindEntry = defineAddKindRegistryEntry({
|
|
|
593
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>.";
|
|
594
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>.";
|
|
595
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
|
+
};
|
|
596
600
|
function formatCoreVariationMissingPositionalNameMessage(blockName) {
|
|
597
601
|
return [
|
|
598
602
|
`\`wp-typia add core-variation ${blockName}\` is missing <name>.`,
|
|
@@ -610,6 +614,7 @@ function resolveCoreVariationInputs(context) {
|
|
|
610
614
|
}
|
|
611
615
|
return {
|
|
612
616
|
targetBlockName: positionalTargetBlockName,
|
|
617
|
+
targetBlockNameDiagnostics: CORE_VARIATION_POSITIONAL_TARGET_DIAGNOSTICS,
|
|
613
618
|
variationName: positionalVariationName
|
|
614
619
|
};
|
|
615
620
|
}
|
|
@@ -624,6 +629,7 @@ function resolveCoreVariationInputs(context) {
|
|
|
624
629
|
}
|
|
625
630
|
return {
|
|
626
631
|
targetBlockName: targetBlockFlag,
|
|
632
|
+
targetBlockNameDiagnostics: "--block",
|
|
627
633
|
variationName
|
|
628
634
|
};
|
|
629
635
|
}
|
|
@@ -643,11 +649,12 @@ var coreVariationAddKindEntry = defineAddKindRegistryEntry({
|
|
|
643
649
|
description: "Add an editor-side variation for an existing core or external block",
|
|
644
650
|
nameLabel: "Variation name",
|
|
645
651
|
async prepareExecution(context) {
|
|
646
|
-
const { targetBlockName, variationName } = resolveCoreVariationInputs(context);
|
|
652
|
+
const { targetBlockName, targetBlockNameDiagnostics, variationName } = resolveCoreVariationInputs(context);
|
|
647
653
|
return createNamedExecutionPlan(context, {
|
|
648
654
|
execute: ({ cwd, name }) => context.addRuntime.runAddCoreVariationCommand({
|
|
649
655
|
cwd,
|
|
650
656
|
targetBlockName,
|
|
657
|
+
targetBlockNameDiagnostics,
|
|
651
658
|
variationName: name
|
|
652
659
|
}),
|
|
653
660
|
getValues: (result) => ({
|
|
@@ -826,11 +833,15 @@ var patternAddKindEntry = defineAddKindRegistryEntry({
|
|
|
826
833
|
nameLabel: "Pattern name",
|
|
827
834
|
async prepareExecution(context) {
|
|
828
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;
|
|
829
840
|
const scope = resolvePatternScopeFlag(context);
|
|
830
841
|
const sectionRole = resolvePatternSectionRoleFlag(context, scope);
|
|
831
|
-
const catalogTitle =
|
|
842
|
+
const catalogTitle = rawCatalogTitle;
|
|
832
843
|
const tags = normalizePatternTagFlags(context.flags.tags, context.flags.tag);
|
|
833
|
-
const thumbnailUrl =
|
|
844
|
+
const thumbnailUrl = rawThumbnailUrl;
|
|
834
845
|
return {
|
|
835
846
|
execute: (cwd) => context.addRuntime.runAddPatternCommand({
|
|
836
847
|
catalogTitle,
|
|
@@ -841,6 +852,13 @@ var patternAddKindEntry = defineAddKindRegistryEntry({
|
|
|
841
852
|
tags,
|
|
842
853
|
thumbnailUrl
|
|
843
854
|
}),
|
|
855
|
+
getDryRunSummaryLines: (result) => buildPatternCatalogDryRunSummaryLines(result, {
|
|
856
|
+
rawCatalogTitle,
|
|
857
|
+
rawScope,
|
|
858
|
+
rawSectionRole,
|
|
859
|
+
rawTags: tags,
|
|
860
|
+
rawThumbnailUrl
|
|
861
|
+
}),
|
|
844
862
|
getValues: (result) => ({
|
|
845
863
|
contentFile: result.contentFile,
|
|
846
864
|
patternSlug: result.patternSlug,
|
|
@@ -904,6 +922,75 @@ function normalizePatternTagFlags(tagsFlag, tagFlag) {
|
|
|
904
922
|
];
|
|
905
923
|
return tags.length > 0 ? tags : undefined;
|
|
906
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
|
+
}
|
|
907
994
|
|
|
908
995
|
// src/add-kinds/post-meta.ts
|
|
909
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>].";
|
|
@@ -1733,12 +1820,16 @@ function buildAddCompletionPayload(options, markerOptions) {
|
|
|
1733
1820
|
}
|
|
1734
1821
|
function buildAddDryRunPayload(options, markerOptions) {
|
|
1735
1822
|
const normalizedTitle = stripLeadingOutputMarker(options.completion.title, "success").replace(/^Added\s*/u, "");
|
|
1823
|
+
const summaryLines = [
|
|
1824
|
+
...options.completion.summaryLines ?? [],
|
|
1825
|
+
...options.summaryLines ?? []
|
|
1826
|
+
];
|
|
1736
1827
|
return {
|
|
1737
1828
|
optionalLines: options.fileOperations,
|
|
1738
1829
|
optionalNote: "No workspace files were changed because --dry-run was enabled. Re-run without --dry-run to apply this add command.",
|
|
1739
1830
|
optionalTitle: `Planned workspace updates (${options.fileOperations.length}):`,
|
|
1740
1831
|
preambleLines: options.completion.preambleLines,
|
|
1741
|
-
summaryLines:
|
|
1832
|
+
summaryLines: summaryLines.length > 0 ? summaryLines : undefined,
|
|
1742
1833
|
title: formatOutputMarker("dryRun", `Dry run for ${normalizedTitle || "workspace add command"}`, markerOptions),
|
|
1743
1834
|
warningLines: options.completion.warningLines
|
|
1744
1835
|
};
|
|
@@ -1858,7 +1949,7 @@ function pushFlag(argv, name, value) {
|
|
|
1858
1949
|
}
|
|
1859
1950
|
|
|
1860
1951
|
// src/runtime-bridge-add.ts
|
|
1861
|
-
var loadCliAddRuntime = () => import("./cli-add-
|
|
1952
|
+
var loadCliAddRuntime = () => import("./cli-add-qjd3ba8j.js");
|
|
1862
1953
|
var loadCliPromptRuntime = () => import("./cli-prompt-ncyg68rn.js");
|
|
1863
1954
|
async function executeWorkspaceAddWithOptionalDryRun(options) {
|
|
1864
1955
|
const simulated = options.dryRun ? await simulateWorkspaceAddDryRun({
|
|
@@ -1876,7 +1967,8 @@ async function executeWorkspaceAddWithOptionalDryRun(options) {
|
|
|
1876
1967
|
}
|
|
1877
1968
|
return emitCompletion(buildAddDryRunPayload({
|
|
1878
1969
|
completion,
|
|
1879
|
-
fileOperations: simulated.fileOperations
|
|
1970
|
+
fileOperations: simulated.fileOperations,
|
|
1971
|
+
summaryLines: options.buildDryRunSummaryLines?.(result)
|
|
1880
1972
|
}), {
|
|
1881
1973
|
emitOutput: options.emitOutput ?? true,
|
|
1882
1974
|
printLine: options.printLine,
|
|
@@ -1891,6 +1983,7 @@ function executePreparedAddKind(kind, context, plan) {
|
|
|
1891
1983
|
values: plan.getValues(result),
|
|
1892
1984
|
warnings: plan.getWarnings?.(result)
|
|
1893
1985
|
}),
|
|
1986
|
+
buildDryRunSummaryLines: (result) => plan.getDryRunSummaryLines?.(result),
|
|
1894
1987
|
cwd: context.cwd,
|
|
1895
1988
|
dryRun: context.dryRun,
|
|
1896
1989
|
emitOutput: context.emitOutput,
|
|
@@ -3917,4 +4010,4 @@ export {
|
|
|
3917
4010
|
wpTypiaCommands
|
|
3918
4011
|
};
|
|
3919
4012
|
|
|
3920
|
-
//# debugId=
|
|
4013
|
+
//# debugId=3C2BF11DC520694164756E2164756E21
|
package/dist-bunli/node-cli.js
CHANGED
|
@@ -620,7 +620,11 @@ function resolveCommandOptionValues(metadata, options) {
|
|
|
620
620
|
continue;
|
|
621
621
|
}
|
|
622
622
|
if (descriptor.repeatable && Array.isArray(value)) {
|
|
623
|
-
|
|
623
|
+
if (!value.every((item) => typeof item === "string")) {
|
|
624
|
+
resolved[name] = undefined;
|
|
625
|
+
continue;
|
|
626
|
+
}
|
|
627
|
+
resolved[name] = options.preserveArrays ? [...value] : value.join(",");
|
|
624
628
|
continue;
|
|
625
629
|
}
|
|
626
630
|
resolved[name] = typeof value === "string" ? value : undefined;
|
|
@@ -1470,6 +1474,10 @@ import {
|
|
|
1470
1474
|
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>.";
|
|
1471
1475
|
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>.";
|
|
1472
1476
|
var CORE_VARIATION_BLOCK_NAME_PATTERN = /^[^/\s]+\/[^/\s]+$/u;
|
|
1477
|
+
var CORE_VARIATION_POSITIONAL_TARGET_DIAGNOSTICS = {
|
|
1478
|
+
empty: () => "The first positional argument (target block name) requires a block name.",
|
|
1479
|
+
invalidFormat: () => "The first positional argument (target block name) must use <namespace/block-slug> format."
|
|
1480
|
+
};
|
|
1473
1481
|
function formatCoreVariationMissingPositionalNameMessage(blockName) {
|
|
1474
1482
|
return [
|
|
1475
1483
|
`\`wp-typia add core-variation ${blockName}\` is missing <name>.`,
|
|
@@ -1487,6 +1495,7 @@ function resolveCoreVariationInputs(context) {
|
|
|
1487
1495
|
}
|
|
1488
1496
|
return {
|
|
1489
1497
|
targetBlockName: positionalTargetBlockName,
|
|
1498
|
+
targetBlockNameDiagnostics: CORE_VARIATION_POSITIONAL_TARGET_DIAGNOSTICS,
|
|
1490
1499
|
variationName: positionalVariationName
|
|
1491
1500
|
};
|
|
1492
1501
|
}
|
|
@@ -1501,6 +1510,7 @@ function resolveCoreVariationInputs(context) {
|
|
|
1501
1510
|
}
|
|
1502
1511
|
return {
|
|
1503
1512
|
targetBlockName: targetBlockFlag,
|
|
1513
|
+
targetBlockNameDiagnostics: "--block",
|
|
1504
1514
|
variationName
|
|
1505
1515
|
};
|
|
1506
1516
|
}
|
|
@@ -1520,11 +1530,12 @@ var coreVariationAddKindEntry = defineAddKindRegistryEntry({
|
|
|
1520
1530
|
description: "Add an editor-side variation for an existing core or external block",
|
|
1521
1531
|
nameLabel: "Variation name",
|
|
1522
1532
|
async prepareExecution(context) {
|
|
1523
|
-
const { targetBlockName, variationName } = resolveCoreVariationInputs(context);
|
|
1533
|
+
const { targetBlockName, targetBlockNameDiagnostics, variationName } = resolveCoreVariationInputs(context);
|
|
1524
1534
|
return createNamedExecutionPlan(context, {
|
|
1525
1535
|
execute: ({ cwd, name }) => context.addRuntime.runAddCoreVariationCommand({
|
|
1526
1536
|
cwd,
|
|
1527
1537
|
targetBlockName,
|
|
1538
|
+
targetBlockNameDiagnostics,
|
|
1528
1539
|
variationName: name
|
|
1529
1540
|
}),
|
|
1530
1541
|
getValues: (result) => ({
|
|
@@ -1707,11 +1718,15 @@ var patternAddKindEntry = defineAddKindRegistryEntry({
|
|
|
1707
1718
|
nameLabel: "Pattern name",
|
|
1708
1719
|
async prepareExecution(context) {
|
|
1709
1720
|
const name = requireAddKindName(context, PATTERN_MISSING_NAME_MESSAGE);
|
|
1721
|
+
const rawScope = typeof context.flags.scope === "string" ? context.flags.scope : undefined;
|
|
1722
|
+
const rawSectionRole = typeof context.flags["section-role"] === "string" ? context.flags["section-role"] : undefined;
|
|
1723
|
+
const rawCatalogTitle = typeof context.flags["catalog-title"] === "string" ? context.flags["catalog-title"] : undefined;
|
|
1724
|
+
const rawThumbnailUrl = typeof context.flags["thumbnail-url"] === "string" ? context.flags["thumbnail-url"] : undefined;
|
|
1710
1725
|
const scope = resolvePatternScopeFlag(context);
|
|
1711
1726
|
const sectionRole = resolvePatternSectionRoleFlag(context, scope);
|
|
1712
|
-
const catalogTitle =
|
|
1727
|
+
const catalogTitle = rawCatalogTitle;
|
|
1713
1728
|
const tags = normalizePatternTagFlags(context.flags.tags, context.flags.tag);
|
|
1714
|
-
const thumbnailUrl =
|
|
1729
|
+
const thumbnailUrl = rawThumbnailUrl;
|
|
1715
1730
|
return {
|
|
1716
1731
|
execute: (cwd) => context.addRuntime.runAddPatternCommand({
|
|
1717
1732
|
catalogTitle,
|
|
@@ -1722,6 +1737,13 @@ var patternAddKindEntry = defineAddKindRegistryEntry({
|
|
|
1722
1737
|
tags,
|
|
1723
1738
|
thumbnailUrl
|
|
1724
1739
|
}),
|
|
1740
|
+
getDryRunSummaryLines: (result) => buildPatternCatalogDryRunSummaryLines(result, {
|
|
1741
|
+
rawCatalogTitle,
|
|
1742
|
+
rawScope,
|
|
1743
|
+
rawSectionRole,
|
|
1744
|
+
rawTags: tags,
|
|
1745
|
+
rawThumbnailUrl
|
|
1746
|
+
}),
|
|
1725
1747
|
getValues: (result) => ({
|
|
1726
1748
|
contentFile: result.contentFile,
|
|
1727
1749
|
patternSlug: result.patternSlug,
|
|
@@ -1785,6 +1807,75 @@ function normalizePatternTagFlags(tagsFlag, tagFlag) {
|
|
|
1785
1807
|
];
|
|
1786
1808
|
return tags.length > 0 ? tags : undefined;
|
|
1787
1809
|
}
|
|
1810
|
+
function quoteValue(value) {
|
|
1811
|
+
return `"${value}"`;
|
|
1812
|
+
}
|
|
1813
|
+
function formatTags(tags) {
|
|
1814
|
+
return tags.length > 0 ? tags.join(", ") : "no tags";
|
|
1815
|
+
}
|
|
1816
|
+
function collectPatternTagTokens(tags) {
|
|
1817
|
+
return (tags ?? []).flatMap((tag) => tag.split(",")).map((tag) => tag.trim()).filter((tag) => tag.length > 0);
|
|
1818
|
+
}
|
|
1819
|
+
function valuesMatch(left, right) {
|
|
1820
|
+
return left.length === right.length && left.every((value, index) => value === right[index]);
|
|
1821
|
+
}
|
|
1822
|
+
function createNormalizationNote(options) {
|
|
1823
|
+
const rawValue = options.rawValue;
|
|
1824
|
+
if (rawValue === undefined || rawValue.trim().length === 0 || !options.resolvedValue || rawValue === options.resolvedValue) {
|
|
1825
|
+
return;
|
|
1826
|
+
}
|
|
1827
|
+
return `${options.fieldLabel} normalized from ${quoteValue(rawValue)} to ${quoteValue(options.resolvedValue)}.`;
|
|
1828
|
+
}
|
|
1829
|
+
function collectPatternCatalogNormalizationNotes(result, options) {
|
|
1830
|
+
const notes = [
|
|
1831
|
+
createNormalizationNote({
|
|
1832
|
+
fieldLabel: "Scope",
|
|
1833
|
+
rawValue: options.rawScope,
|
|
1834
|
+
resolvedValue: result.patternScope
|
|
1835
|
+
}),
|
|
1836
|
+
createNormalizationNote({
|
|
1837
|
+
fieldLabel: "Section role",
|
|
1838
|
+
rawValue: options.rawSectionRole,
|
|
1839
|
+
resolvedValue: result.sectionRole
|
|
1840
|
+
}),
|
|
1841
|
+
createNormalizationNote({
|
|
1842
|
+
fieldLabel: "Title",
|
|
1843
|
+
rawValue: options.rawCatalogTitle,
|
|
1844
|
+
resolvedValue: result.title
|
|
1845
|
+
}),
|
|
1846
|
+
createNormalizationNote({
|
|
1847
|
+
fieldLabel: "Thumbnail URL",
|
|
1848
|
+
rawValue: options.rawThumbnailUrl,
|
|
1849
|
+
resolvedValue: result.thumbnailUrl
|
|
1850
|
+
})
|
|
1851
|
+
].filter((note) => typeof note === "string");
|
|
1852
|
+
const rawTags = collectPatternTagTokens(options.rawTags);
|
|
1853
|
+
if (rawTags.length > 0 && !valuesMatch(rawTags, result.tags)) {
|
|
1854
|
+
notes.push(`Tags normalized from ${quoteValue(formatTags(rawTags))} to ${quoteValue(formatTags(result.tags))}.`);
|
|
1855
|
+
}
|
|
1856
|
+
return notes;
|
|
1857
|
+
}
|
|
1858
|
+
function buildPatternCatalogDryRunSummaryLines(result, options) {
|
|
1859
|
+
const catalogLines = [
|
|
1860
|
+
"",
|
|
1861
|
+
"Catalog metadata:",
|
|
1862
|
+
` Scope: ${result.patternScope}`,
|
|
1863
|
+
...result.sectionRole ? [` Section role: ${result.sectionRole}`] : [],
|
|
1864
|
+
` Title: ${result.title}`,
|
|
1865
|
+
...result.tags.length > 0 ? [` Tags: ${formatTags(result.tags)}`] : [],
|
|
1866
|
+
...result.thumbnailUrl ? [` Thumbnail URL: ${result.thumbnailUrl}`] : []
|
|
1867
|
+
];
|
|
1868
|
+
const normalizationNotes = collectPatternCatalogNormalizationNotes(result, options);
|
|
1869
|
+
if (normalizationNotes.length === 0) {
|
|
1870
|
+
return catalogLines;
|
|
1871
|
+
}
|
|
1872
|
+
return [
|
|
1873
|
+
...catalogLines,
|
|
1874
|
+
"",
|
|
1875
|
+
"Normalization notes:",
|
|
1876
|
+
...normalizationNotes.map((note) => ` ${note}`)
|
|
1877
|
+
];
|
|
1878
|
+
}
|
|
1788
1879
|
|
|
1789
1880
|
// src/add-kinds/post-meta.ts
|
|
1790
1881
|
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>].";
|
|
@@ -2539,7 +2630,7 @@ function buildStructuredInitSuccessPayload(plan) {
|
|
|
2539
2630
|
// package.json
|
|
2540
2631
|
var package_default = {
|
|
2541
2632
|
name: "wp-typia",
|
|
2542
|
-
version: "0.24.
|
|
2633
|
+
version: "0.24.4",
|
|
2543
2634
|
description: "Canonical CLI package for wp-typia scaffolding and project workflows",
|
|
2544
2635
|
packageManager: "bun@1.3.11",
|
|
2545
2636
|
type: "module",
|
|
@@ -2609,7 +2700,7 @@ var package_default = {
|
|
|
2609
2700
|
"@bunli/tui": "0.6.0",
|
|
2610
2701
|
"@bunli/utils": "0.6.0",
|
|
2611
2702
|
"@wp-typia/api-client": "^0.4.5",
|
|
2612
|
-
"@wp-typia/project-tools": "0.24.
|
|
2703
|
+
"@wp-typia/project-tools": "0.24.4",
|
|
2613
2704
|
"better-result": "^2.7.0",
|
|
2614
2705
|
react: "^19.2.5",
|
|
2615
2706
|
"react-dom": "^19.2.5",
|
|
@@ -2730,12 +2821,16 @@ function buildAddCompletionPayload(options, markerOptions) {
|
|
|
2730
2821
|
}
|
|
2731
2822
|
function buildAddDryRunPayload(options, markerOptions) {
|
|
2732
2823
|
const normalizedTitle = stripLeadingOutputMarker(options.completion.title, "success").replace(/^Added\s*/u, "");
|
|
2824
|
+
const summaryLines = [
|
|
2825
|
+
...options.completion.summaryLines ?? [],
|
|
2826
|
+
...options.summaryLines ?? []
|
|
2827
|
+
];
|
|
2733
2828
|
return {
|
|
2734
2829
|
optionalLines: options.fileOperations,
|
|
2735
2830
|
optionalNote: "No workspace files were changed because --dry-run was enabled. Re-run without --dry-run to apply this add command.",
|
|
2736
2831
|
optionalTitle: `Planned workspace updates (${options.fileOperations.length}):`,
|
|
2737
2832
|
preambleLines: options.completion.preambleLines,
|
|
2738
|
-
summaryLines:
|
|
2833
|
+
summaryLines: summaryLines.length > 0 ? summaryLines : undefined,
|
|
2739
2834
|
title: formatOutputMarker("dryRun", `Dry run for ${normalizedTitle || "workspace add command"}`, markerOptions),
|
|
2740
2835
|
warningLines: options.completion.warningLines
|
|
2741
2836
|
};
|
|
@@ -2869,7 +2964,8 @@ async function executeWorkspaceAddWithOptionalDryRun(options) {
|
|
|
2869
2964
|
}
|
|
2870
2965
|
return emitCompletion(buildAddDryRunPayload({
|
|
2871
2966
|
completion,
|
|
2872
|
-
fileOperations: simulated.fileOperations
|
|
2967
|
+
fileOperations: simulated.fileOperations,
|
|
2968
|
+
summaryLines: options.buildDryRunSummaryLines?.(result)
|
|
2873
2969
|
}), {
|
|
2874
2970
|
emitOutput: options.emitOutput ?? true,
|
|
2875
2971
|
printLine: options.printLine,
|
|
@@ -2884,6 +2980,7 @@ function executePreparedAddKind(kind, context, plan) {
|
|
|
2884
2980
|
values: plan.getValues(result),
|
|
2885
2981
|
warnings: plan.getWarnings?.(result)
|
|
2886
2982
|
}),
|
|
2983
|
+
buildDryRunSummaryLines: (result) => plan.getDryRunSummaryLines?.(result),
|
|
2887
2984
|
cwd: context.cwd,
|
|
2888
2985
|
dryRun: context.dryRun,
|
|
2889
2986
|
emitOutput: context.emitOutput,
|
|
@@ -4362,4 +4459,4 @@ export {
|
|
|
4362
4459
|
hasFlagBeforeTerminator
|
|
4363
4460
|
};
|
|
4364
4461
|
|
|
4365
|
-
//# debugId=
|
|
4462
|
+
//# debugId=89953F05ED6BD87364756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wp-typia",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.4",
|
|
4
4
|
"description": "Canonical CLI package for wp-typia scaffolding and project workflows",
|
|
5
5
|
"packageManager": "bun@1.3.11",
|
|
6
6
|
"type": "module",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@bunli/tui": "0.6.0",
|
|
71
71
|
"@bunli/utils": "0.6.0",
|
|
72
72
|
"@wp-typia/api-client": "^0.4.5",
|
|
73
|
-
"@wp-typia/project-tools": "0.24.
|
|
73
|
+
"@wp-typia/project-tools": "0.24.4",
|
|
74
74
|
"better-result": "^2.7.0",
|
|
75
75
|
"react": "^19.2.5",
|
|
76
76
|
"react-dom": "^19.2.5",
|