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.
@@ -170924,14 +170924,12 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
170924
170924
  // ../wp-typia-project-tools/src/runtime/pattern-catalog.ts
170925
170925
  import fs from "fs";
170926
170926
  import path from "path";
170927
+
170928
+ // ../wp-typia-project-tools/src/runtime/pattern-catalog-section-roles.ts
170927
170929
  import {
170928
170930
  validateBlockPatternContentNesting
170929
170931
  } from "@wp-typia/block-runtime/metadata-core";
170930
- var PATTERN_CATALOG_SCOPE_IDS = ["full", "section"];
170931
- var PATTERN_SLUG_PATTERN = /^[a-z][a-z0-9-]*$/u;
170932
- var PATTERN_SECTION_ROLE_PATTERN = PATTERN_SLUG_PATTERN;
170933
- var PATTERN_TAG_PATTERN = /^[a-z0-9][a-z0-9-]*$/u;
170934
- var PATTERN_CONTENT_FILE_ROOT = "src/patterns/";
170932
+ var PATTERN_SECTION_ROLE_PATTERN = /^[a-z][a-z0-9-]*$/u;
170935
170933
  var DEFAULT_SECTION_ROLE_CONVENTION = {
170936
170934
  baseClassName: "section",
170937
170935
  requireUniqueFullPatternRoles: false,
@@ -170942,20 +170940,6 @@ var DEFAULT_SECTION_ROLE_CONVENTION = {
170942
170940
  function createPatternCatalogDiagnostic(diagnostic) {
170943
170941
  return diagnostic;
170944
170942
  }
170945
- function isPatternCatalogScope(value) {
170946
- return PATTERN_CATALOG_SCOPE_IDS.includes(value);
170947
- }
170948
- function isSafeRelativePath(value) {
170949
- return value.length > 0 && !path.isAbsolute(value) && !value.includes("\\") && !value.split(/[\\/]+/u).includes("..") && !/[<>:"|?*\u0000-\u001F]/u.test(value);
170950
- }
170951
- function isPatternContentFilePath(value) {
170952
- if (!isSafeRelativePath(value) || !value.startsWith(PATTERN_CONTENT_FILE_ROOT) || !value.endsWith(".php")) {
170953
- return false;
170954
- }
170955
- const patternRelativePath = value.slice(PATTERN_CONTENT_FILE_ROOT.length);
170956
- const segments = patternRelativePath.split("/");
170957
- return (segments.length === 1 || segments.length === 2) && segments.every((segment) => segment.length > 0);
170958
- }
170959
170943
  function normalizeSectionRoleConventionInput(convention = {}) {
170960
170944
  return {
170961
170945
  baseClassName: convention.baseClassName ?? DEFAULT_SECTION_ROLE_CONVENTION.baseClassName,
@@ -170975,7 +170959,7 @@ function createRoleClassNamePattern(pattern) {
170975
170959
  }
170976
170960
  return new RegExp(`^${escapeRegExp(parts[0] ?? "")}(?<role>\\S*)${escapeRegExp(parts[1] ?? "")}$`, "u");
170977
170961
  }
170978
- function normalizeSectionRoleConvention(convention = {}) {
170962
+ function normalizePatternCatalogSectionRoleConvention(convention = {}) {
170979
170963
  const normalized = normalizeSectionRoleConventionInput(convention);
170980
170964
  return {
170981
170965
  ...normalized,
@@ -171037,7 +171021,7 @@ function collectSectionRoleMatches(blocks, convention, pathSegments = []) {
171037
171021
  `${block.blockName}[${index}]`
171038
171022
  ];
171039
171023
  const blockPath = blockPathSegments.join(" > ");
171040
- const roles = extractPatternSectionRolesFromAttributes(block.attributes, convention);
171024
+ const roles = extractPatternSectionRolesFromNormalizedAttributes(block.attributes, convention);
171041
171025
  const matches = isSectionWrapperCandidate(block, roles, convention) ? [
171042
171026
  {
171043
171027
  blockName: block.blockName,
@@ -171060,27 +171044,12 @@ function unescapeSerializedBlockCommentJsonQuotes(content) {
171060
171044
  return `<!--${body.replace(/\\"/gu, '"')}-->`;
171061
171045
  });
171062
171046
  }
171063
- function extractPatternSectionRolesFromAttributes(attributes, convention = {}) {
171064
- const normalized = normalizeSectionRoleConvention(convention);
171047
+ function extractPatternSectionRolesFromNormalizedAttributes(attributes, normalized) {
171065
171048
  const classRoles = getClassNameTokens(attributes).map((token) => normalized.roleClassNamePatternRegExp.exec(token)?.groups?.role).filter((role) => typeof role === "string");
171066
171049
  const attributeRoles = normalized.roleAttributePaths.flatMap((pathName) => collectStringValues(getAttributePathValue(attributes, pathName)));
171067
171050
  return uniqueValues([...classRoles, ...attributeRoles]);
171068
171051
  }
171069
- function isValidPatternThumbnailUrl(value) {
171070
- if (value.length === 0) {
171071
- return false;
171072
- }
171073
- try {
171074
- const url = new URL(value);
171075
- return url.protocol === "http:" || url.protocol === "https:";
171076
- } catch {
171077
- return isSafeRelativePath(value);
171078
- }
171079
- }
171080
- function resolvePatternCatalogContentFile(pattern) {
171081
- return pattern.contentFile ?? pattern.file;
171082
- }
171083
- function createKnownSectionRoleSet(patterns) {
171052
+ function collectKnownPatternSectionRoles(patterns) {
171084
171053
  return new Set(patterns.map((pattern) => pattern.sectionRole).filter((sectionRole) => typeof sectionRole === "string" && PATTERN_SECTION_ROLE_PATTERN.test(sectionRole)));
171085
171054
  }
171086
171055
  function validatePatternContentSectionRoles({
@@ -171172,26 +171141,63 @@ function validatePatternContentSectionRoles({
171172
171141
  }
171173
171142
  return diagnostics;
171174
171143
  }
171144
+
171145
+ // ../wp-typia-project-tools/src/runtime/pattern-catalog.ts
171146
+ var PATTERN_CATALOG_SCOPE_IDS = ["full", "section"];
171147
+ var PATTERN_SLUG_PATTERN = /^[a-z][a-z0-9-]*$/u;
171148
+ var PATTERN_TAG_PATTERN = /^[a-z0-9][a-z0-9-]*$/u;
171149
+ var PATTERN_CONTENT_FILE_ROOT = "src/patterns/";
171150
+ function createPatternCatalogDiagnostic2(diagnostic) {
171151
+ return diagnostic;
171152
+ }
171153
+ function isPatternCatalogScope(value) {
171154
+ return PATTERN_CATALOG_SCOPE_IDS.includes(value);
171155
+ }
171156
+ function isSafeRelativePath(value) {
171157
+ return value.length > 0 && !path.isAbsolute(value) && !value.includes("\\") && !value.split(/[\\/]+/u).includes("..") && !/[<>:"|?*\u0000-\u001F]/u.test(value);
171158
+ }
171159
+ function isPatternContentFilePath(value) {
171160
+ if (!isSafeRelativePath(value) || !value.startsWith(PATTERN_CONTENT_FILE_ROOT) || !value.endsWith(".php")) {
171161
+ return false;
171162
+ }
171163
+ const patternRelativePath = value.slice(PATTERN_CONTENT_FILE_ROOT.length);
171164
+ const segments = patternRelativePath.split("/");
171165
+ return (segments.length === 1 || segments.length === 2) && segments.every((segment) => segment.length > 0);
171166
+ }
171167
+ function isValidPatternThumbnailUrl(value) {
171168
+ if (value.length === 0) {
171169
+ return false;
171170
+ }
171171
+ try {
171172
+ const url = new URL(value);
171173
+ return url.protocol === "http:" || url.protocol === "https:";
171174
+ } catch {
171175
+ return isSafeRelativePath(value);
171176
+ }
171177
+ }
171178
+ function resolvePatternCatalogContentFile(pattern) {
171179
+ return pattern.contentFile ?? pattern.file;
171180
+ }
171175
171181
  function validatePatternCatalog(patterns, options = {}) {
171176
171182
  const diagnostics = [];
171177
171183
  const seenSlugs = new Map;
171178
171184
  let sectionRoleConvention = null;
171179
171185
  if (options.sectionRoleConvention !== false) {
171180
171186
  try {
171181
- sectionRoleConvention = normalizeSectionRoleConvention(options.sectionRoleConvention);
171187
+ sectionRoleConvention = normalizePatternCatalogSectionRoleConvention(options.sectionRoleConvention);
171182
171188
  } catch (error) {
171183
- diagnostics.push(createPatternCatalogDiagnostic({
171189
+ diagnostics.push(createPatternCatalogDiagnostic2({
171184
171190
  code: "invalid-pattern-section-role-convention",
171185
171191
  message: `sectionRoleConvention.roleClassNamePattern is invalid: ${error instanceof Error ? error.message : String(error)}`,
171186
171192
  severity: "error"
171187
171193
  }));
171188
171194
  }
171189
171195
  }
171190
- const knownSectionRoles = createKnownSectionRoleSet(patterns);
171196
+ const knownSectionRoles = collectKnownPatternSectionRoles(patterns);
171191
171197
  for (const [index, pattern] of patterns.entries()) {
171192
171198
  const label = pattern.slug || `PATTERNS[${index}]`;
171193
171199
  if (!PATTERN_SLUG_PATTERN.test(pattern.slug)) {
171194
- diagnostics.push(createPatternCatalogDiagnostic({
171200
+ diagnostics.push(createPatternCatalogDiagnostic2({
171195
171201
  code: "invalid-pattern-slug",
171196
171202
  message: `${label}: slug must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens.`,
171197
171203
  patternSlug: pattern.slug,
@@ -171200,7 +171206,7 @@ function validatePatternCatalog(patterns, options = {}) {
171200
171206
  }
171201
171207
  const previousIndex = seenSlugs.get(pattern.slug);
171202
171208
  if (previousIndex !== undefined) {
171203
- diagnostics.push(createPatternCatalogDiagnostic({
171209
+ diagnostics.push(createPatternCatalogDiagnostic2({
171204
171210
  code: "duplicate-pattern-slug",
171205
171211
  message: `${label}: duplicate slug already declared at PATTERNS[${previousIndex}].`,
171206
171212
  patternSlug: pattern.slug,
@@ -171211,7 +171217,7 @@ function validatePatternCatalog(patterns, options = {}) {
171211
171217
  }
171212
171218
  const scope = pattern.scope ?? "full";
171213
171219
  if (!isPatternCatalogScope(scope)) {
171214
- diagnostics.push(createPatternCatalogDiagnostic({
171220
+ diagnostics.push(createPatternCatalogDiagnostic2({
171215
171221
  code: "invalid-pattern-scope",
171216
171222
  message: `${label}: scope must be one of ${PATTERN_CATALOG_SCOPE_IDS.join(", ")}.`,
171217
171223
  patternSlug: pattern.slug,
@@ -171219,7 +171225,7 @@ function validatePatternCatalog(patterns, options = {}) {
171219
171225
  }));
171220
171226
  }
171221
171227
  if (scope === "section" && !pattern.sectionRole) {
171222
- diagnostics.push(createPatternCatalogDiagnostic({
171228
+ diagnostics.push(createPatternCatalogDiagnostic2({
171223
171229
  code: "missing-pattern-section-role",
171224
171230
  message: `${label}: section-scoped patterns must declare sectionRole.`,
171225
171231
  patternSlug: pattern.slug,
@@ -171227,7 +171233,7 @@ function validatePatternCatalog(patterns, options = {}) {
171227
171233
  }));
171228
171234
  }
171229
171235
  if (pattern.sectionRole !== undefined && !PATTERN_SECTION_ROLE_PATTERN.test(pattern.sectionRole)) {
171230
- diagnostics.push(createPatternCatalogDiagnostic({
171236
+ diagnostics.push(createPatternCatalogDiagnostic2({
171231
171237
  code: "invalid-pattern-section-role",
171232
171238
  message: `${label}: sectionRole must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens.`,
171233
171239
  patternSlug: pattern.slug,
@@ -171236,7 +171242,7 @@ function validatePatternCatalog(patterns, options = {}) {
171236
171242
  }
171237
171243
  for (const [tagIndex, tag] of (pattern.tags ?? []).entries()) {
171238
171244
  if (!PATTERN_TAG_PATTERN.test(tag)) {
171239
- diagnostics.push(createPatternCatalogDiagnostic({
171245
+ diagnostics.push(createPatternCatalogDiagnostic2({
171240
171246
  code: "invalid-pattern-tag",
171241
171247
  message: `${label}: tags[${tagIndex}] must contain only lowercase letters, numbers, and hyphens.`,
171242
171248
  patternSlug: pattern.slug,
@@ -171245,7 +171251,7 @@ function validatePatternCatalog(patterns, options = {}) {
171245
171251
  }
171246
171252
  }
171247
171253
  if (pattern.thumbnailUrl !== undefined && !isValidPatternThumbnailUrl(pattern.thumbnailUrl)) {
171248
- diagnostics.push(createPatternCatalogDiagnostic({
171254
+ diagnostics.push(createPatternCatalogDiagnostic2({
171249
171255
  code: "invalid-pattern-thumbnail-url",
171250
171256
  message: `${label}: thumbnailUrl must be an http(s) URL or safe relative project path.`,
171251
171257
  patternSlug: pattern.slug,
@@ -171254,7 +171260,7 @@ function validatePatternCatalog(patterns, options = {}) {
171254
171260
  }
171255
171261
  const contentFile = resolvePatternCatalogContentFile(pattern);
171256
171262
  if (!contentFile) {
171257
- diagnostics.push(createPatternCatalogDiagnostic({
171263
+ diagnostics.push(createPatternCatalogDiagnostic2({
171258
171264
  code: "missing-pattern-content-file",
171259
171265
  message: `${label}: contentFile or legacy file must point at the pattern PHP file.`,
171260
171266
  patternSlug: pattern.slug,
@@ -171263,7 +171269,7 @@ function validatePatternCatalog(patterns, options = {}) {
171263
171269
  continue;
171264
171270
  }
171265
171271
  if (!isPatternContentFilePath(contentFile)) {
171266
- diagnostics.push(createPatternCatalogDiagnostic({
171272
+ diagnostics.push(createPatternCatalogDiagnostic2({
171267
171273
  code: "invalid-pattern-content-file",
171268
171274
  message: `${label}: contentFile must be a safe relative project path directly under src/patterns/ or one nested directory under src/patterns/ and end in .php.`,
171269
171275
  patternSlug: pattern.slug,
@@ -171276,7 +171282,7 @@ function validatePatternCatalog(patterns, options = {}) {
171276
171282
  }
171277
171283
  const absoluteContentFile = path.join(options.projectDir, contentFile);
171278
171284
  if (!fs.existsSync(absoluteContentFile)) {
171279
- diagnostics.push(createPatternCatalogDiagnostic({
171285
+ diagnostics.push(createPatternCatalogDiagnostic2({
171280
171286
  code: "missing-pattern-content-file",
171281
171287
  message: `${label}: missing pattern content file ${contentFile}.`,
171282
171288
  patternSlug: pattern.slug,
@@ -171289,7 +171295,7 @@ function validatePatternCatalog(patterns, options = {}) {
171289
171295
  try {
171290
171296
  content = fs.readFileSync(absoluteContentFile, "utf8");
171291
171297
  } catch (error) {
171292
- diagnostics.push(createPatternCatalogDiagnostic({
171298
+ diagnostics.push(createPatternCatalogDiagnostic2({
171293
171299
  code: "invalid-pattern-content-file",
171294
171300
  message: `${label}: failed to read pattern content file ${contentFile}: ${error instanceof Error ? error.message : String(error)}.`,
171295
171301
  patternSlug: pattern.slug,
@@ -171790,7 +171796,7 @@ function formatAddHelpText() {
171790
171796
  wp-typia add variation <name> --block <block-slug> [--dry-run]
171791
171797
  wp-typia add style <name> --block <block-slug> [--dry-run]
171792
171798
  wp-typia add transform <name> --from <namespace/block> --to <block-slug|namespace/block-slug> [--dry-run]
171793
- wp-typia add pattern <name> [--scope <full|section>] [--section-role <role>] [--tags <tag,...>] [--thumbnail-url <url>] [--dry-run]
171799
+ wp-typia add pattern <name> [--scope <full|section>] [--section-role <role>] [--catalog-title <title>] [--tags <tag,...>|--tag <tag>...] [--thumbnail-url <url>] [--dry-run]
171794
171800
  wp-typia add binding-source <name> [--block <block-slug|namespace/block-slug> --attribute <attribute>] [--from-post-meta|--post-meta <post-meta> [--meta-path <field>]] [--dry-run]
171795
171801
  wp-typia add contract <name> [--type <ExportedTypeName>] [--dry-run]
171796
171802
  wp-typia add rest-resource <name> [--namespace <vendor/v1>] [--methods <${REST_RESOURCE_METHOD_IDS.join(",")}>] [--route-pattern <route-pattern>] [--permission-callback <callback>] [--controller-class <ClassName>] [--controller-extends <BaseClass>] [--dry-run]
@@ -171806,6 +171812,7 @@ Notes:
171806
171812
  Pass \`--dry-run\` to preview the workspace files that would change without writing them.
171807
171813
  Interactive add flows let you choose a template when \`--template\` is omitted; non-interactive runs default to \`basic\`.
171808
171814
  \`add core-variation\` registers editor-side variations for existing core or external blocks without generating block.json or Typia manifests.
171815
+ Unknown \`core/*\` core-variation targets warn instead of failing so newer WordPress core blocks remain scaffoldable; third-party namespaces are allowed without local discovery.
171809
171816
  \`add admin-view\` scaffolds an opt-in DataViews-powered WordPress admin screen under \`src/admin-views/\`.
171810
171817
  Pass \`--source rest-resource:<slug>\` to reuse a list-capable REST resource.
171811
171818
  Pass \`--source core-data:postType/post\` or \`--source core-data:taxonomy/category\` to bind a WordPress-owned entity collection.
@@ -171817,7 +171824,7 @@ Notes:
171817
171824
  \`add variation\` targets an existing block slug from \`scripts/block-config.ts\`.
171818
171825
  \`add style\` registers a Block Styles option for an existing generated block.
171819
171826
  \`add transform\` adds a block-to-block transform into an existing generated block.
171820
- \`add pattern\` scaffolds a namespaced PHP pattern shell under \`src/patterns/full/\` or \`src/patterns/sections/\` and records typed catalog metadata in \`PATTERNS\`.
171827
+ \`add pattern\` scaffolds a namespaced PHP pattern shell under \`src/patterns/full/\` or \`src/patterns/sections/\` and records typed catalog metadata in \`PATTERNS\`; pass \`--catalog-title "Hero Photo"\` to override the generated catalog title, and pass \`--tags hero,landing\` or repeat \`--tag hero --tag landing\` to set catalog tags.
171821
171828
  \`add binding-source\` scaffolds shared PHP and editor registration under \`src/bindings/\`; pass \`--block\` and \`--attribute\` together to declare an end-to-end bindable attribute on an existing generated block. Pass \`--from-post-meta\` or \`--post-meta\` to generate a source backed by a typed post-meta contract; \`--meta-path\` selects one top-level field as the default binding arg.
171822
171829
  \`add contract\` registers a standalone TypeScript wire contract under \`src/contracts/\` and generates a stable JSON Schema artifact without creating PHP route glue.
171823
171830
  \`add rest-resource\` scaffolds plugin-level TypeScript REST contracts under \`src/rest/\` and PHP route glue under \`inc/rest/\`. Use \`--route-pattern\`, \`--permission-callback\`, \`--controller-class\`, and \`--controller-extends\` when an existing WordPress controller or permission model needs to own part of the generated route surface.
@@ -173813,4 +173820,4 @@ async function appendWorkspaceInventoryEntries(projectDir, options) {
173813
173820
  }
173814
173821
  export { toKebabCase, toSnakeCase, toPascalCase, toCamelCase, toSegmentPascalCase, toTitleCase, validateBlockSlug, validateNamespace, normalizeBlockSlug, resolveNonEmptyNormalizedBlockSlug, buildBlockCssClassName, buildFrontendCssClassName, resolveScaffoldIdentifiers, PATTERN_CATALOG_SCOPE_IDS, isValidPatternThumbnailUrl, resolvePatternCatalogContentFile, validatePatternCatalog, formatPatternCatalogDiagnostics, REST_RESOURCE_METHOD_IDS, MANUAL_REST_CONTRACT_HTTP_METHOD_IDS, MANUAL_REST_CONTRACT_AUTH_IDS, EDITOR_PLUGIN_SLOT_IDS, resolveEditorPluginSlotAlias, ADD_BLOCK_TEMPLATE_IDS, suggestAddBlockTemplateId, HOOKED_BLOCK_POSITION_SET, HOOKED_BLOCK_ANCHOR_PATTERN, REST_RESOURCE_NAMESPACE_PATTERN, assertValidGeneratedSlug, assertValidTypeScriptIdentifier, resolveRestResourceNamespace, assertValidPostMetaPostType, resolvePostMetaKey, assertValidRestResourceMethods, resolveOptionalPhpCallbackReference, resolveOptionalPhpClassReference, assertValidManualRestContractHttpMethod, assertValidManualRestContractAuth, isGeneratedRestResourceRoutePatternCompatible, collectRestRouteNamedCaptureNames, resolveManualRestContractPathPattern, resolveGeneratedRestResourceRoutePattern, assertValidHookedBlockPosition, buildWorkspacePhpPrefix, isAddBlockTemplateId, quoteTsString, assertValidHookAnchor, assertValidEditorPluginSlot, assertValidIntegrationEnvService, pathExists, readOptionalUtf8File, getNodeErrorCode, getOptionalNodeErrorCode, isFileNotFoundError, getWorkspaceBootstrapPath, patchFile, readOptionalFile, snapshotWorkspaceFiles, rollbackWorkspaceMutation, resolveWorkspaceBlock, readWorkspaceBlockJson, getMutableBlockHooks, assertVariationDoesNotExist, assertBlockStyleDoesNotExist, assertBlockTransformDoesNotExist, assertPatternDoesNotExist, assertBindingSourceDoesNotExist, assertRestResourceDoesNotExist, assertPostMetaDoesNotExist, assertContractDoesNotExist, assertAdminViewDoesNotExist, assertAbilityDoesNotExist, assertAiFeatureDoesNotExist, assertEditorPluginDoesNotExist, formatAddHelpText, require_typescript, getPropertyNameText, readWorkspaceInventory, readWorkspaceInventoryAsync, getWorkspaceBlockSelectOptions, getWorkspaceBlockSelectOptionsAsync, escapeRegex, quotePhpString, hasPhpFunctionDefinition, hasPhpFunctionCall, findPhpFunctionRange, replacePhpFunctionDefinition, updateWorkspaceInventorySource, appendWorkspaceInventoryEntries };
173815
173822
 
173816
- //# debugId=7B77B39B1AF35AE264756E2164756E21
173823
+ //# debugId=3009CBE929AC544A64756E2164756E21
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  getPackageVersions
4
- } from "./cli-y0a8nztv.js";
4
+ } from "./cli-zjw3eqfj.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-v0nnagb3.js";
16
+ } from "./cli-h2v72j8q.js";
17
17
  import"./cli-cvxvcw7c.js";
18
18
  import"./cli-bajwv85z.js";
19
19
  import {
@@ -21,19 +21,19 @@ import {
21
21
  resolvePackageManagerId,
22
22
  resolveTemplateId,
23
23
  scaffoldProject
24
- } from "./cli-74y6z3yx.js";
24
+ } from "./cli-4ah8dawy.js";
25
25
  import"./cli-9fx0qgb7.js";
26
- import"./cli-sw06c521.js";
27
- import"./cli-y0a8nztv.js";
26
+ import"./cli-gaq29kzp.js";
27
+ import"./cli-zjw3eqfj.js";
28
28
  import {
29
29
  OFFICIAL_WORKSPACE_TEMPLATE_PACKAGE,
30
30
  isBuiltInTemplateId
31
31
  } from "./cli-8hxf9qw6.js";
32
- import"./cli-0v407aag.js";
32
+ import"./cli-fzhkqzc7.js";
33
33
  import"./cli-e4bwd81c.js";
34
34
  import {
35
35
  pathExists
36
- } from "./cli-v0nnagb3.js";
36
+ } from "./cli-h2v72j8q.js";
37
37
  import"./cli-cvxvcw7c.js";
38
38
  import {
39
39
  createManagedTempRoot
@@ -4,7 +4,10 @@ import {
4
4
  } from "./cli-8hxf9qw6.js";
5
5
  import {
6
6
  getOptionalNodeErrorCode
7
- } from "./cli-v0nnagb3.js";
7
+ } from "./cli-h2v72j8q.js";
8
+ import {
9
+ safeJsonParse
10
+ } from "./cli-ccax7s0s.js";
8
11
 
9
12
  // ../wp-typia-project-tools/src/runtime/package-versions.ts
10
13
  import fs from "fs";
@@ -88,11 +91,10 @@ function readPackageManifest(location) {
88
91
  if (!location.packageJsonPath || location.source === null) {
89
92
  return null;
90
93
  }
91
- try {
92
- return JSON.parse(location.source);
93
- } catch (error) {
94
- throw new Error(`Failed to parse package version manifest at ${location.packageJsonPath}: ${error instanceof Error ? error.message : String(error)}`);
95
- }
94
+ return safeJsonParse(location.source, {
95
+ context: "package version manifest",
96
+ filePath: location.packageJsonPath
97
+ });
96
98
  }
97
99
  function tryReadPackageManifest(location) {
98
100
  if (!location) {
@@ -193,4 +195,4 @@ function getPackageVersions() {
193
195
 
194
196
  export { DEFAULT_WORDPRESS_ABILITIES_VERSION, DEFAULT_WORDPRESS_CORE_ABILITIES_VERSION, DEFAULT_WORDPRESS_CORE_DATA_VERSION, DEFAULT_WORDPRESS_DATA_VERSION, DEFAULT_WORDPRESS_DATAVIEWS_VERSION, DEFAULT_WORDPRESS_ENV_VERSION, DEFAULT_WP_TYPIA_DATAVIEWS_VERSION, resolveManagedPackageVersionRange, getPackageVersions };
195
197
 
196
- //# debugId=5C44FE33F29175BD64756E2164756E21
198
+ //# debugId=8B55C11F64E194C164756E2164756E21
package/dist-bunli/cli.js CHANGED
@@ -22,7 +22,7 @@ import {
22
22
  package_default,
23
23
  validateCliOutputFormatArgv,
24
24
  writeStructuredCliDiagnosticError
25
- } from "./cli-cwjdzq6n.js";
25
+ } from "./cli-1xt99e09.js";
26
26
  import"./cli-03j0axbt.js";
27
27
  import {
28
28
  GLOBAL_FLAGS,
@@ -2460,7 +2460,7 @@ async function formatCliError(error) {
2460
2460
  }
2461
2461
  async function createWpTypiaCli(options = {}) {
2462
2462
  applyStandaloneSupportLayoutEnv();
2463
- const { wpTypiaCommands } = await import("./command-list-xaw5agks.js");
2463
+ const { wpTypiaCommands } = await import("./command-list-bd2582k1.js");
2464
2464
  const cli = await createCLI({
2465
2465
  ...bunliConfig,
2466
2466
  description: package_default.description,
@@ -19,7 +19,7 @@ import {
19
19
  package_default,
20
20
  prefersStructuredCliOutput,
21
21
  resolveCommandOptionValues
22
- } from "./cli-cwjdzq6n.js";
22
+ } from "./cli-1xt99e09.js";
23
23
  import {
24
24
  Result,
25
25
  TaggedError,
@@ -636,6 +636,7 @@ var coreVariationAddKindEntry = defineAddKindRegistryEntry({
636
636
  variationFile: result.variationFile,
637
637
  variationSlug: result.variationSlug
638
638
  }),
639
+ getWarnings: (result) => result.warnings,
639
640
  missingNameMessage: CORE_VARIATION_MISSING_NAME_MESSAGE,
640
641
  name: variationName,
641
642
  warnLine: context.warnLine
@@ -802,8 +803,10 @@ var patternAddKindEntry = defineAddKindRegistryEntry({
802
803
  },
803
804
  description: "Add a PHP block pattern shell",
804
805
  hiddenStringSubmitFields: [
806
+ "catalog-title",
805
807
  "scope",
806
808
  "section-role",
809
+ "tag",
807
810
  "tags",
808
811
  "thumbnail-url"
809
812
  ],
@@ -812,10 +815,12 @@ var patternAddKindEntry = defineAddKindRegistryEntry({
812
815
  const name = requireAddKindName(context, PATTERN_MISSING_NAME_MESSAGE);
813
816
  const scope = typeof context.flags.scope === "string" ? context.flags.scope : undefined;
814
817
  const sectionRole = typeof context.flags["section-role"] === "string" ? context.flags["section-role"] : undefined;
815
- const tags = typeof context.flags.tags === "string" ? context.flags.tags : undefined;
818
+ const catalogTitle = typeof context.flags["catalog-title"] === "string" ? context.flags["catalog-title"] : undefined;
819
+ const tags = normalizePatternTagFlags(context.flags.tags, context.flags.tag);
816
820
  const thumbnailUrl = typeof context.flags["thumbnail-url"] === "string" ? context.flags["thumbnail-url"] : undefined;
817
821
  return {
818
822
  execute: (cwd) => context.addRuntime.runAddPatternCommand({
823
+ catalogTitle,
819
824
  cwd,
820
825
  patternScope: scope,
821
826
  patternName: name,
@@ -834,9 +839,31 @@ var patternAddKindEntry = defineAddKindRegistryEntry({
834
839
  },
835
840
  sortOrder: 60,
836
841
  supportsDryRun: true,
837
- usage: "wp-typia add pattern <name> [--scope <full|section>] [--section-role <role>] [--tags <tag,...>] [--thumbnail-url <url>] [--dry-run]",
842
+ usage: "wp-typia add pattern <name> [--scope <full|section>] [--section-role <role>] [--catalog-title <title>] [--tags <tag,...>|--tag <tag>...] [--thumbnail-url <url>] [--dry-run]",
838
843
  visibleFieldNames: () => NAME_ONLY_VISIBLE_FIELDS
839
844
  });
845
+ function collectStringFlagValues(value) {
846
+ if (typeof value === "string") {
847
+ return [value];
848
+ }
849
+ if (Array.isArray(value)) {
850
+ return value.filter((item) => typeof item === "string");
851
+ }
852
+ return [];
853
+ }
854
+ function normalizePatternTagFlags(tagsFlag, tagFlag) {
855
+ const tags = [
856
+ ...collectStringFlagValues(tagsFlag),
857
+ ...collectStringFlagValues(tagFlag)
858
+ ];
859
+ if (tags.length === 0) {
860
+ return;
861
+ }
862
+ if (tags.length === 1) {
863
+ return tags[0];
864
+ }
865
+ return tags;
866
+ }
840
867
 
841
868
  // src/add-kinds/post-meta.ts
842
869
  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>].";
@@ -1791,7 +1818,7 @@ function pushFlag(argv, name, value) {
1791
1818
  }
1792
1819
 
1793
1820
  // src/runtime-bridge-add.ts
1794
- var loadCliAddRuntime = () => import("./cli-add-nmdraf20.js");
1821
+ var loadCliAddRuntime = () => import("./cli-add-mr731xtv.js");
1795
1822
  var loadCliPromptRuntime = () => import("./cli-prompt-ncyg68rn.js");
1796
1823
  async function executeWorkspaceAddWithOptionalDryRun(options) {
1797
1824
  const simulated = options.dryRun ? await simulateWorkspaceAddDryRun({
@@ -1901,7 +1928,7 @@ async function executeAddCommand({
1901
1928
  }
1902
1929
  // src/runtime-bridge-create.ts
1903
1930
  var loadCliPromptRuntime2 = () => import("./cli-prompt-ncyg68rn.js");
1904
- var loadCliScaffoldRuntime = () => import("./cli-scaffold-an2k0fnm.js");
1931
+ var loadCliScaffoldRuntime = () => import("./cli-scaffold-bt1ttnkg.js");
1905
1932
  var loadCliTemplatesRuntime = () => import("./cli-templates-g8t4fm11.js");
1906
1933
  var loadCreateTemplateValidationRuntime = () => import("./create-template-validation-4fr851vg.js");
1907
1934
  var PACKAGE_MANAGER_PROMPT_OPTIONS = [
@@ -2022,7 +2049,7 @@ async function executeCreateCommand({
2022
2049
  }
2023
2050
  }
2024
2051
  // src/runtime-bridge-doctor.ts
2025
- var loadCliDoctorRuntime = () => import("./cli-doctor-pcss6ecx.js");
2052
+ var loadCliDoctorRuntime = () => import("./cli-doctor-kf9gwdhh.js");
2026
2053
  async function executeDoctorCommand(cwd, options = {}) {
2027
2054
  try {
2028
2055
  const { runDoctor } = await loadCliDoctorRuntime();
@@ -2033,7 +2060,7 @@ async function executeDoctorCommand(cwd, options = {}) {
2033
2060
  }
2034
2061
  // src/runtime-bridge-init.ts
2035
2062
  import path2 from "path";
2036
- var loadCliInitRuntime = () => import("./cli-init-he7vm7kc.js");
2063
+ var loadCliInitRuntime = () => import("./cli-init-557vq109.js");
2037
2064
  async function executeInitCommand({ apply, cwd, packageManager, projectDir }, options = {}) {
2038
2065
  try {
2039
2066
  const { runInitCommand } = await loadCliInitRuntime();
@@ -2059,7 +2086,7 @@ async function executeInitCommand({ apply, cwd, packageManager, projectDir }, op
2059
2086
  }
2060
2087
  }
2061
2088
  // src/runtime-bridge-migrate.ts
2062
- var loadMigrationsRuntime = () => import("./migrations-z7f4kxba.js");
2089
+ var loadMigrationsRuntime = () => import("./migrations-ky53fj2h.js");
2063
2090
  var defaultPrintLine2 = (line) => {
2064
2091
  process.stdout.write(`${line}
2065
2092
  `);
@@ -2955,7 +2982,7 @@ var doctorCommand = defineCommand({
2955
2982
  createDoctorRunSummary,
2956
2983
  getDoctorChecks,
2957
2984
  getDoctorExitFailureDetailLines
2958
- } = await import("./cli-doctor-pcss6ecx.js");
2985
+ } = await import("./cli-doctor-kf9gwdhh.js");
2959
2986
  const checks = await getDoctorChecks(args.cwd);
2960
2987
  const summary = createDoctorRunSummary(checks, {
2961
2988
  exitPolicy: doctorExitPolicy
@@ -3850,4 +3877,4 @@ export {
3850
3877
  wpTypiaCommands
3851
3878
  };
3852
3879
 
3853
- //# debugId=57FDA4D19922070564756E2164756E21
3880
+ //# debugId=B6599B689F520BC764756E2164756E21
@@ -15,9 +15,9 @@ import {
15
15
  snapshotProjectVersion,
16
16
  verifyProjectMigrations,
17
17
  wizardProjectMigrations
18
- } from "./cli-0v407aag.js";
18
+ } from "./cli-fzhkqzc7.js";
19
19
  import"./cli-e4bwd81c.js";
20
- import"./cli-v0nnagb3.js";
20
+ import"./cli-h2v72j8q.js";
21
21
  import"./cli-cvxvcw7c.js";
22
22
  import"./cli-bajwv85z.js";
23
23
  import"./cli-tq730sqt.js";