Skip to content

Commit

Permalink
exports field has been added to the package.json manifests (#2308)
Browse files Browse the repository at this point in the history
* add package entry points

* Add `package.json#exports` to more packages and introduce `import-condition-proxy.mjs` where needed

Co-authored-by: Mateusz Burzyński <[email protected]>
  • Loading branch information
neurosnap and Andarist authored Aug 12, 2022
1 parent 87cfaaf commit 8207e33
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 4 deletions.
4 changes: 4 additions & 0 deletions packages/core/import-condition-proxy.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from './dist/redux-saga-core.cjs.js'
import _default from './dist/redux-saga-core.cjs.js'

export default _default.default
17 changes: 16 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,23 @@
"files": [
"dist",
"effects",
"types"
"types",
"import-condition-proxy.mjs"
],
"exports": {
"./effects": {
"types": "./types/ts3.6/effects.d.ts",
"module": "./dist/redux-saga-effects.esm.js",
"default": "./dist/redux-saga-effects.cjs.js"
},
".": {
"types": "./types/ts3.6/index.d.ts",
"module": "./dist/redux-saga-core.esm.js",
"import": "./import-condition-proxy.mjs",
"default": "./dist/redux-saga-core.cjs.js"
},
"./package.json": "./package.json"
},
"scripts": {
"test": "yarn test:types && yarn test:jest",
"test:jest": "jest",
Expand Down
4 changes: 4 additions & 0 deletions packages/deferred/import-condition-proxy.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from './dist/redux-saga-deferred.cjs.js'
import _default from './dist/redux-saga-deferred.cjs.js'

export default _default.default
12 changes: 11 additions & 1 deletion packages/deferred/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,18 @@
"typings": "./index.d.ts",
"files": [
"dist",
"*.d.ts"
"*.d.ts",
"import-condition-proxy.mjs"
],
"exports": {
".": {
"types": "./index.d.ts",
"module": "./dist/redux-saga-deferred.esm.js",
"import": "./import-condition-proxy.mjs",
"default": "./dist/redux-saga-deferred.cjs.js"
},
"./package.json": "./package.json"
},
"scripts": {
"clean": "rimraf dist",
"prebuild": "yarn clean",
Expand Down
4 changes: 4 additions & 0 deletions packages/delay-p/import-condition-proxy.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from './dist/redux-saga-delay-p.cjs.js'
import _default from './dist/redux-saga-delay-p.cjs.js'

export default _default.default
12 changes: 11 additions & 1 deletion packages/delay-p/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,18 @@
"typings": "./index.d.ts",
"files": [
"dist",
"*.d.ts"
"*.d.ts",
"import-condition-proxy.mjs"
],
"exports": {
".": {
"types": "./index.d.ts",
"module": "./dist/redux-saga-delay-p.esm.js",
"import": "./import-condition-proxy.mjs",
"default": "./dist/redux-saga-delay-p.cjs.js"
},
"./package.json": "./package.json"
},
"scripts": {
"clean": "rimraf dist",
"prebuild": "yarn clean",
Expand Down
4 changes: 4 additions & 0 deletions packages/redux-saga/import-condition-proxy.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from './dist/redux-saga-core-npm-proxy.cjs.js'
import _default from './dist/redux-saga-core-npm-proxy.cjs.js'

export default _default.default
17 changes: 16 additions & 1 deletion packages/redux-saga/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,23 @@
"files": [
"dist",
"effects",
"*.d.ts"
"*.d.ts",
"import-condition-proxy.mjs"
],
"exports": {
"./effects": {
"types": "./effects.d.ts",
"module": "./dist/redux-saga-effects-npm-proxy.esm.js",
"default": "./dist/redux-saga-effects-npm-proxy.cjs.js"
},
".": {
"types": "./index.d.ts",
"module": "./dist/redux-saga-core-npm-proxy.esm.js",
"import": "./import-condition-proxy.mjs",
"default": "./dist/redux-saga-core-npm-proxy.cjs.js"
},
"./package.json": "./package.json"
},
"scripts": {
"clean": "rimraf dist",
"prebuild": "yarn clean",
Expand Down

0 comments on commit 8207e33

Please sign in to comment.