@savvy-web/tsdown-plugins 2.0.0 → 2.1.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.
@@ -82,11 +82,18 @@ const isTs = (p) => !isDeclarationFile(p) && (p.endsWith(".ts") || p.endsWith(".
82
82
  * gates the `types` condition: when `false` (the build's dts pass was skipped, see issue #198),
83
83
  * omitting `types` avoids pointing the published manifest at a declaration file that was never
84
84
  * written. Defaults to `true` (current behavior, byte-identical).
85
+ *
86
+ * The trailing `default` condition mirrors the ESM artifact so `require(esm)` resolves on the
87
+ * Node range every published package supports (engines >=24.11.0): Node's require() matches
88
+ * `node`/`require`/`default` but never `import`, so an import-only map dies with
89
+ * ERR_PACKAGE_PATH_NOT_EXPORTED even where require(esm) works. Dual-format entries keep their
90
+ * dedicated CJS artifact under `require`, which wins over `default` by condition order.
85
91
  */
86
92
  const tsConditions = (exportKey, dual, subdirExports, emitDts = true) => ({
87
93
  ...emitDts ? { types: toBuiltDts(exportKey, subdirExports) } : {},
88
94
  import: toBuiltJs(exportKey, subdirExports),
89
- ...dual ? { require: toBuiltCjs(exportKey, subdirExports) } : {}
95
+ ...dual ? { require: toBuiltCjs(exportKey, subdirExports) } : {},
96
+ default: toBuiltJs(exportKey, subdirExports)
90
97
  });
91
98
  /**
92
99
  * A `./public/<path>` export value points into the staged `public/` dir, whose CONTENTS `copyPublicDir`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@savvy-web/tsdown-plugins",
3
- "version": "2.0.0",
3
+ "version": "2.1.1",
4
4
  "private": false,
5
5
  "description": "Interface-only tsdown/rolldown plugin pack powering @savvy-web/bundler",
6
6
  "homepage": "https://github.com/savvy-web/systems/tree/main/packages/tsdown-plugins",
@@ -23,7 +23,8 @@
23
23
  "exports": {
24
24
  ".": {
25
25
  "types": "./index.d.ts",
26
- "import": "./index.js"
26
+ "import": "./index.js",
27
+ "default": "./index.js"
27
28
  },
28
29
  "./package.json": "./package.json"
29
30
  },
@@ -31,8 +32,8 @@
31
32
  "@changesets/get-release-plan": "^5.0.0-next.7",
32
33
  "@effect/platform-node": "4.0.0-beta.98",
33
34
  "@effected/npm": "^0.2.0",
34
- "@effected/tsconfig-json": "^0.2.0",
35
- "@effected/workspaces": "^0.2.0",
35
+ "@effected/tsconfig-json": "^0.2.2",
36
+ "@effected/workspaces": "^0.3.1",
36
37
  "@microsoft/api-extractor": "^7.58.9",
37
38
  "@microsoft/tsdoc": "^0.16.0",
38
39
  "@microsoft/tsdoc-config": "^0.18.1",
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.58.9"
8
+ "packageVersion": "7.58.10"
9
9
  }
10
10
  ]
11
11
  }