feat: validate the positional name argument against the project name rules - #276
Open
beeman wants to merge 1 commit into
Open
feat: validate the positional name argument against the project name rules#276beeman wants to merge 1 commit into
beeman wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 4c6f0a9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
Greptile SummaryThe PR validates positional project names before template retrieval while exempting informational list commands.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; the previously reported validation-order and informational-command issues are fixed, and the author reports that the head commit is signed and verified. Important Files Changed
Reviews (5): Last reviewed commit: "feat: validate the positional name argum..." | Re-trigger Greptile |
beeman
force-pushed
the
beeman/validate-positional-name
branch
from
August 6, 2026 00:10
7818d5c to
31a730c
Compare
Collaborator
Author
|
@greptileai review |
beeman
force-pushed
the
beeman/validate-positional-name
branch
from
August 6, 2026 00:18
31a730c to
77ebfd9
Compare
Collaborator
Author
|
@greptileai review |
…rules The positional CLI name argument flowed straight from input.args[0] into the generated package.json name and the init-script rename search key without ever passing through validateProjectName — only the interactive prompt path validated. Run the same validation on the positional argument in getArgs and throw with the validation message on failure, matching the other getArgs errors. Validation runs immediately after argument parsing, before fetching template data, so a network failure can't mask the name error, but is skipped for the informational --list-* commands, which only use the name to build a hint.
beeman
force-pushed
the
beeman/project-name-schema
branch
from
August 7, 2026 13:50
05a3e01 to
5d18ad4
Compare
beeman
force-pushed
the
beeman/validate-positional-name
branch
from
August 7, 2026 13:51
77ebfd9 to
4c6f0a9
Compare
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 positional CLI
nameargument flowed straight frominput.args[0]into the generatedpackage.jsonname and the init-script rename search key without ever passing throughvalidateProjectName— only the interactive prompt path validated. Sonpx create-solana-dapp My_Appbypassed validation entirely and produced an invalid npm package name and a degenerate rename search key.What
validateProjectNameon the positional argument ingetArgswhen it is provided (the same rule as the interactive prompt, including theDirectory already existscheck) and throw with the validation message on failure, matching the existinglog.error+throwpattern.fetchTemplateData, so a network failure can't mask the name-validation error. The informational--list-*commands skip it, since they only use the name to build a hint.minorchangeset.Notes
Stacked on #274 (targets
beeman/project-name-schema); retarget tomainor rebase once that merges.