Skip to content

Commit c34d759

Browse files
authored
Merge branch 'main' into copilot/extract-netlify-artifact-step
2 parents 7f47b8d + 82c731c commit c34d759

File tree

82 files changed

+1589
-1065
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+1589
-1065
lines changed

.all-contributorsrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,13 @@
497497
"avatar_url": "https://avatars.githubusercontent.com/u/1649120?v=4",
498498
"profile": "https://github.com/dmurvihill",
499499
"contributions": ["code"]
500+
},
501+
{
502+
"login": "emilianbold",
503+
"name": "Emi",
504+
"avatar_url": "https://avatars.githubusercontent.com/u/991554?v=4",
505+
"profile": "https://github.com/emilianbold",
506+
"contributions": ["code"]
500507
}
501508
],
502509
"contributorsPerLine": 7

.changeset/rare-rooms-rush.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'fast-check': patch
3+
---
4+
5+
Performance: use Math.imul and bit shift in performance-critical paths. Improves float generation performance by ~7.5%.

.github/workflows/build-status.yml

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -205,19 +205,19 @@ jobs:
205205
runs-on: ${{matrix.os}}
206206
strategy:
207207
matrix:
208-
node-version: [20.x, 22.x, 24.5] # TODO - 24.5 should be replaced by latest, once we understand why snippets.spec.mjs started to fail with 24.6.0
208+
node-version: [20.x, 22.x, 24.x, latest]
209209
os: ['ubuntu-latest']
210210
shard: ['1/1']
211211
include:
212-
- node-version: 22.x
212+
- node-version: 24.x
213213
os: 'macos-latest'
214214
shard: '1/1'
215-
# - node-version: 22.x
216-
# os: 'windows-latest'
217-
# shard: '1/2'
218-
# - node-version: 22.x
219-
# os: 'windows-latest'
220-
# shard: '2/2'
215+
- node-version: 24.x
216+
os: 'windows-latest'
217+
shard: '1/2'
218+
- node-version: 24.x
219+
os: 'windows-latest'
220+
shard: '2/2'
221221
env:
222222
ENABLE_COVERAGE: ${{ matrix.os == 'macos-latest' }}
223223
SKIP_EXPENSIVE: ${{ matrix.os == 'windows-latest' }}
@@ -519,8 +519,6 @@ jobs:
519519
node-version: '24.x'
520520
registry-url: 'https://registry.npmjs.org'
521521
check-latest: true
522-
- name: Update npm
523-
run: npm install -g npm@latest # TODO - To be dropped once npm 11.5.1 or later becomes the default
524522
- name: Download production packages
525523
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
526524
with:
@@ -572,8 +570,6 @@ jobs:
572570
node-version: '24.x'
573571
registry-url: 'https://registry.npmjs.org'
574572
check-latest: true
575-
- name: Update npm
576-
run: npm install -g npm@latest # TODO - To be dropped once npm 11.5.1 or later becomes the default
577573
- name: Download production packages
578574
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
579575
with:
@@ -625,8 +621,6 @@ jobs:
625621
node-version: '24.x'
626622
registry-url: 'https://registry.npmjs.org'
627623
check-latest: true
628-
- name: Update npm
629-
run: npm install -g npm@latest # TODO - To be dropped once npm 11.5.1 or later becomes the default
630624
- name: Download production packages
631625
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
632626
with:
@@ -678,8 +672,6 @@ jobs:
678672
node-version: '24.x'
679673
registry-url: 'https://registry.npmjs.org'
680674
check-latest: true
681-
- name: Update npm
682-
run: npm install -g npm@latest # TODO - To be dropped once npm 11.5.1 or later becomes the default
683675
- name: Download production packages
684676
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
685677
with:
@@ -731,8 +723,6 @@ jobs:
731723
node-version: '24.x'
732724
registry-url: 'https://registry.npmjs.org'
733725
check-latest: true
734-
- name: Update npm
735-
run: npm install -g npm@latest # TODO - To be dropped once npm 11.5.1 or later becomes the default
736726
- name: Download production packages
737727
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
738728
with:
@@ -784,8 +774,6 @@ jobs:
784774
node-version: '24.x'
785775
registry-url: 'https://registry.npmjs.org'
786776
check-latest: true
787-
- name: Update npm
788-
run: npm install -g npm@latest # TODO - To be dropped once npm 11.5.1 or later becomes the default
789777
- name: Download production packages
790778
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
791779
with:
@@ -837,8 +825,6 @@ jobs:
837825
node-version: '24.x'
838826
registry-url: 'https://registry.npmjs.org'
839827
check-latest: true
840-
- name: Update npm
841-
run: npm install -g npm@latest # TODO - To be dropped once npm 11.5.1 or later becomes the default
842828
- name: Download production packages
843829
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
844830
with:
@@ -890,8 +876,6 @@ jobs:
890876
node-version: '24.x'
891877
registry-url: 'https://registry.npmjs.org'
892878
check-latest: true
893-
- name: Update npm
894-
run: npm install -g npm@latest # TODO - To be dropped once npm 11.5.1 or later becomes the default
895879
- name: Download production packages
896880
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
897881
with:
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Validate PR title
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, reopened]
6+
branches:
7+
- main
8+
- 'next-*_*_*'
9+
- 'fix-v*'
10+
11+
jobs:
12+
validate-pr-title:
13+
name: 'Validate PR title'
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
pull-requests: read
18+
steps:
19+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
20+
- name: Validate PR title
21+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
22+
with:
23+
script: |
24+
const fs = require('fs');
25+
const path = require('path');
26+
const prTitle = context.payload.pull_request.title;
27+
28+
const match = prTitle.match(/^([\p{Emoji}\uFE0F\u200d]+)(?:\(([a-z-]+)\)\s*)? ([^ ].+)$/u);
29+
if (match === null) {
30+
core.setFailed('❌ Invalid format');
31+
return;
32+
}
33+
34+
const [, emoji, packageName, description] = match;
35+
if (packageName !== undefined) {
36+
const packagesDir = path.join(process.env.GITHUB_WORKSPACE, 'packages');
37+
const packages =
38+
fs.readdirSync(packagesDir, { withFileTypes: true })
39+
.filter(dirent => dirent.isDirectory())
40+
.map(dirent => dirent.name)
41+
.filter(name => name !== 'fast-check');
42+
if (!packages.includes(packageName)) {
43+
core.setFailed('❌ Invalid package name');
44+
return;
45+
}
46+
}
47+
48+
if (!description.trim()) {
49+
core.setFailed('❌ Missing description');
50+
return;
51+
}
52+
53+
console.log('✅ Valid PR title');

examples/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"@types/supertest": "^6.0.3",
2727
"happy-dom": "^20.0.10",
2828
"typescript": "~5.9.3",
29-
"vitest": "^3.2.4"
29+
"vitest": "^4.0.5"
3030
},
3131
"author": "Nicolas DUBIEN <[email protected]>",
3232
"license": "MIT"

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@
2626
"changelog": "changeset status",
2727
"pack:all": "pnpm --filter {./packages/**} --parallel exec pnpm pack --out package.tgz",
2828
"unpack:all": "pnpm --filter {./packages/**} --parallel exec tar -xf package.tgz --strip-components=1 --exclude='package/package.json'",
29-
"update:documentation": "cross-env UPDATE_CODE_SNIPPETS=true pnpm run test --project fast-check:e2e test/e2e/documentation"
29+
"update:documentation": "cross-env UPDATE_CODE_SNIPPETS=true pnpm run test --project fast-check test/e2e/documentation"
3030
},
3131
"devDependencies": {
3232
"@changesets/cli": "^2.29.7",
3333
"@eslint/js": "^9.39.1",
3434
"@fast-check/packaged": "*",
3535
"@typescript-eslint/utils": "^8.46.3",
36-
"@vitest/coverage-v8": "^3.0.9",
36+
"@vitest/coverage-v8": "^4.0.5",
3737
"all-contributors-cli": "^6.26.1",
3838
"cross-env": "^10.1.0",
3939
"eslint": "^9.39.1",
@@ -44,6 +44,6 @@
4444
"publint": "^0.3.15",
4545
"typescript": "~5.9.3",
4646
"typescript-eslint": "^8.46.3",
47-
"vitest": "^3.2.4"
47+
"vitest": "^4.0.5"
4848
}
4949
}

packages/ava/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
"fast-check": "workspace:*",
6060
"rxjs": "^7.8.2",
6161
"typescript": "~5.9.3",
62-
"vite": "^7.1.12",
63-
"vitest": "^3.2.4"
62+
"vite": "^7.2.1",
63+
"vitest": "^4.0.5"
6464
},
6565
"keywords": [
6666
"ava",

packages/fast-check/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
232232
<td align="center" valign="top" width="14.28%"><a href="https://github.com/matthyk"><img src="https://avatars.githubusercontent.com/u/53833818?v=4?s=100" width="100px;" alt="Matthias Keckl"/><br /><sub><b>Matthias Keckl</b></sub></a><br /><a href="https://github.com/dubzzz/fast-check/commits?author=matthyk" title="Documentation">📖</a></td>
233233
<td align="center" valign="top" width="14.28%"><a href="https://github.com/dmurvihill"><img src="https://avatars.githubusercontent.com/u/1649120?v=4?s=100" width="100px;" alt="Dolan Murvihill"/><br /><sub><b>Dolan Murvihill</b></sub></a><br /><a href="https://github.com/dubzzz/fast-check/commits?author=dmurvihill" title="Code">💻</a></td>
234234
</tr>
235+
<tr>
236+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/emilianbold"><img src="https://avatars.githubusercontent.com/u/991554?v=4?s=100" width="100px;" alt="Emi"/><br /><sub><b>Emi</b></sub></a><br /><a href="https://github.com/dubzzz/fast-check/commits?author=emilianbold" title="Code">💻</a></td>
237+
</tr>
235238
</tbody>
236239
</table>
237240

packages/fast-check/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"replace-in-file": "^8.3.0",
7878
"typedoc": "^0.28.14",
7979
"typescript": "~5.9.3",
80-
"vitest": "^3.2.4"
80+
"vitest": "^4.0.5"
8181
},
8282
"keywords": [
8383
"property-based testing",

packages/fast-check/src/arbitrary/_internals/builders/AnyArbitraryBuilder.ts

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import type { Arbitrary } from '../../../check/arbitrary/definition/Arbitrary';
33
import { stringify } from '../../../utils/stringify';
44
import { array } from '../../array';
55
import { oneof } from '../../oneof';
6-
import { tuple } from '../../tuple';
76
import { bigInt } from '../../bigInt';
87
import { date } from '../../date';
98
import { float32Array } from '../../float32Array';
@@ -17,31 +16,14 @@ import { uint8Array } from '../../uint8Array';
1716
import { uint8ClampedArray } from '../../uint8ClampedArray';
1817
import { sparseArray } from '../../sparseArray';
1918
import type { QualifiedObjectConstraints } from '../helpers/QualifiedObjectConstraints';
20-
import { arrayToMapMapper, arrayToMapUnmapper } from '../mappers/ArrayToMap';
2119
import { arrayToSetMapper, arrayToSetUnmapper } from '../mappers/ArrayToSet';
2220
import { letrec } from '../../letrec';
2321
import type { SizeForArbitrary } from '../helpers/MaxLengthFromMinLength';
2422
import { uniqueArray } from '../../uniqueArray';
2523
import type { DepthIdentifier } from '../helpers/DepthContext';
2624
import { createDepthIdentifier } from '../helpers/DepthContext';
2725
import { dictionary } from '../../dictionary';
28-
29-
/** @internal */
30-
function mapOf<T, U>(
31-
ka: Arbitrary<T>,
32-
va: Arbitrary<U>,
33-
maxKeys: number | undefined,
34-
size: SizeForArbitrary | undefined,
35-
depthIdentifier: DepthIdentifier,
36-
) {
37-
return uniqueArray(tuple(ka, va), {
38-
maxLength: maxKeys,
39-
size,
40-
comparator: 'SameValueZero',
41-
selector: (t) => t[0],
42-
depthIdentifier,
43-
}).map(arrayToMapMapper, arrayToMapUnmapper);
44-
}
26+
import { map } from '../../map';
4527

4628
/** @internal */
4729
function dictOf<U>(
@@ -129,8 +111,8 @@ export function anyArbitraryBuilder(constraints: QualifiedObjectConstraints): Ar
129111
set: setOf(tie('anything'), maxKeys, size, depthIdentifier),
130112
// Map<key, anything> | Map<anything, anything>
131113
map: oneof(
132-
mapOf(tie('keys') as Arbitrary<string>, tie('anything'), maxKeys, size, depthIdentifier),
133-
mapOf(tie('anything'), tie('anything'), maxKeys, size, depthIdentifier),
114+
map(tie('keys') as Arbitrary<string>, tie('anything'), { maxKeys, size, depthIdentifier }),
115+
map(tie('anything'), tie('anything'), { maxKeys, size, depthIdentifier }),
134116
),
135117
// {[key:string]: anything}
136118
object: dictOf(

0 commit comments

Comments
 (0)