wp-typia 0.22.9 → 0.23.0

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.
@@ -1,11 +1,11 @@
1
1
  // @bun
2
2
  import {
3
3
  getPackageVersions
4
- } from "./cli-arz4rcye.js";
4
+ } from "./cli-agywa5n6.js";
5
+ import"./cli-qse6myha.js";
5
6
  import {
6
7
  discoverMigrationInitLayout
7
8
  } from "./cli-2rqf6t0b.js";
8
- import"./cli-qse6myha.js";
9
9
  import {
10
10
  quoteTsString,
11
11
  require_typescript,
@@ -13,9 +13,9 @@ import {
13
13
  snapshotWorkspaceFiles,
14
14
  toPascalCase,
15
15
  updateWorkspaceInventorySource
16
- } from "./cli-regw5384.js";
16
+ } from "./cli-ts9thts5.js";
17
17
  import"./cli-cvxvcw7c.js";
18
- import"./cli-fys8vm2t.js";
18
+ import"./cli-43mx1vfb.js";
19
19
  import {
20
20
  CLI_DIAGNOSTIC_CODES,
21
21
  createCliDiagnosticCodeError
@@ -717,6 +717,16 @@ function getSyncScriptEnv() {
717
717
  return env;
718
718
  }
719
719
 
720
+ function getOptionalNodeErrorCode( error: unknown ): string | undefined {
721
+ return typeof error === 'object' && error !== null && 'code' in error
722
+ ? String( ( error as { code: unknown } ).code )
723
+ : undefined;
724
+ }
725
+
726
+ function isFileNotFoundError( error: unknown ): boolean {
727
+ return getOptionalNodeErrorCode( error ) === 'ENOENT';
728
+ }
729
+
720
730
  function runSyncScript( scriptPath: string, options: SyncCliOptions ) {
721
731
  const args = [ scriptPath ];
722
732
  if ( options.check ) {
@@ -731,7 +741,7 @@ function runSyncScript( scriptPath: string, options: SyncCliOptions ) {
731
741
  } );
732
742
 
733
743
  if ( result.error ) {
734
- if ( ( result.error as NodeJS.ErrnoException ).code === 'ENOENT' ) {
744
+ if ( isFileNotFoundError( result.error ) ) {
735
745
  throw new Error(
736
746
  'Unable to resolve \`tsx\` for project sync. Install project dependencies or rerun the command through your package manager.'
737
747
  );
@@ -863,4 +873,4 @@ export {
863
873
  applyInitPlan
864
874
  };
865
875
 
866
- //# debugId=0E2AA29C775DCB7E64756E2164756E21
876
+ //# debugId=4702A433619DCEF464756E2164756E21
@@ -83,6 +83,41 @@ function findExecutablePatternMatch(source, patterns) {
83
83
  return;
84
84
  }
85
85
 
86
- export { maskTypeScriptCommentsAndLiterals, hasExecutablePattern, hasUncommentedPattern, findExecutablePatternMatch };
86
+ // ../wp-typia-project-tools/src/runtime/cli-add-workspace-admin-view-types.ts
87
+ var ADMIN_VIEW_REST_SOURCE_KIND = "rest-resource";
88
+ var ADMIN_VIEW_CORE_DATA_SOURCE_KIND = "core-data";
89
+ var ADMIN_VIEW_CORE_DATA_ENTITY_KIND_IDS = [
90
+ "postType",
91
+ "taxonomy"
92
+ ];
93
+ var ADMIN_VIEW_CORE_DATA_ENTITY_SEGMENT_PATTERN = /^[A-Za-z][A-Za-z0-9_-]*$/u;
94
+ var ADMIN_VIEW_CORE_DATA_ENTITY_NAME_PATTERN = /^[a-z0-9][a-z0-9_-]*$/u;
95
+ var ADMIN_VIEW_SOURCE_USAGE = "wp-typia add admin-view <name> --source <rest-resource:slug|core-data:kind/name>";
96
+ var ADMIN_VIEWS_SCRIPT = "build/admin-views/index.js";
97
+ var ADMIN_VIEWS_ASSET = "build/admin-views/index.asset.php";
98
+ var ADMIN_VIEWS_STYLE = "build/admin-views/style-index.css";
99
+ var ADMIN_VIEWS_STYLE_RTL = "build/admin-views/style-index-rtl.css";
100
+ var ADMIN_VIEWS_PHP_GLOB = "/inc/admin-views/*.php";
101
+ var ADMIN_VIEW_MANUAL_REST_ROUTE_PARAMETER_PATTERN = /(?:^|[^\\])\(/u;
102
+ function isAdminViewCoreDataSource(source) {
103
+ return source?.kind === ADMIN_VIEW_CORE_DATA_SOURCE_KIND;
104
+ }
105
+ function isAdminViewRestResourceSource(source) {
106
+ return source?.kind === ADMIN_VIEW_REST_SOURCE_KIND;
107
+ }
108
+ function isAdminViewManualSettingsRestResource(restResource) {
109
+ return restResource?.mode === "manual" && typeof restResource.bodyTypeName === "string" && restResource.bodyTypeName.trim().length > 0 && typeof restResource.queryTypeName === "string" && restResource.queryTypeName.trim().length > 0 && typeof restResource.responseTypeName === "string" && restResource.responseTypeName.trim().length > 0;
110
+ }
111
+ function hasAdminViewManualSettingsRouteParameters(restResource) {
112
+ return [restResource?.pathPattern, restResource?.routePattern].some((pattern) => typeof pattern === "string" && ADMIN_VIEW_MANUAL_REST_ROUTE_PARAMETER_PATTERN.test(pattern));
113
+ }
114
+ function formatAdminViewSourceLocator(source) {
115
+ if (isAdminViewCoreDataSource(source)) {
116
+ return `${source.kind}:${source.entityKind}/${source.entityName}`;
117
+ }
118
+ return `${source.kind}:${source.slug}`;
119
+ }
120
+
121
+ export { maskTypeScriptCommentsAndLiterals, hasExecutablePattern, hasUncommentedPattern, findExecutablePatternMatch, ADMIN_VIEW_REST_SOURCE_KIND, ADMIN_VIEW_CORE_DATA_SOURCE_KIND, ADMIN_VIEW_CORE_DATA_ENTITY_KIND_IDS, ADMIN_VIEW_CORE_DATA_ENTITY_SEGMENT_PATTERN, ADMIN_VIEW_CORE_DATA_ENTITY_NAME_PATTERN, ADMIN_VIEW_SOURCE_USAGE, ADMIN_VIEWS_SCRIPT, ADMIN_VIEWS_ASSET, ADMIN_VIEWS_STYLE, ADMIN_VIEWS_STYLE_RTL, ADMIN_VIEWS_PHP_GLOB, isAdminViewCoreDataSource, isAdminViewRestResourceSource, isAdminViewManualSettingsRestResource, hasAdminViewManualSettingsRouteParameters, formatAdminViewSourceLocator };
87
122
 
88
- //# debugId=752C0F7611E9866D64756E2164756E21
123
+ //# debugId=E5187560087C2C2F64756E2164756E21
@@ -20,31 +20,31 @@ import {
20
20
  resolvePackageManagerId,
21
21
  resolveTemplateId,
22
22
  scaffoldProject
23
- } from "./cli-2pnk64h0.js";
24
- import"./cli-arz4rcye.js";
23
+ } from "./cli-1meywwsy.js";
25
24
  import"./cli-8reep89s.js";
26
- import"./cli-ag722tzm.js";
27
- import"./cli-2rqf6t0b.js";
28
- import"./cli-bq2v559b.js";
29
- import"./cli-xw1wbxf3.js";
25
+ import"./cli-c2acv5dv.js";
26
+ import"./cli-agywa5n6.js";
30
27
  import {
31
28
  OFFICIAL_WORKSPACE_TEMPLATE_PACKAGE,
32
29
  isBuiltInTemplateId
33
30
  } from "./cli-qse6myha.js";
31
+ import"./cli-9npd9was.js";
32
+ import"./cli-2rqf6t0b.js";
34
33
  import {
35
34
  pathExists
36
- } from "./cli-regw5384.js";
35
+ } from "./cli-ts9thts5.js";
37
36
  import"./cli-cvxvcw7c.js";
38
37
  import {
39
38
  createManagedTempRoot
40
39
  } from "./cli-t73q5aqz.js";
41
- import"./cli-fys8vm2t.js";
40
+ import"./cli-43mx1vfb.js";
42
41
  import"./cli-p95wr1q8.js";
43
42
  import"./cli-hhp1d348.js";
44
43
  import {
45
44
  formatInstallCommand,
46
45
  formatRunScript
47
46
  } from "./cli-52ke0ptp.js";
47
+ import"./cli-bq2v559b.js";
48
48
  import"./cli-xnn9xjcy.js";
49
49
 
50
50
  // ../wp-typia-project-tools/src/runtime/cli-scaffold.ts
@@ -561,4 +561,4 @@ export {
561
561
  getNextSteps
562
562
  };
563
563
 
564
- //# debugId=95A9F724954FBE1164756E2164756E21
564
+ //# debugId=2B866835B8626C1664756E2164756E21