wp-typia 0.22.0 → 0.22.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.
@@ -80,6 +80,16 @@ function readPackageManifest(location) {
80
80
  }
81
81
  return JSON.parse(location.source);
82
82
  }
83
+ function tryReadPackageManifest(location) {
84
+ if (!location) {
85
+ return null;
86
+ }
87
+ try {
88
+ return readPackageManifest(location);
89
+ } catch {
90
+ return null;
91
+ }
92
+ }
83
93
  function resolveInstalledPackageManifestLocation(packageName) {
84
94
  try {
85
95
  return resolvePackageManifestLocation(require2.resolve(`${packageName}/package.json`));
@@ -97,6 +107,13 @@ function resolveInstalledPackageManifestLocation(packageName) {
97
107
  function composePackageVersionsCacheKey(locations) {
98
108
  return locations.map((location) => location.cacheKey).join("|");
99
109
  }
110
+ function resolveManagedPackageVersionRange(options) {
111
+ const workspaceManifestLocation = options.workspacePackageDirName ? resolvePackageManifestLocation(path.join(PROJECT_TOOLS_PACKAGE_ROOT, "..", options.workspacePackageDirName, "package.json")) : null;
112
+ const installedManifestLocation = resolveInstalledPackageManifestLocation(options.packageName);
113
+ const workspaceManifest = tryReadPackageManifest(workspaceManifestLocation);
114
+ const installedManifest = tryReadPackageManifest(installedManifestLocation);
115
+ return normalizeVersionRangeWithFallback(workspaceManifest?.version ?? installedManifest?.version, options.fallback);
116
+ }
100
117
  function getPackageVersions() {
101
118
  const createManifestLocation = resolvePackageManifestLocation(path.join(PROJECT_TOOLS_PACKAGE_ROOT, "package.json"));
102
119
  const monorepoManifestLocation = resolvePackageManifestLocation(path.join(PROJECT_TOOLS_PACKAGE_ROOT, "..", "..", "package.json"));
@@ -156,6 +173,6 @@ function getPackageVersions() {
156
173
  return versions;
157
174
  }
158
175
 
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 };
176
+ 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, resolveManagedPackageVersionRange, getPackageVersions };
160
177
 
161
- //# debugId=010FDB9C3FA1ADA964756E2164756E21
178
+ //# debugId=2A35523B953F4BF364756E2164756E21
@@ -54,7 +54,7 @@ import {
54
54
  } from "./cli-sj5mtyzj.js";
55
55
  import {
56
56
  readWorkspaceInventory
57
- } from "./cli-j180bk07.js";
57
+ } from "./cli-smzkbfna.js";
58
58
  import {
59
59
  getInvalidWorkspaceProjectReason,
60
60
  tryResolveWorkspaceProject