Skip to content

Commit 3d6c142

Browse files
committed
chore: update project to v1.4.0
1 parent 233a708 commit 3d6c142

18 files changed

Lines changed: 2489 additions & 2549 deletions

.babelrc.json

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

.claude/settings.local.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(ls -la *.png)",
5+
"Bash(du -sh *.png)",
6+
"Bash(npm outdated:*)",
7+
"Bash(npm audit:*)",
8+
"Bash(yarn outdated:*)",
9+
"Bash(yarn audit:*)",
10+
"WebSearch",
11+
"WebFetch(domain:www.npmjs.com)",
12+
"WebFetch(domain:github.com)",
13+
"WebFetch(domain:reactscript.com)",
14+
"WebFetch(domain:thelinuxcode.com)",
15+
"Bash(yarn upgrade:*)",
16+
"Bash(yarn build:*)",
17+
"Bash(yarn build-storybook:*)"
18+
]
19+
}
20+
}

.eslintrc.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,16 @@ module.exports = {
1212
env: {
1313
browser: true,
1414
node: true,
15-
es6: true,
16-
jest: true
15+
es6: true
1716
},
1817
rules: {
1918
"no-control-regex": 0,
2019
'no-undef': 0,
2120
'no-unused-vars': 'off',
2221
'react/prop-types': 0,
23-
'@typescript-eslint/camelcase': 0,
2422
'@typescript-eslint/no-unused-vars': 1,
2523
'@typescript-eslint/no-use-before-define': 0,
2624
'@typescript-eslint/ban-ts-comment': 0,
27-
'@typescript-eslint/ban-ts-ignore': 0,
2825
'@typescript-eslint/explicit-member-accessibility': 0,
2926
'@typescript-eslint/member-delimiter-style': 0,
3027
'@typescript-eslint/no-empty-function': 0,

.github/workflows/main.yml

Lines changed: 5 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
1-
name: Release workflow
1+
name: Build workflow
22

33
on:
44
push:
55
branches: [main]
66

7-
env:
8-
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
9-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
10-
NPM_PACKAGE_NAME: 'react-usage-bar'
11-
VERSION: ''
12-
PUBLISHED_VERSION: ''
13-
NODE_VERSION: '20.x'
14-
157
jobs:
168
build-and-test:
179
runs-on: ubuntu-latest
@@ -21,69 +13,13 @@ jobs:
2113
node-version: [20.x]
2214

2315
steps:
24-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
2517
- name: Setup Node.js ${{ matrix.node-version }}
26-
uses: actions/setup-node@v3
18+
uses: actions/setup-node@v4
2719
with:
2820
node-version: ${{ matrix.node-version }}
29-
cache: 'npm'
21+
cache: 'yarn'
3022
- name: Install and Build
31-
run: | # Install npm packages and build the src files
32-
npm install --force
33-
npm run build --if-present
34-
35-
tag-and-npm-publish:
36-
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
37-
runs-on: ubuntu-latest
38-
permissions:
39-
contents: read
40-
id-token: write
41-
needs: [build-and-test]
42-
steps:
43-
- name: Check out repository code
44-
uses: actions/checkout@v4
45-
with:
46-
token: ${{ env.GITHUB_TOKEN }}
47-
- uses: actions/setup-node@v4
48-
with:
49-
node-version: ${{ env.NODE_VERSION }}
50-
check-latest: true
51-
- name: Set NPM
52-
run: |
53-
echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
54-
- name: Set version
55-
run: |
56-
echo VERSION=$(npm pkg get version | sed 's/"//g') >> $GITHUB_ENV
57-
echo PUBLISHED_VERSION=$(npm show $NPM_PACKAGE_NAME version) >> $GITHUB_ENV
58-
echo "VERSION ${VERSION}"
59-
echo "NPM_PACKAGE_NAME ${NPM_PACKAGE_NAME}"
60-
- name: Install dependecies
61-
if: ${{ env.VERSION != env.PUBLISHED_VERSION }}
6223
run: |
6324
yarn install
64-
- name: Build typescript
65-
if: ${{ env.VERSION != env.PUBLISHED_VERSION }}
66-
run: yarn build
67-
- run: npm publish --dry-run
68-
- uses: step-security/wait-for-secrets@v1
69-
id: wait-for-secrets
70-
with:
71-
secrets: |
72-
OTP:
73-
name: 'OTP to publish package'
74-
description: 'OTP from authenticator app'
75-
- name: Publish on NPM
76-
if: ${{ env.VERSION != env.PUBLISHED_VERSION }}
77-
run: |
78-
git tag v${VERSION} ${GITHUB_SHA} || exit 0
79-
git push origin v${VERSION}
80-
npm publish --otp ${{ steps.wait-for-secrets.outputs.OTP }}
81-
- name: Check loaded and NPM version
82-
if: ${{ env.VERSION == env.PUBLISHED_VERSION }}
83-
run: |
84-
echo "The loaded version is the same on npm. 0 new uploaded versions."
85-
exit 0;
86-
- name: Remove NPM token
87-
if: always()
88-
run: |
89-
rm .npmrc
25+
yarn build

.github/workflows/storybook.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ jobs:
66
build-and-deploy:
77
runs-on: ubuntu-latest
88
steps:
9-
- name: Checkout 🛎️
9+
- name: Checkout
1010
uses: actions/checkout@v4
1111
with:
1212
persist-credentials: false
13-
- name: Install and Build 🔧
14-
run: | # Install npm packages and build the Storybook files
15-
npm install --force
16-
npm run build-storybook
13+
- name: Install and Build
14+
run: |
15+
yarn install
16+
yarn build-storybook
1717
- name: Get commit info
1818
shell: bash
1919
run: |
2020
echo "sha_short=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
21-
- name: Deploy 🚀
21+
- name: Deploy
2222
uses: crazy-max/ghaction-github-pages@v4
2323
with:
2424
target_branch: docs

.storybook/preview.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { Preview } from '@storybook/react'
22

33
const preview: Preview = {
44
parameters: {
5-
actions: { argTypesRegex: '^on[A-Z].*' },
65
controls: {}
76
}
87
}

0 commit comments

Comments
 (0)