-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add react-rsbuild-ts template (#2694)
- Loading branch information
Showing
15 changed files
with
2,354 additions
and
0 deletions.
There are no files selected for viewing
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 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 @@ | ||
{ | ||
// These tasks will run in order when initializing your CodeSandbox project. | ||
"setupTasks": [ | ||
{ | ||
"name": "Install Dependencies", | ||
"command": "pnpm install --force" | ||
} | ||
], | ||
|
||
// These tasks can be run from CodeSandbox. Running one will open a log in the app. | ||
"tasks": { | ||
"dev": { | ||
"name": "dev", | ||
"command": "pnpm dev", | ||
"runAtStart": true, | ||
"preview": { | ||
"port": 3000 | ||
} | ||
}, | ||
"build": { | ||
"name": "build", | ||
"command": "pnpm build", | ||
"runAtStart": false | ||
}, | ||
"preview": { | ||
"name": "preview", | ||
"command": "pnpm preview", | ||
"runAtStart": false | ||
}, | ||
"install": { | ||
"name": "install dependencies", | ||
"command": "pnpm install" | ||
} | ||
} | ||
} |
This file contains 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,7 @@ | ||
{ | ||
"title": "React (Rsbuild + TS)", | ||
"description": "React running with Rsbuild, the Rspack-based build tool", | ||
"iconUrl": "https://raw.githubusercontent.com/codesandbox/sandbox-templates/main/react-rsbuild-ts/.codesandbox/icon.png", | ||
"tags": ["frontend", "react", "rsbuild", "javascript", "typescript"], | ||
"published": true | ||
} |
This file contains 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 @@ | ||
{ | ||
"name": "Devcontainer", | ||
"image": "ghcr.io/codesandbox/devcontainers/typescript-node:latest" | ||
} |
This file contains 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 @@ | ||
# Local | ||
.DS_Store | ||
*.local | ||
*.log* | ||
|
||
# Dist | ||
node_modules | ||
dist/ | ||
|
||
# IDE | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea |
This file contains 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,29 @@ | ||
# Rsbuild Project | ||
|
||
## Setup | ||
|
||
Install the dependencies: | ||
|
||
```bash | ||
pnpm install | ||
``` | ||
|
||
## Get Started | ||
|
||
Start the dev server: | ||
|
||
```bash | ||
pnpm dev | ||
``` | ||
|
||
Build the app for production: | ||
|
||
```bash | ||
pnpm build | ||
``` | ||
|
||
Preview the production build locally: | ||
|
||
```bash | ||
pnpm preview | ||
``` |
This file contains 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,31 @@ | ||
import { fixupConfigRules, fixupPluginRules } from '@eslint/compat'; | ||
import js from '@eslint/js'; | ||
import reactHooks from 'eslint-plugin-react-hooks'; | ||
import reactJsx from 'eslint-plugin-react/configs/jsx-runtime.js'; | ||
import react from 'eslint-plugin-react/configs/recommended.js'; | ||
import globals from 'globals'; | ||
import ts from 'typescript-eslint'; | ||
|
||
export default [ | ||
{ languageOptions: { globals: globals.browser } }, | ||
js.configs.recommended, | ||
...ts.configs.recommended, | ||
...fixupConfigRules([ | ||
{ | ||
...react, | ||
settings: { | ||
react: { version: 'detect' }, | ||
}, | ||
}, | ||
reactJsx, | ||
]), | ||
{ | ||
plugins: { | ||
'react-hooks': fixupPluginRules(reactHooks), | ||
}, | ||
rules: { | ||
...reactHooks.configs.recommended.rules, | ||
}, | ||
}, | ||
{ ignores: ['dist/'] }, | ||
]; |
This file contains 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,29 @@ | ||
{ | ||
"name": "react-rsbuild-ts", | ||
"private": true, | ||
"version": "1.0.0", | ||
"scripts": { | ||
"build": "rsbuild build", | ||
"dev": "rsbuild dev --open", | ||
"lint": "eslint .", | ||
"preview": "rsbuild preview" | ||
}, | ||
"dependencies": { | ||
"react": "^18.3.1", | ||
"react-dom": "^18.3.1" | ||
}, | ||
"devDependencies": { | ||
"@eslint/compat": "^1.1.0", | ||
"@eslint/js": "^9.5.0", | ||
"@rsbuild/core": "^0.7.9", | ||
"@rsbuild/plugin-react": "^0.7.9", | ||
"@types/react": "^18.3.3", | ||
"@types/react-dom": "^18.3.0", | ||
"eslint": "^9.5.0", | ||
"eslint-plugin-react": "^7.34.2", | ||
"eslint-plugin-react-hooks": "^4.6.2", | ||
"globals": "^15.4.0", | ||
"typescript": "^5.4.2", | ||
"typescript-eslint": "^7.12.0" | ||
} | ||
} |
Oops, something went wrong.