-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
feat(create-vite): add solidjs templates (#12218) #12241
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
Merged
Changes from 38 commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
a5da63b
feat(create-vite): add solid javascript template
AbdelrahmanDwedar 62da498
feat(create-vite): add solid typescript template
AbdelrahmanDwedar f07f788
feat(create-vite): add the solid framework to frameworks list
AbdelrahmanDwedar b925aff
fix(solid template): start following the style of vite projects
AbdelrahmanDwedar a0f9415
fix(solid templates): add "template" to the name of the directory
AbdelrahmanDwedar 1fa253a
fix(solid template): add the recommanded gitignore files
AbdelrahmanDwedar e0bfd1e
fix(solid template): rename template-solid-js to template-solid
AbdelrahmanDwedar 2db8466
fix(solid template): add the recommanded html template
AbdelrahmanDwedar fde969a
fix(solid template): add the recommanded package.json
AbdelrahmanDwedar 72ed3c5
fix(solid template): fixed code error in template
AbdelrahmanDwedar 38dde55
fix(solid template): fixed a typo
AbdelrahmanDwedar 2746535
fix(solid template): Removed unneeded configurations
AbdelrahmanDwedar 6b20f18
Merge branch 'vitejs:main' into solidjs-template
AbdelrahmanDwedar ffd9a0a
Merge branch 'vitejs:main' into solidjs-template
AbdelrahmanDwedar f4ed87c
update the version of the packages
AbdelrahmanDwedar 3e64960
docs: add the docs for solid template
AbdelrahmanDwedar f19cc1e
docs: fix format
AbdelrahmanDwedar aa1a689
Merge branch 'vitejs:main' into solidjs-template
AbdelrahmanDwedar 4d42420
fix: fixed typo in readme
AbdelrahmanDwedar 2fa4c45
fix(docs): fix docs issues
AbdelrahmanDwedar 93a36db
fix(home): fixed the css import and the logo alt
AbdelrahmanDwedar 15053d9
fix: removed jsconfig
AbdelrahmanDwedar e1ea34c
fix(tsconfig): update to the new format to match the other templates
AbdelrahmanDwedar 8b15600
fix(docs): add the right command for dev environment
AbdelrahmanDwedar 3d399c8
fix(docs): use the right extension in the file name
AbdelrahmanDwedar 58f450f
fix: use normal css files instead of modules
AbdelrahmanDwedar 4a4695d
fix(docs): add the right command for dev environment
AbdelrahmanDwedar 9092306
fix: fix all the left issues
AbdelrahmanDwedar 2986219
Merge branch 'vitejs:main' into solidjs-template
AbdelrahmanDwedar ffad51c
fix: remove unneeded error throw
AbdelrahmanDwedar 9b6b80e
fix: use the index.{t,j}sx file instead of main.{t,j}sx
AbdelrahmanDwedar 8526721
fix: use the preserve option for the jsx
AbdelrahmanDwedar c1219f6
fix: use the right function for the signal
AbdelrahmanDwedar adcea94
Merge branch 'vitejs:main' into solidjs-template
AbdelrahmanDwedar 1a5a95c
Merge branch 'vitejs:main' into solidjs-template
AbdelrahmanDwedar baa8f50
fix: put typescript first
AbdelrahmanDwedar fcba8e2
fix: remove unneeded class
AbdelrahmanDwedar 3721cd8
fix(docs): add docs for deployment
AbdelrahmanDwedar c105f5d
fix: remove the spinning logo
AbdelrahmanDwedar e97dc9b
fix: add the vite-env.d.ts
AbdelrahmanDwedar 8becd94
Merge branch 'vitejs:main' into solidjs-template
AbdelrahmanDwedar 97529eb
Merge branch 'vitejs:main' into solidjs-template
AbdelrahmanDwedar 1f79326
fix: add jsxImportSource
AbdelrahmanDwedar 909c6e2
Merge branch 'vitejs:main' into solidjs-template
AbdelrahmanDwedar c6af16a
Merge branch 'vitejs:main' into solidjs-template
AbdelrahmanDwedar dff6293
Merge branch 'vitejs:main' into solidjs-template
AbdelrahmanDwedar c08ea56
Apply updates from React template
ArnaudBarre be17e47
chore: flip dev and devdep
bluwy 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
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,28 @@ | ||
| ## Usage | ||
|
|
||
| ```bash | ||
| $ npm install # or pnpm install or yarn install | ||
| ``` | ||
|
|
||
| ### Learn more on the [Solid Website](https://solidjs.com) and come chat with us on our [Discord](https://discord.com/invite/solidjs) | ||
|
|
||
| ## Available Scripts | ||
|
|
||
| In the project directory, you can run: | ||
|
|
||
| ### `npm run dev` | ||
|
|
||
| Runs the app in the development mode.<br> | ||
| Open [http://localhost:5173](http://localhost:5173) to view it in the browser. | ||
|
|
||
| ### `npm run build` | ||
|
|
||
| Builds the app for production to the `dist` folder.<br> | ||
| It correctly bundles Solid in production mode and optimizes the build for the best performance. | ||
|
|
||
| The build is minified and the filenames include the hashes.<br> | ||
| Your app is ready to be deployed! | ||
|
|
||
| ## Deployment | ||
|
|
||
| Learn more about deploying your application with the [documentations](https://vitejs.dev/guide/static-deploy.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,24 @@ | ||
| # Logs | ||
| logs | ||
| *.log | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| pnpm-debug.log* | ||
| lerna-debug.log* | ||
|
|
||
| node_modules | ||
| dist | ||
| dist-ssr | ||
| *.local | ||
|
|
||
| # Editor directories and files | ||
| .vscode/* | ||
| !.vscode/extensions.json | ||
| .idea | ||
| .DS_Store | ||
| *.suo | ||
| *.ntvs* | ||
| *.njsproj | ||
| *.sln | ||
| *.sw? |
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,13 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Vite + Solid + TS</title> | ||
| </head> | ||
| <body> | ||
| <div id="root"></div> | ||
| <script type="module" src="/src/index.tsx"></script> | ||
| </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,19 @@ | ||
| { | ||
| "name": "vite-solid-typescript-starter", | ||
| "private": true, | ||
| "version": "0.0.0", | ||
| "type": "module", | ||
| "scripts": { | ||
| "dev": "vite", | ||
| "build": "tsc && vite build", | ||
| "preview": "vite preview" | ||
| }, | ||
| "devDependencies": { | ||
| "typescript": "^5.0.3", | ||
| "vite": "^4.2.1", | ||
| "vite-plugin-solid": "^2.6.1" | ||
| }, | ||
| "dependencies": { | ||
| "solid-js": "^1.7.1" | ||
| } | ||
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
| #root { | ||
| max-width: 1280px; | ||
| margin: 0 auto; | ||
| padding: 2rem; | ||
| text-align: center; | ||
| } | ||
|
|
||
| .logo { | ||
| height: 6em; | ||
| padding: 1.5em; | ||
| will-change: filter; | ||
| transition: filter 300ms; | ||
| } | ||
| .logo:hover { | ||
| filter: drop-shadow(0 0 2em #646cffaa); | ||
| } | ||
| .logo.solid:hover { | ||
| filter: drop-shadow(0 0 2em #61dafbaa); | ||
| } | ||
|
|
||
| @keyframes logo-spin { | ||
| from { | ||
| transform: rotate(0deg); | ||
| } | ||
| to { | ||
| transform: rotate(360deg); | ||
| } | ||
| } | ||
|
|
||
| @media (prefers-reduced-motion: no-preference) { | ||
| a:nth-of-type(2) .logo { | ||
| animation: logo-spin infinite 20s linear; | ||
| } | ||
| } | ||
|
|
||
| .card { | ||
| padding: 2em; | ||
| } | ||
|
|
||
| .read-the-docs { | ||
| color: #888; | ||
| } |
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,35 @@ | ||
| import { createSignal } from 'solid-js' | ||
| import solidLogo from './assets/solid.svg' | ||
| import viteLogo from '/vite.svg' | ||
| import './App.css' | ||
|
|
||
| function App() { | ||
| const [count, setCount] = createSignal(0) | ||
|
|
||
| return ( | ||
| <div> | ||
| <div> | ||
| <a href="https://vitejs.dev" target="_blank"> | ||
| <img src={viteLogo} class="logo" alt="Vite logo" /> | ||
| </a> | ||
| <a href="https://solidjs.com" target="_blank"> | ||
| <img src={solidLogo} class="logo solid" alt="Solid logo" /> | ||
| </a> | ||
| </div> | ||
| <h1>Vite + Solid</h1> | ||
| <div class="card"> | ||
| <button onClick={() => setCount((count) => count + 1)}> | ||
| count is {count()} | ||
| </button> | ||
| <p> | ||
| Edit <code>src/App.tsx</code> and save to test HMR | ||
| </p> | ||
| </div> | ||
| <p class="read-the-docs"> | ||
| Click on the Vite and Solid logos to learn more | ||
| </p> | ||
| </div> | ||
| ) | ||
| } | ||
|
|
||
| export default App |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,69 @@ | ||
| :root { | ||
| font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; | ||
| line-height: 1.5; | ||
| font-weight: 400; | ||
|
|
||
| color-scheme: light dark; | ||
| color: rgba(255, 255, 255, 0.87); | ||
| background-color: #242424; | ||
|
|
||
| font-synthesis: none; | ||
| text-rendering: optimizeLegibility; | ||
| -webkit-font-smoothing: antialiased; | ||
| -moz-osx-font-smoothing: grayscale; | ||
| -webkit-text-size-adjust: 100%; | ||
| } | ||
|
|
||
| a { | ||
| font-weight: 500; | ||
| color: #646cff; | ||
| text-decoration: inherit; | ||
| } | ||
| a:hover { | ||
| color: #535bf2; | ||
| } | ||
|
|
||
| body { | ||
| margin: 0; | ||
| display: flex; | ||
| place-items: center; | ||
| min-width: 320px; | ||
| min-height: 100vh; | ||
| } | ||
|
|
||
| h1 { | ||
| font-size: 3.2em; | ||
| line-height: 1.1; | ||
| } | ||
|
|
||
| button { | ||
| border-radius: 8px; | ||
| border: 1px solid transparent; | ||
| padding: 0.6em 1.2em; | ||
| font-size: 1em; | ||
| font-weight: 500; | ||
| font-family: inherit; | ||
| background-color: #1a1a1a; | ||
| cursor: pointer; | ||
| transition: border-color 0.25s; | ||
| } | ||
| button:hover { | ||
| border-color: #646cff; | ||
| } | ||
| button:focus, | ||
| button:focus-visible { | ||
| outline: 4px auto -webkit-focus-ring-color; | ||
| } | ||
|
|
||
| @media (prefers-color-scheme: light) { | ||
| :root { | ||
| color: #213547; | ||
| background-color: #ffffff; | ||
| } | ||
| a:hover { | ||
| color: #747bff; | ||
| } | ||
| button { | ||
| background-color: #f9f9f9; | ||
| } | ||
| } |
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,9 @@ | ||
| /* @refresh reload */ | ||
| import { render } from 'solid-js/web' | ||
|
|
||
| import './index.css' | ||
| import App from './App' | ||
|
|
||
| const root = document.getElementById('root') | ||
|
|
||
| render(() => <App />, root!) | ||
|
AbdelrahmanDwedar marked this conversation as resolved.
|
||
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,24 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "target": "ESNext", | ||
| "lib": ["DOM", "DOM.Iterable", "ESNext"], | ||
| "module": "ESNext", | ||
| "skipLibCheck": true, | ||
|
|
||
| /* Bundler mode */ | ||
| "moduleResolution": "bundler", | ||
| "allowImportingTsExtensions": true, | ||
| "resolveJsonModule": true, | ||
| "isolatedModules": true, | ||
| "noEmit": true, | ||
| "jsx": "preserve", | ||
|
|
||
| /* Linting */ | ||
| "strict": true, | ||
| "noUnusedLocals": true, | ||
| "noUnusedParameters": true, | ||
| "noFallthroughCasesInSwitch": true | ||
| }, | ||
| "include": ["src"], | ||
| "references": [{ "path": "./tsconfig.node.json" }] | ||
| } |
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 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "composite": true, | ||
| "skipLibCheck": true, | ||
| "module": "ESNext", | ||
| "moduleResolution": "bundler", | ||
| "allowSyntheticDefaultImports": true | ||
| }, | ||
| "include": ["vite.config.ts"] | ||
| } |
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,6 @@ | ||
| import { defineConfig } from 'vite' | ||
| import solid from 'vite-plugin-solid' | ||
|
|
||
| export default defineConfig({ | ||
| plugins: [solid()], | ||
| }) |
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 @@ | ||
| ## Usage | ||
|
|
||
| ```bash | ||
| $ npm install # or pnpm install or yarn install | ||
| ``` | ||
|
|
||
| ### Learn more on the [Solid Website](https://solidjs.com) and come chat with us on our [Discord](https://discord.com/invite/solidjs) | ||
|
|
||
| ## Available Scripts | ||
|
|
||
| In the project directory, you can run: | ||
|
|
||
| ### `npm run dev` | ||
|
|
||
| Runs the app in the development mode.<br> | ||
| Open [http://localhost:5173](http://localhost:5173) to view it in the browser. | ||
|
|
||
| ### `npm run build` | ||
|
|
||
| Builds the app for production to the `dist` folder.<br> | ||
| It correctly bundles Solid in production mode and optimizes the build for the best performance. | ||
|
|
||
| The build is minified and the filenames include the hashes.<br> | ||
| Your app is ready to be deployed! | ||
|
|
||
| ## Deployment | ||
|
|
||
| Learn more about deploying your application with the [documentations](https://vitejs.dev/guide/static-deploy.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,24 @@ | ||
| # Logs | ||
| logs | ||
| *.log | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| pnpm-debug.log* | ||
| lerna-debug.log* | ||
|
|
||
| node_modules | ||
| dist | ||
| dist-ssr | ||
| *.local | ||
|
|
||
| # Editor directories and files | ||
| .vscode/* | ||
| !.vscode/extensions.json | ||
| .idea | ||
| .DS_Store | ||
| *.suo | ||
| *.ntvs* | ||
| *.njsproj | ||
| *.sln | ||
| *.sw? |
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.