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

[docs] Fix imports for x-grid-data-generator #887

Merged
merged 14 commits into from
Jan 25, 2021
4 changes: 2 additions & 2 deletions .codesandbox/ci.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"packages/x-license",
"packages/grid/data-grid",
"packages/grid/x-grid",
"packages/x-grid-data-generator"
"packages/grid/x-grid-data-generator"
],
"publishDirectory": {
"@material-ui/x-license": "packages/x-license",
"@material-ui/data-grid": "packages/grid/data-grid",
"@material-ui/x-grid": "packages/grid/x-grid",
"@material-ui/x-grid-data-generator": "packages/x-grid-data-generator"
"@material-ui/x-grid-data-generator": "packages/grid/x-grid-data-generator"
},
"sandboxes": [
"new",
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (process.env.BABEL_ENV === 'es') {

const defaultAlias = {
'@material-ui/data-grid': './packages/grid/data-grid/src',
'@material-ui/x-grid-data-generator': './packages/x-grid-data-generator/src',
'@material-ui/x-grid-data-generator': './packages/grid/x-grid-data-generator/src',
'@material-ui/x-grid': './packages/grid/x-grid/src',
'@material-ui/x-license': './packages/x-license/src',
};
Expand Down
2 changes: 1 addition & 1 deletion docs/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function resolvePath(sourcePath, currentFile, opts) {

const alias = {
'@material-ui/data-grid': '../packages/grid/data-grid/src',
'@material-ui/x-grid-data-generator': '../packages/x-grid-data-generator/src',
'@material-ui/x-grid-data-generator': '../packages/grid/x-grid-data-generator/src',
'@material-ui/x-grid': '../packages/grid/x-grid/src',
'@material-ui/x-license': '../packages/x-license/src',
// Help in the event npm and git are significantly desynchronized.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"jsonlint": "node scripts/jsonlint.js",
"typescript": "lerna run --no-bail --parallel typescript",
"build:codesandbox": "yarn build",
"build": "cd packages/x-license && yarn build && cd ../grid/x-grid && yarn build && cd ../data-grid && yarn build && cd ../../x-grid-data-generator && yarn build",
"build": "cd packages/x-license && yarn build && cd ../grid/x-grid && yarn build && cd ../data-grid && yarn build && cd ../x-grid-data-generator && yarn build",
"release": "yarn build && lerna publish --no-changelog",
"release:dry-run": "yarn build && lerna publish --no-changelog --no-git-tag-version --no-push --registry=\"http://localhost:4873/\""
},
Expand Down
1 change: 1 addition & 0 deletions packages/grid/rollup.data-grid.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export default [
`rm -rf ./data-grid/dist/data-grid/`,
`rm -rf ./data-grid/dist/_modules_ `,
`rm -rf ./data-grid/dist/x-grid`,
`rm -rf ./data-grid/dist/x-grid-data-generator`,
],
{
exitOnFail: true,
Expand Down
63 changes: 63 additions & 0 deletions packages/grid/rollup.x-grid-data-generator.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import typescript from 'rollup-plugin-typescript2';
import cleaner from 'rollup-plugin-cleaner';
import sourceMaps from 'rollup-plugin-sourcemaps';
import { terser } from 'rollup-plugin-terser';
import commonjs from 'rollup-plugin-commonjs';
import dts from 'rollup-plugin-dts';
import command from 'rollup-plugin-command';
import pkg from './x-grid-data-generator/package.json';

// dev build if watching, prod build if not
const production = !process.env.ROLLUP_WATCH;
export default [
{
input: {
index: './x-grid-data-generator/src/index.ts',
'datagen-cli': './x-grid-data-generator/src/datagen-cli.ts',
},
output: [
{
dir: './x-grid-data-generator/dist/esm',
format: 'esm',
sourcemap: !production,
},
{
dir: './x-grid-data-generator/dist/cjs',
format: 'cjs',
sourcemap: !production,
},
],
external: [...Object.keys(pkg.peerDependencies || {})],
plugins: [
production &&
cleaner({
targets: ['./x-grid-data-generator/dist/'],
}),
typescript({ tsconfig: 'tsconfig.build.json' }),
commonjs(),
!production && sourceMaps(),
production && terser(),
],
},
{
input: './x-grid-data-generator/dist/esm/x-grid-data-generator/src/index.d.ts',
output: [{ file: './x-grid-data-generator/dist/esm/x-grid-data-generator.d.ts', format: 'es' }],
plugins: [
dts(),
!production && sourceMaps(),
production &&
command(
[
`rm -rf ./x-grid-data-generator/dist/data-grid/`,
`rm -rf ./x-grid-data-generator/dist/_modules_ `,
`rm -rf ./x-grid-data-generator/dist/x-grid`,
`rm -rf ./x-grid-data-generator/dist/x-grid-data-generator`,
],
{
exitOnFail: true,
wait: true,
},
),
],
},
];
1 change: 1 addition & 0 deletions packages/grid/rollup.x-grid.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export default [
`rm -rf ./x-grid/dist/x-grid`,
`rm -rf ./x-grid/dist/_modules_`,
`rm -rf ./x-grid/dist/data-grid`,
`rm -rf ./x-grid/dist/x-grid-data-generator`,
],
{
exitOnFail: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/grid/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"types": ["jest", "node"],
"rootDir": "./"
},
"include": ["./data-grid/src", "./x-grid/src", "./_modules_/**/*"],
"include": ["./data-grid/src", "./x-grid/src", "./x-grid-data-generator/src", "./_modules_/**/*"],
DanailH marked this conversation as resolved.
Show resolved Hide resolved
"exclude": ["__tests__", "**/*.test.*", "node_modules"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
},
"scripts": {
"precommit": "npm run lint",
"build": "rollup -c",
"start": "rollup -cw",
"lint": "../../../node_modules/.bin/tsc --noEmit && eslint 'src/**/*.{ts,tsx}' --quiet --fix -c ../../../.eslintrc.js"
"build": "cd ../ && rollup --config rollup.x-grid-data-generator.config.js",
"start": "cd ../ && rollup --cw rollup.x-grid-data-generator.config.js",
"lint": "../../../node_modules/.bin/tsc --noEmit && eslint 'src/**/*.{ts,tsx}' --quiet --fix -c ../../../.eslintrc.js",
"typescript": "tsc -p tsconfig.json"
},
"dependencies": {
"@types/chance": "^1.1.0",
Expand All @@ -36,7 +37,6 @@
"@material-ui/core": "^4.9.12 || ^5.0.0-alpha.22",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.54",
"@material-ui/x-grid": "^4.0.0-alpha.1",
"react": "^16.8.0 || ^17.0.0"
},
"setupFiles": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import clsx from 'clsx';
import { makeStyles, createStyles, Theme } from '@material-ui/core/styles';
import { CellParams, getThemePaletteMode } from '@material-ui/x-grid';
import { CellParams, getThemePaletteMode } from '../../../_modules_/grid';

const useStyles = makeStyles((theme: Theme) =>
createStyles({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import clsx from 'clsx';
import { makeStyles, createStyles, Theme } from '@material-ui/core/styles';
import { CellParams, muiStyleAlpha } from '@material-ui/x-grid';
import { CellParams, muiStyleAlpha } from '../../../_modules_/grid';

const useStyles = makeStyles((theme: Theme) =>
createStyles({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../../../tsconfig.json",
"compilerOptions": {
"noEmit": true
},
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const config: StorybookConfig = {
'@material-ui/data-grid': path.resolve(__dirname, '../../../packages/grid/data-grid/src'),
'@material-ui/x-grid-data-generator': path.resolve(
__dirname,
'../../../packages/x-grid-data-generator/src',
'../../../packages/grid/x-grid-data-generator/src',
),
'@material-ui/x-grid': path.resolve(__dirname, '../../../packages/grid/x-grid/src'),
'@material-ui/x-license': path.resolve(__dirname, '../../../packages/x-license/src'),
Expand Down
43 changes: 0 additions & 43 deletions packages/x-grid-data-generator/rollup.config.js

This file was deleted.

11 changes: 0 additions & 11 deletions packages/x-grid-data-generator/tsconfig.build.json

This file was deleted.

4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"paths": {
"@material-ui/data-grid": ["./packages/grid/data-grid/src"],
"@material-ui/data-grid/*": ["./packages/grid/data-grid/src/*"],
"@material-ui/x-grid-data-generator": ["./packages/x-grid-data-generator/src/"],
"@material-ui/x-grid-data-generator/*": ["./packages/x-grid-data-generator/src/*"],
"@material-ui/x-grid-data-generator": ["./packages/grid/x-grid-data-generator/src/"],
"@material-ui/x-grid-data-generator/*": ["./packages/grid/x-grid-data-generator/src/*"],
"@material-ui/x-grid": ["./packages/grid/x-grid/src"],
"@material-ui/x-grid/*": ["./packages/grid/x-grid/src/*"],
"@material-ui/x-license": ["./packages/x-license/src"],
Expand Down
2 changes: 1 addition & 1 deletion webpackBaseConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
'@material-ui/data-grid': path.resolve(__dirname, './packages/grid/data-grid/src'),
'@material-ui/x-grid-data-generator': path.resolve(
__dirname,
'./packages/x-grid-data-generator/src',
'./packages/grid/x-grid-data-generator/src',
),
'@material-ui/x-grid': path.resolve(__dirname, './packages/grid/x-grid/src'),
'@material-ui/x-license': path.resolve(__dirname, './packages/x-license/src'),
Expand Down