fix(cli): make project location + github repo optional, guard bad dirs#42
Merged
Merged
Conversation
Lower the barrier to trying the CLI and stop a raw mkdir crash. - Project location is now optional: an empty value falls back to the default ./<name>, and absolute paths are rejected up front with a clear message instead of "Project location is required." - GitHub repo (owner/repo) is now optional: leaving it blank scaffolds with a <owner>/<name> placeholder you can fill in later - Refuse to scaffold into a directory outside the current working directory (or into home/root), which previously surfaced as an unhandled "ENOENT: mkdir '/orc'" stack trace. Scaffolding into "." still works. - Add integration tests for the optional GitHub slug and the directory guard; document both as optional in the CLI docs
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
jal-co
added a commit
that referenced
this pull request
Jun 15, 2026
## What Release **v0.12.1** — a patch bump in `package.json` (and lockfile) to ship the merged CLI fixes to npm. ## Why [#42](#42) is on `main` but not yet published, so users still get the old behaviour (required prompts + the `mkdir '/orc'` crash). This bump lets a GitHub Release publish the fix. Since the package is in initial development (`0.y.z`) and #42 is a bug fix, this is a **PATCH** bump per [SemVer](https://semver.org/) — `0.12.0 → 0.12.1`. ### Included since v0.12.0 - `fix(cli): make project location + github repo optional, guard bad dirs` (#42) - Project location optional (falls back to `./<name>`) - GitHub `owner/repo` optional (`<owner>/<name>` placeholder) - Refuse out-of-tree scaffold dirs instead of crashing with `mkdir ENOENT` > Note: #41 (website light mode) is `www/`-only and ships via Vercel — not part of the npm package. ## How `npm version 0.12.1 --no-git-tag-version` (the `vX.Y.Z` tag is created by the GitHub Release, which triggers `publish.yml`). ## Type - [ ] `feat` — New feature - [ ] `fix` — Bug fix - [ ] `docs` — Documentation - [ ] `refactor` — Code restructuring - [ ] `perf` — Performance improvement - [ ] `style` — Formatting / code style - [x] `chore` — Maintenance / deps - [ ] `ci` — CI/CD changes - [ ] `test` — Tests ## Checklist - [x] Branch follows conventional naming (`release/`) - [x] Commits follow [Conventional Commits](https://www.conventionalcommits.org/) - [x] `npm run lint` passes - [x] `npm test` passes (103 tests) - [ ] Tests added or updated (n/a — version bump only) - [ ] Docs updated (n/a) ## Release steps (after merge) 1. Merge this PR (release branches use a **merge commit**). 2. Create a GitHub Release tagged `v0.12.1` targeting `main` → `publish.yml` lints, builds, tests, and runs `npm publish --provenance`.
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
Three fixes to the scaffold flow, all surfaced by user feedback:
./<name>. The prompt no longer errorsProject location is required.when left blank, and absolute paths are rejected up front with a clear message. Scaffolding into.still works.owner/repo) is optional. Leaving it blank scaffolds with a<owner>/<name>placeholder (already the convention in--yesmode) so people can try the project without creating a repo first, then fill in the real slug later.mkdircrash. An out-of-tree directory (e.g. an absolute/orc) previously crashed with a rawUnexpected error: ENOENT: no such file or directory, mkdir '/orc'stack trace. The CLI now refuses any target outside the current working directory (and home/root) with a friendly message and a non-zero exit.Why
From feedback while trying the CLI:
Required-by-default prompts and an unhandled crash are exactly the friction that makes people bail before their first successful scaffold.
How
validateProjectLocationaccepts empty (falls back to default) and rejects absolute paths.<owner>/<name>placeholder fallback handles the rest.scaffold()resolves and validates the target dir before anymkdir, usingpath.relativecontainment plus explicit home/root checks;"."(current directory) stays allowed.Type
feat— New featurefix— Bug fixdocs— Documentationrefactor— Code restructuringperf— Performance improvementstyle— Formatting / code stylechore— Maintenance / depsci— CI/CD changestest— TestsChecklist
fix/)npm run lintpassesnpm testpasses (103 tests, +2 new)cli/prompts.mdx,cli/options.mdxnote both as optional)Screenshots
Verified locally with the built CLI: