Skip to content

Commit

Permalink
[Tree View] Create pro package (#12240)
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviendelangle committed Mar 29, 2024
1 parent 96d2b5b commit 7a3a889
Show file tree
Hide file tree
Showing 27 changed files with 184 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .codesandbox/ci.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"@mui/x-date-pickers": "packages/x-date-pickers/build",
"@mui/x-date-pickers-pro": "packages/x-date-pickers-pro/build",
"@mui/x-charts": "packages/x-charts/build",
"@mui/x-tree-view": "packages/x-tree-view/build"
"@mui/x-tree-view": "packages/x-tree-view/build",
"@mui/x-tree-view-pro": "packages/x-tree-view-pro/build"
},
"sandboxes": ["/bug-reproductions/x-data-grid"],
"silent": true
Expand Down
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ module.exports = {
buildPackageRestrictedImports('@mui/x-data-grid-generator', 'x-data-grid-generator'),
buildPackageRestrictedImports('@mui/x-pickers', 'x-pickers'),
buildPackageRestrictedImports('@mui/x-pickers-pro', 'x-pickers-pro'),
buildPackageRestrictedImports('@mui/x-tree-view', 'x-tree-view'),
buildPackageRestrictedImports('@mui/x-tree-view-pro', 'x-tree-view-pro'),
buildPackageRestrictedImports('@mui/x-license', 'x-license'),
],
};
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const defaultAlias = {
'@mui/x-date-pickers-pro': resolveAliasPath('./packages/x-date-pickers-pro/src'),
'@mui/x-charts': resolveAliasPath('./packages/x-charts/src'),
'@mui/x-tree-view': resolveAliasPath('./packages/x-tree-view/src'),
'@mui/x-tree-view-pro': resolveAliasPath('./packages/x-tree-view-pro/src'),
'@mui/material-nextjs': '@mui/monorepo/packages/mui-material-nextjs/src',
'@mui-internal/api-docs-builder': resolveAliasPath(
'./node_modules/@mui/monorepo/packages/api-docs-builder',
Expand Down
1 change: 1 addition & 0 deletions docs/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const alias = {
'@mui/x-date-pickers-pro': '../packages/x-date-pickers-pro/src',
'@mui/x-charts': '../packages/x-charts/src',
'@mui/x-tree-view': '../packages/x-tree-view/src',
'@mui/x-tree-view-pro': '../packages/x-tree-view-pro/src',
'@mui/x-license': '../packages/x-license/src',
'@mui/docs': '../node_modules/@mui/monorepo/packages/mui-docs/src',
'@mui/monorepo': '../node_modules/@mui/monorepo',
Expand Down
22 changes: 21 additions & 1 deletion docs/scripts/createXTypeScriptProjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export type XProjectNames =
| 'x-date-pickers'
| 'x-date-pickers-pro'
| 'x-charts'
| 'x-tree-view';
| 'x-tree-view'
| 'x-tree-view-pro';

export type XTypeScriptProjects = Map<XProjectNames, XTypeScriptProject>;

Expand Down Expand Up @@ -264,5 +265,24 @@ export const createXTypeScriptProjects = () => {
}),
);

// TODO x-tree-view-pro uncomment when making the package public
// projects.set(
// 'x-tree-view-pro',
// createXTypeScriptProject({
// name: 'x-tree-view-pro',
// rootPath: path.join(workspaceRoot, 'packages/x-tree-view-pro'),
// entryPointPath: 'src/index.ts',
// documentationFolderName: 'tree-view',
// getComponentsWithPropTypes: getComponentPaths({
// folders: ['src'],
// includeUnstableComponents: true,
// }),
// getComponentsWithApiDoc: getComponentPaths({
// folders: ['src'],
// includeUnstableComponents: true,
// }),
// }),
// );

return projects;
};
2 changes: 1 addition & 1 deletion packages/x-charts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@mui/x-charts",
"version": "7.1.0",
"description": "The community edition of the charts components (MUI X).",
"description": "The community edition of the Charts components (MUI X).",
"author": "MUI Team",
"main": "./src/index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/x-data-grid-premium/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MUI X Data Grid Premium

This package is the Premium plan edition of the data grid component.
This package is the Premium plan edition of the Data Grid components.
It's part of [MUI X](https://mui.com/x/), an open-core extension of MUI Core, with advanced components.

## Installation
Expand Down
2 changes: 1 addition & 1 deletion packages/x-data-grid-premium/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@mui/x-data-grid-premium",
"version": "7.1.0",
"description": "The Premium plan edition of the data grid component (MUI X).",
"description": "The Premium plan edition of the Data Grid Components (MUI X).",
"author": "MUI Team",
"main": "src/index.ts",
"license": "SEE LICENSE IN LICENSE",
Expand Down
2 changes: 1 addition & 1 deletion packages/x-data-grid-pro/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MUI X Data Grid Pro

This package is the Pro plan edition of the data grid component.
This package is the Pro plan edition of the Data Grid component.
It's part of [MUI X](https://mui.com/x/), an open-core extension of MUI Core, with advanced components.

## Installation
Expand Down
2 changes: 1 addition & 1 deletion packages/x-data-grid-pro/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@mui/x-data-grid-pro",
"version": "7.1.0",
"description": "The Pro plan edition of the data grid component (MUI X).",
"description": "The Pro plan edition of the Data Grid components (MUI X).",
"author": "MUI Team",
"main": "src/index.ts",
"license": "SEE LICENSE IN LICENSE",
Expand Down
2 changes: 1 addition & 1 deletion packages/x-data-grid/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MUI X Data Grid

This package is the Community plan edition of the data grid component.
This package is the Community plan edition of the Data Grid components.
It's part of [MUI X](https://mui.com/x/), an open-core extension of MUI Core, with advanced components.

## Installation
Expand Down
2 changes: 1 addition & 1 deletion packages/x-data-grid/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@mui/x-data-grid",
"version": "7.1.0",
"description": "The community edition of the data grid component (MUI X).",
"description": "The Community plan edition of the Data Grid components (MUI X).",
"author": "MUI Team",
"main": "src/index.ts",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/x-date-pickers-pro/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MUI X Date Pickers Pro

This package is the commercial edition of the date and time picker components.
This package is the Pro plan edition of the Date and Time Picker Components.
It's part of [MUI X](https://mui.com/x/), an open-core extension of MUI Core, with advanced components.

## Installation
Expand Down
2 changes: 1 addition & 1 deletion packages/x-date-pickers-pro/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@mui/x-date-pickers-pro",
"version": "7.1.0",
"description": "The commercial edition of the date picker components (MUI X).",
"description": "The Pro plan edition of the Date and Time Picker components (MUI X).",
"author": "MUI Team",
"main": "src/index.ts",
"license": "SEE LICENSE IN LICENSE",
Expand Down
2 changes: 1 addition & 1 deletion packages/x-date-pickers/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MUI X Date Pickers

This package is the community edition of the date and time picker components.
This package is the Community plan edition of the Date and Time Picker components.
It's part of [MUI X](https://mui.com/x/), an open-core extension of MUI Core, with advanced components.

## Installation
Expand Down
2 changes: 1 addition & 1 deletion packages/x-date-pickers/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@mui/x-date-pickers",
"version": "7.1.0",
"description": "The community edition of the date picker components (MUI X).",
"description": "The community edition of the Date and Time Picker components (MUI X).",
"author": "MUI Team",
"main": "src/index.ts",
"license": "MIT",
Expand Down
11 changes: 11 additions & 0 deletions packages/x-tree-view-pro/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Commercial License

Copyright (c) 2020 Material-UI SAS

MUI X Pro (https://mui.com/pricing/) is commercial software. You MUST agree to the
End User License Agreement (EULA: https://mui.com/r/x-license-eula) to be able to
use the software.

This means that you either need to purchase a commercial license at
https://mui.com/r/x-get-license?scope=pro or be eligible for the Evaluation (trial)
licenses detailed at https://mui.com/r/x-license-trial.
26 changes: 26 additions & 0 deletions packages/x-tree-view-pro/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# MUI X Tree View

This package is the Pro plan edition of the Tree View components.
It's part of [MUI X](https://mui.com/x/), an open-core extension of MUI Core, with advanced components.

## Installation

Install the package in your project directory with:

```bash
npm install @mui/x-tree-view-pro
```

This component has the following peer dependencies that you will need to install as well.

```json
"peerDependencies": {
"@mui/material": "^5.15.0",
"react": "^17.0.0 || ^18.0.0",
"react-dom": "^17.0.0 || ^18.0.0"
},
```

## Documentation

Visit [https://mui.com/x/react-tree-view/](https://mui.com/x/react-tree-view/) to view the full documentation.
70 changes: 70 additions & 0 deletions packages/x-tree-view-pro/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"name": "@mui/x-tree-view-pro",
"version": "7.0.1",
"private": true,
"description": "The Pro plan edition of the Tree View components (MUI X).",
"author": "MUI Team",
"main": "src/index.ts",
"license": "SEE LICENSE IN LICENSE",
"bugs": {
"url": "https://github.com/mui/mui-x/issues"
},
"homepage": "https://mui.com/x/react-tree-view/",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/mui-org"
},
"sideEffects": false,
"publishConfig": {
"access": "public"
},
"keywords": [
"react",
"react-component",
"mui",
"mui-x",
"material-ui",
"material design",
"treeview"
],
"scripts": {
"typescript": "tsc -p tsconfig.json",
"build": "yarn build:modern && yarn build:node && yarn build:stable && yarn build:types && yarn build:copy-files ",
"build:modern": "node ../../scripts/build.mjs modern",
"build:node": "node ../../scripts/build.mjs node",
"build:stable": "node ../../scripts/build.mjs stable",
"build:copy-files": "node ../../scripts/copyFiles.mjs",
"build:types": "node ../../scripts/buildTypes.mjs",
"prebuild": "rimraf build tsconfig.build.tsbuildinfo"
},
"repository": {
"type": "git",
"url": "https://github.com/mui/mui-x.git",
"directory": "packages/x-tree-view-pro"
},
"dependencies": {
"@babel/runtime": "^7.24.0",
"@mui/base": "^5.0.0-beta.40",
"@mui/system": "^5.15.14",
"@mui/utils": "^5.15.14",
"@mui/x-license": "7.0.0",
"@mui/x-tree-view-pro": "7.0.1",
"@types/react-transition-group": "^4.4.10",
"clsx": "^2.1.0",
"prop-types": "^15.8.1",
"react-transition-group": "^4.4.5"
},
"peerDependencies": {
"@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1",
"@mui/material": "^5.15.14",
"react": "^17.0.0 || ^18.0.0",
"react-dom": "^17.0.0 || ^18.0.0"
},
"setupFiles": [
"<rootDir>/src/setupTests.js"
],
"engines": {
"node": ">=14.0.0"
}
}
1 change: 1 addition & 0 deletions packages/x-tree-view-pro/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '@mui/x-tree-view';
19 changes: 19 additions & 0 deletions packages/x-tree-view-pro/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
// This config is for emitting declarations (.d.ts) only
// Actual .ts source files are transpiled via babel
"extends": "./tsconfig.json",
"compilerOptions": {
"composite": true,
"declaration": true,
"noEmit": false,
"emitDeclarationOnly": true,
"outDir": "build",
"rootDir": "./src"
},
"references": [
{ "path": "../x-tree-view/tsconfig.build.json" },
{ "path": "../x-license/tsconfig.build.json" }
],
"include": ["src/**/*.ts*", "../../node_modules/@mui/material/themeCssVarsAugmentation"],
"exclude": ["src/**/*.spec.ts*", "src/**/*.test.ts*", "src/tests/**/*"]
}
13 changes: 13 additions & 0 deletions packages/x-tree-view-pro/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"types": ["react", "mocha", "node"],
"noImplicitAny": false
},
"include": [
"src/**/*",
"../../test/utils/addChaiAssertions.ts",
"../../node_modules/@mui/monorepo/packages/test-utils/src/initMatchers.ts",
"../../node_modules/@mui/material/themeCssVarsAugmentation"
]
}
2 changes: 1 addition & 1 deletion packages/x-tree-view/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MUI X Tree View

This package is the community edition of the tree view components.
This package is the Community plan edition of the Tree View components.
It's part of [MUI X](https://mui.com/x/), an open-core extension of MUI Core, with advanced components.

## Installation
Expand Down
2 changes: 1 addition & 1 deletion packages/x-tree-view/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@mui/x-tree-view",
"version": "7.1.0",
"description": "The community edition of the tree view components (MUI X).",
"description": "The community edition of the Tree View components (MUI X).",
"author": "MUI Team",
"main": "src/index.ts",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion scripts/buildApiDocs/treeViewSettings/getComponentInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function getComponentImports(name: string, filename: string) {

const reExportPackage = [rootImportPath];

// TODO: uncomment when releasing the pro package
// TODO x-tree-view-pro uncomment when making the package public
// if (rootImportPath === '@mui/x-tree-view') {
// reExportPackage.push('@mui/x-tree-view-pro');
// }
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"@mui/x-charts/*": ["./packages/x-charts/src/*"],
"@mui/x-tree-view": ["./packages/x-tree-view/src"],
"@mui/x-tree-view/*": ["./packages/x-tree-view/src/*"],
"@mui/x-tree-view-pro": ["./packages/x-tree-view-pro/src"],
"@mui/x-tree-view-pro/*": ["./packages/x-tree-view-pro/src/*"],
"@mui/x-license": ["./packages/x-license/src"],
"@mui/x-license/*": ["./packages/x-license/src/*"],
"@mui-internal/test-utils": ["./node_modules/@mui/monorepo/packages/test-utils/src"],
Expand Down
1 change: 1 addition & 0 deletions webpackBaseConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = {
'@mui/x-date-pickers-pro': path.resolve(__dirname, './packages/x-date-pickers-pro/src'),
'@mui/x-charts': path.resolve(__dirname, './packages/x-charts/src'),
'@mui/x-tree-view': path.resolve(__dirname, './packages/x-tree-view/src'),
'@mui/x-tree-view-pro': path.resolve(__dirname, './packages/x-tree-view-pro/src'),
'@mui/x-license': path.resolve(__dirname, './packages/x-license/src'),
'@mui/material-nextjs': path.resolve(
__dirname,
Expand Down

0 comments on commit 7a3a889

Please sign in to comment.