Skip to content

Commit

Permalink
Merge branch 'develop' into ref/form-field
Browse files Browse the repository at this point in the history
  • Loading branch information
seaerchin committed Feb 18, 2022
2 parents a851ef4 + f0f0204 commit f2c50c6
Show file tree
Hide file tree
Showing 66 changed files with 24,104 additions and 14,396 deletions.
26 changes: 23 additions & 3 deletions .eslintrc.json
Expand Up @@ -7,12 +7,15 @@
"extends": [
"plugin:react/recommended",
"airbnb",
"plugin:prettier/recommended"
"plugin:prettier/recommended",
"plugin:react/jsx-runtime",
"plugin:import/typescript"
],
"settings": {
"import/resolver": {
"node": {
"paths": ["src"]
"paths": ["src"],
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
}
},
Expand All @@ -25,8 +28,17 @@
"sourceType": "module"
},
"plugins": ["only-warn", "react"],
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"parser": "@typescript-eslint/parser",
"extends": ["react-app", "plugin:@typescript-eslint/recommended"]
}
],
"rules": {
"no-underscore-dangle": "off",
"react/jsx-filename-extension": [1, { "extensions": [".tsx", ".jsx"] }],
"import/extensions": 0, // Turn off "Missing file extension for ..." error
"import/order": [
"error",
{
Expand All @@ -35,7 +47,15 @@
"caseInsensitive": true
},
"newlines-between": "always",
"groups": ["builtin", "external", "internal", "parent", "sibling", "index", "object"],
"groups": [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index",
"object"
],
"pathGroups": [
{
"pattern": "components/**",
Expand Down
6 changes: 5 additions & 1 deletion .github/mergify.yml
Expand Up @@ -3,7 +3,9 @@ pull_request_rules:
conditions:
- author~=^dependabot\[bot\]$
- check-success~=lint
- title~=Bump [^\s]+ from ([\d]+)\..+ to \1\.
- check-success~=build
- check-success~=test
- title~=^Bump [^\s]+ from ([\d]+)\..+ to \1\.
actions:
review:
type: APPROVE
Expand All @@ -14,6 +16,8 @@ pull_request_rules:
conditions:
- author=snyk-bot
- check-success~=lint
- check-success~=build
- check-success~=test
- title~=^\[Snyk\]
actions:
review:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/chromatic.yml
@@ -0,0 +1,36 @@
# Workflow name
name: "Chromatic"

# Event for the workflow
on:
push:
pull_request:
types: [opened, reopened]

# List of jobs
jobs:
chromatic-deployment:
# Operating System
runs-on: ubuntu-latest
environment: staging
# Job steps
steps:
- uses: actions/checkout@v1
# This extra step is not in the original chromatic workflow.
# This is to use a specific version of node (14.x), because the default is 16.x,
# which is not compatible with sass
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "14.x"
- name: Install dependencies
run: npm i
# 👇 Adds Chromatic as a step in the workflow
- name: Publish to Chromatic
uses: chromaui/action@v1
# Chromatic GitHub Action options
with:
token: ${{ secrets.GITHUB_TOKEN }}
# 👇 Chromatic projectToken, refer to the manage page to obtain it.
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
onlyChanged: true
94 changes: 94 additions & 0 deletions .github/workflows/ci-e2e.yml
@@ -0,0 +1,94 @@
name: ci-e2e

on:
pull_request:
branches: [master]

jobs:
install:
# NOTE: Netlify uses ubuntu 16.08 but Github Actions does not offer it by default.
# Hence, we default to the latest version.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "14.x"
- name: Cache Node.js modules
uses: actions/cache@v2
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- run: npm ci

lint:
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "14.x"
- name: Load Node.js modules
uses: actions/cache@v2
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npm run lint-fix
- run: npm run format-fix

build:
needs: lint
runs-on: ubuntu-latest
env:
CI: false
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "14.x"
- name: Load Node.js modules
uses: actions/cache@v2
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npm run build

test:
needs: build
runs-on: ubuntu-latest
environment: staging
env:
CYPRESS_RECORD_KEY: ${{secrets.CYPRESS_RECORD_KEY}}
CYPRESS_BASEURL: ${{secrets.CYPRESS_BASEURL}}
CYPRESS_COOKIE_NAME: ${{secrets.CYPRESS_COOKIE_NAME}}
CYPRESS_COOKIE_VALUE: ${{secrets.CYPRESS_COOKIE_VALUE}}
CYPRESS_TEST_REPO_NAME: ${{secrets.CYPRESS_TEST_REPO_NAME}}
USERNAME: ${{secrets.USERNAME}}
PERSONAL_ACCESS_TOKEN: ${{secrets.PERSONAL_ACCESS_TOKEN}}
E2E_COMMIT_HASH: ${{secrets.E2E_COMMIT_HASH}}
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "14.x"
- name: Load Node.js modules
uses: actions/cache@v2
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npm run test:ci
95 changes: 95 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,95 @@
name: ci

on:
push:
pull_request:
types: [opened, reopened]

jobs:
install:
# NOTE: Netlify uses ubuntu 16.08 but Github Actions does not offer it by default.
# Hence, we default to the latest version.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "14.x"
- name: Cache Node.js modules
uses: actions/cache@v2
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- run: npm ci

lint:
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "14.x"
- name: Load Node.js modules
uses: actions/cache@v2
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npm run lint-fix
- run: npm run format-fix

build:
needs: lint
runs-on: ubuntu-latest
env:
CI: false
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "14.x"
- name: Load Node.js modules
uses: actions/cache@v2
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npm run build

test:
needs: build
runs-on: ubuntu-latest
environment: staging
env:
CYPRESS_RECORD_KEY: ${{secrets.CYPRESS_RECORD_KEY}}
CYPRESS_BASEURL: ${{secrets.CYPRESS_BASEURL}}
CYPRESS_COOKIE_NAME: ${{secrets.CYPRESS_COOKIE_NAME}}
CYPRESS_COOKIE_VALUE: ${{secrets.CYPRESS_COOKIE_VALUE}}
CYPRESS_TEST_REPO_NAME: ${{secrets.CYPRESS_TEST_REPO_NAME}}
USERNAME: ${{secrets.USERNAME}}
PERSONAL_ACCESS_TOKEN: ${{secrets.PERSONAL_ACCESS_TOKEN}}
E2E_COMMIT_HASH: ${{secrets.E2E_COMMIT_HASH}}
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "14.x"
- name: Load Node.js modules
uses: actions/cache@v2
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npm run test
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -8,6 +8,7 @@
# testing
/coverage
/cypress/videos
/cypress/screenshots

# production
/build
Expand All @@ -24,3 +25,5 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

build-storybook.log
37 changes: 37 additions & 0 deletions .storybook/main.js
@@ -0,0 +1,37 @@
module.exports = {
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"storybook-preset-craco",
],
framework: "@storybook/react",
// webpackFinal setup retrieved from ChakraUI's own Storybook setup
// https://github.com/chakra-ui/chakra-ui/blob/main/.storybook/main.js
webpackFinal: async (storybookConfig) => {
// Required to sync aliases between storybook and overriden configs
return {
...storybookConfig,
module: {
rules: [
...storybookConfig.module.rules,
{
type: "javascript/auto",
test: /\.mjs$/,
include: /node_modules/,
},
],
},
resolve: {
...storybookConfig.resolve,
alias: {
...storybookConfig.resolve.alias,
// Required so storybook knows where the npm package is to render ChakraUI components
// as this is not directly installed in package.json.
"@emotion/core": "@emotion/react",
"emotion-theming": "@emotion/react",
},
},
}
},
}
9 changes: 9 additions & 0 deletions .storybook/preview.js
@@ -0,0 +1,9 @@
export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
}

0 comments on commit f2c50c6

Please sign in to comment.