feat: add @fresh/cli package for project management and code generation#3787
Draft
bartlomieju wants to merge 1 commit intomainfrom
Draft
feat: add @fresh/cli package for project management and code generation#3787bartlomieju wants to merge 1 commit intomainfrom
@fresh/cli package for project management and code generation#3787bartlomieju wants to merge 1 commit intomainfrom
Conversation
…tion Introduces a unified CLI tool (`fresh`) that handles: - `fresh init` — delegates to @fresh/init for project scaffolding - `fresh dev` / `fresh build` / `fresh start` — project lifecycle commands - `fresh generate` (aliases: gen, g) — code generation for routes, API routes, islands, middleware, layouts, and components - `fresh routes` — lists all routes with URL patterns and types The generate command auto-detects the Fresh project root, computes correct relative import paths for utils.ts, derives PascalCase component names, checks for route collisions, and supports --dry-run, --force, and --handler flags. 20 tests covering utils and all generator types.
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.
Summary
Introduces a new
@fresh/clipackage — a unified CLI tool installable globally asfresh:Commands
fresh init [dir]@fresh/init)fresh devfresh buildfresh startfresh generate <type> <name>gen,g)fresh routesGenerators
--handlerflag.ts, handler only)Features
deno.jsonwithfreshimport)utils.tsimport paths at any nesting depth[id])about.tsxvsabout/index.tsx)--dry-runto preview without writing--forceto overwrite existing filesdefine.page,define.handlers, etc.)Example usage
Test plan
dev,build,startcommands against a real Fresh projectdeno install -gAf