Skip to content

fix(create-void): let Enter accept the default project name - #232

Merged
Brooooooklyn merged 1 commit into
mainfrom
06-25-fix_create-void_let_enter_accept_the_default_project_name
Jun 29, 2026
Merged

Brooooooklyn merged 1 commit into
mainfrom
06-25-fix_create-void_let_enter_accept_the_default_project_name

Conversation

@shulaoda

Copy link
Copy Markdown
Member

Summary

In create-void, the interactive Project name: prompt could not be confirmed by pressing Enter — you were forced to type a name. With nothing typed, submitting failed with Project name is required.

Two things combined to cause this in packages/create-void/src/index.ts. The prompt set placeholder: 'my-app', but in @clack/prompts a placeholder is only a greyed-out hint and is never returned as the value, so an empty Enter submits an empty string rather than my-app. The validate callback then rejected empty input, and in @clack/core validate(value) runs on the raw typed value before any default would be applied, so the empty submission was blocked outright.

Fix

Add defaultValue: 'my-app' so an empty submission resolves to the default, and relax validate so it no longer rejects empty input:

const name = await p.text({
  message: 'Project name:',
  defaultValue: 'my-app',
  placeholder: 'my-app',
  validate(value) {
    if (value && !value.trim()) {
      return 'Project name cannot be blank';
    }
  },
});

Behavior after

Pressing Enter accepts my-app; typing a name uses that name; entering only whitespace is still rejected with Project name cannot be blank.

@Brooooooklyn
Brooooooklyn merged commit 40d9c35 into main Jun 29, 2026
6 checks passed
@Brooooooklyn
Brooooooklyn deleted the 06-25-fix_create-void_let_enter_accept_the_default_project_name branch June 29, 2026 09:48
cpojer pushed a commit that referenced this pull request Sep 11, 2026
…ry params (#232)

* fix(dispatch): key the static-candidate edge cache on allowlisted query params

The static-candidate edge cache (extensioned GETs) hardcoded its key to
`<path>?_v=<version>`, discarding the request query. For a true static
asset that is correct, but a dynamic extensioned route whose body depends
on the query — e.g. a worker-rendered image/badge endpoint — then serves
its first rendered variant for every distinct query, name, theme, etc.,
even when the route declares `revalidateQueryAllowlist` (which was only
consulted on rewrite/fallback variants, never on a direct route).

Project the route's `queryAllowlist` into the static-candidate key via
`buildVariantOriginalUrl` (the same sorted/deterministic helper the ISR
rewrite-variant path uses), matched against the original (pre-rewrite)
request path. A route with no allowlist match still drops the query, so
real static assets keep their pathname-only key — no behavior change.
Read and write share one `staticCacheKey`, so both stay consistent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(dispatch): gate static-candidate query projection to exact paths

Reviewer #232: the static-candidate edge cache has no per-path variant
cap (unlike ISR), so projecting a broad `*` / prefix-wildcard
`queryAllowlist` entry into its key would let a cache-buster query
(`?cb=1`, `?cb=2`, …) fan out unbounded cache slots for true static
assets.

Add `exactQueryAllowlist`, which keeps only wildcard-free patterns, and
feed the static-candidate key through it. Wildcard entries stay valid on
the capped ISR variant path; here a route with no exact match keeps its
pathname-only key — unchanged behavior for real static assets.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* style(dispatch): wrap variant-key import to satisfy fmt --check

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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