Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 13 additions & 123 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,141 +1,31 @@
<p>
<img width="100%" src="https://raw.githubusercontent.com/solidjs/templates/vanilla/master/banner.png" alt="Solid Vite Templates">
</p>
[![Banner](https://assets.solidjs.com/banner?project=templates&type=core)](https://github.com/solidjs)

# Solid Templates (using [vite](https://vitejs.dev/))
[![Discord](https://img.shields.io/discord/722131463138705510?label=join%20server&style=for-the-badge&color=5865F2&logo=discord&logoColor=white)](https://discord.com/invite/solidjs)
[![Reddit](https://img.shields.io/reddit/subreddit-subscribers/solidjs?style=for-the-badge&color=FF4500&logo=reddit&logoColor=white)](https://reddit.com/r/solidjs)

This repository holds most of the official starter templates for [vite](https://vitejs.dev/).
## Get Started

You get:

- HMR out of the box
- Minimal bundle size
- All the vite features

### Learn more on the [Solid Website](https://solidjs.com) and come chat with us on our [Discord](https://discord.com/invite/solidjs)

## Get started

Those templates dependencies are maintained via [pnpm](https://pnpm.io) via `pnpm up -Lri`.

This is the reason you see a `pnpm-lock.yaml`. That being said, any package manager will work. This file can be safely be removed once you clone a template.

These templates are meant to be used as is via the [degit](https://github.com/Rich-Harris/degit) utility.

```bash
# Typescript basic template
$ npx degit solidjs/templates/vanilla/basic my-solid-project
$ cd my-solid-project
$ npm install # or pnpm install or yarn install
```

```bash
# Typescript bare template
$ npx degit solidjs/templates/vanilla/bare my-solid-project
$ cd my-solid-project
$ npm install # or pnpm install or yarn install
```
Import a template project using

```bash
# Typescript unocss template
$ npx degit solidjs/templates/vanilla/with-unocss my-solid-project
$ cd my-solid-project
$ npm install # or pnpm install or yarn install
# use preferred package manager
npm create solid@latest
```

```bash
# Typescript tailwindcss template + solid-router with config-based routing
$ npx degit solidjs/templates/vanilla/with-solid-router my-solid-project
$ cd my-solid-project
$ npm install # or pnpm install or yarn install
```

```bash
# Typescript vite-plugin-pages file-based routing
$ npx degit solidjs/templates/vanilla/with-vite-plugin-pages my-solid-project
$ cd my-solid-project
$ npm install # or pnpm install or yarn install
```

```bash
# Typescript bootstrap (5) template
$ npx degit solidjs/templates/vanilla/with-bootstrap my-solid-project
$ cd my-solid-project
$ npm install # or pnpm install or yarn install
```
## Missing a Template?

```bash
# Typescript + tailwindcss template
$ npx degit solidjs/templates/vanilla/with-tailwindcss my-solid-project
$ cd my-solid-project
$ npm install # or pnpm install or yarn install
```
Want a template with your favorite library? Create a pull request! Copy an existing template, modify it, name it with a `with-` prefix, and submit a PR.

```bash
# Typescript + sass template
$ npx degit solidjs/templates/vanilla/with-sass my-solid-project
$ cd my-solid-project
$ npm install # or pnpm install or yarn install
```

```bash
# Typescript + vitest template
$ npx degit solidjs/templates/vanilla/with-vitest my-solid-project
$ cd my-solid-project
$ npm install # or pnpm install or yarn install
```

```bash
# Typescript + vitest browser mode template
$ npx degit solidjs/templates/vanilla/with-vitest-browser-mode my-solid-project
$ cd my-solid-project
$ npm install # or pnpm install or yarn install
```
## Contributing

```bash
# Typescript + uvu template
$ npx degit solidjs/templates/vanilla/with-uvu my-solid-project
$ cd my-solid-project
$ npm install # or pnpm install or yarn install
```
This project uses [pnpm](https://pnpm.io) for dependency management. Install it to test or contribute to templates.

```bash
# TanStack Router
$ npx degit solidjs/templates/vanilla/with-tanstack-router-config-based my-solid-project
$ cd my-solid-project
$ npm install # or pnpm install or yarn install
```
Update dependencies with

```bash
# TanStack Router File Based
$ npx degit solidjs/templates/vanilla/with-tanstack-router-file-based my-solid-project
$ cd my-solid-project
$ npm install # or pnpm install or yarn install
pnpm up -Lri
```

```bash
# TanStack Start
$ npx degit solidjs/templates/tanstack-start my-solid-project
$ cd my-solid-project
$ npm install # or pnpm install or yarn install
```

## I don't see a template that matches my need?

You wish there was a template with your favorite library?

Feel free to make a pull request. Copy one of the template already available, tweak it, name it properly and make a PR. See [contributing](#contributing) below.

## Contributing

This project is managed with [pnpm](https://pnpm.io). You should [install it](https://pnpm.io/installation) first to test out your template or contribute to an existing one.

You can create your own template and prefix it `with-` and give it a name that describe the purpose.

To update all dependencies you can run:

`pnpm up -Lri`

## Troubleshooting

It appears that Webstorm generate some weird triggers when saving a file. In order to prevent that you can follow [this thread](https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000154544-I-m-having-a-huge-problem-with-Webstorm-and-react-hot-loader-) and disable the **"Safe Write"** option in **"Settings | Appearance & Behavior | System Settings"**.
Binary file removed banner.png
Binary file not shown.
34 changes: 13 additions & 21 deletions solid-start/bare/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
# SolidStart
# SolidStart Template

Everything you need to build a Solid project, powered by [`solid-start`](https://start.solidjs.com);
For more information on SolidStart, refer to the [README](https://github.com/solidjs/solid-start/tree/main/packages/start#readme) or visit the official [documentation](https://docs.solidjs.com/solid-start/).

## Creating a project
## Installation

```bash
# create a new project in the current directory
npm init solid@latest
Generate the **bare** template using your preferred package manager

# create a new project in my-app
npm init solid@latest my-app
```bash
# using npm
npm create solid@latest -- -st bare
```

## Developing

Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:

```bash
npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open
# using pnpm
pnpm create solid@latest -st bare
```

## Building

Solid apps are built with _presets_, which optimise your project for deployment to different environments.

By default, `npm run build` will generate a Node app that you can run with `npm start`. To use a different preset, add it to the `devDependencies` in `package.json` and specify in your `app.config.js`.
```bash
# using bun
bun create solid@latest --s --t bare
```
2 changes: 1 addition & 1 deletion solid-start/bare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "example-bare",
"type": "module",
"scripts": {
"dev": "vinxi dev",
"dev": "vinxi dev --port 3000",
"build": "vinxi build",
"start": "vinxi start"
},
Expand Down
Binary file removed solid-start/bare/public/favicon.ico
Binary file not shown.
92 changes: 92 additions & 0 deletions solid-start/bare/public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions solid-start/bare/src/entry-server.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @refresh reload
import { createHandler, StartServer } from "@solidjs/start/server";
import { createHandler, StartServer } from '@solidjs/start/server';

export default createHandler(() => (
<StartServer
Expand All @@ -8,7 +8,7 @@ export default createHandler(() => (
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="/favicon.ico" />
<link rel="icon" type="image/svg" href="favicon.svg" />
{assets}
</head>
<body>
Expand Down
34 changes: 13 additions & 21 deletions solid-start/basic/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
# SolidStart
# SolidStart Template

Everything you need to build a Solid project, powered by [`solid-start`](https://start.solidjs.com);
For more information on SolidStart, refer to the [README](https://github.com/solidjs/solid-start/tree/main/packages/start#readme) or visit the official [documentation](https://docs.solidjs.com/solid-start/).

## Creating a project
## Installation

```bash
# create a new project in the current directory
npm init solid@latest
Generate the **basic** template using your preferred package manager

# create a new project in my-app
npm init solid@latest my-app
```bash
# using npm
npm create solid@latest -- -st basic
```

## Developing

Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:

```bash
npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open
# using pnpm
pnpm create solid@latest -st basic
```

## Building

Solid apps are built with _presets_, which optimise your project for deployment to different environments.

By default, `npm run build` will generate a Node app that you can run with `npm start`. To use a different preset, add it to the `devDependencies` in `package.json` and specify in your `app.config.js`.
```bash
# using bun
bun create solid@latest --s --t basic
```
2 changes: 1 addition & 1 deletion solid-start/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "example-basic",
"type": "module",
"scripts": {
"dev": "vinxi dev",
"dev": "vinxi dev --port 3000",
"build": "vinxi build",
"start": "vinxi start",
"version": "vinxi version"
Expand Down
Binary file removed solid-start/basic/public/favicon.ico
Binary file not shown.
Loading