Skip to content

Commit d562d14

Browse files
authored
Merge pull request #10 from factman/feature/demos
feat: add demos directory to pnpm workspace configuration
2 parents db6161b + 7f1b5df commit d562d14

49 files changed

Lines changed: 5670 additions & 3037 deletions

Some content is hidden

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

.github/workflows/verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ jobs:
3333
# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
3434
# - run: pnpm exec nx-cloud record -- echo Hello World
3535
# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected
36-
- run: pnpx nx affected -t build && pnpm build
36+
- run: pnpm build:all

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ dist
9393

9494
# Documentations / Demos
9595
demos/out
96+
demos/packages.json
9697

9798
# Gatsby files
9899
.cache/
@@ -170,3 +171,4 @@ tmp
170171
.nx/cache
171172
.nx/workspace-data
172173
.cursor
174+
Icon

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"cSpell.words": [
2020
"arcstack",
2121
"factman",
22+
"webapi",
2223
"webapis"
2324
],
2425
"typescript.tsdk": "node_modules/typescript/lib",
@@ -31,4 +32,4 @@
3132
]
3233
}
3334
]
34-
}
35+
}

demos/.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
packages.json
15+
16+
# Editor directories and files
17+
.vscode/*
18+
!.vscode/extensions.json
19+
.idea
20+
.DS_Store
21+
*.suo
22+
*.ntvs*
23+
*.njsproj
24+
*.sln
25+
*.sw?

demos/README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# React + TypeScript + Vite
2+
3+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4+
5+
Currently, two official plugins are available:
6+
7+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
8+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9+
10+
## React Compiler
11+
12+
The React Compiler is enabled on this template. See [this documentation](https://react.dev/learn/react-compiler) for more information.
13+
14+
Note: This will impact Vite dev & build performances.
15+
16+
## Expanding the ESLint configuration
17+
18+
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
19+
20+
```js
21+
export default defineConfig([
22+
globalIgnores(['dist']),
23+
{
24+
files: ['**/*.{ts,tsx}'],
25+
extends: [
26+
// Other configs...
27+
28+
// Remove tseslint.configs.recommended and replace with this
29+
tseslint.configs.recommendedTypeChecked,
30+
// Alternatively, use this for stricter rules
31+
tseslint.configs.strictTypeChecked,
32+
// Optionally, add this for stylistic rules
33+
tseslint.configs.stylisticTypeChecked,
34+
35+
// Other configs...
36+
],
37+
languageOptions: {
38+
parserOptions: {
39+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
40+
tsconfigRootDir: import.meta.dirname,
41+
},
42+
// other options...
43+
},
44+
},
45+
])
46+
```
47+
48+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
49+
50+
```js
51+
// eslint.config.js
52+
import reactX from 'eslint-plugin-react-x'
53+
import reactDom from 'eslint-plugin-react-dom'
54+
55+
export default defineConfig([
56+
globalIgnores(['dist']),
57+
{
58+
files: ['**/*.{ts,tsx}'],
59+
extends: [
60+
// Other configs...
61+
// Enable lint rules for React
62+
reactX.configs['recommended-typescript'],
63+
// Enable lint rules for React DOM
64+
reactDom.configs.recommended,
65+
],
66+
languageOptions: {
67+
parserOptions: {
68+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
69+
tsconfigRootDir: import.meta.dirname,
70+
},
71+
// other options...
72+
},
73+
},
74+
])
75+
```

demos/eslint.config.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import reactHooks from 'eslint-plugin-react-hooks'
4+
import reactRefresh from 'eslint-plugin-react-refresh'
5+
import tseslint from 'typescript-eslint'
6+
import { defineConfig, globalIgnores } from 'eslint/config'
7+
8+
export default defineConfig([
9+
globalIgnores(['dist']),
10+
{
11+
files: ['**/*.{ts,tsx}'],
12+
extends: [
13+
js.configs.recommended,
14+
tseslint.configs.recommended,
15+
reactHooks.configs.flat.recommended,
16+
reactRefresh.configs.vite,
17+
],
18+
languageOptions: {
19+
ecmaVersion: 2020,
20+
globals: globals.browser,
21+
},
22+
},
23+
])

demos/index.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!doctype html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8" />
6+
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
7+
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
8+
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
9+
<link rel="manifest" href="/site.webmanifest">
10+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
11+
<title>Web APIs Demo - @ArcStackLab</title>
12+
<script>
13+
navigator.registerProtocolHandler('web+api', `./?source=PWA&ref=%s`)
14+
</script>
15+
</head>
16+
17+
<body>
18+
<div id="root"></div>
19+
<script type="module" src="/src/main.tsx"></script>
20+
</body>
21+
22+
</html>

demos/package.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "@arcstack/demos",
3+
"private": true,
4+
"version": "0.0.1",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "tsc -b && vite build",
9+
"lint": "eslint .",
10+
"preview": "vite preview"
11+
},
12+
"dependencies": {
13+
"@headlessui/react": "^2.2.9",
14+
"@tailwindcss/vite": "^4.1.18",
15+
"clsx": "^2.1.1",
16+
"react": "^19.2.0",
17+
"react-dom": "^19.2.0",
18+
"tailwindcss": "^4.1.18"
19+
},
20+
"devDependencies": {
21+
"@eslint/js": "^9.39.1",
22+
"@types/node": "^24.10.1",
23+
"@types/react": "^19.2.5",
24+
"@types/react-dom": "^19.2.3",
25+
"@vitejs/plugin-react": "^5.1.1",
26+
"babel-plugin-react-compiler": "^1.0.0",
27+
"eslint": "^9.39.1",
28+
"eslint-plugin-react-hooks": "^7.0.1",
29+
"eslint-plugin-react-refresh": "^0.4.24",
30+
"globals": "^16.5.0",
31+
"typescript": "~5.9.3",
32+
"typescript-eslint": "^8.46.4",
33+
"vite": "^7.2.4"
34+
}
35+
}
67 KB
Loading
338 KB
Loading

0 commit comments

Comments
 (0)