Skip to content

Commit

Permalink
build: build modern js dist (#57)
Browse files Browse the repository at this point in the history
* build: build modern js

* chore: update modern-js

* style: use prettier as default formatter

* chore: changeset
  • Loading branch information
xuchaobei authored Jul 26, 2022
1 parent 30b1167 commit ed80d6e
Show file tree
Hide file tree
Showing 21 changed files with 84 additions and 42 deletions.
12 changes: 12 additions & 0 deletions .changeset/pink-pianos-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@modern-js-reduck/plugin-auto-actions': patch
'@modern-js-reduck/plugin-devtools': patch
'@modern-js-reduck/plugin-effects': patch
'@modern-js-reduck/plugin-immutable': patch
'@modern-js-reduck/plugin-xstate': patch
'@modern-js-reduck/plugin-xstate-immer': patch
'@modern-js-reduck/react': patch
'@modern-js-reduck/store': patch
---

build: build modern js dist
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"trailingComma": "all",
"arrowParens": "avoid"
}
9 changes: 3 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,13 @@
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[vue]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"eslint.alwaysShowStatus": true,
// "eslint.nodePath": "./node_modules",
Expand Down
20 changes: 20 additions & 0 deletions common/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
tools: {
babel: config => {
const { presets } = config;
for (const preset of presets) {
if (preset[0].includes('@babel/preset-env')) {
preset[1] = {
targets: {
esmodules: true,
},
// Use the equivalent of `babel-preset-modules`
bugfixes: true,
modules: false,
loose: true,
};
}
}
},
},
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
"devDependencies": {
"@commitlint/cli": "^17.0.0",
"@commitlint/config-conventional": "^17.0.0",
"@modern-js/monorepo-tools": "^1.4.6",
"@modern-js/plugin-jarvis": "^1.2.12",
"@modern-js/monorepo-tools": "^1.5.0",
"@modern-js/plugin-jarvis": "^1.2.14",
"@modern-js/tsconfig": "^1.2.0",
"husky": "^8.0.0",
"webpack": "^5.54.0"
Expand Down
5 changes: 3 additions & 2 deletions packages/plugins/auto-actions/modern.config.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/** @type {import('@modern-js/module-tools').UserConfig} */
module.exports = {};
const config = require('../../../common/config');

module.exports = config;
4 changes: 2 additions & 2 deletions packages/plugins/auto-actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
},
"devDependencies": {
"@modern-js-reduck/store": "^1.0.1",
"@modern-js/module-tools": "^1.5.3",
"@modern-js/plugin-testing": "^1.5.5",
"@modern-js/module-tools": "^1.7.1",
"@modern-js/plugin-testing": "^1.6.0",
"@types/jest": "^27.5.1",
"@types/node": "^14",
"@types/react": "^17",
Expand Down
5 changes: 3 additions & 2 deletions packages/plugins/devtools/modern.config.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/** @type {import('@modern-js/module-tools').UserConfig} */
module.exports = {};
const config = require('../../../common/config');

module.exports = config;
4 changes: 2 additions & 2 deletions packages/plugins/devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
},
"devDependencies": {
"@modern-js-reduck/store": "^1.0.4",
"@modern-js/module-tools": "^1.5.3",
"@modern-js/plugin-testing": "^1.5.5",
"@modern-js/module-tools": "^1.7.1",
"@modern-js/plugin-testing": "^1.6.0",
"@types/jest": "^27.5.1",
"@types/node": "^14",
"@types/react": "^17",
Expand Down
5 changes: 3 additions & 2 deletions packages/plugins/effects/modern.config.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/** @type {import('@modern-js/module-tools').UserConfig} */
module.exports = {};
const config = require('../../../common/config');

module.exports = config;
4 changes: 2 additions & 2 deletions packages/plugins/effects/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
},
"devDependencies": {
"@modern-js-reduck/store": "^1.0.1",
"@modern-js/module-tools": "^1.5.3",
"@modern-js/plugin-testing": "^1.5.5",
"@modern-js/module-tools": "^1.7.1",
"@modern-js/plugin-testing": "^1.6.0",
"@types/jest": "^27.5.1",
"@types/node": "^14",
"@types/react": "^17",
Expand Down
5 changes: 3 additions & 2 deletions packages/plugins/immer/modern.config.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/** @type {import('@modern-js/module-tools').UserConfig} */
module.exports = {};
const config = require('../../../common/config');

module.exports = config;
4 changes: 2 additions & 2 deletions packages/plugins/immer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
},
"devDependencies": {
"@modern-js-reduck/store": "^1.0.1",
"@modern-js/module-tools": "^1.5.3",
"@modern-js/plugin-testing": "^1.5.5",
"@modern-js/module-tools": "^1.7.1",
"@modern-js/plugin-testing": "^1.6.0",
"@types/jest": "^27.5.1",
"@types/node": "^14",
"@types/react": "^17",
Expand Down
5 changes: 3 additions & 2 deletions packages/plugins/xstate-immer/modern.config.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/** @type {import('@modern-js/module-tools').UserConfig} */
module.exports = {};
const config = require('../../../common/config');

module.exports = config;
4 changes: 2 additions & 2 deletions packages/plugins/xstate-immer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"@modern-js-reduck/plugin-xstate": "^1.0.1",
"@modern-js-reduck/react": "^1.0.1",
"@modern-js-reduck/store": "^1.0.1",
"@modern-js/module-tools": "^1.5.3",
"@modern-js/plugin-testing": "^1.5.5",
"@modern-js/module-tools": "^1.7.1",
"@modern-js/plugin-testing": "^1.6.0",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.0.0",
"@types/jest": "^27.5.1",
Expand Down
5 changes: 3 additions & 2 deletions packages/plugins/xstate/modern.config.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/** @type {import('@modern-js/module-tools').UserConfig} */
module.exports = {};
const config = require('../../../common/config');

module.exports = config;
4 changes: 2 additions & 2 deletions packages/plugins/xstate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"devDependencies": {
"@modern-js-reduck/react": "^1.0.1",
"@modern-js-reduck/store": "^1.0.4",
"@modern-js/module-tools": "^1.5.3",
"@modern-js/plugin-testing": "^1.5.5",
"@modern-js/module-tools": "^1.7.1",
"@modern-js/plugin-testing": "^1.6.0",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.0.0",
"@types/jest": "^27.5.1",
Expand Down
5 changes: 3 additions & 2 deletions packages/react/modern.config.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/** @type {import('@modern-js/module-tools').UserConfig} */
module.exports = {};
const config = require('../../common/config');

module.exports = config;
6 changes: 3 additions & 3 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@
"invariant": "^2.2.4"
},
"devDependencies": {
"create-react-class": "15.7.0",
"@modern-js/module-tools": "^1.5.3",
"@modern-js/plugin-testing": "^1.5.5",
"@modern-js/module-tools": "^1.7.1",
"@modern-js/plugin-testing": "^1.6.0",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.0.0",
"@types/invariant": "^2.2.34",
Expand All @@ -52,6 +51,7 @@
"@types/react": "^17",
"@types/react-dom": "^17",
"@types/testing-library__jest-dom": "^5.14.1",
"create-react-class": "15.7.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"redux": "^4.1.1",
Expand Down
5 changes: 3 additions & 2 deletions packages/store/modern.config.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/** @type {import('@modern-js/module-tools').UserConfig} */
module.exports = {};
const config = require('../../common/config');

module.exports = config;
6 changes: 3 additions & 3 deletions packages/store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
"redux": "^4.1.1"
},
"devDependencies": {
"@modern-js/module-tools": "^1.5.3",
"@modern-js/plugin-testing": "^1.5.5",
"@modern-js/runtime": "^1.3.0",
"@modern-js/module-tools": "^1.7.1",
"@modern-js/plugin-testing": "^1.6.0",
"@modern-js/runtime": "^1.3.5",
"@types/jest": "^27.5.1",
"@types/node": "^14",
"@types/react": "^17",
Expand Down

0 comments on commit ed80d6e

Please sign in to comment.