Skip to content
Merged
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ vite.config.ts.timestamp*
tsconfig.tsbuildinfo

apps/tests/**/test-results
.solid-start
30 changes: 30 additions & 0 deletions apps/fixtures/nitro-3/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# SolidStart

Everything you need to build a Solid project, powered by [`solid-start`](https://start.solidjs.com);

## Creating a project

```bash
# create a new project in the current directory
npm init solid@latest

# create a new project in my-app
npm init solid@latest my-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

# or start the server and open the app in a new browser tab
npm run dev -- --open
```

## 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`.
20 changes: 20 additions & 0 deletions apps/fixtures/nitro-3/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "fixture-nitro-3",
"type": "module",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"@solidjs/meta": "^0.29.4",
"@solidjs/router": "^0.15.0",
"@solidjs/start": "workspace:*",
"solid-js": "^1.9.9",
"nitro": "^3.0.1-alpha.1",
"vite": "7.1.10"
},
"engines": {
"node": ">=22"
}
}
Binary file added apps/fixtures/nitro-3/public/favicon.ico
Binary file not shown.
39 changes: 39 additions & 0 deletions apps/fixtures/nitro-3/src/app.css
Original file line number Diff line number Diff line change
@@ -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 changes: 22 additions & 0 deletions apps/fixtures/nitro-3/src/app.tsx
Original file line number Diff line number Diff line change
@@ -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>
);
}
21 changes: 21 additions & 0 deletions apps/fixtures/nitro-3/src/components/Counter.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.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;
cursor: pointer;
}

.increment:focus {
border: 2px solid #335d92;
}

.increment:active {
background-color: rgba(68, 107, 158, 0.2);
}
11 changes: 11 additions & 0 deletions apps/fixtures/nitro-3/src/components/Counter.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
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)} type="button">
Clicks: {count()}
</button>
);
}
4 changes: 4 additions & 0 deletions apps/fixtures/nitro-3/src/entry-client.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// @refresh reload
import { mount, StartClient } from "@solidjs/start/client";

mount(() => <StartClient />, document.getElementById("app")!);
21 changes: 21 additions & 0 deletions apps/fixtures/nitro-3/src/entry-server.tsx
Original file line number Diff line number Diff line change
@@ -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 change: 1 addition & 0 deletions apps/fixtures/nitro-3/src/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="@solidjs/start/env" />
19 changes: 19 additions & 0 deletions apps/fixtures/nitro-3/src/routes/[...404].tsx
Original file line number Diff line number Diff line change
@@ -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>
);
}
10 changes: 10 additions & 0 deletions apps/fixtures/nitro-3/src/routes/about.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Title } from "@solidjs/meta";

export default function About() {
return (
<main>
<Title>About</Title>
<h1>About</h1>
</main>
);
}
19 changes: 19 additions & 0 deletions apps/fixtures/nitro-3/src/routes/index.tsx
Original file line number Diff line number Diff line change
@@ -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>
);
}
18 changes: 18 additions & 0 deletions apps/fixtures/nitro-3/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"jsx": "preserve",
"jsxImportSource": "solid-js",
"allowJs": true,
"strict": true,
"noEmit": true,
"isolatedModules": true,
"paths": {
"~/*": ["./src/*"]
}
}
}
7 changes: 7 additions & 0 deletions apps/fixtures/nitro-3/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { solidStart } from "@solidjs/start/config";
import { nitro } from "nitro/vite";
import { defineConfig } from "vite";

export default defineConfig({
plugins: [solidStart(), nitro({ preset: "node-server" })]
});
2 changes: 1 addition & 1 deletion apps/landing-page/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"dev": "vite dev",
"build": "pnpm --filter @solidjs/start build && vite build",
"build": "vite build",
"start": "vite serve"
},
"devDependencies": {
Expand Down
3 changes: 1 addition & 2 deletions apps/landing-page/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
"esModuleInterop": true,
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "node",
"moduleResolution": "bundler",
"jsxImportSource": "solid-js",
"jsx": "preserve",
"types": ["@solidjs/start/env"],
"baseUrl": "./",
"paths": {
"~/*": ["./src/*"]
Expand Down
Loading
Loading