wp-typia 0.24.1 → 0.24.3
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 +346 -323
- package/dist-bunli/{cli-gaq29kzp.js → cli-377p86mf.js} +1 -1
- package/dist-bunli/{cli-1xt99e09.js → cli-4pzxbk4s.js} +36 -13
- package/dist-bunli/{cli-zjw3eqfj.js → cli-84c7wff4.js} +1 -1
- package/dist-bunli/{cli-add-mr731xtv.js → cli-add-mxxk5rep.js} +20 -12
- package/dist-bunli/{cli-doctor-kf9gwdhh.js → cli-doctor-6fyxq940.js} +2 -2
- package/dist-bunli/{cli-h2v72j8q.js → cli-fv4h3ydt.js} +188 -188
- package/dist-bunli/{cli-init-557vq109.js → cli-init-7avk42dh.js} +2 -2
- package/dist-bunli/{cli-4ah8dawy.js → cli-kfm9mm68.js} +3130 -3132
- package/dist-bunli/{cli-scaffold-bt1ttnkg.js → cli-scaffold-0bb6pr3w.js} +95 -133
- package/dist-bunli/{cli-fzhkqzc7.js → cli-tj7ajdvf.js} +1 -1
- package/dist-bunli/cli.js +2 -2
- package/dist-bunli/{command-list-bd2582k1.js → command-list-bgwaa2f4.js} +73 -33
- package/dist-bunli/{migrations-ky53fj2h.js → migrations-3vngdy51.js} +2 -2
- package/dist-bunli/node-cli.js +154 -161
- package/package.json +2 -2
|
@@ -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.3",
|
|
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.3",
|
|
88
88
|
"better-result": "^2.7.0",
|
|
89
89
|
react: "^19.2.5",
|
|
90
90
|
"react-dom": "^19.2.5",
|
|
@@ -286,11 +286,11 @@ var ADD_OPTION_METADATA = {
|
|
|
286
286
|
type: "string"
|
|
287
287
|
},
|
|
288
288
|
scope: {
|
|
289
|
-
description: "Pattern catalog scope for pattern workflows
|
|
289
|
+
description: "Pattern catalog scope for pattern workflows; one of full or section.",
|
|
290
290
|
type: "string"
|
|
291
291
|
},
|
|
292
292
|
"section-role": {
|
|
293
|
-
description: "Typed section role for section-scoped pattern catalog entries.",
|
|
293
|
+
description: "Typed section role for section-scoped pattern catalog entries; requires --scope section.",
|
|
294
294
|
type: "string"
|
|
295
295
|
},
|
|
296
296
|
"secret-field": {
|
|
@@ -334,12 +334,12 @@ var ADD_OPTION_METADATA = {
|
|
|
334
334
|
type: "string"
|
|
335
335
|
},
|
|
336
336
|
tags: {
|
|
337
|
-
description: "Comma-separated tags for typed pattern catalog entries;
|
|
337
|
+
description: "Comma-separated tags for typed pattern catalog entries; combine with repeatable --tag for single tags.",
|
|
338
338
|
repeatable: true,
|
|
339
339
|
type: "string"
|
|
340
340
|
},
|
|
341
341
|
tag: {
|
|
342
|
-
description: "Repeatable
|
|
342
|
+
description: "Repeatable single tag for typed pattern catalog entries; use --tags for comma-separated lists.",
|
|
343
343
|
repeatable: true,
|
|
344
344
|
type: "string"
|
|
345
345
|
},
|
|
@@ -635,22 +635,32 @@ var COMMAND_ROUTING_METADATA = buildArgvWalkerRoutingMetadata(ALL_COMMAND_OPTION
|
|
|
635
635
|
function createMissingOptionValueError(optionLabel) {
|
|
636
636
|
return createCliDiagnosticCodeError(CLI_DIAGNOSTIC_CODES.MISSING_ARGUMENT, `\`${optionLabel}\` requires a value.`);
|
|
637
637
|
}
|
|
638
|
-
function
|
|
638
|
+
function createUnknownOptionError(optionLabel) {
|
|
639
|
+
return createCliDiagnosticCodeError(CLI_DIAGNOSTIC_CODES.INVALID_ARGUMENT, `Unknown option \`${optionLabel}\`.`);
|
|
640
|
+
}
|
|
641
|
+
function walkArgvOptions(argv, options) {
|
|
639
642
|
const flags = {};
|
|
640
643
|
const nextArgv = [];
|
|
641
|
-
const
|
|
644
|
+
const booleanOptionNames = new Set(options.parser.booleanOptionNames);
|
|
645
|
+
const optionNames = new Set(options.optionNames ?? []);
|
|
646
|
+
for (const optionName of options.extraBooleanOptionNames ?? []) {
|
|
647
|
+
booleanOptionNames.add(optionName);
|
|
648
|
+
}
|
|
642
649
|
for (let index = 0;index < argv.length; index += 1) {
|
|
643
650
|
const arg = argv[index];
|
|
644
651
|
if (!arg) {
|
|
645
652
|
continue;
|
|
646
653
|
}
|
|
647
654
|
if (arg === "--") {
|
|
648
|
-
nextArgv.push(...argv.slice(index));
|
|
655
|
+
nextArgv.push(...argv.slice(index + (options.strict ? 1 : 0)));
|
|
649
656
|
break;
|
|
650
657
|
}
|
|
651
658
|
if (arg.length === 2 && arg.startsWith("-")) {
|
|
652
659
|
const shortFlag = options.parser.shortFlagMap.get(arg.slice(1));
|
|
653
|
-
if (!shortFlag || !optionNames.has(shortFlag.name)) {
|
|
660
|
+
if (!shortFlag || !options.strict && !optionNames.has(shortFlag.name)) {
|
|
661
|
+
if (options.strict) {
|
|
662
|
+
throw createUnknownOptionError(arg);
|
|
663
|
+
}
|
|
654
664
|
nextArgv.push(arg);
|
|
655
665
|
continue;
|
|
656
666
|
}
|
|
@@ -675,15 +685,18 @@ function extractKnownOptionValuesFromArgv(argv, options) {
|
|
|
675
685
|
const separatorIndex = option.indexOf("=");
|
|
676
686
|
const rawName = separatorIndex === -1 ? option : option.slice(0, separatorIndex);
|
|
677
687
|
const inlineValue = separatorIndex === -1 ? undefined : option.slice(separatorIndex + 1);
|
|
678
|
-
if (!optionNames.has(rawName)) {
|
|
688
|
+
if (!options.strict && !optionNames.has(rawName)) {
|
|
679
689
|
nextArgv.push(arg);
|
|
680
690
|
continue;
|
|
681
691
|
}
|
|
682
|
-
if (
|
|
692
|
+
if (booleanOptionNames.has(rawName)) {
|
|
683
693
|
flags[rawName] = true;
|
|
684
694
|
continue;
|
|
685
695
|
}
|
|
686
696
|
if (!options.parser.stringOptionNames.has(rawName)) {
|
|
697
|
+
if (options.strict) {
|
|
698
|
+
throw createUnknownOptionError(`--${rawName}`);
|
|
699
|
+
}
|
|
687
700
|
nextArgv.push(arg);
|
|
688
701
|
continue;
|
|
689
702
|
}
|
|
@@ -710,6 +723,9 @@ function extractKnownOptionValuesFromArgv(argv, options) {
|
|
|
710
723
|
index += 1;
|
|
711
724
|
continue;
|
|
712
725
|
}
|
|
726
|
+
if (arg.startsWith("-") && options.strict) {
|
|
727
|
+
throw createUnknownOptionError(arg);
|
|
728
|
+
}
|
|
713
729
|
nextArgv.push(arg);
|
|
714
730
|
}
|
|
715
731
|
return {
|
|
@@ -717,6 +733,13 @@ function extractKnownOptionValuesFromArgv(argv, options) {
|
|
|
717
733
|
flags
|
|
718
734
|
};
|
|
719
735
|
}
|
|
736
|
+
function extractKnownOptionValuesFromArgv(argv, options) {
|
|
737
|
+
return walkArgvOptions(argv, {
|
|
738
|
+
optionNames: options.optionNames,
|
|
739
|
+
parser: options.parser,
|
|
740
|
+
strict: false
|
|
741
|
+
});
|
|
742
|
+
}
|
|
720
743
|
function resolveCommandOptionValues(metadata, options) {
|
|
721
744
|
const resolved = {};
|
|
722
745
|
const optionNames = options.optionNames ?? Object.keys(metadata);
|
|
@@ -1205,4 +1228,4 @@ function createPlugin(input) {
|
|
|
1205
1228
|
}
|
|
1206
1229
|
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 };
|
|
1207
1230
|
|
|
1208
|
-
//# debugId=
|
|
1231
|
+
//# debugId=C92E20FC0E312E8D64756E2164756E21
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
scaffoldProject,
|
|
25
25
|
syncPersistenceRestArtifacts,
|
|
26
26
|
updatePluginHeaderCompatibility
|
|
27
|
-
} from "./cli-
|
|
27
|
+
} from "./cli-kfm9mm68.js";
|
|
28
28
|
import {
|
|
29
29
|
parseTemplateLocator,
|
|
30
30
|
require_semver
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
loadPostMetaBindingFields,
|
|
54
54
|
maskTypeScriptCommentsAndLiterals
|
|
55
55
|
} from "./cli-z48frc8t.js";
|
|
56
|
-
import"./cli-
|
|
56
|
+
import"./cli-377p86mf.js";
|
|
57
57
|
import {
|
|
58
58
|
DEFAULT_WORDPRESS_ABILITIES_VERSION,
|
|
59
59
|
DEFAULT_WORDPRESS_CORE_ABILITIES_VERSION,
|
|
@@ -63,13 +63,13 @@ import {
|
|
|
63
63
|
DEFAULT_WP_TYPIA_DATAVIEWS_VERSION,
|
|
64
64
|
getPackageVersions,
|
|
65
65
|
resolveManagedPackageVersionRange
|
|
66
|
-
} from "./cli-
|
|
66
|
+
} from "./cli-84c7wff4.js";
|
|
67
67
|
import {
|
|
68
68
|
SHARED_WORKSPACE_TEMPLATE_ROOT
|
|
69
69
|
} from "./cli-8hxf9qw6.js";
|
|
70
70
|
import {
|
|
71
71
|
snapshotProjectVersion
|
|
72
|
-
} from "./cli-
|
|
72
|
+
} from "./cli-tj7ajdvf.js";
|
|
73
73
|
import {
|
|
74
74
|
ensureMigrationDirectories,
|
|
75
75
|
parseMigrationConfig,
|
|
@@ -80,6 +80,8 @@ import {
|
|
|
80
80
|
ADD_BLOCK_TEMPLATE_IDS,
|
|
81
81
|
EDITOR_PLUGIN_SLOT_IDS,
|
|
82
82
|
PATTERN_CATALOG_SCOPE_IDS,
|
|
83
|
+
PATTERN_SECTION_ROLE_PATTERN,
|
|
84
|
+
PATTERN_TAG_PATTERN,
|
|
83
85
|
appendWorkspaceInventoryEntries,
|
|
84
86
|
assertAbilityDoesNotExist,
|
|
85
87
|
assertAdminViewDoesNotExist,
|
|
@@ -144,7 +146,7 @@ import {
|
|
|
144
146
|
toPascalCase,
|
|
145
147
|
toSnakeCase,
|
|
146
148
|
toTitleCase
|
|
147
|
-
} from "./cli-
|
|
149
|
+
} from "./cli-fv4h3ydt.js";
|
|
148
150
|
import"./cli-cvxvcw7c.js";
|
|
149
151
|
import {
|
|
150
152
|
createManagedTempRoot
|
|
@@ -6901,7 +6903,6 @@ function ${patternRegistrationFunctionName}() {
|
|
|
6901
6903
|
// ../wp-typia-project-tools/src/runtime/cli-add-workspace-pattern-options.ts
|
|
6902
6904
|
import path19 from "path";
|
|
6903
6905
|
var PATTERN_CONTENT_FILE_ROOT = "src/patterns/";
|
|
6904
|
-
var PATTERN_TAG_PATTERN = /^[a-z0-9][a-z0-9-]*$/u;
|
|
6905
6906
|
function assertValidPatternRelativePath(label, value, usage) {
|
|
6906
6907
|
const normalizedPath = value.trim().replace(/\\/gu, "/");
|
|
6907
6908
|
if (normalizedPath.length === 0 || path19.isAbsolute(normalizedPath) || normalizedPath.split("/").includes("..") || /[<>:"|?*\u0000-\u001F]/u.test(normalizedPath)) {
|
|
@@ -6934,11 +6935,15 @@ function resolvePatternScope(scope) {
|
|
|
6934
6935
|
}
|
|
6935
6936
|
throw new Error(`Pattern scope must be one of: ${PATTERN_CATALOG_SCOPE_IDS.join(", ")}.`);
|
|
6936
6937
|
}
|
|
6937
|
-
function
|
|
6938
|
+
function normalizePatternSectionRole(value) {
|
|
6938
6939
|
if (value === undefined || value.trim() === "") {
|
|
6939
6940
|
return;
|
|
6940
6941
|
}
|
|
6941
|
-
|
|
6942
|
+
const sectionRole = normalizeBlockSlug(value);
|
|
6943
|
+
if (!PATTERN_SECTION_ROLE_PATTERN.test(sectionRole)) {
|
|
6944
|
+
throw new Error("Pattern section role must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens. Section roles apply only with `--scope section`.");
|
|
6945
|
+
}
|
|
6946
|
+
return sectionRole;
|
|
6942
6947
|
}
|
|
6943
6948
|
function normalizePatternTags(tags) {
|
|
6944
6949
|
const rawTags = typeof tags === "string" ? tags.split(",") : Array.isArray(tags) ? tags.flatMap((tag) => tag.split(",")) : [];
|
|
@@ -6969,12 +6974,12 @@ function resolvePatternContentFile(patternSlug, patternScope, contentFile) {
|
|
|
6969
6974
|
}
|
|
6970
6975
|
function resolvePatternCatalogOptions(patternSlug, options) {
|
|
6971
6976
|
const patternScope = resolvePatternScope(options.patternScope);
|
|
6972
|
-
const sectionRole =
|
|
6977
|
+
const sectionRole = normalizePatternSectionRole(options.sectionRole);
|
|
6973
6978
|
if (patternScope === "section" && !sectionRole) {
|
|
6974
|
-
throw new Error("`wp-typia add pattern --scope section` requires --section-role <role
|
|
6979
|
+
throw new Error("`wp-typia add pattern --scope section` requires --section-role <role> because section-scoped patterns need a typed catalog section role.");
|
|
6975
6980
|
}
|
|
6976
6981
|
if (patternScope !== "section" && sectionRole) {
|
|
6977
|
-
throw new Error("`--section-role`
|
|
6982
|
+
throw new Error("`--section-role` only applies with `--scope section`. Use `--scope section --section-role <role>` or omit `--section-role` for full patterns.");
|
|
6978
6983
|
}
|
|
6979
6984
|
const title = options.catalogTitle && options.catalogTitle.trim() !== "" ? options.catalogTitle.trim() : toTitleCase(patternSlug);
|
|
6980
6985
|
const thumbnailUrl = normalizePatternThumbnailUrl(options.thumbnailUrl);
|
|
@@ -10639,14 +10644,17 @@ export {
|
|
|
10639
10644
|
runAddAiFeatureCommand,
|
|
10640
10645
|
runAddAdminViewCommand,
|
|
10641
10646
|
runAddAbilityCommand,
|
|
10647
|
+
normalizeBlockSlug,
|
|
10642
10648
|
isAddBlockTemplateId,
|
|
10643
10649
|
getWorkspaceBlockSelectOptionsAsync,
|
|
10644
10650
|
getWorkspaceBlockSelectOptions,
|
|
10645
10651
|
formatAddHelpText,
|
|
10652
|
+
PATTERN_TAG_PATTERN,
|
|
10653
|
+
PATTERN_SECTION_ROLE_PATTERN,
|
|
10646
10654
|
PATTERN_CATALOG_SCOPE_IDS,
|
|
10647
10655
|
EDITOR_PLUGIN_SLOT_IDS,
|
|
10648
10656
|
ADD_KIND_IDS,
|
|
10649
10657
|
ADD_BLOCK_TEMPLATE_IDS
|
|
10650
10658
|
};
|
|
10651
10659
|
|
|
10652
|
-
//# debugId=
|
|
10660
|
+
//# debugId=3EDD3B6180967F3A64756E2164756E21
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import {
|
|
12
12
|
getBuiltInTemplateLayerDirs,
|
|
13
13
|
isOmittableBuiltInTemplateLayerDir
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-377p86mf.js";
|
|
15
15
|
import {
|
|
16
16
|
isBuiltInTemplateId,
|
|
17
17
|
listTemplates
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
resolveEditorPluginSlotAlias,
|
|
34
34
|
resolvePatternCatalogContentFile,
|
|
35
35
|
validatePatternCatalog
|
|
36
|
-
} from "./cli-
|
|
36
|
+
} from "./cli-fv4h3ydt.js";
|
|
37
37
|
import"./cli-cvxvcw7c.js";
|
|
38
38
|
import"./cli-t73q5aqz.js";
|
|
39
39
|
import"./cli-bajwv85z.js";
|