create-teamix-evo 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +75 -0
  3. package/dist/index.js +586 -0
  4. package/dist/index.js.map +1 -0
  5. package/overlays/console/package.json.fragment.json +5 -0
  6. package/overlays/console/src/App.tsx +6 -0
  7. package/overlays/console/src/components/_placeholder/Card.tsx +40 -0
  8. package/overlays/console/src/components/_placeholder/Form.tsx +52 -0
  9. package/overlays/console/src/components/_placeholder/Input.tsx +35 -0
  10. package/overlays/console/src/components/_placeholder/README.md +42 -0
  11. package/overlays/console/src/components/_placeholder/Table.tsx +77 -0
  12. package/overlays/console/src/layouts/ConsoleLayout.tsx +46 -0
  13. package/overlays/console/src/lib/mock-data.ts +38 -0
  14. package/overlays/console/src/main.tsx +13 -0
  15. package/overlays/console/src/pages/DashboardPage.tsx +38 -0
  16. package/overlays/console/src/pages/UserDetailPage.tsx +57 -0
  17. package/overlays/console/src/pages/UserFormPage.tsx +61 -0
  18. package/overlays/console/src/pages/UserListPage.tsx +67 -0
  19. package/overlays/console/src/routes.tsx +21 -0
  20. package/package.json +38 -0
  21. package/templates/react-ts/README.md.hbs +39 -0
  22. package/templates/react-ts/_editorconfig +9 -0
  23. package/templates/react-ts/_gitignore +24 -0
  24. package/templates/react-ts/index.html.hbs +12 -0
  25. package/templates/react-ts/package.json.hbs +26 -0
  26. package/templates/react-ts/src/App.tsx +20 -0
  27. package/templates/react-ts/src/index.css +5 -0
  28. package/templates/react-ts/src/main.tsx +10 -0
  29. package/templates/react-ts/src/vite-env.d.ts +1 -0
  30. package/templates/react-ts/tailwind.config.ts +13 -0
  31. package/templates/react-ts/tsconfig.json +29 -0
  32. package/templates/react-ts/vite.config.ts +14 -0
@@ -0,0 +1,67 @@
1
+ import { useState } from 'react';
2
+ import { Link } from 'react-router-dom';
3
+ import { Card } from '@/components/_placeholder/Card';
4
+ import { Input } from '@/components/_placeholder/Input';
5
+ import { Table } from '@/components/_placeholder/Table';
6
+ import { Button } from '@/components/ui/button';
7
+ import { mockUsers } from '@/lib/mock-data';
8
+
9
+ export function UserListPage() {
10
+ const [keyword, setKeyword] = useState('');
11
+ const filtered = mockUsers.filter((u) =>
12
+ `${u.name}${u.email}`.toLowerCase().includes(keyword.toLowerCase()),
13
+ );
14
+
15
+ return (
16
+ <div className="space-y-6">
17
+ <div className="flex items-center justify-between">
18
+ <div>
19
+ <h2 className="text-2xl font-semibold tracking-tight">用户管理</h2>
20
+ <p className="text-sm text-muted-foreground mt-1">
21
+ 列表 + 搜索 — 演示 Table / Input 占位组件 与真 Button。
22
+ </p>
23
+ </div>
24
+ <Link to="/users/new">
25
+ <Button>新建用户</Button>
26
+ </Link>
27
+ </div>
28
+
29
+ <Card>
30
+ <div className="flex items-center gap-3 mb-4">
31
+ <Input
32
+ placeholder="搜索姓名 / 邮箱"
33
+ value={keyword}
34
+ onChange={(e) => setKeyword(e.target.value)}
35
+ className="max-w-sm"
36
+ />
37
+ </div>
38
+ <Table
39
+ columns={[
40
+ { key: 'name', title: '姓名' },
41
+ { key: 'email', title: '邮箱' },
42
+ { key: 'role', title: '角色' },
43
+ {
44
+ key: 'actions',
45
+ title: '操作',
46
+ render: (row) => (
47
+ <div className="flex gap-2">
48
+ <Link to={`/users/${row.id}`}>
49
+ <Button variant="ghost" size="sm">
50
+ 详情
51
+ </Button>
52
+ </Link>
53
+ <Link to={`/users/${row.id}/edit`}>
54
+ <Button variant="outline" size="sm">
55
+ 编辑
56
+ </Button>
57
+ </Link>
58
+ </div>
59
+ ),
60
+ },
61
+ ]}
62
+ data={filtered}
63
+ />
64
+ </Card>
65
+ </div>
66
+ );
67
+ }
@@ -0,0 +1,21 @@
1
+ import { Navigate, type RouteObject } from 'react-router-dom';
2
+ import { ConsoleLayout } from '@/layouts/ConsoleLayout';
3
+ import { DashboardPage } from '@/pages/DashboardPage';
4
+ import { UserListPage } from '@/pages/UserListPage';
5
+ import { UserDetailPage } from '@/pages/UserDetailPage';
6
+ import { UserFormPage } from '@/pages/UserFormPage';
7
+
8
+ export const routes: RouteObject[] = [
9
+ {
10
+ path: '/',
11
+ element: <ConsoleLayout />,
12
+ children: [
13
+ { index: true, element: <Navigate to="/dashboard" replace /> },
14
+ { path: 'dashboard', element: <DashboardPage /> },
15
+ { path: 'users', element: <UserListPage /> },
16
+ { path: 'users/new', element: <UserFormPage /> },
17
+ { path: 'users/:id', element: <UserDetailPage /> },
18
+ { path: 'users/:id/edit', element: <UserFormPage /> },
19
+ ],
20
+ },
21
+ ];
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "create-teamix-evo",
3
+ "version": "0.1.1",
4
+ "description": "Scaffold a Vite + React + TypeScript project pre-wired with Teamix Evo design tokens, AI skills, and UI components.",
5
+ "type": "module",
6
+ "bin": {
7
+ "create-teamix-evo": "./dist/index.js"
8
+ },
9
+ "files": [
10
+ "dist",
11
+ "templates",
12
+ "overlays"
13
+ ],
14
+ "dependencies": {
15
+ "@clack/prompts": "^0.8.0",
16
+ "commander": "^12.0.0",
17
+ "cross-spawn": "^7.0.3",
18
+ "execa": "^9.0.0",
19
+ "handlebars": "^4.7.0",
20
+ "kolorist": "^1.8.0",
21
+ "teamix-evo": "0.2.0"
22
+ },
23
+ "devDependencies": {
24
+ "@types/cross-spawn": "^6.0.6",
25
+ "@types/node": "^20.0.0",
26
+ "tsup": "^8.0.0",
27
+ "typescript": "^5.5.0",
28
+ "vitest": "^2.0.0"
29
+ },
30
+ "scripts": {
31
+ "build": "tsup",
32
+ "dev": "tsup --watch",
33
+ "test": "vitest run",
34
+ "test:watch": "vitest",
35
+ "typecheck": "tsc --noEmit",
36
+ "lint": "tsc --noEmit"
37
+ }
38
+ }
@@ -0,0 +1,39 @@
1
+ # {{projectName}}
2
+
3
+ 由 [`create-teamix-evo`](https://www.npmjs.com/package/create-teamix-evo) 脚手架生成 — 已经接通 design tokens、AI skills 与 UI 资产。
4
+
5
+ ## 快速开始
6
+
7
+ ```bash
8
+ {{pmInstall}} # 安装依赖(如脚手架已自动跑过可跳过)
9
+ {{pmRun}} dev # 启动开发服务器
10
+ {{pmRun}} build # 生产构建
11
+ ```
12
+
13
+ ## 已安装资产
14
+
15
+ - **设计 tokens**:`.teamix-evo/design/tokens/`(variant: `{{designVariant}}`)
16
+ - **AI 入口**:`AGENTS.md`(项目级)/ `.qoder/agents/` / `.claude/agents/`
17
+ - **UI 组件**:`src/components/ui/`(已落地:`{{uiInstalled}}`)
18
+
19
+ ## 更新设计资产
20
+
21
+ ```bash
22
+ # 重新拉取最新 design tokens(覆盖 regenerable,保留 frozen)
23
+ npx teamix-evo design update {{designVariant}}
24
+
25
+ # 同步 AI skills 文件
26
+ npx teamix-evo skills update
27
+
28
+ # 安装更多 UI 组件
29
+ npx teamix-evo ui add <component-id>
30
+ npx teamix-evo ui list
31
+ ```
32
+
33
+ ## 自定义 token
34
+
35
+ `.teamix-evo/design/tokens/tokens.overrides.css` 是 **frozen** 资源 — 在这里覆盖任何 `--color-primary` 等 CSS 变量后,刷新即可生效,CLI 升级不会覆盖你的改动。
36
+
37
+ ## AI 协作
38
+
39
+ 打开本项目时,AI 助手会自动读取 `AGENTS.md` / `CLAUDE.md` 与 `.teamix-evo/design/` 下的设计上下文 — 直接告诉它"帮我加一个用户列表页"即可。
@@ -0,0 +1,9 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ end_of_line = lf
6
+ indent_style = space
7
+ indent_size = 2
8
+ insert_final_newline = true
9
+ trim_trailing_whitespace = true
@@ -0,0 +1,24 @@
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
+
15
+ # Editor directories and files
16
+ .vscode/*
17
+ !.vscode/extensions.json
18
+ .idea
19
+ .DS_Store
20
+ *.suo
21
+ *.ntvs*
22
+ *.njsproj
23
+ *.sln
24
+ *.sw?
@@ -0,0 +1,12 @@
1
+ <!doctype html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>{{projectName}}</title>
7
+ </head>
8
+ <body>
9
+ <div id="root"></div>
10
+ <script type="module" src="/src/main.tsx"></script>
11
+ </body>
12
+ </html>
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "{{projectName}}",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "tsc -b && vite build",
9
+ "preview": "vite preview",
10
+ "typecheck": "tsc --noEmit"
11
+ },
12
+ "dependencies": {
13
+ "react": "^18.3.1",
14
+ "react-dom": "^18.3.1"
15
+ },
16
+ "devDependencies": {
17
+ "@tailwindcss/vite": "^4.0.0",
18
+ "@types/node": "^20.0.0",
19
+ "@types/react": "^18.3.0",
20
+ "@types/react-dom": "^18.3.0",
21
+ "@vitejs/plugin-react": "^4.3.0",
22
+ "tailwindcss": "^4.0.0",
23
+ "typescript": "^5.5.0",
24
+ "vite": "^5.4.0"
25
+ }
26
+ }
@@ -0,0 +1,20 @@
1
+ export default function App() {
2
+ return (
3
+ <main className="min-h-screen flex flex-col items-center justify-center gap-6 bg-background text-foreground">
4
+ <h1 className="text-4xl font-bold">Welcome to Teamix Evo</h1>
5
+ <p className="text-muted-foreground max-w-md text-center">
6
+ 设计 tokens 已就位 — 修改{' '}
7
+ <code className="px-1 py-0.5 rounded bg-muted">
8
+ .teamix-evo/design/tokens/tokens.overrides.css
9
+ </code>{' '}
10
+ 试试热更新。
11
+ </p>
12
+ <button
13
+ type="button"
14
+ className="px-4 py-2 rounded-md bg-primary text-primary-foreground hover:opacity-90 transition"
15
+ >
16
+ Primary Button (token 通路验证)
17
+ </button>
18
+ </main>
19
+ );
20
+ }
@@ -0,0 +1,5 @@
1
+ @import 'tailwindcss';
2
+
3
+ /* Teamix Evo design tokens — 由 `teamix-evo design init` 装载到 .teamix-evo/design/tokens/ */
4
+ @import '../.teamix-evo/design/tokens/tokens.theme.css';
5
+ @import '../.teamix-evo/design/tokens/tokens.overrides.css';
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom/client';
3
+ import App from '@/App';
4
+ import '@/index.css';
5
+
6
+ ReactDOM.createRoot(document.getElementById('root')!).render(
7
+ <React.StrictMode>
8
+ <App />
9
+ </React.StrictMode>,
10
+ );
@@ -0,0 +1 @@
1
+ /// <reference types="vite/client" />
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Tailwind CSS v4 — zero-config by default.
3
+ *
4
+ * 推荐通过 src/index.css 中的 @theme 块声明设计变量;
5
+ * 本文件仅在你需要扩展 content scan 路径或注册自定义插件时启用。
6
+ *
7
+ * 详见 https://tailwindcss.com/docs/v4-beta
8
+ */
9
+ import type { Config } from 'tailwindcss';
10
+
11
+ export default {
12
+ content: ['./index.html', './src/**/*.{ts,tsx}'],
13
+ } satisfies Config;
@@ -0,0 +1,29 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "useDefineForClassFields": true,
5
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
6
+ "module": "ESNext",
7
+ "skipLibCheck": true,
8
+
9
+ "moduleResolution": "bundler",
10
+ "allowImportingTsExtensions": true,
11
+ "resolveJsonModule": true,
12
+ "isolatedModules": true,
13
+ "moduleDetection": "force",
14
+ "noEmit": true,
15
+ "jsx": "react-jsx",
16
+
17
+ "strict": true,
18
+ "noUnusedLocals": true,
19
+ "noUnusedParameters": true,
20
+ "noFallthroughCasesInSwitch": true,
21
+
22
+ "baseUrl": ".",
23
+ "paths": {
24
+ "@/*": ["./src/*"]
25
+ },
26
+ "types": ["node", "vite/client"]
27
+ },
28
+ "include": ["src", "vite.config.ts"]
29
+ }
@@ -0,0 +1,14 @@
1
+ import { defineConfig } from 'vite';
2
+ import path from 'node:path';
3
+ import react from '@vitejs/plugin-react';
4
+ import tailwindcss from '@tailwindcss/vite';
5
+
6
+ // https://vitejs.dev/config/
7
+ export default defineConfig({
8
+ plugins: [react(), tailwindcss()],
9
+ resolve: {
10
+ alias: {
11
+ '@': path.resolve(__dirname, './src'),
12
+ },
13
+ },
14
+ });