When a stable release is cut via workflow_dispatch with channel=latest,
@latest can leapfrog the current @next head. Without a corresponding
prerelease publish, the @next dist-tag is left pointing at an older
version, which turns `npx bmad-method@next install` into a downgrade.
This is the root cause of #2317: @latest=6.5.0 but @next=6.4.1-next.0,
so users running `npx bmad-method@next install` get the older code
written over the newer.
Add a final step in the latest-channel branch that derives the next
prerelease (max(@next-stripped, @latest) bumped to -next.0) and
publishes it with --tag next, reusing the proven `npm publish
--provenance` flow rather than mutating dist-tags directly. Runs after
the GitHub Release and Discord notify steps so they still see the
stable version in package.json.
Refs #2317
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* refactor(installer): restructure installer with clean separation of concerns
Move tools/cli/ to tools/installer/ with major structural cleanup:
- InstallPaths async factory for path resolution and directory creation
- Config value object (frozen) replaces mutable config bag
- ExistingInstall value object replaces stateful Detector class
- OfficialModules + CustomModules + ExternalModuleManager replace monolithic ModuleManager
- install() is prompt-free; all user interaction in ui.js
- Update state returned explicitly instead of mutating customConfig
- Delete dead code: dependency-resolver, _base-ide, IdeConfigManager,
platform-codes helpers, npx wrapper, xml-utils
- Flatten directory structure: custom/handler → custom-handler,
tools/cli/ → tools/installer/, lib/ directories removed
- Update all path references in package.json, tests, CI, and docs
* fix(installer): guard ExistingInstall.version and surface module.yaml errors
Guard ExistingInstall.version access with .installed check in
uninstall.js, ui.js, and installer.js to prevent throwing on
empty/partial _bmad dirs. Surface invalid module.yaml parse errors
as warnings instead of silently returning empty results.
* ci: add continuous delivery workflows for npm publishing
Add publish-next (auto-prerelease on push to main) and publish-latest
(manual stable release with Discord notification). Update CONTRIBUTING.md
to describe the trunk-based CD model.
* fix(ci): guard publish-latest against non-main dispatch
Reject workflow_dispatch runs from non-main refs to prevent
publishing unintended code or fast-forwarding main unexpectedly.
* chore: unify npm publish workflow