Skip to content

Commit

Permalink
[v5]: drop "module" condition (#2270)
Browse files Browse the repository at this point in the history
* Update package json in order to remove module

* Update rollup config in order to remove module config

* Update patch esm script
  • Loading branch information
dbritto-dev authored Dec 22, 2023
1 parent 4ffdb19 commit f910d1c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 34 deletions.
34 changes: 1 addition & 33 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
"types": "./esm/index.d.mts",
"default": "./esm/index.mjs"
},
"module": {
"types": "./esm/index.d.ts",
"default": "./esm/index.js"
},
"default": {
"types": "./index.d.ts",
"default": "./index.js"
Expand All @@ -47,10 +43,6 @@
"types": "./esm/vanilla.d.mts",
"default": "./esm/vanilla.mjs"
},
"module": {
"types": "./esm/vanilla.d.ts",
"default": "./esm/vanilla.js"
},
"default": {
"types": "./vanilla.d.ts",
"default": "./vanilla.js"
Expand All @@ -61,10 +53,6 @@
"types": "./esm/middleware.d.mts",
"default": "./esm/middleware.mjs"
},
"module": {
"types": "./esm/middleware.d.ts",
"default": "./esm/middleware.js"
},
"default": {
"types": "./middleware.d.ts",
"default": "./middleware.js"
Expand All @@ -75,10 +63,6 @@
"types": "./esm/middleware/immer.d.mts",
"default": "./esm/middleware/immer.mjs"
},
"module": {
"types": "./esm/middleware/immer.d.ts",
"default": "./esm/middleware/immer.js"
},
"default": {
"types": "./middleware/immer.d.ts",
"default": "./middleware/immer.js"
Expand All @@ -89,10 +73,6 @@
"types": "./esm/shallow.d.mts",
"default": "./esm/shallow.mjs"
},
"module": {
"types": "./esm/shallow.d.ts",
"default": "./esm/shallow.js"
},
"default": {
"types": "./shallow.d.ts",
"default": "./shallow.js"
Expand All @@ -103,10 +83,6 @@
"types": "./esm/vanilla/shallow.d.mts",
"default": "./esm/vanilla/shallow.mjs"
},
"module": {
"types": "./esm/vanilla/shallow.d.ts",
"default": "./esm/vanilla/shallow.js"
},
"default": {
"types": "./vanilla/shallow.d.ts",
"default": "./vanilla/shallow.js"
Expand All @@ -117,10 +93,6 @@
"types": "./esm/react/shallow.d.mts",
"default": "./esm/react/shallow.mjs"
},
"module": {
"types": "./esm/react/shallow.d.ts",
"default": "./esm/react/shallow.js"
},
"default": {
"types": "./react/shallow.d.ts",
"default": "./react/shallow.js"
Expand All @@ -131,10 +103,6 @@
"types": "./esm/traditional.d.mts",
"default": "./esm/traditional.mjs"
},
"module": {
"types": "./esm/traditional.d.ts",
"default": "./esm/traditional.js"
},
"default": {
"types": "./traditional.d.ts",
"default": "./traditional.js"
Expand Down Expand Up @@ -167,7 +135,7 @@
"patch-d-ts": "node -e \"var {entries}=require('./rollup.config.js');require('shelljs').find('dist/**/*.d.ts').forEach(f=>{entries.forEach(({find,replacement})=>require('shelljs').sed('-i',new RegExp(' from \\''+find.source.slice(0,-1)+'\\';$'),' from \\''+replacement+'\\';',f));require('shelljs').sed('-i',/ from '(\\.[^']+)\\.ts';$/,' from \\'\\$1\\';',f)})\"",
"copy": "shx cp -r dist/src/* dist/esm && shx cp -r dist/src/* dist && shx rm -rf dist/src && shx rm -rf dist/{src,tests} && shx cp package.json readme.md LICENSE dist && json -I -f dist/package.json -e \"this.private=false; this.devDependencies=undefined; this.optionalDependencies=undefined; this.scripts=undefined; this.prettier=undefined;\"",
"patch-old-ts": "shx touch dist/ts_version_4.5_and_above_is_required.d.ts",
"patch-esm-ts": "node -e \"require('shelljs').find('dist/esm/**/*.d.ts').forEach(f=>{var f2=f.replace(/\\.ts$/,'.mts');require('fs').copyFileSync(f,f2);require('shelljs').sed('-i',/ from '(\\.[^']+)';$/,' from \\'\\$1.mjs\\';',f2);require('shelljs').sed('-i',/^declare module '(\\.[^']+)'/,'declare module \\'\\$1.mjs\\'',f2)})\""
"patch-esm-ts": "node -e \"require('shelljs').find('dist/esm/**/*.d.ts').forEach(f=>{var f2=f.replace(/\\.ts$/,'.mts');require('fs').renameSync(f,f2);require('shelljs').sed('-i',/ from '(\\.[^']+)';$/,' from \\'\\$1.mjs\\';',f2);require('shelljs').sed('-i',/^declare module '(\\.[^']+)'/,'declare module \\'\\$1.mjs\\'',f2)})\""
},
"engines": {
"node": ">=12.7.0"
Expand Down
1 change: 0 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ module.exports = function (args) {
return [
...(c === 'index' ? [createDeclarationConfig(`src/${c}.ts`, 'dist')] : []),
createCommonJSConfig(`src/${c}.ts`, `dist/${c}`),
createESMConfig(`src/${c}.ts`, `dist/esm/${c}.js`),
createESMConfig(`src/${c}.ts`, `dist/esm/${c}.mjs`),
createUMDConfig(`src/${c}.ts`, `dist/umd/${c}`, 'development'),
createUMDConfig(`src/${c}.ts`, `dist/umd/${c}`, 'production'),
Expand Down

0 comments on commit f910d1c

Please sign in to comment.