Skip to content

Commit 87a8f00

Browse files
authored
Improvement/babel setup (#32)
* bust cache * simplify circle setup * more updates for circle * update nwb * update lock file * update babel config * more babel stuff
1 parent fdbb517 commit 87a8f00

File tree

4 files changed

+460
-545
lines changed

4 files changed

+460
-545
lines changed

.circleci/config.yml

Lines changed: 38 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,82 @@
11
version: 2
22

3-
defaults: &defaults
4-
working_directory: ~/project/react-stick
5-
docker:
6-
- image: circleci/node:latest-browsers
7-
environment:
8-
CHROME_BIN: '/usr/bin/google-chrome'
9-
10-
attach_workspace: &attach_workspace
11-
attach_workspace:
12-
at: ~/project
13-
14-
restore_cache: &restore_cache
15-
restore_cache:
16-
name: Restore node_modules cache
17-
keys:
18-
- v1-node-{{ .Branch }}-{{ checksum "yarn.lock" }}
19-
- v1-node-{{ .Branch }}-
20-
- v1-node-
3+
references:
4+
defaults: &defaults
5+
working_directory: ~/repo
6+
docker:
7+
- image: circleci/node:latest-browsers
8+
environment:
9+
CHROME_BIN: "/usr/bin/google-chrome"
10+
11+
restore_cache: &restore_cache
12+
restore_cache:
13+
keys:
14+
- deps-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}
15+
- deps-v1-{{ .Branch }}
16+
- deps-v1
2117

2218
jobs:
2319
install:
2420
<<: *defaults
21+
2522
steps:
2623
- checkout
27-
- *attach_workspace
24+
2825
- *restore_cache
29-
- run:
30-
name: Install Dependencies
31-
command: yarn install --frozen-lockfile
32-
- save_cache:
33-
name: Save yarn cache
34-
key: v1-yarn-{{ .Branch }}-{{ checksum "yarn.lock" }}
35-
paths:
36-
- .cache/yarn
26+
27+
- run: yarn
28+
3729
- save_cache:
38-
name: Save node_modules cache
39-
key: v1-node-{{ .Branch }}-{{ checksum "yarn.lock" }}
40-
paths:
41-
- node_modules/
42-
- run:
43-
name: Remove node_modules to cleanup workspace
44-
command: rm -r node_modules/
45-
- persist_to_workspace:
46-
root: ~/project
30+
key: deps-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}
4731
paths:
48-
- react-stick
32+
- node_modules
4933

5034
lint:
5135
<<: *defaults
36+
5237
steps:
53-
- *attach_workspace
38+
- checkout
39+
5440
- *restore_cache
41+
5542
- run:
5643
name: Lint
5744
command: yarn lint
5845

5946
flow:
6047
<<: *defaults
48+
6149
steps:
62-
- *attach_workspace
50+
- checkout
51+
6352
- *restore_cache
53+
6454
- run:
6555
name: Flow
6656
command: yarn flow
6757

6858
test:
6959
<<: *defaults
7060
steps:
71-
- *attach_workspace
61+
- checkout
62+
7263
- *restore_cache
64+
7365
- run:
7466
name: Test
7567
command: yarn test:coverage
68+
7669
- run:
7770
name: Codecov
7871
command: bash <(curl -s https://codecov.io/bash)
7972

8073
publish-demo:
8174
<<: *defaults
8275
steps:
83-
- *attach_workspace
76+
- checkout
77+
8478
- *restore_cache
79+
8580
- run:
8681
name: Fix host authenticity for github.com
8782
command: mkdir -p ~/.ssh/ && ssh-keyscan github.com >> ~/.ssh/known_hosts
@@ -102,7 +97,7 @@ jobs:
10297
release-preview:
10398
<<: *defaults
10499
steps:
105-
- *attach_workspace
100+
- checkout
106101
- *restore_cache
107102
- run:
108103
name: Post release preview
@@ -111,7 +106,7 @@ jobs:
111106
release:
112107
<<: *defaults
113108
steps:
114-
- *attach_workspace
109+
- checkout
115110
- *restore_cache
116111
- run:
117112
name: Fix host authenticity for github.com

babel.config.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,8 @@ module.exports = {
1616
comments: true,
1717
plugins: [
1818
'@babel/transform-runtime',
19-
'@babel/plugin-transform-flow-strip-types',
2019
'@babel/plugin-proposal-object-rest-spread',
21-
'@babel/plugin-proposal-export-namespace-from',
22-
'@babel/plugin-proposal-optional-chaining',
2320

2421
'lodash',
25-
'syntax-dynamic-import',
26-
27-
...(NODE_ENV === 'test' ? ['dynamic-import-node'] : []),
2822
],
2923
}

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@
3333
},
3434
"devDependencies": {
3535
"@babel/core": "7.8.7",
36+
"@babel/plugin-proposal-object-rest-spread": "^7.9.5",
37+
"@babel/plugin-transform-runtime": "^7.9.0",
38+
"@babel/preset-env": "^7.9.5",
3639
"@babel/preset-flow": "7.8.3",
40+
"@babel/preset-react": "^7.9.4",
3741
"babel-eslint": "10.1.0",
3842
"babel-loader": "^8.1.0",
3943
"babel-plugin-syntax-dynamic-import": "6.18.0",
@@ -53,7 +57,7 @@
5357
"html-webpack-harddisk-plugin": "^1.0.1",
5458
"html-webpack-plugin": "^4.0.4",
5559
"inferno": "7.4.2",
56-
"nwb": "0.24.3",
60+
"nwb": "0.24.5",
5761
"prettier": "1.19.1",
5862
"react": "^16.13.1",
5963
"react-dom": "^16.13.1",

0 commit comments

Comments
 (0)