Skip to content

Commit

Permalink
feat(babel): remove rollup dependency and compile dist solely with babel
Browse files Browse the repository at this point in the history
  • Loading branch information
siarhei.fedarovich committed Jan 10, 2020
1 parent 30606b1 commit d416b4b
Show file tree
Hide file tree
Showing 25 changed files with 710 additions and 931 deletions.
39 changes: 39 additions & 0 deletions config/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
const isCjsBuild = process.env.BABEL_ENV === "cjs";

module.exports = {
presets: [
[
"@babel/preset-env",
{
modules: isCjsBuild ? "commonjs" : false
}
],
"@babel/preset-react",
"@babel/preset-typescript"
],
plugins: [
[
"@babel/plugin-proposal-object-rest-spread",
{
loose: true,
useBuiltIns: true
}
],
"@babel/plugin-proposal-class-properties",
[
"babel-plugin-transform-react-remove-prop-types",
{
mode: "unsafe-wrap"
}
],
"@babel/plugin-transform-runtime",
[
"babel-plugin-styled-components",
{
displayName: false,
pure: true
}
]
],
babelrc: false
};
65 changes: 0 additions & 65 deletions config/rollup.config.js

This file was deleted.

20 changes: 8 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
],
"license": "MIT",
"scripts": {
"build": "rollup -c config/rollup.config.js && npm run tsc:declaration",
"build": "npm run build:cjs && npm run build:esm && npm run tsc:declaration",
"build:cjs": "NODE_ENV=production BABEL_ENV=cjs babel ./src --config-file ./config/babel.config.js --out-dir ./dist/cjs --extensions \".js,.jsx,.ts,.tsx\" --ignore \"**/*.spec.js\"",
"build:esm": "NODE_ENV=production BABEL_ENV=esm babel ./src --config-file ./config/babel.config.js --out-dir ./dist/esm --extensions \".js,.jsx,.ts,.tsx\" --ignore \"**/*.spec.js\"",
"catalog-start": "NODE_ENV=development catalog start",
"catalog-build": "catalog build -u \"/aurora\"",
"lint": "eslint \"{src,catalog}/**/*.{js,jsx,ts,tsx}\"",
Expand All @@ -29,8 +31,7 @@
"test:cover": "NODE_ENV=test jest --coverage",
"test:ci": "NODE_ENV=test jest --changedSince=master --runInBand",
"add-icons": "pixo $* --out-dir src/components/Icons",
"tsc:declaration": "tsc -p tsconfig.declaration.json",
"posttsc:declaration": "node -e 'require(\"./scripts/declarejs\").generateStubTypings()'"
"tsc:declaration": "tsc -p tsconfig.declaration.json"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
Expand Down Expand Up @@ -72,7 +73,8 @@
"styled-components": ">=4"
},
"devDependencies": {
"@babel/core": "^7.0.0-0",
"@babel/cli": "^7.0.0",
"@babel/core": "^7.0.0",
"@babel/plugin-external-helpers": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-proposal-decorators": "^7.0.0",
Expand All @@ -83,20 +85,16 @@
"@babel/plugin-proposal-throw-expressions": "^7.0.0",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/plugin-syntax-import-meta": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.7.6",
"@babel/preset-env": "~7.1.4",
"@babel/preset-react": "^7.0.0",
"@babel/preset-typescript": "^7.3.3",
"@rollup/plugin-commonjs": "^11.0.0",
"@rollup/plugin-node-resolve": "^6.0.0",
"@rollup/plugin-replace": "^2.3.0",
"@types/jest": "^24.0.15",
"@types/react": "^16.4.0",
"@types/react-dom": "^16.4.0",
"@types/styled-components": "^4.0.3",
"@typescript-eslint/eslint-plugin": "^1.12.0",
"@typescript-eslint/parser": "^1.12.0",
"babel-cli": "^7.0.0-beta.3",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^9.0.0",
"babel-jest": "^23.4.2",
"babel-plugin-styled-components": "^1.10.6",
Expand All @@ -122,9 +120,6 @@
"react-testing-library": "^3.1.3",
"react-transition-group": "^2.5.0",
"regenerator-runtime": "^0.13.2",
"rollup": "^1.27.14",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-terser": "^5.1.3",
"styled-components": "^4.0.3",
"stylelint": "9.6.0",
"stylelint-config-recommended": "^2.1.0",
Expand All @@ -133,6 +128,7 @@
"typescript": "^3.5.3"
},
"resolutions": {
"babel-cli": "^7.0.0-beta.3",
"babel-core": "7.0.0-bridge.0",
"istanbul-reports": "^2.1.1",
"js-yaml": "^3.13.1",
Expand Down
64 changes: 32 additions & 32 deletions src/components/Banner/__tests__/__snapshots__/index.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ exports[`<Banner /> renders correctly when open 1`] = `
display: -ms-flexbox;
display: flex;
overflow: hidden;
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
background-color: rgba(255,255,255,0.5);
opacity: 0;
}
.c0.visible-banner {
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
opacity: 1;
}
Expand Down Expand Up @@ -145,15 +145,15 @@ exports[`<Banner /> renders correctly when variant is set 1`] = `
display: -ms-flexbox;
display: flex;
overflow: hidden;
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
background-color: rgba(255,255,255,0.5);
opacity: 0;
}
.c0.visible-banner {
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
opacity: 1;
}
Expand Down Expand Up @@ -293,15 +293,15 @@ exports[`<Banner /> renders correctly with close button 1`] = `
display: -ms-flexbox;
display: flex;
overflow: hidden;
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
background-color: rgba(255,255,255,0.5);
opacity: 0;
}
.c0.visible-banner {
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
opacity: 1;
}
Expand Down Expand Up @@ -441,15 +441,15 @@ exports[`<Banner /> renders correctly with content 1`] = `
display: -ms-flexbox;
display: flex;
overflow: hidden;
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
background-color: rgba(255,255,255,0.5);
opacity: 0;
}
.c0.visible-banner {
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
opacity: 1;
}
Expand Down Expand Up @@ -559,15 +559,15 @@ exports[`<Banner /> renders correctly with custom icon 1`] = `
display: -ms-flexbox;
display: flex;
overflow: hidden;
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
background-color: rgba(255,255,255,0.5);
opacity: 0;
}
.c0.visible-banner {
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
opacity: 1;
}
Expand Down Expand Up @@ -699,15 +699,15 @@ exports[`<Banner /> renders correctly with custom title for the close button 1`]
display: -ms-flexbox;
display: flex;
overflow: hidden;
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
background-color: rgba(255,255,255,0.5);
opacity: 0;
}
.c0.visible-banner {
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
opacity: 1;
}
Expand Down Expand Up @@ -845,15 +845,15 @@ exports[`<Banner /> renders correctly with expand/collapse button 1`] = `
display: -ms-flexbox;
display: flex;
overflow: hidden;
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
background-color: rgba(255,255,255,0.5);
opacity: 0;
}
.c0.visible-banner {
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
opacity: 1;
}
Expand Down Expand Up @@ -993,15 +993,15 @@ exports[`<Banner /> renders correctly with link 1`] = `
display: -ms-flexbox;
display: flex;
overflow: hidden;
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.55,0.085,0.68,0.53);
background-color: rgba(255,255,255,0.5);
opacity: 0;
}
.c0.visible-banner {
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955), opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
-webkit-transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
transition: max-height 0.3s cubic-bezier(0.455,0.03,0.515,0.955),opacity 0.3s cubic-bezier(0.455,0.03,0.515,0.955);
opacity: 1;
}
Expand Down
Loading

0 comments on commit d416b4b

Please sign in to comment.