fix(init): revert init template to make init work again (#3530)

https://github.com/denoland/fresh/pull/3524 unfortunately introduced a
regression in the init script which breaks it. This was caused by two
independent problems:

1. Only files reachable in the module graph are published, meaning the
templates itself weren't published to JSR
2. When publishing to JSR all specifiers become `https://` internally
which breaks doing path operations like `path.resolve()`,
`path.relative()` and all others. This is something that cannot be
tested locally in advance

Addressing these is going to require a bit of work. The quickest way to
get init working again is to revert it.
This commit is contained in:
Marvin Hagemeister
2025-10-06 17:48:25 +02:00
committed by GitHub
parent b3c91bd008
commit 41fba500de
96 changed files with 1243 additions and 4053 deletions
+6 -58
View File
@@ -1,62 +1,10 @@
# @fresh/init
# Create a new Fresh project.
Template-based initialization system for Fresh projects.
This is a CLI tool to bootstrap a new Fresh project. To do so, run this command:
## Usage
### CLI
```bash
# Interactive mode
deno run -Ar jsr:@fresh/init my-project
# With options
deno run -Ar jsr:@fresh/init my-app --tailwind --vscode --docker
```sh
deno run -Ar jsr:@fresh/init
```
**Options:**
- `--force` - Overwrite existing files
- `--tailwind` - Include Tailwind CSS
- `--vscode` - Add VS Code configuration
- `--docker` - Add Docker support
- `--builder` - Use builder instead of Vite
- `--help` - Show help message
### Programmatic
```typescript
import { initProject, resolveVersions } from "jsr:@fresh/init/src/init";
const versions = await resolveVersions();
await initProject(Deno.cwd(), {
directory: "./my-fresh-app",
tailwind: true,
vscode: true,
docker: false,
builder: false,
force: false,
}, versions);
```
## Templates
**Build Systems:**
- **Vite** (default) - Modern build system with HMR
- **Builder** - Traditional Deno-based build system
**Styling:**
- **Plain CSS** (default)
- **Tailwind CSS** (`--tailwind`)
**Optional Features:**
- **VS Code** configuration (`--vscode`)
- **Docker** support (`--docker`)
## Maintainer Documentation
See [DESIGN.md](./DESIGN.md) for architecture, maintenance workflows, and
development setup.
Go to [https://fresh.deno.dev/](https://fresh.deno.dev/) for more information
about Fresh.