Skip to content

Add build & yalc files to the delete script#71

Draft
imnasnainaec wants to merge 4 commits into
mainfrom
del-more-things
Draft

Add build & yalc files to the delete script#71
imnasnainaec wants to merge 4 commits into
mainfrom
del-more-things

Conversation

@imnasnainaec
Copy link
Copy Markdown
Contributor

@imnasnainaec imnasnainaec commented May 14, 2026

This change is Reviewable

Summary by CodeRabbit

  • Chores
    • Updated build cleanup script to support granular cleanup options with separate flags for different cleanup targets.
    • Modified the core reinstall command to use updated cleanup parameters.

Review Change Stack

@imnasnainaec imnasnainaec self-assigned this May 14, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9c34ccd1-2936-4f4f-88f7-238f89b1907f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch del-more-things

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@imnasnainaec

This comment was marked as resolved.

@imnasnainaec imnasnainaec changed the title Add yalc-files to the delete script Add build & yalc files to the delete script May 15, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 103d275 and 33f0bd0.

📒 Files selected for processing (2)
  • package.json
  • scripts/delete-temp-files.cjs

Comment thread package.json
"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",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

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.

Comment on lines +67 to +72
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));
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

--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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant