wp-typia 0.24.1 → 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/dist-bunli/.bunli/commands.gen.js +87 -42
- package/dist-bunli/{cli-4ah8dawy.js → cli-4eqznv15.js} +4 -4
- package/dist-bunli/{cli-1xt99e09.js → cli-6mr6vja7.js} +36 -13
- package/dist-bunli/{cli-fzhkqzc7.js → cli-6ys6d16y.js} +1 -1
- package/dist-bunli/{cli-add-mr731xtv.js → cli-add-r4c15g7g.js} +20 -12
- package/dist-bunli/{cli-doctor-kf9gwdhh.js → cli-doctor-fd6mfx0f.js} +2 -2
- package/dist-bunli/{cli-init-557vq109.js → cli-init-kmredfj7.js} +2 -2
- package/dist-bunli/{cli-h2v72j8q.js → cli-kbqztfkt.js} +162 -164
- package/dist-bunli/{cli-scaffold-bt1ttnkg.js → cli-scaffold-b49zc1rw.js} +5 -5
- package/dist-bunli/{cli-gaq29kzp.js → cli-vxd8eyax.js} +1 -1
- package/dist-bunli/{cli-zjw3eqfj.js → cli-wfvf3tv1.js} +1 -1
- package/dist-bunli/cli.js +2 -2
- package/dist-bunli/{command-list-bd2582k1.js → command-list-rqt03qqy.js} +71 -33
- package/dist-bunli/{migrations-ky53fj2h.js → migrations-zhd03hvy.js} +2 -2
- package/dist-bunli/node-cli.js +152 -161
- package/package.json +2 -2
package/dist-bunli/node-cli.js
CHANGED
|
@@ -146,11 +146,11 @@ var ADD_OPTION_METADATA = {
|
|
|
146
146
|
type: "string"
|
|
147
147
|
},
|
|
148
148
|
scope: {
|
|
149
|
-
description: "Pattern catalog scope for pattern workflows
|
|
149
|
+
description: "Pattern catalog scope for pattern workflows; one of full or section.",
|
|
150
150
|
type: "string"
|
|
151
151
|
},
|
|
152
152
|
"section-role": {
|
|
153
|
-
description: "Typed section role for section-scoped pattern catalog entries.",
|
|
153
|
+
description: "Typed section role for section-scoped pattern catalog entries; requires --scope section.",
|
|
154
154
|
type: "string"
|
|
155
155
|
},
|
|
156
156
|
"secret-field": {
|
|
@@ -194,12 +194,12 @@ var ADD_OPTION_METADATA = {
|
|
|
194
194
|
type: "string"
|
|
195
195
|
},
|
|
196
196
|
tags: {
|
|
197
|
-
description: "Comma-separated tags for typed pattern catalog entries;
|
|
197
|
+
description: "Comma-separated tags for typed pattern catalog entries; combine with repeatable --tag for single tags.",
|
|
198
198
|
repeatable: true,
|
|
199
199
|
type: "string"
|
|
200
200
|
},
|
|
201
201
|
tag: {
|
|
202
|
-
description: "Repeatable
|
|
202
|
+
description: "Repeatable single tag for typed pattern catalog entries; use --tags for comma-separated lists.",
|
|
203
203
|
repeatable: true,
|
|
204
204
|
type: "string"
|
|
205
205
|
},
|
|
@@ -492,22 +492,29 @@ function createMissingOptionValueError(optionLabel) {
|
|
|
492
492
|
function createUnknownOptionError(optionLabel) {
|
|
493
493
|
return createCliDiagnosticCodeError(CLI_DIAGNOSTIC_CODES.INVALID_ARGUMENT, `Unknown option \`${optionLabel}\`.`);
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function walkArgvOptions(argv, options) {
|
|
496
496
|
const flags = {};
|
|
497
497
|
const nextArgv = [];
|
|
498
|
-
const
|
|
498
|
+
const booleanOptionNames = new Set(options.parser.booleanOptionNames);
|
|
499
|
+
const optionNames = new Set(options.optionNames ?? []);
|
|
500
|
+
for (const optionName of options.extraBooleanOptionNames ?? []) {
|
|
501
|
+
booleanOptionNames.add(optionName);
|
|
502
|
+
}
|
|
499
503
|
for (let index = 0;index < argv.length; index += 1) {
|
|
500
504
|
const arg = argv[index];
|
|
501
505
|
if (!arg) {
|
|
502
506
|
continue;
|
|
503
507
|
}
|
|
504
508
|
if (arg === "--") {
|
|
505
|
-
nextArgv.push(...argv.slice(index));
|
|
509
|
+
nextArgv.push(...argv.slice(index + (options.strict ? 1 : 0)));
|
|
506
510
|
break;
|
|
507
511
|
}
|
|
508
512
|
if (arg.length === 2 && arg.startsWith("-")) {
|
|
509
513
|
const shortFlag = options.parser.shortFlagMap.get(arg.slice(1));
|
|
510
|
-
if (!shortFlag || !optionNames.has(shortFlag.name)) {
|
|
514
|
+
if (!shortFlag || !options.strict && !optionNames.has(shortFlag.name)) {
|
|
515
|
+
if (options.strict) {
|
|
516
|
+
throw createUnknownOptionError(arg);
|
|
517
|
+
}
|
|
511
518
|
nextArgv.push(arg);
|
|
512
519
|
continue;
|
|
513
520
|
}
|
|
@@ -532,15 +539,18 @@ function extractKnownOptionValuesFromArgv(argv, options) {
|
|
|
532
539
|
const separatorIndex = option.indexOf("=");
|
|
533
540
|
const rawName = separatorIndex === -1 ? option : option.slice(0, separatorIndex);
|
|
534
541
|
const inlineValue = separatorIndex === -1 ? undefined : option.slice(separatorIndex + 1);
|
|
535
|
-
if (!optionNames.has(rawName)) {
|
|
542
|
+
if (!options.strict && !optionNames.has(rawName)) {
|
|
536
543
|
nextArgv.push(arg);
|
|
537
544
|
continue;
|
|
538
545
|
}
|
|
539
|
-
if (
|
|
546
|
+
if (booleanOptionNames.has(rawName)) {
|
|
540
547
|
flags[rawName] = true;
|
|
541
548
|
continue;
|
|
542
549
|
}
|
|
543
550
|
if (!options.parser.stringOptionNames.has(rawName)) {
|
|
551
|
+
if (options.strict) {
|
|
552
|
+
throw createUnknownOptionError(`--${rawName}`);
|
|
553
|
+
}
|
|
544
554
|
nextArgv.push(arg);
|
|
545
555
|
continue;
|
|
546
556
|
}
|
|
@@ -567,6 +577,9 @@ function extractKnownOptionValuesFromArgv(argv, options) {
|
|
|
567
577
|
index += 1;
|
|
568
578
|
continue;
|
|
569
579
|
}
|
|
580
|
+
if (arg.startsWith("-") && options.strict) {
|
|
581
|
+
throw createUnknownOptionError(arg);
|
|
582
|
+
}
|
|
570
583
|
nextArgv.push(arg);
|
|
571
584
|
}
|
|
572
585
|
return {
|
|
@@ -574,83 +587,19 @@ function extractKnownOptionValuesFromArgv(argv, options) {
|
|
|
574
587
|
flags
|
|
575
588
|
};
|
|
576
589
|
}
|
|
590
|
+
function extractKnownOptionValuesFromArgv(argv, options) {
|
|
591
|
+
return walkArgvOptions(argv, {
|
|
592
|
+
optionNames: options.optionNames,
|
|
593
|
+
parser: options.parser,
|
|
594
|
+
strict: false
|
|
595
|
+
});
|
|
596
|
+
}
|
|
577
597
|
function parseCommandArgvWithMetadata(argv, options) {
|
|
578
|
-
const flags = {
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
}
|
|
584
|
-
for (let index = 0;index < argv.length; index += 1) {
|
|
585
|
-
const arg = argv[index];
|
|
586
|
-
if (!arg) {
|
|
587
|
-
continue;
|
|
588
|
-
}
|
|
589
|
-
if (arg === "--") {
|
|
590
|
-
positionals.push(...argv.slice(index + 1));
|
|
591
|
-
break;
|
|
592
|
-
}
|
|
593
|
-
if (arg.length === 2 && arg.startsWith("-")) {
|
|
594
|
-
const shortFlag = options.parser.shortFlagMap.get(arg.slice(1));
|
|
595
|
-
if (!shortFlag) {
|
|
596
|
-
throw createUnknownOptionError(arg);
|
|
597
|
-
}
|
|
598
|
-
if (shortFlag.type === "boolean") {
|
|
599
|
-
flags[shortFlag.name] = true;
|
|
600
|
-
continue;
|
|
601
|
-
}
|
|
602
|
-
const next = argv[index + 1];
|
|
603
|
-
if (!next || next.startsWith("-")) {
|
|
604
|
-
throw createMissingOptionValueError(arg);
|
|
605
|
-
}
|
|
606
|
-
assignParsedOptionValue(flags, {
|
|
607
|
-
name: shortFlag.name,
|
|
608
|
-
parser: options.parser,
|
|
609
|
-
value: next
|
|
610
|
-
});
|
|
611
|
-
index += 1;
|
|
612
|
-
continue;
|
|
613
|
-
}
|
|
614
|
-
if (arg.startsWith("--")) {
|
|
615
|
-
const option = arg.slice(2);
|
|
616
|
-
const separatorIndex = option.indexOf("=");
|
|
617
|
-
const rawName = separatorIndex === -1 ? option : option.slice(0, separatorIndex);
|
|
618
|
-
const inlineValue = separatorIndex === -1 ? undefined : option.slice(separatorIndex + 1);
|
|
619
|
-
if (booleanOptionNames.has(rawName)) {
|
|
620
|
-
flags[rawName] = true;
|
|
621
|
-
continue;
|
|
622
|
-
}
|
|
623
|
-
if (!options.parser.stringOptionNames.has(rawName)) {
|
|
624
|
-
throw createUnknownOptionError(`--${rawName}`);
|
|
625
|
-
}
|
|
626
|
-
if (inlineValue !== undefined) {
|
|
627
|
-
if (!inlineValue) {
|
|
628
|
-
throw createMissingOptionValueError(`--${rawName}`);
|
|
629
|
-
}
|
|
630
|
-
assignParsedOptionValue(flags, {
|
|
631
|
-
name: rawName,
|
|
632
|
-
parser: options.parser,
|
|
633
|
-
value: inlineValue
|
|
634
|
-
});
|
|
635
|
-
continue;
|
|
636
|
-
}
|
|
637
|
-
const next = argv[index + 1];
|
|
638
|
-
if (!next || next.startsWith("-")) {
|
|
639
|
-
throw createMissingOptionValueError(`--${rawName}`);
|
|
640
|
-
}
|
|
641
|
-
assignParsedOptionValue(flags, {
|
|
642
|
-
name: rawName,
|
|
643
|
-
parser: options.parser,
|
|
644
|
-
value: next
|
|
645
|
-
});
|
|
646
|
-
index += 1;
|
|
647
|
-
continue;
|
|
648
|
-
}
|
|
649
|
-
if (arg.startsWith("-")) {
|
|
650
|
-
throw createUnknownOptionError(arg);
|
|
651
|
-
}
|
|
652
|
-
positionals.push(arg);
|
|
653
|
-
}
|
|
598
|
+
const { argv: positionals, flags } = walkArgvOptions(argv, {
|
|
599
|
+
extraBooleanOptionNames: options.extraBooleanOptionNames,
|
|
600
|
+
parser: options.parser,
|
|
601
|
+
strict: true
|
|
602
|
+
});
|
|
654
603
|
return {
|
|
655
604
|
flags,
|
|
656
605
|
positionals
|
|
@@ -1003,8 +952,8 @@ function extractWpTypiaConfigOverride(argv) {
|
|
|
1003
952
|
|
|
1004
953
|
// src/runtime-bridge-add.ts
|
|
1005
954
|
import {
|
|
1006
|
-
CLI_DIAGNOSTIC_CODES as
|
|
1007
|
-
createCliDiagnosticCodeError as
|
|
955
|
+
CLI_DIAGNOSTIC_CODES as CLI_DIAGNOSTIC_CODES10,
|
|
956
|
+
createCliDiagnosticCodeError as createCliDiagnosticCodeError9
|
|
1008
957
|
} from "@wp-typia/project-tools/cli-diagnostics";
|
|
1009
958
|
|
|
1010
959
|
// src/add-kind-ids.ts
|
|
@@ -1035,6 +984,13 @@ var NAME_ONLY_VISIBLE_FIELDS = [
|
|
|
1035
984
|
"kind",
|
|
1036
985
|
"name"
|
|
1037
986
|
];
|
|
987
|
+
var PATTERN_CATALOG_VISIBLE_FIELDS = [
|
|
988
|
+
"kind",
|
|
989
|
+
"name",
|
|
990
|
+
"scope",
|
|
991
|
+
"section-role",
|
|
992
|
+
"catalog-title"
|
|
993
|
+
];
|
|
1038
994
|
var NAME_SOURCE_VISIBLE_FIELDS = [
|
|
1039
995
|
"kind",
|
|
1040
996
|
"name",
|
|
@@ -1511,6 +1467,15 @@ import {
|
|
|
1511
1467
|
} from "@wp-typia/project-tools/cli-diagnostics";
|
|
1512
1468
|
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>.";
|
|
1513
1469
|
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>.";
|
|
1470
|
+
var CORE_VARIATION_BLOCK_NAME_PATTERN = /^[^/\s]+\/[^/\s]+$/u;
|
|
1471
|
+
function formatCoreVariationMissingPositionalNameMessage(blockName) {
|
|
1472
|
+
return [
|
|
1473
|
+
`\`wp-typia add core-variation ${blockName}\` is missing <name>.`,
|
|
1474
|
+
"Usage: wp-typia add core-variation <block-name> <name>",
|
|
1475
|
+
"Alternative: wp-typia add core-variation <name> --block <namespace/block>"
|
|
1476
|
+
].join(`
|
|
1477
|
+
`);
|
|
1478
|
+
}
|
|
1514
1479
|
function resolveCoreVariationInputs(context) {
|
|
1515
1480
|
const positionalTargetBlockName = context.positionalArgs?.[1];
|
|
1516
1481
|
const positionalVariationName = context.positionalArgs?.[2];
|
|
@@ -1523,16 +1488,17 @@ function resolveCoreVariationInputs(context) {
|
|
|
1523
1488
|
variationName: positionalVariationName
|
|
1524
1489
|
};
|
|
1525
1490
|
}
|
|
1526
|
-
|
|
1527
|
-
|
|
1491
|
+
const targetBlockFlag = readOptionalStrictStringFlag(context.flags, "block");
|
|
1492
|
+
const missingPositionalNameTarget = context.name !== undefined && positionalTargetBlockName === context.name && CORE_VARIATION_BLOCK_NAME_PATTERN.test(context.name) ? context.name : undefined;
|
|
1493
|
+
if (missingPositionalNameTarget && !targetBlockFlag) {
|
|
1494
|
+
throw createCliDiagnosticCodeError5(CLI_DIAGNOSTIC_CODES6.MISSING_ARGUMENT, formatCoreVariationMissingPositionalNameMessage(missingPositionalNameTarget));
|
|
1528
1495
|
}
|
|
1529
1496
|
const variationName = requireAddKindName(context, CORE_VARIATION_MISSING_NAME_MESSAGE);
|
|
1530
|
-
|
|
1531
|
-
if (!targetBlockName) {
|
|
1497
|
+
if (!targetBlockFlag) {
|
|
1532
1498
|
throw createCliDiagnosticCodeError5(CLI_DIAGNOSTIC_CODES6.MISSING_ARGUMENT, CORE_VARIATION_MISSING_BLOCK_MESSAGE);
|
|
1533
1499
|
}
|
|
1534
1500
|
return {
|
|
1535
|
-
targetBlockName,
|
|
1501
|
+
targetBlockName: targetBlockFlag,
|
|
1536
1502
|
variationName
|
|
1537
1503
|
};
|
|
1538
1504
|
}
|
|
@@ -1711,10 +1677,15 @@ var integrationEnvAddKindEntry = defineAddKindRegistryEntry({
|
|
|
1711
1677
|
supportsDryRun: true,
|
|
1712
1678
|
usage: "wp-typia add integration-env <name> [--wp-env] [--release-zip] [--service <none|docker-compose>] [--dry-run]",
|
|
1713
1679
|
visibleFieldNames: () => NAME_ONLY_VISIBLE_FIELDS,
|
|
1714
|
-
hiddenBooleanSubmitFields: ["wp-env", "release-zip"]
|
|
1680
|
+
hiddenBooleanSubmitFields: ["wp-env", "release-zip"],
|
|
1681
|
+
hiddenStringSubmitFields: ["service"]
|
|
1715
1682
|
});
|
|
1716
1683
|
|
|
1717
1684
|
// src/add-kinds/pattern.ts
|
|
1685
|
+
import {
|
|
1686
|
+
CLI_DIAGNOSTIC_CODES as CLI_DIAGNOSTIC_CODES7,
|
|
1687
|
+
createCliDiagnosticCodeError as createCliDiagnosticCodeError6
|
|
1688
|
+
} from "@wp-typia/project-tools/cli-diagnostics";
|
|
1718
1689
|
var PATTERN_MISSING_NAME_MESSAGE = "`wp-typia add pattern` requires <name>. Usage: wp-typia add pattern <name>.";
|
|
1719
1690
|
var patternAddKindEntry = defineAddKindRegistryEntry({
|
|
1720
1691
|
completion: {
|
|
@@ -1730,19 +1701,12 @@ var patternAddKindEntry = defineAddKindRegistryEntry({
|
|
|
1730
1701
|
title: "Added workspace pattern"
|
|
1731
1702
|
},
|
|
1732
1703
|
description: "Add a PHP block pattern shell",
|
|
1733
|
-
hiddenStringSubmitFields: [
|
|
1734
|
-
"catalog-title",
|
|
1735
|
-
"scope",
|
|
1736
|
-
"section-role",
|
|
1737
|
-
"tag",
|
|
1738
|
-
"tags",
|
|
1739
|
-
"thumbnail-url"
|
|
1740
|
-
],
|
|
1704
|
+
hiddenStringSubmitFields: ["tag", "tags", "thumbnail-url"],
|
|
1741
1705
|
nameLabel: "Pattern name",
|
|
1742
1706
|
async prepareExecution(context) {
|
|
1743
1707
|
const name = requireAddKindName(context, PATTERN_MISSING_NAME_MESSAGE);
|
|
1744
|
-
const scope =
|
|
1745
|
-
const sectionRole =
|
|
1708
|
+
const scope = resolvePatternScopeFlag(context);
|
|
1709
|
+
const sectionRole = resolvePatternSectionRoleFlag(context, scope);
|
|
1746
1710
|
const catalogTitle = typeof context.flags["catalog-title"] === "string" ? context.flags["catalog-title"] : undefined;
|
|
1747
1711
|
const tags = normalizePatternTagFlags(context.flags.tags, context.flags.tag);
|
|
1748
1712
|
const thumbnailUrl = typeof context.flags["thumbnail-url"] === "string" ? context.flags["thumbnail-url"] : undefined;
|
|
@@ -1767,9 +1731,42 @@ var patternAddKindEntry = defineAddKindRegistryEntry({
|
|
|
1767
1731
|
},
|
|
1768
1732
|
sortOrder: 60,
|
|
1769
1733
|
supportsDryRun: true,
|
|
1770
|
-
usage: "wp-typia add pattern <name> [--scope <full|section>] [--section-role <role>] [--catalog-title <title>] [--tags <tag
|
|
1771
|
-
visibleFieldNames: () =>
|
|
1734
|
+
usage: "wp-typia add pattern <name> [--scope <full|section>] [--section-role <role>] [--catalog-title <title>] [--tags <tag,...>] [--tag <tag>...] [--thumbnail-url <url>] [--dry-run]",
|
|
1735
|
+
visibleFieldNames: () => PATTERN_CATALOG_VISIBLE_FIELDS
|
|
1772
1736
|
});
|
|
1737
|
+
function createInvalidPatternArgumentError(message) {
|
|
1738
|
+
return createCliDiagnosticCodeError6(CLI_DIAGNOSTIC_CODES7.INVALID_ARGUMENT, message);
|
|
1739
|
+
}
|
|
1740
|
+
function createMissingPatternArgumentError(message) {
|
|
1741
|
+
return createCliDiagnosticCodeError6(CLI_DIAGNOSTIC_CODES7.MISSING_ARGUMENT, message);
|
|
1742
|
+
}
|
|
1743
|
+
function resolvePatternScopeFlag(context) {
|
|
1744
|
+
const scope = readOptionalLooseStringFlag(context.flags, "scope");
|
|
1745
|
+
if (!scope) {
|
|
1746
|
+
return;
|
|
1747
|
+
}
|
|
1748
|
+
if (context.addRuntime.PATTERN_CATALOG_SCOPE_IDS.includes(scope)) {
|
|
1749
|
+
return scope;
|
|
1750
|
+
}
|
|
1751
|
+
throw createInvalidPatternArgumentError(`\`--scope\` must be one of: ${context.addRuntime.PATTERN_CATALOG_SCOPE_IDS.join(", ")}. Usage: wp-typia add pattern <name> --scope <full|section>.`);
|
|
1752
|
+
}
|
|
1753
|
+
function resolvePatternSectionRoleFlag(context, scope) {
|
|
1754
|
+
const sectionRole = readOptionalLooseStringFlag(context.flags, "section-role");
|
|
1755
|
+
if (scope === "section" && sectionRole === undefined) {
|
|
1756
|
+
throw createMissingPatternArgumentError("`wp-typia add pattern --scope section` requires --section-role <role> because section-scoped patterns need a typed catalog section role.");
|
|
1757
|
+
}
|
|
1758
|
+
if (scope !== "section" && sectionRole !== undefined) {
|
|
1759
|
+
throw createInvalidPatternArgumentError("`--section-role` only applies with `--scope section`. Use `--scope section --section-role <role>` or omit `--section-role` for full patterns.");
|
|
1760
|
+
}
|
|
1761
|
+
const normalizedSectionRole = sectionRole === undefined ? undefined : context.addRuntime.normalizeBlockSlug(sectionRole);
|
|
1762
|
+
if (normalizedSectionRole && !context.addRuntime.PATTERN_SECTION_ROLE_PATTERN.test(normalizedSectionRole)) {
|
|
1763
|
+
throw createInvalidPatternArgumentError("`--section-role` must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens. Section roles apply only with `--scope section`.");
|
|
1764
|
+
}
|
|
1765
|
+
if (sectionRole !== undefined && !normalizedSectionRole) {
|
|
1766
|
+
throw createInvalidPatternArgumentError("`--section-role` must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens. Section roles apply only with `--scope section`.");
|
|
1767
|
+
}
|
|
1768
|
+
return normalizedSectionRole;
|
|
1769
|
+
}
|
|
1773
1770
|
function collectStringFlagValues(value) {
|
|
1774
1771
|
if (typeof value === "string") {
|
|
1775
1772
|
return [value];
|
|
@@ -1784,13 +1781,7 @@ function normalizePatternTagFlags(tagsFlag, tagFlag) {
|
|
|
1784
1781
|
...collectStringFlagValues(tagsFlag),
|
|
1785
1782
|
...collectStringFlagValues(tagFlag)
|
|
1786
1783
|
];
|
|
1787
|
-
|
|
1788
|
-
return;
|
|
1789
|
-
}
|
|
1790
|
-
if (tags.length === 1) {
|
|
1791
|
-
return tags[0];
|
|
1792
|
-
}
|
|
1793
|
-
return tags;
|
|
1784
|
+
return tags.length > 0 ? tags : undefined;
|
|
1794
1785
|
}
|
|
1795
1786
|
|
|
1796
1787
|
// src/add-kinds/post-meta.ts
|
|
@@ -1856,8 +1847,8 @@ var postMetaAddKindEntry = defineAddKindRegistryEntry({
|
|
|
1856
1847
|
|
|
1857
1848
|
// src/add-kinds/rest-resource.ts
|
|
1858
1849
|
import {
|
|
1859
|
-
CLI_DIAGNOSTIC_CODES as
|
|
1860
|
-
createCliDiagnosticCodeError as
|
|
1850
|
+
CLI_DIAGNOSTIC_CODES as CLI_DIAGNOSTIC_CODES8,
|
|
1851
|
+
createCliDiagnosticCodeError as createCliDiagnosticCodeError7
|
|
1861
1852
|
} from "@wp-typia/project-tools/cli-diagnostics";
|
|
1862
1853
|
var REST_RESOURCE_GENERATED_USAGE = "Generated: wp-typia add rest-resource <name> [--namespace <vendor/v1>] [--methods <list,read,create,update,delete>] [--route-pattern <route-pattern>] [--permission-callback <callback>] [--controller-class <ClassName>] [--controller-extends <BaseClass>] [--dry-run]";
|
|
1863
1854
|
var REST_RESOURCE_MANUAL_USAGE = "Manual: wp-typia add rest-resource <name> --manual [--namespace <vendor/v1>] [--method <GET|POST|PUT|PATCH|DELETE>] [--auth <public|authenticated|public-write-protected>] [--path <route-pattern>|--route-pattern <route-pattern>] [--permission-callback <callback>] [--controller-class <ClassName>] [--controller-extends <BaseClass>] [--query-type <Type>] [--body-type <Type>] [--response-type <Type>] [--secret-field <field>] [--secret-state-field|--secret-has-value-field <field>] [--secret-preserve-on-empty <true|false>] [--dry-run]";
|
|
@@ -1880,11 +1871,11 @@ function readOptionalSecretPreserveOnEmptyFlag(flags) {
|
|
|
1880
1871
|
return value;
|
|
1881
1872
|
}
|
|
1882
1873
|
if (typeof value !== "string") {
|
|
1883
|
-
throw
|
|
1874
|
+
throw createCliDiagnosticCodeError7(CLI_DIAGNOSTIC_CODES8.MISSING_ARGUMENT, "`--secret-preserve-on-empty` requires a value.");
|
|
1884
1875
|
}
|
|
1885
1876
|
const normalized = value.trim().toLowerCase();
|
|
1886
1877
|
if (normalized.length === 0) {
|
|
1887
|
-
throw
|
|
1878
|
+
throw createCliDiagnosticCodeError7(CLI_DIAGNOSTIC_CODES8.MISSING_ARGUMENT, "`--secret-preserve-on-empty` requires a value.");
|
|
1888
1879
|
}
|
|
1889
1880
|
if (SECRET_PRESERVE_ON_EMPTY_TRUE_VALUES.has(normalized)) {
|
|
1890
1881
|
return true;
|
|
@@ -1892,7 +1883,7 @@ function readOptionalSecretPreserveOnEmptyFlag(flags) {
|
|
|
1892
1883
|
if (SECRET_PRESERVE_ON_EMPTY_FALSE_VALUES.has(normalized)) {
|
|
1893
1884
|
return false;
|
|
1894
1885
|
}
|
|
1895
|
-
throw
|
|
1886
|
+
throw createCliDiagnosticCodeError7(CLI_DIAGNOSTIC_CODES8.INVALID_ARGUMENT, "Manual REST contract --secret-preserve-on-empty must be true or false.");
|
|
1896
1887
|
}
|
|
1897
1888
|
var restResourceAddKindEntry = defineAddKindRegistryEntry({
|
|
1898
1889
|
completion: {
|
|
@@ -2546,7 +2537,7 @@ function buildStructuredInitSuccessPayload(plan) {
|
|
|
2546
2537
|
// package.json
|
|
2547
2538
|
var package_default = {
|
|
2548
2539
|
name: "wp-typia",
|
|
2549
|
-
version: "0.24.
|
|
2540
|
+
version: "0.24.2",
|
|
2550
2541
|
description: "Canonical CLI package for wp-typia scaffolding and project workflows",
|
|
2551
2542
|
packageManager: "bun@1.3.11",
|
|
2552
2543
|
type: "module",
|
|
@@ -2616,7 +2607,7 @@ var package_default = {
|
|
|
2616
2607
|
"@bunli/tui": "0.6.0",
|
|
2617
2608
|
"@bunli/utils": "0.6.0",
|
|
2618
2609
|
"@wp-typia/api-client": "^0.4.5",
|
|
2619
|
-
"@wp-typia/project-tools": "0.24.
|
|
2610
|
+
"@wp-typia/project-tools": "0.24.2",
|
|
2620
2611
|
"better-result": "^2.7.0",
|
|
2621
2612
|
react: "^19.2.5",
|
|
2622
2613
|
"react-dom": "^19.2.5",
|
|
@@ -2645,8 +2636,8 @@ import {
|
|
|
2645
2636
|
parsePackageManagerField
|
|
2646
2637
|
} from "@wp-typia/project-tools/package-managers";
|
|
2647
2638
|
import {
|
|
2648
|
-
CLI_DIAGNOSTIC_CODES as
|
|
2649
|
-
createCliDiagnosticCodeError as
|
|
2639
|
+
CLI_DIAGNOSTIC_CODES as CLI_DIAGNOSTIC_CODES9,
|
|
2640
|
+
createCliDiagnosticCodeError as createCliDiagnosticCodeError8
|
|
2650
2641
|
} from "@wp-typia/project-tools/cli-diagnostics";
|
|
2651
2642
|
var LOOSE_CREATE_COMPLETION_PACKAGE_MANAGER_PATTERN = new RegExp(`^(?:corepack\\s+)?(${PACKAGE_MANAGER_IDS.map(escapeRegExp).join("|")})(?=$|[@:/+\\s])`, "iu");
|
|
2652
2643
|
function parseCreateCompletionPackageManager(packageManager) {
|
|
@@ -2664,7 +2655,7 @@ function resolveCreateCompletionPackageManager(packageManager) {
|
|
|
2664
2655
|
if (parsedPackageManager) {
|
|
2665
2656
|
return parsedPackageManager;
|
|
2666
2657
|
}
|
|
2667
|
-
throw
|
|
2658
|
+
throw createCliDiagnosticCodeError8(CLI_DIAGNOSTIC_CODES9.INVALID_ARGUMENT, `Unsupported package manager "${packageManager}" in create completion payload. Expected one of: ${PACKAGE_MANAGER_IDS.join(", ")}.`);
|
|
2668
2659
|
}
|
|
2669
2660
|
function formatCreateProgressLine(payload, markerOptions) {
|
|
2670
2661
|
return formatOutputMarker("progress", `${payload.title}: ${payload.detail}`, markerOptions);
|
|
@@ -2924,13 +2915,13 @@ async function executeAddCommand({
|
|
|
2924
2915
|
if (shouldPrintMissingAddKindHelp({ emitOutput })) {
|
|
2925
2916
|
printLine(addRuntime.formatAddHelpText());
|
|
2926
2917
|
}
|
|
2927
|
-
throw
|
|
2918
|
+
throw createCliDiagnosticCodeError9(CLI_DIAGNOSTIC_CODES10.MISSING_ARGUMENT, formatMissingAddKindDetailLine());
|
|
2928
2919
|
}
|
|
2929
2920
|
if (!isAddKindId(kind)) {
|
|
2930
|
-
throw
|
|
2921
|
+
throw createCliDiagnosticCodeError9(CLI_DIAGNOSTIC_CODES10.INVALID_COMMAND, `Unknown add kind "${kind}". Expected one of: ${formatAddKindList()}.`);
|
|
2931
2922
|
}
|
|
2932
2923
|
if (dryRun && !supportsAddKindDryRun(kind)) {
|
|
2933
|
-
throw
|
|
2924
|
+
throw createCliDiagnosticCodeError9(CLI_DIAGNOSTIC_CODES10.INVALID_ARGUMENT, `\`wp-typia add ${kind}\` does not support \`--dry-run\` yet.`);
|
|
2934
2925
|
}
|
|
2935
2926
|
const executionContext = {
|
|
2936
2927
|
addRuntime,
|
|
@@ -3184,8 +3175,8 @@ async function executeMigrateCommand({
|
|
|
3184
3175
|
}
|
|
3185
3176
|
// src/runtime-bridge-templates.ts
|
|
3186
3177
|
import {
|
|
3187
|
-
CLI_DIAGNOSTIC_CODES as
|
|
3188
|
-
createCliDiagnosticCodeError as
|
|
3178
|
+
CLI_DIAGNOSTIC_CODES as CLI_DIAGNOSTIC_CODES11,
|
|
3179
|
+
createCliDiagnosticCodeError as createCliDiagnosticCodeError10
|
|
3189
3180
|
} from "@wp-typia/project-tools/cli-diagnostics";
|
|
3190
3181
|
var loadCliTemplatesRuntime2 = () => import("@wp-typia/project-tools/cli-templates");
|
|
3191
3182
|
async function executeTemplatesCommand({ flags }, printLine = console.log) {
|
|
@@ -3205,24 +3196,24 @@ async function executeTemplatesCommand({ flags }, printLine = console.log) {
|
|
|
3205
3196
|
}
|
|
3206
3197
|
if (subcommand === "inspect") {
|
|
3207
3198
|
if (!flags.id) {
|
|
3208
|
-
throw
|
|
3199
|
+
throw createCliDiagnosticCodeError10(CLI_DIAGNOSTIC_CODES11.MISSING_ARGUMENT, "`wp-typia templates inspect` requires <template-id>.");
|
|
3209
3200
|
}
|
|
3210
3201
|
const template = getTemplateById(flags.id);
|
|
3211
3202
|
if (!template) {
|
|
3212
|
-
throw
|
|
3203
|
+
throw createCliDiagnosticCodeError10(CLI_DIAGNOSTIC_CODES11.INVALID_ARGUMENT, `Unknown template "${flags.id}".`);
|
|
3213
3204
|
}
|
|
3214
3205
|
printBlock(printLine, [formatTemplateDetails(template)]);
|
|
3215
3206
|
return;
|
|
3216
3207
|
}
|
|
3217
|
-
throw
|
|
3208
|
+
throw createCliDiagnosticCodeError10(CLI_DIAGNOSTIC_CODES11.INVALID_COMMAND, `Unknown templates subcommand "${subcommand}". Expected list or inspect.`);
|
|
3218
3209
|
}
|
|
3219
3210
|
// src/runtime-bridge-sync.ts
|
|
3220
3211
|
import { spawnSync } from "node:child_process";
|
|
3221
3212
|
import fs3 from "node:fs";
|
|
3222
3213
|
import path4 from "node:path";
|
|
3223
3214
|
import {
|
|
3224
|
-
CLI_DIAGNOSTIC_CODES as
|
|
3225
|
-
createCliDiagnosticCodeError as
|
|
3215
|
+
CLI_DIAGNOSTIC_CODES as CLI_DIAGNOSTIC_CODES12,
|
|
3216
|
+
createCliDiagnosticCodeError as createCliDiagnosticCodeError11
|
|
3226
3217
|
} from "@wp-typia/project-tools/cli-diagnostics";
|
|
3227
3218
|
import {
|
|
3228
3219
|
formatInstallCommand,
|
|
@@ -3243,10 +3234,10 @@ function resolveSyncExecutionTarget(subcommand) {
|
|
|
3243
3234
|
if (subcommand === "ai") {
|
|
3244
3235
|
return "ai";
|
|
3245
3236
|
}
|
|
3246
|
-
throw
|
|
3237
|
+
throw createCliDiagnosticCodeError11(CLI_DIAGNOSTIC_CODES12.INVALID_COMMAND, `Unknown sync subcommand "${subcommand}". Expected one of: "ai".`);
|
|
3247
3238
|
}
|
|
3248
3239
|
function getSyncRootError(cwd) {
|
|
3249
|
-
return
|
|
3240
|
+
return createCliDiagnosticCodeError11(CLI_DIAGNOSTIC_CODES12.OUTSIDE_PROJECT_ROOT, `No generated wp-typia project root was found at ${cwd}. Run \`wp-typia sync\` from a scaffolded project or official workspace root that already contains generated sync scripts. If you expected this directory to work, cd into the scaffold root first or rerun the scaffold before syncing.`);
|
|
3250
3241
|
}
|
|
3251
3242
|
function readSyncPackageJson(packageJsonPath) {
|
|
3252
3243
|
const source = fs3.readFileSync(packageJsonPath, "utf8");
|
|
@@ -3254,7 +3245,7 @@ function readSyncPackageJson(packageJsonPath) {
|
|
|
3254
3245
|
return JSON.parse(source);
|
|
3255
3246
|
} catch (error) {
|
|
3256
3247
|
const message = error instanceof Error ? error.message : String(error);
|
|
3257
|
-
throw
|
|
3248
|
+
throw createCliDiagnosticCodeError11(CLI_DIAGNOSTIC_CODES12.INVALID_ARGUMENT, `Unable to parse ${packageJsonPath}: ${message}`, error instanceof Error ? { cause: error } : undefined);
|
|
3258
3249
|
}
|
|
3259
3250
|
}
|
|
3260
3251
|
function resolveSyncProjectContext(cwd) {
|
|
@@ -3321,7 +3312,7 @@ function assertSyncDependenciesInstalled(project, target) {
|
|
|
3321
3312
|
if (markerDir) {
|
|
3322
3313
|
return;
|
|
3323
3314
|
}
|
|
3324
|
-
throw
|
|
3315
|
+
throw createCliDiagnosticCodeError11(CLI_DIAGNOSTIC_CODES12.DEPENDENCIES_NOT_INSTALLED, `Project dependencies have not been installed yet. Run \`${formatInstallCommand(project.packageManager)}\` from the project root before \`wp-typia sync\`. The generated sync scripts rely on local tools such as \`tsx\`.`);
|
|
3325
3316
|
}
|
|
3326
3317
|
function getPackageManagerRunInvocation(packageManager, scriptName, extraArgs) {
|
|
3327
3318
|
switch (packageManager) {
|
|
@@ -3359,7 +3350,7 @@ function buildSyncPlannedCommands(project, extraArgs, target) {
|
|
|
3359
3350
|
if (target === "ai") {
|
|
3360
3351
|
const syncAiCommand2 = createSyncPlannedCommand(project, "sync-ai", extraArgs);
|
|
3361
3352
|
if (!syncAiCommand2) {
|
|
3362
|
-
throw
|
|
3353
|
+
throw createCliDiagnosticCodeError11(CLI_DIAGNOSTIC_CODES12.CONFIGURATION_MISSING, `Expected ${project.packageJsonPath} to define a \`sync-ai\` script for \`wp-typia sync ai\`.`);
|
|
3363
3354
|
}
|
|
3364
3355
|
return [syncAiCommand2];
|
|
3365
3356
|
}
|
|
@@ -3368,7 +3359,7 @@ function buildSyncPlannedCommands(project, extraArgs, target) {
|
|
|
3368
3359
|
}
|
|
3369
3360
|
const syncTypesCommand = createSyncPlannedCommand(project, "sync-types", extraArgs);
|
|
3370
3361
|
if (!syncTypesCommand) {
|
|
3371
|
-
throw
|
|
3362
|
+
throw createCliDiagnosticCodeError11(CLI_DIAGNOSTIC_CODES12.CONFIGURATION_MISSING, `Expected ${project.packageJsonPath} to define either a \`sync\` or \`sync-types\` script.`);
|
|
3372
3363
|
}
|
|
3373
3364
|
const plannedCommands = [syncTypesCommand];
|
|
3374
3365
|
const syncRestCommand = createSyncPlannedCommand(project, "sync-rest", extraArgs);
|
|
@@ -3392,7 +3383,7 @@ function runProjectScript(project, plannedCommand, options) {
|
|
|
3392
3383
|
const stderr = options.captureOutput && typeof result.stderr === "string" ? result.stderr : undefined;
|
|
3393
3384
|
const stdout = options.captureOutput && typeof result.stdout === "string" ? result.stdout : undefined;
|
|
3394
3385
|
if (result.error || result.status !== 0) {
|
|
3395
|
-
throw
|
|
3386
|
+
throw createCliDiagnosticCodeError11(CLI_DIAGNOSTIC_CODES12.COMMAND_EXECUTION, `\`${plannedCommand.displayCommand}\` failed.`, {
|
|
3396
3387
|
cause: result.error ?? (stderr ? new Error(stderr.trim()) : undefined)
|
|
3397
3388
|
});
|
|
3398
3389
|
}
|
|
@@ -3434,8 +3425,8 @@ async function executeSyncCommand({
|
|
|
3434
3425
|
// src/command-contract.ts
|
|
3435
3426
|
import path5 from "node:path";
|
|
3436
3427
|
import {
|
|
3437
|
-
CLI_DIAGNOSTIC_CODES as
|
|
3438
|
-
createCliDiagnosticCodeError as
|
|
3428
|
+
CLI_DIAGNOSTIC_CODES as CLI_DIAGNOSTIC_CODES13,
|
|
3429
|
+
createCliDiagnosticCodeError as createCliDiagnosticCodeError12
|
|
3439
3430
|
} from "@wp-typia/project-tools/cli-diagnostics";
|
|
3440
3431
|
|
|
3441
3432
|
// src/command-registry.ts
|
|
@@ -3706,10 +3697,10 @@ function looksLikeStructuredProjectInput(value) {
|
|
|
3706
3697
|
function assertPositionalAliasProjectDir(projectDir) {
|
|
3707
3698
|
const normalizedProjectDir = path5.normalize(projectDir).replace(/[\\/]+$/u, "") || path5.normalize(projectDir);
|
|
3708
3699
|
if (normalizedProjectDir === "." || normalizedProjectDir === "..") {
|
|
3709
|
-
throw
|
|
3700
|
+
throw createCliDiagnosticCodeError12(CLI_DIAGNOSTIC_CODES13.INVALID_ARGUMENT, `The positional alias does not scaffold into \`${projectDir}\`. Use \`${WP_TYPIA_CANONICAL_CREATE_USAGE}\` with an explicit child directory instead.`);
|
|
3710
3701
|
}
|
|
3711
3702
|
if (looksLikeStructuredProjectInput(projectDir)) {
|
|
3712
|
-
throw
|
|
3703
|
+
throw createCliDiagnosticCodeError12(CLI_DIAGNOSTIC_CODES13.INVALID_ARGUMENT, `The positional alias only accepts unambiguous local project directories. Use \`${WP_TYPIA_CANONICAL_CREATE_USAGE}\` for \`${projectDir}\`.`);
|
|
3713
3704
|
}
|
|
3714
3705
|
}
|
|
3715
3706
|
function normalizeWpTypiaArgv(argv) {
|
|
@@ -3723,7 +3714,7 @@ function normalizeWpTypiaArgv(argv) {
|
|
|
3723
3714
|
return argv;
|
|
3724
3715
|
}
|
|
3725
3716
|
if (firstPositional === "migrations") {
|
|
3726
|
-
throw
|
|
3717
|
+
throw createCliDiagnosticCodeError12(CLI_DIAGNOSTIC_CODES13.INVALID_ARGUMENT, "`wp-typia migrations` was removed in favor of `wp-typia migrate`. Use `wp-typia migrate <subcommand>` instead.");
|
|
3727
3718
|
}
|
|
3728
3719
|
if (isReservedTopLevelCommandName(firstPositional)) {
|
|
3729
3720
|
assertStringOptionValues(argv);
|
|
@@ -3731,7 +3722,7 @@ function normalizeWpTypiaArgv(argv) {
|
|
|
3731
3722
|
}
|
|
3732
3723
|
if (positionalIndexes.length > 1) {
|
|
3733
3724
|
const extraPositionals = positionalIndexes.slice(1).map((index) => argv[index]).filter((value) => typeof value === "string" && value.length > 0);
|
|
3734
|
-
throw
|
|
3725
|
+
throw createCliDiagnosticCodeError12(CLI_DIAGNOSTIC_CODES13.INVALID_ARGUMENT, `The positional alias only accepts a single project directory. Use \`${WP_TYPIA_CANONICAL_CREATE_USAGE}\` for scaffold invocations with additional positional arguments, or check the command spelling if you meant another top-level command. Extra positional arguments: ${extraPositionals.map((value) => `\`${value}\``).join(", ")}.`);
|
|
3735
3726
|
}
|
|
3736
3727
|
assertPositionalAliasProjectDir(firstPositional);
|
|
3737
3728
|
const normalizedArgv = [
|
|
@@ -3745,7 +3736,7 @@ function normalizeWpTypiaArgv(argv) {
|
|
|
3745
3736
|
|
|
3746
3737
|
// src/node-fallback/doctor.ts
|
|
3747
3738
|
import {
|
|
3748
|
-
CLI_DIAGNOSTIC_CODES as
|
|
3739
|
+
CLI_DIAGNOSTIC_CODES as CLI_DIAGNOSTIC_CODES14,
|
|
3749
3740
|
createCliCommandError as createCliCommandError2
|
|
3750
3741
|
} from "@wp-typia/project-tools/cli-diagnostics";
|
|
3751
3742
|
async function renderNodeFallbackDoctorJson(cwd, exitPolicy, printLine) {
|
|
@@ -3762,7 +3753,7 @@ async function renderNodeFallbackDoctorJson(cwd, exitPolicy, printLine) {
|
|
|
3762
3753
|
}, null, 2));
|
|
3763
3754
|
if (summary.exitCode === 1) {
|
|
3764
3755
|
throw createCliCommandError2({
|
|
3765
|
-
code:
|
|
3756
|
+
code: CLI_DIAGNOSTIC_CODES14.DOCTOR_CHECK_FAILED,
|
|
3766
3757
|
command: "doctor",
|
|
3767
3758
|
detailLines: getDoctorExitFailureDetailLines(checks, { exitPolicy }),
|
|
3768
3759
|
summary: "One or more doctor checks failed."
|
|
@@ -3784,7 +3775,7 @@ async function dispatchNodeFallbackDoctor({
|
|
|
3784
3775
|
|
|
3785
3776
|
// src/node-fallback/dispatchers/add.ts
|
|
3786
3777
|
import {
|
|
3787
|
-
CLI_DIAGNOSTIC_CODES as
|
|
3778
|
+
CLI_DIAGNOSTIC_CODES as CLI_DIAGNOSTIC_CODES15,
|
|
3788
3779
|
createCliCommandError as createCliCommandError3
|
|
3789
3780
|
} from "@wp-typia/project-tools/cli-diagnostics";
|
|
3790
3781
|
function resolveNodeFallbackAddName(positionals) {
|
|
@@ -3806,7 +3797,7 @@ async function dispatchNodeFallbackAdd({
|
|
|
3806
3797
|
printLine(formatAddHelpText());
|
|
3807
3798
|
}
|
|
3808
3799
|
throw createCliCommandError3({
|
|
3809
|
-
code:
|
|
3800
|
+
code: CLI_DIAGNOSTIC_CODES15.MISSING_ARGUMENT,
|
|
3810
3801
|
command: "add",
|
|
3811
3802
|
detailLines: buildMissingAddKindDetailLines()
|
|
3812
3803
|
});
|
|
@@ -3856,7 +3847,7 @@ async function dispatchNodeFallbackAdd({
|
|
|
3856
3847
|
|
|
3857
3848
|
// src/node-fallback/dispatchers/create.ts
|
|
3858
3849
|
import {
|
|
3859
|
-
CLI_DIAGNOSTIC_CODES as
|
|
3850
|
+
CLI_DIAGNOSTIC_CODES as CLI_DIAGNOSTIC_CODES16,
|
|
3860
3851
|
createCliCommandError as createCliCommandError4
|
|
3861
3852
|
} from "@wp-typia/project-tools/cli-diagnostics";
|
|
3862
3853
|
async function dispatchNodeFallbackCreate({
|
|
@@ -3869,7 +3860,7 @@ async function dispatchNodeFallbackCreate({
|
|
|
3869
3860
|
const projectDir = positionals[1];
|
|
3870
3861
|
if (!projectDir) {
|
|
3871
3862
|
throw createCliCommandError4({
|
|
3872
|
-
code:
|
|
3863
|
+
code: CLI_DIAGNOSTIC_CODES16.MISSING_ARGUMENT,
|
|
3873
3864
|
command: "create",
|
|
3874
3865
|
detailLines: buildMissingCreateProjectDirDetailLines()
|
|
3875
3866
|
});
|
|
@@ -3902,7 +3893,7 @@ async function dispatchNodeFallbackCreate({
|
|
|
3902
3893
|
|
|
3903
3894
|
// src/node-fallback/errors.ts
|
|
3904
3895
|
import {
|
|
3905
|
-
CLI_DIAGNOSTIC_CODES as
|
|
3896
|
+
CLI_DIAGNOSTIC_CODES as CLI_DIAGNOSTIC_CODES17,
|
|
3906
3897
|
createCliCommandError as createCliCommandError6,
|
|
3907
3898
|
formatCliDiagnosticError,
|
|
3908
3899
|
isCliDiagnosticError,
|
|
@@ -4020,18 +4011,18 @@ var NODE_FALLBACK_HELP_RENDERERS = Object.fromEntries(Object.entries(NODE_FALLBA
|
|
|
4020
4011
|
// src/node-fallback/errors.ts
|
|
4021
4012
|
function createNodeFallbackNoCommandCliError() {
|
|
4022
4013
|
return createCliCommandError6({
|
|
4023
|
-
code:
|
|
4014
|
+
code: CLI_DIAGNOSTIC_CODES17.INVALID_COMMAND,
|
|
4024
4015
|
command: "wp-typia",
|
|
4025
4016
|
detailLines: [NODE_FALLBACK_NO_COMMAND_REASON_LINE],
|
|
4026
4017
|
summary: "No command was provided."
|
|
4027
4018
|
});
|
|
4028
4019
|
}
|
|
4029
4020
|
function isNodeFallbackNoCommandCliDiagnostic(error) {
|
|
4030
|
-
return isCliDiagnosticError(error) && error.code ===
|
|
4021
|
+
return isCliDiagnosticError(error) && error.code === CLI_DIAGNOSTIC_CODES17.INVALID_COMMAND && error.command === "wp-typia" && error.detailLines.includes(NODE_FALLBACK_NO_COMMAND_REASON_LINE);
|
|
4031
4022
|
}
|
|
4032
4023
|
function throwUnsupportedNodeFallbackCommand(command) {
|
|
4033
4024
|
throw createCliCommandError6({
|
|
4034
|
-
code:
|
|
4025
|
+
code: CLI_DIAGNOSTIC_CODES17.UNSUPPORTED_COMMAND,
|
|
4035
4026
|
command,
|
|
4036
4027
|
detailLines: [
|
|
4037
4028
|
[
|
|
@@ -4067,7 +4058,7 @@ async function handleNodeFallbackEntrypointError(error, argv) {
|
|
|
4067
4058
|
|
|
4068
4059
|
// src/node-fallback/templates.ts
|
|
4069
4060
|
import {
|
|
4070
|
-
CLI_DIAGNOSTIC_CODES as
|
|
4061
|
+
CLI_DIAGNOSTIC_CODES as CLI_DIAGNOSTIC_CODES18,
|
|
4071
4062
|
createCliCommandError as createCliCommandError7
|
|
4072
4063
|
} from "@wp-typia/project-tools/cli-diagnostics";
|
|
4073
4064
|
import {
|
|
@@ -4084,7 +4075,7 @@ function renderNodeFallbackTemplatesJson(printLine, flags, subcommand) {
|
|
|
4084
4075
|
const templateId = flags.id;
|
|
4085
4076
|
if (!templateId) {
|
|
4086
4077
|
throw createCliCommandError7({
|
|
4087
|
-
code:
|
|
4078
|
+
code: CLI_DIAGNOSTIC_CODES18.MISSING_ARGUMENT,
|
|
4088
4079
|
command: "templates",
|
|
4089
4080
|
detailLines: ["`wp-typia templates inspect` requires <template-id>."]
|
|
4090
4081
|
});
|
|
@@ -4092,7 +4083,7 @@ function renderNodeFallbackTemplatesJson(printLine, flags, subcommand) {
|
|
|
4092
4083
|
const template = getTemplateById(templateId);
|
|
4093
4084
|
if (!template) {
|
|
4094
4085
|
throw createCliCommandError7({
|
|
4095
|
-
code:
|
|
4086
|
+
code: CLI_DIAGNOSTIC_CODES18.INVALID_ARGUMENT,
|
|
4096
4087
|
command: "templates",
|
|
4097
4088
|
detailLines: [`Unknown template "${templateId}".`]
|
|
4098
4089
|
});
|
|
@@ -4111,7 +4102,7 @@ async function dispatchNodeFallbackTemplates({
|
|
|
4111
4102
|
const resolvedSubcommand = subcommand ?? (templateId ? "inspect" : "list");
|
|
4112
4103
|
if (resolvedSubcommand !== "list" && resolvedSubcommand !== "inspect") {
|
|
4113
4104
|
throw createCliCommandError7({
|
|
4114
|
-
code:
|
|
4105
|
+
code: CLI_DIAGNOSTIC_CODES18.INVALID_COMMAND,
|
|
4115
4106
|
command: "templates",
|
|
4116
4107
|
detailLines: [
|
|
4117
4108
|
`Unknown templates subcommand "${resolvedSubcommand}". Expected list or inspect.`
|
|
@@ -4369,4 +4360,4 @@ export {
|
|
|
4369
4360
|
hasFlagBeforeTerminator
|
|
4370
4361
|
};
|
|
4371
4362
|
|
|
4372
|
-
//# debugId=
|
|
4363
|
+
//# debugId=925E6E8A01768B3B64756E2164756E21
|