Repository navigation
fix(publish)!: apply schema publish defaults when the config has no publish block - #690
Merged
Merged
Conversation
…ublish block Without a publish block, loadPublishConfig returned undefined and the publish package fell back to a hand-written getDefaultConfig() that still had crates.io and pub.dev publishing off, contrary to ADR-0004. It also dropped the top-level git config, so e.g. git.push: false was ignored. loadPublishConfig now parses an absent block through PublishConfigSchema and always merges the top-level git config, and getDefaultConfig() derives from the schema so the two can't drift again. toPublishConfig deep-clones its input because Zod shallow-clones defaults, which would otherwise share nested default objects between configs. BREAKING CHANGE: a repo with detected Rust crates or Dart/Flutter packages and no publish block now publishes them. Set publish.cargo.enabled or publish.pub.enabled to false to version and tag only. Closes #667 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Standing release PR: #614 · v0.42.0 queued (4 packages) · open 82d 20h 33m · ✅ ready to merge Release Preview — v0.41.2 → v0.42.0
These changes will be added to the release PR (#614) when merged: Changelogmonorepo 0.41.2 → 0.42.0
After merge — predicted release
Updated automatically by ReleaseKit |
7 of 20 tasks
… tests Both relied on the old off-by-default and, with no manifest on disk, passed whatever the setting. They now write a crate/pubspec and turn the registry off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8 of 20 tasks
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 23, 2026
Merged
This was referenced Oct 23, 2026
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.
Description
Without a
publishblock,loadPublishConfigreturnedundefinedand@releasekit/publishfell back to a hand-writtengetDefaultConfig()that still hadcargo.enabled/pub.enabledset tofalse, the asymmetry ADR-0004 removed. The defaults now come from the schema instead:loadPublishConfigparses an absent block throughPublishConfigSchemaand always merges the top-levelgitconfig.getDefaultConfig()istoPublishConfig(PublishConfigSchema.parse({})). Only thegitfallbacks stay hand-written, becausepublish.githas no schema defaults by design (it inherits the top-levelgit).toPublishConfigstructuredClones its input: Zod 4 shallow-clones.default({...})values, so nested defaults (verify.*,npm.copyFiles) were otherwise shared between configs.gitconfig when there was nopublishblock (git.push: falsestill pushed). Fixed too.docs/rust.md,docs/dart.md,docs/architecture.md,packages/release/docs/ci-setup.md,packages/publish/README.md.Breaking: a repo with detected Rust crates or Dart/Flutter packages and no
publishblock now publishes them, as ADR-0004 intends (#563 shipped the default, but it only applied when apublishblock existed). Without credentials it fails rather than skips: crates.io at its auth check (CARGO_REGISTRY_TOKEN not set), pub.dev whendart pub publish/flutter pub publishruns. The run stops there; npm packages already published in that run stay published, and the push, tags and GitHub Releases wait for a re-run. Setpublish.cargo.enabled/publish.pub.enabledtofalseto version and tag only.Related Issue(s)
Closes #667. Found while working on it: #688, #689.
Type of Change
feat— New featurefix— Bug fixdocs— Documentation changerefactor— Code refactoringtest— Adding or updating testschore— Maintenance, dependencies, toolingScope
@releasekit/version@releasekit/notes@releasekit/publish@releasekit/release@releasekit/config@releasekit/coreChecklist
pnpm lint)pnpm test)pnpm typecheck)Testing Notes
@releasekit/publishconfig.spec.ts: a table test over no config file / nopublishblock / emptypublishblock, each equal togetDefaultConfig()with npm, cargo and pub enabled; top-levelgitinheritance without apublishblock; defaults don't share nested objects between calls.@releasekit/configload.spec.ts: the same table over the loader, plusgitinheritance.main's sources and pass with the fix.pnpm turbo run test --forcefor config / publish / release: 224 / 293 (+3 skipped) / 848 passed.docs:checkandschema:checkclean (the schema is unchanged).🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge with its documented breaking behavior.Summary
The PR makes missing and empty
publishblocks use the same schema defaults.Acknowledgments from goosewobbler: enabling detected Cargo/pub packages, including failures without credentials, is intentional breaking behavior. The exposed
mainbranch default is acknowledged and tracked separately in #688.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Load repository config] --> B{Publish block exists?} B -->|Yes| C[Use parsed publish settings] B -->|No| D[Parse schema defaults] C --> E[Merge top-level Git settings] D --> E E --> F[Deep-clone settings] F --> G[Fill remaining Git defaults] G --> H[Publish pipeline]Reviews (1) · Last reviewed commit: "fix(publish)!: apply schema publish defa..." · Reviewed by Greptile