feat: initial release of @arkenv/cli#897
Conversation
🦋 Changeset detectedLatest commit: 237f706 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 |
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (45)
WalkthroughAdds a standalone Changes@arkenv/cli Implementation
React Playground
OpenSpec Documentation
Workspace, Bun docs & misc
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ction to respect package.json fields
…eference pnpm create arkenv@latest
arkenv
@arkenv/cli
@arkenv/bun-plugin
@arkenv/fumadocs-ui
@arkenv/vite-plugin
commit: |
📦 Bundle Size Report
✅ All size limits passed! |
…old progress message
…ion and remove intro banner
… text, and improve post-scaffold setup instructions.
arkenv init
…ation command to pnpm dlx arkenv@latest init
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 13
🧹 Nitpick comments (11)
apps/www/package.json (1)
64-81: ⚡ Quick winReconsider switching to caret ranges for build tooling.
Changing from exact versions to caret ranges for build-critical devDependencies (
@babel/core,@rolldown/plugin-babel,babel-plugin-react-compiler) reduces build reproducibility. Since this is an application package (not published), exact versions ensure consistent builds across environments and prevent unexpected breakage from patch/minor updates in Babel and compiler tooling.Unless there's a specific need for automatic updates, consider reverting to exact versions.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/www/package.json` around lines 64 - 81, The devDependencies `@babel/core`, `@rolldown/plugin-babel`, and babel-plugin-react-compiler were changed to caret ranges which harms build reproducibility; revert those three entries in package.json to exact pinned versions (remove the leading ^ and restore the previously used exact version strings) so the app uses the exact tool versions for consistent builds, and run a quick install to update lockfile accordingly.packages/arkenv-cli/src/templates/valibot.ts (1)
3-3: ⚡ Quick winDocument exported API with JSDoc
Add a JSDoc comment for
valibotTemplateso consumers can quickly understandframeworkNoteand the generated output contract.As per coding guidelines, "Use JSDoc comments for public APIs".
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/arkenv-cli/src/templates/valibot.ts` at line 3, Add a JSDoc comment above the exported function valibotTemplate that documents the frameworkNote parameter (what it is and how it affects the generated template) and describes the return value (the generated TypeScript template string containing the contract). Ensure the JSDoc follows standard tags: `@param` {string} frameworkNote and a brief `@returns` {string} summary so consumers can quickly understand the API and output.packages/arkenv-cli/src/templates/arktype.ts (1)
3-3: ⚡ Quick winAdd JSDoc for exported template helper
Please add a short JSDoc block for
arktypeTemplate(params and return shape) since it’s a public exported API.As per coding guidelines, "Use JSDoc comments for public APIs".
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/arkenv-cli/src/templates/arktype.ts` at line 3, Add a JSDoc block above the exported arktypeTemplate function describing the function, its parameter (frameworkNote: string) and its return type (string template), e.g., a short description, `@param` {string} frameworkNote and `@returns` {string>; ensure the comment sits immediately above the arktypeTemplate declaration so the exported helper has proper public API documentation.packages/arkenv-cli/src/templates/zod.ts (1)
3-3: ⚡ Quick winAdd JSDoc to
zodTemplatePlease document this exported helper with JSDoc (parameter intent + generated code purpose).
As per coding guidelines, "Use JSDoc comments for public APIs".
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/arkenv-cli/src/templates/zod.ts` at line 3, Add a JSDoc block immediately above the exported zodTemplate function that documents the function as a public API: describe that zodTemplate generates a TypeScript/Zod schema template string, explain the frameworkNote parameter (its intent to inject framework-specific notes or comments into the generated template), and mention the return type (a dedented TypeScript template string). Reference the exported symbol zodTemplate and ensure the JSDoc follows standard tags like `@param` and `@returns`.packages/arkenv-cli/src/index.ts (3)
103-106: ⚡ Quick winRemove redundant top-level error handler.
The
main()function already has comprehensive error handling at lines 96-100. The outer.catch()at line 103 would never execute because all errors are caught andprocess.exit(1)is called inside the try-catch block.Remove redundant handler
-main().catch((err) => { - log.error(String(err)); - process.exit(1); -}); +main();Alternatively, if you want to keep defense-in-depth for unexpected errors, add a comment explaining why:
main().catch((err) => { + // Defense-in-depth: catch any errors that escape the main error handler log.error(String(err)); process.exit(1); });🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/arkenv-cli/src/index.ts` around lines 103 - 106, The outer promise rejection handler attached to main() (the .catch that calls log.error and process.exit(1)) is redundant because main() already handles errors and exits within its try-catch; remove the final main().catch(...) block (the one calling log.error and process.exit) to avoid duplicate handling, or if you intentionally want defense-in-depth keep the block but add a clear comment above it explaining it's an extra safety net for unforeseen async rejections so future readers understand its purpose; target the main() invocation and the surrounding .catch(...) code for this change.
87-89: ⚡ Quick winSimplify path normalization logic.
The conditional check for
.startsWith("./")followed by a ternary is unnecessary—path.resolve()already normalizes paths correctly, and the relative path can be constructed directly.Cleaner approach
- const relPath = options.path.startsWith("./") - ? options.path - : `./${options.path}`; + const relPath = path.relative(process.cwd(), targetPath).startsWith("..") + ? options.path + : `./${path.relative(process.cwd(), targetPath)}`;Or even simpler, if
options.pathis already expected to be in the correct format from the wizard:- const relPath = options.path.startsWith("./") - ? options.path - : `./${options.path}`; + const relPath = options.path;🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/arkenv-cli/src/index.ts` around lines 87 - 89, The relPath ternary around options.path is unnecessary; replace the conditional logic that builds relPath (the code assigning relPath from options.path.startsWith("./") ? options.path : `./${options.path}`) with a direct normalized resolution using Node's path utilities (e.g., use path.resolve or simply use options.path as-is if the wizard guarantees format) so the path is normalized in one place; update any references that consume relPath accordingly (look for the relPath variable assignment in the module-level code in packages/arkenv-cli/src/index.ts).
19-26: ⚡ Quick winHandle
--helpand-hflags explicitly.The current logic only displays help when an unknown command is provided, but doesn't handle the common
--helpor-hflags when no command is given or when the command isinit.Suggested enhancement
async function main() { const args = process.argv.slice(2); const command = args[0]; - if (command && command !== "init") { + if (command === "--help" || command === "-h" || (command && command !== "init")) { console.log(pc.cyan("ArkEnv CLI")); console.log("\nUsage:"); console.log(" arkenv init Set up ArkEnv in your project"); console.log("\nOptions:"); console.log(" --help, -h Show this help message"); process.exit(0); }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/arkenv-cli/src/index.ts` around lines 19 - 26, The help text is only shown for unknown commands; update the condition around the existing command check (the `command` variable) to also trigger when the user passed `--help` or `-h` (either as the command itself or present in process.argv), and also when `init` is invoked with a `--help`/`-h` flag; change the `if (command && command !== "init")` branch to something like checking `command === "--help" || command === "-h" || process.argv.includes("--help") || process.argv.includes("-h") || (command && command !== "init")` so the existing help printing and `process.exit(0)` run for help flags as well. Ensure you reference and reuse the same help output block (the console.log lines) and keep `init` behavior unchanged except when help flags are present.packages/arkenv-cli/src/prompts.ts (1)
81-86: 💤 Low valueType assertion may be unnecessary.
The
as ProjectOptionsassertion at line 86 might not be needed if the object literal already matches the type. TypeScript should be able to infer this correctly.Verify if assertion can be removed
return { path: result.path || "./src/env.ts", validator: result.validator, framework: result.framework, language: "ts", - } as ProjectOptions; + };If TypeScript complains, the assertion is necessary; otherwise, removing it makes the code cleaner.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/arkenv-cli/src/prompts.ts` around lines 81 - 86, Remove the unnecessary type assertion "as ProjectOptions" from the returned object (the object using result.path/result.validator/result.framework and language: "ts"); ensure the function's declared return type (or inferred type) matches ProjectOptions and that the properties (path, validator, framework, language) satisfy ProjectOptions — if TypeScript then errors, restore the explicit return type on the function or adjust property names/types accordingly rather than re-adding the inline assertion.packages/arkenv-cli/src/scaffold.ts (3)
53-63: ⚖️ Poor tradeoffConsider using a more robust tsconfig discovery mechanism.
The current implementation only checks for
tsconfig.app.jsonandtsconfig.jsonin the current directory. Modern TypeScript projects may use different names (tsconfig.base.json,tsconfig.node.json) or have tsconfig in parent directories.Consider using TypeScript's own config resolution or checking for additional common patterns. However, since this is an initial implementation and the current approach covers the most common cases, this can be deferred to a future enhancement.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/arkenv-cli/src/scaffold.ts` around lines 53 - 63, The current findTsConfig function only checks tsconfig.app.json and tsconfig.json in the CWD; update it to be more robust by either (a) using TypeScript's API (ts.findConfigFile / ts.sys.fileExists) to resolve the nearest tsconfig (so it finds tsconfig.* and parent-directory configs) or (b) expand the filenames array (add tsconfig.base.json, tsconfig.node.json, etc.) and walk up parent directories until root; modify the files list and implement a parent-directory loop in findTsConfig to return the first found config path or null.
42-48: ⚡ Quick winImprove dependency installation error message.
The error message at line 47 only shows the failed command but doesn't include the underlying error details, making debugging harder for users.
Include underlying error details
try { await exec(installCmd); } catch (error) { - // If install fails, we don't want to crash the whole thing, but maybe log it? - // For now, we'll just let the user know they might need to run it manually. - throw new Error(`Failed to install dependencies: ${installCmd}`); + const message = error instanceof Error ? error.message : String(error); + throw new Error( + `Failed to install dependencies with command: ${installCmd}\n${message}\nYou may need to run this manually.` + ); }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/arkenv-cli/src/scaffold.ts` around lines 42 - 48, The catch block around exec(installCmd) currently throws a new Error that only includes the command; change it to include the underlying error details (message and/or stack) from the caught error so users can debug; update the throw in the catch to combine `installCmd` with `error.message` or `error.stack` (cast the caught value if needed) or log the full error before rethrowing, referencing the existing `exec` call and `installCmd` variable to locate the change.
60-60: ⚡ Quick winAdd comments to empty catch blocks for clarity.
Multiple empty catch blocks appear throughout the file (lines 60, 141, 147, 151, 175). While these may be intentional (to silently ignore file-not-found errors), adding brief comments improves code maintainability.
Document silent error handling
try { await fs.access(fullPath); return fullPath; - } catch {} + } catch { + // File doesn't exist, try next candidate + }Apply similar comments to the other empty catch blocks to clarify intent.
Also applies to: 141-141, 147-147, 151-151, 175-175
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/arkenv-cli/src/scaffold.ts` at line 60, There are multiple empty catch blocks written as "catch {}" in scaffold.ts; replace each empty block with a brief explanatory comment (e.g., "// intentionally ignore missing file" or "// noop: expected when X may not exist") so reviewers understand the silent error handling intent—update every occurrence of the bare catch {} (the ones noted in the diff) with such concise comments adjacent to the catch to clarify why exceptions are being ignored.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/playgrounds/arkenv-cli/.gitignore`:
- Around line 10-14: The .gitignore is missing rules to ignore environment files
which can leak secrets; update the .gitignore by adding patterns such as .env,
.env.local, .env.* and .env.*.local (or a single broad pattern like .env*) so
all local env files are ignored; edit the existing .gitignore (the shown
node_modules/dist entries) and append these .env ignore patterns to prevent
accidental commits of secrets.
In `@apps/playgrounds/arkenv-cli/eslint.config.js`:
- Around line 8-22: The flat ESLint config uses an invalid "extends" key; update
the array passed to defineConfig to spread the config arrays instead of nesting
them under "extends" — i.e., keep globalIgnores(["dist"]) and the file matcher
object (files: ["**/*.{ts,tsx}"], languageOptions: { globals: globals.browser })
but remove the extends property and instead include ...js.configs.recommended,
...tseslint.configs.recommended, ...reactHooks.configs.flat.recommended, and
...reactRefresh.configs.vite at the top level of the defineConfig array so those
configs are applied correctly.
In `@apps/playgrounds/arkenv-cli/package.json`:
- Around line 13-14: The package.json currently pins external semver ranges for
the internal packages "@arkenv/vite-plugin" and "arkenv"; update their
dependency entries to use the workspace protocol by replacing the version
strings with "workspace:*" for both "@arkenv/vite-plugin" and "arkenv" so the
playground uses the local workspace packages during monorepo development.
In `@apps/playgrounds/arkenv-cli/README.md`:
- Line 14: Update the README line that currently reads "Note: This will impact
Vite dev & build performances." to use singular wording: change "performances"
to "performance" so the sentence becomes "Note: This will impact Vite dev &
build performance." Locate and edit the sentence in the README.md
(apps/playgrounds/arkenv-cli/README.md) where that exact phrase appears.
In `@apps/playgrounds/arkenv-cli/src/index.css`:
- Around line 13-15: The CSS custom properties (--sans, --heading, --mono and
the other occurrence on line 23) contain capitalized font keywords that trigger
Stylelint's value-keyword-case rule; update the values so all keywords are
lowercased (e.g., change "Segoe UI", "Roboto", "Consolas" to lowercase
equivalents and ensure generic family names remain lowercase) by editing the
declarations for --sans, --heading, --mono and the other occurrence to use
lowercase tokens throughout.
In `@apps/playgrounds/arkenv-cli/vite.config.ts`:
- Line 7: The plugins array currently calls react() before babel(), but
`@vitejs/plugin-react` v6+ requires the `@rollup/plugin-babel` (babel(...)) to run
first so the React Compiler preset (reactCompilerPreset()) is applied by Babel;
update the plugins array to call babel({ presets: [reactCompilerPreset()] })
before react() (i.e., swap the order so babel(...) is the first entry).
In `@openspec/changes/arkenv-init/design.md`:
- Around line 26-35: The fenced code block that starts with ``` and contains
"User runs: pnpm dlx `@arkenv/cli`@latest init" is missing a language identifier
and triggers markdownlint MD040; update that opening fence to include a language
(e.g., use ```text or ```console) so the block becomes ```text (or ```console)
followed by the existing diagram and the closing ``` to satisfy the linter.
In `@packages/arkenv-cli/package.json`:
- Around line 9-12: The package.json currently exposes "main" and "files" but
lacks an explicit exports map; add an "exports" field that explicitly maps the
package entry points to the built files (e.g., map "." to the CommonJS and ESM
builds and to the type definitions and map "./*" to "./dist/*") so
Node/import-resolvers have an unambiguous public boundary; update package.json
to include this exports map alongside the existing "main" and "files" and ensure
the type entry (types or typesVersions) points to the built d.ts in dist.
In `@packages/arkenv-cli/src/prompts.ts`:
- Around line 72-75: Make cancellation behavior consistent by removing the hard
process exit in the onCancel handler so the caller can handle cancellations: in
the prompt's onCancel callback, replace the call to process.exit(0) with a
return of null (or simply let it invoke cancel("Operation cancelled.") and
return null), and keep the subsequent isCancel check that handles cancellation
at the call site; update any comments around onCancel/cancel/isCancel to reflect
that cancellation is propagated rather than terminating the process.
In `@packages/arkenv-cli/src/scaffold.ts`:
- Around line 107-124: The current regex-based edits to tsconfig.json (in the
block that reads content, tsConfigPath and fileName) are fragile; replace the
regex logic in the function that updates tsconfig (the code that tests
/"compilerOptions"\s*:\s*\{/ and /\{/) with a safe JSONC approach: read content,
parse it with jsonc-parser (parse), check parsed?.compilerOptions?.strict, and
if missing use modify to set ["compilerOptions","strict"] to true then
applyEdits and write the updated content to tsConfigPath; this preserves
comments/formatting and avoids touching nested/braced content or comments.
- Line 78: Replace the catch clauses typed as "e: any" with "e: unknown" and
narrow the error before using it: change both "catch (e: any)" occurrences to
"catch (e: unknown)" and where the code reads from e (logging or accessing
message/stack), use a type guard like "if (e instanceof Error) { /* use
e.message or e.stack */ } else { /* fallback: String(e) */ }" so you preserve
type safety without losing error details; update the two catch sites that
currently use "catch (e: any)" accordingly.
- Line 154: The check uses a type assertion to any on process.versions; replace
it with a type-safe property check on process.versions (e.g., use the 'in'
operator or Object.prototype.hasOwnProperty.call(process.versions, "bun") or
cast to Record<string, string | undefined> instead of any) so the runtime
detection for bun stays type-safe; update the line that references
process.versions to use one of these safe checks and return "bun" when the
property is present.
- Around line 19-21: The scaffold currently calls fs.writeFile(targetPath,
content, "utf-8") which can silently overwrite an existing env.ts; before
writing, check for file existence using fs.existsSync or fs.stat (referencing
targetPath) and if the file exists prompt the user (or surface a prompt in the
existing wizard flow) to confirm overwrite, then only call fs.writeFile from the
branch that confirms overwrite or from the branch where the file does not exist;
update the logic around getEnvTemplate and the write step to honor the user's
choice and abort or skip writing when the user declines.
---
Nitpick comments:
In `@apps/www/package.json`:
- Around line 64-81: The devDependencies `@babel/core`, `@rolldown/plugin-babel`,
and babel-plugin-react-compiler were changed to caret ranges which harms build
reproducibility; revert those three entries in package.json to exact pinned
versions (remove the leading ^ and restore the previously used exact version
strings) so the app uses the exact tool versions for consistent builds, and run
a quick install to update lockfile accordingly.
In `@packages/arkenv-cli/src/index.ts`:
- Around line 103-106: The outer promise rejection handler attached to main()
(the .catch that calls log.error and process.exit(1)) is redundant because
main() already handles errors and exits within its try-catch; remove the final
main().catch(...) block (the one calling log.error and process.exit) to avoid
duplicate handling, or if you intentionally want defense-in-depth keep the block
but add a clear comment above it explaining it's an extra safety net for
unforeseen async rejections so future readers understand its purpose; target the
main() invocation and the surrounding .catch(...) code for this change.
- Around line 87-89: The relPath ternary around options.path is unnecessary;
replace the conditional logic that builds relPath (the code assigning relPath
from options.path.startsWith("./") ? options.path : `./${options.path}`) with a
direct normalized resolution using Node's path utilities (e.g., use path.resolve
or simply use options.path as-is if the wizard guarantees format) so the path is
normalized in one place; update any references that consume relPath accordingly
(look for the relPath variable assignment in the module-level code in
packages/arkenv-cli/src/index.ts).
- Around line 19-26: The help text is only shown for unknown commands; update
the condition around the existing command check (the `command` variable) to also
trigger when the user passed `--help` or `-h` (either as the command itself or
present in process.argv), and also when `init` is invoked with a `--help`/`-h`
flag; change the `if (command && command !== "init")` branch to something like
checking `command === "--help" || command === "-h" ||
process.argv.includes("--help") || process.argv.includes("-h") || (command &&
command !== "init")` so the existing help printing and `process.exit(0)` run for
help flags as well. Ensure you reference and reuse the same help output block
(the console.log lines) and keep `init` behavior unchanged except when help
flags are present.
In `@packages/arkenv-cli/src/prompts.ts`:
- Around line 81-86: Remove the unnecessary type assertion "as ProjectOptions"
from the returned object (the object using
result.path/result.validator/result.framework and language: "ts"); ensure the
function's declared return type (or inferred type) matches ProjectOptions and
that the properties (path, validator, framework, language) satisfy
ProjectOptions — if TypeScript then errors, restore the explicit return type on
the function or adjust property names/types accordingly rather than re-adding
the inline assertion.
In `@packages/arkenv-cli/src/scaffold.ts`:
- Around line 53-63: The current findTsConfig function only checks
tsconfig.app.json and tsconfig.json in the CWD; update it to be more robust by
either (a) using TypeScript's API (ts.findConfigFile / ts.sys.fileExists) to
resolve the nearest tsconfig (so it finds tsconfig.* and parent-directory
configs) or (b) expand the filenames array (add tsconfig.base.json,
tsconfig.node.json, etc.) and walk up parent directories until root; modify the
files list and implement a parent-directory loop in findTsConfig to return the
first found config path or null.
- Around line 42-48: The catch block around exec(installCmd) currently throws a
new Error that only includes the command; change it to include the underlying
error details (message and/or stack) from the caught error so users can debug;
update the throw in the catch to combine `installCmd` with `error.message` or
`error.stack` (cast the caught value if needed) or log the full error before
rethrowing, referencing the existing `exec` call and `installCmd` variable to
locate the change.
- Line 60: There are multiple empty catch blocks written as "catch {}" in
scaffold.ts; replace each empty block with a brief explanatory comment (e.g.,
"// intentionally ignore missing file" or "// noop: expected when X may not
exist") so reviewers understand the silent error handling intent—update every
occurrence of the bare catch {} (the ones noted in the diff) with such concise
comments adjacent to the catch to clarify why exceptions are being ignored.
In `@packages/arkenv-cli/src/templates/arktype.ts`:
- Line 3: Add a JSDoc block above the exported arktypeTemplate function
describing the function, its parameter (frameworkNote: string) and its return
type (string template), e.g., a short description, `@param` {string} frameworkNote
and `@returns` {string>; ensure the comment sits immediately above the
arktypeTemplate declaration so the exported helper has proper public API
documentation.
In `@packages/arkenv-cli/src/templates/valibot.ts`:
- Line 3: Add a JSDoc comment above the exported function valibotTemplate that
documents the frameworkNote parameter (what it is and how it affects the
generated template) and describes the return value (the generated TypeScript
template string containing the contract). Ensure the JSDoc follows standard
tags: `@param` {string} frameworkNote and a brief `@returns` {string} summary so
consumers can quickly understand the API and output.
In `@packages/arkenv-cli/src/templates/zod.ts`:
- Line 3: Add a JSDoc block immediately above the exported zodTemplate function
that documents the function as a public API: describe that zodTemplate generates
a TypeScript/Zod schema template string, explain the frameworkNote parameter
(its intent to inject framework-specific notes or comments into the generated
template), and mention the return type (a dedented TypeScript template string).
Reference the exported symbol zodTemplate and ensure the JSDoc follows standard
tags like `@param` and `@returns`.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e1bfe3af-8ef6-4ca8-af92-84f20c66f21c
⛔ Files ignored due to path filters (6)
apps/playgrounds/arkenv-cli/public/favicon.svgis excluded by!**/*.svgapps/playgrounds/arkenv-cli/public/icons.svgis excluded by!**/*.svgapps/playgrounds/arkenv-cli/src/assets/hero.pngis excluded by!**/*.pngapps/playgrounds/arkenv-cli/src/assets/react.svgis excluded by!**/*.svgapps/playgrounds/arkenv-cli/src/assets/vite.svgis excluded by!**/*.svgpnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (38)
.changeset/arkenv-init.mdapps/playgrounds/arkenv-cli/.gitignoreapps/playgrounds/arkenv-cli/README.mdapps/playgrounds/arkenv-cli/eslint.config.jsapps/playgrounds/arkenv-cli/index.htmlapps/playgrounds/arkenv-cli/package.jsonapps/playgrounds/arkenv-cli/src/app.cssapps/playgrounds/arkenv-cli/src/app.tsxapps/playgrounds/arkenv-cli/src/env.tsapps/playgrounds/arkenv-cli/src/index.cssapps/playgrounds/arkenv-cli/src/main.tsxapps/playgrounds/arkenv-cli/tsconfig.app.jsonapps/playgrounds/arkenv-cli/tsconfig.jsonapps/playgrounds/arkenv-cli/tsconfig.node.jsonapps/playgrounds/arkenv-cli/vite.config.tsapps/playgrounds/vite-legacy/package.jsonapps/www/package.jsonarkenv.code-workspaceopenspec/changes/archive/2025-11-28-add-bun-plugin/proposal.mdopenspec/changes/archive/2025-11-28-add-bun-plugin/specs/bun-plugin/spec.mdopenspec/changes/arkenv-init/.openspec.yamlopenspec/changes/arkenv-init/design.mdopenspec/changes/arkenv-init/proposal.mdopenspec/changes/arkenv-init/specs/scaffolding-cli/spec.mdopenspec/changes/arkenv-init/tasks.mdopenspec/specs/bun-plugin/spec.mdpackages/arkenv-cli/.vscode/extensions.jsonpackages/arkenv-cli/package.jsonpackages/arkenv-cli/src/env-template.tspackages/arkenv-cli/src/index.tspackages/arkenv-cli/src/prompts.tspackages/arkenv-cli/src/scaffold.tspackages/arkenv-cli/src/templates/arktype.tspackages/arkenv-cli/src/templates/index.tspackages/arkenv-cli/src/templates/valibot.tspackages/arkenv-cli/src/templates/zod.tspackages/arkenv-cli/tsdown.config.tspackages/bun-plugin/CHANGELOG.md
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…, and playground configuration
…dling in scaffold.ts
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 6
♻️ Duplicate comments (1)
apps/playgrounds/arkenv-cli/src/index.css (1)
23-23:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winFix remaining Stylelint
value-keyword-caseviolation.The CSS keyword
optimizeLegibilityshould be lowercase to satisfy the Stylelint rule. This was flagged in a previous review but remains unfixed.🎨 Proposed fix
- text-rendering: optimizeLegibility; + text-rendering: optimizelegibility;🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/playgrounds/arkenv-cli/src/index.css` at line 23, Replace the CamelCase CSS keyword in the text-rendering declaration with its lowercase form to satisfy Stylelint's value-keyword-case rule; specifically update the text-rendering property value (currently "optimizeLegibility") to the lowercase "optimizelegibility" in apps/playgrounds/arkenv-cli/src/index.css so the linter no longer flags the violation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.idea/vcs.xml:
- Around line 18-41: The IssueNavigationLink entries contain duplicate
issueRegexp patterns (\(#(\d+)\), #(\d+), GH-(\d+)) mapped to different
linkRegexp hosts (aruaycodes, yamcodes, danciudev) so IntelliJ will always match
the first entry and never reach later ones; fix by either removing the old
aruhaycodes entries (delete the IssueNavigationLink blocks that reference
aruhaycodes) or make patterns repository-specific (change the issueRegexp values
to unique prefixes per fork, e.g., YAM-(\d+) or DAN-(\d+), and update the
corresponding linkRegexp entries) so each IssueNavigationLink block uniquely
identifies which repo it links to.
In `@packages/arkenv-cli/src/index.ts`:
- Around line 94-95: The code uses path.relative and path.resolve when computing
relPath and displayPath but never imports the path module; add an import for the
Node path API (e.g., import path from "node:path" or const path =
require("path") depending on project module style) at the top of the file so
relPath, displayPath and the calls path.relative(path.resolve(...)) referencing
options.path work without a ReferenceError.
In `@packages/arkenv-cli/src/prompts.ts`:
- Around line 3-8: The ProjectOptions type and related prompt logic currently
hardcode language "ts" and limit validator/framework choices, preventing
supported scaffolds; update the ProjectOptions type to allow language: "ts" |
"js", validator: "arktype" | "zod" | "valibot" | "plain", and framework: "vite"
| "bun" | "node" | "next.js" | "none", then propagate these expanded unions into
every prompt/validation branch that references ProjectOptions (e.g., any
functions or constants handling validator, framework, or language at the earlier
referenced blocks), ensuring prompt choices, default values, and downstream
scaffolding logic accept "plain", "next.js", "none", and "js" paths so the
wizard can scaffold all documented entry points.
In `@packages/arkenv-cli/src/scaffold.ts`:
- Around line 24-35: If the user declines overwriting the existing file (check
the confirmOverwrite result after prompting for targetPath), abort the scaffold
early instead of proceeding to later side effects: when confirmOverwrite is
false, return from the scaffold function (or prompt explicitly to continue
without writing) so you do not call fsp.writeFile, do not mutate tsconfig, and
do not invoke the package installation steps; update the control flow around the
confirm/existsSync block to exit early on a declined overwrite to prevent
partial setup.
- Around line 173-202: The detectPackageManager function currently only inspects
package.json and lockfiles and thus can mis-detect the invoking tool; update
detectPackageManager to first check process.env.npm_config_user_agent (and
optionally process.env.npm_config_user_agent?.toString()) and parse it for
"pnpm", "yarn", "bun", or "npm" returning the matched manager immediately; only
if the user agent is missing or unrecognized fall back to the existing
filesystem walk and package.json/packageManager checks already in
detectPackageManager.
- Around line 54-63: The install step currently uses exec(installCmd) which
buffers output and can hit maxBuffer; replace this with a child_process.spawn
invocation that runs the same command returned by
getInstallCommand(packageManager, deps) and streams output by setting stdio:
'inherit' (and properly wiring the shell option if using a single string
command); ensure you await the spawned process by listening for the
'close'/'exit' event and throw an Error on non-zero exit code (preserve the
existing error message format referencing installCmd), and remove the exec
import/usages accordingly.
---
Duplicate comments:
In `@apps/playgrounds/arkenv-cli/src/index.css`:
- Line 23: Replace the CamelCase CSS keyword in the text-rendering declaration
with its lowercase form to satisfy Stylelint's value-keyword-case rule;
specifically update the text-rendering property value (currently
"optimizeLegibility") to the lowercase "optimizelegibility" in
apps/playgrounds/arkenv-cli/src/index.css so the linter no longer flags the
violation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 86aee0ae-ce45-429f-af9b-d1ceb5a2b76e
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (16)
.idea/vcs.xmlapps/playgrounds/arkenv-cli/.gitignoreapps/playgrounds/arkenv-cli/README.mdapps/playgrounds/arkenv-cli/eslint.config.jsapps/playgrounds/arkenv-cli/package.jsonapps/playgrounds/arkenv-cli/src/index.cssapps/playgrounds/arkenv-cli/vite.config.tsopenspec/changes/arkenv-init/design.mdpackages/arkenv-cli/package.jsonpackages/arkenv-cli/src/index.tspackages/arkenv-cli/src/prompts.tspackages/arkenv-cli/src/scaffold.tspackages/arkenv-cli/src/templates/arktype.tspackages/arkenv-cli/src/templates/valibot.tspackages/arkenv-cli/src/templates/zod.tspackages/arkenv-cli/src/visuals.ts
✅ Files skipped from review due to trivial changes (5)
- apps/playgrounds/arkenv-cli/.gitignore
- packages/arkenv-cli/src/visuals.ts
- apps/playgrounds/arkenv-cli/README.md
- apps/playgrounds/arkenv-cli/package.json
- packages/arkenv-cli/package.json
🚧 Files skipped from review as they are similar to previous changes (5)
- apps/playgrounds/arkenv-cli/vite.config.ts
- packages/arkenv-cli/src/templates/valibot.ts
- packages/arkenv-cli/src/templates/arktype.ts
- packages/arkenv-cli/src/templates/zod.ts
- apps/playgrounds/arkenv-cli/eslint.config.js
| export type ProjectOptions = { | ||
| path: string; | ||
| validator: "arktype" | "zod" | "valibot"; | ||
| framework: "vite" | "bun" | "node"; | ||
| language: "ts"; // TODO: Support JS | ||
| }; |
There was a problem hiding this comment.
Don't ship a narrower prompt matrix than issue #896 requires.
This wizard currently hardcodes TypeScript and only offers arktype/zod/valibot plus vite/bun/node. That leaves out the required plain, next.js, none, and JS paths, so the initial release cannot scaffold several documented entry points from the PR objective.
Also applies to: 15-18, 37-52, 81-85
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/arkenv-cli/src/prompts.ts` around lines 3 - 8, The ProjectOptions
type and related prompt logic currently hardcode language "ts" and limit
validator/framework choices, preventing supported scaffolds; update the
ProjectOptions type to allow language: "ts" | "js", validator: "arktype" | "zod"
| "valibot" | "plain", and framework: "vite" | "bun" | "node" | "next.js" |
"none", then propagate these expanded unions into every prompt/validation branch
that references ProjectOptions (e.g., any functions or constants handling
validator, framework, or language at the earlier referenced blocks), ensuring
prompt choices, default values, and downstream scaffolding logic accept "plain",
"next.js", "none", and "js" paths so the wizard can scaffold all documented
entry points.
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
…nager detection, and clean up UI components and project configs
…atus 1 on invalid usage
…rity and accuracy
Closes #896
TODO:
Summary by CodeRabbit
New Features
Documentation
Chores