-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 68c3ccb
Showing
24 changed files
with
6,803 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"moderate": true, | ||
"allowlist": [], | ||
"retry-count": 10, | ||
"skip-dev": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/build | ||
/node_modules | ||
/coverage | ||
/examples | ||
!.eslintrc.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
module.exports = { | ||
root: true, | ||
parser: '@typescript-eslint/parser', | ||
extends: [ | ||
'airbnb-base', | ||
'plugin:@typescript-eslint/recommended', | ||
'prettier', | ||
'plugin:prettier/recommended', | ||
], | ||
parserOptions: { | ||
ecmaVersion: 2020, | ||
sourceType: 'module', | ||
}, | ||
env: { | ||
node: true, | ||
jest: true, | ||
}, | ||
rules: { | ||
'eol-last': ['error', 'always'], | ||
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }], | ||
'import/extensions': ['off'], | ||
'import/order': ['off'], | ||
'import/prefer-default-export': ['off'], | ||
'simple-import-sort/imports': 'warn', | ||
'simple-import-sort/exports': 'warn', | ||
'@typescript-eslint/no-empty-interface': ['off'], | ||
'@typescript-eslint/explicit-function-return-type': ['off'], | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['src/__mocks__/.*', '**/*.spec.ts', '**/*.spec.tsx'], | ||
rules: { | ||
'import/no-extraneous-dependencies': [ | ||
'error', | ||
{ devDependencies: true }, | ||
], | ||
'@typescript-eslint/no-empty-function': ['off'], | ||
'@typescript-eslint/no-non-null-assertion': ['off'], | ||
}, | ||
}, | ||
], | ||
settings: { | ||
'import/resolver': { | ||
node: { | ||
extensions: ['.js', '.ts', '.jsx', '.tsx'], | ||
}, | ||
}, | ||
}, | ||
plugins: ['simple-import-sort'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Back-merge | ||
|
||
description: Back-merge main into development. | ||
|
||
inputs: | ||
gh_token: | ||
description: The Github token to use for authentication. | ||
required: true | ||
git_user_email: | ||
description: The email of the user to use for the git commit. | ||
required: true | ||
git_user_name: | ||
description: The name of the user to use for the git commit. | ||
required: true | ||
main_branch: | ||
description: The main branch to back-merge from. | ||
required: false | ||
default: "main" | ||
|
||
runs: | ||
using: "composite" | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ inputs.gh_token }} | ||
|
||
- name: Setup git config | ||
shell: bash | ||
run: | | ||
git config --global user.email ${{ inputs.git_user_email }} | ||
git config --global user.name ${{ inputs.git_user_name }} | ||
- name: Merge main back to development | ||
shell: bash | ||
run: | | ||
git fetch --unshallow | ||
git checkout development | ||
git pull | ||
git merge --no-ff origin/${{ inputs.main_branch }} -m "Back-merge ${{ inputs.main_branch }} into development" | ||
git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Setup pnpm | ||
|
||
description: Setup pnpm with caching and install dependencies. | ||
|
||
inputs: | ||
npm_token: | ||
description: The npm token to use for authentication. | ||
required: true | ||
install_dependencies: | ||
description: Whether to install dependencies. | ||
required: false | ||
default: "true" | ||
|
||
runs: | ||
using: "composite" | ||
|
||
steps: | ||
- name: Install Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
id: pnpm-install | ||
with: | ||
version: 8 | ||
run_install: false | ||
|
||
- name: Set pnpm home | ||
shell: bash | ||
run: | | ||
echo "PNPM_HOME=$HOME/.local/share/pnpm" >> $GITHUB_ENV | ||
echo "$HOME/.local/share/pnpm" >> $GITHUB_PATH | ||
- name: Get pnpm store directory | ||
id: pnpm-cache | ||
shell: bash | ||
run: | | ||
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
- name: Setup pnpm cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Authenticate for private NPM package | ||
shell: bash | ||
env: | ||
NPM_TOKEN: ${{ inputs.npm_token }} | ||
run: | | ||
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc | ||
- name: Install dependencies | ||
shell: bash | ||
if: ${{ inputs.install_dependencies == 'true' }} | ||
run: | | ||
pnpm install --frozen-lockfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: Continuous Integration | ||
|
||
on: | ||
push: | ||
# branches-ignore: | ||
# - main | ||
# - development | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
audit: | ||
name: Audit | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [18, 20] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup pnpm | ||
uses: ./.github/actions/setup-pnpm | ||
with: | ||
npm_token: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Perform dependency audit | ||
run: | | ||
pnpm audit-ci --config .audit-ci.json | ||
lint: | ||
name: Lint | ||
needs: audit | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [18, 20] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup pnpm | ||
uses: ./.github/actions/setup-pnpm | ||
with: | ||
npm_token: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Execute lint | ||
run: | | ||
pnpm lint | ||
coverage: | ||
name: Coverage | ||
needs: audit | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [18, 20] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup pnpm | ||
uses: ./.github/actions/setup-pnpm | ||
with: | ||
npm_token: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Generate code coverage | ||
run: | | ||
pnpm test -- \ | ||
--ci \ | ||
--runInBand \ | ||
--coverage | ||
- name: Upload code coverage | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- development | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
release: | ||
name: Tag Release and deploy to NPM | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [18] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup pnpm | ||
uses: ./.github/actions/setup-pnpm | ||
with: | ||
npm_token: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Build | ||
run: | | ||
pnpm build | ||
- name: Create version and publish to NPM | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
run: | | ||
pnpm semantic-release | ||
- name: Merge main into development | ||
if: ${{ github.ref_name == 'main' }} | ||
uses: ./.github/actions/back-merge | ||
with: | ||
gh_token: ${{ secrets.GH_TOKEN }} | ||
git_user_email: ${{ secrets.GIT_USER_EMAIL }} | ||
git_user_name: ${{ secrets.GIT_USER_NAME }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# See https://help.github.com/ignore-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
.env | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Webstorm | ||
.idea | ||
|
||
# Typescript | ||
*.tsbuildinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# testing | ||
/coverage | ||
|
||
# server | ||
.audit-ci.json | ||
.env.sample | ||
.eslintignore | ||
.eslintrc.js | ||
.releaserc.yaml | ||
codecov.yml | ||
jest.config.js | ||
prettier.config.js | ||
tsconfig.json | ||
/.github | ||
/.vscode | ||
|
||
# source | ||
/src | ||
|
||
# expamples | ||
/examples | ||
|
||
# misc | ||
.DS_Store | ||
.env | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Webstorm | ||
.idea | ||
|
||
# Typescript | ||
tsconfig.tsbuildinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
branches: | ||
- main | ||
- name: development | ||
prerelease: alpha | ||
channel: alpha | ||
|
||
plugins: | ||
- - "@semantic-release/commit-analyzer" | ||
- preset: angular | ||
releaseRules: | ||
- scope: no-release | ||
release: false | ||
- type: build | ||
release: patch | ||
- type: chore | ||
release: patch | ||
- type: ci | ||
release: false | ||
- type: docs | ||
release: false | ||
- type: style | ||
release: patch | ||
- type: refactor | ||
release: patch | ||
- type: test | ||
release: patch | ||
- - "@semantic-release/release-notes-generator" | ||
- - "@semantic-release/npm" | ||
- - "@semantic-release/github" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"cSpell.words": ["Zaraz"], | ||
"typescript.tsdk": "node_modules/typescript/lib" | ||
} |
Oops, something went wrong.