Repository navigation
feat(cli): name the command ajs cloud in hints, help and docs - #7
Merged
Merged
Conversation
The command is run as `ajs cloud`: the `ajs` command of @antelopejs/core loads the `ajs-cloud` binary as a plugin. Every hint, help example and problem fix still told the user to run `ajs-cloud …`. The texts keep writing the binary's name and pass through `asInvoked`, which writes it the way the person runs the command: `ajs cloud`, or `npx @antelopejs/cloud` when npx runs it. A person who came through npx has neither `ajs` nor `ajs-cloud` on the PATH, and a bare name given to npx fetches whatever package holds that name on the registry, so those hints always name the scoped package. The binary keeps its name, `ajs-cloud`: it is what `ajs` looks for. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
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.
Why
The command is run as
ajs cloud: theajscommand of@antelopejs/corefinds theajs-cloudbinary in the nearestnode_modules/.bin, then on thePATH, and runs it as a plugin. Every hint, help example, usage line and problem fix still saidajs-cloud ….What changes
cli/src/invocation.ts:commandName()isajs cloud, ornpx @antelopejs/cloudwhen npx runs the package (npm_command=exec).asInvoked(text)writes the binary's name in a text that way.asInvokedwhere they leave: problem texts (error-messages.ts), messages (i18n.ts), help examples and the help footer (command.ts), next steps and prompts (deploy.ts,actions.ts), and the program name (bin.ts).ajs cloud, howajsloads the plugin, and that npx must be given the scoped name.ajs-cloud.Why the npx case
A person who started with
npx @antelopejs/cloud loginhas neitherajsnorajs-cloudon thePATH. A hint naming a bare command leads tonpx <that name>, which fetches whatever package holds the name on the registry. Hints printed under npx therefore always name the scoped package.Tests
cli/test/invocation.test.ts: both forms, and no bare name under npx.ajs cloud ….Follow-ups outside this repository
@antelopejs/corelistsdmsas its only official plugin. Listingcloud(@antelopejs/cloud,ajs-cloud) letsajs cloudinstall the package when it is missing and drops the "third-party plugin" line.ajsstarted it, so the hints sayajs cloudto someone who ranajs-clouddirectly as well.