feat: remove fresh cli, do manifest generation in process (#223)

This commit removes the `fresh` cli, replacing it with a small bootstrap script,
and JIT generation of the manifest that happens in process during development.
This commit is contained in:
Luca Casonato
2022-06-14 09:39:38 +02:00
committed by GitHub
parent 844ded8cfd
commit 836cc24bdd
40 changed files with 362 additions and 730 deletions
+18 -14
View File
@@ -1,30 +1,34 @@
---
description: |
Create a new fresh project by running `fresh init`. This scaffolds out the
various files and folders a fresh project needs.
Create a new fresh project by running the fresh project creation tool. This
scaffolds out the various files and folders a fresh project needs.
---
New `fresh` projects can be created with the `fresh` CLI tool. It will scaffold
out a new project with some example files to get you started.
New Fresh projects can be created with using the fresh project creation tool. It
will scaffold out a new project with some example files to get you started.
To create a new project in the directory `"my-project"`, run:
```
$ fresh init my-project
Manifest generated and written to ./my-project/fresh.gen.ts
$ deno run -A --no-check https://raw.githubusercontent.com/lucacasonato/fresh/main/init.ts my-project
The manifest has been generated for 3 routes and 1 islands.
Project created!
Run `deno task start` in the project directory to get started.
```
This will create a directory containing some files and directories. There are 3
This will create a directory containing some files and directories. There are 4
files that are strictly necessary to run a fresh project:
- **`main.ts`**: This is the entrypoint for your project. It is the file that
will you run to start your fresh application. This file doesn't actually need
to be called `main.ts`, but it's best practice to call the entrypoint
`main.ts`.
- **`dev.ts`**: This is the development entrypoint for your project. This is the
file that you run to start your project. This file doesn't need to be called
`dev.ts`, but this is the convention.
- **`main.ts`**: This is the production entrypoint for your project. It is the
file that you link to Deno Deploy. This file doesn't actually need to be
`main.ts`, but this is the convention.
- **`fresh.gen.ts`**: This is the manifest file that contains information about
your routes and islands. This file is automatically generated based on your
`routes/` and `islands/` folder by the `fresh` CLI when running the
`fresh manifest` command.
your routes and islands. This file is automatically generated in development
based on your `routes/` and `islands/` folders.
- **`import_map.json`**: This is an [import map][import-map] that is used to
manage dependencies for the project. This allows for easy importing and
updating of dependencies.