Skip to content

Commit c7a3594

Browse files
committed
feat: initial implement
1 parent e26eb00 commit c7a3594

22 files changed

+7816
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: setup-node
2+
3+
runs:
4+
using: composite
5+
steps:
6+
- uses: pnpm/[email protected]
7+
8+
- uses: actions/[email protected]
9+
with:
10+
node-version-file: '.node-version'
11+
cache: 'pnpm'
12+
13+
- run: pnpm i --frozen-lockfile
14+
shell: bash

.github/workflows/ci.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: 'Continuous Integration'
2+
3+
on:
4+
pull_request:
5+
types:
6+
- synchronize
7+
- opened
8+
- reopened
9+
push:
10+
branches:
11+
- main
12+
- 'releases/*'
13+
14+
jobs:
15+
build_and_test:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/[email protected]
19+
20+
- uses: ./.github/actions/setup-node
21+
22+
- run: pnpm build
23+
24+
- name: Compare the expected and actual dist/ directories
25+
id: diff
26+
run: |
27+
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
28+
echo "Detected uncommitted changes after build. See status below:"
29+
git diff
30+
exit 1
31+
fi
32+
33+
- name: Typecheck
34+
run: pnpm typecheck
35+
36+
- name: Test
37+
run: pnpm test
38+
39+
- name: Lint
40+
run: pnpm lint
41+
42+
- name: Generate
43+
run: |
44+
pnpm generate
45+
git diff --exit-code || exit 1
46+
47+
publish:
48+
runs-on: ubuntu-latest
49+
if: ${{ github.ref == 'refs/heads/main' && success() }}
50+
needs: build_and_test
51+
permissions:
52+
contents: write
53+
issues: write
54+
pull-requests: write
55+
steps:
56+
- uses: actions/[email protected]
57+
with:
58+
fetch-depth: 0
59+
persist-credentials: false
60+
61+
- uses: ./.github/actions/setup-node
62+
63+
- name: Release
64+
env:
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+
run: pnpm release

.github/workflows/commitlint.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Lint Commit Messages
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
9+
jobs:
10+
commitlint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/[email protected]
14+
with:
15+
fetch-depth: 0
16+
17+
- uses: wagoid/[email protected]

.gitignore

Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
/test.js
2+
3+
# Created by https://www.toptal.com/developers/gitignore/api/macos,windows,node
4+
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,windows,node
5+
6+
### macOS ###
7+
# General
8+
.DS_Store
9+
.AppleDouble
10+
.LSOverride
11+
12+
# Icon must end with two \r
13+
Icon
14+
15+
# Thumbnails
16+
._*
17+
18+
# Files that might appear in the root of a volume
19+
.DocumentRevisions-V100
20+
.fseventsd
21+
.Spotlight-V100
22+
.TemporaryItems
23+
.Trashes
24+
.VolumeIcon.icns
25+
.com.apple.timemachine.donotpresent
26+
27+
# Directories potentially created on remote AFP share
28+
.AppleDB
29+
.AppleDesktop
30+
Network Trash Folder
31+
Temporary Items
32+
.apdisk
33+
34+
### macOS Patch ###
35+
# iCloud generated files
36+
*.icloud
37+
38+
### Node ###
39+
# Logs
40+
logs
41+
*.log
42+
npm-debug.log*
43+
yarn-debug.log*
44+
yarn-error.log*
45+
lerna-debug.log*
46+
.pnpm-debug.log*
47+
48+
# Diagnostic reports (https://nodejs.org/api/report.html)
49+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
50+
51+
# Runtime data
52+
pids
53+
*.pid
54+
*.seed
55+
*.pid.lock
56+
57+
# Directory for instrumented libs generated by jscoverage/JSCover
58+
lib-cov
59+
60+
# Coverage directory used by tools like istanbul
61+
coverage
62+
*.lcov
63+
64+
# nyc test coverage
65+
.nyc_output
66+
67+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
68+
.grunt
69+
70+
# Bower dependency directory (https://bower.io/)
71+
bower_components
72+
73+
# node-waf configuration
74+
.lock-wscript
75+
76+
# Compiled binary addons (https://nodejs.org/api/addons.html)
77+
build/Release
78+
79+
# Dependency directories
80+
node_modules/
81+
jspm_packages/
82+
83+
# Snowpack dependency directory (https://snowpack.dev/)
84+
web_modules/
85+
86+
# TypeScript cache
87+
*.tsbuildinfo
88+
89+
# Optional npm cache directory
90+
.npm
91+
92+
# Optional eslint cache
93+
.eslintcache
94+
95+
# Optional stylelint cache
96+
.stylelintcache
97+
98+
# Microbundle cache
99+
.rpt2_cache/
100+
.rts2_cache_cjs/
101+
.rts2_cache_es/
102+
.rts2_cache_umd/
103+
104+
# Optional REPL history
105+
.node_repl_history
106+
107+
# Output of 'npm pack'
108+
*.tgz
109+
110+
# Yarn Integrity file
111+
.yarn-integrity
112+
113+
# dotenv environment variable files
114+
.env
115+
.env.development.local
116+
.env.test.local
117+
.env.production.local
118+
.env.local
119+
120+
# parcel-bundler cache (https://parceljs.org/)
121+
.cache
122+
.parcel-cache
123+
124+
# Next.js build output
125+
.next
126+
out
127+
128+
# Nuxt.js build / generate output
129+
.nuxt
130+
131+
# Gatsby files
132+
.cache/
133+
# Comment in the public line in if your project uses Gatsby and not Next.js
134+
# https://nextjs.org/blog/next-9-1#public-directory-support
135+
# public
136+
137+
# vuepress build output
138+
.vuepress/dist
139+
140+
# vuepress v2.x temp and cache directory
141+
.temp
142+
143+
# Docusaurus cache and generated files
144+
.docusaurus
145+
146+
# Serverless directories
147+
.serverless/
148+
149+
# FuseBox cache
150+
.fusebox/
151+
152+
# DynamoDB Local files
153+
.dynamodb/
154+
155+
# TernJS port file
156+
.tern-port
157+
158+
# Stores VSCode versions used for testing VSCode extensions
159+
.vscode-test
160+
161+
# yarn v2
162+
.yarn/cache
163+
.yarn/unplugged
164+
.yarn/build-state.yml
165+
.yarn/install-state.gz
166+
.pnp.*
167+
168+
### Node Patch ###
169+
# Serverless Webpack directories
170+
.webpack/
171+
172+
# Optional stylelint cache
173+
174+
# SvelteKit build / generate output
175+
.svelte-kit
176+
177+
### Windows ###
178+
# Windows thumbnail cache files
179+
Thumbs.db
180+
Thumbs.db:encryptable
181+
ehthumbs.db
182+
ehthumbs_vista.db
183+
184+
# Dump file
185+
*.stackdump
186+
187+
# Folder config file
188+
[Dd]esktop.ini
189+
190+
# Recycle Bin used on file shares
191+
$RECYCLE.BIN/
192+
193+
# Windows Installer files
194+
*.cab
195+
*.msi
196+
*.msix
197+
*.msm
198+
*.msp
199+
200+
# Windows shortcuts
201+
*.lnk
202+
203+
# End of https://www.toptal.com/developers/gitignore/api/macos,windows,node

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20.17.0

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/dist
2+
/pnpm-lock.yaml

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Knowledge Work Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)