Skip to content

Commit aa2b753

Browse files
committed
perf(packages): use tsc to build instead of babel
1 parent c4660d0 commit aa2b753

File tree

94 files changed

+1158
-1534
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+1158
-1534
lines changed

.circleci/config.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ references:
2121
- packages/react-codemods/node_modules/
2222
- packages/react-icons/node_modules/
2323
build_cache_paths: &build_cache_paths
24-
- .cache/
2524
- packages/react-charts/dist/
2625
- packages/react-core/dist/
2726
- packages/react-inline-edit-extension/dist/
@@ -128,7 +127,7 @@ jobs:
128127
- *build_cache_key
129128
- run:
130129
name: Build Dist
131-
command: yarn build
130+
command: yarn build && yarn build:umd
132131
- save_cache:
133132
paths: *build_cache_paths
134133
key: *build_cache_key

babel.config.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
module.exports = {
2-
extends: './packages/.babelrc',
3-
presets: [['@babel/env', {'modules': 'commonjs'}], '@babel/react'],
4-
};
2+
presets: [
3+
'@babel/preset-env',
4+
'@babel/preset-typescript',
5+
'@babel/preset-react'
6+
],
7+
plugins: [
8+
'@babel/plugin-proposal-class-properties',
9+
'@babel/plugin-proposal-object-rest-spread'
10+
]
11+
}

package.json

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,14 @@
2525
},
2626
"homepage": "https://github.com/patternfly/patternfly-react#readme",
2727
"devDependencies": {
28+
"@babel/core": "^7.0.0",
29+
"@babel/plugin-proposal-class-properties": "^7.0.0",
30+
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
31+
"@babel/preset-env": "^7.0.0",
32+
"@babel/preset-react": "^7.0.0",
33+
"@babel/preset-typescript": "^7.0.0",
2834
"@octokit/rest": "^16.39.0",
35+
"@types/jest": "^24.0.11",
2936
"@types/enzyme": "3.9.0",
3037
"@typescript-eslint/eslint-plugin": "^2.18.0",
3138
"@typescript-eslint/parser": "^2.18.0",
@@ -65,12 +72,15 @@
6572
},
6673
"scripts": {
6774
"bootstrap": "lerna bootstrap",
68-
"build": "node scripts/incrementalBuild.js",
69-
"build:docs": "lerna run build:docs --stream",
70-
"build:integration:report": "lerna run build:integration:report --stream",
75+
"build": "yarn build:generate && yarn build:esm && yarn build:cjs",
76+
"build:cjs": "tsc --build packages/tsconfig.cjs.json -v",
77+
"build:esm": "tsc --build packages/tsconfig.json -v",
7178
"build:integration": "lerna run build:demo-app --stream",
79+
"build:docs": "yarn workspace @patternfly/react-docs build:docs",
80+
"build:umd": "yarn workspace @patternfly/react-core build:umd",
81+
"build:generate": "lerna run generate --parallel --stream",
7282
"clean": "yarn clean:build && yarn clean:pf3 && lerna run clean --parallel",
73-
"clean:build": "rimraf .cache",
83+
"clean:build": "rimraf .cache .eslintcache coverage",
7484
"clean:pf3": "rimraf packages/patternfly-3 packages/patternfly-4",
7585
"commit": "git-cz",
7686
"generate": "yarn plop",
@@ -81,7 +91,7 @@
8191
"prettier": "node node_modules/.bin/prettier --write \"packages/**/*.{js,jsx,ts,tsx}\" \"scripts/**/*.{js,jsx,ts,tsx}\"",
8292
"serve:docs": "lerna run serve",
8393
"serve:integration": "lerna run serve:demo-app",
84-
"start": "yarn build && lerna run develop --parallel --stream",
94+
"start": "concurrently --kill-others \"yarn build && yarn build:esm --watch\" \"yarn workspace @patternfly/react-docs develop\"",
8595
"start:cypress": "lerna run cypress:open",
8696
"start:demo-app": "lerna run start:demo-app --stream",
8797
"start:pf4": "yarn start",

packages/.babelrc

Lines changed: 0 additions & 11 deletions
This file was deleted.

packages/react-catalog-view-extension/.babelrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/react-catalog-view-extension/.npmignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/react-catalog-view-extension/package.json

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,10 @@
2929
},
3030
"homepage": "https://github.com/patternfly/patternfly-react/blob/master/packages/react-catalog-view-extension/README.md",
3131
"scripts": {
32-
"build": "yarn build:babel && yarn build:types && yarn build:sass",
33-
"build:babel": "concurrently 'yarn build:babel:esm && yarn build:babel:umd' 'yarn build:babel:cjs'",
34-
"build:babel:cjs": "babel --source-maps --extensions '.js,.ts,.tsx' src --out-dir dist/js --presets=@babel/env",
35-
"build:babel:esm": "babel --source-maps --extensions '.js,.ts,.tsx' src --out-dir dist/esm",
36-
"build:babel:umd": "babel --source-maps --extensions '.js' dist/esm --out-dir dist/umd --plugins=transform-es2015-modules-umd",
37-
"build:types": "tsc -p tsconfig.gen-dts.json",
38-
"build:sass": "shx mkdir -p dist/sass && shx cp -r sass/react-catalog-view-extension/* dist/sass && node-sass --output-style compressed --importer=./node-sass-patternfly-importer.js -o dist/css sass/react-catalog-view-extension.scss",
39-
"clean": "rimraf dist",
40-
"develop": "yarn build:babel:esm --skip-initial-build --watch --verbose --source-maps"
32+
"generate": "concurrently \"yarn build:sass\" \"yarn copy:sass\"",
33+
"build:sass": "node-sass --output-style compressed --importer=./node-sass-patternfly-importer.js -o dist/css sass/react-catalog-view-extension.scss",
34+
"copy:sass": "shx mkdir -p dist/sass && shx cp -r sass/react-catalog-view-extension/* dist/sass",
35+
"clean": "rimraf dist"
4136
},
4237
"dependencies": {
4338
"@patternfly/patternfly": "4.6.0",
@@ -47,25 +42,14 @@
4742
"patternfly": "^3.59.4"
4843
},
4944
"devDependencies": {
50-
"@babel/cli": "^7.0.0",
51-
"@babel/core": "^7.0.0",
52-
"@babel/plugin-proposal-class-properties": "^7.0.0",
53-
"@babel/plugin-proposal-export-default-from": "^7.0.0",
54-
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
55-
"@babel/plugin-transform-typescript": "^7.0.0",
56-
"@babel/preset-env": "^7.0.0",
57-
"@babel/preset-react": "^7.0.0",
58-
"@types/react": "^16.4.0",
59-
"@types/react-dom": "^16.4.0",
60-
"babel-plugin-transform-es2015-modules-umd": "^6.24.1",
61-
"babel-plugin-typescript-to-proptypes": "^0.17.1",
45+
"concurrently": "^3.5.1",
6246
"node-sass": "^4.12.0",
6347
"rimraf": "^2.6.2",
6448
"shx": "^0.3.2",
49+
"tslib": "^1.11.1",
6550
"typescript": "^3.8.3"
6651
},
6752
"peerDependencies": {
68-
"prop-types": "^15.6.1",
6953
"react": "^16.4.0",
7054
"react-dom": "^15.6.2 || ^16.4.0"
7155
}

0 commit comments

Comments
 (0)