adorn-api 1.0.18 → 1.0.19

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.
package/dist/cli.cjs CHANGED
@@ -3365,16 +3365,31 @@ var ADORN_VERSION = (() => {
3365
3365
  return null;
3366
3366
  }
3367
3367
  };
3368
- const cliDir = (0, import_node_path6.dirname)((0, import_node_url.fileURLToPath)(import_meta2.url));
3369
- const bundledPkgPath = (0, import_node_path6.resolve)(cliDir, "..", "package.json");
3370
- const bundledVersion = tryReadPackageJson(bundledPkgPath);
3371
- if (bundledVersion) return bundledVersion;
3372
- const localPkgPath = (0, import_node_path6.resolve)(import_node_process2.default.cwd(), "package.json");
3373
- const localVersion = tryReadPackageJson(localPkgPath);
3374
- if (localVersion) return localVersion;
3375
- const nodeModulesPath = (0, import_node_path6.resolve)(cliDir, "..", "package.json");
3376
- const nodeModulesVersion = tryReadPackageJson(nodeModulesPath);
3377
- if (nodeModulesVersion) return nodeModulesVersion;
3368
+ const potentialPaths = [];
3369
+ try {
3370
+ const importMetaUrl = import_meta2?.url;
3371
+ if (importMetaUrl && typeof importMetaUrl === "string" && importMetaUrl.length > 0) {
3372
+ const cliDir = (0, import_node_path6.dirname)((0, import_node_url.fileURLToPath)(importMetaUrl));
3373
+ potentialPaths.push(
3374
+ (0, import_node_path6.resolve)(cliDir, "..", "package.json"),
3375
+ (0, import_node_path6.resolve)(cliDir, "package.json")
3376
+ );
3377
+ }
3378
+ } catch {
3379
+ }
3380
+ const cwd = import_node_process2.default.cwd();
3381
+ potentialPaths.push(
3382
+ (0, import_node_path6.resolve)(cwd, "package.json"),
3383
+ (0, import_node_path6.resolve)(cwd, "node_modules", "adorn-api", "package.json"),
3384
+ (0, import_node_path6.resolve)(cwd, "..", "package.json"),
3385
+ (0, import_node_path6.resolve)(cwd, "..", "..", "package.json")
3386
+ );
3387
+ for (const pkgPath of potentialPaths) {
3388
+ const version = tryReadPackageJson(pkgPath);
3389
+ if (version) {
3390
+ return version;
3391
+ }
3392
+ }
3378
3393
  return "0.0.0";
3379
3394
  })();
3380
3395
  function log(msg, options) {