Skip to content

Commit 1333230

Browse files
Merge pull request #70 from commitd/sh-develop
Minor updates against issues
2 parents a61d156 + 5b943c0 commit 1333230

File tree

19 files changed

+1380
-1214
lines changed

19 files changed

+1380
-1214
lines changed

.devcontainer/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.148.1/containers/javascript-node/.devcontainer/base.Dockerfile
2+
3+
# [Choice] Node.js version: 14, 12, 10
4+
ARG VARIANT="14-buster"
5+
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
6+
7+
# [Optional] Uncomment this section to install additional OS packages.
8+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
9+
# && apt-get -y install --no-install-recommends <your-package-list-here>
10+
11+
# [Optional] Uncomment if you want to install an additional version of node using nvm
12+
# ARG EXTRA_NODE_VERSION=10
13+
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"
14+
15+
# [Optional] Uncomment if you want to install more global node modules
16+
# RUN sudo -u node npm install -g <your-package-list-here>
17+

.devcontainer/devcontainer.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "Node.js",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"args": {
6+
"VARIANT": "14"
7+
}
8+
},
9+
"settings": {
10+
"terminal.integrated.shell.linux": "/bin/bash"
11+
},
12+
"extensions": [
13+
"dbaeumer.vscode-eslint",
14+
"esbenp.prettier-vscode",
15+
"github.vscode-pull-request-github",
16+
"ms-vsliveshare.vsliveshare",
17+
"eamodio.gitlens",
18+
"streetsidesoftware.code-spell-checker"
19+
],
20+
"postCreateCommand": "yarn install",
21+
"remoteUser": "node"
22+
}

.drone.yml

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

.github/workflows/build.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: build
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
build:
9+
name: Build, lint, test, sonar on main branch
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repo
14+
uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Set up Node
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: '12'
22+
23+
- name: Install deps and build (with cache)
24+
uses: bahmutov/npm-install@v1
25+
26+
- name: Lint
27+
run: yarn lint
28+
29+
- name: Danger
30+
run: yarn danger ci
31+
env:
32+
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Test
35+
run: yarn test --ci --coverage --maxWorkers=2
36+
37+
- name: Build
38+
run: yarn build
39+
40+
- name: Build Storybook
41+
run: yarn build-storybook --quiet
42+
43+
- name: SonarCloud Scan
44+
uses: sonarsource/sonarcloud-github-action@master
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
SONAR_TOKEN: ${{ secrets.SONAR_CLOUD_TOKEN }}

.github/workflows/main.yml

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,43 @@
1-
name: CI
2-
on: [push]
1+
name: build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
38
jobs:
49
build:
10+
name: Build, lint, test, sonar on main branch
511
runs-on: ubuntu-latest
612

713
steps:
8-
- name: Begin CI...
14+
- name: Checkout repo
915
uses: actions/checkout@v2
10-
11-
- name: Use Node 12
12-
uses: actions/setup-node@v1
1316
with:
14-
node-version: 12.x
17+
fetch-depth: 0
1518

16-
- name: Use cached node_modules
17-
uses: actions/cache@v1
19+
- name: Set up Node
20+
uses: actions/setup-node@v1
1821
with:
19-
path: node_modules
20-
key: nodeModules-${{ hashFiles('**/yarn.lock') }}
21-
restore-keys: |
22-
nodeModules-
22+
node-version: '12'
2323

24-
- name: Install dependencies
25-
run: yarn install --frozen-lockfile
26-
env:
27-
CI: true
24+
- name: Install deps and build (with cache)
25+
uses: bahmutov/npm-install@v1
2826

2927
- name: Lint
3028
run: yarn lint
31-
env:
32-
CI: true
3329

3430
- name: Test
3531
run: yarn test --ci --coverage --maxWorkers=2
36-
env:
37-
CI: true
3832

3933
- name: Build
4034
run: yarn build
35+
36+
- name: Build Storybook
37+
run: yarn build-storybook --quiet
38+
39+
- name: SonarCloud Scan
40+
uses: sonarsource/sonarcloud-github-action@master
4141
env:
42-
CI: true
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
SONAR_TOKEN: ${{ secrets.SONAR_CLOUD_TOKEN }}

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: release
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
release:
9+
name: Build and publish
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repo
14+
uses: actions/checkout@v2
15+
16+
- name: Set up Node
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: '12'
20+
registry-url: 'https://registry.npmjs.org'
21+
22+
- name: Install deps and build (with cache)
23+
uses: bahmutov/npm-install@v1
24+
25+
- name: Publish Package
26+
run: npm publish --access=public
27+
env:
28+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
29+
30+
- name: Publish Docs
31+
run: yarn deploy-storybook --ci
32+
env:
33+
GH_TOKEN: ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}

.github/workflows/size.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: size
2+
on: [pull_request]
3+
jobs:
4+
size:
5+
runs-on: ubuntu-latest
6+
env:
7+
CI_JOB_NUMBER: 1
8+
steps:
9+
- uses: actions/checkout@v1
10+
- uses: andresz1/size-limit-action@v1
11+
with:
12+
github_token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ lib
1212
lib-esm
1313
_bundles
1414
docs
15+
coverage
16+
test-report.xml
1517

1618
# misc
1719
.cache

.storybook/committed/withTheme.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22
import { useDarkMode } from 'storybook-dark-mode'
3-
import { ThemeProvider } from '../../src'
3+
import { ThemeProvider, Box } from '../../src'
44

55
/**
66
* Wrap a component with the default ThemeProvider
@@ -11,7 +11,10 @@ export const withTheme = (Story) => {
1111
const choice = useDarkMode() ? 'dark' : 'light'
1212
return (
1313
<ThemeProvider choice={choice}>
14-
<Story />
14+
{/* Temporary background until themeing in docs is supported */}
15+
<Box bgcolor="background.paper" p={3}>
16+
<Story />
17+
</Box>
1518
</ThemeProvider>
1619
)
1720
}

.storybook/main.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
module.exports = {
22
stories: ['../stories/**/*.stories.@(ts|tsx|mdx)'],
33
addons: [
4-
'@storybook/addon-links',
54
{
65
name: '@storybook/addon-essentials',
76
options: {

0 commit comments

Comments
 (0)