feat(create-astro-fleet): ready CLI for npm publish - #10
Merged
Conversation
… 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
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.
Summary
Readies
create-astro-fleetfor 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.npm_config_user_agent(bun/pnpm/yarn/npm), prompts interactively after scaffold, and honors--install/--no-installto skip the prompt. Previously--no-installwas documented but unimplemented.github:indivar/astro-fleet#v2.2.0via aTEMPLATE_VERSIONconstant insrc/init.mjs. Bumped by maintainers when cutting a new template release; decouples CLI semver from template semver.--no-*prefix and a known-boolean set (--install,--no-install,--keep-demos) no longer consume the next positional arg.author,bugs,homepagetopackage.json.src/help.mjs+README.mdupdated to match the actual flag surface.Test plan
node bin/create-astro-fleet.mjs --helpshows new--install/ corrected--no-install+ default template#v2.2.0parseArgs(['--no-install', './my-fleet'])→{positional: ['./my-fleet'], flags: {'no-install': true}}(no longer swallows positional)parseArgs(['--install', '--preset', 'saas'])→ install is boolean, preset consumes nextnpm pack --dry-run→ 9 files, 6.8 kB (README, bin, src/*, package.json)node --checkclean on all modified filesnpm publish --access publicfrompackages/create-astro-fleet/npx create-astro-fleet@latest --helpworks from any directoryRelease notes for future reference
When shipping a new template release:
vX.Y.ZTEMPLATE_VERSIONinpackages/create-astro-fleet/src/init.mjspackages/create-astro-fleet/package.jsonversionnpm publish --access publicCLI-only fixes just need a CLI version bump + publish; no git tag required.