Skip to content

Commit 74b2d3b

Browse files
authored
feat/odedgo/refactor (#35)
1 parent ff11fcc commit 74b2d3b

File tree

110 files changed

+13553
-1885
lines changed

Some content is hidden

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

110 files changed

+13553
-1885
lines changed

.babelrc

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

.eslintignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
dist/
1+
dist/
2+
storybook-static/
3+
node_modules/
4+
coverage/
5+
.yarn/

.eslintrc.js

Lines changed: 48 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,50 @@
11
module.exports = {
2-
'env': {
3-
'es6': true,
4-
'jest': true,
5-
'node': true,
6-
'browser': true
7-
},
8-
'extends': [
9-
'eslint:recommended',
10-
'plugin:react/recommended',
11-
'plugin:import/errors',
12-
'plugin:import/warnings',
13-
// 'plugin:react-hooks'
14-
],
15-
'parserOptions': {
16-
'ecmaVersion': 2018,
17-
'sourceType': 'module'
18-
},
19-
'settings': {
20-
'react': {
21-
'version': '16.8.0'
22-
},
23-
},
24-
'rules': {
25-
'indent': [
26-
'off',
27-
'tab'
28-
],
29-
'quotes': [
30-
'error',
31-
'single'
32-
],
33-
'semi': [
34-
'error',
35-
'always'
36-
],
37-
'eqeqeq': [
38-
'error',
39-
'always'
40-
],
41-
'no-trailing-spaces': ['error', { 'ignoreComments': true }],
42-
'consistent-this': 2,
43-
'import/no-self-import': 2,
44-
'import/no-internal-modules': 0,
45-
'import/no-dynamic-require': 0,
46-
'import/no-useless-path-segments': 2,
47-
'import/order': 1,
48-
'import/newline-after-import': 2,
49-
// "react-hooks/rules-of-hooks": "error",
50-
// "react-hooks/exhaustive-deps": "warn"
51-
}
2+
root: true,
3+
env: {
4+
browser: true,
5+
es2021: true,
6+
node: true,
7+
},
8+
extends: [
9+
'eslint:recommended',
10+
'plugin:react/recommended',
11+
'plugin:react-hooks/recommended',
12+
'plugin:import/recommended',
13+
'plugin:import/typescript',
14+
'plugin:@typescript-eslint/recommended',
15+
],
16+
parser: '@typescript-eslint/parser',
17+
parserOptions: {
18+
ecmaFeatures: {
19+
jsx: true,
20+
},
21+
ecmaVersion: 'latest',
22+
sourceType: 'module',
23+
},
24+
plugins: ['react', 'react-hooks', 'import', '@typescript-eslint'],
25+
rules: {
26+
'react/react-in-jsx-scope': 'off',
27+
'react/prop-types': 'off',
28+
'react-hooks/rules-of-hooks': 'error',
29+
'react-hooks/exhaustive-deps': 'warn',
30+
'import/order': [
31+
'error',
32+
{
33+
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
34+
alphabetize: { order: 'asc', caseInsensitive: true },
35+
},
36+
],
37+
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
38+
'@typescript-eslint/no-explicit-any': 'warn',
39+
},
40+
settings: {
41+
react: {
42+
version: 'detect',
43+
},
44+
'import/resolver': {
45+
node: {
46+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
47+
},
48+
},
49+
},
5250
};

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '20.12.2'
20+
cache: 'yarn'
21+
22+
- name: Install dependencies
23+
run: yarn install --frozen-lockfile
24+
25+
- name: Run linting
26+
run: yarn lint
27+
28+
- name: Run tests
29+
run: yarn test
30+
31+
- name: Build package
32+
run: yarn build
33+
34+
- name: Build Storybook
35+
run: yarn build-storybook
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Storybook CI/CD
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build-storybook:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Setup Node.js
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: '18'
18+
cache: 'yarn'
19+
20+
- name: Install dependencies
21+
run: yarn install --frozen-lockfile
22+
23+
- name: Build Storybook
24+
run: yarn build-storybook
25+
26+
deploy-storybook:
27+
needs: build-storybook
28+
if: github.ref == 'refs/heads/master'
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
33+
- name: Setup Node.js
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: '18'
37+
cache: 'yarn'
38+
39+
- name: Install dependencies
40+
run: yarn install --frozen-lockfile
41+
42+
- name: Build Storybook
43+
run: yarn build-storybook
44+
45+
- name: Deploy to GitHub Pages
46+
uses: JamesIves/github-pages-deploy-action@v4
47+
with:
48+
branch: gh-pages
49+
folder: storybook-static
50+
clean: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules
22
dist
33
package-lock.json
4+
storybook-static
45
.idea

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
14
1+
20.12.2

.prettierrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"tabWidth": 2,
5+
"trailingComma": "es5",
6+
"printWidth": 180,
7+
"bracketSpacing": true,
8+
"arrowParens": "avoid"
9+
}

.storybook/main.js

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

.storybook/main.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import type { StorybookConfig } from '@storybook/react-webpack5';
2+
3+
const config: StorybookConfig = {
4+
framework: {
5+
name: '@storybook/react-webpack5',
6+
options: {
7+
builder: {
8+
useSWC: true,
9+
},
10+
},
11+
},
12+
13+
stories: [`${process.cwd()}/stories/**/*.stories.@(js|tsx)`],
14+
addons: ['@storybook/addon-essentials', '@storybook/addon-links', '@storybook/preset-scss', '@storybook/addon-webpack5-compiler-swc'],
15+
16+
docs: {
17+
autodocs: false,
18+
},
19+
};
20+
21+
export default config;

0 commit comments

Comments
 (0)