feat(templates): update basic template readme

This commit is contained in:
Ayo 2023-10-21 18:25:04 +02:00
parent 0e417d5769
commit e71c7d22b9
2 changed files with 19 additions and 35 deletions

BIN
assets/template-basic.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 424 KiB

View file

@ -1,42 +1,26 @@
# Nitro Minimal Starter
# McFly Starter Project
Look at the [Nitro documentation](https://nitro.unjs.io/) to learn more.
**McFly** is a no-framework framework that assists in leveraging the web platform
## Setup
Make sure to install the dependencies:
```bash
# npm
npm install
# yarn
yarn install
# pnpm
pnpm install
```
## Development Server
Start the development server on <http://localhost:3000>
```bash
npm run dev
npm create mcfly@latest
```
![template-basic](https://raw.githubusercontent.com/ayoayco/McFly/main/assets/template-basic.png)
## Production
## Features
- Create web apps with vanilla custom elements
- Write real .HTML files
- Have no frameworks or reactivity libraries on the browser
- Use server-side rendering
- Deploy anywhere
Build the application for production:
## Special directories
**1. `src/pages`**
- file based routing for `.html` files
- directly use custom elements & static fragments (no imports or registry maintenance needed)
- use `<script server:setup>` to define logic that runs on the server, which then gets stripped away
```bash
npm run build
```
Locally preview production build:
```bash
npm run preview
```
Check out the [deployment documentation](https://nitro.unjs.io/deploy) for more information.
**2. `src/components`**
- custom element constructor files (only `.js` files for now)
- all components are automatically registered using their file names; a `hello-world.js` component can be used as `<hello-world>`
- static `.html` fragments; a `my-header.html` fragment can be directly used as `<my-header>`