Skip to content

Commit d99b5b7

Browse files
authored
Initial commit
0 parents  commit d99b5b7

24 files changed

+4362
-0
lines changed

.changeset/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Changesets
2+
[Changesets documentation](https://github.com/changesets/changesets#readme) • [Changesets common questions](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
3+
4+
<br>
5+
6+
## Commands
7+
8+
| Command | Description |
9+
| --- | --- |
10+
| `npx changeset` | Create a changeset. On commit & push, the Actions workflow will create a PR that versions the package and publishes it on merge. |
11+
| `npx changeset status` | Shows info on the current changesets. |
12+
| `npx changeset version` | Versions the package and updates the changelog using the previously created changesets. |
13+
| `npx changeset publish --otp=TOKEN` | Publishes to npm. Should be run after the changes made by `version` are pushed to main. Don't create any commits in between! |

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
github: Sv443
2+
ko_fi: Sv443
3+
custom: ['paypal.me/Sv443']
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: "Analyze Code with CodeQL"
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
jobs:
10+
analyze:
11+
name: Analyze Code
12+
13+
runs-on: ubuntu-latest
14+
15+
permissions:
16+
actions: read
17+
contents: read
18+
security-events: write
19+
20+
strategy:
21+
matrix:
22+
language: ["javascript-typescript"]
23+
# CodeQL supports "c-cpp", "csharp", "go", "java-kotlin", "javascript-typescript", "python", "ruby", "swift"
24+
# Learn more:
25+
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
with:
30+
submodules: recursive
31+
32+
- name: Initialize CodeQL
33+
uses: github/codeql-action/init@v3
34+
with:
35+
languages: ${{ matrix.language }}
36+
37+
- name: Perform CodeQL Analysis
38+
uses: github/codeql-action/analyze@v3
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: "Build and Publish on JSR"
2+
3+
on:
4+
# manual only for now
5+
workflow_dispatch:
6+
7+
concurrency: ${{ github.workflow }}-${{ github.ref }}
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [22.x]
16+
17+
permissions:
18+
contents: read
19+
id-token: write
20+
21+
env:
22+
CI: "true"
23+
STORE_PATH: ""
24+
PNPM_VERSION: 10
25+
RETENTION_DAYS: 2
26+
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v4
30+
31+
- name: Setup Node.js v${{ matrix.node-version }}
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: ${{ matrix.node-version }}
35+
36+
- name: Setup pnpm
37+
uses: pnpm/action-setup@v4
38+
with:
39+
version: ${{ env.PNPM_VERSION }}
40+
run_install: false
41+
42+
- name: Get pnpm store directory
43+
shell: bash
44+
run: |
45+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
46+
47+
- name: Setup pnpm cache
48+
uses: actions/cache@v4
49+
with:
50+
path: ${{ env.STORE_PATH }}
51+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
52+
restore-keys: |
53+
${{ runner.os }}-pnpm-store-
54+
55+
- name: Install dependencies
56+
run: pnpm i
57+
58+
- name: Build package
59+
run: pnpm build-all
60+
61+
- name: Publish on JSR
62+
run: pnpm publish-package-jsr
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: "Build and Publish on NPM"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
env:
9+
PR_TITLE: "Create Release"
10+
COMMIT_MSG: "chore: create new release"
11+
12+
concurrency: ${{ github.workflow }}-${{ github.ref }}
13+
14+
jobs:
15+
publish:
16+
runs-on: ubuntu-latest
17+
18+
strategy:
19+
matrix:
20+
node-version: [22.x]
21+
22+
permissions:
23+
contents: write # For pushing Git tags and creating releases
24+
pull-requests: write # For creating the changesets relese PR
25+
id-token: write # The OIDC ID token is used for authentication with JSR
26+
27+
env:
28+
CI: "true"
29+
STORE_PATH: ""
30+
PNPM_VERSION: 10
31+
RETENTION_DAYS: 2
32+
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v4
36+
37+
- name: Setup Node.js v${{ matrix.node-version }}
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: ${{ matrix.node-version }}
41+
42+
- name: Setup pnpm
43+
uses: pnpm/action-setup@v4
44+
with:
45+
version: ${{ env.PNPM_VERSION }}
46+
run_install: false
47+
48+
- name: Get pnpm store directory
49+
shell: bash
50+
run: |
51+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
52+
53+
- name: Setup pnpm cache
54+
uses: actions/cache@v4
55+
with:
56+
path: ${{ env.STORE_PATH }}
57+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
58+
restore-keys: |
59+
${{ runner.os }}-pnpm-store-
60+
61+
- name: Install dependencies
62+
run: pnpm i
63+
64+
- name: Build package
65+
run: pnpm build-all
66+
67+
- name: Create artifact
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: dist
71+
path: dist/
72+
retention-days: ${{ env.RETENTION_DAYS }}
73+
74+
- name: Create release or publish package
75+
uses: changesets/action@v1
76+
id: changesets
77+
with:
78+
publish: npm run publish-package
79+
commit: ${{ env.COMMIT_MSG }}
80+
title: ${{ env.PR_TITLE }}
81+
env:
82+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: "Lint and test code"
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
jobs:
10+
lint-test:
11+
name: Lint and test
12+
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
matrix:
17+
node-version: [22.x]
18+
19+
env:
20+
CI: "true"
21+
STORE_PATH: ""
22+
PNPM_VERSION: 10
23+
RETENTION_DAYS: 2
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
29+
- name: Setup Node.js v${{ matrix.node-version }}
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: ${{ matrix.node-version }}
33+
34+
- name: Setup pnpm
35+
uses: pnpm/action-setup@v4
36+
with:
37+
version: ${{ env.PNPM_VERSION }}
38+
run_install: false
39+
40+
- name: Get pnpm store directory
41+
shell: bash
42+
run: |
43+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
44+
45+
- name: Setup pnpm cache
46+
uses: actions/cache@v4
47+
with:
48+
path: ${{ env.STORE_PATH }}
49+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
50+
restore-keys: |
51+
${{ runner.os }}-pnpm-store-
52+
53+
- name: Install dependencies
54+
run: pnpm i
55+
56+
- name: Lint
57+
run: pnpm lint
58+
59+
- name: Test
60+
run: pnpm test-coverage
61+
62+
- name: Upload coverage report
63+
uses: actions/upload-artifact@v4
64+
with:
65+
name: coverage
66+
path: coverage/lcov-report/
67+
retention-days: ${{ env.RETENTION_DAYS }}
68+
69+
- name: Upload coverage to Coveralls
70+
uses: coverallsapp/github-action@v2

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
dist/
3+
test.ts
4+
coverage/
5+
.env

.vscode/extensions.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"recommendations": [
3+
"dbaeumer.vscode-eslint",
4+
"MylesMurphy.prettify-ts",
5+
"yoavbls.pretty-ts-errors",
6+
"fabiospampinato.vscode-highlight",
7+
]
8+
}

.vscode/launch.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "fix-dts",
6+
"type": "node",
7+
"request": "launch",
8+
"program": "${workspaceFolder}/tools/fix-dts.mts",
9+
"runtimeExecutable": "tsx",
10+
"console": "integratedTerminal",
11+
"internalConsoleOptions": "neverOpen",
12+
"skipFiles": [
13+
"<node_internals>/**",
14+
"${workspaceFolder}/node_modules/**"
15+
]
16+
},
17+
{
18+
"name": "test.ts",
19+
"type": "node",
20+
"request": "launch",
21+
"program": "${workspaceFolder}/test.ts",
22+
"runtimeExecutable": "tsx",
23+
"console": "integratedTerminal",
24+
"internalConsoleOptions": "neverOpen",
25+
"skipFiles": [
26+
"<node_internals>/**",
27+
"${workspaceFolder}/node_modules/**"
28+
]
29+
},
30+
]
31+
}

0 commit comments

Comments
 (0)