@resourcexjs/core 2.17.0 → 2.17.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.
package/dist/index.js CHANGED
@@ -15138,8 +15138,8 @@ async function loadResource(source, config2) {
15138
15138
  return loader.load(source);
15139
15139
  }
15140
15140
  // src/loader/NpmSourceLoader.ts
15141
- import { dirname } from "node:path";
15142
- import { fileURLToPath } from "node:url";
15141
+ import { dirname, join as join3 } from "node:path";
15142
+ import { fileURLToPath, pathToFileURL } from "node:url";
15143
15143
  var NPM_PREFIX = "npm:";
15144
15144
 
15145
15145
  class NpmSourceLoader {
@@ -15160,8 +15160,9 @@ class NpmSourceLoader {
15160
15160
  return { source, files: rxs.files };
15161
15161
  }
15162
15162
  resolvePackageDir(packageName) {
15163
+ const parent = pathToFileURL(join3(process.cwd(), "noop.js")).href;
15163
15164
  try {
15164
- const url2 = import.meta.resolve(`${packageName}/package.json`);
15165
+ const url2 = import.meta.resolve(`${packageName}/package.json`, parent);
15165
15166
  return dirname(fileURLToPath(url2));
15166
15167
  } catch {
15167
15168
  throw new ResourceXError(`Cannot resolve npm package: ${packageName}`);
@@ -15477,7 +15478,7 @@ class CASRegistry {
15477
15478
  }
15478
15479
  // src/registry/registries/LinkedRegistry.ts
15479
15480
  import { lstat, mkdir, readdir as readdir3, readlink, rm, symlink } from "node:fs/promises";
15480
- import { join as join3, resolve as resolvePath } from "node:path";
15481
+ import { join as join4, resolve as resolvePath } from "node:path";
15481
15482
  class LinkedRegistry {
15482
15483
  basePath;
15483
15484
  constructor(basePath) {
@@ -15486,11 +15487,11 @@ class LinkedRegistry {
15486
15487
  buildLinkPath(rxi) {
15487
15488
  const registry2 = rxi.registry ?? "localhost";
15488
15489
  const tag = rxi.tag ?? "latest";
15489
- let linkPath = join3(this.basePath, registry2);
15490
+ let linkPath = join4(this.basePath, registry2);
15490
15491
  if (rxi.path) {
15491
- linkPath = join3(linkPath, rxi.path);
15492
+ linkPath = join4(linkPath, rxi.path);
15492
15493
  }
15493
- return join3(linkPath, rxi.name, tag);
15494
+ return join4(linkPath, rxi.name, tag);
15494
15495
  }
15495
15496
  async isSymlink(path) {
15496
15497
  try {
@@ -15552,7 +15553,7 @@ class LinkedRegistry {
15552
15553
  await rm(linkPath, { recursive: true });
15553
15554
  }
15554
15555
  } catch {}
15555
- const parentPath = join3(linkPath, "..");
15556
+ const parentPath = join4(linkPath, "..");
15556
15557
  await mkdir(parentPath, { recursive: true });
15557
15558
  const absolutePath = resolvePath(devPath);
15558
15559
  await symlink(absolutePath, linkPath);
@@ -15569,7 +15570,7 @@ class LinkedRegistry {
15569
15570
  return;
15570
15571
  }
15571
15572
  for (const entry of entries) {
15572
- const fullPath = join3(dirPath, entry);
15573
+ const fullPath = join4(dirPath, entry);
15573
15574
  const relPath = relativePath ? `${relativePath}/${entry}` : entry;
15574
15575
  try {
15575
15576
  const stats = await lstat(fullPath);
@@ -15996,4 +15997,4 @@ export {
15996
15997
  CASRegistry
15997
15998
  };
15998
15999
 
15999
- //# debugId=8B42B108D3A1492364756E2164756E21
16000
+ //# debugId=F11283FBFC6D53D064756E2164756E21