-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[core] Migrate @mui/x-license-pro
to the new bundling strategy
#3738
Changes from all commits
0d0fabd
7789edf
a6ffec7
ee608a3
f92743f
a68383b
d5eaabc
b99abfc
262c77b
0e38aa4
3be34b8
6bc170b
74eb662
7ea7b7a
d4b33b4
a21c484
0ad6c9f
be7c0da
dd5e2ef
6c96aff
cfd4c8e
30823d0
c90ad6a
6b8abbb
2b4a0e0
f43fe3c
fa69aee
a204b9c
e08a964
a6a2a70
d8c5d6c
839aa59
a054c1b
eeeeedc
c7417c0
bacb7d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,19 +57,24 @@ | |
"build:codesandbox": "yarn release:build", | ||
"release:changelog": "node scripts/releaseChangelog", | ||
"release:version": "lerna version --exact --no-changelog --no-push --no-git-tag-version", | ||
"release:build": "cd packages/x-license-pro && yarn build && cd ../grid/x-data-grid-pro && yarn build && cd ../x-data-grid && yarn build && cd ../x-data-grid-generator && yarn build", | ||
"release:build": "yarn release:build:next && cd packages/grid/x-data-grid-pro && yarn build && cd ../x-data-grid && yarn build && cd ../x-data-grid-generator && yarn build", | ||
"release:build:next": "lerna run --parallel --scope \"@mui/x-license-pro\" build", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm following mui/material-ui#30201, mui/material-ui#30200 because we will probably have the same issue. |
||
"release:publish": "lerna publish from-package --dist-tag latest --contents build", | ||
"release:publish:dry-run": "lerna publish from-package --dist-tag latest --contents build --registry=\"http://localhost:4873/\"" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.16.0", | ||
"@babel/cli": "^7.16.8", | ||
"@babel/core": "^7.16.12", | ||
"@babel/node": "^7.16.8", | ||
"@babel/plugin-proposal-class-properties": "^7.16.7", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.16.7", | ||
"@babel/plugin-transform-object-assign": "^7.16.7", | ||
"@babel/plugin-transform-react-constant-elements": "^7.16.7", | ||
"@babel/plugin-transform-runtime": "^7.16.10", | ||
"@babel/preset-env": "^7.16.11", | ||
"@babel/preset-react": "^7.16.7", | ||
"@babel/preset-typescript": "^7.16.7", | ||
"@babel/register": "^7.16.9", | ||
"@babel/runtime": "^7.16.7", | ||
"@babel/traverse": "^7.16.10", | ||
"@babel/types": "^7.16.8", | ||
"@emotion/cache": "^11.7.1", | ||
|
@@ -101,10 +106,15 @@ | |
"@typescript-eslint/eslint-plugin": "^5.11.0", | ||
"@typescript-eslint/parser": "^5.11.0", | ||
"argos-cli": "^0.3.3", | ||
"babel-loader": "^8.2.3", | ||
"babel-plugin-istanbul": "^6.1.1", | ||
"babel-plugin-module-resolver": "^4.1.0", | ||
"babel-plugin-optimize-clsx": "^2.6.2", | ||
"babel-plugin-transform-react-remove-prop-types": "^0.4.24", | ||
"babel-plugin-react-remove-properties": "^0.3.0", | ||
"babel-plugin-search-and-replace": "^1.1.0", | ||
"babel-plugin-tester": "^10.1.0", | ||
"babel-plugin-transform-rename-import": "^2.3.0", | ||
"babel-plugin-transform-react-remove-prop-types": "^0.4.24", | ||
"chai": "^4.3.6", | ||
"chai-dom": "^1.11.0", | ||
"compression-webpack-plugin": "^9.2.0", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import { generateReleaseInfo } from '@mui/x-license-pro'; | ||
import replace from '@rollup/plugin-replace'; | ||
import babel from '@rollup/plugin-babel'; | ||
import typescript from 'rollup-plugin-typescript2'; | ||
import cleaner from 'rollup-plugin-cleaner'; | ||
|
@@ -32,24 +31,32 @@ export default [ | |
return new RegExp(`(${packageName}|${packageName}\\/.*)`); | ||
}), | ||
plugins: [ | ||
replace({ | ||
__RELEASE_INFO__: generateReleaseInfo(), | ||
}), | ||
production && | ||
cleaner({ | ||
targets: ['./x-data-grid-pro/build/'], | ||
}), | ||
typescript({ tsconfig: 'tsconfig.build.json' }), | ||
babel({ | ||
babelHelpers: 'bundled', | ||
extensions: ['.tsx'], | ||
extensions: ['.tsx', '.ts'], | ||
plugins: [ | ||
[ | ||
'transform-react-remove-prop-types', | ||
{ | ||
ignoreFilenames: ['DataGridPro.tsx'], | ||
}, | ||
], | ||
[ | ||
'search-and-replace', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I moved this replace to babel because once we remove rollup for |
||
{ | ||
rules: [ | ||
{ | ||
search: '__RELEASE_INFO__', | ||
replace: generateReleaseInfo(), | ||
}, | ||
], | ||
}, | ||
], | ||
], | ||
}), | ||
!production && sourceMaps(), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,30 +3,37 @@ | |
"version": "5.5.1", | ||
"description": "MUI X License verification", | ||
"author": "MUI Team", | ||
"main": "build/cjs/index.js", | ||
"main": "build/index.js", | ||
"module": "build/esm/index.js", | ||
"types": "build/x-license-pro.d.ts", | ||
"scripts": { | ||
"typescript": "tsc -p tsconfig.json", | ||
"build": "rollup -c" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/mui/mui-x.git", | ||
"directory": "packages/x-license-pro" | ||
}, | ||
"types": "build/index.d.ts", | ||
"license": "SEE LICENSE IN LICENSE.txt", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We now need a valid license field for bundling |
||
"bugs": { | ||
"url": "https://github.com/mui/mui-x/issues" | ||
}, | ||
"homepage": "https://mui.com/components/data-grid/", | ||
"license": "See LICENSE file", | ||
"sideEffects": false, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"bin": { | ||
"licensegen": "./bin/license-gen-script.js" | ||
}, | ||
"scripts": { | ||
"typescript": "tsc -p tsconfig.json", | ||
"build": "yarn build:legacy && yarn build:modern && yarn build:node && yarn build:stable && yarn build:types && yarn build:copy-files ", | ||
"build:legacy": "node ../../scripts/build legacy", | ||
"build:modern": "node ../../scripts/build modern", | ||
"build:node": "node ../../scripts/build node", | ||
"build:stable": "node ../../scripts/build stable", | ||
"build:copy-files": "node ../../scripts/copyFiles.js", | ||
"build:types": "node ../../scripts/buildTypes", | ||
"prebuild": "rimraf build tsconfig.build.tsbuildinfo" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/mui/mui-x.git", | ||
"directory": "packages/x-license-pro" | ||
}, | ||
"dependencies": { | ||
"@mui/utils": "^5.4.1", | ||
"esm": "^3.2.25", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I synced this file with the core one, minus some things (we don't have there error management for instance).
I will do some tests for the packages still on the old bundling. But I would advise against releasing a state where some package use the core bundling strategy and others don't.