Skip to content

Commit fc1a212

Browse files
committed
first commit
0 parents  commit fc1a212

29 files changed

Lines changed: 5128 additions & 0 deletions

.github/workflows/demo.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Demo
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
jobs:
14+
build:
15+
name: 🏗️ Build
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: ⎔ Setup pnpm
22+
uses: pnpm/action-setup@v4
23+
with:
24+
version: 9
25+
26+
- name: ⎔ Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: 22
30+
cache: pnpm
31+
32+
- name: 📥 Install dependencies
33+
run: pnpm install --ignore-scripts --frozen-lockfile
34+
35+
- name: 🛠️ Build project
36+
run: pnpm demo
37+
38+
- name: 📄 Setup Pages
39+
uses: actions/configure-pages@v5
40+
41+
- name: 📤 Upload artifact
42+
uses: actions/upload-pages-artifact@v3
43+
with:
44+
path: './demo/dist'
45+
46+
- name: 🚀 Deploy to GitHub Pages
47+
id: deployment
48+
uses: actions/deploy-pages@v4

.github/workflows/release.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Release
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
tags:
9+
- 'v*'
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: ⎔ Setup pnpm
20+
uses: pnpm/action-setup@v4
21+
with:
22+
version: 9
23+
24+
- name: ⎔ Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: 22
28+
registry-url: 'https://registry.npmjs.org'
29+
cache: pnpm
30+
31+
- name: 📥 Install dependencies
32+
run: pnpm install --frozen-lockfile
33+
34+
- name: 🔍 Type Check
35+
run: pnpm run typecheck
36+
37+
- name: 🧪 Test
38+
run: pnpm run test
39+
40+
- name: 🏗️ Build
41+
run: pnpm run build
42+
43+
- name: 📦 Validate build artifacts
44+
run: |
45+
# Check if dist directory exists
46+
if [ ! -d "dist" ]; then
47+
echo "❌ dist directory is missing but declared in package.json"
48+
exit 1
49+
fi
50+
51+
# Check if dist contains files
52+
if [ -z "$(ls -A dist)" ]; then
53+
echo "❌ dist directory is empty"
54+
exit 1
55+
fi
56+
57+
# Check for index.js and index.d.ts
58+
if [ ! -f "dist/index.js" ] || [ ! -f "dist/index.d.ts" ]; then
59+
echo "❌ Missing required files in dist/"
60+
echo "Required: index.js and index.d.ts"
61+
echo "Found: $(ls dist)"
62+
exit 1
63+
fi
64+
65+
echo "✅ Build artifacts validation passed"
66+
67+
- name: 📦 Publish to NPM
68+
run: pnpm publish --no-git-checks
69+
env:
70+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
71+
72+
- name: 📝 Update Changelog
73+
run: npx changelogithub
74+
env:
75+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/test.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
pull_request:
9+
branches:
10+
- main
11+
12+
env:
13+
CLICOLOR: 1
14+
15+
jobs:
16+
test:
17+
runs-on: ubuntu-latest
18+
19+
permissions:
20+
contents: read
21+
pull-requests: write
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: ⎔ Setup pnpm
27+
uses: pnpm/action-setup@v4
28+
with:
29+
version: 9
30+
31+
- name: ⎔ Setup Node.js
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: 22
35+
cache: pnpm
36+
37+
- name: 📥 Install dependencies
38+
run: pnpm install --ignore-scripts --frozen-lockfile
39+
40+
- name: 🔍 Type Check
41+
run: pnpm run typecheck
42+
43+
- name: 🧪 Test
44+
run: pnpm run test
45+
46+
security:
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v4
50+
51+
- name: 🔍 Run CodeQL
52+
uses: github/codeql-action/init@v3
53+
with:
54+
languages: javascript
55+
56+
- name: 🔍 Perform Analysis
57+
uses: github/codeql-action/analyze@v3
58+
59+
60+
spelling:
61+
runs-on: ubuntu-latest
62+
steps:
63+
- uses: actions/checkout@v4
64+
65+
- name: 🔍 Spell Check Repo
66+
uses: crate-ci/typos@v1.34.0

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
coverage
3+
src/**.js
4+
scripts/**.js
5+
dist
6+
.DS_Store
7+
!.vscode

.vscode/launch.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"type": "node",
6+
"request": "launch",
7+
"name": "Debug Tests",
8+
"autoAttachChildProcesses": true,
9+
"skipFiles": ["<node_internals>/**", "**/node_modules/**"],
10+
"program": "${workspaceRoot}/node_modules/vitest/vitest.mjs",
11+
"args": ["run", "${file}"],
12+
"smartStep": true,
13+
"console": "integratedTerminal"
14+
},
15+
{
16+
"type": "chrome",
17+
"request": "launch",
18+
"name": "Debug Demo",
19+
"url": "http://localhost:5173",
20+
"webRoot": "${workspaceFolder}/demo"
21+
}
22+
]
23+
}

.vscode/settings.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"editor.defaultFormatter": "biomejs.biome",
4+
"editor.codeActionsOnSave": {
5+
"source.organizeImports.biome": "always",
6+
"quickfix.biome": "always"
7+
},
8+
"files.autoSave": "afterDelay",
9+
"files.autoSaveDelay": 1000,
10+
"[markdown]": {
11+
"editor.defaultFormatter": "esbenp.prettier-vscode"
12+
}
13+
}

CONTRIBUTING.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Contributing to codemirror-sql
2+
3+
Thanks for your interest in contributing! Here's how you can help:
4+
5+
## Development Setup
6+
7+
1. Fork and clone the repo
8+
2. Install dependencies: `pnpm install`
9+
3. Run tests: `pnpm test`
10+
4. Start dev environment: `pnpm dev`
11+
12+
## Development Process
13+
14+
1. Create a feature branch: `git checkout -b feature-name`
15+
2. Make your changes
16+
3. Run tests: `pnpm test`
17+
4. Run type checks: `pnpm typecheck`
18+
5. Run linting: `pnpm lint`
19+
6. Commit your changes using conventional commits
20+
7. Push to your fork and submit a pull request
21+
22+
## Pull Request Guidelines
23+
24+
- Include tests for any new functionality
25+
- Update documentation for API changes
26+
- Follow the existing code style
27+
- Keep PRs focused - one feature/fix per PR
28+
29+
## Commit Messages
30+
31+
We use conventional commits. Format:
32+
33+
```markdown
34+
type(scope): description
35+
36+
[optional body]
37+
[optional footer]
38+
```
39+
40+
Types:
41+
42+
- feat: New feature
43+
- fix: Bug fix
44+
- docs: Documentation only
45+
- style: Code style changes
46+
- refactor: Code changes that neither fixes a bug nor adds a feature
47+
- perf: Performance improvements
48+
- test: Adding or updating tests
49+
- chore: Changes to build process or auxiliary tools
50+
51+
## Release Process
52+
53+
For maintainers only:
54+
55+
```bash
56+
git checkout main
57+
git pull
58+
npx bumpp --no-git-check=false
59+
```
60+
61+
## Questions?
62+
63+
Open an issue or discussion if you have questions!

0 commit comments

Comments
 (0)