Skip to content

Commit 144cf42

Browse files
authored
Initial commit
0 parents  commit 144cf42

25 files changed

+579
-0
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This file is for unifying the coding style for different editors and IDEs
2+
# editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
end_of_line = lf
8+
charset = utf-8
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
indent_style = space
12+
indent_size = 2

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NODE_OPTIONS = "--no-warnings=EXPERIMENTAL_FEATURE"

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto eol=lf

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
tags:
8+
- '!**'
9+
pull_request:
10+
branches:
11+
- main
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
test-and-build:
18+
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
node: [22]
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Setup Node.js ${{ matrix.node }}
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: ${{ matrix.node }}
29+
30+
- name: Install dependencies
31+
run: |
32+
if [ -f package-lock.json ]; then
33+
echo "package-lock.json found, using 'npm ci'"
34+
npm ci
35+
else
36+
echo "package-lock.json not found, using 'npm install'"
37+
npm install
38+
fi
39+
40+
- name: Run test
41+
run: npm test
42+
43+
- name: Run build
44+
run: npm run build

.github/workflows/publish.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2+
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3+
4+
name: Publish Package
5+
6+
on:
7+
push:
8+
tags:
9+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version-file: '.node-version'
21+
22+
- name: Install dependencies
23+
run: |
24+
if [ -f package-lock.json ]; then
25+
echo "package-lock.json found, using 'npm ci'"
26+
npm ci
27+
else
28+
echo "package-lock.json not found, using 'npm install'"
29+
npm install
30+
fi
31+
32+
- name: Run test
33+
run: npm test
34+
35+
- name: Run build
36+
run: npm run build
37+
38+
- name: Dry run publish
39+
run: npm pack -dry-run
40+
41+
- name: Upload artifact
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: dist
45+
path: dist
46+
retention-days: 1
47+
48+
publish:
49+
env:
50+
CHECK_NPM_TOKEN: ${{ secrets.NPM_TOKEN != '' }}
51+
needs: build
52+
runs-on: ubuntu-latest
53+
permissions:
54+
contents: read
55+
id-token: write
56+
steps:
57+
- uses: actions/checkout@v4
58+
59+
- name: Download artifact
60+
uses: actions/download-artifact@v4
61+
with:
62+
path: .
63+
64+
- name: Set npm registry url
65+
uses: actions/setup-node@v4
66+
with:
67+
node-version-file: '.node-version'
68+
registry-url: 'https://registry.npmjs.org'
69+
70+
- name: Dry run publish
71+
run: npm pack -dry-run
72+
73+
- name: Publish
74+
if: ${{ env.CHECK_NPM_TOKEN == 'true'}}
75+
env:
76+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
77+
run: npm publish . --provenance --access public
78+
79+
- name: Clean up
80+
uses: geekyeggo/delete-artifact@v5
81+
with:
82+
name: dist

.github/workflows/release-tag.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Publish Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
7+
8+
# $GITHUB_REF_NAME - https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
9+
10+
jobs:
11+
release:
12+
permissions:
13+
contents: write
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Create Release for Tag
19+
uses: elgohr/Github-Release-Action@v5
20+
env:
21+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
with:
23+
tag: ${{ github.ref }}
24+
title: ${{ github.ref_name }}

.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.DS_Store
2+
node_modules
3+
dist
4+
5+
/tests/e2e/videos/
6+
/tests/e2e/screenshots/
7+
8+
# local env files
9+
.env.local
10+
.env.*.local
11+
12+
# Log files
13+
npm-debug.log*
14+
yarn-debug.log*
15+
yarn-error.log*
16+
pnpm-debug.log*
17+
18+
.env*
19+
.flaskenv*
20+
!.env.project
21+
!.env.vault
22+
23+
package-lock.json
24+
pnpm-lock.yaml
25+
yarn.lock

.node-version

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

.npmignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/*
2+
!/dist
3+
!/LICENSE
4+
!/package.json

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict=true

0 commit comments

Comments
 (0)