wp-typia 0.20.5 → 0.22.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.
@@ -10,6 +10,14 @@ import path from "path";
10
10
  var require2 = createRequire(import.meta.url);
11
11
  var DEFAULT_VERSION_RANGE = "^0.0.0";
12
12
  var DEFAULT_EXACT_VERSION = "0.0.0";
13
+ var DEFAULT_TSX_PACKAGE_VERSION = "^4.20.5";
14
+ var DEFAULT_TYPIA_UNPLUGIN_PACKAGE_VERSION = "^12.0.1";
15
+ var DEFAULT_WORDPRESS_ABILITIES_VERSION = "^0.10.0";
16
+ var DEFAULT_WORDPRESS_CORE_ABILITIES_VERSION = "^0.9.0";
17
+ var DEFAULT_WORDPRESS_CORE_DATA_VERSION = "^7.44.0";
18
+ var DEFAULT_WORDPRESS_DATA_VERSION = "^9.28.0";
19
+ var DEFAULT_WORDPRESS_DATAVIEWS_VERSION = "^14.1.0";
20
+ var DEFAULT_WP_TYPIA_DATAVIEWS_VERSION = "^0.1.0";
13
21
  var cachedPackageVersions = null;
14
22
  function getErrorCode(error) {
15
23
  return typeof error === "object" && error !== null && "code" in error ? String(error.code) : undefined;
@@ -34,6 +42,10 @@ function normalizeExactVersion(value) {
34
42
  }
35
43
  return trimmed.replace(/^[~^<>=]+/, "");
36
44
  }
45
+ function normalizeVersionRangeWithFallback(value, fallback) {
46
+ const normalized = normalizeVersionRange(value);
47
+ return normalized === DEFAULT_VERSION_RANGE ? fallback : normalized;
48
+ }
37
49
  function createContentFingerprint(source) {
38
50
  let hash = 2166136261;
39
51
  for (let index = 0;index < source.length; index += 1) {
@@ -87,6 +99,7 @@ function composePackageVersionsCacheKey(locations) {
87
99
  }
88
100
  function getPackageVersions() {
89
101
  const createManifestLocation = resolvePackageManifestLocation(path.join(PROJECT_TOOLS_PACKAGE_ROOT, "package.json"));
102
+ const monorepoManifestLocation = resolvePackageManifestLocation(path.join(PROJECT_TOOLS_PACKAGE_ROOT, "..", "..", "package.json"));
90
103
  const blockRuntimeManifestLocation = resolvePackageManifestLocation(path.join(PROJECT_TOOLS_PACKAGE_ROOT, "..", "wp-typia-block-runtime", "package.json"));
91
104
  const wpTypiaManifestLocation = resolvePackageManifestLocation(path.join(PROJECT_TOOLS_PACKAGE_ROOT, "..", "wp-typia", "package.json"));
92
105
  const installedProjectToolsManifestLocation = resolveInstalledPackageManifestLocation("@wp-typia/project-tools");
@@ -94,9 +107,14 @@ function getPackageVersions() {
94
107
  const installedBlockRuntimeManifestLocation = resolveInstalledPackageManifestLocation("@wp-typia/block-runtime");
95
108
  const installedBlockTypesManifestLocation = resolveInstalledPackageManifestLocation("@wp-typia/block-types");
96
109
  const installedRestManifestLocation = resolveInstalledPackageManifestLocation("@wp-typia/rest");
110
+ const installedTsxManifestLocation = resolveInstalledPackageManifestLocation("tsx");
111
+ const installedTypiaManifestLocation = resolveInstalledPackageManifestLocation("typia");
112
+ const installedTypiaUnpluginManifestLocation = resolveInstalledPackageManifestLocation("@typia/unplugin");
113
+ const installedTypescriptManifestLocation = resolveInstalledPackageManifestLocation("typescript");
97
114
  const installedWpTypiaManifestLocation = resolveInstalledPackageManifestLocation("wp-typia");
98
115
  const cacheKey = composePackageVersionsCacheKey([
99
116
  createManifestLocation,
117
+ monorepoManifestLocation,
100
118
  blockRuntimeManifestLocation,
101
119
  wpTypiaManifestLocation,
102
120
  installedProjectToolsManifestLocation,
@@ -104,12 +122,17 @@ function getPackageVersions() {
104
122
  installedBlockRuntimeManifestLocation,
105
123
  installedBlockTypesManifestLocation,
106
124
  installedRestManifestLocation,
125
+ installedTsxManifestLocation,
126
+ installedTypiaManifestLocation,
127
+ installedTypiaUnpluginManifestLocation,
128
+ installedTypescriptManifestLocation,
107
129
  installedWpTypiaManifestLocation
108
130
  ]);
109
131
  if (cachedPackageVersions?.cacheKey === cacheKey) {
110
132
  return cachedPackageVersions.versions;
111
133
  }
112
134
  const createManifest = readPackageManifest(createManifestLocation) ?? readPackageManifest(installedProjectToolsManifestLocation) ?? {};
135
+ const monorepoManifest = readPackageManifest(monorepoManifestLocation) ?? {};
113
136
  const blockRuntimeManifest = readPackageManifest(blockRuntimeManifestLocation) ?? readPackageManifest(installedBlockRuntimeManifestLocation) ?? {};
114
137
  const wpTypiaManifest = readPackageManifest(wpTypiaManifestLocation) ?? readPackageManifest(installedWpTypiaManifestLocation) ?? {};
115
138
  const blockRuntimeDependencyVersion = normalizeVersionRange(createManifest.dependencies?.["@wp-typia/block-runtime"]);
@@ -119,6 +142,10 @@ function getPackageVersions() {
119
142
  blockTypesPackageVersion: normalizeVersionRange(createManifest.dependencies?.["@wp-typia/block-types"] ?? readPackageManifest(installedBlockTypesManifestLocation)?.version),
120
143
  projectToolsPackageVersion: normalizeVersionRange(createManifest.version),
121
144
  restPackageVersion: normalizeVersionRange(createManifest.dependencies?.["@wp-typia/rest"] ?? readPackageManifest(installedRestManifestLocation)?.version),
145
+ tsxPackageVersion: normalizeVersionRangeWithFallback(monorepoManifest.dependencies?.tsx ?? monorepoManifest.devDependencies?.tsx ?? readPackageManifest(installedTsxManifestLocation)?.version, DEFAULT_TSX_PACKAGE_VERSION),
146
+ typiaPackageVersion: normalizeVersionRangeWithFallback(monorepoManifest.dependencies?.typia ?? monorepoManifest.devDependencies?.typia ?? createManifest.dependencies?.typia ?? readPackageManifest(installedTypiaManifestLocation)?.version, DEFAULT_VERSION_RANGE),
147
+ typiaUnpluginPackageVersion: normalizeVersionRangeWithFallback(monorepoManifest.dependencies?.["@typia/unplugin"] ?? monorepoManifest.devDependencies?.["@typia/unplugin"] ?? readPackageManifest(installedTypiaUnpluginManifestLocation)?.version, DEFAULT_TYPIA_UNPLUGIN_PACKAGE_VERSION),
148
+ typescriptPackageVersion: normalizeVersionRangeWithFallback(monorepoManifest.dependencies?.typescript ?? monorepoManifest.devDependencies?.typescript ?? createManifest.dependencies?.typescript ?? readPackageManifest(installedTypescriptManifestLocation)?.version, DEFAULT_VERSION_RANGE),
122
149
  wpTypiaPackageExactVersion: normalizeExactVersion(wpTypiaManifest.version),
123
150
  wpTypiaPackageVersion: normalizeVersionRange(wpTypiaManifest.version)
124
151
  };
@@ -129,6 +156,6 @@ function getPackageVersions() {
129
156
  return versions;
130
157
  }
131
158
 
132
- export { getPackageVersions };
159
+ export { DEFAULT_WORDPRESS_ABILITIES_VERSION, DEFAULT_WORDPRESS_CORE_ABILITIES_VERSION, DEFAULT_WORDPRESS_CORE_DATA_VERSION, DEFAULT_WORDPRESS_DATA_VERSION, DEFAULT_WORDPRESS_DATAVIEWS_VERSION, DEFAULT_WP_TYPIA_DATAVIEWS_VERSION, getPackageVersions };
133
160
 
134
- //# debugId=C3B4490E611B094364756E2164756E21
161
+ //# debugId=010FDB9C3FA1ADA964756E2164756E21