Skip to content

Commit 2b0f92a

Browse files
committed
initial
0 parents  commit 2b0f92a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+29045
-0
lines changed

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
3+
"changelog": "@changesets/changelog-git",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": ["code-components"]
11+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: Bug Report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Description
10+
11+
A clear and concise description of what the bug is.
12+
13+
## Steps to Reproduce
14+
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
## Expected Behavior
21+
22+
A clear and concise description of what you expected to happen.
23+
24+
## Actual Behavior
25+
26+
A clear and concise description of what actually happened.
27+
28+
## Environment
29+
30+
- Package: [scripts / code-components]
31+
- Version: [e.g. 1.0.0]
32+
- Browser: [e.g. Chrome 120]
33+
- OS: [e.g. macOS 14]
34+
35+
## Additional Context
36+
37+
Add any other context, screenshots, or error messages about the problem here.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Description
10+
11+
A clear and concise description of the feature you'd like to see.
12+
13+
## Problem Statement
14+
15+
What problem does this feature solve? What pain point does it address?
16+
17+
## Proposed Solution
18+
19+
Describe how you envision this feature working.
20+
21+
## Alternatives Considered
22+
23+
Describe any alternative solutions or features you've considered.
24+
25+
## Additional Context
26+
27+
Add any other context, mockups, or examples about the feature request here.
28+
29+
## Package
30+
31+
- [ ] `scripts`
32+
- [ ] `code-components`
33+
- [ ] Both

.github/pull_request_template.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## Description
2+
3+
Brief description of changes
4+
5+
## Type of Change
6+
7+
- [ ] Bug fix
8+
- [ ] New feature
9+
- [ ] Breaking change
10+
- [ ] Documentation update
11+
12+
## Packages Affected
13+
14+
- [ ] `scripts`
15+
- [ ] `code-components`
16+
- [ ] Both
17+
18+
## Changeset
19+
20+
- [ ] Changeset created (`pnpm changeset`)
21+
- [ ] No changeset needed (no version bump)
22+
23+
## Testing
24+
25+
- [ ] Tested locally
26+
- [ ] All builds pass
27+
- [ ] Linting passes
28+
- [ ] Type checking passes
29+
30+
## Checklist
31+
32+
- [ ] Code follows project style guidelines
33+
- [ ] Self-review completed
34+
- [ ] Comments added for complex code
35+
- [ ] Documentation updated (if needed)
36+
- [ ] No console.logs or debug code left
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build Scripts
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [main]
7+
paths:
8+
- 'packages/scripts/**'
9+
- '.github/workflows/build-scripts.yml'
10+
11+
jobs:
12+
build-scripts:
13+
name: Build Scripts Package
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: pnpm/action-setup@v4
19+
with:
20+
version: 10.20.0
21+
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: '20'
25+
cache: 'pnpm'
26+
27+
- name: Install dependencies
28+
run: pnpm install --frozen-lockfile
29+
30+
- name: Build scripts package
31+
run: pnpm --filter scripts build
32+
33+
- name: Upload build artifacts
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: scripts-dist
37+
path: packages/scripts/dist/**
38+
retention-days: 30

.github/workflows/ci.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
9+
jobs:
10+
lint-and-typecheck:
11+
name: Lint and Type Check
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: pnpm/action-setup@v4
16+
with:
17+
version: 10.20.0
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: '20'
21+
cache: 'pnpm'
22+
23+
- name: Install dependencies
24+
run: pnpm install --frozen-lockfile
25+
26+
- name: Lint
27+
run: pnpm lint
28+
29+
- name: Type check
30+
run: pnpm check
31+
32+
build:
33+
name: Build Packages
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: pnpm/action-setup@v4
38+
with:
39+
version: 10.20.0
40+
- uses: actions/setup-node@v4
41+
with:
42+
node-version: '20'
43+
cache: 'pnpm'
44+
45+
- name: Install dependencies
46+
run: pnpm install --frozen-lockfile
47+
48+
- name: Build all packages
49+
run: pnpm build

.github/workflows/release.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
name: Release
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
pull-requests: write
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- uses: pnpm/action-setup@v4
21+
with:
22+
version: 10.20.0
23+
24+
- uses: actions/setup-node@v4
25+
with:
26+
node-version: '20'
27+
cache: 'pnpm'
28+
29+
- name: Install dependencies
30+
run: pnpm install --frozen-lockfile
31+
32+
- name: Build packages
33+
run: pnpm build
34+
35+
- name: Commit dist folder (if changed)
36+
run: |
37+
git config user.name "github-actions[bot]"
38+
git config user.email "github-actions[bot]@users.noreply.github.com"
39+
git add packages/scripts/dist/
40+
if git diff --staged --quiet; then
41+
echo "No changes to dist folder"
42+
else
43+
git commit -m "chore: build scripts package"
44+
git push
45+
fi
46+
47+
- name: Create Release Pull Request or Publish
48+
id: changesets
49+
uses: changesets/action@v1
50+
with:
51+
publish: pnpm changeset publish
52+
version: pnpm changeset version
53+
commit: 'chore: version packages'
54+
title: 'chore: version packages'
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
58+
- name: Get Scripts Package Version
59+
if: steps.changesets.outputs.published == 'true'
60+
id: version
61+
run: |
62+
VERSION=$(grep -o '"version": "[^"]*"' packages/scripts/package.json | cut -d'"' -f4)
63+
echo "version=$VERSION" >> $GITHUB_OUTPUT
64+
echo "tag=v$VERSION" >> $GITHUB_OUTPUT
65+
echo "Released version: $VERSION"
66+
67+
- name: Create Git Tag
68+
if: steps.changesets.outputs.published == 'true'
69+
run: |
70+
git config user.name "github-actions[bot]"
71+
git config user.email "github-actions[bot]@users.noreply.github.com"
72+
git tag -a "${{ steps.version.outputs.tag }}" -m "Release ${{ steps.version.outputs.tag }}"
73+
git push origin "${{ steps.version.outputs.tag }}"
74+
75+
- name: Create GitHub Release for Scripts
76+
if: steps.changesets.outputs.published == 'true'
77+
uses: softprops/action-gh-release@v1
78+
with:
79+
tag_name: ${{ steps.version.outputs.tag }}
80+
name: Scripts Release ${{ steps.version.outputs.tag }}
81+
body: |
82+
Automated release of scripts package.
83+
84+
**Version:** ${{ steps.version.outputs.version }}
85+
86+
**jsdelivr URLs:**
87+
- Latest from this version: `https://cdn.jsdelivr.net/gh/${{ github.repository }}@${{ steps.version.outputs.tag }}/packages/scripts/dist/index.js`
88+
- Latest from major version: `https://cdn.jsdelivr.net/gh/${{ github.repository }}@${{ steps.version.outputs.version }}.*/packages/scripts/dist/index.js`
89+
- Specific commit: `https://cdn.jsdelivr.net/gh/${{ github.repository }}@${{ github.sha }}/packages/scripts/dist/index.js`
90+
91+
**Usage in HTML:**
92+
```html
93+
<script defer src="https://cdn.jsdelivr.net/gh/${{ github.repository }}@${{ steps.version.outputs.tag }}/packages/scripts/dist/index.js"></script>
94+
```
95+
draft: false
96+
prerelease: false
97+
env:
98+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99+
100+
- name: Upload Scripts Artifacts
101+
if: steps.changesets.outputs.published == 'true'
102+
uses: actions/upload-artifact@v4
103+
with:
104+
name: scripts-dist
105+
path: packages/scripts/dist/**
106+
retention-days: 90

.gitignore

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
# Dependency directories
11+
node_modules/
12+
.pnp
13+
.pnp.js
14+
15+
# Build outputs
16+
# Note: packages/scripts/dist/ is NOT ignored - needed for jsdelivr CDN
17+
packages/code-components/dist/
18+
build/
19+
*.tsbuildinfo
20+
21+
# TypeScript v1 declaration files
22+
typings/
23+
24+
# Optional npm cache directory
25+
.npm
26+
27+
# Optional eslint cache
28+
.eslintcache
29+
30+
# Optional REPL history
31+
.node_repl_history
32+
33+
# Output of 'npm pack'
34+
*.tgz
35+
36+
# dotenv environment variables file
37+
.env
38+
.env.local
39+
.env.*.local
40+
41+
# IDE
42+
.vscode/
43+
.idea/
44+
*.swp
45+
*.swo
46+
*~
47+
48+
# OS
49+
.DS_Store
50+
Thumbs.db
51+
52+
# Changeset
53+
.changeset/*.md
54+
!/.changeset/config.json

.prettierrc.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "es5",
4+
"singleQuote": true,
5+
"printWidth": 100,
6+
"tabWidth": 2,
7+
"useTabs": false,
8+
"arrowParens": "always"
9+
}

0 commit comments

Comments
 (0)