wp-typia 0.24.0 → 0.24.1

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.
@@ -33,6 +33,10 @@ var ADD_OPTION_METADATA = {
33
33
  description: "Target block slug/name for variation, core-variation, style, and end-to-end binding-source workflows.",
34
34
  type: "string"
35
35
  },
36
+ "catalog-title": {
37
+ description: "Human-readable title for typed pattern catalog entries; defaults to the pattern slug title.",
38
+ type: "string"
39
+ },
36
40
  "controller-class": {
37
41
  description: "REST resource controller class used for generated route callbacks or declared manual/provider route ownership.",
38
42
  type: "string"
@@ -190,7 +194,13 @@ var ADD_OPTION_METADATA = {
190
194
  type: "string"
191
195
  },
192
196
  tags: {
193
- description: "Comma-separated tags for typed pattern catalog entries.",
197
+ description: "Comma-separated tags for typed pattern catalog entries; may be repeated.",
198
+ repeatable: true,
199
+ type: "string"
200
+ },
201
+ tag: {
202
+ description: "Repeatable singular tag for typed pattern catalog entries.",
203
+ repeatable: true,
194
204
  type: "string"
195
205
  },
196
206
  type: {
@@ -455,10 +465,19 @@ function buildCommandOptionParser(...metadataMaps) {
455
465
  }
456
466
  return {
457
467
  booleanOptionNames: new Set(collectOptionNamesByType(metadata, "boolean")),
468
+ repeatableOptionNames: new Set(Object.entries(metadata).filter(([, option]) => option.repeatable).map(([name]) => name)),
458
469
  shortFlagMap: new Map(Object.entries(metadata).flatMap(([name, option]) => option.short ? [[option.short, { name, type: option.type }]] : [])),
459
470
  stringOptionNames: new Set(collectOptionNamesByType(metadata, "string"))
460
471
  };
461
472
  }
473
+ function assignParsedOptionValue(flags, options) {
474
+ if (!options.parser.repeatableOptionNames.has(options.name)) {
475
+ flags[options.name] = options.value;
476
+ return;
477
+ }
478
+ const current = flags[options.name];
479
+ flags[options.name] = Array.isArray(current) ? [...current, options.value] : current === undefined ? [options.value] : [current, options.value];
480
+ }
462
481
  function buildArgvWalkerRoutingMetadata(...metadataMaps) {
463
482
  const parser = buildCommandOptionParser(...metadataMaps);
464
483
  return {
@@ -500,7 +519,11 @@ function extractKnownOptionValuesFromArgv(argv, options) {
500
519
  if (!next || next.startsWith("-")) {
501
520
  throw createMissingOptionValueError(arg);
502
521
  }
503
- flags[shortFlag.name] = next;
522
+ assignParsedOptionValue(flags, {
523
+ name: shortFlag.name,
524
+ parser: options.parser,
525
+ value: next
526
+ });
504
527
  index += 1;
505
528
  continue;
506
529
  }
@@ -525,14 +548,22 @@ function extractKnownOptionValuesFromArgv(argv, options) {
525
548
  if (!inlineValue) {
526
549
  throw createMissingOptionValueError(`--${rawName}`);
527
550
  }
528
- flags[rawName] = inlineValue;
551
+ assignParsedOptionValue(flags, {
552
+ name: rawName,
553
+ parser: options.parser,
554
+ value: inlineValue
555
+ });
529
556
  continue;
530
557
  }
531
558
  const next = argv[index + 1];
532
559
  if (!next || next.startsWith("-")) {
533
560
  throw createMissingOptionValueError(`--${rawName}`);
534
561
  }
535
- flags[rawName] = next;
562
+ assignParsedOptionValue(flags, {
563
+ name: rawName,
564
+ parser: options.parser,
565
+ value: next
566
+ });
536
567
  index += 1;
537
568
  continue;
538
569
  }
@@ -572,7 +603,11 @@ function parseCommandArgvWithMetadata(argv, options) {
572
603
  if (!next || next.startsWith("-")) {
573
604
  throw createMissingOptionValueError(arg);
574
605
  }
575
- flags[shortFlag.name] = next;
606
+ assignParsedOptionValue(flags, {
607
+ name: shortFlag.name,
608
+ parser: options.parser,
609
+ value: next
610
+ });
576
611
  index += 1;
577
612
  continue;
578
613
  }
@@ -592,14 +627,22 @@ function parseCommandArgvWithMetadata(argv, options) {
592
627
  if (!inlineValue) {
593
628
  throw createMissingOptionValueError(`--${rawName}`);
594
629
  }
595
- flags[rawName] = inlineValue;
630
+ assignParsedOptionValue(flags, {
631
+ name: rawName,
632
+ parser: options.parser,
633
+ value: inlineValue
634
+ });
596
635
  continue;
597
636
  }
598
637
  const next = argv[index + 1];
599
638
  if (!next || next.startsWith("-")) {
600
639
  throw createMissingOptionValueError(`--${rawName}`);
601
640
  }
602
- flags[rawName] = next;
641
+ assignParsedOptionValue(flags, {
642
+ name: rawName,
643
+ parser: options.parser,
644
+ value: next
645
+ });
603
646
  index += 1;
604
647
  continue;
605
648
  }
@@ -627,6 +670,10 @@ function resolveCommandOptionValues(metadata, options) {
627
670
  resolved[name] = Boolean(value ?? false);
628
671
  continue;
629
672
  }
673
+ if (descriptor.repeatable && Array.isArray(value)) {
674
+ resolved[name] = value.every((item) => typeof item === "string") ? value.join(",") : undefined;
675
+ continue;
676
+ }
630
677
  resolved[name] = typeof value === "string" ? value : undefined;
631
678
  }
632
679
  return resolved;
@@ -1517,6 +1564,7 @@ var coreVariationAddKindEntry = defineAddKindRegistryEntry({
1517
1564
  variationFile: result.variationFile,
1518
1565
  variationSlug: result.variationSlug
1519
1566
  }),
1567
+ getWarnings: (result) => result.warnings,
1520
1568
  missingNameMessage: CORE_VARIATION_MISSING_NAME_MESSAGE,
1521
1569
  name: variationName,
1522
1570
  warnLine: context.warnLine
@@ -1683,8 +1731,10 @@ var patternAddKindEntry = defineAddKindRegistryEntry({
1683
1731
  },
1684
1732
  description: "Add a PHP block pattern shell",
1685
1733
  hiddenStringSubmitFields: [
1734
+ "catalog-title",
1686
1735
  "scope",
1687
1736
  "section-role",
1737
+ "tag",
1688
1738
  "tags",
1689
1739
  "thumbnail-url"
1690
1740
  ],
@@ -1693,10 +1743,12 @@ var patternAddKindEntry = defineAddKindRegistryEntry({
1693
1743
  const name = requireAddKindName(context, PATTERN_MISSING_NAME_MESSAGE);
1694
1744
  const scope = typeof context.flags.scope === "string" ? context.flags.scope : undefined;
1695
1745
  const sectionRole = typeof context.flags["section-role"] === "string" ? context.flags["section-role"] : undefined;
1696
- const tags = typeof context.flags.tags === "string" ? context.flags.tags : undefined;
1746
+ const catalogTitle = typeof context.flags["catalog-title"] === "string" ? context.flags["catalog-title"] : undefined;
1747
+ const tags = normalizePatternTagFlags(context.flags.tags, context.flags.tag);
1697
1748
  const thumbnailUrl = typeof context.flags["thumbnail-url"] === "string" ? context.flags["thumbnail-url"] : undefined;
1698
1749
  return {
1699
1750
  execute: (cwd) => context.addRuntime.runAddPatternCommand({
1751
+ catalogTitle,
1700
1752
  cwd,
1701
1753
  patternScope: scope,
1702
1754
  patternName: name,
@@ -1715,9 +1767,31 @@ var patternAddKindEntry = defineAddKindRegistryEntry({
1715
1767
  },
1716
1768
  sortOrder: 60,
1717
1769
  supportsDryRun: true,
1718
- usage: "wp-typia add pattern <name> [--scope <full|section>] [--section-role <role>] [--tags <tag,...>] [--thumbnail-url <url>] [--dry-run]",
1770
+ usage: "wp-typia add pattern <name> [--scope <full|section>] [--section-role <role>] [--catalog-title <title>] [--tags <tag,...>|--tag <tag>...] [--thumbnail-url <url>] [--dry-run]",
1719
1771
  visibleFieldNames: () => NAME_ONLY_VISIBLE_FIELDS
1720
1772
  });
1773
+ function collectStringFlagValues(value) {
1774
+ if (typeof value === "string") {
1775
+ return [value];
1776
+ }
1777
+ if (Array.isArray(value)) {
1778
+ return value.filter((item) => typeof item === "string");
1779
+ }
1780
+ return [];
1781
+ }
1782
+ function normalizePatternTagFlags(tagsFlag, tagFlag) {
1783
+ const tags = [
1784
+ ...collectStringFlagValues(tagsFlag),
1785
+ ...collectStringFlagValues(tagFlag)
1786
+ ];
1787
+ if (tags.length === 0) {
1788
+ return;
1789
+ }
1790
+ if (tags.length === 1) {
1791
+ return tags[0];
1792
+ }
1793
+ return tags;
1794
+ }
1721
1795
 
1722
1796
  // src/add-kinds/post-meta.ts
1723
1797
  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>].";
@@ -2472,7 +2546,7 @@ function buildStructuredInitSuccessPayload(plan) {
2472
2546
  // package.json
2473
2547
  var package_default = {
2474
2548
  name: "wp-typia",
2475
- version: "0.24.0",
2549
+ version: "0.24.1",
2476
2550
  description: "Canonical CLI package for wp-typia scaffolding and project workflows",
2477
2551
  packageManager: "bun@1.3.11",
2478
2552
  type: "module",
@@ -2542,7 +2616,7 @@ var package_default = {
2542
2616
  "@bunli/tui": "0.6.0",
2543
2617
  "@bunli/utils": "0.6.0",
2544
2618
  "@wp-typia/api-client": "^0.4.5",
2545
- "@wp-typia/project-tools": "0.24.0",
2619
+ "@wp-typia/project-tools": "0.24.1",
2546
2620
  "better-result": "^2.7.0",
2547
2621
  react: "^19.2.5",
2548
2622
  "react-dom": "^19.2.5",
@@ -4295,4 +4369,4 @@ export {
4295
4369
  hasFlagBeforeTerminator
4296
4370
  };
4297
4371
 
4298
- //# debugId=89977F6E4F67703D64756E2164756E21
4372
+ //# debugId=9C14F1C0B8D6AB4264756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wp-typia",
3
- "version": "0.24.0",
3
+ "version": "0.24.1",
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.0",
73
+ "@wp-typia/project-tools": "0.24.1",
74
74
  "better-result": "^2.7.0",
75
75
  "react": "^19.2.5",
76
76
  "react-dom": "^19.2.5",