fix: add pregenerate cleanup to SDK packages to remove stale files#838
Merged
pyramation merged 1 commit intomainfrom Mar 17, 2026
Merged
fix: add pregenerate cleanup to SDK packages to remove stale files#838pyramation merged 1 commit intomainfrom
pyramation merged 1 commit intomainfrom
Conversation
Each generate script now cleans its output directory via rimraf before
running codegen. This prevents stale files from deleted database
entities from persisting and causing build failures.
Affected packages:
- constructive-sdk: cleans src/{admin,auth,objects,public}
- constructive-cli: cleans src/{admin,auth,objects,public}
- constructive-react: cleans src/{admin,auth,objects,public}
- migrate-client (via constructive-sdk): cleans src/migrate
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
Adds
pregeneratescripts to each SDK package that clean generated output directories before codegen runs. This prevents stale files from deleted database entities (e.g.uuidModule.ts) from persisting and causing build failures when they reference types that no longer exist.Companion to constructive-db#595 which applies the same fix to the constructive-db repo.
Changes:
rimraf(^6.1.3) as a root devDependencypregeneratescript toconstructive-sdk,constructive-cli, andconstructive-reactthat removessrc/{admin,auth,objects,public}andsrc/index.tspregenerate:migrate-clienttoconstructive-sdkthat removes../migrate-client/src/migrateand../migrate-client/src/index.tsgeneratescripts to run theirpregeneratestep firstReview & Testing Checklist for Human
constructive-clicleanup list is safe: The CLI has non-generated files insrc/(cli-commands.ts,cli.ts,commands/,config/,utils/) — confirm thepregeneratelist only targets generated dirs (admin,auth,objects,public,index.ts) and doesn't touch thesepregenerate:migrate-clientrelative path: Runs fromsdk/constructive-sdk/and targets../migrate-client/src/migrate— confirm this resolves correctly@types/nodeversion shifts (25.5.0→22.19.15) that appear to be pnpm re-resolution noise from adding rimraf — verify these don't cause type issuesNotes
pregeneratescripts will need updating to include them.@constructive-io/graphql-codegen); the cleanup is at the script level.Link to Devin session: https://app.devin.ai/sessions/08781f0838fd4c929bb5ab08052b2b5a
Requested by: @pyramation