chore(remix): replace glob with native recursive fs walk#19531
Open
roli-lpci wants to merge 1 commit intogetsentry:developfrom
Open
chore(remix): replace glob with native recursive fs walk#19531roli-lpci wants to merge 1 commit intogetsentry:developfrom
roli-lpci wants to merge 1 commit intogetsentry:developfrom
Conversation
Replaces the glob dependency with a simple recursive fs.readdirSync walk for
finding .map files to delete after upload. Uses manual recursion instead of
fs.readdirSync({recursive}) to avoid the Node 18.17-18.18 withFileTypes bug.
Removes glob and its transitive dependencies (minimatch, brace-expansion,
balanced-match, minipass, jackspeak, path-scurry, foreground-child).
Also removes orphaned glob-related resolution overrides from the integration
test package.json.
Ref: getsentry#19447
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the
globdependency in@sentry/remixwith a simple recursivefs.readdirSyncwalk for finding.mapfiles to delete after source map upload.yarn lint) & (yarn test).Ref #19447
What this does
Replaces
glob.sync('**/*.map', { cwd: buildPath })indeleteSourcemaps.jswith a manual recursive directory walk using nativefs.readdirSync. This removes theglobpackage and its transitive dependency tree (minimatch, brace-expansion, balanced-match, minipass, jackspeak, path-scurry, foreground-child) from@sentry/remix.Also cleans up orphaned
glob/jackspeak/path-scurryresolution overrides in the integration testpackage.json.Why manual recursion instead of
fs.readdirSync({recursive: true})fs.readdirSync(dir, { recursive: true, withFileTypes: true })silently drops entries on Node 18.17-18.18 due to a known Node.js bug. Since@sentry/remixsupports Node >= 18, a manual recursive walk avoids this edge case entirely.Behavioral notes
buildPath, matchingglob.sync's{ cwd }output shape[]gracefully (matching glob behavior)dot: false), but this has zero practical impact since Remix build output never produces.mapdotfilesCo-Authored-By: Claude Opus 4.6 noreply@anthropic.com