Skip to content

Commit b135567

Browse files
authored
Merge branch 'main' into fix-baseUrl-api-route
2 parents ecd7fe7 + 7282ef4 commit b135567

78 files changed

Lines changed: 9696 additions & 3187 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/open-ducks-flash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@solidjs/start": patch
3+
---
4+
5+
fix: check for `null` instad of `undefined` in `HeaderProxy`

.changeset/soft-beans-take.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@solidjs/start": minor
3+
---
4+
5+
adds the option to change the public directory to something other than the default "public"

.github/workflows/compliance.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 141 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,144 @@
11
# Contributing
22

3+
Thank you for your interest in contributing to **SolidStart**! We welcome contributions including bug fixes, feature enhancements, documentation improvements, and more.
4+
5+
## Prerequisites
6+
7+
- **Node.js**: Use the version specified in `.nvmrc`, to manage multiple versions across your system, we recommend a version manager such as [fnm](https://github.com/Schniz/fnm), or another of your preference.
8+
- **pnpm**: Install globally via `npm install -g pnpm`. Or let **Corepack** handle it in the setup step below.
9+
- **Git**: Ensure Git is installed for cloning and managing the repository
10+
11+
## Setup
12+
313
1. Clone the repository
4-
`git clone https://github.com/solidjs/solid-start.git`
5-
2. Install dependencies
6-
`pnpm install`
7-
3. Build dependencies
8-
`pnpm run build:all`
9-
4. Run an example
10-
`pnpm --filter example-hackernews run dev`
11-
5. Make changes and check if things work in examples
12-
6. Add integration tests in `test`, if appropriate
13-
7. Run tests locally
14-
- Setup playwright: `pnpm run install:playwright`
15-
- Run all tests: `pnpm run test:all`
16-
- Show report: `pnpm run show:test-report`
17-
18-
## Requirements
19-
20-
1. Node.js: ^20
14+
15+
```bash
16+
git clone https://github.com/solidjs/solid-start.git
17+
cd solid-start
18+
```
19+
20+
2. Enable the correct pnpm version specified in package.json
21+
22+
```bash
23+
corepack enable
24+
```
25+
26+
3. Install dependencies
27+
28+
```bash
29+
pnpm install
30+
```
31+
32+
4. Build all packages and the landing page
33+
```bash
34+
pnpm run build:all
35+
```
36+
37+
If you encounter issues (e.g. missing `node_modules`), clean the workspace
38+
39+
```bash
40+
pnpm run clean:all
41+
```
42+
43+
Then reinstall dependencies and rebuild.
44+
45+
## Monorepo Structure
46+
47+
SolidStart is a pnpm-based monorepo with nested workspaces. Key directories include
48+
49+
- **`packages/start`**: The core `@solidjs/start` package.
50+
- **`packages/landing-page`**: The official landing page.
51+
- **`examples/`**: Example projects for testing (a nested workspace; see details below).
52+
- **`packages/tests`**: Unit and end-to-end (E2E) tests using Vitest and Cypress.
53+
54+
Use pnpm filters (e.g. `pnpm --filter @solidjs/start ...`) to target specific packages.
55+
The `examples/` directory is a separate workspace with its own `pnpm-workspace.yaml` and `pnpm-lock.yaml`.
56+
57+
## Developing and Testing Changes
58+
59+
1. Make your changes in the relevant package (e.g. `packages/start`)
60+
61+
2. Rebuild affected packages
62+
63+
```bash
64+
pnpm run packages:build
65+
```
66+
67+
For a full rebuild: `pnpm run build:all`
68+
69+
3. Test your changes
70+
71+
- For examples
72+
```bash
73+
cd examples
74+
pnpm install
75+
pnpm --filter example-hackernews run dev # Runs the HackerNews example
76+
```
77+
- For the landing page (from the root directory)
78+
```bash
79+
pnpm run lp:dev
80+
```
81+
82+
4. Clean builds if needed
83+
```bash
84+
pnpm run packages:clean # Cleans packages' node_modules and dist folders
85+
pnpm run lp:clean # Cleans the landing page
86+
pnpm run clean:root # Cleans root-level caches
87+
```
88+
89+
## Running Tests
90+
91+
Tests are located in `packages/tests`, using Vitest for unit tests and Cypress for E2E tests.
92+
93+
1. Install the Cypress binary (required only once)
94+
95+
```bash
96+
pnpm --filter tests exec cypress install
97+
```
98+
99+
2. For unit tests that check build artifacts, build the test app first
100+
101+
```bash
102+
pnpm --filter tests run build
103+
```
104+
105+
3. Run unit tests
106+
107+
```bash
108+
pnpm --filter tests run unit
109+
```
110+
111+
- CI mode (run once): `pnpm --filter tests run unit:ci`
112+
- UI mode: `pnpm --filter tests run unit:ui`
113+
114+
4. Run E2E tests
115+
116+
```bash
117+
pnpm --filter tests run e2e:run
118+
```
119+
120+
- Interactive mode: `pnpm --filter tests run e2e:open`
121+
- With dev server: `pnpm --filter tests run e2e`
122+
123+
5. Clean test artifacts
124+
```bash
125+
pnpm run clean:test
126+
```
127+
128+
## Using SolidStart in Your Own Monorepo
129+
130+
When integrating `@solidjs/start` into your own monorepo (e.g. using Yarn workspaces), configure dependency hoisting to ensure proper resolution. This helps runtime components (e.g. `client/index.tsx`) resolve correctly in generated files like `index.html`.
131+
132+
### Yarn v2+
133+
134+
In the project root's `package.json`
135+
136+
```jsonc
137+
{
138+
"installConfig": {
139+
"hoistingLimits": "dependencies"
140+
}
141+
}
142+
```
143+
144+
For pnpm monorepos, define workspaces in `pnpm-workspace.yaml`. If you encounter resolution issues (e.g. missing modules like `h3` from Vinxi), add `shamefully-hoist=true` to your `.npmrc` file. Test for duplicates and adjust configurations as necessary.

README.md

Lines changed: 58 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,112 +1,87 @@
1-
<p>
2-
<img width="100%" src="https://assets.solidjs.com/banner?project=Start&type=core" alt="Solid Docs">
3-
</p>
1+
[![Banner](https://assets.solidjs.com/banner?project=Start&type=core)](https://github.com/solidjs)
42

5-
# SolidStart
3+
<div align="center">
64

7-
This is the home of the SolidStart, the Solid app framework.
5+
[![Version](https://img.shields.io/npm/v/@solidjs/start.svg?style=for-the-badge&color=blue&logo=npm)](https://npmjs.com/package/@solidjs/start)
6+
[![Downloads](https://img.shields.io/npm/dm/@solidjs/start.svg?style=for-the-badge&color=green&logo=npm)](https://npmjs.com/package/@solidjs/start)
7+
[![Stars](https://img.shields.io/github/stars/solidjs/solid-start?style=for-the-badge&color=yellow&logo=github)](https://github.com/solidjs/solid-start)
8+
[![Discord](https://img.shields.io/discord/722131463138705510?label=join&style=for-the-badge&color=5865F2&logo=discord&logoColor=white)](https://discord.com/invite/solidjs)
9+
[![Reddit](https://img.shields.io/reddit/subreddit-subscribers/solidjs?label=join&style=for-the-badge&color=FF4500&logo=reddit&logoColor=white)](https://reddit.com/r/solidjs)
810

9-
## Features
11+
</div>
1012

11-
- File-system based routing
12-
- Supports all rendering modes:
13-
- Server-side rendering (SSR)
14-
- Streaming SSR
15-
- Client-side rendering (CSR)
16-
- Static site generation (SSG)
17-
- Streaming
18-
- Build optimizations with code splitting, tree shaking and dead code elimination
19-
- API Routes
20-
- Built on Web standards like Fetch, Streams, and WebCrypto
21-
- Adapters for deployment to all popular platforms
22-
- CSS Modules, SASS/SCSS Support
23-
- TypeScript-first
13+
**SolidStart** brings fine-grained reactivity fullstack with full flexibility. Built with features like unified rendering and isomorphic code execution, SolidStart enables you to create highly performant and scalable web applications.
2414

25-
### Getting started
15+
Explore the official [documentation](https://docs.solidjs.com/solid-start) for detailed guides and examples.
2616

27-
Create a SolidStart application and run a development server using your preferred package manager:
17+
## Core Features
2818

29-
```bash
30-
mkdir my-app
31-
cd my-app
32-
33-
# with npm
34-
npm init solid@latest
35-
npm install
36-
npm run dev
37-
38-
# or with pnpm
39-
pnpm create solid@latest
40-
pnpm install
41-
pnpm dev
42-
43-
# or with Bun
44-
bun create solid@latest
45-
bun install
46-
bun dev
47-
```
19+
- **All Rendering Modes**:
20+
- Server-Side Rendering _(SSR)_ with sync, async, and stream [modes](https://docs.solidjs.com/solid-start/reference/server/create-handler)
21+
- Client-Side Rendering _(CSR)_
22+
- Static Site Generation _(SSG)_ with route [pre-rendering](https://docs.solidjs.com/solid-start/building-your-application/route-prerendering)
23+
- **TypeScript**: Full integration for robust, type-safe development
24+
- **File-Based Routing**: Intuitive routing based on your project’s file structure
25+
- **API Routes**: Dedicated server-side endpoints for seamless API development
26+
- **Streaming**: Efficient data rendering for faster page loads
27+
- **Build Optimizations**: Code splitting, tree shaking, and dead code elimination
28+
- **Deployment Adapters**: Easily deploy to platforms like Vercel, Netlify, Cloudflare, and more
4829

49-
### Development
30+
## Getting Started
5031

51-
You should use a Node.js version manager [compatible with `.node-version`](https://stackoverflow.com/a/62978089/565877) ([asdf-vm](https://asdf-vm.com/) is a great option macOS/Linux users)
32+
### Installation
5233

53-
The monorepo uses `pnpm` as the package manager. To install `pnpm`, run the following command in your terminal.
34+
Create a SolidStart template project with your preferred package manager
5435

5536
```bash
56-
npm install -g pnpm
37+
# using npm
38+
npm create solid@latest -- -s
5739
```
5840

59-
Run `pnpm install` to install all the dependencies for the packages and examples in your monorepo.
41+
```bash
42+
# using pnpm
43+
pnpm create solid@latest -s
44+
```
6045

61-
Run `pnpm build` to build SolidStart project
46+
```bash
47+
# using bun
48+
bun create solid@latest --s
49+
```
6250

63-
<details>
64-
<summary><h4>Monorepo & <code>project.json</code> <code>"workspace"</code> support</h4></summary>
51+
### Project Structure
6552

66-
If you are using SolidStart within a monorepo that takes advantage of the `package.json` `"workspaces"` property (e.g. [Yarn workspaces](https://classic.yarnpkg.com/en/docs/workspaces/)) with hoisted dependencies (the default for Yarn), you must include `#solidjs/start` within the optional `"nohoist"` (for Yarn v2 or higher, see further down for instructions) workspaces property.
53+
- `public/`: Static assets like icons, images, and fonts
54+
- `src/`: Core application (aliased to `~/`)
55+
- `routes/`: File-based routing for pages and APIs
56+
- `app.tsx`: Root component of your application
57+
- `entry-client.tsx`: Handles client-side hydration
58+
- `entry-server.tsx`: Manages server-side request handling
59+
- **Configuration Files**: `app.config.ts`, `package.json`, and more
6760

68-
- _In the following, "workspace root" refers to the root of your repository while "project root" refers to the root of a child package within your repository._
61+
Learn more about [routing](https://docs.solidjs.com/solid-start/building-your-application/routing)
6962

70-
For example, if specifying `"nohoist"` options from the workspace root (i.e. for all packages):
63+
## Adapters
7164

72-
```jsonc
73-
// in workspace root
74-
{
75-
"workspaces": {
76-
"packages": [
77-
/* ... */
78-
],
79-
"nohoist": ["**/@solidjs/start"]
80-
}
81-
}
82-
```
65+
Configure adapters in `app.config.ts` to deploy to platforms like Vercel, Netlify, Cloudflare, and others
8366

84-
If specifying `"nohoist"` options for a specific package using `@solidjs/start`:
67+
```ts
68+
import { defineConfig } from "@solidjs/start/config";
8569

86-
```jsonc
87-
// in project root of a workspace child
88-
{
89-
"workspaces": {
90-
"nohoist": ["@solidjs/start"]
91-
}
92-
}
70+
export default defineConfig({
71+
ssr: true, // false for client-side rendering only
72+
server: { preset: "vercel" }
73+
});
9374
```
9475

95-
Regardless of where you specify the `nohoist` option, you also need to include `@solidjs/start` as a `devDependency` in the child `package.json`.
76+
Presets also include runtimes like Node.js, Bun or Deno. For example, a preset like `node-server` enables hosting on your server.
77+
Learn more about [`defineConfig`](https://docs.solidjs.com/solid-start/reference/config/define-config)
9678

97-
The reason why this is necessary is because `@solidjs/start` creates an `index.html` file within your project which expects to load a script located in `/node_modules/@solidjs/start/runtime/entry.jsx` (where `/` is the path of your project root). By default, if you hoist the `@solidjs/start` dependency into the workspace root then that script will not be available within the package's `node_modules` folder.
79+
## Building
9880

99-
**Yarn v2 or higher**
81+
Generate production-ready bundles
10082

101-
The `nohoist` option is no longer available in Yarn v2+. In this case, we can use the `installConfig` property in the `package.json` (either workspace package or a specific project package) to make sure our deps are not hoisted.
102-
103-
```jsonc
104-
// in project root of a workspace child
105-
{
106-
"installConfig": {
107-
"hoistingLimits": "dependencies"
108-
}
109-
}
83+
```bash
84+
npm run build # or pnpm build or bun build
11085
```
11186

112-
</details>
87+
After the build completes, you’ll be guided through deployment for your specific preset.

examples/bare/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"dependencies": {
1010
"@solidjs/start": "^1.1.0",
1111
"solid-js": "^1.9.5",
12-
"vinxi": "^0.5.3"
12+
"vinxi": "^0.5.7"
1313
},
1414
"engines": {
1515
"node": ">=22"

examples/basic/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"@solidjs/router": "^0.15.0",
1313
"@solidjs/start": "^1.1.0",
1414
"solid-js": "^1.9.5",
15-
"vinxi": "^0.5.3"
15+
"vinxi": "^0.5.7"
1616
},
1717
"engines": {
1818
"node": ">=22"

0 commit comments

Comments
 (0)