Skip to content

Commit

Permalink
Migration Babel to ESBuild (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssi02014 authored Apr 21, 2024
1 parent 81b60b7 commit 4bd0e00
Show file tree
Hide file tree
Showing 17 changed files with 659 additions and 599 deletions.
6 changes: 6 additions & 0 deletions .changeset/wise-hats-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@modern-kit/react': minor
'@modern-kit/utils': minor
---

Migration Babel to ESBuild
1,109 changes: 585 additions & 524 deletions .pnp.cjs

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ yarn typecheck
- Node v20
- React, TypeScript
- Vitest, React-Testing-Library
- Rollup, Babel
- Rollup, ESBuild
- Yarn Berry(v4) & Workspaces
- Lerna (for Versioning & Publishing)
- docusaurus (documentation)
Expand Down
10 changes: 0 additions & 10 deletions babel.config.js

This file was deleted.

6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,20 @@
},
"homepage": "https://github.com/modern-agile-team/modern-kit",
"devDependencies": {
"@babel/core": "^7.22.10",
"@babel/preset-env": "^7.22.10",
"@babel/preset-react": "^7.22.5",
"@babel/preset-typescript": "^7.22.5",
"@changesets/cli": "^2.27.1",
"@types/node": "^20.5.0",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"esbuild": "^0.20.2",
"eslint": "^8.47.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
"lerna": "^8.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rollup-plugin-esbuild": "^6.1.1",
"ts-node": "^10.9.1",
"tslib": "^2.6.1",
"typescript": "^5.1.6"
Expand Down
3 changes: 0 additions & 3 deletions packages/react/babel.config.js

This file was deleted.

4 changes: 2 additions & 2 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
"author": "ssi02014 <ssi02014@naver.com>",
"license": "MIT",
"devDependencies": {
"@babel/core": "^7.22.10",
"@modern-kit/utils": "workspace:*",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-commonjs": "^25.0.4",
"@rollup/plugin-node-resolve": "^15.1.0",
"@rollup/plugin-terser": "^0.4.3",
Expand All @@ -42,12 +40,14 @@
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
"core-js": "^3.32.0",
"esbuild": "^0.20.2",
"jsdom": "^24.0.0",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rollup": "^4.14.3",
"rollup-plugin-esbuild": "^6.1.1",
"rollup-plugin-peer-deps-external": "^2.2.4",
"tslib": "^2.6.1",
"typescript": "^5.1.6",
Expand Down
8 changes: 2 additions & 6 deletions packages/react/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import nodeResolve from '@rollup/plugin-node-resolve';
import babel from '@rollup/plugin-babel';
import terser from '@rollup/plugin-terser';
import typescript from '@rollup/plugin-typescript';
import commonjs from '@rollup/plugin-commonjs';
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
import pkg from './package.json' assert { type: 'json' };
import esbuild from 'rollup-plugin-esbuild';

const extensions = ['.js', '.jsx', '.ts', '.tsx'];

Expand All @@ -29,11 +29,7 @@ export default {
extensions,
}),
commonjs(),
babel({
exclude: /node_modules/,
extensions,
include: ['src/**/*'],
}),
esbuild(),
typescript({
tsconfig: './tsconfig.json',
exclude: ['**/*.spec.tsx'],
Expand Down
1 change: 0 additions & 1 deletion packages/utils/babel.config.js

This file was deleted.

4 changes: 2 additions & 2 deletions packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@
"access": "public"
},
"devDependencies": {
"@babel/core": "^7.22.10",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-commonjs": "^25.0.4",
"@rollup/plugin-node-resolve": "^15.1.0",
"@rollup/plugin-terser": "^0.4.3",
"@rollup/plugin-typescript": "^11.1.2",
"core-js": "^3.32.0",
"esbuild": "^0.20.2",
"jsdom": "^24.0.0",
"rollup": "^4.14.3",
"rollup-plugin-esbuild": "^6.1.1",
"tslib": "^2.6.2",
"typescript": "^5.1.6",
"vitest": "^1.5.0"
Expand Down
8 changes: 2 additions & 6 deletions packages/utils/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import nodeResolve from '@rollup/plugin-node-resolve';
import babel from '@rollup/plugin-babel';
import terser from '@rollup/plugin-terser';
import typescript from '@rollup/plugin-typescript';
import commonjs from '@rollup/plugin-commonjs';
import pkg from './package.json' assert { type: 'json' };
import esbuild from 'rollup-plugin-esbuild';

const extensions = ['.js', '.jsx', '.ts', '.tsx'];

Expand All @@ -26,11 +26,7 @@ export default {
extensions,
}),
commonjs(),
babel({
exclude: /node_modules/,
extensions,
include: ['src/**/*'],
}),
esbuild(),
typescript({ tsconfig: './tsconfig.json', exclude: ['**/*.spec.ts'] }),
terser(),
],
Expand Down
97 changes: 57 additions & 40 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ __metadata:
languageName: node
linkType: hard

"@babel/core@npm:^7.22.10, @babel/core@npm:^7.22.9":
"@babel/core@npm:^7.22.9":
version: 7.22.10
resolution: "@babel/core@npm:7.22.10"
dependencies:
Expand Down Expand Up @@ -542,15 +542,6 @@ __metadata:
languageName: node
linkType: hard

"@babel/helper-module-imports@npm:^7.18.6, @babel/helper-module-imports@npm:^7.22.5":
version: 7.22.5
resolution: "@babel/helper-module-imports@npm:7.22.5"
dependencies:
"@babel/types": "npm:^7.22.5"
checksum: 04f8c0586c485c33017c63e0fc5fc16bd33b883cef3c88e4b3a8bf7bc807b3f9a7bcb9372fbcc01c0a539a5d1cdb477e7bdec77e250669edab00f796683b6b07
languageName: node
linkType: hard

"@babel/helper-module-imports@npm:^7.22.15":
version: 7.22.15
resolution: "@babel/helper-module-imports@npm:7.22.15"
Expand All @@ -560,6 +551,15 @@ __metadata:
languageName: node
linkType: hard

"@babel/helper-module-imports@npm:^7.22.5":
version: 7.22.5
resolution: "@babel/helper-module-imports@npm:7.22.5"
dependencies:
"@babel/types": "npm:^7.22.5"
checksum: 04f8c0586c485c33017c63e0fc5fc16bd33b883cef3c88e4b3a8bf7bc807b3f9a7bcb9372fbcc01c0a539a5d1cdb477e7bdec77e250669edab00f796683b6b07
languageName: node
linkType: hard

"@babel/helper-module-transforms@npm:^7.22.5, @babel/helper-module-transforms@npm:^7.22.9":
version: 7.22.9
resolution: "@babel/helper-module-transforms@npm:7.22.9"
Expand Down Expand Up @@ -2551,7 +2551,7 @@ __metadata:
languageName: node
linkType: hard

"@babel/preset-env@npm:^7.22.10, @babel/preset-env@npm:^7.22.9":
"@babel/preset-env@npm:^7.22.9":
version: 7.22.10
resolution: "@babel/preset-env@npm:7.22.10"
dependencies:
Expand Down Expand Up @@ -4170,9 +4170,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@modern-kit/react@workspace:packages/react"
dependencies:
"@babel/core": "npm:^7.22.10"
"@modern-kit/utils": "workspace:*"
"@rollup/plugin-babel": "npm:^6.0.3"
"@rollup/plugin-commonjs": "npm:^25.0.4"
"@rollup/plugin-node-resolve": "npm:^15.1.0"
"@rollup/plugin-terser": "npm:^0.4.3"
Expand All @@ -4186,12 +4184,14 @@ __metadata:
"@types/react": "npm:^18.2.20"
"@types/react-dom": "npm:^18.2.7"
core-js: "npm:^3.32.0"
esbuild: "npm:^0.20.2"
jsdom: "npm:^24.0.0"
lodash: "npm:^4.17.21"
lodash-es: "npm:^4.17.21"
react: "npm:^18.2.0"
react-dom: "npm:^18.2.0"
rollup: "npm:^4.14.3"
rollup-plugin-esbuild: "npm:^6.1.1"
rollup-plugin-peer-deps-external: "npm:^2.2.4"
tslib: "npm:^2.6.1"
typescript: "npm:^5.1.6"
Expand All @@ -4206,15 +4206,15 @@ __metadata:
version: 0.0.0-use.local
resolution: "@modern-kit/utils@workspace:packages/utils"
dependencies:
"@babel/core": "npm:^7.22.10"
"@rollup/plugin-babel": "npm:^6.0.3"
"@rollup/plugin-commonjs": "npm:^25.0.4"
"@rollup/plugin-node-resolve": "npm:^15.1.0"
"@rollup/plugin-terser": "npm:^0.4.3"
"@rollup/plugin-typescript": "npm:^11.1.2"
core-js: "npm:^3.32.0"
esbuild: "npm:^0.20.2"
jsdom: "npm:^24.0.0"
rollup: "npm:^4.14.3"
rollup-plugin-esbuild: "npm:^6.1.1"
tslib: "npm:^2.6.2"
typescript: "npm:^5.1.6"
vitest: "npm:^1.5.0"
Expand Down Expand Up @@ -4642,25 +4642,6 @@ __metadata:
languageName: node
linkType: hard

"@rollup/plugin-babel@npm:^6.0.3":
version: 6.0.4
resolution: "@rollup/plugin-babel@npm:6.0.4"
dependencies:
"@babel/helper-module-imports": "npm:^7.18.6"
"@rollup/pluginutils": "npm:^5.0.1"
peerDependencies:
"@babel/core": ^7.0.0
"@types/babel__core": ^7.1.9
rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0
peerDependenciesMeta:
"@types/babel__core":
optional: true
rollup:
optional: true
checksum: 5a7c04fa6d608512b597835e749aef33e129ee9ed6cc9e33489b7d43937358fc8aba48b00819604d0bc9b7c20790a6c035e4136e8d9f70cf0d0f056ba547e700
languageName: node
linkType: hard

"@rollup/plugin-commonjs@npm:^25.0.4":
version: 25.0.4
resolution: "@rollup/plugin-commonjs@npm:25.0.4"
Expand Down Expand Up @@ -4750,7 +4731,7 @@ __metadata:
languageName: node
linkType: hard

"@rollup/pluginutils@npm:^5.1.0":
"@rollup/pluginutils@npm:^5.0.5, @rollup/pluginutils@npm:^5.1.0":
version: 5.1.0
resolution: "@rollup/pluginutils@npm:5.1.0"
dependencies:
Expand Down Expand Up @@ -9557,6 +9538,13 @@ __metadata:
languageName: node
linkType: hard

"es-module-lexer@npm:^1.3.1":
version: 1.5.0
resolution: "es-module-lexer@npm:1.5.0"
checksum: d199853404f3381801eb102befb84a8fc48f93ed86b852c2461c2c4ad4bbbc91128f3d974ff9b8718628260ae3f36e661295ab3e419222868aa31269284e34c9
languageName: node
linkType: hard

"es-object-atoms@npm:^1.0.0":
version: 1.0.0
resolution: "es-object-atoms@npm:1.0.0"
Expand Down Expand Up @@ -9597,7 +9585,7 @@ __metadata:
languageName: node
linkType: hard

"esbuild@npm:^0.20.1":
"esbuild@npm:^0.20.1, esbuild@npm:^0.20.2":
version: 0.20.2
resolution: "esbuild@npm:0.20.2"
dependencies:
Expand Down Expand Up @@ -10846,6 +10834,15 @@ __metadata:
languageName: node
linkType: hard

"get-tsconfig@npm:^4.7.2":
version: 4.7.3
resolution: "get-tsconfig@npm:4.7.3"
dependencies:
resolve-pkg-maps: "npm:^1.0.0"
checksum: b15ca9d5d0887ebfccadc9fe88b6ff3827a5691ec90e7608a5e9c74bef959c14aba62f6bb88ac7f50322395731789a2cf654244f00e10f4f76349911b6846d6f
languageName: node
linkType: hard

"gh-pages@npm:^6.0.0":
version: 6.1.0
resolution: "gh-pages@npm:6.1.0"
Expand Down Expand Up @@ -14787,22 +14784,20 @@ __metadata:
version: 0.0.0-use.local
resolution: "modern-kit@workspace:."
dependencies:
"@babel/core": "npm:^7.22.10"
"@babel/preset-env": "npm:^7.22.10"
"@babel/preset-react": "npm:^7.22.5"
"@babel/preset-typescript": "npm:^7.22.5"
"@changesets/cli": "npm:^2.27.1"
"@types/node": "npm:^20.5.0"
"@types/react": "npm:^18.2.20"
"@types/react-dom": "npm:^18.2.7"
"@typescript-eslint/eslint-plugin": "npm:^6.0.0"
"@typescript-eslint/parser": "npm:^6.0.0"
esbuild: "npm:^0.20.2"
eslint: "npm:^8.47.0"
eslint-plugin-react-hooks: "npm:^4.6.0"
eslint-plugin-react-refresh: "npm:^0.4.3"
lerna: "npm:^8.0.2"
react: "npm:^18.2.0"
react-dom: "npm:^18.2.0"
rollup-plugin-esbuild: "npm:^6.1.1"
ts-node: "npm:^10.9.1"
tslib: "npm:^2.6.1"
typescript: "npm:^5.1.6"
Expand Down Expand Up @@ -17710,6 +17705,13 @@ __metadata:
languageName: node
linkType: hard

"resolve-pkg-maps@npm:^1.0.0":
version: 1.0.0
resolution: "resolve-pkg-maps@npm:1.0.0"
checksum: fb8f7bbe2ca281a73b7ef423a1cbc786fb244bd7a95cbe5c3fba25b27d327150beca8ba02f622baea65919a57e061eb5005204daa5f93ed590d9b77463a567ab
languageName: node
linkType: hard

"resolve@npm:^1.1.6":
version: 1.22.8
resolution: "resolve@npm:1.22.8"
Expand Down Expand Up @@ -17824,6 +17826,21 @@ __metadata:
languageName: node
linkType: hard

"rollup-plugin-esbuild@npm:^6.1.1":
version: 6.1.1
resolution: "rollup-plugin-esbuild@npm:6.1.1"
dependencies:
"@rollup/pluginutils": "npm:^5.0.5"
debug: "npm:^4.3.4"
es-module-lexer: "npm:^1.3.1"
get-tsconfig: "npm:^4.7.2"
peerDependencies:
esbuild: ">=0.18.0"
rollup: ^1.20.0 || ^2.0.0 || ^3.0.0 || ^4.0.0
checksum: 1d5610a54ea4ffc4721d4f6beed8931cb2188313ab464480605b8bc7eb24be63eadf5eb706c8af2ed930f93c210b66190f482311642f5f3c5ad801c63d80f755
languageName: node
linkType: hard

"rollup-plugin-peer-deps-external@npm:^2.2.4":
version: 2.2.4
resolution: "rollup-plugin-peer-deps-external@npm:2.2.4"
Expand Down

0 comments on commit 4bd0e00

Please sign in to comment.