Skip to content

Commit 0675e2c

Browse files
committed
minor #34 [Package] Expose per-entry types through the exports map (Kocal)
This PR was merged into the main branch. Discussion ---------- [Package] Expose per-entry types through the exports map | Q | A | -------------- | --- | Bug fix? | no | New feature? | no | Deprecations? | no | Documentation? | no | Issues | - | License | MIT ``@symfony`/reprise` exposed its type declarations through a `typesVersions` wildcard plus bare-string `exports` entries. This PR gives each `exports` entry explicit `types` and `default` conditions, the mechanism `node16`/`nodenext`/`bundler` module resolution actually reads, and drops the `typesVersions` hack. All five subpath entries (`.`, `./rsbuild`, `./stimulus`, `./types`, `./vite`) now resolve to their generated `.d.mts`. The top-level `types` field is kept as a fallback. Commits ------- 83faa50 [Package] Expose per-entry types through the exports map
2 parents a3ab547 + 83faa50 commit 0675e2c

1 file changed

Lines changed: 20 additions & 13 deletions

File tree

assets/package.json

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,31 @@
2525
"encore"
2626
],
2727
"exports": {
28-
".": "./dist/index.mjs",
29-
"./rsbuild": "./dist/rsbuild.mjs",
30-
"./stimulus": "./dist/stimulus.mjs",
31-
"./types": "./dist/types.mjs",
32-
"./vite": "./dist/vite.mjs",
28+
".": {
29+
"types": "./dist/index.d.mts",
30+
"default": "./dist/index.mjs"
31+
},
32+
"./rsbuild": {
33+
"types": "./dist/rsbuild.d.mts",
34+
"default": "./dist/rsbuild.mjs"
35+
},
36+
"./stimulus": {
37+
"types": "./dist/stimulus.d.mts",
38+
"default": "./dist/stimulus.mjs"
39+
},
40+
"./types": {
41+
"types": "./dist/types.d.mts",
42+
"default": "./dist/types.mjs"
43+
},
44+
"./vite": {
45+
"types": "./dist/vite.d.mts",
46+
"default": "./dist/vite.mjs"
47+
},
3348
"./package.json": "./package.json"
3449
},
3550
"main": "./dist/index.mjs",
3651
"module": "./dist/index.mjs",
3752
"types": "./dist/index.d.mts",
38-
"typesVersions": {
39-
"*": {
40-
"*": [
41-
"./dist/*",
42-
"./*"
43-
]
44-
}
45-
},
4653
"files": [
4754
"dist"
4855
],

0 commit comments

Comments
 (0)