Skip to content

Commit 68234ec

Browse files
committed
Initial
1 parent b07a139 commit 68234ec

27 files changed

+13580
-6
lines changed

.github/workflows/ci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [ main, master ]
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
11+
strategy:
12+
matrix:
13+
node-version: [16, 18, 20]
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
cache: 'npm'
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: Run linter
29+
run: npm run lint
30+
31+
- name: Run tests
32+
run: npm test
33+
34+
- name: Build package
35+
run: npm run build
36+
37+
- name: Check if dist directory exists
38+
run: |
39+
if [ ! -d "dist" ]; then
40+
echo "Build failed: dist directory not found"
41+
exit 1
42+
fi
43+
echo "Build successful: dist directory found"

.github/workflows/publish.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Publish to NPM
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
publish:
9+
description: 'Publish to npm'
10+
required: true
11+
default: 'false'
12+
type: choice
13+
options:
14+
- 'true'
15+
- 'false'
16+
17+
jobs:
18+
publish:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
25+
- name: Setup Node.js
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: '18'
29+
registry-url: 'https://registry.npmjs.org'
30+
31+
- name: Install dependencies
32+
run: npm ci
33+
34+
- name: Build package
35+
run: npm run build
36+
37+
- name: Publish to npm
38+
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true')
39+
run: npm publish --access public
40+
env:
41+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
dist

.npmignore

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Source files
2+
src/
3+
example/
4+
5+
# Configuration files
6+
tsconfig.json
7+
webpack.config.js
8+
.eslintrc.js
9+
jest.config.js
10+
11+
# Development dependencies
12+
node_modules/
13+
package-lock.json
14+
15+
# Build artifacts (keep dist)
16+
# dist/
17+
18+
# Documentation and meta files
19+
.github/
20+
.gitignore
21+
*.md
22+
!README.md
23+
24+
# Environment and temp files
25+
.env
26+
.env.*
27+
*.log
28+
*.tmp
29+
30+
# IDE files
31+
.vscode/
32+
.idea/
33+
*.swp
34+
*.swo
35+
36+
# OS files
37+
.DS_Store
38+
Thumbs.db

0 commit comments

Comments
 (0)