diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..1f9baf0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,37 @@ +name: Bug Report +description: Report a bug +title: '[Bug] ' +labels: ['bug'] +body: + - type: textarea + id: description + attributes: + label: What happened? + placeholder: Describe the bug and expected behavior + validations: + required: true + + - type: textarea + id: code + attributes: + label: Code + render: typescript + placeholder: Minimal reproduction code + validations: + required: true + + - type: input + id: browser + attributes: + label: Browser + placeholder: 'Chrome 120, Firefox 119, etc.' + validations: + required: true + + - type: input + id: version + attributes: + label: version + placeholder: '0.0.0' + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..f33ba94 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,28 @@ +name: Feature Request +description: Suggest a feature +title: '[Feature] ' +labels: ['enhancement'] +body: + - type: textarea + id: problem + attributes: + label: Problem + placeholder: What problem does this solve? + validations: + required: true + + - type: textarea + id: solution + attributes: + label: Solution + placeholder: How should this work? + validations: + required: true + + - type: textarea + id: api + attributes: + label: Proposed API + render: typescript + validations: + required: false diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..24a62ee --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,18 @@ +## What + +Brief description of changes. + +## Type + +- [ ] Bug fix +- [ ] New feature +- [ ] Breaking change +- [ ] Documentation + +## Testing + +- [ ] Tested in modern browsers +- [ ] No console errors +- [ ] Types/doc added + +Closes #(issue) diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..e2abb7d --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +version: 2 +updates: + - package-ecosystem: 'npm' + directory: '/' + schedule: + interval: 'weekly' + open-pull-requests-limit: 10 + + - package-ecosystem: 'github-actions' + directory: '/' + schedule: + interval: 'weekly' + open-pull-requests-limit: 5 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0ce709b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +permissions: + contents: read +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20, 22] + + steps: + - uses: actions/checkout@v5 + + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + + - name: Install dependencies + run: npm install + + - name: Lint + run: npx eslint . && npx prettier --check **/*.ts + + - name: Build + run: npm run build diff --git a/.github/workflows/deploy-demo.yml b/.github/workflows/deploy-demo.yml new file mode 100644 index 0000000..96231f2 --- /dev/null +++ b/.github/workflows/deploy-demo.yml @@ -0,0 +1,40 @@ +name: Deploy Demo + +on: + push: + branches: [main] + +jobs: + deploy: + runs-on: ubuntu-latest + permissions: + contents: read + pages: write + id-token: write + + steps: + - uses: actions/checkout@v5 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Build demo + run: npm run build + + - name: Setup Pages + uses: actions/configure-pages@v5 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v4 + with: + path: './dist' + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d643474 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,39 @@ +name: Release + +on: + push: + tags: + - 'v*' + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v5 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + registry-url: 'https://registry.npmjs.org' + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build:lib + + - name: Publish to npm + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + name: Release ${{ github.ref_name }} + draft: false + prerelease: false