Skip to content

Commit 549099f

Browse files
DavertMikclaude
andcommitted
release: 4.0.0 — stable, provenance publish workflow
* Bump version to 4.0.0 to align with CodeceptJS 4 line. CodeceptJS still pins to `@codeceptjs/configure@1.0.6`, so this jump cannot accidentally break 3.x users — they keep getting 1.x via the hard pin. * Replace semantic-release / `NPM_TOKEN` workflow with an OIDC trusted publisher workflow at `.github/workflows/publish.yml`. Triggered on release-published; runs `npm test` first; publishes with `--provenance --access public` and no token. Uses the release tag as the npm version verbatim (plain SemVer, no `v` prefix). * `run-tests.yml`: trigger on `4.x`, `master`, `main` and PRs; Node 20 and 22 matrix; runs the new `node --test` unit suite. * CHANGELOG entry summarizing the ESM port and the publish-flow change. * devDep + peer ranges include 4.0.0-rc prereleases so CI installs a resolvable `codeceptjs` until 4.0.0 stable lands. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 1bc8644 commit 549099f

6 files changed

Lines changed: 72 additions & 41 deletions

File tree

.github/workflows/publish-node.js.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Publish to npm
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: read
9+
id-token: write
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
ref: ${{ github.event.release.target_commitish }}
18+
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: 22
22+
23+
- run: npm install
24+
- run: npm test
25+
26+
publish:
27+
needs: test
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
with:
32+
ref: ${{ github.event.release.target_commitish }}
33+
34+
- uses: actions/setup-node@v4
35+
with:
36+
node-version: 22
37+
registry-url: 'https://registry.npmjs.org'
38+
39+
- run: npm install
40+
- run: npm install -g npm@latest
41+
42+
- name: Set package version from release tag
43+
run: npm version "${{ github.event.release.tag_name }}" --no-git-tag-version
44+
45+
- name: Publish to npm
46+
run: npm publish --provenance --access public

.github/workflows/run-tests.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,28 @@ name: Run Tests
33
on:
44
push:
55
branches:
6+
- 4.x
67
- master
78
- main
89
pull_request:
910
branches:
1011
- '**'
1112

12-
jobs:
13-
build:
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
15+
cancel-in-progress: true
1416

17+
jobs:
18+
unit-tests:
19+
name: Unit tests
1520
runs-on: ubuntu-latest
16-
21+
strategy:
22+
matrix:
23+
node-version: [20.x, 22.x]
1724
steps:
18-
- uses: actions/checkout@v3
19-
- name: Setup nodejs
20-
uses: actions/setup-node@v3
25+
- uses: actions/checkout@v4
26+
- uses: actions/setup-node@v4
2127
with:
22-
node-version: 22
23-
- run: npm i
24-
- run: npm run test
25-
- run: npm run test-integration
28+
node-version: ${{ matrix.node-version }}
29+
- run: npm install
30+
- run: npm test

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
4.0.0
2+
3+
* ESM-only release targeting CodeceptJS 4.x. Convert package + all hooks + bridge to native ESM (`type: module`).
4+
* Fix Config singleton sharing: bridge now imports `codeceptjs` via ESM, so hooks register on the host's Config instance instead of a stale CJS-resolved copy.
5+
* Mark the `codeceptjs` peer dependency as optional so npm doesn't pull a parallel 3.x copy alongside a 4.x host.
6+
* Drop the `tryTo` / `retryTo` plugin enable in `setCommonPlugins` — in CodeceptJS 4 those are imported from `codeceptjs/effects`, not enabled as plugins.
7+
* Tests rewritten on Node's built-in `node:test` + `node:assert` (no jest).
8+
* Engines: Node >=18.
9+
110
0.8.0
211

312
* Added `setCommonPlugins` hook

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Configuration hook helps you update CodeceptJS configuration at ease.
44

55
Those hooks are expected to simplify configuration for common use cases.
66

7-
**Requires CodeceptJS >= 4.0.0** (this is the ESM-only `2.x` line targeting CodeceptJS 4. For CodeceptJS 3.x use `@codeceptjs/configure@^1`.)
7+
**Requires CodeceptJS >= 4.0.0** `4.x` is the ESM-only line that ships alongside CodeceptJS 4. For CodeceptJS 3.x use `@codeceptjs/configure@^1`.
88

99
## Install it
1010

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codeceptjs/configure",
3-
"version": "2.0.0-rc.1",
3+
"version": "4.0.0",
44
"description": "Set of CodeceptJS config hooks to simplify configuration (ESM, CodeceptJS 4.x)",
55
"type": "module",
66
"main": "index.js",

0 commit comments

Comments
 (0)