feat: publish-target plugin system (npm / jsr / pypi / vscode-marketplace / open-vsx) - #153
Open
theoephraim wants to merge 4 commits into
Open
feat: publish-target plugin system (npm / jsr / pypi / vscode-marketplace / open-vsx)#153theoephraim wants to merge 4 commits into
theoephraim wants to merge 4 commits into
Conversation
…ilt-in) Packages can now publish to multiple targets via per-package publishTargets config and a root targets map (type defaults + named reusable instances). Targets execute per-package with per-target retry state in GitHub release metadata, shared artifacts (one .vsix -> marketplace + Open VSX), and a registry-level pre-publish idempotency guard. JSR publishing (publish-time jsr.json version sync, claim-first bootstrap detection) is modeled on Drake Costa's (@Saeris) setup in mirrordown. Legacy publishCommand/skipNpmPublish fields keep working via back-compat mapping in the resolver.
Python packages ride bumpy's package.json spine via a private stub package; the target syncs [project].version into pyproject.toml at publish time, builds with uv into an isolated per-version dist dir, and uploads via uv publish (PyPI trusted publishing / UV_PUBLISH_TOKEN). PyPI project name comes from pyproject.toml. Prereleases/snapshots are skipped (PEP 440 doesn't cover semver suffixes).
- prepare() lifecycle hook — publish-time version syncs (jsr.json, pyproject.toml) get a formal home instead of living in publish/buildArtifact - broken target config no longer breaks read-only commands: discovery records targetsError and publish flows refuse loudly instead - structured TargetOutcome.skipKind replaces magic reason strings coupled across pipeline and publish command - npmEffectiveRegistry() is the single registry fallback chain (options -> bumpy registry -> publishConfig.registry) for publish args, existence checks, prerelease counters, labels, and URLs - refusesPrivatePackages capability flag replaces hardcoded npm-type check in the resolver - jsr.json version sync uses the formatting-preserving updateJsonFields - per-target published checks run in parallel; shared stringArrayOption/ stringOption helpers de-triplicate option coercion
|
The changes in this PR will be included in the next version bump.
|
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.


What
Packages can now publish to multiple targets at once. Each target is an instance of a plugin implementing one interface (
src/core/targets/); built-ins:npm,custom(the existing shell-command escape hatch),jsr,pypi,vscode-marketplace,open-vsx.Design highlights
checkPublishedbefore every publish) also prevents republish errors when metadata is lost..vsix(packaged once viavsce package --no-dependencies) uploads to both the Marketplace and Open VSX, byte-identical. npm's pack-then-publish flow is the same mechanism (npm-tarball).prepare()hook):jsr.jsonandpyproject.tomlversions sync from package.json in the working tree at publish time — commit them as0.0.0and forget them. No version-phase changes needed.skippedinstead of failing mid-release.allowCustomCommands. Broken target config degrades read-only commands to a warning; publish flows refuse loudly.publishCommand/skipNpmPublishmap onto targets with the same metadata keys — in-flight releases resume cleanly, and all 411 pre-existing tests pass unmodified.Validated against real setups
skipNpmPublish+ vsce/ovsx script chain collapses to two targets (incl.azureCredential: truefor its Azure-OIDC Marketplace auth) — and gains per-registry retry itscmd1 && cmd2setup can't do.["npm", "jsr"].Review
Multi-angle review (8 finders → 12 verified candidates) ran on the branch; all confirmed findings are fixed in the hardening commit (lenient discovery, unified registry fallback chain, structured skip kinds, capability-driven private-package drop, parallel published-checks). Not yet done: a live end-to-end publish — first real validation will be a varlock release after migrating its config.
Credits
JSR publishing behavior (publish-time
jsr.jsonsync, claim-first bootstrap, catalog-resolution requirement) is modeled on Drake Costa's setup in mirrordown — thanks Drake! 🙏Test plan