@farris/cli 2.2.6 → 2.3.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.
- package/lib/commands/add-app.js +6 -0
- package/lib/commands/add-app.js.map +1 -0
- package/lib/commands/add-lib.js +6 -0
- package/lib/commands/add-lib.js.map +1 -0
- package/lib/commands/add-project.js +194 -0
- package/lib/commands/add-project.js.map +1 -0
- package/lib/commands/build-components.js +8 -1
- package/lib/commands/build-components.js.map +1 -1
- package/lib/commands/build-lib.js +5 -0
- package/lib/commands/build-lib.js.map +1 -1
- package/lib/commands/build.js +7 -2
- package/lib/commands/build.js.map +1 -1
- package/lib/commands/create-app-options.js +0 -2
- package/lib/commands/create-app-options.js.map +1 -1
- package/lib/commands/create-app.js +6 -1
- package/lib/commands/create-app.js.map +1 -1
- package/lib/commands/create-options.js +3 -0
- package/lib/commands/create-options.js.map +1 -1
- package/lib/commands/create.js +96 -50
- package/lib/commands/create.js.map +1 -1
- package/lib/commands/generate/common.js +13 -12
- package/lib/commands/generate/common.js.map +1 -1
- package/lib/commands/workspace/add-app.js +10 -175
- package/lib/commands/workspace/add-app.js.map +1 -1
- package/lib/commands/workspace/create.js +29 -346
- package/lib/commands/workspace/create.js.map +1 -1
- package/lib/common/agents-doc.js +34 -0
- package/lib/common/agents-doc.js.map +1 -0
- package/lib/common/constant.js +18 -0
- package/lib/common/constant.js.map +1 -1
- package/lib/common/generate-app.js +48 -24
- package/lib/common/generate-app.js.map +1 -1
- package/lib/common/output.js +72 -2
- package/lib/common/output.js.map +1 -1
- package/lib/common/project-layout.js +143 -0
- package/lib/common/project-layout.js.map +1 -0
- package/lib/common/safety.js +4 -2
- package/lib/common/safety.js.map +1 -1
- package/lib/common/template-manifest.js +2 -4
- package/lib/common/template-manifest.js.map +1 -1
- package/lib/common/verifier.js +143 -99
- package/lib/common/verifier.js.map +1 -1
- package/lib/common/workspace-contract.js +86 -0
- package/lib/common/workspace-contract.js.map +1 -0
- package/lib/index.js +31 -2
- package/lib/index.js.map +1 -1
- package/lib/plugins/create-app-package-json.js +24 -0
- package/lib/plugins/create-app-package-json.js.map +1 -0
- package/package.json +87 -52
- package/templates/create/.gitignore.tpl +12 -0
- package/templates/create/AGENTS.md +62 -0
- package/templates/create/CLAUDE.md +1 -0
- package/templates/create/README.md +14 -1
- package/templates/create/package.json +11 -3
- package/templates/create/pnpm-workspace.yaml +3 -9
- package/templates/lib/.eslintrc.cjs +15 -0
- package/templates/lib/.gitignore.tpl +3 -0
- package/templates/lib/.prettierrc.json +8 -0
- package/templates/lib/index.html +1 -1
- package/templates/lib/package.json +41 -3
- package/templates/lib/{components → test/components}/button/button.spec.ts +3 -2
- package/templates/lib/test/components/button/button.spec.tsx +11 -0
- package/templates/lib/tsconfig.json +5 -1
- package/templates/lib/vitest.config.ts +1 -1
- package/templates/mobile/.gitignore.tpl +31 -0
- package/templates/mobile/.gitlab-ci.yml +3 -9
- package/templates/mobile/index.html +1 -1
- package/templates/mobile/package.json +16 -10
- package/templates/mobile/src/main.ts +5 -4
- package/templates/mobile/src/router/index.ts +17 -17
- package/templates/mobile/test/src/components/TheButton.spec.ts +15 -0
- package/templates/mobile/test/src/components/TheButton.spec.tsx +15 -0
- package/templates/mobile/tsconfig.json +3 -2
- package/templates/mobile/vitest.config.ts +2 -1
- package/templates/web/.gitignore.tpl +31 -0
- package/templates/web/.gitlab-ci.yml +3 -9
- package/templates/web/index.html +1 -1
- package/templates/web/package.json +16 -10
- package/templates/web/src/locales/index.ts +5 -0
- package/templates/web/src/locales/zh-CN.json +1 -0
- package/templates/web/src/main.ts +5 -2
- package/templates/web/src/router/index.ts +17 -17
- package/templates/web/src/styles/index.css +0 -0
- package/templates/web/src/styles/index.scss +0 -0
- package/templates/web/test/src/components/TheButton.spec.ts +15 -0
- package/templates/web/test/src/components/TheButton.spec.tsx +15 -0
- package/templates/web/tsconfig.json +3 -2
- package/templates/web/vitest.config.ts +2 -1
- package/lib/common/project-package-name.js +0 -5
- package/lib/common/project-package-name.js.map +0 -1
- package/templates/mobile/.changeset/README.md +0 -4
- package/templates/mobile/.changeset/config.json +0 -11
- package/templates/mobile/project.json +0 -4
- package/templates/mobile/src/components/TheButton.spec.ts +0 -8
- package/templates/web/.changeset/README.md +0 -4
- package/templates/web/.changeset/config.json +0 -11
- package/templates/web/project.json +0 -4
- package/templates/web/src/components/TheButton.spec.ts +0 -8
- package/templates/workspace/app/farris.config.mjs +0 -13
- package/templates/workspace/app/index.html +0 -12
- package/templates/workspace/app/package.json +0 -22
- package/templates/workspace/app/src/App.tsx +0 -11
- package/templates/workspace/app/src/main.ts +0 -12
- package/templates/workspace/app/src/router/index.ts +0 -16
- package/templates/workspace/app/src/views/home/composables/use-home.ts +0 -7
- package/templates/workspace/app/src/views/home/home.component.tsx +0 -15
- package/templates/workspace/app/src/views/home/index.ts +0 -4
- package/templates/workspace/app/tsconfig.json +0 -21
- package/templates/workspace/root/README.md +0 -28
- package/templates/workspace/root/package.json +0 -13
- package/templates/workspace/root/pnpm-workspace.yaml +0 -12
- /package/templates/{workspace/app → mobile}/src/locales/index.ts +0 -0
- /package/templates/{workspace/app → mobile}/src/locales/zh-CN.json +0 -0
- /package/templates/{workspace/app → mobile}/src/styles/index.css +0 -0
- /package/templates/{workspace/app → mobile}/src/styles/index.scss +0 -0
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://unpkg.com/@changesets/config@3.0.2/schema.json",
|
|
3
|
-
"changelog": "@changesets/cli/changelog",
|
|
4
|
-
"commit": false,
|
|
5
|
-
"fixed": [],
|
|
6
|
-
"linked": [],
|
|
7
|
-
"access": "restricted",
|
|
8
|
-
"baseBranch": "main",
|
|
9
|
-
"updateInternalDependencies": "patch",
|
|
10
|
-
"ignore": []
|
|
11
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { fileURLToPath, URL } from 'node:url';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
base: '<%= base %>',
|
|
5
|
-
routerMode: '<%= routerMode %>',
|
|
6
|
-
format: '<%= format %>',
|
|
7
|
-
minify: true,
|
|
8
|
-
externalDependencies: false,
|
|
9
|
-
alias: [
|
|
10
|
-
{ find: '@', replacement: fileURLToPath(new URL('./src', import.meta.url)) }
|
|
11
|
-
],
|
|
12
|
-
viteConfig: {}
|
|
13
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
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><%= title %></title>
|
|
7
|
-
</head>
|
|
8
|
-
<body>
|
|
9
|
-
<div id="app"></div>
|
|
10
|
-
<script type="module" src="/src/main.ts"></script>
|
|
11
|
-
</body>
|
|
12
|
-
</html>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "<%= appName %>",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"dev": "farris-cli dev",
|
|
8
|
-
"build": "farris-cli build",
|
|
9
|
-
"preview": "farris-cli preview",
|
|
10
|
-
"typecheck": "vue-tsc --noEmit"
|
|
11
|
-
},
|
|
12
|
-
"dependencies": {
|
|
13
|
-
"@farris/ui-vue": "catalog:",
|
|
14
|
-
"vue": "catalog:"<%= routerDependency %>
|
|
15
|
-
},
|
|
16
|
-
"devDependencies": {
|
|
17
|
-
"@farris/cli": "catalog:",
|
|
18
|
-
"typescript": "catalog:",
|
|
19
|
-
"vite": "catalog:",
|
|
20
|
-
"vue-tsc": "catalog:"<%= sassDevDependency %>
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { createApp } from 'vue';
|
|
2
|
-
import FarrisUI from '@farris/ui-vue';
|
|
3
|
-
import '@farris/ui-vue/index.css';<%= styleImport %><%= routerImport %>
|
|
4
|
-
import { localResources } from './locales';
|
|
5
|
-
import App from './App';
|
|
6
|
-
|
|
7
|
-
const app = createApp(App);
|
|
8
|
-
|
|
9
|
-
app.use(FarrisUI, { basePath: '', locale: 'zh-CN', localResources });<%= routerUse %>
|
|
10
|
-
|
|
11
|
-
app.mount('#app');
|
|
12
|
-
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { createRouter, <%= routerHistoryFunction %>, type RouteRecordRaw } from 'vue-router';
|
|
2
|
-
|
|
3
|
-
export const routes: RouteRecordRaw[] = [
|
|
4
|
-
{
|
|
5
|
-
path: '/',
|
|
6
|
-
name: 'Home',
|
|
7
|
-
component: () => import('../views/home')
|
|
8
|
-
},
|
|
9
|
-
];
|
|
10
|
-
|
|
11
|
-
const router = createRouter({
|
|
12
|
-
history: <%= routerHistoryCall %>,
|
|
13
|
-
routes
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
export default router;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { defineComponent } from 'vue';
|
|
2
|
-
import { useHome } from './composables/use-home';
|
|
3
|
-
|
|
4
|
-
export default defineComponent({
|
|
5
|
-
name: 'HomeView',
|
|
6
|
-
setup() {
|
|
7
|
-
const { title } = useHome();
|
|
8
|
-
|
|
9
|
-
return () => (
|
|
10
|
-
<div class="f-page-home">
|
|
11
|
-
<h2>{title}</h2>
|
|
12
|
-
</div>
|
|
13
|
-
);
|
|
14
|
-
}
|
|
15
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ESNext",
|
|
4
|
-
"useDefineForClassFields": true,
|
|
5
|
-
"module": "ESNext",
|
|
6
|
-
"moduleResolution": "Node",
|
|
7
|
-
"strict": true,
|
|
8
|
-
"jsx": "preserve",
|
|
9
|
-
"jsxImportSource": "vue",
|
|
10
|
-
"resolveJsonModule": true,
|
|
11
|
-
"isolatedModules": true,
|
|
12
|
-
"esModuleInterop": true,
|
|
13
|
-
"lib": ["ESNext", "DOM"],
|
|
14
|
-
"skipLibCheck": true,
|
|
15
|
-
"types": ["vite/client"],
|
|
16
|
-
"paths": {
|
|
17
|
-
"@/*": ["./src/*"]
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
|
|
21
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# <%= title %>
|
|
2
|
-
|
|
3
|
-
基于 Farris Vue 的前端工程 Workspace。
|
|
4
|
-
|
|
5
|
-
## 目录结构
|
|
6
|
-
|
|
7
|
-
```text
|
|
8
|
-
├── packages/
|
|
9
|
-
│ └── <%= appDir %>/ # 应用源码
|
|
10
|
-
├── pnpm-workspace.yaml # pnpm workspace 配置及 Catalog 依赖版本
|
|
11
|
-
└── package.json # 根工程脚本
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## 快速上手
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
# 安装依赖
|
|
18
|
-
pnpm install
|
|
19
|
-
|
|
20
|
-
# 启动开发服务器
|
|
21
|
-
pnpm --filter "<%= appName %>" dev
|
|
22
|
-
|
|
23
|
-
# 执行全量类型检查
|
|
24
|
-
pnpm typecheck
|
|
25
|
-
|
|
26
|
-
# 构建生产产物
|
|
27
|
-
pnpm build
|
|
28
|
-
```
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"private": true,
|
|
3
|
-
"packageManager": "pnpm@<%= pnpmVersion %>",
|
|
4
|
-
"engines": {
|
|
5
|
-
"node": "^18.0.0 || >=20.0.0",
|
|
6
|
-
"pnpm": ">=9.0.0 <10.0.0"
|
|
7
|
-
},
|
|
8
|
-
"scripts": {
|
|
9
|
-
"build": "pnpm --recursive --if-present run build",
|
|
10
|
-
"dev": "pnpm --recursive --if-present run dev",
|
|
11
|
-
"typecheck": "pnpm --recursive --if-present run typecheck"
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
packages:
|
|
2
|
-
- "packages/*"
|
|
3
|
-
|
|
4
|
-
catalog:
|
|
5
|
-
"@farris/ui-vue": "<%= farrisUiVueVersion %>"
|
|
6
|
-
"@farris/cli": "<%= farrisCliVersion %>"
|
|
7
|
-
"typescript": "<%= typescriptVersion %>"
|
|
8
|
-
"vite": "<%= viteVersion %>"
|
|
9
|
-
"vue": "<%= vueVersion %>"
|
|
10
|
-
"vue-router": "<%= vueRouterVersion %>"
|
|
11
|
-
"vue-tsc": "<%= vueTscVersion %>"
|
|
12
|
-
"sass": "<%= sassVersion %>"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|