From 2a1ce88ca558ae8e86bfba7f5cc04f537d9cc13f Mon Sep 17 00:00:00 2001 From: Nate Goldman <427322+ungoldman@users.noreply.github.com> Date: Sat, 13 Jun 2026 17:33:59 -0700 Subject: [PATCH 1/5] build: scope biome to source, not json Drop *.json from Biome's includes. It made Biome a second formatter for package.json (fixpack owns that) and reformatted the config JSON to its own line width. Biome now scopes to src and test only; package-lock.json was already auto-ignored. --- biome.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biome.json b/biome.json index bca370a..1e3fa08 100644 --- a/biome.json +++ b/biome.json @@ -1,7 +1,7 @@ { "$schema": "https://biomejs.dev/schemas/2.5.0/schema.json", "vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true }, - "files": { "includes": ["src/**", "*.json"] }, + "files": { "includes": ["src/**", "test/**"] }, "formatter": { "enabled": true, "indentStyle": "space", "indentWidth": 2, "lineWidth": 100 }, "javascript": { "formatter": { "quoteStyle": "single", "semicolons": "asNeeded", "trailingCommas": "none" } From dc596a820c8106958b70f71c6c7659a329cf9cbd Mon Sep 17 00:00:00 2001 From: Nate Goldman <427322+ungoldman@users.noreply.github.com> Date: Sat, 13 Jun 2026 17:34:36 -0700 Subject: [PATCH 2/5] test: move specs from src to test Relocate index.spec.ts to test/index.test.ts and point its imports at ../src. Matches the standard's layout (specs in test/, not co-located in src/). --- package.json | 4 ++-- src/index.spec.ts => test/index.test.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) rename src/index.spec.ts => test/index.test.ts (96%) diff --git a/package.json b/package.json index b228c24..53fa4a2 100644 --- a/package.json +++ b/package.json @@ -64,9 +64,9 @@ "prepare": "npm run build", "prerelease": "git fetch --tags && npm run check", "release": "npm version patch", - "test": "node --test --import=tsx src/**/*.spec.ts", + "test": "node --test --import=tsx test/*.test.ts", "test:pack": "bash scripts/test-pack.sh", - "test:watch": "node --test --watch --import=tsx src/**/*.spec.ts", + "test:watch": "node --test --watch --import=tsx test/*.test.ts", "typecheck": "tsc --noEmit" }, "type": "module", diff --git a/src/index.spec.ts b/test/index.test.ts similarity index 96% rename from src/index.spec.ts rename to test/index.test.ts index e26add4..4303e89 100644 --- a/src/index.spec.ts +++ b/test/index.test.ts @@ -2,9 +2,9 @@ import { strict as assert } from 'node:assert' import { describe, test } from 'node:test' import tags from 'html-tags' import h from 'hyperscript' -import type { CreateElementFunction } from './factory.js' -import * as namedExports from './index.js' -import hyperaxe, { getFactory, varTag } from './index.js' +import type { CreateElementFunction } from '../src/factory.js' +import * as namedExports from '../src/index.js' +import hyperaxe, { getFactory, varTag } from '../src/index.js' describe('Hyperaxe Factory', () => { test('factory function signature', () => { From 34cd3144168d5811367e771c3928eae7b5e01d1c Mon Sep 17 00:00:00 2001 From: Nate Goldman <427322+ungoldman@users.noreply.github.com> Date: Sat, 13 Jun 2026 17:35:17 -0700 Subject: [PATCH 3/5] test: reorient tsconfig to a build base and test typecheck tsconfig.json becomes the build config that emits src; new tsconfig.test.json is the noEmit typecheck that adds the tests. Remove tsconfig.build.json. typecheck runs against the test config, build is plain tsc with a prebuild clean. --- package.json | 5 +++-- tsconfig.build.json | 7 ------- tsconfig.json | 4 +--- tsconfig.test.json | 9 +++++++++ 4 files changed, 13 insertions(+), 12 deletions(-) delete mode 100644 tsconfig.build.json create mode 100644 tsconfig.test.json diff --git a/package.json b/package.json index 53fa4a2..99cbe0b 100644 --- a/package.json +++ b/package.json @@ -56,18 +56,19 @@ "url": "git+https://github.com/ungoldman/hyperaxe.git" }, "scripts": { - "build": "rm -rf dist && tsc -p tsconfig.build.json", + "build": "tsc", "check": "npm run lint && npm run typecheck && npm test && npx publint && npm run test:pack", "format": "biome check --write .", "lint": "biome check .", "postrelease": "git push --follow-tags && npm publish", + "prebuild": "rm -rf dist", "prepare": "npm run build", "prerelease": "git fetch --tags && npm run check", "release": "npm version patch", "test": "node --test --import=tsx test/*.test.ts", "test:pack": "bash scripts/test-pack.sh", "test:watch": "node --test --watch --import=tsx test/*.test.ts", - "typecheck": "tsc --noEmit" + "typecheck": "tsc -p tsconfig.test.json" }, "type": "module", "types": "dist/index.d.ts" diff --git a/tsconfig.build.json b/tsconfig.build.json deleted file mode 100644 index a7bc7b8..0000000 --- a/tsconfig.build.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "noEmit": false - }, - "exclude": ["src/**/*.spec.ts"] -} diff --git a/tsconfig.json b/tsconfig.json index e3c519e..9f6e466 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,10 +9,8 @@ "outDir": "dist", "rootDir": "src", "declaration": true, - "noEmit": true, "strict": true, "esModuleInterop": true, - "types": ["node"], "skipLibCheck": true, "noUnusedLocals": true, "noUnusedParameters": true, @@ -22,5 +20,5 @@ "forceConsistentCasingInFileNames": true, "resolveJsonModule": true }, - "include": ["src/**/*"] + "include": ["src"] } diff --git a/tsconfig.test.json b/tsconfig.test.json new file mode 100644 index 0000000..badb66a --- /dev/null +++ b/tsconfig.test.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": true, + "rootDir": ".", + "types": ["node"] + }, + "include": ["src", "test"] +} From 70f899bc77a2cec51d40d18c55720753efbeeeff Mon Sep 17 00:00:00 2001 From: Nate Goldman <427322+ungoldman@users.noreply.github.com> Date: Sat, 13 Jun 2026 17:35:31 -0700 Subject: [PATCH 4/5] test: add a 100% coverage gate Use Node's built-in coverage (no c8), holding lines, branches, and functions at 100% and excluding test/. --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 99cbe0b..0762b74 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "scripts": { "build": "tsc", "check": "npm run lint && npm run typecheck && npm test && npx publint && npm run test:pack", + "coverage": "node --test --experimental-test-coverage --import=tsx --test-coverage-exclude='test/**' --test-coverage-lines=100 --test-coverage-branches=100 --test-coverage-functions=100 test/*.test.ts", "format": "biome check --write .", "lint": "biome check .", "postrelease": "git push --follow-tags && npm publish", From 2add2e86679ab7cd339cef2721bae55dd5b95509 Mon Sep 17 00:00:00 2001 From: Nate Goldman <427322+ungoldman@users.noreply.github.com> Date: Sat, 13 Jun 2026 17:36:17 -0700 Subject: [PATCH 5/5] ci: run npm test and coverage as the gate, drop check Make npm test the aggregate (lint, typecheck, build, run), matching the standard, and drop the redundant check script. CI runs npm test, npm run coverage, and npm run test:pack as steps, which also removes npx publint (unpinned remote code) from CI. Repoint prerelease off check. --- .github/workflows/fresh-deps.yml | 4 +++- .github/workflows/tests.yml | 4 +++- package.json | 5 ++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/fresh-deps.yml b/.github/workflows/fresh-deps.yml index 372c688..9ffb927 100644 --- a/.github/workflows/fresh-deps.yml +++ b/.github/workflows/fresh-deps.yml @@ -23,4 +23,6 @@ jobs: node-version: ${{ matrix.node }} - run: rm package-lock.json - run: npm i - - run: npm run check + - run: npm test + - run: npm run coverage + - run: npm run test:pack diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 61ced78..3523da3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,4 +22,6 @@ jobs: node-version: ${{ matrix.node }} cache: npm - run: npm ci - - run: npm run check + - run: npm test + - run: npm run coverage + - run: npm run test:pack diff --git a/package.json b/package.json index 0762b74..0dad950 100644 --- a/package.json +++ b/package.json @@ -57,16 +57,15 @@ }, "scripts": { "build": "tsc", - "check": "npm run lint && npm run typecheck && npm test && npx publint && npm run test:pack", "coverage": "node --test --experimental-test-coverage --import=tsx --test-coverage-exclude='test/**' --test-coverage-lines=100 --test-coverage-branches=100 --test-coverage-functions=100 test/*.test.ts", "format": "biome check --write .", "lint": "biome check .", "postrelease": "git push --follow-tags && npm publish", "prebuild": "rm -rf dist", "prepare": "npm run build", - "prerelease": "git fetch --tags && npm run check", + "prerelease": "git fetch --tags && npm test && npm run test:pack", "release": "npm version patch", - "test": "node --test --import=tsx test/*.test.ts", + "test": "npm run lint && npm run typecheck && npm run build && node --test --import=tsx test/*.test.ts", "test:pack": "bash scripts/test-pack.sh", "test:watch": "node --test --watch --import=tsx test/*.test.ts", "typecheck": "tsc -p tsconfig.test.json"