Skip to content

Commit f4052b2

Browse files
authored
cli: add with-solidbase example (#1847)
1 parent 7030a13 commit f4052b2

File tree

15 files changed

+5529
-2615
lines changed

15 files changed

+5529
-2615
lines changed

examples/pnpm-lock.yaml

Lines changed: 5300 additions & 2615 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/with-solidbase/.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
dist
2+
.solid
3+
.output
4+
.vercel
5+
.netlify
6+
.vinxi
7+
app.config.timestamp_*.js
8+
9+
# Environment
10+
.env
11+
.env*.local
12+
13+
# dependencies
14+
/node_modules
15+
16+
# IDEs and editors
17+
/.idea
18+
.project
19+
.classpath
20+
*.launch
21+
.settings/
22+
23+
# Temp
24+
gitignore
25+
26+
# System Files
27+
.DS_Store
28+
Thumbs.db

examples/with-solidbase/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# SolidStart
2+
3+
Everything you need to build a Solid project, powered by [`solid-start`](https://start.solidjs.com) and [SolidBase](https://solidbase.kobalte.dev/);
4+
5+
## Creating a project
6+
7+
```bash
8+
# create a new project in the current directory
9+
npm init solid@latest
10+
11+
# create a new project in my-app
12+
npm init solid@latest my-app
13+
```
14+
15+
## Developing
16+
17+
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
18+
19+
```bash
20+
npm run dev
21+
22+
# or start the server and open the app in a new browser tab
23+
npm run dev -- --open
24+
```
25+
26+
## Building
27+
28+
Solid apps are built with _presets_, which optimise your project for deployment to different environments.
29+
30+
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`.
31+
32+
## This project was created with the [Solid CLI](https://solid-cli.netlify.app)
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { defineConfig } from "@solidjs/start/config";
2+
import { withSolidBase } from "@kobalte/solidbase/config";
3+
4+
export default defineConfig(withSolidBase(
5+
// SolidStart config
6+
{
7+
server: {
8+
prerender: {
9+
crawlLinks: true
10+
}
11+
}
12+
},
13+
// SolidBase config
14+
{
15+
title: "SolidBase",
16+
titleTemplate: ":title - SolidBase",
17+
description: "Fully featured, fully customisable static site generation for SolidStart",
18+
themeConfig: {
19+
sidebar: {
20+
"/": {
21+
items: [
22+
{
23+
title: "Overview",
24+
collapsed: false,
25+
items: [
26+
{
27+
title: "Home",
28+
link: "/"
29+
},
30+
{
31+
title: "About",
32+
link: "/about"
33+
}
34+
]
35+
}
36+
]
37+
}
38+
}
39+
}
40+
}
41+
));
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "example-with-solidbase",
3+
"type": "module",
4+
"scripts": {
5+
"dev": "vinxi dev",
6+
"build": "vinxi build",
7+
"start": "vinxi start",
8+
"version": "vinxi version"
9+
},
10+
"dependencies": {
11+
"@iconify-json/ri": "^1.2.5",
12+
"@kobalte/solidbase": "^0.2.11",
13+
"@solidjs/meta": "^0.29.4",
14+
"@solidjs/router": "^0.15.3",
15+
"@solidjs/start": "^1.1.0",
16+
"solid-js": "^1.9.5",
17+
"vinxi": "^0.5.6"
18+
},
19+
"engines": {
20+
"node": ">=22"
21+
}
22+
}
664 Bytes
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
:root {
2+
--sb-hero-name-background: linear-gradient(-20deg, hsl(200, 98%, 39%) 30%, hsl(199, 95%, 74%));
3+
--sb-hero-background: linear-gradient(-45deg, hsl(200, 98%, 39%) 50%, hsl(199, 95%, 74%) 50%);
4+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Router } from "@solidjs/router";
2+
import { FileRoutes } from "@solidjs/start/router";
3+
import "./app.css";
4+
import {SolidBaseRoot} from "@kobalte/solidbase/client";
5+
6+
export default function App() {
7+
return (
8+
<Router root={SolidBaseRoot}>
9+
<FileRoutes />
10+
</Router>
11+
);
12+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// @refresh reload
2+
import { mount, StartClient } from "@solidjs/start/client";
3+
4+
mount(() => <StartClient />, document.getElementById("app")!);
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// @refresh reload
2+
import { createHandler, StartServer } from "@solidjs/start/server";
3+
import {getHtmlProps} from "@kobalte/solidbase/server";
4+
5+
export default createHandler(() => (
6+
<StartServer
7+
document={({ assets, children, scripts }) => (
8+
<html {...getHtmlProps()}>
9+
<head>
10+
<meta charset="utf-8" />
11+
<meta name="viewport" content="width=device-width, initial-scale=1" />
12+
<link rel="icon" href="/favicon.ico" />
13+
{assets}
14+
</head>
15+
<body>
16+
<div id="app">{children}</div>
17+
{scripts}
18+
</body>
19+
</html>
20+
)}
21+
/>
22+
));

0 commit comments

Comments
 (0)