From 19c07d16ba0fdcf6d1bcbe82725c7eeeb1401d5b Mon Sep 17 00:00:00 2001 From: Roger Chappel Date: Thu, 11 Jun 2026 21:52:21 +1000 Subject: [PATCH 1/4] build: include package support metadata --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 75ea5be..ecbd3c9 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,8 @@ "README.md", "LICENSE", "SECURITY.md", - "CONTRIBUTING.md" + "CONTRIBUTING.md", + "CHANGELOG.md" ], "scripts": { "test": "node --test test/*.test.js", From 2676f20ced36ea0385f14170126df8c35b01f696 Mon Sep 17 00:00:00 2001 From: Roger Chappel Date: Thu, 11 Jun 2026 21:52:21 +1000 Subject: [PATCH 2/4] ci: run package verification in workflow --- .github/workflows/ci.yml | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c8f8599..239f74e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,23 +48,48 @@ jobs: exit 1 fi - - name: Run optional Node checks + - name: Run package verification run: | set -euo pipefail if [ ! -f package.json ]; then echo "No package.json found; skipping Node checks." - echo "TODO: add install, lint, test, typecheck, or build commands when this template becomes an app or package." exit 0 fi - if [ -f package-lock.json ]; then + if [ -f pnpm-lock.yaml ]; then + corepack enable + pnpm install --frozen-lockfile + if pnpm run | grep -q " release:check"; then + pnpm run release:check + else + pnpm run check --if-present + pnpm test --if-present + pnpm run build --if-present + pnpm run smoke --if-present + pnpm run package:smoke --if-present + fi + elif [ -f package-lock.json ]; then npm ci + if npm run | grep -q " release:check"; then + npm run release:check + else + npm run check --if-present + npm test --if-present + npm run build --if-present + npm run smoke --if-present + npm run package:smoke --if-present + fi else npm install + if npm run | grep -q " release:check"; then + npm run release:check + else + npm run check --if-present + npm test --if-present + npm run build --if-present + npm run smoke --if-present + npm run package:smoke --if-present + fi fi - npm run lint --if-present - npm test --if-present - npm run typecheck --if-present - npm run build --if-present From ca59fc4d77e4fce4aca5f2e3b6cab2bcf7c64943 Mon Sep 17 00:00:00 2001 From: Roger Chappel Date: Thu, 11 Jun 2026 21:54:02 +1000 Subject: [PATCH 3/4] ci: check package scripts without npm run probing --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 239f74e..92ebea6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,7 +60,7 @@ jobs: if [ -f pnpm-lock.yaml ]; then corepack enable pnpm install --frozen-lockfile - if pnpm run | grep -q " release:check"; then + if node -e "process.exit(require('./package.json').scripts?.['release:check'] ? 0 : 1)"; then pnpm run release:check else pnpm run check --if-present @@ -71,7 +71,7 @@ jobs: fi elif [ -f package-lock.json ]; then npm ci - if npm run | grep -q " release:check"; then + if node -e "process.exit(require('./package.json').scripts?.['release:check'] ? 0 : 1)"; then npm run release:check else npm run check --if-present @@ -82,7 +82,7 @@ jobs: fi else npm install - if npm run | grep -q " release:check"; then + if node -e "process.exit(require('./package.json').scripts?.['release:check'] ? 0 : 1)"; then npm run release:check else npm run check --if-present From 16293850d6a3b16c7d77ab6e416e5de78171be2a Mon Sep 17 00:00:00 2001 From: Roger Chappel Date: Thu, 11 Jun 2026 21:54:39 +1000 Subject: [PATCH 4/4] test: fix ESM CLI smoke imports --- test/cli.test.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/cli.test.js b/test/cli.test.js index 836fa4d..4a1a81c 100644 --- a/test/cli.test.js +++ b/test/cli.test.js @@ -6,10 +6,9 @@ import { tmpdir } from 'node:os'; import { join } from 'node:path'; test('atomcommit plan test - CLI should handle --help', () => { - const { execSync } = require('child_process'); try { - const out = execSync('node src/index.js --help', { encoding: 'utf8', stdio: 'pipe' }); - assert.ok(out.includes('atomcommit') || out.includes('plan') || out.includes('commit'), + const out = execFileSync(process.execPath, ['src/index.js', '--help'], { encoding: 'utf8', stdio: 'pipe' }); + assert.ok(out.includes('atomcommit') || out.includes('plan') || out.includes('commit'), 'help should mention atomcommit or plan'); } catch (e) { // CLI may exit with code for --help @@ -17,13 +16,13 @@ test('atomcommit plan test - CLI should handle --help', () => { } }); -test('parseNameStatus handles invalid input', () => { +test('parseNameStatus handles invalid input', async () => { const { parseNameStatus } = await import('../src/index.js'); const result = parseNameStatus(''); assert.deepEqual(result, [], 'empty input returns empty array'); }); -test('parseNumstat handles binary markers', () => { +test('parseNumstat handles binary markers', async () => { const { parseNumstat } = await import('../src/index.js'); const result = parseNumstat('-\t-\tbinary.png\n'); assert.ok(result.get('binary.png').binary, 'should detect binary files');