Skip to content

Commit 15a6e8b

Browse files
committed
experimental add-on-developer
1 parent 65b8fe4 commit 15a6e8b

Some content is hidden

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

59 files changed

+8263
-412
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ my-app
55
.DS_Store
66
**/node_modules
77
**/dist
8+
.vinxi
9+
**/bin-dist
810

911
.vscode
1012

cli/add-on-developer/.cursorrules

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# shadcn instructions
2+
3+
Use the latest version of Shadcn to install new components, like this command to add a button component:
4+
5+
```bash
6+
pnpx shadcn@latest add button
7+
```

cli/add-on-developer/TESTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Run `pnpm build` at the root.
2+
3+
Run `pnpm build:bin` to build the `bin-dist` directory.
4+
5+
In the `examples/mui-add-on` directory run:
6+
7+
```bash
8+
node ../../cli/add-on-developer/bin-dist/bin/add-on-developer.js
9+
```

cli/add-on-developer/app.config.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { defineConfig } from '@tanstack/react-start/config'
2+
import viteTsConfigPaths from 'vite-tsconfig-paths'
3+
import tailwindcss from '@tailwindcss/vite'
4+
5+
export default defineConfig({
6+
tsr: {
7+
appDirectory: 'src',
8+
},
9+
vite: {
10+
forceOptimizeDeps: true,
11+
plugins: [
12+
// this is the plugin that enables path aliases
13+
viteTsConfigPaths({
14+
projects: ['./tsconfig.json'],
15+
}),
16+
tailwindcss(),
17+
],
18+
optimizeDeps: {
19+
exclude: [],
20+
},
21+
},
22+
})
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { dirname, resolve } from 'node:path'
2+
import { fileURLToPath } from 'node:url'
3+
4+
const projectPath = process.cwd()
5+
6+
process.env.PROJECT_PATH = projectPath
7+
8+
const configPath = resolve(
9+
dirname(fileURLToPath(import.meta.url)),
10+
'../../app.config.js',
11+
)
12+
13+
const developerPath = resolve(dirname(fileURLToPath(import.meta.url)), '../..')
14+
15+
process.chdir(developerPath)
16+
17+
import(configPath).then(async (config) => {
18+
const out = await config.default
19+
await out.dev()
20+
})

cli/add-on-developer/components.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "new-york",
4+
"rsc": false,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "",
8+
"css": "src/styles.css",
9+
"baseColor": "zinc",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"aliases": {
14+
"components": "@/components",
15+
"utils": "@/lib/utils",
16+
"ui": "@/components/ui",
17+
"lib": "@/lib",
18+
"hooks": "@/hooks"
19+
},
20+
"iconLibrary": "lucide"
21+
}

cli/add-on-developer/package.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"name": "@tanstack/add-on-developer",
3+
"private": true,
4+
"type": "module",
5+
"bin": {
6+
"add-on-developer": "./dist/add-on-developer.js"
7+
},
8+
"main": "./bin-dist/bin/add-on-developer.js",
9+
"scripts": {
10+
"build:bin": "tsc -p tsconfig.bin.json",
11+
"dev": "vinxi dev"
12+
},
13+
"dependencies": {
14+
"@radix-ui/react-accordion": "^1.2.3",
15+
"@radix-ui/react-dialog": "^1.1.6",
16+
"@radix-ui/react-slot": "^1.1.2",
17+
"@radix-ui/react-tabs": "^1.1.3",
18+
"@tailwindcss/vite": "^4.0.6",
19+
"@tanstack/cta-engine": "workspace:*",
20+
"@tanstack/react-query": "^5.66.5",
21+
"@tanstack/react-query-devtools": "^5.66.5",
22+
"@tanstack/react-router": "^1.114.3",
23+
"@tanstack/react-router-devtools": "^1.114.3",
24+
"@tanstack/react-router-with-query": "^1.114.3",
25+
"@tanstack/react-start": "^1.114.3",
26+
"@tanstack/router-plugin": "^1.114.3",
27+
"class-variance-authority": "^0.7.1",
28+
"clsx": "^2.1.1",
29+
"execa": "^9.5.2",
30+
"lucide-react": "^0.476.0",
31+
"react": "^19.0.0",
32+
"react-dom": "^19.0.0",
33+
"tailwind-merge": "^3.0.2",
34+
"tailwindcss": "^4.0.6",
35+
"tailwindcss-animate": "^1.0.7",
36+
"vinxi": "^0.5.3",
37+
"vite-tsconfig-paths": "^5.1.4"
38+
},
39+
"devDependencies": {
40+
"@testing-library/dom": "^10.4.0",
41+
"@testing-library/react": "^16.2.0",
42+
"@types/node": "^22.13.14",
43+
"@types/react": "^19.0.8",
44+
"@types/react-dom": "^19.0.3",
45+
"@vitejs/plugin-react": "^4.3.4",
46+
"jsdom": "^26.0.0",
47+
"typescript": "^5.7.2",
48+
"vite": "^6.1.0",
49+
"vitest": "^3.0.5",
50+
"web-vitals": "^4.2.4"
51+
}
52+
}
3.78 KB
Binary file not shown.
5.22 KB
Loading
9.44 KB
Loading

0 commit comments

Comments
 (0)