Skip to content

feat: add dub publish command for registry registration - #3139

Open
AMDphreak wants to merge 3 commits into
dlang:masterfrom
AMDphreak:feat/publish-command
Open

feat: add dub publish command for registry registration#3139
AMDphreak wants to merge 3 commits into
dlang:masterfrom
AMDphreak:feat/publish-command

Conversation

@AMDphreak

@AMDphreak AMDphreak commented Jul 28, 2026

Copy link
Copy Markdown

Summary

Expands dub publish from early register/status/update/login support to feature parity with dub-publish 0.3.2 (adapted to official dub conventions).

  • Actions: register/publish, status, update, login, logout, remove (--yes), logo, logo-delete, docs-url, categories, hooks, hooks-disable, repo, perms-add, leave
  • Idempotent register: AlreadyRegisteredException → success + metadata refresh; fails if still on the add-package form after POST
  • Ingest poll: uses /api/packages/:name/info (packageExists) then triggerUpdate; status reports (registered, no versions yet) when appropriate
  • Webhooks: hooks regenerates secret and prints/saves clean generic/GitHub/GitLab URLs (avoids dub-registry no warning in misspelling of fields in dub.json #614)
  • Credentials: credentials.v1 under DUB user settings (~/.dub / %APPDATA%\dub) — DPAPI on Windows, Base64 + mode 0600 elsewhere; legacy plaintext upgraded on load
  • Safer password input: password.incoming drop file (consumed after verified --save-credentials), --password-file, --password-stdin, opt-in --prompt-password; logout clears store + drop file
  • Dry-run via existing --annotate / dub.dryRun; User-Agent dub/<version>; curl gated with version (DubUseCurl)

Test plan

  • dub build
  • bin/dub publish -h shows the full action/option set
  • bin/dub publish --annotate dry-runs register without contacting the registry
  • bin/dub publish status -n vibe-d (live registry)
  • bin/dub publish logout --annotate
  • bin/dub publish hooks --annotate -n mypkg
  • Login with password.incoming + --save-credentials stores credentials.v1 and deletes the drop file (Windows DPAPI / Posix 0600)
  • bin/dub publish remove -n mypkg without --yes refuses; with --yes requires intentional confirmation

Registers packages with code.dlang.org from the CLI (login +
register_package), with status and update actions.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown

Thanks for your Pull Request and making D better!

This comment will automatically be updated to summarize some statistics in a few minutes.

AMDphreak and others added 2 commits July 31, 2026 08:54
Port dub-publish 0.3.2 features into dub publish: owner settings
(logo, docs-url, categories, hooks, repo, perms, remove, leave),
idempotent register with ingest polling, and DPAPI/0600 credentials
with password.incoming / --password-file / --password-stdin.

Co-authored-by: Cursor <cursoragent@cursor.com>
Match dub-publish 0.3.3: prefer password.incoming / --password-file / -p.

Co-authored-by: Cursor <cursoragent@cursor.com>
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