Skip to content

Commit

Permalink
fix: initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
melishev committed Feb 3, 2024
1 parent 63389fd commit 3dbbd50
Show file tree
Hide file tree
Showing 15 changed files with 10,575 additions and 463 deletions.
16 changes: 16 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"root": true,
"env": {
"browser": true,
"es2021": true
},
"extends": ["standard-with-typescript", "prettier"],
"plugins": ["prettier"],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"@typescript-eslint/no-unsafe-argument": "warn"
}
}
106 changes: 106 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Release bundle to package manager

on:
pull_request:
branches: [master]
push:
branches: [master]

permissions:
id-token: write # to enable use of OIDC for npm provenance
contents: write
issues: write
pull-requests: write

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'

- name: Cache
uses: actions/cache@v4
with:
path: |
node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

- name: Install dependensies
run: npm ci

- name: Build
run: npm run build

- name: Upload dist
uses: actions/upload-artifact@v4
with:
name: dist
path: |
dist/
tests:
needs: build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Cache
uses: actions/cache@v4
with:
path: |
node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

- name: Eslint
run: npm run lint

- name: Prettier
run: npm run format

- name: Typescript
run: npm run type:check

release:
needs: tests
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'

- name: Cache
uses: actions/cache@v4
with:
path: |
node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: dist
path: ./dist

- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: npm audit signatures

- name: Release
env:
HUSKY: 0
NPM_TOKEN: ${{ secrets.NPM_TOKEN_RELEASE }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ dist-ssr
*.njsproj
*.sln
*.sw?

CHANGELOG.md
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit ${1}
6 changes: 6 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint
npm run format
npm run type:check
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": false,
"tabWidth": 2,
"singleQuote": true,
"printWidth": 120,
"endOfLine": "lf"
}
11 changes: 11 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"branches": ["master"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/github",
"@semantic-release/git"
]
}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
пожалуйста, фиксируйте версию пакета, если вы уверены в ней, это библиотека пока что не стабильна, и может иметь некоторые отличия в поведения взависимости от версии
> [!WARNING]
> Please lock the version of the package. This library is not stable yet and may have some behavioral differences depending on the version.
Loading

0 comments on commit 3dbbd50

Please sign in to comment.