Skip to content
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

Merged
merged 36 commits into from
Feb 14, 2022
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
0d0fabd
[core] Prepare infra for pickers migration
flaviendelangle Jan 24, 2022
7789edf
Work
flaviendelangle Jan 24, 2022
a6ffec7
Merge
flaviendelangle Jan 25, 2022
ee608a3
Merge branch 'master' into infra-pickers
flaviendelangle Jan 25, 2022
f92743f
[core] Migrate @mui/x-license-pro to the new bundling strategy
flaviendelangle Jan 25, 2022
a68383b
Work
flaviendelangle Jan 25, 2022
d5eaabc
Merge
flaviendelangle Feb 1, 2022
b99abfc
Work
flaviendelangle Feb 1, 2022
262c77b
Fix
flaviendelangle Feb 1, 2022
0e38aa4
Fix
flaviendelangle Feb 1, 2022
3be34b8
Fix
flaviendelangle Feb 1, 2022
6bc170b
Fix
flaviendelangle Feb 1, 2022
74eb662
Empty
flaviendelangle Feb 1, 2022
7ea7b7a
Merge branch 'master' into x-license-pro-bundling
flaviendelangle Feb 3, 2022
d4b33b4
work
flaviendelangle Feb 3, 2022
a21c484
Work
flaviendelangle Feb 3, 2022
0ad6c9f
Work
flaviendelangle Feb 3, 2022
be7c0da
Work
flaviendelangle Feb 3, 2022
dd5e2ef
Work
flaviendelangle Feb 3, 2022
6c96aff
Work
flaviendelangle Feb 3, 2022
cfd4c8e
Work
flaviendelangle Feb 3, 2022
30823d0
Work
flaviendelangle Feb 3, 2022
c90ad6a
Work
flaviendelangle Feb 3, 2022
6b8abbb
Work
flaviendelangle Feb 3, 2022
2b4a0e0
Work
flaviendelangle Feb 3, 2022
f43fe3c
Work
flaviendelangle Feb 3, 2022
fa69aee
Fix
flaviendelangle Feb 3, 2022
a204b9c
Work
flaviendelangle Feb 3, 2022
e08a964
Work
flaviendelangle Feb 3, 2022
a6a2a70
Work
flaviendelangle Feb 3, 2022
d8c5d6c
Work
flaviendelangle Feb 3, 2022
839aa59
Work
flaviendelangle Feb 3, 2022
a054c1b
Work
flaviendelangle Feb 7, 2022
eeeeedc
Merge branch 'master' into x-license-pro-bundling
flaviendelangle Feb 8, 2022
c7417c0
Merge branch 'master' into x-license-pro-bundling
flaviendelangle Feb 11, 2022
bacb7d8
Fix
flaviendelangle Feb 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
"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",
Copy link
Member Author

Choose a reason for hiding this comment

The 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.
But for now it's not a problem since I build the only package with the core bundling strategy before the others.

"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/\""
},
Expand Down Expand Up @@ -103,6 +104,7 @@
"argos-cli": "^0.3.3",
"babel-plugin-module-resolver": "^4.1.0",
"babel-plugin-optimize-clsx": "^2.6.2",
"babel-plugin-search-and-replace": "^1.1.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"babel-plugin-transform-rename-import": "^2.3.0",
"chai": "^4.3.6",
Expand Down
17 changes: 12 additions & 5 deletions packages/grid/rollup.x-data-grid-pro.config.js
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';
Expand Down Expand Up @@ -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',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved this replace to babel because once we remove rollup for @mui/x-data-grid-pro we won't be able to use to current plugin.

{
rules: [
{
search: '__RELEASE_INFO__',
replace: generateReleaseInfo(),
},
],
},
],
],
}),
!production && sourceMaps(),
Expand Down
File renamed without changes.
31 changes: 19 additions & 12 deletions packages/x-license-pro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,37 @@
"version": "5.4.0",
"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-org/material-ui-x.git",
"directory": "packages/x-license-pro"
},
"types": "build/index.d.ts",
"license": "SEE LICENSE IN LICENSE.txt",
Copy link
Member Author

Choose a reason for hiding this comment

The 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-org/material-ui-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-org/material-ui-x.git",
"directory": "packages/x-license-pro"
},
"dependencies": {
"@mui/utils": "^5.3.0",
"esm": "^3.2.25",
Expand Down
70 changes: 0 additions & 70 deletions packages/x-license-pro/rollup.config.js

This file was deleted.

15 changes: 10 additions & 5 deletions packages/x-license-pro/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
{
"extends": "../../tsconfig.json",
// This config is for emitting declarations (.d.ts) only
// Actual .ts source files are transpiled via babel
"extends": "./tsconfig",
"compilerOptions": {
"composite": true,
"declaration": true,
"declarationDir": "./build",
"outDir": "./build"
"noEmit": false,
"emitDeclarationOnly": true,
"outDir": "build",
"rootDir": "./src"
},
"include": ["src"],
"exclude": ["__tests__", "**/*.test.ts", "**/*.tests.ts"]
"include": ["src/**/*.ts*"],
"exclude": ["src/**/*.spec.ts*", "src/**/*.test.ts*"]
}
7 changes: 3 additions & 4 deletions packages/x-license-pro/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "../../tsconfig.json",
"extends": "../../tsconfig-core.json",
"compilerOptions": {
"noEmit": true,
"types": ["mocha", "node", "chai"]
"types": ["react", "mocha", "node"]
},
"include": ["src"]
"include": ["src/**/*"]
}
23 changes: 23 additions & 0 deletions tsconfig-core.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{ // TODO: Replace the `tsconfig.json` with this one when migrating to the new bundling structure
"extends": "@mui/monorepo/tsconfig.json",
"compilerOptions": {
// Already tested with eslint
"noUnusedLocals": false,
// TODO, turn to true
"noImplicitAny": false,
"paths": {
"@mui/x-data-grid": ["./packages/grid/x-data-grid/src"],
"@mui/x-data-grid/*": ["./packages/grid/x-data-grid/src/*"],
"@mui/x-data-grid-generator": ["./packages/grid/x-data-grid-generator/src/"],
"@mui/x-data-grid-generator/*": ["./packages/grid/x-data-grid-generator/src/*"],
"@mui/x-data-grid-pro": ["./packages/grid/x-data-grid-pro/src"],
"@mui/x-data-grid-pro/*": ["./packages/grid/x-data-grid-pro/src/*"],
"@mui/x-license-pro": ["./packages/x-license-pro/src"],
"@mui/x-license-pro/*": ["./packages/x-license-pro/src/*"],
"@mui/x-pickers": ["./packages/x-pickers/src"],
"@mui/x-pickers/*": ["./packages/x-pickers/src/*"],
"@mui/x-pickers-pro": ["./packages/x-pickers-pro/src"],
"@mui/x-pickers-pro/*": ["./packages/x-pickers-pro/src/*"]
}
},
}
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6338,6 +6338,11 @@ babel-plugin-react-remove-properties@^0.3.0:
resolved "https://registry.yarnpkg.com/babel-plugin-react-remove-properties/-/babel-plugin-react-remove-properties-0.3.0.tgz#7b623fb3c424b6efb4edc9b1ae4cc50e7154b87f"
integrity sha512-vbxegtXGyVcUkCvayLzftU95vuvpYFV85pRpeMpohMHeEY46Qe0VNWfkVVcCbaZ12CXHzDFOj0esumATcW83ng==

babel-plugin-search-and-replace@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/babel-plugin-search-and-replace/-/babel-plugin-search-and-replace-1.1.0.tgz#ad26f2037a80034613dae61b913902d9aa58ed2c"
integrity sha512-qo3E08GmT43/IgfbEiAZoauYW3SILLTyt79QPZc2ME3sHvuBuRA01nQl7WnJRKZTnqUCimXSMOU+LBHxe+HTUw==

"babel-plugin-styled-components@>= 1.12.0":
version "1.13.2"
resolved "https://registry.yarnpkg.com/babel-plugin-styled-components/-/babel-plugin-styled-components-1.13.2.tgz#ebe0e6deff51d7f93fceda1819e9b96aeb88278d"
Expand Down