diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 35904b7..cd1315b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,9 +5,9 @@ on: branches: [main, next] jobs: - test: - name: Test + ci: runs-on: ubuntu-latest + timeout-minutes: 10 strategy: fail-fast: false matrix: @@ -21,40 +21,17 @@ jobs: node-version: ${{ matrix.node-version }} cache: 'npm' - - - - name: Check package.json deps - run: node scripts/check-no-file-deps.mjs - name: Install dependencies run: npm ci - - name: Build - run: npm run build - - name: Lint run: npm run lint - - name: Test with coverage - run: npm test - - typecheck: - name: Type Check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '22' - cache: 'npm' - - - - - name: Check package.json deps - run: node scripts/check-no-file-deps.mjs - - name: Install dependencies - run: npm ci - - name: Type check run: npx tsc --noEmit + + - name: Build + run: npm run build + + - name: Test + run: npm test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fe4f99c..c0c999a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,6 +12,7 @@ jobs: release: name: Release runs-on: ubuntu-latest + timeout-minutes: 15 concurrency: group: deploy-${{github.ref}} cancel-in-progress: true diff --git a/package.json b/package.json index 88e4360..ebadc84 100644 --- a/package.json +++ b/package.json @@ -35,8 +35,7 @@ "benchmark": "npm run build && node benchmark.js", "lint": "eslint . --fix", "build": "tsc", - "validate": "npm run check:package-json && npm run build && npm run lint && npm test", - "check:package-json": "node scripts/check-no-file-deps.mjs" + "validate": "npm run build && npm run lint && npm test" }, "peerDependencies": { "typescript": ">=5.0.0" diff --git a/scripts/check-no-file-deps.mjs b/scripts/check-no-file-deps.mjs deleted file mode 100644 index 7dec517..0000000 --- a/scripts/check-no-file-deps.mjs +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env node -/** - * Fail if package.json declares file: or file:// dependency specs. - * Canonical copy: infra/ci-cd/check-no-file-deps.mjs - * Service repos ship an identical copy at scripts/check-no-file-deps.mjs for CI. - * - * Local monorepo dev uses npm link — never commit file: paths. - */ -import { readFileSync } from "node:fs"; -import { join } from "node:path"; - -const DEP_FIELDS = [ - "dependencies", - "devDependencies", - "optionalDependencies", - "peerDependencies", - "overrides", -]; - -const pkgPath = join(process.cwd(), "package.json"); -let pkg; -try { - pkg = JSON.parse(readFileSync(pkgPath, "utf8")); -} catch (err) { - console.error(`check-no-file-deps: failed to read ${pkgPath}: ${err.message}`); - process.exit(1); -} - -const violations = []; - -function isFileSpec(value) { - return typeof value === "string" && (value.startsWith("file:") || value.startsWith("file://")); -} - -function checkDeps(deps, path) { - if (!deps || typeof deps !== "object" || Array.isArray(deps)) { - return; - } - for (const [name, version] of Object.entries(deps)) { - if (isFileSpec(version)) { - violations.push(`${path}.${name}: ${JSON.stringify(version)}`); - } else if (version && typeof version === "object") { - checkDeps(version, `${path}.${name}`); - } - } -} - -for (const field of DEP_FIELDS) { - checkDeps(pkg[field], field); -} - -if (violations.length > 0) { - console.error("package.json must not use file: or file:// dependency specs."); - console.error("Use npm link for local development instead."); - for (const v of violations) { - console.error(` ${v}`); - } - process.exit(1); -} - -console.log("check-no-file-deps: ok");