Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .eslintignore

This file was deleted.

27 changes: 0 additions & 27 deletions .eslintrc.json

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# One lightweight CI job.
# npm ci requires package-lock.json to match package.json.

name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
check:
name: Lint, typecheck, build, test
runs-on: ubuntu-latest
timeout-minutes: 6
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 1

- uses: actions/setup-node@v7
with:
node-version: 24
cache: npm

- name: Install
run: npm ci --no-audit --no-fund

- name: ESLint, typecheck, build, test
run: |
npx eslint src || true
npm run typecheck
npm run build
npm test
28 changes: 7 additions & 21 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: "CodeQL"
name: CodeQL

# Security scan: main + weekly. Not on every PR.
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '37 23 * * 0'

Expand All @@ -16,23 +15,10 @@ jobs:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ['javascript']

steps:
- name: Checkout repository
uses: actions/checkout@v7

- name: Initialize CodeQL
uses: github/codeql-action/init@v4
- uses: actions/checkout@v7
- uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v4

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
languages: javascript
- uses: github/codeql-action/autobuild@v4
- uses: github/codeql-action/analyze@v4
35 changes: 6 additions & 29 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,12 @@
name: ESLint
# Disabled — ESLint now runs inside .github/workflows/ci.yml
name: ESLint (disabled)

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
schedule:
- cron: '34 7 * * 3'
workflow_dispatch:

jobs:
eslint:
name: Run eslint scanning
disabled:
if: false
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write

steps:
- name: Checkout code
uses: actions/checkout@v7

- name: Use Node.js 20
uses: actions/setup-node@v7
with:
node-version: 24
cache: 'npm'

- name: Install dependencies
run: npm install

- name: Run ESLint
run: |
npx eslint src --ext .ts,.js --max-warnings 50 || true
continue-on-error: true
- run: echo "Use the CI workflow instead"
37 changes: 7 additions & 30 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,13 @@
name: Node.js CI
# Disabled — replaced by .github/workflows/ci.yml
# Kept so GitHub does not keep the old filename active on PRs.
name: Node.js CI (disabled)

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

jobs:
build:
disabled:
if: false
runs-on: ubuntu-latest
permissions:
contents: read

strategy:
fail-fast: false
matrix:
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v7

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm install

- name: Build
run: npm run build --if-present

- name: Test
run: npm test
- run: echo "Use the CI workflow instead"
46 changes: 12 additions & 34 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
# Publish markdown-regex to npm when a GitHub Release is published.
#
# Setup (once):
# 1. Create an npm Access Token with publish rights
# https://www.npmjs.com/settings/~/tokens
# 2. Add it as a repository secret named `npm_token`
# Settings → Secrets and variables → Actions → New repository secret
# 3. Create a GitHub Release whose tag matches package.json version
# (e.g. tag v2.0.0 when version is 2.0.0)
#
# Manual run is also available via workflow_dispatch.

name: Publish to npm

Expand All @@ -31,36 +21,24 @@ jobs:
publish:
name: Build, test, and publish
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
id-token: write # npm provenance / OIDC

id-token: write
steps:
- name: Checkout
uses: actions/checkout@v7

- name: Setup Node.js
uses: actions/setup-node@v7
- uses: actions/checkout@v7
with:
fetch-depth: 1
- uses: actions/setup-node@v7
with:
node-version: 22
node-version: 24
registry-url: https://registry.npmjs.org/
cache: npm

- name: Install dependencies
run: npm install

- name: Typecheck
run: npm run typecheck

- name: Build
run: npm run build

- name: Test
run: npm test

- name: Preview published files
run: npm pack --dry-run

- run: npm ci --no-audit --no-fund
- run: npm run typecheck
- run: npm run build
- run: npm test
- run: npm pack --dry-run
- name: Publish to npm
if: ${{ github.event_name == 'release' || inputs.dry_run != true }}
run: npm publish --access public --provenance
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Semgrep

# Security scan: main + weekly. Not on every PR.
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
branches: [main]
schedule:
- cron: '22 15 * * 3'

Expand All @@ -20,15 +19,13 @@ jobs:
security-events: write
steps:
- uses: actions/checkout@v7

- uses: returntocorp/semgrep-action@9d0e5a1dbfaf51e4c3a5026d12c65508fe58f191
with:
publishToken: ${{ secrets.SEMGREP_APP_TOKEN }}
publishDeployment: ${{ secrets.SEMGREP_DEPLOYMENT_ID }}
generateSarif: "1"

- name: Upload SARIF file
if: always()
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: semgrep.sarif
if: always()
40 changes: 6 additions & 34 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,12 @@
name: Tests
# Disabled — replaced by .github/workflows/ci.yml
name: Tests (disabled)

on:
push:
branches: [main, 'feat/**', 'fix/**', 'chore/**']
pull_request:
branches: [main]
workflow_dispatch:

jobs:
test:
disabled:
if: false
runs-on: ubuntu-latest
permissions:
contents: read

strategy:
fail-fast: false
matrix:
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v7

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

# Using npm install until a complete package-lock.json is committed
- name: Install dependencies
run: npm install

- name: Typecheck
run: npm run typecheck

- name: Build
run: npm run build

- name: Run tests
run: npm test
- run: echo "Use the CI workflow instead"
26 changes: 26 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import js from '@eslint/js';

export default [
{
ignores: [
'dist/**',
'coverage/**',
'node_modules/**',
'src/**/*.js',
'src/**/*.d.ts',
],
},
js.configs.recommended,
{
files: ['src/**/*.ts'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
},
rules: {
'no-control-regex': 'off',
'no-useless-escape': 'off',
'no-unused-vars': 'off',
},
},
];
Loading