@farris/cli 2.0.0-beta.7 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/bin/index.js +0 -0
- package/lib/commands/build-components.js +39 -36
- package/lib/commands/build-components.js.map +1 -0
- package/lib/commands/build-css.js +28 -11
- package/lib/commands/build-css.js.map +1 -0
- package/lib/commands/build-lib.js +28 -16
- package/lib/commands/build-lib.js.map +1 -0
- package/lib/commands/build.js +16 -10
- package/lib/commands/build.js.map +1 -0
- package/lib/commands/create-app.js +55 -54
- package/lib/commands/create-app.js.map +1 -0
- package/lib/commands/dev-serve.js +24 -23
- package/lib/commands/dev-serve.js.map +1 -0
- package/lib/commands/preview-serve.js +17 -16
- package/lib/commands/preview-serve.js.map +1 -0
- package/lib/common/constant.js +19 -18
- package/lib/common/constant.js.map +1 -0
- package/lib/common/generate-app.js +45 -44
- package/lib/common/generate-app.js.map +1 -0
- package/lib/common/get-dependencies.js +10 -9
- package/lib/common/get-dependencies.js.map +1 -0
- package/lib/common/get-farris-config.js +12 -11
- package/lib/common/get-farris-config.js.map +1 -0
- package/lib/common/get-version.js +7 -6
- package/lib/common/get-version.js.map +1 -0
- package/lib/common/get-vite-config.js +41 -38
- package/lib/common/get-vite-config.js.map +1 -0
- package/lib/config/vite-app.js +15 -14
- package/lib/config/vite-app.js.map +1 -0
- package/lib/config/vite-component.js +33 -0
- package/lib/config/vite-component.js.map +1 -0
- package/lib/config/vite-lib.js +28 -35
- package/lib/config/vite-lib.js.map +1 -0
- package/lib/index.js +66 -54
- package/lib/index.js.map +1 -0
- package/lib/plugins/{gen-component-style.js → create-component-style.js} +45 -43
- package/lib/plugins/create-component-style.js.map +1 -0
- package/lib/plugins/create-package-json.js +34 -0
- package/lib/plugins/create-package-json.js.map +1 -0
- package/lib/plugins/dts.js +9 -8
- package/lib/plugins/dts.js.map +1 -0
- package/lib/plugins/html-system.js +12 -11
- package/lib/plugins/html-system.js.map +1 -0
- package/lib/plugins/replace.js +14 -13
- package/lib/plugins/replace.js.map +1 -0
- package/lib/plugins/systemjs-bundle.js +16 -0
- package/lib/plugins/systemjs-bundle.js.map +1 -0
- package/package.json +5 -3
- package/templates/mobile/farris.config.mjs +23 -23
- package/templates/{lib → web}/farris.config.mjs +23 -34
- package/templates/{lib → web}/package.json +4 -4
- package/templates/web/src/App.vue +80 -0
- package/templates/web/src/components/TheButton.vue +3 -0
- package/templates/{lib → web}/src/main.ts +3 -2
- package/templates/web/src/router/index.ts +23 -0
- package/templates/web/src/views/AboutView.vue +15 -0
- package/templates/web/src/views/HomeView.vue +9 -0
- package/templates/{lib → web}/tsconfig.json +5 -5
- package/templates/lib/packages/button/src/index.vue +0 -4
- package/templates/lib/packages/index.ts +0 -7
- package/templates/lib/src/App.vue +0 -5
- /package/templates/{lib → web}/.eslintrc.cjs +0 -0
- /package/templates/{lib → web}/.prettierrc.json +0 -0
- /package/templates/{lib → web}/index.html +0 -0
@@ -1,24 +1,24 @@
|
|
1
|
-
import { fileURLToPath, URL } from 'node:url';
|
2
|
-
|
3
|
-
export default {
|
4
|
-
format: "<%= format %>",
|
5
|
-
// 输出目录 App模式默认值 './dist' Lib模式 './lib'
|
6
|
-
// outDir: fileURLToPath(new URL('./dist', import.meta.url)),
|
7
|
-
// 最小化 默认值 true
|
8
|
-
minify: true,
|
9
|
-
// 外部依赖排除项 默认值 { include: [], exclude: [] }
|
10
|
-
// externals: {
|
11
|
-
// include: [],
|
12
|
-
// exclude: []
|
13
|
-
// },
|
14
|
-
// 是否排除 package.json 中 dependencies和 peerDependencies 依赖的包; App模式默认值 false Lib模式默认值 true
|
15
|
-
externalDependencies: false,
|
16
|
-
// 路径别名 默认值 null
|
17
|
-
alias: [
|
18
|
-
{ find: '@', replacement: fileURLToPath(new URL('./src', import.meta.url)) }
|
19
|
-
],
|
20
|
-
// 插件 默认值 [vue(), vueJsx()] 不要重复添加
|
21
|
-
// plugins: [],
|
22
|
-
// viteConfig 配置项
|
23
|
-
viteConfig: {}
|
1
|
+
import { fileURLToPath, URL } from 'node:url';
|
2
|
+
|
3
|
+
export default {
|
4
|
+
format: "<%= format %>",
|
5
|
+
// 输出目录 App模式默认值 './dist' Lib模式 './lib'
|
6
|
+
// outDir: fileURLToPath(new URL('./dist', import.meta.url)),
|
7
|
+
// 最小化 默认值 true
|
8
|
+
minify: true,
|
9
|
+
// 外部依赖排除项 默认值 { include: [], exclude: [] }
|
10
|
+
// externals: {
|
11
|
+
// include: [],
|
12
|
+
// exclude: []
|
13
|
+
// },
|
14
|
+
// 是否排除 package.json 中 dependencies和 peerDependencies 依赖的包; App模式默认值 false Lib模式默认值 true
|
15
|
+
externalDependencies: false,
|
16
|
+
// 路径别名 默认值 null
|
17
|
+
alias: [
|
18
|
+
{ find: '@', replacement: fileURLToPath(new URL('./src', import.meta.url)) }
|
19
|
+
],
|
20
|
+
// 插件 默认值 [vue(), vueJsx()] 不要重复添加
|
21
|
+
// plugins: [],
|
22
|
+
// viteConfig 配置项
|
23
|
+
viteConfig: {}
|
24
24
|
}
|
@@ -1,35 +1,24 @@
|
|
1
|
-
import { fileURLToPath, URL } from 'node:url';
|
2
|
-
|
3
|
-
export default {
|
4
|
-
|
5
|
-
lib
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
//
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
//
|
21
|
-
//
|
22
|
-
//
|
23
|
-
|
24
|
-
// 是否排除 package.json 中 dependencies和 peerDependencies 依赖的包; App模式默认值 false Lib模式默认值 true
|
25
|
-
externalDependencies: true,
|
26
|
-
// 路径别名 默认值 null
|
27
|
-
alias: [
|
28
|
-
{ find: '@', replacement: fileURLToPath(new URL('./src', import.meta.url)) },
|
29
|
-
{ find: '@packages', replacement: fileURLToPath(new URL('./packages', import.meta.url)) },
|
30
|
-
],
|
31
|
-
// 插件 默认值 [vue(), vueJsx()] 不要重复添加
|
32
|
-
// plugins: [],
|
33
|
-
// viteConfig 配置项
|
34
|
-
viteConfig: {}
|
1
|
+
import { fileURLToPath, URL } from 'node:url';
|
2
|
+
|
3
|
+
export default {
|
4
|
+
format: "<%= format %>",
|
5
|
+
// 输出目录 App模式默认值 './dist' Lib模式 './lib'
|
6
|
+
// outDir: fileURLToPath(new URL('./dist', import.meta.url)),
|
7
|
+
// 最小化 默认值 true
|
8
|
+
minify: true,
|
9
|
+
// 外部依赖排除项 默认值 { include: [], exclude: [] }
|
10
|
+
// externals: {
|
11
|
+
// include: [],
|
12
|
+
// exclude: []
|
13
|
+
// },
|
14
|
+
// 是否排除 package.json 中 dependencies和 peerDependencies 依赖的包; App模式默认值 false Lib模式默认值 true
|
15
|
+
externalDependencies: false,
|
16
|
+
// 路径别名 默认值 null
|
17
|
+
alias: [
|
18
|
+
{ find: '@', replacement: fileURLToPath(new URL('./src', import.meta.url)) }
|
19
|
+
],
|
20
|
+
// 插件 默认值 [vue(), vueJsx()] 不要重复添加
|
21
|
+
// plugins: [],
|
22
|
+
// viteConfig 配置项
|
23
|
+
viteConfig: {}
|
35
24
|
}
|
@@ -3,17 +3,17 @@
|
|
3
3
|
"version": "0.0.0",
|
4
4
|
"private": true,
|
5
5
|
"type": "module",
|
6
|
-
"main": "./dist/index.umd.js",
|
7
|
-
"module": "./dist/index.js",
|
8
6
|
"scripts": {
|
9
7
|
"dev": "farris-cli dev",
|
10
|
-
"build": "farris-cli build
|
8
|
+
"build": "farris-cli build",
|
11
9
|
"preview": "farris-cli preview",
|
12
10
|
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
13
11
|
"format": "prettier --write src/"
|
14
12
|
},
|
15
13
|
"dependencies": {
|
16
|
-
"vue": "
|
14
|
+
"@farris/ui-vue": "latest",
|
15
|
+
"vue": "^3.4.29",
|
16
|
+
"vue-router": "^4.3.0"
|
17
17
|
},
|
18
18
|
"devDependencies": {
|
19
19
|
"@farris/cli": "<%= cliVersion %>",
|
@@ -0,0 +1,80 @@
|
|
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,9 +1,10 @@
|
|
1
1
|
import { createApp } from 'vue'
|
2
|
+
import FarrisVue from '@farris/ui-vue'
|
2
3
|
import App from './App.vue'
|
3
|
-
import
|
4
|
+
import router from './router'
|
4
5
|
|
5
6
|
const app = createApp(App)
|
6
7
|
|
7
|
-
app.use(
|
8
|
+
app.use(router).use(FarrisVue)
|
8
9
|
|
9
10
|
app.mount('#app')
|
@@ -0,0 +1,23 @@
|
|
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,18 +1,18 @@
|
|
1
1
|
{
|
2
2
|
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
3
3
|
"include": [
|
4
|
+
"env.d.ts",
|
4
5
|
"src/**/*",
|
5
|
-
"src/**/*.vue"
|
6
|
-
"packages/**/*",
|
7
|
-
"packages/**/*.vue",
|
6
|
+
"src/**/*.vue"
|
8
7
|
],
|
9
8
|
"compilerOptions": {
|
10
9
|
"composite": true,
|
11
10
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
12
11
|
"baseUrl": ".",
|
13
12
|
"paths": {
|
14
|
-
"@/*": [
|
15
|
-
|
13
|
+
"@/*": [
|
14
|
+
"./src/*"
|
15
|
+
]
|
16
16
|
}
|
17
17
|
}
|
18
18
|
}
|
File without changes
|
File without changes
|
File without changes
|