Skip to content

Commit 3dbbd50

Browse files
committed
fix: initialization
1 parent 63389fd commit 3dbbd50

File tree

15 files changed

+10575
-463
lines changed

15 files changed

+10575
-463
lines changed

.eslintrc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"root": true,
3+
"env": {
4+
"browser": true,
5+
"es2021": true
6+
},
7+
"extends": ["standard-with-typescript", "prettier"],
8+
"plugins": ["prettier"],
9+
"parserOptions": {
10+
"ecmaVersion": "latest",
11+
"sourceType": "module"
12+
},
13+
"rules": {
14+
"@typescript-eslint/no-unsafe-argument": "warn"
15+
}
16+
}

.github/workflows/release.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Release bundle to package manager
2+
3+
on:
4+
pull_request:
5+
branches: [master]
6+
push:
7+
branches: [master]
8+
9+
permissions:
10+
id-token: write # to enable use of OIDC for npm provenance
11+
contents: write
12+
issues: write
13+
pull-requests: write
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Install Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: '20.x'
27+
28+
- name: Cache
29+
uses: actions/cache@v4
30+
with:
31+
path: |
32+
node_modules
33+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
34+
35+
- name: Install dependensies
36+
run: npm ci
37+
38+
- name: Build
39+
run: npm run build
40+
41+
- name: Upload dist
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: dist
45+
path: |
46+
dist/
47+
48+
tests:
49+
needs: build
50+
runs-on: ubuntu-latest
51+
52+
steps:
53+
- name: Checkout
54+
uses: actions/checkout@v4
55+
56+
- name: Cache
57+
uses: actions/cache@v4
58+
with:
59+
path: |
60+
node_modules
61+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
62+
63+
- name: Eslint
64+
run: npm run lint
65+
66+
- name: Prettier
67+
run: npm run format
68+
69+
- name: Typescript
70+
run: npm run type:check
71+
72+
release:
73+
needs: tests
74+
runs-on: ubuntu-latest
75+
76+
steps:
77+
- name: Checkout
78+
uses: actions/checkout@v4
79+
80+
- name: Install Node.js
81+
uses: actions/setup-node@v4
82+
with:
83+
node-version: '20.x'
84+
85+
- name: Cache
86+
uses: actions/cache@v4
87+
with:
88+
path: |
89+
node_modules
90+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
91+
92+
- name: Download Artifact
93+
uses: actions/download-artifact@v4
94+
with:
95+
name: dist
96+
path: ./dist
97+
98+
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
99+
run: npm audit signatures
100+
101+
- name: Release
102+
env:
103+
HUSKY: 0
104+
NPM_TOKEN: ${{ secrets.NPM_TOKEN_RELEASE }}
105+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
106+
run: npx semantic-release

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ dist-ssr
2222
*.njsproj
2323
*.sln
2424
*.sw?
25+
26+
CHANGELOG.md

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx --no -- commitlint --edit ${1}

.husky/pre-commit

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm run lint
5+
npm run format
6+
npm run type:check

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": false,
3+
"tabWidth": 2,
4+
"singleQuote": true,
5+
"printWidth": 120,
6+
"endOfLine": "lf"
7+
}

.releaserc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"branches": ["master"],
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
"@semantic-release/changelog",
7+
"@semantic-release/npm",
8+
"@semantic-release/github",
9+
"@semantic-release/git"
10+
]
11+
}

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
пожалуйста, фиксируйте версию пакета, если вы уверены в ней, это библиотека пока что не стабильна, и может иметь некоторые отличия в поведения взависимости от версии
1+
> [!WARNING]
2+
> Please lock the version of the package. This library is not stable yet and may have some behavioral differences depending on the version.

0 commit comments

Comments
 (0)