feat(pgpm-core): rebundleWorkspace — emit chunks as separate modules with control-only cross-chunk deps#1413
Merged
Merged
Conversation
…with control-only cross-chunk deps
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:
|
…pace/writeMinimalModule
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
Atom 4, third slice: the "modular workspace" carve. Where
rebundleModule(#1412) collapses a module into fewer changes within one extension,rebundleWorkspaceemits each chunk as its own tiny module — the same monolith sliced into independently publishable forks (a users module, an admin module, …). This is where thecontrol-onlycross-chunk dep mode from deep-dive-4 finally has a home: cross-module ordering rides on the control-filerequires, not on plan cross-references.The emitted directory is a real, discoverable, deployable pgpm workspace, via two new reusable helpers in
workspace/minimal.ts:writeMinimalModuleemits the minimal file set pgpm needs — matching whatpgpm initscaffolds, minus the network-fetched boilerplate (README/LICENSE/jest/tests/lint configs). The.controlcarries the full extension shape (comment,default_version,module_pathname,requires,relocatable,superuser), and theMakefileis standard PGXS. These are generic scaffolding knives, usable by any emitter — not rebundle-specific.rebundleWorkspacecomposition:crossChunkDepMode(defaultcontrol-only):control-only— deps live only in controlrequires; the plan change has no cross-ref. Extension install/deploy ordering handles the rest — the right shape for versioned module forks.change— additionally records the fine-grained plan cross-ref (<dep>:<dep>).Reuses existing plumbing throughout:
rebundlePlan(chunk model + deploy order), the extractedmergeChunkScript/mergeSqlStatements(shared withrebundleModule/packageModule), and slice'sgeneratePlanContent. Tags are remapped onto their sealing chunk-module.Gates.
mergeSqlStatementspipeline; equality proves the carve preserved the deployed statements and their order.Purely additive — new
rebundleWorkspace+crossChunkDepMode+ theworkspace/minimalhelpers;rebundleModule/rebundlePlanand every existing packaging/slice path are untouched.Test plan
rebundleWorkspacetests (real DDL, no DB): per-chunk module layout +pgpm.json/Makefile, control-only vs change dep representation, no-dep root module, tag remap, byte-identical gate in both dep modes + overwrite guard.workspace/minimalunit tests:pgpm.jsondiscoverable viapgpmPath, module discoverable viamodulePath, full control fields, PGXS Makefile, missing-script/non-empty guards.PgpmMigrate.deployin deploy order;auth/billingschemas + tables created; 2 merged changes recorded.@pgpmjs/coresuite green with Postgres up: 435/435 (66 suites).tsc --noEmitandpnpm buildclean.Link to Devin session: https://app.devin.ai/sessions/ad40d16f38a349b48eb7ce9375e27e6e
Requested by: @pyramation