Skip to content

Commit d568f59

Browse files
committed
feat: main features
1 parent 84399de commit d568f59

39 files changed

+4184
-0
lines changed

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
indent_style = space
6+
indent_size = 2
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true
9+
10+
[*.{js,ts}]
11+
quote_type = single
12+
13+
[*.md]
14+
trim_trailing_whitespace = false

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
* text=auto eol=lf
2+
*.md text diff=markdown
3+
*.lockb binary diff=lockb
4+
*.json linguist-language=jsonc

.github/workflows/ci.yaml

Lines changed: 219 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- "*"
7+
pull_request:
8+
branches:
9+
- "*"
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
13+
cancel-in-progress: true
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
commit:
20+
name: Commit check
21+
runs-on: ubuntu-24.04
22+
steps:
23+
- name: Harden runner
24+
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
25+
with:
26+
disable-sudo: true
27+
egress-policy: block
28+
allowed-endpoints: >
29+
bun.sh:443
30+
github.com:443
31+
objects.githubusercontent.com:443
32+
registry.npmjs.org:443
33+
34+
- name: Git checkout
35+
if: github.event_name == 'push'
36+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
37+
with:
38+
fetch-depth: 1
39+
sparse-checkout: |
40+
.
41+
src
42+
persist-credentials: false
43+
44+
- name: Git checkout (full-history)
45+
if: github.event_name == 'pull_request'
46+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
47+
with:
48+
fetch-depth: 0
49+
sparse-checkout: |
50+
.
51+
src
52+
ref: ${{ github.head_ref }}
53+
repository: ${{ github.event.pull_request.head.repo.full_name }}
54+
persist-credentials: false
55+
56+
- name: Set up bun@latest
57+
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2.0.1
58+
59+
- name: Install dependencies
60+
run: bun ci
61+
62+
- name: Run check (push)
63+
if: github.event_name == 'push'
64+
run: bunx --bun commitlint --last --verbose
65+
66+
- name: Run check (pull_request)
67+
if: github.event_name == 'pull_request'
68+
run: bunx --bun commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
69+
70+
dependency:
71+
name: Dependency check
72+
runs-on: ubuntu-24.04
73+
permissions:
74+
pull-requests: write
75+
steps:
76+
- name: Harden runner
77+
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
78+
with:
79+
disable-sudo: true
80+
egress-policy: block
81+
allowed-endpoints: >
82+
api.github.com:443
83+
api.securityscorecards.dev:443
84+
github.com:443
85+
86+
- name: Git checkout
87+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
88+
with:
89+
fetch-depth: ${{ github.event_name == 'pull_request' && 1 || 2 }}
90+
repository: ${{ github.event.pull_request.head.repo.full_name }}
91+
persist-credentials: false
92+
93+
- name: Run check (push)
94+
if: github.event_name == 'push'
95+
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 #v4.5.0
96+
with:
97+
allow-licenses: MIT, ISC, CC0-1.0, Apache-2.0, BSD-3-Clause, Unlicense
98+
head-ref: ${{ github.sha }}
99+
base-ref: ${{ github.event.before }}
100+
fail-on-severity: low
101+
comment-summary-in-pr: never
102+
warn-on-openssf-scorecard-level: 3
103+
104+
- name: Run check (pull_request)
105+
if: github.event_name == 'pull_request'
106+
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 #v4.5.0
107+
with:
108+
allow-licenses: MIT, ISC, CC0-1.0, Apache-2.0, BSD-3-Clause, Unlicense
109+
fail-on-severity: low
110+
comment-summary-in-pr: on-failure
111+
warn-on-openssf-scorecard-level: 3
112+
113+
format:
114+
name: Format check
115+
runs-on: ubuntu-24.04
116+
steps:
117+
- name: Harden runner
118+
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
119+
with:
120+
disable-sudo: true
121+
egress-policy: block
122+
allowed-endpoints: >
123+
bun.sh:443
124+
github.com:443
125+
objects.githubusercontent.com:443
126+
github.com:443
127+
registry.npmjs.org:443
128+
129+
- name: Git checkout
130+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
131+
with:
132+
persist-credentials: false
133+
134+
- name: Set up bun@latest
135+
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2.0.1
136+
137+
- name: Install dependencies
138+
run: bun ci
139+
140+
- name: Run check
141+
run: bunx biome ci --reporter=github --max-diagnostics=none --no-errors-on-unmatched
142+
143+
spec:
144+
name: Spec check
145+
runs-on: ubuntu-24.04
146+
steps:
147+
- name: Harden runner
148+
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
149+
with:
150+
disable-sudo: true
151+
egress-policy: block
152+
allowed-endpoints: >
153+
bun.sh:443
154+
cli.codecov.io:443
155+
github.com:443
156+
ingest.codecov.io:443
157+
keybase.io:443
158+
objects.githubusercontent.com:443
159+
registry.npmjs.org:443
160+
storage.googleapis.com:443
161+
162+
- name: Git checkout
163+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
164+
with:
165+
persist-credentials: false
166+
167+
- name: Set up bun@latest
168+
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2.0.1
169+
170+
- name: Install dependencies
171+
run: bun ci
172+
173+
- name: Run check
174+
env:
175+
FORCE_COLOR: 3
176+
run: bun test --coverage --coverage-reporter=lcov --coverage-reporter=text --reporter=junit --reporter-outfile=junit.xml
177+
178+
- name: Upload lcov
179+
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
180+
with:
181+
fail_ci_if_error: true
182+
183+
- name: Upload test result
184+
uses: codecov/test-results-action@4e79e65778be1cecd5df25e14af1eafb6df80ea9 # v1.0.2
185+
with:
186+
fail_ci_if_error: true
187+
188+
type:
189+
name: Type check
190+
runs-on: ubuntu-24.04
191+
steps:
192+
- name: Harden runner
193+
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
194+
with:
195+
disable-sudo: true
196+
egress-policy: block
197+
allowed-endpoints: >
198+
api.github.com:443
199+
bun.sh:443
200+
github.com:443
201+
objects.githubusercontent.com:443
202+
github.com:443
203+
registry.npmjs.org:443
204+
205+
- name: Git checkout
206+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
207+
with:
208+
persist-credentials: false
209+
210+
- name: Set up bun@latest
211+
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2.0.1
212+
213+
- name: Install dependencies
214+
run: bun ci
215+
216+
- name: Run check
217+
run: |
218+
bunx tsc
219+
bunx type-coverage

.github/workflows/codeql.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
schedule:
11+
- cron: "0 0 * * 1"
12+
workflow_dispatch:
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
16+
cancel-in-progress: true
17+
18+
permissions:
19+
packages: read
20+
actions: read
21+
contents: read
22+
23+
jobs:
24+
analyze:
25+
name: Code analyze
26+
runs-on: ubuntu-24.04
27+
permissions:
28+
security-events: write
29+
strategy:
30+
matrix:
31+
include:
32+
- language: javascript-typescript
33+
build-mode: none
34+
steps:
35+
- name: Harden runner
36+
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
37+
with:
38+
disable-sudo: true
39+
egress-policy: block
40+
allowed-endpoints: >
41+
api.github.com:443
42+
github.com:443
43+
objects.githubusercontent.com
44+
uploads.github.com:443
45+
46+
- name: Git checkout
47+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
48+
with:
49+
persist-credentials: false
50+
51+
- name: Initialize CodeQL
52+
uses: github/codeql-action/init@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
53+
with:
54+
languages: ${{ matrix.language }}
55+
build-mode: ${{ matrix.build-mode }}
56+
57+
- name: Perform CodeQL Analysis
58+
uses: github/codeql-action/analyze@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
59+
with:
60+
category: "/language:${{matrix.language}}"

.github/workflows/release.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
publish:
17+
name: Publish release
18+
if: github.repository_owner == 'codeismyid'
19+
runs-on: ubuntu-24.04
20+
permissions:
21+
contents: write
22+
issues: write
23+
pull-requests: write
24+
id-token: write
25+
steps:
26+
- name: Harden runner
27+
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
28+
with:
29+
disable-sudo: true
30+
egress-policy: block
31+
allowed-endpoints: >
32+
api.github.com:443
33+
bun.sh:443
34+
fulcio.sigstore.dev:443
35+
github.com:443
36+
objects.githubusercontent.com:443
37+
registry.npmjs.org:443
38+
rekor.sigstore.dev:443
39+
tuf-repo-cdn.sigstore.dev:443
40+
uploads.github.com:443
41+
42+
- name: Git checkout (full-history)
43+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
44+
with:
45+
fetch-depth: 0
46+
persist-credentials: true
47+
48+
- name: Set up bun@latest
49+
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2.0.1
50+
51+
- name: Install dependencies
52+
run: bun ci
53+
54+
- name: Run check
55+
env:
56+
FORCE_COLOR: 3
57+
run: bun check
58+
59+
- name: Audit signatures
60+
run: npm audit signatures
61+
62+
- name: Build dist
63+
run: bun dist
64+
65+
- name: Publish
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
69+
run: bun release

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# external dependencies
2+
node_modules/
3+
4+
# distribution files
5+
dist
6+
7+
# TypeScript cache
8+
*.tsbuildinfo
9+
10+
# tarball
11+
*.tgz

0 commit comments

Comments
 (0)