Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 3 additions & 1 deletion .github/scripts/before-beta-release.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ pkgJson.version = nextVersion;
fs.writeFileSync(PKG_JSON_PATH, `${JSON.stringify(pkgJson, null, 2)}\n`);

function getNextVersion(version) {
const versionString = execSync(`npm show ${PACKAGE_NAME} versions --json`, { encoding: 'utf8' });
// `pnpm view` matches `npm view`/`npm show` semantics and is safe under our
// devEngines `onFail: error` pin (npm CLI would be blocked).
const versionString = execSync(`pnpm view ${PACKAGE_NAME} versions --json`, { encoding: 'utf8' });
const versions = JSON.parse(versionString);

if (versions.some((v) => v === VERSION)) {
Expand Down
38 changes: 22 additions & 16 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ jobs:
with:
node-version: 24

- name: Install Dependencies
run: npm install
- name: Install pnpm and dependencies
uses: apify/actions/pnpm-install@v1.1.2

- name: Lint code
run: npm run lint
run: pnpm run lint

unit:
name: Unit tests (Node.js ${{ matrix.node-version }})
Expand All @@ -51,7 +51,13 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [20, 22, 24]
# pnpm 11 requires Node ≥22, so Node 20 from the previous matrix is dropped.
# Node 26 is intentionally NOT here yet: a pre-existing tsx + yargs (16.x
# CJS bin) + Node 26 ESM-loader incompatibility breaks `mocha` under the
# repo's `node-option: ["import=tsx"]` config. Reproducible on `master`
# with plain `npm install`, so it's not a migration regression — but the
# fix belongs in a separate change.
node-version: [22, 24]

steps:
- name: Checkout repository
Expand All @@ -62,11 +68,11 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: npm install
- name: Install pnpm and dependencies
uses: apify/actions/pnpm-install@v1.1.2

- name: Run unit tests
run: npm run test:unit
run: pnpm run test:unit

e2e:
name: E2E tests (Node.js 24)
Expand All @@ -82,14 +88,14 @@ jobs:
with:
node-version: 24

- name: Install Dependencies
run: npm install
- name: Install pnpm and dependencies
uses: apify/actions/pnpm-install@v1.1.2

- name: Add localhost-test to Linux hosts file
run: sudo echo "127.0.0.1 localhost-test" | sudo tee -a /etc/hosts

- name: Run E2E tests
run: npm run test:e2e
run: pnpm run test:e2e

bun_unit:
name: Unit tests (Bun)
Expand All @@ -111,11 +117,11 @@ jobs:
with:
bun-version: latest

- name: Install Dependencies
run: npm install
- name: Install pnpm and dependencies
uses: apify/actions/pnpm-install@v1.1.2

- name: Run unit tests with Bun
run: npm run test:bun
run: pnpm run test:bun

bun_e2e:
name: E2E tests (Bun, ${{ inputs.bun_e2e_mode || 'compatible' }})
Expand All @@ -137,11 +143,11 @@ jobs:
with:
bun-version: latest

- name: Install Dependencies
run: npm install
- name: Install pnpm and dependencies
uses: apify/actions/pnpm-install@v1.1.2

- name: Add localhost-test to Linux hosts file
run: sudo echo "127.0.0.1 localhost-test" | sudo tee -a /etc/hosts

- name: Run E2E tests (Bun, ${{ inputs.bun_e2e_mode || 'compatible' }})
run: npm run test:bun:e2e:${{ inputs.bun_e2e_mode || 'compatible' }}
run: pnpm run test:bun:e2e:${{ inputs.bun_e2e_mode || 'compatible' }}
11 changes: 8 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ jobs:
uses: actions/setup-node@v6
with:
node-version: 24
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm install
- name: Install pnpm and dependencies
uses: apify/actions/pnpm-install@v1.1.2

# Determine if this is a beta or latest release
- name: Get release tag
Expand All @@ -46,8 +47,12 @@ jobs:
if: steps.get_release_tag.outputs.release_tag == 'beta'
run: node ./.github/scripts/before-beta-release.cjs

# `pnpm publish` honours the dist-tag flag and is safe under our devEngines
# `onFail: error` pin (`npm publish` would be rejected). `--no-git-checks`
# skips pnpm's working-tree/branch guards — release events are validated by
# the workflow trigger upstream.
- name: Publish to NPM
run: npm publish --tag ${{ steps.get_release_tag.outputs.release_tag }}
run: pnpm publish --tag ${{ steps.get_release_tag.outputs.release_tag }} --no-git-checks

# Latest version is tagged by the release process so we only tag beta here.
- name: Tag version
Expand Down
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"build:watch": "tsc -w",
"build": "tsc",
"clean": "rimraf dist",
"prepublishOnly": "npm run build",
"prepublishOnly": "pnpm run build",
"local-proxy": "tsx test/utils/run_locally.js",
"test": "nyc cross-env NODE_OPTIONS=--insecure-http-parser mocha 'test/unit/**/*.js' 'test/e2e/**/*.js'",
"test:unit": "mocha 'test/unit/**/*.js'",
Expand All @@ -56,8 +56,16 @@
"lint:fix": "eslint . --fix"
},
"engines": {
"node": ">=20.11"
"node": ">=22"
Comment thread
B4nan marked this conversation as resolved.
Outdated
},
"devEngines": {
"packageManager": {
"name": "pnpm",
"version": "11.1.3",
"onFail": "error"
}
},
"packageManager": "pnpm@11.1.3",
"devDependencies": {
"@apify/eslint-config": "^1.0.0",
"@apify/tsconfig": "^0.1.0",
Expand Down
Loading
Loading