-
Notifications
You must be signed in to change notification settings - Fork 5
Add Bun SolidStart playground #428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+1,521
−2
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
314b0b3
Add bun-solid-start playground to workspace and update pnpm-lock.yaml
yamcodes b2be348
Integrate ArkEnv Vite plugin and enhance environment variable handlin…
yamcodes 393e054
Update apps/playgrounds/bun-solid-start/README.md
yamcodes 879e85e
Update package.json files to specify package manager and adjust depen…
yamcodes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| VITE_TEST=Hello from SolidStart (Production) | ||
| VITE_NUMERIC=3 | ||
| VITE_BOOLEAN=false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| dist | ||
| .wrangler | ||
| .output | ||
| .vercel | ||
| .netlify | ||
| .vinxi | ||
| app.config.timestamp_*.js | ||
|
|
||
| # Environment | ||
| .env | ||
| .env*.local | ||
|
|
||
| # dependencies | ||
| /node_modules | ||
|
|
||
| # IDEs and editors | ||
| /.idea | ||
| .project | ||
| .classpath | ||
| *.launch | ||
| .settings/ | ||
|
|
||
| # Temp | ||
| gitignore | ||
|
|
||
| # System Files | ||
| .DS_Store | ||
| Thumbs.db |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # 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, `bun run build` will generate a Node app that you can run with `bun start`. To use a different preset, add it to the `devDependencies` in `package.json` and specify in your `app.config.ts`. | ||
|
|
||
| ## This project was created with the [Solid CLI](https://github.com/solidjs-community/solid-cli) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import arkenvVitePlugin from "@arkenv/vite-plugin"; | ||
| import { defineConfig } from "@solidjs/start/config"; | ||
| import { type } from "arkenv"; | ||
|
|
||
| export const Env = type({ | ||
| VITE_TEST: "string", | ||
| VITE_NUMERIC: "string.numeric", | ||
| VITE_BOOLEAN: "boolean", | ||
| }); | ||
|
|
||
| export default defineConfig({ | ||
| vite: { | ||
| plugins: [arkenvVitePlugin(Env)], | ||
| }, | ||
| }); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "name": "bun-solid-start-playground", | ||
| "private": true, | ||
| "type": "module", | ||
| "scripts": { | ||
| "dev": "vinxi dev", | ||
| "build": "vinxi build", | ||
| "start": "vinxi start" | ||
| }, | ||
| "dependencies": { | ||
| "@arkenv/vite-plugin": "^0.0.18", | ||
| "@solidjs/start": "^1.1.0", | ||
| "arkenv": "^0.7.6", | ||
| "arktype": "2.1.27", | ||
| "solid-js": "^1.9.5", | ||
| "vinxi": "^0.5.7" | ||
| }, | ||
| "packageManager": "bun@1.3.2" | ||
| } | ||
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| 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; | ||
| } | ||
| } | ||
|
|
||
| .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); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import { createSignal } from "solid-js"; | ||
| import "./app.css"; | ||
|
|
||
| export default function App() { | ||
| const [count, setCount] = createSignal(0); | ||
|
|
||
| return ( | ||
| <main> | ||
| <h1>Hello world!</h1> | ||
| <button | ||
| class="increment" | ||
| onClick={() => setCount(count() + 1)} | ||
| type="button" | ||
| > | ||
| Clicks: {count()} | ||
| </button> | ||
| <p> | ||
| Visit{" "} | ||
| <a | ||
| href="https://start.solidjs.com" | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| > | ||
| start.solidjs.com | ||
| </a>{" "} | ||
| to learn how to build SolidStart apps. | ||
| <br /> | ||
| <br /> | ||
| <code>import.meta.env.VITE_TEST</code>: {import.meta.env.VITE_TEST} (of | ||
| type {typeof import.meta.env.VITE_TEST}) | ||
| <br /> | ||
| <code>import.meta.env.VITE_NUMERIC</code>:{" "} | ||
| {import.meta.env.VITE_NUMERIC} (of type{" "} | ||
| {typeof import.meta.env.VITE_NUMERIC}) | ||
| <br /> | ||
| <code>import.meta.env.VITE_BOOLEAN</code>:{" "} | ||
| {import.meta.env.VITE_BOOLEAN} (of type{" "} | ||
| {typeof import.meta.env.VITE_BOOLEAN}) | ||
| </p> | ||
| </main> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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")!); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> | ||
| )} | ||
| /> | ||
| )); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| /// <reference types="@solidjs/start/env" /> | ||
|
|
||
| type ImportMetaEnvAugmented = | ||
| import("@arkenv/vite-plugin").ImportMetaEnvAugmented< | ||
| typeof import("../app.config").Env | ||
| >; | ||
|
|
||
| // Augment import.meta.env with your schema | ||
| // Only `VITE_*` prefixed variables will be included | ||
| interface ImportMetaEnv extends ImportMetaEnvAugmented {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "target": "ESNext", | ||
| "module": "ESNext", | ||
| "moduleResolution": "bundler", | ||
| "allowSyntheticDefaultImports": true, | ||
| "esModuleInterop": true, | ||
| "jsx": "preserve", | ||
| "jsxImportSource": "solid-js", | ||
| "allowJs": true, | ||
| "strict": true, | ||
| "noEmit": true, | ||
| "types": ["vinxi/types/client"], | ||
| "isolatedModules": true, | ||
| "paths": { | ||
| "~/*": ["./src/*"] | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,5 +18,6 @@ | |
| "devDependencies": { | ||
| "@types/bun": "1.3.2", | ||
| "typescript": "5.9.3" | ||
| } | ||
| }, | ||
| "packageManager": "bun@1.3.2" | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.