Skip to content

feat(create-astro-fleet): ready CLI for npm publish - #10

Merged
vairi merged 1 commit into
mainfrom
feat/create-astro-fleet-publish-prep
Apr 18, 2026
Merged

feat(create-astro-fleet): ready CLI for npm publish#10
vairi merged 1 commit into
mainfrom
feat/create-astro-fleet-publish-prep

Conversation

@vairi

@vairi vairi commented Apr 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Readies create-astro-fleet for its first publish to npm. Ships what the CLI has been promising, removes a latent flag-parsing bug, and pins the template download to the current fleet release so users get a deterministic scaffold.

  • Real install flow. Auto-detects the invoking package manager from npm_config_user_agent (bun/pnpm/yarn/npm), prompts interactively after scaffold, and honors --install / --no-install to skip the prompt. Previously --no-install was documented but unimplemented.
  • Pinned template. Default is now github:indivar/astro-fleet#v2.2.0 via a TEMPLATE_VERSION constant in src/init.mjs. Bumped by maintainers when cutting a new template release; decouples CLI semver from template semver.
  • Flag parser fix. --no-* prefix and a known-boolean set (--install, --no-install, --keep-demos) no longer consume the next positional arg.
  • npm-page metadata. Added author, bugs, homepage to package.json.
  • Docs. src/help.mjs + README.md updated to match the actual flag surface.

Test plan

  • node bin/create-astro-fleet.mjs --help shows new --install / corrected --no-install + default template #v2.2.0
  • parseArgs(['--no-install', './my-fleet']){positional: ['./my-fleet'], flags: {'no-install': true}} (no longer swallows positional)
  • parseArgs(['--install', '--preset', 'saas']) → install is boolean, preset consumes next
  • npm pack --dry-run → 9 files, 6.8 kB (README, bin, src/*, package.json)
  • node --check clean on all modified files
  • After merge: npm publish --access public from packages/create-astro-fleet/
  • Post-publish: npx create-astro-fleet@latest --help works from any directory

Release notes for future reference

When shipping a new template release:

  1. Tag repo vX.Y.Z
  2. Update TEMPLATE_VERSION in packages/create-astro-fleet/src/init.mjs
  3. Bump packages/create-astro-fleet/package.json version
  4. Merge, then npm publish --access public

CLI-only fixes just need a CLI version bump + publish; no git tag required.

… metadata

Implements what the CLI has been promising and readies it for npm publish:

- Auto-detect package manager from npm_config_user_agent (bun/pnpm/yarn/npm)
- Interactive install prompt after scaffold; --install / --no-install skip it
- Pin default template to github:indivar/astro-fleet#v2.2.0 via a
  TEMPLATE_VERSION constant; bump when shipping a new template release
- Fix flag parser to treat --no-* and known boolean flags as pure booleans
  (previously --no-install would consume the next positional)
- Add author, bugs, homepage to package.json for a cleaner npm page
- Update help and README to match the actual flag surface
@vairi
vairi merged commit 51cfbe7 into main Apr 18, 2026
1 check passed
@vairi
vairi deleted the feat/create-astro-fleet-publish-prep branch April 18, 2026 07:18
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.

2 participants