wp-typia 0.24.0 → 0.24.2
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/bin/routing-metadata.generated.js +2 -0
- package/dist-bunli/.bunli/commands.gen.js +311 -129
- package/dist-bunli/{cli-74y6z3yx.js → cli-4eqznv15.js} +11 -7
- package/dist-bunli/{cli-cwjdzq6n.js → cli-6mr6vja7.js} +75 -16
- package/dist-bunli/{cli-0v407aag.js → cli-6ys6d16y.js} +1 -1
- package/dist-bunli/{cli-add-nmdraf20.js → cli-add-r4c15g7g.js} +127 -40
- package/dist-bunli/{cli-doctor-pcss6ecx.js → cli-doctor-fd6mfx0f.js} +2 -2
- package/dist-bunli/{cli-init-he7vm7kc.js → cli-init-kmredfj7.js} +2 -2
- package/dist-bunli/{cli-v0nnagb3.js → cli-kbqztfkt.js} +221 -216
- package/dist-bunli/{cli-scaffold-an2k0fnm.js → cli-scaffold-b49zc1rw.js} +5 -5
- package/dist-bunli/{cli-sw06c521.js → cli-vxd8eyax.js} +1 -1
- package/dist-bunli/{cli-y0a8nztv.js → cli-wfvf3tv1.js} +9 -7
- package/dist-bunli/cli.js +2 -2
- package/dist-bunli/{command-list-xaw5agks.js → command-list-rqt03qqy.js} +90 -25
- package/dist-bunli/{migrations-z7f4kxba.js → migrations-zhd03hvy.js} +2 -2
- package/dist-bunli/node-cli.js +208 -143
- package/package.json +2 -2
|
@@ -14,11 +14,11 @@ import {
|
|
|
14
14
|
isOmittableBuiltInTemplateLayerDir,
|
|
15
15
|
resolveBuiltInTemplateSource,
|
|
16
16
|
resolveBuiltInTemplateSourceFromLayerDirs
|
|
17
|
-
} from "./cli-
|
|
17
|
+
} from "./cli-vxd8eyax.js";
|
|
18
18
|
import {
|
|
19
19
|
DEFAULT_WORDPRESS_ENV_VERSION,
|
|
20
20
|
getPackageVersions
|
|
21
|
-
} from "./cli-
|
|
21
|
+
} from "./cli-wfvf3tv1.js";
|
|
22
22
|
import {
|
|
23
23
|
BUILTIN_BLOCK_METADATA_VERSION,
|
|
24
24
|
COMPOUND_CHILD_BLOCK_METADATA_DEFAULTS,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
} from "./cli-8hxf9qw6.js";
|
|
37
37
|
import {
|
|
38
38
|
seedProjectMigrations
|
|
39
|
-
} from "./cli-
|
|
39
|
+
} from "./cli-6ys6d16y.js";
|
|
40
40
|
import {
|
|
41
41
|
ensureMigrationDirectories,
|
|
42
42
|
isPlainObject,
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
toTitleCase,
|
|
64
64
|
validateBlockSlug,
|
|
65
65
|
validateNamespace
|
|
66
|
-
} from "./cli-
|
|
66
|
+
} from "./cli-kbqztfkt.js";
|
|
67
67
|
import {
|
|
68
68
|
createManagedTempRoot
|
|
69
69
|
} from "./cli-t73q5aqz.js";
|
|
@@ -8079,7 +8079,9 @@ function sanitizeExternalTemplateCacheMetadata(metadata) {
|
|
|
8079
8079
|
function parseExternalTemplateCacheEntryMarker(markerText) {
|
|
8080
8080
|
let marker;
|
|
8081
8081
|
try {
|
|
8082
|
-
marker =
|
|
8082
|
+
marker = safeJsonParse(markerText, {
|
|
8083
|
+
context: "external template cache entry marker"
|
|
8084
|
+
});
|
|
8083
8085
|
} catch {
|
|
8084
8086
|
return null;
|
|
8085
8087
|
}
|
|
@@ -8113,7 +8115,9 @@ function isExternalTemplateCacheEntryFreshForTtl(createdAtMs, nowMs, ttlMs) {
|
|
|
8113
8115
|
function parseExternalTemplateCachePruneMarker(markerText) {
|
|
8114
8116
|
let marker;
|
|
8115
8117
|
try {
|
|
8116
|
-
marker =
|
|
8118
|
+
marker = safeJsonParse(markerText, {
|
|
8119
|
+
context: "external template cache prune marker"
|
|
8120
|
+
});
|
|
8117
8121
|
} catch {
|
|
8118
8122
|
return null;
|
|
8119
8123
|
}
|
|
@@ -14674,4 +14678,4 @@ async function resolveOptionalInteractiveExternalLayerId({
|
|
|
14674
14678
|
|
|
14675
14679
|
export { syncPersistenceRestArtifacts, copyInterpolatedDirectory, listInterpolatedDirectoryOutputs, getPrimaryDevelopmentScript, getOptionalOnboardingSteps, getOptionalOnboardingNote, getOptionalOnboardingShortNote, isCompoundPersistenceEnabled, formatNonEmptyTargetDirectoryError, executeWorkspaceMutationPlan, insertPhpSnippetBeforeWorkspaceAnchors, appendPhpSnippetBeforeClosingTag, runAddIntegrationEnvCommand, resolveExternalTemplateLayers, resolveTemplateSeed, normalizeOptionalCliString, resolveLocalCliPathOption, assertExternalLayerCompositionOptions, assertBuiltInTemplateVariantAllowed, parseAlternateRenderTargets, parseCompoundInnerBlocksPreset, OPTIONAL_WORDPRESS_AI_CLIENT_COMPATIBILITY, REQUIRED_WORKSPACE_ABILITY_COMPATIBILITY, resolveScaffoldCompatibilityPolicy, createScaffoldCompatibilityConfig, renderScaffoldCompatibilityConfig, updatePluginHeaderCompatibility, getDefaultAnswers, resolveTemplateId, resolvePackageManagerId, collectScaffoldAnswers, DATA_STORAGE_MODES, PERSISTENCE_POLICIES, isDataStorageMode, isPersistencePolicy, resolveCreateProfileId, scaffoldProject, resolveOptionalInteractiveExternalLayerId };
|
|
14676
14680
|
|
|
14677
|
-
//# debugId=
|
|
14681
|
+
//# debugId=F4E5CC39251E69C964756E2164756E21
|
|
@@ -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.2",
|
|
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.2",
|
|
88
88
|
"better-result": "^2.7.0",
|
|
89
89
|
react: "^19.2.5",
|
|
90
90
|
"react-dom": "^19.2.5",
|
|
@@ -173,6 +173,10 @@ var ADD_OPTION_METADATA = {
|
|
|
173
173
|
description: "Target block slug/name for variation, core-variation, style, and end-to-end binding-source workflows.",
|
|
174
174
|
type: "string"
|
|
175
175
|
},
|
|
176
|
+
"catalog-title": {
|
|
177
|
+
description: "Human-readable title for typed pattern catalog entries; defaults to the pattern slug title.",
|
|
178
|
+
type: "string"
|
|
179
|
+
},
|
|
176
180
|
"controller-class": {
|
|
177
181
|
description: "REST resource controller class used for generated route callbacks or declared manual/provider route ownership.",
|
|
178
182
|
type: "string"
|
|
@@ -282,11 +286,11 @@ var ADD_OPTION_METADATA = {
|
|
|
282
286
|
type: "string"
|
|
283
287
|
},
|
|
284
288
|
scope: {
|
|
285
|
-
description: "Pattern catalog scope for pattern workflows
|
|
289
|
+
description: "Pattern catalog scope for pattern workflows; one of full or section.",
|
|
286
290
|
type: "string"
|
|
287
291
|
},
|
|
288
292
|
"section-role": {
|
|
289
|
-
description: "Typed section role for section-scoped pattern catalog entries.",
|
|
293
|
+
description: "Typed section role for section-scoped pattern catalog entries; requires --scope section.",
|
|
290
294
|
type: "string"
|
|
291
295
|
},
|
|
292
296
|
"secret-field": {
|
|
@@ -330,7 +334,13 @@ var ADD_OPTION_METADATA = {
|
|
|
330
334
|
type: "string"
|
|
331
335
|
},
|
|
332
336
|
tags: {
|
|
333
|
-
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
|
+
repeatable: true,
|
|
339
|
+
type: "string"
|
|
340
|
+
},
|
|
341
|
+
tag: {
|
|
342
|
+
description: "Repeatable single tag for typed pattern catalog entries; use --tags for comma-separated lists.",
|
|
343
|
+
repeatable: true,
|
|
334
344
|
type: "string"
|
|
335
345
|
},
|
|
336
346
|
type: {
|
|
@@ -580,7 +590,8 @@ function buildCommandOptions(metadata) {
|
|
|
580
590
|
{
|
|
581
591
|
...option.argumentKind ? { argumentKind: option.argumentKind } : {},
|
|
582
592
|
description: option.description,
|
|
583
|
-
|
|
593
|
+
...option.repeatable ? { repeatable: true } : {},
|
|
594
|
+
schema: option.type === "boolean" ? exports_external.boolean().default(false) : option.repeatable ? exports_external.union([exports_external.string(), exports_external.array(exports_external.string())]).optional() : exports_external.string().optional(),
|
|
584
595
|
...option.short ? { short: option.short } : {}
|
|
585
596
|
}
|
|
586
597
|
]));
|
|
@@ -600,10 +611,19 @@ function buildCommandOptionParser(...metadataMaps) {
|
|
|
600
611
|
}
|
|
601
612
|
return {
|
|
602
613
|
booleanOptionNames: new Set(collectOptionNamesByType(metadata, "boolean")),
|
|
614
|
+
repeatableOptionNames: new Set(Object.entries(metadata).filter(([, option]) => option.repeatable).map(([name]) => name)),
|
|
603
615
|
shortFlagMap: new Map(Object.entries(metadata).flatMap(([name, option]) => option.short ? [[option.short, { name, type: option.type }]] : [])),
|
|
604
616
|
stringOptionNames: new Set(collectOptionNamesByType(metadata, "string"))
|
|
605
617
|
};
|
|
606
618
|
}
|
|
619
|
+
function assignParsedOptionValue(flags, options) {
|
|
620
|
+
if (!options.parser.repeatableOptionNames.has(options.name)) {
|
|
621
|
+
flags[options.name] = options.value;
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
624
|
+
const current = flags[options.name];
|
|
625
|
+
flags[options.name] = Array.isArray(current) ? [...current, options.value] : current === undefined ? [options.value] : [current, options.value];
|
|
626
|
+
}
|
|
607
627
|
function buildArgvWalkerRoutingMetadata(...metadataMaps) {
|
|
608
628
|
const parser = buildCommandOptionParser(...metadataMaps);
|
|
609
629
|
return {
|
|
@@ -615,22 +635,32 @@ var COMMAND_ROUTING_METADATA = buildArgvWalkerRoutingMetadata(ALL_COMMAND_OPTION
|
|
|
615
635
|
function createMissingOptionValueError(optionLabel) {
|
|
616
636
|
return createCliDiagnosticCodeError(CLI_DIAGNOSTIC_CODES.MISSING_ARGUMENT, `\`${optionLabel}\` requires a value.`);
|
|
617
637
|
}
|
|
618
|
-
function
|
|
638
|
+
function createUnknownOptionError(optionLabel) {
|
|
639
|
+
return createCliDiagnosticCodeError(CLI_DIAGNOSTIC_CODES.INVALID_ARGUMENT, `Unknown option \`${optionLabel}\`.`);
|
|
640
|
+
}
|
|
641
|
+
function walkArgvOptions(argv, options) {
|
|
619
642
|
const flags = {};
|
|
620
643
|
const nextArgv = [];
|
|
621
|
-
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
|
+
}
|
|
622
649
|
for (let index = 0;index < argv.length; index += 1) {
|
|
623
650
|
const arg = argv[index];
|
|
624
651
|
if (!arg) {
|
|
625
652
|
continue;
|
|
626
653
|
}
|
|
627
654
|
if (arg === "--") {
|
|
628
|
-
nextArgv.push(...argv.slice(index));
|
|
655
|
+
nextArgv.push(...argv.slice(index + (options.strict ? 1 : 0)));
|
|
629
656
|
break;
|
|
630
657
|
}
|
|
631
658
|
if (arg.length === 2 && arg.startsWith("-")) {
|
|
632
659
|
const shortFlag = options.parser.shortFlagMap.get(arg.slice(1));
|
|
633
|
-
if (!shortFlag || !optionNames.has(shortFlag.name)) {
|
|
660
|
+
if (!shortFlag || !options.strict && !optionNames.has(shortFlag.name)) {
|
|
661
|
+
if (options.strict) {
|
|
662
|
+
throw createUnknownOptionError(arg);
|
|
663
|
+
}
|
|
634
664
|
nextArgv.push(arg);
|
|
635
665
|
continue;
|
|
636
666
|
}
|
|
@@ -642,7 +672,11 @@ function extractKnownOptionValuesFromArgv(argv, options) {
|
|
|
642
672
|
if (!next || next.startsWith("-")) {
|
|
643
673
|
throw createMissingOptionValueError(arg);
|
|
644
674
|
}
|
|
645
|
-
flags
|
|
675
|
+
assignParsedOptionValue(flags, {
|
|
676
|
+
name: shortFlag.name,
|
|
677
|
+
parser: options.parser,
|
|
678
|
+
value: next
|
|
679
|
+
});
|
|
646
680
|
index += 1;
|
|
647
681
|
continue;
|
|
648
682
|
}
|
|
@@ -651,15 +685,18 @@ function extractKnownOptionValuesFromArgv(argv, options) {
|
|
|
651
685
|
const separatorIndex = option.indexOf("=");
|
|
652
686
|
const rawName = separatorIndex === -1 ? option : option.slice(0, separatorIndex);
|
|
653
687
|
const inlineValue = separatorIndex === -1 ? undefined : option.slice(separatorIndex + 1);
|
|
654
|
-
if (!optionNames.has(rawName)) {
|
|
688
|
+
if (!options.strict && !optionNames.has(rawName)) {
|
|
655
689
|
nextArgv.push(arg);
|
|
656
690
|
continue;
|
|
657
691
|
}
|
|
658
|
-
if (
|
|
692
|
+
if (booleanOptionNames.has(rawName)) {
|
|
659
693
|
flags[rawName] = true;
|
|
660
694
|
continue;
|
|
661
695
|
}
|
|
662
696
|
if (!options.parser.stringOptionNames.has(rawName)) {
|
|
697
|
+
if (options.strict) {
|
|
698
|
+
throw createUnknownOptionError(`--${rawName}`);
|
|
699
|
+
}
|
|
663
700
|
nextArgv.push(arg);
|
|
664
701
|
continue;
|
|
665
702
|
}
|
|
@@ -667,17 +704,28 @@ function extractKnownOptionValuesFromArgv(argv, options) {
|
|
|
667
704
|
if (!inlineValue) {
|
|
668
705
|
throw createMissingOptionValueError(`--${rawName}`);
|
|
669
706
|
}
|
|
670
|
-
flags
|
|
707
|
+
assignParsedOptionValue(flags, {
|
|
708
|
+
name: rawName,
|
|
709
|
+
parser: options.parser,
|
|
710
|
+
value: inlineValue
|
|
711
|
+
});
|
|
671
712
|
continue;
|
|
672
713
|
}
|
|
673
714
|
const next = argv[index + 1];
|
|
674
715
|
if (!next || next.startsWith("-")) {
|
|
675
716
|
throw createMissingOptionValueError(`--${rawName}`);
|
|
676
717
|
}
|
|
677
|
-
flags
|
|
718
|
+
assignParsedOptionValue(flags, {
|
|
719
|
+
name: rawName,
|
|
720
|
+
parser: options.parser,
|
|
721
|
+
value: next
|
|
722
|
+
});
|
|
678
723
|
index += 1;
|
|
679
724
|
continue;
|
|
680
725
|
}
|
|
726
|
+
if (arg.startsWith("-") && options.strict) {
|
|
727
|
+
throw createUnknownOptionError(arg);
|
|
728
|
+
}
|
|
681
729
|
nextArgv.push(arg);
|
|
682
730
|
}
|
|
683
731
|
return {
|
|
@@ -685,6 +733,13 @@ function extractKnownOptionValuesFromArgv(argv, options) {
|
|
|
685
733
|
flags
|
|
686
734
|
};
|
|
687
735
|
}
|
|
736
|
+
function extractKnownOptionValuesFromArgv(argv, options) {
|
|
737
|
+
return walkArgvOptions(argv, {
|
|
738
|
+
optionNames: options.optionNames,
|
|
739
|
+
parser: options.parser,
|
|
740
|
+
strict: false
|
|
741
|
+
});
|
|
742
|
+
}
|
|
688
743
|
function resolveCommandOptionValues(metadata, options) {
|
|
689
744
|
const resolved = {};
|
|
690
745
|
const optionNames = options.optionNames ?? Object.keys(metadata);
|
|
@@ -699,6 +754,10 @@ function resolveCommandOptionValues(metadata, options) {
|
|
|
699
754
|
resolved[name] = Boolean(value ?? false);
|
|
700
755
|
continue;
|
|
701
756
|
}
|
|
757
|
+
if (descriptor.repeatable && Array.isArray(value)) {
|
|
758
|
+
resolved[name] = value.every((item) => typeof item === "string") ? value.join(",") : undefined;
|
|
759
|
+
continue;
|
|
760
|
+
}
|
|
702
761
|
resolved[name] = typeof value === "string" ? value : undefined;
|
|
703
762
|
}
|
|
704
763
|
return resolved;
|
|
@@ -1169,4 +1228,4 @@ function createPlugin(input) {
|
|
|
1169
1228
|
}
|
|
1170
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 };
|
|
1171
1230
|
|
|
1172
|
-
//# debugId=
|
|
1231
|
+
//# debugId=6550DDC468E315F664756E2164756E21
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
scaffoldProject,
|
|
25
25
|
syncPersistenceRestArtifacts,
|
|
26
26
|
updatePluginHeaderCompatibility
|
|
27
|
-
} from "./cli-
|
|
27
|
+
} from "./cli-4eqznv15.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-vxd8eyax.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-wfvf3tv1.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-6ys6d16y.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-kbqztfkt.js";
|
|
148
150
|
import"./cli-cvxvcw7c.js";
|
|
149
151
|
import {
|
|
150
152
|
createManagedTempRoot
|
|
@@ -4289,11 +4291,6 @@ main().catch( ( error ) => {
|
|
|
4289
4291
|
}
|
|
4290
4292
|
|
|
4291
4293
|
// ../wp-typia-project-tools/src/runtime/cli-add-workspace-ai-source-emitters.ts
|
|
4292
|
-
function indentMultiline2(source, prefix) {
|
|
4293
|
-
return source.split(`
|
|
4294
|
-
`).map((line) => `${prefix}${line}`).join(`
|
|
4295
|
-
`);
|
|
4296
|
-
}
|
|
4297
4294
|
function buildAiFeatureConfigEntry(aiFeatureSlug, namespace) {
|
|
4298
4295
|
const pascalCase = toPascalCase(aiFeatureSlug);
|
|
4299
4296
|
const title = toTitleCase(aiFeatureSlug);
|
|
@@ -4315,7 +4312,7 @@ function buildAiFeatureConfigEntry(aiFeatureSlug, namespace) {
|
|
|
4315
4312
|
` openApiFile: ${quoteTsString(`src/ai-features/${aiFeatureSlug}/api.openapi.json`)},`,
|
|
4316
4313
|
` phpFile: ${quoteTsString(`inc/ai-features/${aiFeatureSlug}.php`)},`,
|
|
4317
4314
|
"\t\trestManifest: defineEndpointManifest(",
|
|
4318
|
-
|
|
4315
|
+
indentMultiline(JSON.stringify(manifest, null, "\t"), "\t\t\t"),
|
|
4319
4316
|
"\t\t),",
|
|
4320
4317
|
` slug: ${quoteTsString(aiFeatureSlug)},`,
|
|
4321
4318
|
` typesFile: ${quoteTsString(`src/ai-features/${aiFeatureSlug}/api-types.ts`)},`,
|
|
@@ -4449,26 +4446,7 @@ import {
|
|
|
4449
4446
|
run${pascalCase}AiFeatureEndpoint,
|
|
4450
4447
|
} from './api-client';
|
|
4451
4448
|
|
|
4452
|
-
|
|
4453
|
-
if ( typeof fallback === 'string' && fallback.length > 0 ) {
|
|
4454
|
-
return fallback;
|
|
4455
|
-
}
|
|
4456
|
-
|
|
4457
|
-
if ( typeof window === 'undefined' ) {
|
|
4458
|
-
return undefined;
|
|
4459
|
-
}
|
|
4460
|
-
|
|
4461
|
-
const wpApiSettings = (
|
|
4462
|
-
window as typeof window & {
|
|
4463
|
-
wpApiSettings?: { nonce?: string };
|
|
4464
|
-
}
|
|
4465
|
-
).wpApiSettings;
|
|
4466
|
-
|
|
4467
|
-
return typeof wpApiSettings?.nonce === 'string' &&
|
|
4468
|
-
wpApiSettings.nonce.length > 0
|
|
4469
|
-
? wpApiSettings.nonce
|
|
4470
|
-
: undefined;
|
|
4471
|
-
}
|
|
4449
|
+
${formatResolveRestNonceSource("spaced")}
|
|
4472
4450
|
|
|
4473
4451
|
function isPlainObject( value: unknown ): value is Record< string, unknown > {
|
|
4474
4452
|
return (
|
|
@@ -6925,7 +6903,6 @@ function ${patternRegistrationFunctionName}() {
|
|
|
6925
6903
|
// ../wp-typia-project-tools/src/runtime/cli-add-workspace-pattern-options.ts
|
|
6926
6904
|
import path19 from "path";
|
|
6927
6905
|
var PATTERN_CONTENT_FILE_ROOT = "src/patterns/";
|
|
6928
|
-
var PATTERN_TAG_PATTERN = /^[a-z0-9][a-z0-9-]*$/u;
|
|
6929
6906
|
function assertValidPatternRelativePath(label, value, usage) {
|
|
6930
6907
|
const normalizedPath = value.trim().replace(/\\/gu, "/");
|
|
6931
6908
|
if (normalizedPath.length === 0 || path19.isAbsolute(normalizedPath) || normalizedPath.split("/").includes("..") || /[<>:"|?*\u0000-\u001F]/u.test(normalizedPath)) {
|
|
@@ -6958,14 +6935,18 @@ function resolvePatternScope(scope) {
|
|
|
6958
6935
|
}
|
|
6959
6936
|
throw new Error(`Pattern scope must be one of: ${PATTERN_CATALOG_SCOPE_IDS.join(", ")}.`);
|
|
6960
6937
|
}
|
|
6961
|
-
function
|
|
6938
|
+
function normalizePatternSectionRole(value) {
|
|
6962
6939
|
if (value === undefined || value.trim() === "") {
|
|
6963
6940
|
return;
|
|
6964
6941
|
}
|
|
6965
|
-
|
|
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;
|
|
6966
6947
|
}
|
|
6967
6948
|
function normalizePatternTags(tags) {
|
|
6968
|
-
const rawTags = typeof tags === "string" ? tags.split(",") : Array.isArray(tags) ?
|
|
6949
|
+
const rawTags = typeof tags === "string" ? tags.split(",") : Array.isArray(tags) ? tags.flatMap((tag) => tag.split(",")) : [];
|
|
6969
6950
|
const normalizedTags = rawTags.map((tag) => normalizeBlockSlug(tag)).filter((tag) => tag.length > 0);
|
|
6970
6951
|
for (const tag of normalizedTags) {
|
|
6971
6952
|
if (!PATTERN_TAG_PATTERN.test(tag)) {
|
|
@@ -6993,12 +6974,12 @@ function resolvePatternContentFile(patternSlug, patternScope, contentFile) {
|
|
|
6993
6974
|
}
|
|
6994
6975
|
function resolvePatternCatalogOptions(patternSlug, options) {
|
|
6995
6976
|
const patternScope = resolvePatternScope(options.patternScope);
|
|
6996
|
-
const sectionRole =
|
|
6977
|
+
const sectionRole = normalizePatternSectionRole(options.sectionRole);
|
|
6997
6978
|
if (patternScope === "section" && !sectionRole) {
|
|
6998
|
-
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.");
|
|
6999
6980
|
}
|
|
7000
6981
|
if (patternScope !== "section" && sectionRole) {
|
|
7001
|
-
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.");
|
|
7002
6983
|
}
|
|
7003
6984
|
const title = options.catalogTitle && options.catalogTitle.trim() !== "" ? options.catalogTitle.trim() : toTitleCase(patternSlug);
|
|
7004
6985
|
const thumbnailUrl = normalizePatternThumbnailUrl(options.thumbnailUrl);
|
|
@@ -7903,6 +7884,101 @@ import fs2, { promises as fsp17 } from "fs";
|
|
|
7903
7884
|
import path27 from "path";
|
|
7904
7885
|
var CORE_VARIATIONS_EDITOR_PLUGIN_SLUG = "core-variations";
|
|
7905
7886
|
var CORE_VARIATION_USAGE = "wp-typia add core-variation <block-name> <name> or wp-typia add core-variation <name> --block <namespace/block>";
|
|
7887
|
+
var KNOWN_CORE_VARIATION_TARGETS = new Set([
|
|
7888
|
+
"core/archives",
|
|
7889
|
+
"core/audio",
|
|
7890
|
+
"core/avatar",
|
|
7891
|
+
"core/block",
|
|
7892
|
+
"core/button",
|
|
7893
|
+
"core/buttons",
|
|
7894
|
+
"core/calendar",
|
|
7895
|
+
"core/categories",
|
|
7896
|
+
"core/code",
|
|
7897
|
+
"core/column",
|
|
7898
|
+
"core/columns",
|
|
7899
|
+
"core/comment-author-name",
|
|
7900
|
+
"core/comment-content",
|
|
7901
|
+
"core/comment-date",
|
|
7902
|
+
"core/comment-edit-link",
|
|
7903
|
+
"core/comment-reply-link",
|
|
7904
|
+
"core/comment-template",
|
|
7905
|
+
"core/comments",
|
|
7906
|
+
"core/comments-pagination",
|
|
7907
|
+
"core/comments-pagination-next",
|
|
7908
|
+
"core/comments-pagination-numbers",
|
|
7909
|
+
"core/comments-pagination-previous",
|
|
7910
|
+
"core/comments-title",
|
|
7911
|
+
"core/cover",
|
|
7912
|
+
"core/details",
|
|
7913
|
+
"core/embed",
|
|
7914
|
+
"core/file",
|
|
7915
|
+
"core/footnotes",
|
|
7916
|
+
"core/freeform",
|
|
7917
|
+
"core/gallery",
|
|
7918
|
+
"core/group",
|
|
7919
|
+
"core/heading",
|
|
7920
|
+
"core/home-link",
|
|
7921
|
+
"core/html",
|
|
7922
|
+
"core/image",
|
|
7923
|
+
"core/latest-comments",
|
|
7924
|
+
"core/latest-posts",
|
|
7925
|
+
"core/legacy-widget",
|
|
7926
|
+
"core/list",
|
|
7927
|
+
"core/list-item",
|
|
7928
|
+
"core/loginout",
|
|
7929
|
+
"core/media-text",
|
|
7930
|
+
"core/missing",
|
|
7931
|
+
"core/more",
|
|
7932
|
+
"core/navigation",
|
|
7933
|
+
"core/navigation-link",
|
|
7934
|
+
"core/navigation-submenu",
|
|
7935
|
+
"core/nextpage",
|
|
7936
|
+
"core/page-list",
|
|
7937
|
+
"core/paragraph",
|
|
7938
|
+
"core/pattern",
|
|
7939
|
+
"core/post-author",
|
|
7940
|
+
"core/post-author-biography",
|
|
7941
|
+
"core/post-author-name",
|
|
7942
|
+
"core/post-comments",
|
|
7943
|
+
"core/post-comments-form",
|
|
7944
|
+
"core/post-content",
|
|
7945
|
+
"core/post-date",
|
|
7946
|
+
"core/post-excerpt",
|
|
7947
|
+
"core/post-featured-image",
|
|
7948
|
+
"core/post-navigation-link",
|
|
7949
|
+
"core/post-terms",
|
|
7950
|
+
"core/post-template",
|
|
7951
|
+
"core/post-title",
|
|
7952
|
+
"core/preformatted",
|
|
7953
|
+
"core/pullquote",
|
|
7954
|
+
"core/query",
|
|
7955
|
+
"core/query-no-results",
|
|
7956
|
+
"core/query-pagination",
|
|
7957
|
+
"core/query-pagination-next",
|
|
7958
|
+
"core/query-pagination-numbers",
|
|
7959
|
+
"core/query-pagination-previous",
|
|
7960
|
+
"core/query-title",
|
|
7961
|
+
"core/quote",
|
|
7962
|
+
"core/read-more",
|
|
7963
|
+
"core/rss",
|
|
7964
|
+
"core/search",
|
|
7965
|
+
"core/separator",
|
|
7966
|
+
"core/shortcode",
|
|
7967
|
+
"core/site-logo",
|
|
7968
|
+
"core/site-tagline",
|
|
7969
|
+
"core/site-title",
|
|
7970
|
+
"core/social-link",
|
|
7971
|
+
"core/social-links",
|
|
7972
|
+
"core/spacer",
|
|
7973
|
+
"core/table",
|
|
7974
|
+
"core/table-of-contents",
|
|
7975
|
+
"core/tag-cloud",
|
|
7976
|
+
"core/template-part",
|
|
7977
|
+
"core/term-description",
|
|
7978
|
+
"core/text-columns",
|
|
7979
|
+
"core/verse",
|
|
7980
|
+
"core/video"
|
|
7981
|
+
]);
|
|
7906
7982
|
var CORE_VARIATION_SIMPLE_CONTAINER_BLOCKS = new Set([
|
|
7907
7983
|
"core/column",
|
|
7908
7984
|
"core/cover",
|
|
@@ -7946,6 +8022,12 @@ function buildCoreVariationImportPath(ref) {
|
|
|
7946
8022
|
function formatCoreVariationTitle(variationSlug) {
|
|
7947
8023
|
return toTitleCase(variationSlug);
|
|
7948
8024
|
}
|
|
8025
|
+
function getUnknownCoreVariationTargetWarning(targetBlockName) {
|
|
8026
|
+
if (!targetBlockName.startsWith("core/") || KNOWN_CORE_VARIATION_TARGETS.has(targetBlockName)) {
|
|
8027
|
+
return;
|
|
8028
|
+
}
|
|
8029
|
+
return `Target block "${targetBlockName}" uses the WordPress core namespace but is not in wp-typia's known core block list. The variation was generated for forward compatibility; verify the block name or update wp-typia if this is a newer core block.`;
|
|
8030
|
+
}
|
|
7949
8031
|
function assertCoreVariationDoesNotExist(projectDir, targetBlockName, variationSlug) {
|
|
7950
8032
|
const variationFilePath = getCoreVariationFilePath(projectDir, targetBlockName, variationSlug);
|
|
7951
8033
|
if (fs2.existsSync(variationFilePath)) {
|
|
@@ -8153,6 +8235,7 @@ async function runAddCoreVariationCommand({
|
|
|
8153
8235
|
const workspace = resolveWorkspaceProject(cwd);
|
|
8154
8236
|
const resolvedTargetBlockName = assertFullBlockName(targetBlockName, "core-variation target");
|
|
8155
8237
|
const variationSlug = assertValidGeneratedSlug("Core variation name", normalizeBlockSlug(variationName), CORE_VARIATION_USAGE);
|
|
8238
|
+
const unknownCoreTargetWarning = getUnknownCoreVariationTargetWarning(resolvedTargetBlockName);
|
|
8156
8239
|
assertCoreVariationSlugIsNotRegistryIndex(variationSlug);
|
|
8157
8240
|
assertCoreVariationDoesNotExist(workspace.projectDir, resolvedTargetBlockName, variationSlug);
|
|
8158
8241
|
const bootstrapPath = path27.join(workspace.projectDir, `${workspace.packageName.split("/").pop() ?? workspace.packageName}.php`);
|
|
@@ -8193,7 +8276,8 @@ async function runAddCoreVariationCommand({
|
|
|
8193
8276
|
projectDir: workspace.projectDir,
|
|
8194
8277
|
targetBlockName: resolvedTargetBlockName,
|
|
8195
8278
|
variationFile: path27.relative(workspace.projectDir, variationFilePath),
|
|
8196
|
-
variationSlug
|
|
8279
|
+
variationSlug,
|
|
8280
|
+
...unknownCoreTargetWarning ? { warnings: [unknownCoreTargetWarning] } : {}
|
|
8197
8281
|
};
|
|
8198
8282
|
} catch (error) {
|
|
8199
8283
|
await rollbackWorkspaceMutation(mutationSnapshot);
|
|
@@ -10560,14 +10644,17 @@ export {
|
|
|
10560
10644
|
runAddAiFeatureCommand,
|
|
10561
10645
|
runAddAdminViewCommand,
|
|
10562
10646
|
runAddAbilityCommand,
|
|
10647
|
+
normalizeBlockSlug,
|
|
10563
10648
|
isAddBlockTemplateId,
|
|
10564
10649
|
getWorkspaceBlockSelectOptionsAsync,
|
|
10565
10650
|
getWorkspaceBlockSelectOptions,
|
|
10566
10651
|
formatAddHelpText,
|
|
10652
|
+
PATTERN_TAG_PATTERN,
|
|
10653
|
+
PATTERN_SECTION_ROLE_PATTERN,
|
|
10567
10654
|
PATTERN_CATALOG_SCOPE_IDS,
|
|
10568
10655
|
EDITOR_PLUGIN_SLOT_IDS,
|
|
10569
10656
|
ADD_KIND_IDS,
|
|
10570
10657
|
ADD_BLOCK_TEMPLATE_IDS
|
|
10571
10658
|
};
|
|
10572
10659
|
|
|
10573
|
-
//# debugId=
|
|
10660
|
+
//# debugId=3EDD3B6180967F3A64756E2164756E21
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import {
|
|
12
12
|
getBuiltInTemplateLayerDirs,
|
|
13
13
|
isOmittableBuiltInTemplateLayerDir
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-vxd8eyax.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-kbqztfkt.js";
|
|
37
37
|
import"./cli-cvxvcw7c.js";
|
|
38
38
|
import"./cli-t73q5aqz.js";
|
|
39
39
|
import"./cli-bajwv85z.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
getPackageVersions
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-wfvf3tv1.js";
|
|
5
5
|
import"./cli-8hxf9qw6.js";
|
|
6
6
|
import {
|
|
7
7
|
discoverMigrationInitLayout
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
snapshotWorkspaceFiles,
|
|
14
14
|
toPascalCase,
|
|
15
15
|
updateWorkspaceInventorySource
|
|
16
|
-
} from "./cli-
|
|
16
|
+
} from "./cli-kbqztfkt.js";
|
|
17
17
|
import"./cli-cvxvcw7c.js";
|
|
18
18
|
import"./cli-bajwv85z.js";
|
|
19
19
|
import {
|