Skip to content

Commit 9d25a45

Browse files
docs: Updated contribution guidelines and README (#1948)
Co-authored-by: Atila Fassina <atilafassina@gmail.com>
1 parent 1678f34 commit 9d25a45

File tree

2 files changed

+160
-120
lines changed

2 files changed

+160
-120
lines changed

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: 19 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
[![Banner](https://assets.solidjs.com/banner?project=Start&type=core)](https://github.com/solidjs)
22

3-
[![Version](https://img.shields.io/npm/v/@solidjs/start.svg?style=for-the-badge&color=blue)](https://www.npmjs.com/package/@solidjs/start)
4-
[![Downloads](https://img.shields.io/npm/dm/@solidjs/start.svg?style=for-the-badge&color=green)](https://www.npmjs.com/package/@solidjs/start)
5-
[![Stars](https://img.shields.io/github/stars/solidjs/solid-start?style=for-the-badge&color=yellow)](https://github.com/solidjs/solid-start)
6-
[![Discord](https://img.shields.io/discord/722131463138705510?style=for-the-badge&color=5865F2)](https://discord.com/invite/solidjs)
7-
[![Reddit](https://img.shields.io/reddit/subreddit-subscribers/solidjs?style=for-the-badge&color=FF4500)](https://www.reddit.com/r/solidjs/)
3+
<div align="center">
4+
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)
10+
11+
</div>
812

913
**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.
1014

@@ -15,7 +19,7 @@ Explore the official [documentation](https://docs.solidjs.com/solid-start) for d
1519
- **All Rendering Modes**:
1620
- Server-Side Rendering _(SSR)_ with sync, async, and stream [modes](https://docs.solidjs.com/solid-start/reference/server/create-handler)
1721
- Client-Side Rendering _(CSR)_
18-
- Static Site Generation _(SSG)_
22+
- Static Site Generation _(SSG)_ with route [pre-rendering](https://docs.solidjs.com/solid-start/building-your-application/route-prerendering)
1923
- **TypeScript**: Full integration for robust, type-safe development
2024
- **File-Based Routing**: Intuitive routing based on your project’s file structure
2125
- **API Routes**: Dedicated server-side endpoints for seamless API development
@@ -27,35 +31,21 @@ Explore the official [documentation](https://docs.solidjs.com/solid-start) for d
2731

2832
### Installation
2933

30-
Create a template project with your preferred package manager
34+
Create a SolidStart template project with your preferred package manager
3135

3236
```bash
3337
# using npm
34-
npm create solid@latest -- --solidstart
38+
npm create solid@latest -- -s
3539
```
3640

3741
```bash
3842
# using pnpm
39-
pnpm create solid@latest --solidstart
43+
pnpm create solid@latest -s
4044
```
4145

4246
```bash
4347
# using bun
44-
bun create solid@latest --solidstart
45-
```
46-
47-
1. Follow the CLI prompts to set up your project
48-
2. Navigate to your project directory and install the dependencies
49-
50-
```bash
51-
cd <project-name>
52-
npm install # or pnpm install or bun install
53-
```
54-
55-
3. Start the development server
56-
57-
```bash
58-
npm run dev # or pnpm dev or bun dev
48+
bun create solid@latest --s
5949
```
6050

6151
### Project Structure
@@ -68,7 +58,7 @@ npm run dev # or pnpm dev or bun dev
6858
- `entry-server.tsx`: Manages server-side request handling
6959
- **Configuration Files**: `app.config.ts`, `package.json`, and more
7060

71-
Learn more about routing in the [documentation](https://docs.solidjs.com/solid-start/building-your-application/routing).
61+
Learn more about [routing](https://docs.solidjs.com/solid-start/building-your-application/routing)
7262

7363
## Adapters
7464

@@ -79,14 +69,14 @@ import { defineConfig } from "@solidjs/start/config";
7969

8070
export default defineConfig({
8171
ssr: true, // false for client-side rendering only
82-
server: { preset: "vercel" },
72+
server: { preset: "vercel" }
8373
});
8474
```
8575

86-
Presets also include runtimes like Node.js, Bun or Deno. For example, the `node-server` preset enables hosting on your server.
87-
Learn more about [`defineConfig`](https://docs.solidjs.com/solid-start/reference/config/define-config).
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)
8878

89-
## Building for Production
79+
## Building
9080

9181
Generate production-ready bundles
9282

@@ -95,77 +85,3 @@ npm run build # or pnpm build or bun build
9585
```
9686

9787
After the build completes, you’ll be guided through deployment for your specific preset.
98-
99-
## Contributing
100-
101-
Join the SolidJS community and contribute!
102-
103-
- [Discord](https://discord.com/invite/solidjs): Ask for help and discuss ideas
104-
- [Issues](https://github.com/solidjs/solid-start/issues): Report bugs or suggest features
105-
- [Docs Issues](https://github.com/solidjs/solid-docs/issues): Report documentation issues
106-
107-
<details>
108-
<summary><h3>Development Setup</h3></summary>
109-
110-
Use a Node.js version manager compatible with `.node-version`. We recommend [asdf-vm](https://asdf-vm.com/) for macOS and Linux users.
111-
112-
### Monorepo & Package Manager
113-
114-
SolidStart uses `pnpm` as the package manager. Install it globally:
115-
116-
```bash
117-
npm install -g pnpm
118-
```
119-
120-
Install dependencies for the monorepo:
121-
122-
```bash
123-
pnpm install
124-
```
125-
126-
Build the project:
127-
128-
```bash
129-
pnpm build
130-
```
131-
132-
### Monorepo & `package.json` Workspaces
133-
134-
If using a monorepo with `package.json` `"workspaces"` (e.g., [Yarn Workspaces](https://classic.yarnpkg.com/en/docs/workspaces/)), ensure `@solidjs/start` is not hoisted. Add it to the `"nohoist"` field in the workspace root or project root:
135-
136-
**Workspace Root Example**:
137-
138-
```jsonc
139-
{
140-
"workspaces": {
141-
"packages": [
142-
/* ... */
143-
],
144-
"nohoist": ["**/@solidjs/start"]
145-
}
146-
}
147-
```
148-
149-
**Project Root Example**:
150-
151-
```jsonc
152-
{
153-
"workspaces": {
154-
"nohoist": ["@solidjs/start"]
155-
}
156-
}
157-
```
158-
159-
For **Yarn v2+**, use `installConfig` to prevent hoisting:
160-
161-
```jsonc
162-
{
163-
"installConfig": {
164-
"hoistingLimits": "dependencies"
165-
}
166-
}
167-
```
168-
169-
**Note**: Add `@solidjs/start` as a `devDependency` in the child `package.json` to ensure the `/node_modules/@solidjs/start/runtime/entry.jsx` script is available.
170-
171-
</details>

0 commit comments

Comments
 (0)