mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-06 12:57:46 +00:00
[examples] Update to latest SolidStart (#11308)
We've done a pretty significant update over the past few months on SolidStart and 1.0 is looming. Thought I'd update the official templates to get in line before we do the release. I wasn't sure what to do with the `output` fields as we use Vercel's build output V3 here. But otherwise I think everything should be good. --------- Co-authored-by: Nathan Rajlich <n@n8.io> Co-authored-by: Jeff See <jeffsee.55@gmail.com>
This commit is contained in:
5
.changeset/yellow-ties-grin.md
Normal file
5
.changeset/yellow-ties-grin.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@vercel/frameworks": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Update framework detection to support SolidStart v1
|
||||||
4
examples/__tests__/integration/solidstart-1.test.ts
Normal file
4
examples/__tests__/integration/solidstart-1.test.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
import { deployExample } from '../test-utils';
|
||||||
|
it('[examples] should deploy solidstart-1', async () => {
|
||||||
|
await deployExample('solidstart-1');
|
||||||
|
});
|
||||||
23
examples/solidstart-1/.gitignore
vendored
Normal file
23
examples/solidstart-1/.gitignore
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
dist
|
||||||
|
worker
|
||||||
|
.solid
|
||||||
|
.vercel
|
||||||
|
.vinxi
|
||||||
|
.output
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
/node_modules
|
||||||
|
|
||||||
|
# IDEs and editors
|
||||||
|
/.idea
|
||||||
|
.project
|
||||||
|
.classpath
|
||||||
|
*.launch
|
||||||
|
.settings/
|
||||||
|
|
||||||
|
# Temp
|
||||||
|
gitignore
|
||||||
|
|
||||||
|
# System Files
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
27
examples/solidstart-1/README.md
Normal file
27
examples/solidstart-1/README.md
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
# SolidStart
|
||||||
|
|
||||||
|
This directory is a brief example of a [SolidStart](https://github.com/ryansolid/solid-start) site that can be deployed to Vercel with zero configuration.
|
||||||
|
|
||||||
|
## Deploy Your Own
|
||||||
|
|
||||||
|
Deploy your own SolidStart project with Vercel.
|
||||||
|
|
||||||
|
[](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/examples/solidstart&template=solidstart)
|
||||||
|
|
||||||
|
_Live Example: https://solid-start-template.vercel.app_
|
||||||
|
|
||||||
|
## 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
|
||||||
|
```
|
||||||
|
|
||||||
|
## Building
|
||||||
|
|
||||||
|
This uses the [Vercel Adapter](https://github.com/solidjs/solid-start/tree/main/packages/start-vercel) for SolidStart.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run build
|
||||||
|
```
|
||||||
7
examples/solidstart-1/app.config.ts
Normal file
7
examples/solidstart-1/app.config.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import { defineConfig } from "@solidjs/start/config";
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
server: {
|
||||||
|
preset: "vercel"
|
||||||
|
}
|
||||||
|
});
|
||||||
20
examples/solidstart-1/package.json
Normal file
20
examples/solidstart-1/package.json
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"scripts": {
|
||||||
|
"dev": "vinxi dev",
|
||||||
|
"build": "vinxi build",
|
||||||
|
"start": "vinxi start",
|
||||||
|
"version": "vinxi version"
|
||||||
|
},
|
||||||
|
"type": "module",
|
||||||
|
"private": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@solidjs/meta": "^0.29.2",
|
||||||
|
"@solidjs/router": "^0.13.1",
|
||||||
|
"@solidjs/start": "^1.0.0-rc.0",
|
||||||
|
"solid-js": "^1.8.16",
|
||||||
|
"vinxi": "^0.3.10"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
}
|
||||||
4413
examples/solidstart-1/pnpm-lock.yaml
generated
Normal file
4413
examples/solidstart-1/pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
BIN
examples/solidstart-1/public/favicon.ico
Normal file
BIN
examples/solidstart-1/public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 664 B |
39
examples/solidstart-1/src/app.css
Normal file
39
examples/solidstart-1/src/app.css
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
body {
|
||||||
|
font-family: Gordita, Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
margin-right: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
main {
|
||||||
|
text-align: center;
|
||||||
|
padding: 1em;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
color: #335d92;
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-size: 4rem;
|
||||||
|
font-weight: 100;
|
||||||
|
line-height: 1.1;
|
||||||
|
margin: 4rem auto;
|
||||||
|
max-width: 14rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
max-width: 14rem;
|
||||||
|
margin: 2rem auto;
|
||||||
|
line-height: 1.35;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 480px) {
|
||||||
|
h1 {
|
||||||
|
max-width: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
max-width: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
22
examples/solidstart-1/src/app.tsx
Normal file
22
examples/solidstart-1/src/app.tsx
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import { MetaProvider, Title } from "@solidjs/meta";
|
||||||
|
import { Router } from "@solidjs/router";
|
||||||
|
import { FileRoutes } from "@solidjs/start/router";
|
||||||
|
import { Suspense } from "solid-js";
|
||||||
|
import "./app.css";
|
||||||
|
|
||||||
|
export default function App() {
|
||||||
|
return (
|
||||||
|
<Router
|
||||||
|
root={props => (
|
||||||
|
<MetaProvider>
|
||||||
|
<Title>SolidStart - Basic</Title>
|
||||||
|
<a href="/">Index</a>
|
||||||
|
<a href="/about">About</a>
|
||||||
|
<Suspense>{props.children}</Suspense>
|
||||||
|
</MetaProvider>
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<FileRoutes />
|
||||||
|
</Router>
|
||||||
|
);
|
||||||
|
}
|
||||||
20
examples/solidstart-1/src/components/Counter.css
Normal file
20
examples/solidstart-1/src/components/Counter.css
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
.increment {
|
||||||
|
font-family: inherit;
|
||||||
|
font-size: inherit;
|
||||||
|
padding: 1em 2em;
|
||||||
|
color: #335d92;
|
||||||
|
background-color: rgba(68, 107, 158, 0.1);
|
||||||
|
border-radius: 2em;
|
||||||
|
border: 2px solid rgba(68, 107, 158, 0);
|
||||||
|
outline: none;
|
||||||
|
width: 200px;
|
||||||
|
font-variant-numeric: tabular-nums;
|
||||||
|
}
|
||||||
|
|
||||||
|
.increment:focus {
|
||||||
|
border: 2px solid #335d92;
|
||||||
|
}
|
||||||
|
|
||||||
|
.increment:active {
|
||||||
|
background-color: rgba(68, 107, 158, 0.2);
|
||||||
|
}
|
||||||
12
examples/solidstart-1/src/components/Counter.tsx
Normal file
12
examples/solidstart-1/src/components/Counter.tsx
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
"use client";
|
||||||
|
import { createSignal } from "solid-js";
|
||||||
|
import "./Counter.css";
|
||||||
|
|
||||||
|
export default function Counter() {
|
||||||
|
const [count, setCount] = createSignal(0);
|
||||||
|
return (
|
||||||
|
<button class="increment" onClick={() => setCount(count() + 1)}>
|
||||||
|
Clicks: {count()}
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
}
|
||||||
4
examples/solidstart-1/src/entry-client.tsx
Normal file
4
examples/solidstart-1/src/entry-client.tsx
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
// @refresh reload
|
||||||
|
import { mount, StartClient } from "@solidjs/start/client";
|
||||||
|
|
||||||
|
mount(() => <StartClient />, document.getElementById("app")!);
|
||||||
21
examples/solidstart-1/src/entry-server.tsx
Normal file
21
examples/solidstart-1/src/entry-server.tsx
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
// @refresh reload
|
||||||
|
import { createHandler, StartServer } from "@solidjs/start/server";
|
||||||
|
|
||||||
|
export default createHandler(() => (
|
||||||
|
<StartServer
|
||||||
|
document={({ assets, children, scripts }) => (
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<link rel="icon" href="/favicon.ico" />
|
||||||
|
{assets}
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app">{children}</div>
|
||||||
|
{scripts}
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
));
|
||||||
1
examples/solidstart-1/src/global.d.ts
vendored
Normal file
1
examples/solidstart-1/src/global.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/// <reference types="@solidjs/start/env" />
|
||||||
19
examples/solidstart-1/src/routes/[...404].tsx
Normal file
19
examples/solidstart-1/src/routes/[...404].tsx
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import { Title } from "@solidjs/meta";
|
||||||
|
import { HttpStatusCode } from "@solidjs/start";
|
||||||
|
|
||||||
|
export default function NotFound() {
|
||||||
|
return (
|
||||||
|
<main>
|
||||||
|
<Title>Not Found</Title>
|
||||||
|
<HttpStatusCode code={404} />
|
||||||
|
<h1>Page Not Found</h1>
|
||||||
|
<p>
|
||||||
|
Visit{" "}
|
||||||
|
<a href="https://start.solidjs.com" target="_blank">
|
||||||
|
start.solidjs.com
|
||||||
|
</a>{" "}
|
||||||
|
to learn how to build SolidStart apps.
|
||||||
|
</p>
|
||||||
|
</main>
|
||||||
|
);
|
||||||
|
}
|
||||||
19
examples/solidstart-1/src/routes/index.tsx
Normal file
19
examples/solidstart-1/src/routes/index.tsx
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import { Title } from "@solidjs/meta";
|
||||||
|
import Counter from "~/components/Counter";
|
||||||
|
|
||||||
|
export default function Home() {
|
||||||
|
return (
|
||||||
|
<main>
|
||||||
|
<Title>Hello World</Title>
|
||||||
|
<h1>Hello world!</h1>
|
||||||
|
<Counter />
|
||||||
|
<p>
|
||||||
|
Visit{" "}
|
||||||
|
<a href="https://start.solidjs.com" target="_blank">
|
||||||
|
start.solidjs.com
|
||||||
|
</a>{" "}
|
||||||
|
to learn how to build SolidStart apps.
|
||||||
|
</p>
|
||||||
|
</main>
|
||||||
|
);
|
||||||
|
}
|
||||||
19
examples/solidstart-1/tsconfig.json
Normal file
19
examples/solidstart-1/tsconfig.json
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ESNext",
|
||||||
|
"module": "ESNext",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"jsx": "preserve",
|
||||||
|
"jsxImportSource": "solid-js",
|
||||||
|
"allowJs": true,
|
||||||
|
"strict": true,
|
||||||
|
"noEmit": true,
|
||||||
|
"types": ["vinxi/client"],
|
||||||
|
"isolatedModules": true,
|
||||||
|
"paths": {
|
||||||
|
"~/*": ["./src/*"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -548,7 +548,44 @@ export const frameworks = [
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'SolidStart',
|
name: 'SolidStart (v1)',
|
||||||
|
slug: 'solidstart-1',
|
||||||
|
demo: 'https://solid-start-template.vercel.app',
|
||||||
|
logo: 'https://api-frameworks.vercel.sh/framework-logos/solid.svg',
|
||||||
|
tagline: 'Simple and performant reactivity for building user interfaces.',
|
||||||
|
description: 'A Solid app, created with SolidStart.',
|
||||||
|
website: 'https://start.solidjs.com',
|
||||||
|
envPrefix: 'VITE_',
|
||||||
|
detectors: {
|
||||||
|
every: [
|
||||||
|
{
|
||||||
|
matchPackage: 'solid-js',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
matchPackage: '@solidjs/start',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
settings: {
|
||||||
|
installCommand: {
|
||||||
|
placeholder:
|
||||||
|
'`yarn install`, `pnpm install`, `npm install`, or `bun install`',
|
||||||
|
},
|
||||||
|
buildCommand: {
|
||||||
|
placeholder: '`npm run build` or `vinxi build`',
|
||||||
|
value: 'vinxi build',
|
||||||
|
},
|
||||||
|
devCommand: {
|
||||||
|
value: 'vinxi dev',
|
||||||
|
},
|
||||||
|
outputDirectory: {
|
||||||
|
value: '.output',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
getOutputDirName: async () => '.output',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'SolidStart (v0)',
|
||||||
slug: 'solidstart',
|
slug: 'solidstart',
|
||||||
demo: 'https://solid-start-template.vercel.app',
|
demo: 'https://solid-start-template.vercel.app',
|
||||||
logo: 'https://api-frameworks.vercel.sh/framework-logos/solid.svg',
|
logo: 'https://api-frameworks.vercel.sh/framework-logos/solid.svg',
|
||||||
@@ -556,6 +593,7 @@ export const frameworks = [
|
|||||||
description: 'A Solid app, created with SolidStart.',
|
description: 'A Solid app, created with SolidStart.',
|
||||||
website: 'https://solidjs.com',
|
website: 'https://solidjs.com',
|
||||||
envPrefix: 'VITE_',
|
envPrefix: 'VITE_',
|
||||||
|
sort: 98,
|
||||||
detectors: {
|
detectors: {
|
||||||
every: [
|
every: [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user