@axlsdk/axl 0.17.1 → 0.17.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.
package/dist/index.d.cts CHANGED
@@ -2573,10 +2573,18 @@ declare function expandGlob(pattern: string, cwd: string): string[];
2573
2573
  * `exports` use a `development` condition to point at `.ts` source instead
2574
2574
  * of built `dist`.
2575
2575
  *
2576
- * Caveat: ESM-only. CJS `require()` chains bypass the hook. Files tsx
2577
- * compiles to CJS (`.cts`, or `.ts` in a package without
2578
- * `"type": "module"`) issue `require()` calls that don't see the extra
2579
- * conditions — workaround is to add `"type": "module"` or rename to `.mts`.
2576
+ * Caveat: ESM-only. `node:module.register()` only installs ESM resolve
2577
+ * hooks; Node's CJS resolver never sees them. So when tsx compiles a
2578
+ * `.ts` file in a CJS-typed package, its `import` statements become
2579
+ * `require()` calls, those `require()`s use the CJS resolver, and the
2580
+ * extra conditions don't propagate — meaning a workspace package whose
2581
+ * `exports.development → "./src/foo.ts"` resolves to the `default`
2582
+ * entry (e.g. built `./dist/foo.js`) instead of the `.ts` source. This
2583
+ * is independent of the `tsx/cjs/api` hook (which fixes `.ts` *file
2584
+ * loading* under require, but can't make the CJS resolver consult ESM
2585
+ * conditions). Workaround for full condition coverage: add
2586
+ * `"type": "module"` to the importer's package, or rename it to `.mts`,
2587
+ * so its internal imports stay as `import` and hit the ESM resolve hook.
2580
2588
  *
2581
2589
  * @internal
2582
2590
  */
package/dist/index.d.ts CHANGED
@@ -2573,10 +2573,18 @@ declare function expandGlob(pattern: string, cwd: string): string[];
2573
2573
  * `exports` use a `development` condition to point at `.ts` source instead
2574
2574
  * of built `dist`.
2575
2575
  *
2576
- * Caveat: ESM-only. CJS `require()` chains bypass the hook. Files tsx
2577
- * compiles to CJS (`.cts`, or `.ts` in a package without
2578
- * `"type": "module"`) issue `require()` calls that don't see the extra
2579
- * conditions — workaround is to add `"type": "module"` or rename to `.mts`.
2576
+ * Caveat: ESM-only. `node:module.register()` only installs ESM resolve
2577
+ * hooks; Node's CJS resolver never sees them. So when tsx compiles a
2578
+ * `.ts` file in a CJS-typed package, its `import` statements become
2579
+ * `require()` calls, those `require()`s use the CJS resolver, and the
2580
+ * extra conditions don't propagate — meaning a workspace package whose
2581
+ * `exports.development → "./src/foo.ts"` resolves to the `default`
2582
+ * entry (e.g. built `./dist/foo.js`) instead of the `.ts` source. This
2583
+ * is independent of the `tsx/cjs/api` hook (which fixes `.ts` *file
2584
+ * loading* under require, but can't make the CJS resolver consult ESM
2585
+ * conditions). Workaround for full condition coverage: add
2586
+ * `"type": "module"` to the importer's package, or rename it to `.mts`,
2587
+ * so its internal imports stay as `import` and hit the ESM resolve hook.
2580
2588
  *
2581
2589
  * @internal
2582
2590
  */
package/dist/index.js CHANGED
@@ -7925,15 +7925,23 @@ var tsxRegistered;
7925
7925
  async function ensureTsxRegistered() {
7926
7926
  if (tsxRegistered !== void 0) return tsxRegistered;
7927
7927
  try {
7928
- const mod = await import("tsx/esm/api");
7929
- if (typeof mod.register === "function") {
7930
- mod.register();
7931
- tsxRegistered = true;
7932
- } else {
7928
+ const esm = await import("tsx/esm/api");
7929
+ if (typeof esm.register !== "function") {
7933
7930
  tsxRegistered = false;
7931
+ return tsxRegistered;
7934
7932
  }
7933
+ esm.register();
7934
+ tsxRegistered = true;
7935
7935
  } catch {
7936
7936
  tsxRegistered = false;
7937
+ return tsxRegistered;
7938
+ }
7939
+ try {
7940
+ const cjs = await import("tsx/cjs/api");
7941
+ if (typeof cjs.register === "function") {
7942
+ cjs.register();
7943
+ }
7944
+ } catch {
7937
7945
  }
7938
7946
  return tsxRegistered;
7939
7947
  }