Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 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
5 changes: 5 additions & 0 deletions .changeset/worker-drop-commonjs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@fast-check/worker": major
---

💥(worker) Drop CommonJS support
8 changes: 4 additions & 4 deletions .github/workflows/build-status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -479,14 +479,14 @@ jobs:
- name: Check in CommonJS mode
run: |
if [ "${{ matrix.ts-version }}" = "5.0" ] || [ "${{ matrix.ts-version }}" = "5.7" ]; then
pnpm --filter {./packages/**} --filter '!@fast-check/ava' --parallel -c exec "cd test-types && pnpm --package typescript@${{ matrix.ts-version }} dlx tsc --noEmit --skipLibCheck --strict *.cts"
pnpm --filter {./packages/**} --filter '!@fast-check/ava' --filter '!@fast-check/worker' --parallel -c exec "cd test-types && pnpm --package typescript@${{ matrix.ts-version }} dlx tsc --noEmit --skipLibCheck --strict *.cts"
else
pnpm --filter {./packages/**} --parallel -c exec "cd test-types && pnpm --package typescript@${{ matrix.ts-version }} dlx tsc --noEmit --skipLibCheck --strict *.cts"
fi
- name: Check in CommonJS mode with NodeNext
run: |
if [ "${{ matrix.ts-version }}" = "5.0" ] || [ "${{ matrix.ts-version }}" = "5.7" ]; then
pnpm --filter {./packages/**} --filter '!@fast-check/ava' --parallel -c exec "cd test-types && pnpm --package typescript@${{ matrix.ts-version }} dlx tsc --noEmit --skipLibCheck --strict --module NodeNext --moduleResolution NodeNext *.cts"
pnpm --filter {./packages/**} --filter '!@fast-check/ava' --filter '!@fast-check/worker' --parallel -c exec "cd test-types && pnpm --package typescript@${{ matrix.ts-version }} dlx tsc --noEmit --skipLibCheck --strict --module NodeNext --moduleResolution NodeNext *.cts"
else
pnpm --filter {./packages/**} --parallel -c exec "cd test-types && pnpm --package typescript@${{ matrix.ts-version }} dlx tsc --noEmit --skipLibCheck --strict --module NodeNext --moduleResolution NodeNext *.cts"
fi
Expand All @@ -495,14 +495,14 @@ jobs:
- name: Check in ES Modules mode
run: |
if [ "${{ matrix.ts-version }}" = "5.0" ] || [ "${{ matrix.ts-version }}" = "5.7" ]; then
pnpm --filter {./packages/**} --filter '!@fast-check/ava' --parallel -c exec "cd test-types && pnpm --package typescript@${{ matrix.ts-version }} dlx tsc --noEmit --skipLibCheck --strict *.mts"
pnpm --filter {./packages/**} --filter '!@fast-check/ava' --filter '!@fast-check/worker' --parallel -c exec "cd test-types && pnpm --package typescript@${{ matrix.ts-version }} dlx tsc --noEmit --skipLibCheck --strict *.mts"
else
pnpm --filter {./packages/**} --parallel -c exec "cd test-types && pnpm --package typescript@${{ matrix.ts-version }} dlx tsc --noEmit --skipLibCheck --strict *.mts"
fi
- name: Check in ES Modules mode with NodeNext
run: |
if [ "${{ matrix.ts-version }}" = "5.0" ] || [ "${{ matrix.ts-version }}" = "5.7" ]; then
pnpm --filter {./packages/**} --filter '!@fast-check/ava' --parallel -c exec "cd test-types && pnpm --package typescript@${{ matrix.ts-version }} dlx tsc --noEmit --skipLibCheck --strict --module NodeNext --moduleResolution NodeNext *.mts"
pnpm --filter {./packages/**} --filter '!@fast-check/ava' --filter '!@fast-check/worker' --parallel -c exec "cd test-types && pnpm --package typescript@${{ matrix.ts-version }} dlx tsc --noEmit --skipLibCheck --strict --module NodeNext --moduleResolution NodeNext *.mts"
else
pnpm --filter {./packages/**} --parallel -c exec "cd test-types && pnpm --package typescript@${{ matrix.ts-version }} dlx tsc --noEmit --skipLibCheck --strict --module NodeNext --moduleResolution NodeNext *.mts"
fi
Expand Down
4 changes: 2 additions & 2 deletions packages/worker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ const property = propertyFor(new URL(import.meta.url), { randomSource: 'worker'

## Minimal requirements

- Node ≥14.18.0<sup>(1)</sup><sup>(2)</sup><sup>(3)</sup>
- Node ≥20.19.0<sup>(1)</sup><sup>(2)</sup><sup>(3)</sup>
- TypeScript ≥4.1 (optional)

_(1): `worker_threads` alone would only require Node ≥10.5.0, but our usage of `require(node:*)` forces us to request at least Node ≥14.18.0_
_(1): Requires support for `require(esm)`._

_(2): this package targets ES2020 specification which is quite well supported (more than 94%) by any Node ≥14.5.0_

Expand Down
3 changes: 0 additions & 3 deletions packages/worker/package.cjs-template.json

This file was deleted.

27 changes: 12 additions & 15 deletions packages/worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,28 @@
"description": "Provide built-ins to run predicates directly within dedicated workers",
"version": "0.5.0",
"type": "module",
"main": "lib/main.js",
"exports": {
"./package.json": "./package.json",
".": {
"require": {
"types": "./lib/cjs/main.d.ts",
"default": "./lib/cjs/main.js"
},
"import": {
"types": "./lib/main.d.ts",
"default": "./lib/main.js"
}
"types": "./lib/main.d.ts",
"default": "./lib/main.js"
}
},
"typesVersions": {
"*": {
"index": [
"./lib/main.d.ts"
]
}
},
"module": "lib/main.js",
"types": "lib/main.d.ts",
"files": [
"lib"
],
"scripts": {
"build": "pnpm run build:publish-cjs && pnpm run build:publish-esm && pnpm run build:publish-types",
"build": "pnpm run build:publish-esm && pnpm run build:publish-types",
"build-ci": "pnpm run build",
"build:publish-types": "tsc -p tsconfig.publish.types.json && tsc -p tsconfig.publish.types.json --outDir lib/cjs",
"build:publish-cjs": "tsc -p tsconfig.publish.json --outDir lib/cjs && cp package.cjs-template.json lib/cjs/package.json",
"build:publish-esm": "tsc -p tsconfig.publish.json --module es2015 --moduleResolution node",
"build:publish-types": "tsc -p tsconfig.publish.types.json",
"build:publish-esm": "tsc -p tsconfig.publish.json",
"test-bundle:cjs": "node test-bundle/main.cjs",
"test-bundle:mjs": "node test-bundle/main.mjs",
"test-bundle": "pnpm run test-bundle:cjs && pnpm run test-bundle:mjs",
Expand Down
5 changes: 4 additions & 1 deletion packages/worker/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "../../tsconfig.common.json"
"extends": "../../tsconfig.common.json",
"compilerOptions": {
"module": "node20"
}
}
3 changes: 2 additions & 1 deletion packages/worker/tsconfig.publish.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"extends": "../../tsconfig.publish.json",
"compilerOptions": {
"outDir": "lib/"
"outDir": "lib/",
"module": "node20"
},
"include": ["src/"]
}
3 changes: 2 additions & 1 deletion packages/worker/tsconfig.publish.types.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"extends": "../../tsconfig.publish.types.json",
"compilerOptions": {
"outDir": "lib/"
"outDir": "lib/",
"module": "node20"
},
"include": ["src/"]
}