fix(create-emdash): accept "." in the Project name? prompt#900
Merged
ascorbic merged 1 commit intoemdash-cms:mainfrom May 5, 2026
Merged
fix(create-emdash): accept "." in the Project name? prompt#900ascorbic merged 1 commit intoemdash-cms:mainfrom
ascorbic merged 1 commit intoemdash-cms:mainfrom
Conversation
…s#894) The flag-positional path already accepted "." via validateProjectName, but the prompt's inline regex check rejected it. Users running `npm create emdash@latest` with no arguments could only install into a new subdirectory. Use validateProjectName from the prompt validator so both code paths share the same rule, and surface the "." option in the prompt message. The flag path's behavior is unchanged. Closes emdash-cms#894
🦋 Changeset detectedLatest commit: 06bbb5f The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
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 |
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/blocks
@emdash-cms/cloudflare
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
Collaborator
|
/review kimi |
Collaborator
|
This does highlight how confusing it is that it conflates project name with output directory |
Contributor
|
LGTM! |
Merged
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.
What does this PR do?
Closes #894
The interactive
Project name?prompt increate-emdashrejected.as a project name, even though the flag-positional path (e.g.npm create emdash@latest .) already accepted it viavalidateProjectName. Users who rannpm create emdash@latestwithout arguments had no way to scaffold into the current directory from the prompt.The prompt validator now delegates to the same
validateProjectNamehelper the flag path uses, and the prompt message gains a hint about.. Behavior on every other path (flag positional,--yes,--yes --force, non-empty cwd confirm) is unchanged -- thetarget === "."branch inresolveProjectLocationalready handles current-directory scaffolding.Type of change
Checklist
pnpm typecheckpasses (packages/create-emdash)pnpm lintpasses -- diagnostic count unchanged (45 onmain, 45 on this branch; all pre-existing)pnpm testpasses (103 passedincreate-emdash)pnpm formathas been run.changeset/olive-loops-change.md,create-emdash: patchTests
packages/create-emdash/tests/flags.test.tsalready exercisesvalidateProjectName(".")returningundefined("returns undefined for.(current-dir sentinel)"). The fix is precisely "make the prompt validator call this same helper", so the existing test now also covers the prompt path's accept-of-.behavior. No new test was added because the validator is the unit under test and was already covered.If reviewers prefer an explicit prompt-path test, happy to add one -- it would mock
@clack/prompts.textand assert thatvalidateProjectNameis the validate fn.AI-generated code disclosure
Screenshots / test output