Skip to content

Commit 22c99a7

Browse files
[feat] Add SolidStart plugin support (#150)
1 parent 42bf08e commit 22c99a7

Some content is hidden

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

58 files changed

+10528
-11890
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@codecov/solidstart-plugin": patch
3+
---
4+
5+
Add support for SolidStart through new plugin

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const config = {
3030
"./packages/nuxt-plugin/tsconfig.json",
3131
"./packages/remix-vite-plugin/tsconfig.json",
3232
"./packages/rollup-plugin/tsconfig.json",
33+
"./packages/solidstart-plugin/tsconfig.json",
3334
"./packages/sveltekit-plugin/tsconfig.json",
3435
"./packages/vite-plugin/tsconfig.json",
3536
"./packages/webpack-plugin/tsconfig.json",

.github/workflows/ci.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ jobs:
280280
fail-fast: false
281281
matrix:
282282
example:
283-
["next-js", "nuxt", "remix", "rollup", "sveltekit", "vite", "webpack"]
283+
["next-js", "nuxt", "remix", "rollup", "sveltekit", "vite", "webpack", "solidstart"]
284284
steps:
285285
- name: Checkout
286286
uses: actions/checkout@v4
@@ -336,6 +336,8 @@ jobs:
336336
REMIX_API_URL: ${{ secrets.CODECOV_API_URL }}
337337
ROLLUP_UPLOAD_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }}
338338
ROLLUP_API_URL: ${{ secrets.CODECOV_API_URL }}
339+
SOLIDSTART_UPLOAD_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }}
340+
SOLIDSTART_API_URL: ${{ secrets.CODECOV_API_URL }}
339341
SVELTEKIT_UPLOAD_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }}
340342
SVELTEKIT_API_URL: ${{ secrets.CODECOV_API_URL }}
341343
VITE_UPLOAD_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }}
@@ -352,7 +354,7 @@ jobs:
352354
fail-fast: false
353355
matrix:
354356
example:
355-
["next-js", "nuxt", "remix", "rollup", "sveltekit", "vite", "webpack"]
357+
["next-js", "nuxt", "remix", "rollup", "sveltekit", "vite", "webpack", "solidstart"]
356358
steps:
357359
- name: Checkout
358360
uses: actions/checkout@v4
@@ -408,6 +410,8 @@ jobs:
408410
REMIX_API_URL: ${{ secrets.CODECOV_API_URL }}
409411
ROLLUP_UPLOAD_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN_STAGING }}
410412
ROLLUP_API_URL: ${{ secrets.CODECOV_STAGING_API_URL }}
413+
SOLIDSTART_UPLOAD_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }}
414+
SOLIDSTART_API_URL: ${{ secrets.CODECOV_API_URL }}
411415
SVELTEKIT_UPLOAD_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }}
412416
SVELTEKIT_API_URL: ${{ secrets.CODECOV_API_URL }}
413417
VITE_UPLOAD_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN_STAGING }}
@@ -432,6 +436,7 @@ jobs:
432436
"sveltekit-plugin",
433437
"vite-plugin",
434438
"webpack-plugin",
439+
"solidstart-plugin",
435440
]
436441
steps:
437442
- name: Checkout
@@ -498,6 +503,7 @@ jobs:
498503
"sveltekit-plugin",
499504
"vite-plugin",
500505
"webpack-plugin",
506+
"solidstart-plugin",
501507
]
502508
steps:
503509
- name: Checkout

examples/solidstart/.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
dist
3+
.solid
4+
.output
5+
.vercel
6+
.netlify
7+
.vinxi
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/solidstart/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);
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)

examples/solidstart/app.config.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { defineConfig } from "@solidjs/start/config";
2+
import solidPlugin from "vite-plugin-solid";
3+
import { codecovSolidStartPlugin } from "@codecov/solidstart-plugin";
4+
5+
export default defineConfig({
6+
vite: {
7+
plugins: [
8+
solidPlugin(),
9+
codecovSolidStartPlugin({
10+
enableBundleAnalysis: true,
11+
bundleName: "@codecov/example-solidstart-app",
12+
uploadToken: process.env.SOLIDSTART_UPLOAD_TOKEN,
13+
apiUrl: process.env.SOLIDSTART_API_URL,
14+
debug: true,
15+
}) as any,
16+
],
17+
},
18+
});

examples/solidstart/package.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "@codecov/example-solidstart-app",
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+
"@codecov/solidstart-plugin": "workspace:^",
12+
"@solidjs/meta": "^0.29.4",
13+
"@solidjs/router": "^0.14.1",
14+
"@solidjs/start": "^1.0.6",
15+
"solid-js": "^1.8.18",
16+
"vinxi": "^0.4.1",
17+
"vite-plugin-solid": "^2.10.2"
18+
},
19+
"engines": {
20+
"node": ">=18"
21+
}
22+
}
664 Bytes
Binary file not shown.

examples/solidstart/src/app.css

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
body {
2+
font-family: Gordita, Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans",
3+
"Helvetica Neue", sans-serif;
4+
}
5+
6+
a {
7+
margin-right: 1rem;
8+
}
9+
10+
main {
11+
text-align: center;
12+
padding: 1em;
13+
margin: 0 auto;
14+
}
15+
16+
h1 {
17+
color: #335d92;
18+
text-transform: uppercase;
19+
font-size: 4rem;
20+
font-weight: 100;
21+
line-height: 1.1;
22+
margin: 4rem auto;
23+
max-width: 14rem;
24+
}
25+
26+
p {
27+
max-width: 14rem;
28+
margin: 2rem auto;
29+
line-height: 1.35;
30+
}
31+
32+
@media (min-width: 480px) {
33+
h1 {
34+
max-width: none;
35+
}
36+
37+
p {
38+
max-width: none;
39+
}
40+
}

examples/solidstart/src/app.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { MetaProvider, Title } from "@solidjs/meta";
2+
import { Router } from "@solidjs/router";
3+
import { FileRoutes } from "@solidjs/start/router";
4+
import { Suspense } from "solid-js";
5+
import "./app.css";
6+
7+
export default function App() {
8+
return (
9+
<Router
10+
root={(props) => (
11+
<MetaProvider>
12+
<Title>SolidStart - Basic</Title>
13+
<a href="/">Index</a>
14+
<a href="/about">About</a>
15+
<Suspense>{props.children}</Suspense>
16+
</MetaProvider>
17+
)}
18+
>
19+
<FileRoutes />
20+
</Router>
21+
);
22+
}

0 commit comments

Comments
 (0)