Add build & yalc files to the delete script#71
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
eae4050 to
f56ed43
Compare
f56ed43 to
aecc392
Compare
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@package.json`:
- Line 35: The "core:reinstall" npm script currently calls node
./scripts/delete-temp-files.cjs with the destructive "--all" flag which wipes
dev-appdata, caches, builds and forces full rebuilds; update the script
definition for "core:reinstall" to call delete-temp-files.cjs with only the
narrower flags required (e.g. "--npm" and, if yalc cleanup is intended,
"--yalc") instead of "--all" so it performs npm/yalc cleanup only and avoids
wiping dev-appdata, Electron caches, build outputs and other heavy state.
In `@scripts/delete-temp-files.cjs`:
- Around line 67-72: The BUILD_PATHS collection only adds directories from
findDirsNamed for 'dist' and 'temp-build' but misses buildinfo files; update the
shouldDeleteBuild logic (and the analogous block around lines 128-140) to also
collect files matching *buildinfo* under CORE_DIR_PATH (not just directories) —
either extend or add a helper like findPathsMatching(CORE_DIR_PATH,
'*buildinfo*', SKIP_DIRS) and push those file paths into BUILD_PATHS (or a
combined list used for deletion), ensuring you reference the existing symbols
BUILD_PATHS, shouldDeleteBuild, findDirsNamed and CORE_DIR_PATH so the cleanup
removes incremental compiler state as intended.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 1ac91d80-01cb-49ce-a26e-58594a212237
📒 Files selected for processing (2)
package.jsonscripts/delete-temp-files.cjs
| "core:stop": "npm --prefix ../paranext-core stop", | ||
| "core:reset": "npm run core:stop && node ./scripts/delete-temp-files.cjs --core --ext", | ||
| "core:reinstall": "npm run core:reset && node ./scripts/delete-temp-files.cjs --npm && npm run core:update && npm i", | ||
| "core:reinstall": "npm run core:stop && node ./scripts/delete-temp-files.cjs --all && npm run core:update && npm i", |
There was a problem hiding this comment.
core:reinstall is now much more destructive than the command name suggests.
Using --all here also wipes dev-appdata, Electron cache, build outputs, test caches, and yalc state. That's a big jump from the previous npm-only cleanup, and per the PR discussion it forces multi-minute core rebuilds that usually are not needed. Please keep this script on the narrower flags it actually requires, e.g. --npm plus --yalc if yalc cleanup was the intended addition.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@package.json` at line 35, The "core:reinstall" npm script currently calls
node ./scripts/delete-temp-files.cjs with the destructive "--all" flag which
wipes dev-appdata, caches, builds and forces full rebuilds; update the script
definition for "core:reinstall" to call delete-temp-files.cjs with only the
narrower flags required (e.g. "--npm" and, if yalc cleanup is intended,
"--yalc") instead of "--all" so it performs npm/yalc cleanup only and avoids
wiping dev-appdata, Electron caches, build outputs and other heavy state.
| const BUILD_PATHS = []; | ||
| if (shouldDeleteBuild) { | ||
| // Add core build output subdirectories to `BUILD_PATHS` | ||
| BUILD_PATHS.push(...findDirsNamed(CORE_DIR_PATH, 'dist', SKIP_DIRS)); | ||
| BUILD_PATHS.push(...findDirsNamed(CORE_DIR_PATH, 'temp-build', SKIP_DIRS)); | ||
| } |
There was a problem hiding this comment.
--build still misses *buildinfo* artifacts.
The PR objective explicitly includes paranext-core/**/*buildinfo*, but this implementation only collects dist and temp-build directories, and the helper only returns directories. A "clean build" can still reuse stale incremental compiler state until file matching is added here.
Also applies to: 128-140
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@scripts/delete-temp-files.cjs` around lines 67 - 72, The BUILD_PATHS
collection only adds directories from findDirsNamed for 'dist' and 'temp-build'
but misses buildinfo files; update the shouldDeleteBuild logic (and the
analogous block around lines 128-140) to also collect files matching *buildinfo*
under CORE_DIR_PATH (not just directories) — either extend or add a helper like
findPathsMatching(CORE_DIR_PATH, '*buildinfo*', SKIP_DIRS) and push those file
paths into BUILD_PATHS (or a combined list used for deletion), ensuring you
reference the existing symbols BUILD_PATHS, shouldDeleteBuild, findDirsNamed and
CORE_DIR_PATH so the cleanup removes incremental compiler state as intended.
This change is
Summary by CodeRabbit