From d340f9c740da4681cb6d25ffb34f5492a443c30d Mon Sep 17 00:00:00 2001 From: "claude[bot]" <209825114+claude[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2026 22:29:50 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F(worker)=20Bump=20pure-rand?= =?UTF-8?q?=20to=20v8=20(#6689)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Bump `@fast-check/worker` to use pure-rand v8, mirroring the upgrade done in the main `fast-check` package. Updates import paths from the v7-style `pure-rand/generator/XorShift` to the v8-style `pure-rand/generator/xorshift128plus`. Related to #6679. ## Checklist — _Don't delete this checklist and make sure you do the following before opening the PR_ - [x] I have a full understanding of every line in this PR — whether the code was hand-written, AI-generated, copied from external sources or produced by any other tool - [x] I flagged the impact of my change (minor / patch / major) either by running `pnpm run bump` or by following the instructions from the changeset bot - [x] I kept this PR focused on a single concern and did not bundle unrelated changes - [x] I followed the [gitmoji](https://gitmoji.dev/) specification for the name of the PR, including the package scope (e.g. `🐛(vitest) Something...`) when the change targets a package other than `fast-check` - [x] I added relevant tests and they would have failed without my PR (when applicable) --------- Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Nicolas DUBIEN Co-authored-by: Claude Sonnet 4.6 --- .changeset/worker-pure-rand-v8.md | 5 +++++ packages/worker/package.json | 2 +- packages/worker/src/internals/ValueFromState.ts | 4 ++-- .../worker-property/WorkerPropertyFromWorker.spec.ts | 2 +- pnpm-lock.yaml | 4 ++-- 5 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 .changeset/worker-pure-rand-v8.md diff --git a/.changeset/worker-pure-rand-v8.md b/.changeset/worker-pure-rand-v8.md new file mode 100644 index 00000000..46d7ad3c --- /dev/null +++ b/.changeset/worker-pure-rand-v8.md @@ -0,0 +1,5 @@ +--- +"@fast-check/worker": patch +--- + +⚡️ Bump pure-rand to v8 diff --git a/packages/worker/package.json b/packages/worker/package.json index b71e20e4..65eb7e1c 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -31,7 +31,7 @@ "homepage": "https://github.com/dubzzz/fast-check/tree/main/packages/worker#readme", "dependencies": { "fast-check": "^4.0.0", - "pure-rand": "^7.0.1" + "pure-rand": "^8.0.0" }, "devDependencies": { "@fast-check/worker": "workspace:*", diff --git a/packages/worker/src/internals/ValueFromState.ts b/packages/worker/src/internals/ValueFromState.ts index 4b7b9411..601ecbd2 100644 --- a/packages/worker/src/internals/ValueFromState.ts +++ b/packages/worker/src/internals/ValueFromState.ts @@ -1,4 +1,4 @@ -import { xorshift128plus } from 'pure-rand/generator/XorShift'; +import { xorshift128plusFromState } from 'pure-rand/generator/xorshift128plus'; import { Random } from 'fast-check'; import type { IRawProperty } from 'fast-check'; @@ -12,6 +12,6 @@ export type ValueState = { rngState: number[]; runId: number | undefined }; * @param state - The state defining the Value to be generated (the how) */ export function generateValueFromState(property: IRawProperty, state: ValueState): Ts { - const mrng = new Random(xorshift128plus.fromState(state.rngState)); + const mrng = new Random(xorshift128plusFromState(state.rngState)); return property.generate(mrng, state.runId).value_; } diff --git a/packages/worker/test/internals/worker-property/WorkerPropertyFromWorker.spec.ts b/packages/worker/test/internals/worker-property/WorkerPropertyFromWorker.spec.ts index dbef1416..67b87c27 100644 --- a/packages/worker/test/internals/worker-property/WorkerPropertyFromWorker.spec.ts +++ b/packages/worker/test/internals/worker-property/WorkerPropertyFromWorker.spec.ts @@ -1,6 +1,6 @@ import { WorkerPropertyFromWorker } from '../../../src/internals/worker-property/WorkerPropertyFromWorker.js'; import fc from 'fast-check'; -import { xorshift128plus } from 'pure-rand/generator/XorShift'; +import { xorshift128plus } from 'pure-rand/generator/xorshift128plus'; import { describe, it, expect, vi } from 'vitest'; describe('WorkerPropertyFromWorker', () => { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fad11863..27e4fa85 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -314,8 +314,8 @@ importers: specifier: ^4.0.0 version: link:../fast-check pure-rand: - specifier: ^7.0.1 - version: 7.0.1 + specifier: ^8.0.0 + version: 8.0.0 devDependencies: '@fast-check/worker': specifier: workspace:* -- 2.51.2