✨(packaged) Replace keepNodeModules with flexible keep patterns#6713
✨(packaged) Replace keepNodeModules with flexible keep patterns#6713
Conversation
Add a new --keep <glob> option that can be specified multiple times to preserve files/directories matching glob patterns during cleanup, using picomatch for matching. This generalizes --keep-node-modules to support any path. https://claude.ai/code/session_01Sf6CnWKuP1jHUcFiLJ97u3
Use Node.js built-in path.matchesGlob() (available since Node 20.17.0) instead of the picomatch dependency for glob pattern matching in the --keep option. https://claude.ai/code/session_01Sf6CnWKuP1jHUcFiLJ97u3
The --keep-node-modules CLI flag now adds 'node_modules' to the keep patterns array instead of passing a separate keepNodeModules option. This simplifies the API surface by using a single mechanism for keeping files. https://claude.ai/code/session_01Sf6CnWKuP1jHUcFiLJ97u3
Drop the dedicated --keep-node-modules flag from the CLI and docs. Users should use --keep node_modules instead. Update tests to remove keepNodeModules column and add a test for glob paths with --keep. https://claude.ai/code/session_01Sf6CnWKuP1jHUcFiLJ97u3
Fold all standalone --keep tests into the it.each table with a new keep column. Add tsconfig files to the shared fixture. Use path.matchesGlob in assertions to dynamically compute expected file existence based on the keep patterns under test. https://claude.ai/code/session_01Sf6CnWKuP1jHUcFiLJ97u3
🦋 Changeset detectedLatest commit: 8afc253 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@fast-check/ava
fast-check
@fast-check/jest
@fast-check/packaged
@fast-check/poisoning
@fast-check/vitest
@fast-check/worker
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6713 +/- ##
==========================================
- Coverage 94.54% 94.52% -0.02%
==========================================
Files 210 210
Lines 5686 5685 -1
Branches 1499 1499
==========================================
- Hits 5376 5374 -2
- Misses 297 298 +1
Partials 13 13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Replace --keep-node-modules with --keep and pass test-bundle/test-types directly, removing the git restore workaround steps. https://claude.ai/code/session_01Sf6CnWKuP1jHUcFiLJ97u3
- Use --keep flag per value (--keep a --keep b) in CI workflows - Throw on unknown flags - Throw when --keep is passed without a value https://claude.ai/code/session_01Sf6CnWKuP1jHUcFiLJ97u3
Updated version from patch to minor for @fast-check/packaged.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
Description
Replaces the
keepNodeModulesboolean option with a more flexiblekeeparray option that accepts glob patterns. This allows users to preserve any files or directories matching specified patterns, not justnode_modules.Changes
removeNonPublishedFiles()option fromkeepNodeModules: booleantokeep: string[](glob patterns)--keep-node-modulesflag to--keep <glob>(can be specified multiple times)Motivation
The new approach is more flexible and allows users to preserve any files or directories matching glob patterns (e.g.,
tsconfig*,src, etc.) rather than being limited to justnode_modules.Checklist
pnpm run bumpor by following the instructions from the changeset bothttps://claude.ai/code/session_01Sf6CnWKuP1jHUcFiLJ97u3