Skip to content

Commit

Permalink
[core] Last mile so we can release the lab 🔬 (mui#10441)
Browse files Browse the repository at this point in the history
Add lerna. I'm far from convinced it's a good tool.
We can always move to use a custom script like [react-native-web](https://github.com/necolas/react-native-web/blob/ae7aa818fb16364ebacd344d941d50d86c4e5fa9/scripts/release/publish.js) or [React](https://github.com/facebook/react/tree/94518b068bf52196abea0c83f4c9926bfe2065c6/scripts/release) are doing.
  • Loading branch information
oliviertassinari authored Feb 25, 2018
1 parent ea179a1 commit bbf9161
Show file tree
Hide file tree
Showing 10 changed files with 637 additions and 67 deletions.
11 changes: 11 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"lerna": "2.9.0",
"packages": [
"packages/*"
],
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": true,
"allowBranch": ["v1-beta"],
"concurrency": 2
}
22 changes: 12 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,9 @@
"docs:deploy": "yarn docs:build && yarn docs:export && firebase deploy",
"docs:size-why": "DOCS_STATS_ENABLED=true yarn docs:build",
"docs:build-sw": "babel-node ./docs/scripts/buildServiceWorker.js",
"prebuild": "rimraf build",
"build:es2015": "cross-env NODE_ENV=production babel ./src --ignore *.spec.js --out-dir ./build",
"build:es2015modules": "cross-env NODE_ENV=production BABEL_ENV=modules babel ./src/index.js --out-file ./build/index.es.js",
"build:es": "cross-env NODE_ENV=production BABEL_ENV=es babel ./src --ignore *.spec.js --out-dir ./build/es",
"build:umd:dev": "webpack --config scripts/umd.webpack.config.js",
"build:umd:prod": "cross-env NODE_ENV=production webpack --config scripts/umd.webpack.config.js",
"build:copy-files": "babel-node ./scripts/copy-files.js",
"build": "yarn build:es2015 && yarn build:es2015modules && yarn build:es && yarn build:umd:dev && yarn build:umd:prod && yarn build:copy-files",
"prettier": "find . -name \"*.js\" -o -name \"*.d.ts\" -o -name \"*.tsx\" | grep -v -f .eslintignore | xargs prettier --write",
"lint": "eslint . --cache && echo \"eslint: no lint errors\"",
"lint:fix": "eslint . --cache --fix && echo \"eslint: no lint errors\"",
"prettier": "find . -name \"*.js\" -o -name \"*.d.ts\" -o -name \"*.tsx\" | grep -v -f .eslintignore | xargs prettier --write",
"size": "size-limit",
"size:why": "size-limit --why build/index.js",
"size:overhead:why": "size-limit --why ./test/size/overhead.js",
Expand All @@ -58,9 +50,18 @@
"typescript": "tsc -p tsconfig.json",
"flow": "flow --show-all-errors",
"argos": "argos upload test/regressions/screenshots/chrome --token $ARGOS_TOKEN || true",
"prebuild": "rimraf build",
"build:es2015": "cross-env NODE_ENV=production babel ./src --ignore *.spec.js --out-dir ./build",
"build:es2015modules": "cross-env NODE_ENV=production BABEL_ENV=modules babel ./src/index.js --out-file ./build/index.es.js",
"build:es": "cross-env NODE_ENV=production BABEL_ENV=es babel ./src --ignore *.spec.js --out-dir ./build/es",
"build:umd:dev": "webpack --config scripts/umd.webpack.config.js",
"build:umd:prod": "cross-env NODE_ENV=production webpack --config scripts/umd.webpack.config.js",
"build:copy-files": "babel-node ./scripts/copy-files.js",
"build": "yarn build:es2015 && yarn build:es2015modules && yarn build:es && yarn build:umd:dev && yarn build:umd:prod && yarn build:copy-files",
"version": "yarn build",
"release": "np --no-publish --any-branch",
"postrelease": "yarn docs:deploy && npm publish build --tag next"
"postrelease": "yarn docs:deploy && npm publish build --tag next",
"monorepo:release": "yarn lerna exec -- yarn build && ./node_modules/.bin/lerna publish --skip-npm"
},
"peerDependencies": {
"react": "^15.3.0 || ^16.0.0",
Expand Down Expand Up @@ -160,6 +161,7 @@
"karma-phantomjs-launcher": "^1.0.4",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^2.0.6",
"lerna": "^2.9.0",
"lz-string": "^1.4.4",
"marked": "^0.3.12",
"mocha": "^5.0.0",
Expand Down
5 changes: 3 additions & 2 deletions packages/eslint-plugin-material-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
"name": "eslint-plugin-material-ui",
"version": "1.0.0",
"private": true,
"description": "Custom eslint rules for Material-UI",
"description": "Custom eslint rules for Material-UI.",
"main": "src/index.js",
"scripts": {
"test": "../../node_modules/.bin/mocha src/**/*.spec.js"
"test": "../../node_modules/.bin/mocha src/**/*.spec.js",
"build": "echo done"
},
"repository": {
"type": "git",
Expand Down
5 changes: 3 additions & 2 deletions packages/material-ui-codemod/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "material-ui-codemod",
"private": false,
"author": "Material-UI Team",
"version": "1.0.0-beta.23",
"description": "Codemod scripts for Material-UI",
"description": "Codemod scripts for Material-UI.",
"keywords": [
"react",
"react-component",
Expand All @@ -16,7 +17,7 @@
"test:unit": "cd ../../ && ./node_modules/.bin/mocha packages/material-ui-codemod/src/**/*.spec.js",
"test:watch": "yarn test:unit --watch",
"build": "../../node_modules/.bin/rimraf lib && ../../node_modules/.bin/babel ./src --out-dir ./lib",
"prepublish": "yarn build"
"version": "npm publish"
},
"repository": {
"type": "git",
Expand Down
11 changes: 0 additions & 11 deletions packages/material-ui-dependents/package.json

This file was deleted.

14 changes: 6 additions & 8 deletions packages/material-ui-icons/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "material-ui-icons",
"private": true,
"private": false,
"author": "Material-UI Team",
"version": "1.0.0-beta.17",
"description": "Material Design Svg Icons converted to Material-UI React components.",
Expand All @@ -22,19 +22,17 @@
},
"homepage": "https://github.com/mui-org/material-ui/tree/v1-beta/packages/material-ui-icons",
"scripts": {
"test": "yarn test:unit",
"test:unit": "cd ../../ && ./node_modules/.bin/cross-env NODE_ENV=test ./node_modules/.bin/mocha packages/material-ui-icons/test/index.spec.js",
"test:watch": "yarn test:unit --watch",
"prebuild": "../../node_modules/.bin/rimraf build",
"build:es2015": "../../node_modules/.bin/cross-env NODE_ENV=production ../../node_modules/.bin/babel ./src --out-dir ./build",
"build:es2015modules": "../../node_modules/.bin/cross-env NODE_ENV=production BABEL_ENV=modules ../../node_modules/.bin/babel ./src/index.js --out-file ./build/index.es.js",
"build:copy-files": "../../node_modules/.bin/babel-node ./scripts/copy-files.js",
"build:icons": "../../node_modules/.bin/babel-node ./builder.js --output-dir ./src --svg-dir ../../node_modules/material-design-icons --glob '/**/production/*_24px.svg' --renameFilter ./filters/rename/material-design-icons.js",
"build:typings": "../../node_modules/.bin/babel-node ./scripts/create-typings.js",
"build": "yarn build:icons && yarn build:es2015 && yarn build:es2015modules && yarn build:copy-files && yarn build:typings",
"version": "yarn build",
"release": "np --no-publish --any-branch",
"postrelease": "npm publish build",
"test": "yarn test:unit",
"test:unit": "cd ../../ && ./node_modules/.bin/cross-env NODE_ENV=test ./node_modules/.bin/mocha packages/material-ui-icons/test/index.spec.js",
"test:watch": "yarn test:unit --watch"
"build": "yarn build:icons && yarn build:es2015 && yarn build:es2015modules && yarn build:typings && yarn build:copy-files",
"version": "yarn build:copy-files && npm publish build"
},
"peerDependencies": {
"material-ui": "^1.0.0-beta.16",
Expand Down
1 change: 0 additions & 1 deletion packages/material-ui-icons/scripts/copy-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ async function createPackageFile() {
main: './index.js',
module: './index.es.js',
typings: './index.d.ts',
private: false,
};
const buildPath = path.resolve(__dirname, '../build/package.json');

Expand Down
17 changes: 7 additions & 10 deletions packages/material-ui-lab/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@material-ui/lab",
"private": true,
"private": false,
"author": "Material-UI Team",
"version": "1.0.0-alpha.1",
"version": "1.0.0-alpha.0",
"description": "Material-UI Lab - Incubator for Material-UI React components.",
"main": "./src/index.js",
"keywords": [
Expand All @@ -22,25 +22,22 @@
},
"homepage": "https://github.com/mui-org/material-ui/tree/v1-beta/packages/material-ui-lab",
"scripts": {
"test": "yarn test:unit",
"test:unit": "cd ../../ && ./node_modules/.bin/cross-env NODE_ENV=test ./node_modules/.bin/mocha packages/material-ui-lab/src/{,**/}*.spec.js",
"test:watch": "yarn test:unit --watch",
"prebuild": "../../node_modules/.bin/rimraf build",
"build:es2015": "../../node_modules/.bin/cross-env NODE_ENV=production ../../node_modules/.bin/babel ./src --out-dir ./build",
"build:es2015modules": "../../node_modules/.bin/cross-env NODE_ENV=production BABEL_ENV=modules ../../node_modules/.bin/babel ./src/index.js --out-file ./build/index.es.js",
"build:copy-files": "../../node_modules/.bin/babel-node ./scripts/copy-files.js",
"build": "yarn build:es2015 && npm run build:es2015modules && npm run build:copy-files",
"test": "yarn test:unit",
"test:unit": "cd ../../ && ./node_modules/.bin/cross-env NODE_ENV=test ./node_modules/.bin/mocha packages/material-ui-lab/src/{,**/}*.spec.js",
"test:watch": "yarn test:unit --watch",
"version": "yarn build",
"release": "np --no-publish --any-branch",
"postrelease": "npm publish build"
"build": "yarn build:es2015 && yarn build:es2015modules && yarn build:copy-files",
"version": "yarn build:copy-files && npm publish build"
},
"peerDependencies": {
"material-ui": "^1.0.0-beta.33",
"material-ui-icons": "^1.0.0-beta.17",
"react": "^15.3.0 || ^16.0.0",
"react-dom": "^15.3.0 || ^16.0.0"
},
"dependencies": {},
"devDependencies": {
"material-ui": "^1.0.0-beta.33",
"material-ui-icons": "^1.0.0-beta.17"
Expand Down
2 changes: 0 additions & 2 deletions packages/material-ui-lab/scripts/copy-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ async function createPackageFile() {
...packageDataOther,
main: './index.js',
module: './index.es.js',
typings: './index.d.ts',
private: false,
};
const buildPath = path.resolve(__dirname, '../build/package.json');

Expand Down
Loading

0 comments on commit bbf9161

Please sign in to comment.