Skip to content
This repository has been archived by the owner on May 25, 2023. It is now read-only.

Commit

Permalink
build: update deps and semantic release (#1333)
Browse files Browse the repository at this point in the history
* build: update non-breaking changes dependencies

* build: update eslint configuration and remove redundant react-scripts

* build: update react-markdown dependency and mock tests

* fix: correct test and release flows

* fix: correct static build

* build: correct static build dependencies

* build: add missing webpack stray dependencies

* build: update final deps

* refactor: correct minor storybook breaking change

* fix: correct react-loading-skeleton and comment

* build: update react-loading-skeleton gracefully now

* build: add more minor dependency updates
  • Loading branch information
0-vortex committed Dec 15, 2021
1 parent 8c27f01 commit bf2501d
Show file tree
Hide file tree
Showing 13 changed files with 29,668 additions and 44,875 deletions.
132 changes: 132 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
process.env.NODE_ENV = "development";

module.exports = {
"env": {
"browser": true,
"jest": true,
"es2021": true
},
"parser": "@babel/eslint-parser",
"settings": {
"react": {
"version": "detect"
}
},
"plugins": [
"react",
"import",
"prettier"
],
"parserOptions": {
"ecmaFeatures": {
"arrowFunctions": true,
"binaryLiterals": true,
"blockBindings": true,
"classes": true,
"defaultParams": true,
"destructuring": true,
"forOf": true,
"generators": true,
"jsx": true,
"modules": true,
"objectLiteralShorthandMethods": true,
"objectLiteralShorthandProperties": true,
"octalLiterals": true,
"spread": true,
"templateStrings": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"rules": {
"no-control-regex": 2,
"no-debugger": 2,
"no-dupe-args": 2,
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-empty-character-class": 2,
"no-ex-assign": 2,
"no-extra-boolean-cast": 2,
"no-extra-semi": 2,
"no-invalid-regexp": 2,
"no-irregular-whitespace": 1,
"no-proto": 2,
"no-unexpected-multiline": 2,
"no-unreachable": 2,
"valid-typeof": 2,
"no-fallthrough": 2,
"no-redeclare": 2,
"comma-spacing": 2,
"eol-last": 2,
"eqeqeq": ["error", "smart"],
"indent": [2, 2, {"SwitchCase": 1}],
"keyword-spacing": 2,
"max-len": [1, 160, 2],
"new-parens": 2,
"no-mixed-spaces-and-tabs": 2,
"no-multiple-empty-lines": [2, {"max": 2}],
"no-trailing-spaces": 2,
"object-curly-spacing": [2, "never"],
"quotes": [2, "double", "avoid-escape"],
"semi": 1,
"space-before-blocks": [2, "always"],
"space-before-function-paren": [2, "never"],
"space-in-parens": [2, "never"],
"space-infix-ops": 2,
"space-unary-ops": 2,
"arrow-spacing": [2, {"before": true, "after": true}],
"prefer-const": 2,
"jsx-quotes": [2, "prefer-double"],
"import/no-unresolved": [1, {"commonjs": true, "amd": true}],
"import/export": 2,
"strict": [2, "global"],
"no-undef": 2,
"no-unused-vars": [2, {"args": "none"}],
"react/forbid-prop-types": 1,
"react/jsx-boolean-value": 1,
"react/jsx-curly-spacing": 1,
"react/jsx-equals-spacing": 1,
"react/jsx-handler-names": 1,
"react/jsx-indent": [2, 2],
"react/jsx-no-duplicate-props": 1,
"react/jsx-no-undef": 1,
"react/jsx-pascal-case": 1,
"react/jsx-sort-prop-types": 0,
"react/jsx-uses-react": 1,
"react/jsx-uses-vars": 1,
"react/no-danger": 1,
"react/no-deprecated": 1,
"react/no-did-mount-set-state": 0,
"react/no-did-update-set-state": 1,
"react/no-direct-mutation-state": 1,
"react/no-is-mounted": 1,
"react/no-multi-comp": 0,
"react/no-string-refs": 1,
"react/no-unknown-property": 1,
"react/react-in-jsx-scope": 1,
"import/extensions": 1,
"react/self-closing-comp": 1,
"react/sort-comp": 1,
"react/prefer-stateless-function": 1
},
"ignorePatterns": [
"build",
"docs",
"public"
],
"globals": {
"module": true,
"process": true,
"global": true
// "netlify": true,
// "App": true,
// "describe": true,
// "it": true,
// "beforeEach": true,
// "afterEach": true,
// "require": true,
// "ENV": true,
// "Promise": true,
// "SyntheticEvent": true,
}
};
147 changes: 0 additions & 147 deletions .eslintrc.yml

This file was deleted.

34 changes: 3 additions & 31 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
release:
environment:
name: production
url: https://github.com/${{ github.repository }}/releases/tag/v${{ steps.release.outputs.version }}
url: https://github.com/${{ github.repository }}/releases/tag/${{ steps.semantic-release.outputs.release-tag }}
name: Semantic release
needs:
- docker
Expand All @@ -107,25 +107,6 @@ jobs:
with:
fetch-depth: 0

- name: "🔧 setup node"
uses: actions/setup-node@v2.1.5
with:
node-version: 16

- name: "🔧 setup cache"
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/npm-shrinkwrap.json', '**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: "🔧 install npm@latest"
run: npm i -g npm@latest

- name: "📦 install dependencies"
run: npm ci

- name: "📂 download docker artifacts"
uses: actions/download-artifact@v2
with:
Expand All @@ -144,19 +125,10 @@ jobs:
path: /tmp/build

- name: "🚀 release"
id: release
id: semantic-release
uses: open-sauced/semantic-release-conventional-config@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_USERNAME: ${{ github.repository_owner }}
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
GIT_AUTHOR_NAME: ${{ github.event.commits[0].author.username }}
GIT_AUTHOR_EMAIL: ${{ github.event.commits[0].author.email }}
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}
run: |
cp -R /tmp/build ./build
npm run semantic-release
echo "::set-output name=version::$(cat package.json | jq -r '.version')"

cleanup:
name: Cleanup actions
Expand Down
8 changes: 1 addition & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,9 @@ storybook-static
.env
npm-debug.log

# jest test
# jest test
src/tests/__snapshots__/

.DS_Store
../.DS_Store
../../.DS_Store

#ignore wallaby.js
wallaby.js
babel.config.js
jest.config.js
svgTransform.js
3 changes: 3 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@ module.exports = {
"@storybook/addon-essentials",
"@storybook/addon-storysource",
"storybook-dark-mode",
],
"staticDirs": [
'../.storybook'
]
}
7 changes: 7 additions & 0 deletions config/jest/react-markdown.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from "react";

const ReactMarkdown = ({children}) => {
return <>{children}</>;
};

export default ReactMarkdown;
25 changes: 25 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
"moduleFileExtensions": [
"jsx",
"js",
"json"
],
"globals": {
"window": true
},
"moduleNameMapper": {
"^.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/config/jest/FileStub.js",
"^.+\\.css$": "<rootDir>/config/jest/CSSStub.js",
"react-markdown": "<rootDir>/config/jest/react-markdown.js"
},
"setupFiles": [
"<rootDir>/config/polyfills.js",
"<rootDir>/src/setupTestFramework.js",
"jest-localstorage-mock"
],
"testPathIgnorePatterns": [
"<rootDir>/(build|docs|node_modules)/"
],
"testEnvironment": "node",
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(js|jsx)$",
};

0 comments on commit bf2501d

Please sign in to comment.