Skip to content

Commit 7f0a67e

Browse files
committed
Refactor
1 parent 1ab9afa commit 7f0a67e

37 files changed

Lines changed: 13438 additions & 17835 deletions

.babelrc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"presets": ["env", "react", "stage-3"],
3-
"plugins": ["transform-class-properties", "react-css-modules"],
4-
"env": {
5-
"test": {
6-
"presets": ["env", "react", "stage-3"],
7-
"plugins": ["transform-class-properties", "react-css-modules"]
8-
}
9-
}
2+
"presets": ["@babel/preset-env", "@babel/preset-react"],
3+
"plugins": ["@babel/plugin-proposal-class-properties"],
4+
"env": {
5+
"test": {
6+
"presets": ["@babel/preset-env", "@babel/preset-react"],
7+
"plugins": ["@babel/plugin-proposal-class-properties"]
8+
}
9+
}
1010
}

.eslintrc.js

Lines changed: 24 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,30 @@
11
module.exports = {
2-
'env': {
3-
'browser': true,
4-
'commonjs': true
2+
env: {
3+
browser: true,
4+
commonjs: true,
55
},
6-
'extends': [
7-
'eslint:recommended',
8-
'plugin:react/recommended'
9-
],
10-
'parserOptions': {
11-
'ecmaFeatures': {
12-
'jsx': true
6+
extends: ['eslint:recommended', 'plugin:react/recommended'],
7+
parserOptions: {
8+
ecmaFeatures: {
9+
jsx: true,
1310
},
14-
'ecmaVersion': 2018,
15-
'sourceType': 'module'
11+
ecmaVersion: 2018,
12+
sourceType: 'module',
1613
},
17-
'plugins': [
18-
'react'
19-
],
20-
'settings': {
21-
'react': {
22-
'pragma': 'React',
23-
'version': '16.5.2',
24-
'flowVersion': '0.53'
14+
plugins: ['react'],
15+
settings: {
16+
react: {
17+
pragma: 'React',
18+
version: '16.5.2',
19+
flowVersion: '0.53',
2520
},
26-
'propWrapperFunctions': [ 'forbidExtraProps' ]
21+
propWrapperFunctions: ['forbidExtraProps'],
2722
},
28-
'rules': {
29-
'indent': [
30-
'error',
31-
'tab'
32-
],
33-
'linebreak-style': [
34-
'error',
35-
'windows'
36-
],
37-
'quotes': [
38-
'error',
39-
'single'
40-
],
41-
'semi': [
42-
'error',
43-
'always'
44-
],
45-
'no-unexpected-multiline': 0
46-
}
47-
};
23+
rules: {
24+
indent: ['error', 'tab'],
25+
'linebreak-style': ['error', 'unix'],
26+
quotes: ['error', 'single'],
27+
semi: ['error', 'always'],
28+
'no-unexpected-multiline': 0,
29+
},
30+
};

.github/dependabot.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
version: 2
77
updates:
8-
- package-ecosystem: "npm" # See documentation for possible values
9-
directory: "/" # Location of package manifests
8+
- package-ecosystem: 'npm' # See documentation for possible values
9+
directory: '/' # Location of package manifests
1010
schedule:
11-
interval: "weekly"
11+
interval: 'weekly'

.github/workflows/ci.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master, main]
6+
pull_request:
7+
branches: [master, main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [18.x, 20.x, 22.x]
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v5
20+
21+
- name: Use Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
cache: 'npm'
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Run linter
31+
run: npm run lint
32+
33+
- name: Run tests
34+
run: npm test
35+
36+
- name: Build library
37+
run: npm run transpile
38+
39+
- name: Build Storybook
40+
run: npm run storybook:build
41+
42+
security:
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Checkout repository
46+
uses: actions/checkout@v5
47+
48+
- name: Use Node.js 20
49+
uses: actions/setup-node@v4
50+
with:
51+
node-version: 20
52+
cache: 'npm'
53+
54+
- name: Install dependencies
55+
run: npm ci
56+
57+
- name: Run security audit
58+
run: npm audit --audit-level=high

.github/workflows/npm-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
build:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v5
1515
- uses: actions/setup-node@v3
1616
with:
1717
node-version: 16
@@ -22,7 +22,7 @@ jobs:
2222
needs: build
2323
runs-on: ubuntu-latest
2424
steps:
25-
- uses: actions/checkout@v3
25+
- uses: actions/checkout@v5
2626
- uses: actions/setup-node@v3
2727
with:
2828
node-version: 16

.github/workflows/npm.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ on: [push]
44

55
jobs:
66
build:
7-
87
runs-on: ubuntu-latest
98

109
steps:
11-
- uses: actions/checkout@v4
10+
- uses: actions/checkout@v5
1211
- name: Use Node.js
1312
uses: actions/setup-node@v3
1413
with:

.github/workflows/release.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v5
15+
16+
- name: Use Node.js 20
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 20
20+
cache: 'npm'
21+
registry-url: 'https://registry.npmjs.org'
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Run tests
27+
run: npm test
28+
29+
- name: Run linter
30+
run: npm run lint
31+
32+
- name: Build library
33+
run: npm run transpile
34+
35+
- name: Publish to npm
36+
run: npm publish
37+
env:
38+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
39+
40+
- name: Create GitHub Release
41+
uses: actions/create-release@v1
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
with:
45+
tag_name: ${{ github.ref }}
46+
release_name: Release ${{ github.ref }}
47+
draft: false
48+
prerelease: false

.github/workflows/storybook.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Deploy Storybook
2+
3+
on:
4+
push:
5+
branches: [master, main]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
environment:
17+
name: github-pages
18+
url: ${{ steps.deployment.outputs.page_url }}
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v5
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: 20
28+
cache: 'npm'
29+
30+
- name: Install dependencies
31+
run: npm ci
32+
33+
- name: Build Storybook
34+
run: npm run storybook:build
35+
36+
- name: Setup Pages
37+
uses: actions/configure-pages@v4
38+
39+
- name: Upload artifact
40+
uses: actions/upload-pages-artifact@v3
41+
with:
42+
path: ./.out
43+
44+
- name: Deploy to GitHub Pages
45+
id: deployment
46+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,50 @@ node_modules/
44
dist/
55
tests/__snapshots__/
66
.idea/
7+
8+
# Build outputs
9+
build/
10+
lib/
11+
coverage/
12+
13+
# Logs
14+
*.log
15+
npm-debug.log*
16+
yarn-debug.log*
17+
yarn-error.log*
18+
lerna-debug.log*
19+
20+
# Runtime data
21+
pids
22+
*.pid
23+
*.seed
24+
*.pid.lock
25+
26+
# IDE and editor files
27+
.vscode/
28+
*.swp
29+
*.swo
30+
*~
31+
32+
# OS generated files
33+
.DS_Store
34+
.DS_Store?
35+
._*
36+
.Spotlight-V100
37+
.Trashes
38+
ehthumbs.db
39+
Thumbs.db
40+
41+
# Temporary files
42+
.tmp/
43+
.temp/
44+
45+
# Environment variables
46+
.env
47+
.env.local
48+
.env.development.local
49+
.env.test.local
50+
.env.production.local
51+
52+
# Storybook
53+
storybook-static/

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20

0 commit comments

Comments
 (0)