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
17 changes: 0 additions & 17 deletions .eslintrc.js

This file was deleted.

118 changes: 103 additions & 15 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,117 @@
name: build
name: CI

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

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

env:
CI: true

permissions:
contents: read

jobs:
build:
quality:
name: Quality (lint/format)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: '26'
cache: npm

- name: Install
run: npm ci

- name: Lint
run: npm run lint:check

- name: Format check
run: npm run format:check

test-build:
name: Test + Build (Node ${{ matrix.node }})
runs-on: ubuntu-latest
needs: [quality]
strategy:
fail-fast: false
matrix:
node: ['22', '24', '26']

permissions:
contents: read
actions: read

steps:
- uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
- name: Checkout
uses: actions/checkout@v6

- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: '18.x'
node-version: ${{ matrix.node }}
cache: npm

- name: Install
run: npm ci

- name: Type check (TypeScript 7)
run: npm run build:check

- name: Test
run: npm run test:coverage

- run: npm ci
- run: npm run build
- run: npm run lint-check
- run: npm run format-check
- name: Framework integration
run: npm run test:integration

- name: Upload report as artifact
uses: actions/upload-artifact@v2
- name: Packed consumer checks
run: npm run test:package

- name: Publish Test Report
uses: ctrf-io/github-test-reporter@v1
with:
name: ctrf-report
path: ctrf/ctrf-report.json
report-path: './ctrf/*.json'
summary-delta-report: true
github-report: true
insights-report: true
flaky-rate-report: true
previous-results-report: true
upload-artifact: true
artifact-name: ctrf-test-report-node-${{ matrix.node }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: always() && hashFiles('ctrf/*.json') != ''

- name: Build
run: npm run build

security:
name: Security (deps audit)
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: '26'
cache: npm

- name: Install
run: npm ci

- name: npm audit (prod)
run: npm audit --omit=dev
25 changes: 18 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: '24.x'
node-version: '26.x'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
always-auth: true

- name: Install dependencies
run: npm ci
Expand All @@ -34,10 +33,22 @@ jobs:
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: npm audit signatures

- name: Publish to npm
run: npm publish --provenance --access public
- name: Determine npm tag
id: release-info
run: |
VERSION=$(node -p "require('./package.json').version")
if [[ "$VERSION" =~ -.*$ ]]; then
echo "npm_tag=next" >> $GITHUB_OUTPUT
else
echo "npm_tag=latest" >> $GITHUB_OUTPUT
fi

- name: Stage publish to npm
run: npm stage publish --provenance --access public --tag ${{ steps.release-info.outputs.npm_tag }}

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v3
with:
generate_release_notes: true
prerelease: true
make_latest: false
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
dist
node_modules
ctrf
dist/
node_modules/
ctrf/
coverage/
reports/
*.tgz
5 changes: 0 additions & 5 deletions .prettierrc

This file was deleted.

16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Changelog

## 0.1.0 (unreleased)

- Require Node 22.12+ and CodeceptJS 4.2.0. Dependencies are pinned exactly.
- Publish ESM/CommonJS entry points and complete TypeScript declarations;
preserve the callable CommonJS plugin factory.
- Use ctrf 0.5.0 and emit strictly validated specification 0.2.0 reports.
- Add stable logical test IDs and optional run/shard IDs; preserve execution identity across retries and assign distinct final and historical attempt IDs, including minimal reports.
- Include suite/file/tag/timing/step/error information and final retry outcomes
with prior-attempt history and flaky classification.
- Add scoped runtime metadata through `extra()` and `ctrf.extra()`.
- Store legacy `appName` under environment extra; normalize build numbers to
integers and reject invalid values.
- Adopt TypeScript 7, Biome, Vitest/coverage and staged Node 22/24/26 CI, with
real framework and packed-consumer verification.
37 changes: 37 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,40 @@ Your contributions are sincerely appreciated. We want to make contributing to th
- Proposing new features

Thank you for your interest in contributing

## TypeScript compiler tooling

The native TypeScript 7.0.2 compiler is installed through the exact
`@typescript/native` alias and provides `tsc` for compilation and type checks.
The `typescript` alias points to `@typescript/typescript6@6.0.2` so tools that
import the compiler API remain compatible. Keep both development dependencies.

Run `npm run build:check` to check source types with TypeScript 7, and
`npm run all` for the repository checks and build.

## Local verification

Use Node 22.12.0 or newer. CI tests Node 22, 24 and 26; quality and security
stages run on Node 26. Keep direct dependencies, peer dependencies and explicit
security overrides pinned to exact versions. Update the lockfile with changes.

```sh
npm ci
npm run all
npm audit
npm audit --omit=dev
```

`all` runs native TypeScript checks, Biome lint/format, Vitest with V8 coverage,
real CodeceptJS integration scenarios, and isolated packed-consumer checks.
Integration includes an intentional failing scenario: the harness expects the
framework exit code and validates all final outcomes, including a flaky retry.
Packed checks use an isolated temporary project/cache and install the CodeceptJS
peer; they require npm registry access. They verify ESM/CommonJS runtime imports
and both declaration consumers with native TypeScript 7.

The tsup declaration build uses the TypeScript 6 compiler API. Keep its
`ignoreDeprecations` setting scoped to `tsup.config.ts`.

This version removes the old repository-local CTRF type declarations. Use
canonical `ctrf` types and strict 0.2.0 validation in new report tests.
Loading
Loading