@farris/cli 2.0.3 → 2.1.0
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/build.js +6 -7
- package/lib/commands/build.js.map +1 -1
- package/lib/commands/generate/api.js +188 -0
- package/lib/commands/generate/api.js.map +1 -0
- package/lib/commands/generate/common.js +101 -0
- package/lib/commands/generate/common.js.map +1 -0
- package/lib/commands/generate/component.js +163 -0
- package/lib/commands/generate/component.js.map +1 -0
- package/lib/commands/generate/view.js +195 -0
- package/lib/commands/generate/view.js.map +1 -0
- package/lib/commands/workspace/add-app.js +170 -0
- package/lib/commands/workspace/add-app.js.map +1 -0
- package/lib/commands/workspace/create.js +310 -0
- package/lib/commands/workspace/create.js.map +1 -0
- package/lib/commands/workspace/inspect.js +31 -0
- package/lib/commands/workspace/inspect.js.map +1 -0
- package/lib/commands/workspace/verify.js +39 -0
- package/lib/commands/workspace/verify.js.map +1 -0
- package/lib/common/constant.js +42 -1
- package/lib/common/constant.js.map +1 -1
- package/lib/common/get-vite-config.js +66 -9
- package/lib/common/get-vite-config.js.map +1 -1
- package/lib/common/output.js +93 -0
- package/lib/common/output.js.map +1 -0
- package/lib/common/safety.js +172 -0
- package/lib/common/safety.js.map +1 -0
- package/lib/common/template-renderer.js +113 -0
- package/lib/common/template-renderer.js.map +1 -0
- package/lib/common/transaction.js +84 -0
- package/lib/common/transaction.js.map +1 -0
- package/lib/common/verifier.js +147 -0
- package/lib/common/verifier.js.map +1 -0
- package/lib/config/vite-common.js +1 -1
- package/lib/config/vite-common.js.map +1 -1
- package/lib/index.js +124 -30
- package/lib/index.js.map +1 -1
- package/package.json +14 -10
- package/templates/workspace/app/farris.config.mjs +13 -0
- package/templates/{lib → workspace/app}/index.html +12 -12
- package/templates/workspace/app/package.json +22 -0
- package/templates/workspace/app/src/App.tsx +11 -0
- package/templates/workspace/app/src/main.ts +11 -0
- package/templates/workspace/app/src/router/index.ts +16 -0
- package/templates/workspace/app/src/styles/index.css +0 -0
- package/templates/workspace/app/src/styles/index.scss +0 -0
- package/templates/workspace/app/src/views/home/composables/use-home.ts +7 -0
- package/templates/workspace/app/src/views/home/home.component.tsx +15 -0
- package/templates/workspace/app/src/views/home/index.ts +4 -0
- package/templates/workspace/app/tsconfig.json +21 -0
- package/templates/workspace/root/README.md +28 -0
- package/templates/workspace/root/package.json +13 -0
- package/templates/workspace/root/pnpm-workspace.yaml +12 -0
- package/templates/lib/.eslintrc.cjs +0 -15
- package/templates/lib/.prettierrc.json +0 -8
- package/templates/lib/components/button/index.ts +0 -7
- package/templates/lib/components/button/src/button.component.tsx +0 -84
- package/templates/lib/components/button/src/button.props.ts +0 -55
- package/templates/lib/components/button/src/button.scss +0 -179
- package/templates/lib/components/common/index.ts +0 -6
- package/templates/lib/components/common/src/common.scss +0 -4
- package/templates/lib/components/common/src/compositions/index.ts +0 -19
- package/templates/lib/components/common/src/compositions/types.ts +0 -6
- package/templates/lib/components/common/src/compositions/use-bem/index.ts +0 -46
- package/templates/lib/components/common/src/compositions/use-click-away/index.ts +0 -40
- package/templates/lib/components/common/src/compositions/use-context/use-children-contexts.ts +0 -40
- package/templates/lib/components/common/src/compositions/use-context/use-parent-context.ts +0 -24
- package/templates/lib/components/common/src/compositions/use-event-listener/index.ts +0 -45
- package/templates/lib/components/common/src/compositions/use-expose/index.ts +0 -9
- package/templates/lib/components/common/src/compositions/use-lay-render/index.ts +0 -17
- package/templates/lib/components/common/src/compositions/use-link/index.ts +0 -14
- package/templates/lib/components/common/src/compositions/use-lock-scroll/index.ts +0 -25
- package/templates/lib/components/common/src/compositions/use-long-press/index.ts +0 -141
- package/templates/lib/components/common/src/compositions/use-momentum/index.ts +0 -82
- package/templates/lib/components/common/src/compositions/use-mount-component/index.ts +0 -48
- package/templates/lib/components/common/src/compositions/use-rect/index.ts +0 -31
- package/templates/lib/components/common/src/compositions/use-refs/index.ts +0 -21
- package/templates/lib/components/common/src/compositions/use-resize-observer/index.ts +0 -85
- package/templates/lib/components/common/src/compositions/use-resize-observer/utils.ts +0 -37
- package/templates/lib/components/common/src/compositions/use-scroll-parent/index.ts +0 -42
- package/templates/lib/components/common/src/compositions/use-touch/index.ts +0 -82
- package/templates/lib/components/common/src/compositions/use-touch-move/index.ts +0 -120
- package/templates/lib/components/common/src/entity/base-property.ts +0 -129
- package/templates/lib/components/common/src/entity/entity-schema.ts +0 -274
- package/templates/lib/components/common/src/entity/input-base-property.ts +0 -285
- package/templates/lib/components/common/src/style/animation/index.scss +0 -150
- package/templates/lib/components/common/src/style/base.scss +0 -63
- package/templates/lib/components/common/src/style/fonts/farris-mobile-icon.ttf +0 -0
- package/templates/lib/components/common/src/style/icon.scss +0 -6
- package/templates/lib/components/common/src/style/index.scss +0 -4
- package/templates/lib/components/common/src/style/mixins/bem.scss +0 -204
- package/templates/lib/components/common/src/style/mixins/border-radius.scss +0 -13
- package/templates/lib/components/common/src/style/mixins/ellipsis.scss +0 -15
- package/templates/lib/components/common/src/style/mixins/hairline.scss +0 -113
- package/templates/lib/components/common/src/style/mixins/index.scss +0 -6
- package/templates/lib/components/common/src/style/mixins/margin.scss +0 -10
- package/templates/lib/components/common/src/style/mixins/safe-area.scss +0 -9
- package/templates/lib/components/common/src/style/variables.scss +0 -113
- package/templates/lib/components/common/src/utils/index.ts +0 -15
- package/templates/lib/components/common/src/utils/src/common.ts +0 -83
- package/templates/lib/components/common/src/utils/src/date.ts +0 -134
- package/templates/lib/components/common/src/utils/src/dom/event.ts +0 -37
- package/templates/lib/components/common/src/utils/src/hook.ts +0 -18
- package/templates/lib/components/common/src/utils/src/number.ts +0 -26
- package/templates/lib/components/common/src/utils/src/query-filter.ts +0 -40
- package/templates/lib/components/common/src/utils/src/resove-asset.ts +0 -33
- package/templates/lib/components/common/src/utils/src/string.ts +0 -18
- package/templates/lib/components/common/src/utils/src/throttle.ts +0 -41
- package/templates/lib/components/common/src/utils/src/transition.ts +0 -14
- package/templates/lib/components/common/src/utils/src/type.ts +0 -105
- package/templates/lib/components/common/src/utils/src/use-appearance.ts +0 -33
- package/templates/lib/components/common/src/utils/src/with-install.ts +0 -16
- package/templates/lib/components/common/src/utils/src/with-register-designer.ts +0 -16
- package/templates/lib/components/common/src/utils/src/with-register.ts +0 -16
- package/templates/lib/components/common/types.ts +0 -131
- package/templates/lib/components/index.scss +0 -2
- package/templates/lib/components/index.ts +0 -21
- package/templates/lib/farris.config.mjs +0 -56
- package/templates/lib/package.json +0 -32
- package/templates/lib/src/App.vue +0 -80
- package/templates/lib/src/components/TheButton.vue +0 -3
- package/templates/lib/src/main.ts +0 -10
- package/templates/lib/src/router/index.ts +0 -23
- package/templates/lib/src/views/AboutView.vue +0 -15
- package/templates/lib/src/views/HomeView.vue +0 -9
- package/templates/lib/tsconfig.json +0 -20
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { App, Plugin } from 'vue';
|
|
2
|
-
import Button from './button';
|
|
3
|
-
export * from './common/src/utils';
|
|
4
|
-
|
|
5
|
-
const components = [
|
|
6
|
-
Button
|
|
7
|
-
];
|
|
8
|
-
|
|
9
|
-
const install = (app: App): void => {
|
|
10
|
-
components.forEach((component) => {
|
|
11
|
-
app.use(component as Plugin);
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export {
|
|
16
|
-
Button
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export default {
|
|
20
|
-
install
|
|
21
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { fileURLToPath, URL } from 'node:url';
|
|
2
|
-
|
|
3
|
-
const { BUILD_TYPE } = process.env;
|
|
4
|
-
const externalDependencies = BUILD_TYPE !== 'app';
|
|
5
|
-
const externals = [BUILD_TYPE === 'components' ? "@components" : ''];
|
|
6
|
-
const outDir = BUILD_TYPE === 'app' ? "dist" : 'package';
|
|
7
|
-
export default {
|
|
8
|
-
format: "<%= format %>",
|
|
9
|
-
// 输出目录 App模式默认值 './dist' Lib模式 './lib'
|
|
10
|
-
// outDir: fileURLToPath(new URL('./dist', import.meta.url)),
|
|
11
|
-
// 压缩代码 默认值 true
|
|
12
|
-
minify: true,
|
|
13
|
-
// 外部依赖排除项 默认值 { include: [], exclude: [] }
|
|
14
|
-
// externals: {
|
|
15
|
-
// include: [],
|
|
16
|
-
// exclude: []
|
|
17
|
-
// },
|
|
18
|
-
externals: {
|
|
19
|
-
include: externals,
|
|
20
|
-
filter: (externals) => {
|
|
21
|
-
return (id) => {
|
|
22
|
-
return externals.find((item) => item && id.indexOf(item) === 0);
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
// 是否排除 package.json 中 dependencies和 peerDependencies 依赖的包; App模式默认值 false Lib模式默认值 true
|
|
27
|
-
externalDependencies,
|
|
28
|
-
// 路径别名 默认值 null
|
|
29
|
-
alias: [
|
|
30
|
-
{ find: '@', replacement: fileURLToPath(new URL('./', import.meta.url)) },
|
|
31
|
-
{ find: '@components', replacement: fileURLToPath(new URL('./components', import.meta.url)) }
|
|
32
|
-
],
|
|
33
|
-
// 打包后产物路径
|
|
34
|
-
outDir: fileURLToPath(new URL(`./${outDir}`, import.meta.url)),
|
|
35
|
-
// 开发者模式 本地启动服务
|
|
36
|
-
server: {
|
|
37
|
-
proxy: {
|
|
38
|
-
"/api": {
|
|
39
|
-
target: "http://localhost:5173",
|
|
40
|
-
changeOrigin: true,
|
|
41
|
-
secure: false
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
lib: {
|
|
46
|
-
entry: fileURLToPath(new URL('./components/index.ts', import.meta.url)),
|
|
47
|
-
name: "",
|
|
48
|
-
fileName: "index",
|
|
49
|
-
formats: ["esm", 'umd', 'systemjs'],
|
|
50
|
-
},
|
|
51
|
-
target: 'es2015',
|
|
52
|
-
// 插件 默认值 [vue(), vueJsx()] 不要重复添加
|
|
53
|
-
// plugins: [],
|
|
54
|
-
// viteConfig 配置项
|
|
55
|
-
viteConfig: {}
|
|
56
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "<%= name %>",
|
|
3
|
-
"version": "0.0.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"dev": "farris-cli dev",
|
|
8
|
-
"preview": "farris-cli preview",
|
|
9
|
-
"build": "npm run build:lib && npm run build:css && npm run build:components",
|
|
10
|
-
"build:lib": "farris-cli build-lib -ep",
|
|
11
|
-
"build:components": "farris-cli build-components",
|
|
12
|
-
"build:css": "farris-cli build-css -e ./components/index.scss -o ./package/index.css --minify",
|
|
13
|
-
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
|
14
|
-
"format": "prettier --write src/"
|
|
15
|
-
},
|
|
16
|
-
"dependencies": {
|
|
17
|
-
"@farris/ui-vue": "latest",
|
|
18
|
-
"vue": "^3.4.29",
|
|
19
|
-
"vue-router": "^4.3.0"
|
|
20
|
-
},
|
|
21
|
-
"devDependencies": {
|
|
22
|
-
"@farris/cli": "<%= cliVersion %>",
|
|
23
|
-
"@rushstack/eslint-patch": "^1.8.0",
|
|
24
|
-
"@vue/eslint-config-prettier": "^9.0.0",
|
|
25
|
-
"@vue/eslint-config-typescript": "^13.0.0",
|
|
26
|
-
"@vue/tsconfig": "^0.5.1",
|
|
27
|
-
"eslint": "^8.57.0",
|
|
28
|
-
"eslint-plugin-vue": "^9.23.0",
|
|
29
|
-
"prettier": "^3.2.5",
|
|
30
|
-
"typescript": "~5.4.0"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { RouterLink, RouterView } from 'vue-router';
|
|
3
|
-
</script>
|
|
4
|
-
|
|
5
|
-
<template>
|
|
6
|
-
<header>
|
|
7
|
-
<div class="wrapper">
|
|
8
|
-
<nav>
|
|
9
|
-
<RouterLink to="/">Home</RouterLink>
|
|
10
|
-
<RouterLink to="/about">About</RouterLink>
|
|
11
|
-
</nav>
|
|
12
|
-
</div>
|
|
13
|
-
</header>
|
|
14
|
-
|
|
15
|
-
<RouterView />
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<style scoped>
|
|
19
|
-
header {
|
|
20
|
-
line-height: 1.5;
|
|
21
|
-
max-height: 100vh;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.logo {
|
|
25
|
-
display: block;
|
|
26
|
-
margin: 0 auto 2rem;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
nav {
|
|
30
|
-
width: 100%;
|
|
31
|
-
font-size: 12px;
|
|
32
|
-
text-align: center;
|
|
33
|
-
margin-top: 2rem;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
nav a.router-link-exact-active {
|
|
37
|
-
color: var(--color-text);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
nav a.router-link-exact-active:hover {
|
|
41
|
-
background-color: transparent;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
nav a {
|
|
45
|
-
display: inline-block;
|
|
46
|
-
padding: 0 1rem;
|
|
47
|
-
border-left: 1px solid var(--color-border);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
nav a:first-of-type {
|
|
51
|
-
border: 0;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
@media (min-width: 1024px) {
|
|
55
|
-
header {
|
|
56
|
-
display: flex;
|
|
57
|
-
place-items: center;
|
|
58
|
-
padding-right: calc(var(--section-gap) / 2);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.logo {
|
|
62
|
-
margin: 0 2rem 0 0;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
header .wrapper {
|
|
66
|
-
display: flex;
|
|
67
|
-
place-items: flex-start;
|
|
68
|
-
flex-wrap: wrap;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
nav {
|
|
72
|
-
text-align: left;
|
|
73
|
-
margin-left: -1rem;
|
|
74
|
-
font-size: 1rem;
|
|
75
|
-
|
|
76
|
-
padding: 1rem 0;
|
|
77
|
-
margin-top: 1rem;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
</style>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { createRouter, createWebHistory } from 'vue-router';
|
|
2
|
-
import HomeView from '../views/HomeView.vue';
|
|
3
|
-
|
|
4
|
-
const router = createRouter({
|
|
5
|
-
history: createWebHistory(import.meta.env.BASE_URL),
|
|
6
|
-
routes: [
|
|
7
|
-
{
|
|
8
|
-
path: '/',
|
|
9
|
-
name: 'home',
|
|
10
|
-
component: HomeView
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
path: '/about',
|
|
14
|
-
name: 'about',
|
|
15
|
-
// route level code-splitting
|
|
16
|
-
// this generates a separate chunk (About.[hash].js) for this route
|
|
17
|
-
// which is lazy-loaded when the route is visited.
|
|
18
|
-
component: () => import('../views/AboutView.vue')
|
|
19
|
-
}
|
|
20
|
-
]
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
export default router;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"include": [
|
|
3
|
-
"src/**/*",
|
|
4
|
-
"components/**/*",
|
|
5
|
-
],
|
|
6
|
-
"compilerOptions": {
|
|
7
|
-
"composite": true,
|
|
8
|
-
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
9
|
-
"baseUrl": ".",
|
|
10
|
-
"jsx": "preserve",
|
|
11
|
-
"paths": {
|
|
12
|
-
"@/*": [
|
|
13
|
-
"./*"
|
|
14
|
-
],
|
|
15
|
-
"@components/*": [
|
|
16
|
-
"./components/*"
|
|
17
|
-
]
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|