Skip to content

Commit 7aca546

Browse files
authored
Migrate Build and Deployment to Create-React-App (#584)
* update tests * remove babel-jest * remove dockerfile * update .gitignore * add workflows * remove unused babel configs * add npm auto * distribute es6 module * update ci/cd * remove unused addParameters from storybook * update CI * run jest ci in silent mode * remove unneeded imports from tests * pass codeclimate * Add CHANGELOG.md * add base branch to auto
1 parent c1f0171 commit 7aca546

Some content is hidden

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

55 files changed

+17116
-32639
lines changed

.babelrc

-121
This file was deleted.

.dockerignore

-16
This file was deleted.

.eslintrc

-56
This file was deleted.

.github/workflows/chromatic.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: "Chromatic"
22

3-
on: [push, pull_request]
3+
on: push
44

55
jobs:
66

7-
chromatic-deployment:
7+
test:
88

99
runs-on: ubuntu-latest
1010

@@ -14,11 +14,9 @@ jobs:
1414
with:
1515
fetch-depth: 0
1616
- name: Install dependencies
17-
run: npm i
17+
run: yarn install
1818
- name: Deploy to Chromatic
1919
uses: chromaui/action@v1
2020
with:
2121
token: ${{ secrets.GITHUB_TOKEN }}
2222
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
23-
autoAcceptChanges: true
24-
exitZeroOnChanges: true

.github/workflows/ci.js.yml .github/workflows/ci.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: "CI"
22

33
on:
44
push:
@@ -13,7 +13,7 @@ jobs:
1313

1414
strategy:
1515
matrix:
16-
node-version: [12.x, 13.x, 14.x]
16+
node-version: [14.x]
1717

1818
steps:
1919
- name: Checkout repo
@@ -27,16 +27,16 @@ jobs:
2727
node-version: ${{ matrix.node-version }}
2828

2929
- name: Install dependencies
30-
run: npm ci
30+
run: yarn install --frozen-lockfile
3131

3232
- name: Run build
33-
run: npm run build --if-present
33+
run: yarn build
3434

3535
- name: Run tests
36-
run: npm test
36+
run: yarn coverage
3737

3838
- name: Create docs
39-
run: npm run prebuild-storybook
39+
run: yarn build-storybook-docs
4040

4141
- name: Code coverage
4242
uses: codecov/codecov-action@v1
File renamed without changes.

.github/workflows/npm-publish.yml

-33
This file was deleted.

.github/workflows/npm.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
## name of our action
2+
name: "NPM Publish"
3+
4+
# the event that will trigger the action
5+
on:
6+
push:
7+
branches: [main]
8+
9+
# what the action will do
10+
jobs:
11+
release:
12+
# the operating system it will run on
13+
runs-on: ubuntu-latest
14+
# this check needs to be in place to prevent a publish loop with auto and github actions
15+
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
16+
# the list of steps that the action will go through
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Prepare repository
20+
run: git fetch --unshallow --tags
21+
- name: Use Node.js 12.x
22+
uses: actions/setup-node@v1
23+
with:
24+
node-version: 12.x
25+
- name: Cache node modules
26+
uses: actions/cache@v1
27+
with:
28+
path: node_modules
29+
key: yarn-deps-${{ hashFiles('yarn.lock') }}
30+
restore-keys: |
31+
yarn-deps-${{ hashFiles('yarn.lock') }}
32+
33+
- name: Create Release
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
37+
run: |
38+
yarn install --frozen-lockfile
39+
yarn build
40+
yarn release

.gitignore

+9-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@ dist
33

44
# Logs
55
npm-debug.log*
6+
yarn-debug.log*
7+
yarn-error.log*
8+
build-storybook.log*
69

710
# Build deps
8-
.jest-test-results.json
11+
src/.jest-test-results.json
912

1013
# Docs (moved to Netlify)
1114
docs/
15+
storybook-static/
1216

1317
# Runtime data
1418
pids
@@ -20,13 +24,16 @@ pids
2024
lib-cov
2125

2226
# Coverage directory used by tools like istanbul
23-
coverage
27+
/coverage
2428

2529
# Dependency directories
2630
node_modules/
31+
/.pnp
32+
.pnp.js
2733

2834
# OSX
2935
.DS_Store
36+
.env
3037

3138
#IDE
3239
.vscode

.npmignore

-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@ scripts/
33
test/
44
src/
55
docs/
6-
rollup.config.*
76
.*
87
CNAME

.storybook/addons.js

-3
This file was deleted.

.storybook/config.js

-10
This file was deleted.

0 commit comments

Comments
 (0)