@das-fed/cli 6.3.0-beta.11 → 6.3.0-beta.12
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/package.json +2 -1
- package/src/commands/build/index.js +1 -1
- package/src/commands/build/nginx.main.conf +54 -54
- package/src/commands/build/nginx.micro.conf +61 -61
- package/src/commands/init/template/.prettierignore +21 -21
- package/src/commands/init/template/.prettierrc +8 -8
- package/src/commands/init/template/README.md +19 -19
- package/src/commands/init/template/config.js +3 -3
- package/src/commands/init/template/index.html +12 -12
- package/src/commands/init/template/package.json +12 -12
- package/src/commands/init/template/public/config.js +1 -1
- package/src/commands/init/template/src/main.ts +9 -9
- package/src/commands/init/template/src/micro-app.ts +8 -8
- package/src/commands/init/template/src/views/demo/app.vue +61 -61
- package/src/commands/init/template/src/views/demo/i18n/index.ts +14 -14
- package/src/commands/init/template/src/views/demo/router.ts +13 -13
- package/src/commands/init/template/src/views/demo/theme/index.ts +7 -7
- package/src/commands/init/template/src/views/hello/api/index.ts +6 -6
- package/src/commands/init/template/src/views/hello/app.vue +157 -157
- package/src/commands/init/template/src/views/hello/i18n/index.ts +16 -16
- package/src/commands/init/template/src/views/hello/router.ts +12 -12
- package/src/commands/init/template/src/views/hello/theme/index.ts +18 -18
- package/src/commands/init/template/src/vite-env.d.ts +1 -1
- package/src/commands/init/template/tsconfig.app.json +28 -28
- package/src/commands/init/template/tsconfig.json +11 -11
- package/src/commands/init/template/tsconfig.node.json +13 -13
- package/src/commands/init/template/vite.config.ts +14 -14
- package/src/index.js +1 -1
- package/src/vite-plugins/das-fe-resolve/index.js +1 -0
- package/src/vite-plugins/das-fe-ui/index.js +1 -1
- package/src/vite-plugins/das-fe-web/index.js +1 -1
- package/src/vite-plugins/das-fe-web-app/index.js +1 -0
- package/src/vite-plugins/dynamic-entry/index.js +1 -0
- package/src/vite-plugins/index.js +1 -1
- package/src/commands/build/get-window-config.js +0 -1
- package/src/commands/helper/modules/gen-auth/gen/dist/config.js +0 -1
- package/src/commands/helper/modules/gen-auth/gen/dist/config.local.js +0 -1
- package/src/commands/helper/modules/gen-auth/gen/dist/index.js +0 -1
@@ -1,6 +1,6 @@
|
|
1
|
-
import { createService } from '@das-fed/utils/api-services'
|
2
|
-
|
3
|
-
const http = createService('/test')
|
4
|
-
|
5
|
-
export const getUser = http.get('/user')
|
6
|
-
export const addUser = http.post('/user')
|
1
|
+
import { createService } from '@das-fed/utils/api-services'
|
2
|
+
|
3
|
+
const http = createService('/test')
|
4
|
+
|
5
|
+
export const getUser = http.get('/user')
|
6
|
+
export const addUser = http.post('/user')
|
@@ -1,157 +1,157 @@
|
|
1
|
-
<template>
|
2
|
-
<div class="hello-container">
|
3
|
-
<button type="button" @click="setLang('zh-CN')">中</button>
|
4
|
-
<button type="button" style="margin-left: 10px" @click="setLang('en')">英</button>
|
5
|
-
<div class="img-container">
|
6
|
-
<a href="https://vitejs.dev" target="_blank">
|
7
|
-
<img src="./assets/vite.svg" class="logo" alt="Vite logo" />
|
8
|
-
</a>
|
9
|
-
<a href="https://vuejs.org/" target="_blank">
|
10
|
-
<img src="./assets/vue.svg" class="logo vue" alt="Vue logo" />
|
11
|
-
</a>
|
12
|
-
</div>
|
13
|
-
<router-link to="/"> {{ t('home-router') }} </router-link>
|
14
|
-
<span>-</span>
|
15
|
-
<router-link to="/demo"> {{ t('demo-router') }} </router-link>
|
16
|
-
|
17
|
-
<div>
|
18
|
-
<h1>{{ msg }}</h1>
|
19
|
-
|
20
|
-
<div class="card">
|
21
|
-
<p>
|
22
|
-
{{ t('edit', 'views/hello/app.vue') }}
|
23
|
-
</p>
|
24
|
-
</div>
|
25
|
-
|
26
|
-
<p v-html="t('click-out', `<a href='http://docs.chn-das.com' target='_blank'>达实文档中心</a>`)"></p>
|
27
|
-
<p v-html="t('suggest', `<a href='https://github.com/vuejs/language-tools' target='_blank'>Volar</a>`)"></p>
|
28
|
-
<router-link to="/demo">
|
29
|
-
<p class="read-the-demo">{{ t('read-the-demo') }}</p>
|
30
|
-
</router-link>
|
31
|
-
</div>
|
32
|
-
<button type="button" @click="setTheme('light')">{{ t('light') }}</button>
|
33
|
-
<button type="button" style="margin-left: 10px" @click="setTheme('dark')">
|
34
|
-
{{ t('dark') }}
|
35
|
-
</button>
|
36
|
-
<br />
|
37
|
-
<br />
|
38
|
-
<div class="img-container">
|
39
|
-
<a href="https://aiot.chn-das.com/login" target="_blank">
|
40
|
-
<img class="das-logo" src="./assets/das.png" />
|
41
|
-
</a>
|
42
|
-
</div>
|
43
|
-
</div>
|
44
|
-
</template>
|
45
|
-
|
46
|
-
<script setup lang="ts">
|
47
|
-
import { ref } from 'vue'
|
48
|
-
import { t, setLang, setTheme } from '@das-fed/web'
|
49
|
-
|
50
|
-
const msg = ref('vite + vue + das-fe')
|
51
|
-
</script>
|
52
|
-
|
53
|
-
<style>
|
54
|
-
|
55
|
-
|
56
|
-
.hello-container {
|
57
|
-
height: 100%;
|
58
|
-
margin: 0 auto;
|
59
|
-
padding: 2rem;
|
60
|
-
text-align: center;
|
61
|
-
background: var(--hello-bg);
|
62
|
-
color: var(--hello-color);
|
63
|
-
}
|
64
|
-
.hello-container p {
|
65
|
-
margin-bottom: 10px;
|
66
|
-
}
|
67
|
-
.hello-container h1 {
|
68
|
-
font-weight: 600;
|
69
|
-
margin-bottom: 20px;
|
70
|
-
color: var(--btn-color);
|
71
|
-
}
|
72
|
-
|
73
|
-
.img-container {
|
74
|
-
display: flex;
|
75
|
-
justify-content: center;
|
76
|
-
}
|
77
|
-
body {
|
78
|
-
background: var(--hello-bg);
|
79
|
-
color: var(--hello-color);
|
80
|
-
}
|
81
|
-
button {
|
82
|
-
background: var(--btn-bg);
|
83
|
-
color: var(--btn-color);
|
84
|
-
}
|
85
|
-
.logo {
|
86
|
-
height: 6em;
|
87
|
-
padding: 1.5em;
|
88
|
-
will-change: filter;
|
89
|
-
transition: filter 300ms;
|
90
|
-
}
|
91
|
-
.logo:hover {
|
92
|
-
filter: drop-shadow(0 0 2em #646cffaa);
|
93
|
-
}
|
94
|
-
.logo.vue:hover {
|
95
|
-
filter: drop-shadow(0 0 2em #42b883aa);
|
96
|
-
}
|
97
|
-
.das-logo {
|
98
|
-
height: 30px;
|
99
|
-
will-change: filter;
|
100
|
-
transition: filter 300ms;
|
101
|
-
}
|
102
|
-
.das-logo:hover {
|
103
|
-
filter: drop-shadow(0 0 2em #646cffaa);
|
104
|
-
}
|
105
|
-
|
106
|
-
.read-the-demo {
|
107
|
-
color: #888;
|
108
|
-
/* font-size: 14px; */
|
109
|
-
font-weight: 400;
|
110
|
-
}
|
111
|
-
:root {
|
112
|
-
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
|
113
|
-
line-height: 1.5;
|
114
|
-
font-weight: 400;
|
115
|
-
|
116
|
-
color-scheme: light dark;
|
117
|
-
color: rgba(255, 255, 255, 0.87);
|
118
|
-
background-color: #242424;
|
119
|
-
|
120
|
-
font-synthesis: none;
|
121
|
-
text-rendering: optimizeLegibility;
|
122
|
-
-webkit-font-smoothing: antialiased;
|
123
|
-
-moz-osx-font-smoothing: grayscale;
|
124
|
-
}
|
125
|
-
|
126
|
-
a {
|
127
|
-
font-weight: 500;
|
128
|
-
color: #646cff;
|
129
|
-
text-decoration: inherit;
|
130
|
-
}
|
131
|
-
a:hover {
|
132
|
-
color: #535bf2;
|
133
|
-
}
|
134
|
-
|
135
|
-
h1 {
|
136
|
-
font-size: 3.2em;
|
137
|
-
line-height: 1.1;
|
138
|
-
}
|
139
|
-
|
140
|
-
button {
|
141
|
-
border-radius: 8px;
|
142
|
-
border: 1px solid transparent;
|
143
|
-
padding: 0.6em 1.2em;
|
144
|
-
font-size: 1em;
|
145
|
-
font-weight: 500;
|
146
|
-
font-family: inherit;
|
147
|
-
cursor: pointer;
|
148
|
-
transition: border-color 0.25s;
|
149
|
-
}
|
150
|
-
button:hover {
|
151
|
-
border-color: #646cff;
|
152
|
-
}
|
153
|
-
button:focus,
|
154
|
-
button:focus-visible {
|
155
|
-
outline: 4px auto -webkit-focus-ring-color;
|
156
|
-
}
|
157
|
-
</style>
|
1
|
+
<template>
|
2
|
+
<div class="hello-container">
|
3
|
+
<button type="button" @click="setLang('zh-CN')">中</button>
|
4
|
+
<button type="button" style="margin-left: 10px" @click="setLang('en')">英</button>
|
5
|
+
<div class="img-container">
|
6
|
+
<a href="https://vitejs.dev" target="_blank">
|
7
|
+
<img src="./assets/vite.svg" class="logo" alt="Vite logo" />
|
8
|
+
</a>
|
9
|
+
<a href="https://vuejs.org/" target="_blank">
|
10
|
+
<img src="./assets/vue.svg" class="logo vue" alt="Vue logo" />
|
11
|
+
</a>
|
12
|
+
</div>
|
13
|
+
<router-link to="/"> {{ t('home-router') }} </router-link>
|
14
|
+
<span>-</span>
|
15
|
+
<router-link to="/demo"> {{ t('demo-router') }} </router-link>
|
16
|
+
|
17
|
+
<div>
|
18
|
+
<h1>{{ msg }}</h1>
|
19
|
+
|
20
|
+
<div class="card">
|
21
|
+
<p>
|
22
|
+
{{ t('edit', 'views/hello/app.vue') }}
|
23
|
+
</p>
|
24
|
+
</div>
|
25
|
+
|
26
|
+
<p v-html="t('click-out', `<a href='http://docs.chn-das.com' target='_blank'>达实文档中心</a>`)"></p>
|
27
|
+
<p v-html="t('suggest', `<a href='https://github.com/vuejs/language-tools' target='_blank'>Volar</a>`)"></p>
|
28
|
+
<router-link to="/demo">
|
29
|
+
<p class="read-the-demo">{{ t('read-the-demo') }}</p>
|
30
|
+
</router-link>
|
31
|
+
</div>
|
32
|
+
<button type="button" @click="setTheme('light')">{{ t('light') }}</button>
|
33
|
+
<button type="button" style="margin-left: 10px" @click="setTheme('dark')">
|
34
|
+
{{ t('dark') }}
|
35
|
+
</button>
|
36
|
+
<br />
|
37
|
+
<br />
|
38
|
+
<div class="img-container">
|
39
|
+
<a href="https://aiot.chn-das.com/login" target="_blank">
|
40
|
+
<img class="das-logo" src="./assets/das.png" />
|
41
|
+
</a>
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
</template>
|
45
|
+
|
46
|
+
<script setup lang="ts">
|
47
|
+
import { ref } from 'vue'
|
48
|
+
import { t, setLang, setTheme } from '@das-fed/web'
|
49
|
+
|
50
|
+
const msg = ref('vite + vue + das-fe')
|
51
|
+
</script>
|
52
|
+
|
53
|
+
<style>
|
54
|
+
|
55
|
+
|
56
|
+
.hello-container {
|
57
|
+
height: 100%;
|
58
|
+
margin: 0 auto;
|
59
|
+
padding: 2rem;
|
60
|
+
text-align: center;
|
61
|
+
background: var(--hello-bg);
|
62
|
+
color: var(--hello-color);
|
63
|
+
}
|
64
|
+
.hello-container p {
|
65
|
+
margin-bottom: 10px;
|
66
|
+
}
|
67
|
+
.hello-container h1 {
|
68
|
+
font-weight: 600;
|
69
|
+
margin-bottom: 20px;
|
70
|
+
color: var(--btn-color);
|
71
|
+
}
|
72
|
+
|
73
|
+
.img-container {
|
74
|
+
display: flex;
|
75
|
+
justify-content: center;
|
76
|
+
}
|
77
|
+
body {
|
78
|
+
background: var(--hello-bg);
|
79
|
+
color: var(--hello-color);
|
80
|
+
}
|
81
|
+
button {
|
82
|
+
background: var(--btn-bg);
|
83
|
+
color: var(--btn-color);
|
84
|
+
}
|
85
|
+
.logo {
|
86
|
+
height: 6em;
|
87
|
+
padding: 1.5em;
|
88
|
+
will-change: filter;
|
89
|
+
transition: filter 300ms;
|
90
|
+
}
|
91
|
+
.logo:hover {
|
92
|
+
filter: drop-shadow(0 0 2em #646cffaa);
|
93
|
+
}
|
94
|
+
.logo.vue:hover {
|
95
|
+
filter: drop-shadow(0 0 2em #42b883aa);
|
96
|
+
}
|
97
|
+
.das-logo {
|
98
|
+
height: 30px;
|
99
|
+
will-change: filter;
|
100
|
+
transition: filter 300ms;
|
101
|
+
}
|
102
|
+
.das-logo:hover {
|
103
|
+
filter: drop-shadow(0 0 2em #646cffaa);
|
104
|
+
}
|
105
|
+
|
106
|
+
.read-the-demo {
|
107
|
+
color: #888;
|
108
|
+
/* font-size: 14px; */
|
109
|
+
font-weight: 400;
|
110
|
+
}
|
111
|
+
:root {
|
112
|
+
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
|
113
|
+
line-height: 1.5;
|
114
|
+
font-weight: 400;
|
115
|
+
|
116
|
+
color-scheme: light dark;
|
117
|
+
color: rgba(255, 255, 255, 0.87);
|
118
|
+
background-color: #242424;
|
119
|
+
|
120
|
+
font-synthesis: none;
|
121
|
+
text-rendering: optimizeLegibility;
|
122
|
+
-webkit-font-smoothing: antialiased;
|
123
|
+
-moz-osx-font-smoothing: grayscale;
|
124
|
+
}
|
125
|
+
|
126
|
+
a {
|
127
|
+
font-weight: 500;
|
128
|
+
color: #646cff;
|
129
|
+
text-decoration: inherit;
|
130
|
+
}
|
131
|
+
a:hover {
|
132
|
+
color: #535bf2;
|
133
|
+
}
|
134
|
+
|
135
|
+
h1 {
|
136
|
+
font-size: 3.2em;
|
137
|
+
line-height: 1.1;
|
138
|
+
}
|
139
|
+
|
140
|
+
button {
|
141
|
+
border-radius: 8px;
|
142
|
+
border: 1px solid transparent;
|
143
|
+
padding: 0.6em 1.2em;
|
144
|
+
font-size: 1em;
|
145
|
+
font-weight: 500;
|
146
|
+
font-family: inherit;
|
147
|
+
cursor: pointer;
|
148
|
+
transition: border-color 0.25s;
|
149
|
+
}
|
150
|
+
button:hover {
|
151
|
+
border-color: #646cff;
|
152
|
+
}
|
153
|
+
button:focus,
|
154
|
+
button:focus-visible {
|
155
|
+
outline: 4px auto -webkit-focus-ring-color;
|
156
|
+
}
|
157
|
+
</style>
|
@@ -1,16 +1,16 @@
|
|
1
|
-
export default {
|
2
|
-
'home-router': { 'zh-CN': '主页', en: 'home' },
|
3
|
-
'demo-router': { 'zh-CN': '示例', en: 'demo' },
|
4
|
-
light: { 'zh-CN': '浅色', en: 'light' },
|
5
|
-
dark: { 'zh-CN': '深色', en: 'dark' },
|
6
|
-
edit: {
|
7
|
-
'zh-CN': '编辑 $0 来测试模块热重载',
|
8
|
-
en: 'Edit $0 to test HMR',
|
9
|
-
},
|
10
|
-
'click-out': {
|
11
|
-
'zh-CN': '进入 $0 , 快速创建 Vue + Vite + Das Front-End 的开发模板',
|
12
|
-
en: 'Click out $0 , check the official Vue + Vite + Das Front-End starter',
|
13
|
-
},
|
14
|
-
suggest: { 'zh-CN': '安装 $0 在您的IDE中获得更好的开发体验', en: 'Install $0 in your IDE for a better DX' },
|
15
|
-
'read-the-demo': { 'zh-CN': '进入示例页面,查看组件库使用示例', en: 'to read demo' },
|
16
|
-
}
|
1
|
+
export default {
|
2
|
+
'home-router': { 'zh-CN': '主页', en: 'home' },
|
3
|
+
'demo-router': { 'zh-CN': '示例', en: 'demo' },
|
4
|
+
light: { 'zh-CN': '浅色', en: 'light' },
|
5
|
+
dark: { 'zh-CN': '深色', en: 'dark' },
|
6
|
+
edit: {
|
7
|
+
'zh-CN': '编辑 $0 来测试模块热重载',
|
8
|
+
en: 'Edit $0 to test HMR',
|
9
|
+
},
|
10
|
+
'click-out': {
|
11
|
+
'zh-CN': '进入 $0 , 快速创建 Vue + Vite + Das Front-End 的开发模板',
|
12
|
+
en: 'Click out $0 , check the official Vue + Vite + Das Front-End starter',
|
13
|
+
},
|
14
|
+
suggest: { 'zh-CN': '安装 $0 在您的IDE中获得更好的开发体验', en: 'Install $0 in your IDE for a better DX' },
|
15
|
+
'read-the-demo': { 'zh-CN': '进入示例页面,查看组件库使用示例', en: 'to read demo' },
|
16
|
+
}
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import type { RouteRecordRaw } from 'vue-router'
|
2
|
-
import { setI18nRule, setThemeRule } from '@das-fed/web'
|
3
|
-
import i18n from './i18n'
|
4
|
-
import theme from './theme'
|
5
|
-
|
6
|
-
setI18nRule(i18n)
|
7
|
-
setThemeRule(theme)
|
8
|
-
|
9
|
-
export default {
|
10
|
-
path: '/',
|
11
|
-
component: () => import('./app.vue'),
|
12
|
-
} as RouteRecordRaw
|
1
|
+
import type { RouteRecordRaw } from 'vue-router'
|
2
|
+
import { setI18nRule, setThemeRule } from '@das-fed/web'
|
3
|
+
import i18n from './i18n'
|
4
|
+
import theme from './theme'
|
5
|
+
|
6
|
+
setI18nRule(i18n)
|
7
|
+
setThemeRule(theme)
|
8
|
+
|
9
|
+
export default {
|
10
|
+
path: '/',
|
11
|
+
component: () => import('./app.vue'),
|
12
|
+
} as RouteRecordRaw
|
@@ -1,18 +1,18 @@
|
|
1
|
-
export default {
|
2
|
-
'--hello-bg': {
|
3
|
-
light: '#fff',
|
4
|
-
dark: '#000',
|
5
|
-
},
|
6
|
-
'--hello-color': {
|
7
|
-
light: '#000',
|
8
|
-
dark: '#fff',
|
9
|
-
},
|
10
|
-
'--btn-bg': {
|
11
|
-
light: '#f9f9f9',
|
12
|
-
dark: '#1a1a1a',
|
13
|
-
},
|
14
|
-
'--btn-color': {
|
15
|
-
light: '#213547',
|
16
|
-
dark: '#f9f9f9',
|
17
|
-
},
|
18
|
-
}
|
1
|
+
export default {
|
2
|
+
'--hello-bg': {
|
3
|
+
light: '#fff',
|
4
|
+
dark: '#000',
|
5
|
+
},
|
6
|
+
'--hello-color': {
|
7
|
+
light: '#000',
|
8
|
+
dark: '#fff',
|
9
|
+
},
|
10
|
+
'--btn-bg': {
|
11
|
+
light: '#f9f9f9',
|
12
|
+
dark: '#1a1a1a',
|
13
|
+
},
|
14
|
+
'--btn-color': {
|
15
|
+
light: '#213547',
|
16
|
+
dark: '#f9f9f9',
|
17
|
+
},
|
18
|
+
}
|
@@ -1 +1 @@
|
|
1
|
-
/// <reference types="vite/client" />
|
1
|
+
/// <reference types="vite/client" />
|
@@ -1,28 +1,28 @@
|
|
1
|
-
{
|
2
|
-
"compilerOptions": {
|
3
|
-
"composite": true,
|
4
|
-
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
5
|
-
"target": "ES2020",
|
6
|
-
"useDefineForClassFields": true,
|
7
|
-
"module": "ESNext",
|
8
|
-
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
9
|
-
"skipLibCheck": true,
|
10
|
-
|
11
|
-
/* Bundler mode */
|
12
|
-
"moduleResolution": "bundler",
|
13
|
-
"allowImportingTsExtensions": true,
|
14
|
-
"resolveJsonModule": true,
|
15
|
-
"isolatedModules": true,
|
16
|
-
"moduleDetection": "force",
|
17
|
-
"noEmit": true,
|
18
|
-
"jsx": "preserve",
|
19
|
-
"jsxImportSource": "vue", // vue 3.4+ 需要显示指定jsx导出为vue
|
20
|
-
|
21
|
-
/* Linting */
|
22
|
-
"strict": true,
|
23
|
-
"noUnusedLocals": true,
|
24
|
-
"noUnusedParameters": true,
|
25
|
-
"noFallthroughCasesInSwitch": true
|
26
|
-
},
|
27
|
-
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"]
|
28
|
-
}
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"composite": true,
|
4
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
5
|
+
"target": "ES2020",
|
6
|
+
"useDefineForClassFields": true,
|
7
|
+
"module": "ESNext",
|
8
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
9
|
+
"skipLibCheck": true,
|
10
|
+
|
11
|
+
/* Bundler mode */
|
12
|
+
"moduleResolution": "bundler",
|
13
|
+
"allowImportingTsExtensions": true,
|
14
|
+
"resolveJsonModule": true,
|
15
|
+
"isolatedModules": true,
|
16
|
+
"moduleDetection": "force",
|
17
|
+
"noEmit": true,
|
18
|
+
"jsx": "preserve",
|
19
|
+
"jsxImportSource": "vue", // vue 3.4+ 需要显示指定jsx导出为vue
|
20
|
+
|
21
|
+
/* Linting */
|
22
|
+
"strict": true,
|
23
|
+
"noUnusedLocals": true,
|
24
|
+
"noUnusedParameters": true,
|
25
|
+
"noFallthroughCasesInSwitch": true
|
26
|
+
},
|
27
|
+
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"]
|
28
|
+
}
|
@@ -1,11 +1,11 @@
|
|
1
|
-
{
|
2
|
-
"files": [],
|
3
|
-
"references": [
|
4
|
-
{
|
5
|
-
"path": "./tsconfig.app.json"
|
6
|
-
},
|
7
|
-
{
|
8
|
-
"path": "./tsconfig.node.json"
|
9
|
-
}
|
10
|
-
]
|
11
|
-
}
|
1
|
+
{
|
2
|
+
"files": [],
|
3
|
+
"references": [
|
4
|
+
{
|
5
|
+
"path": "./tsconfig.app.json"
|
6
|
+
},
|
7
|
+
{
|
8
|
+
"path": "./tsconfig.node.json"
|
9
|
+
}
|
10
|
+
]
|
11
|
+
}
|
@@ -1,13 +1,13 @@
|
|
1
|
-
{
|
2
|
-
"compilerOptions": {
|
3
|
-
"composite": true,
|
4
|
-
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
5
|
-
"skipLibCheck": true,
|
6
|
-
"module": "ESNext",
|
7
|
-
"moduleResolution": "bundler",
|
8
|
-
"allowSyntheticDefaultImports": true,
|
9
|
-
"strict": true,
|
10
|
-
"noEmit": true
|
11
|
-
},
|
12
|
-
"include": ["vite.config.ts"]
|
13
|
-
}
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"composite": true,
|
4
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
5
|
+
"skipLibCheck": true,
|
6
|
+
"module": "ESNext",
|
7
|
+
"moduleResolution": "bundler",
|
8
|
+
"allowSyntheticDefaultImports": true,
|
9
|
+
"strict": true,
|
10
|
+
"noEmit": true
|
11
|
+
},
|
12
|
+
"include": ["vite.config.ts"]
|
13
|
+
}
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import { defineConfig } from 'vite'
|
2
|
-
import vue from '@vitejs/plugin-vue'
|
3
|
-
import { dasFeWebVitePlugin } from '@das-fed/cli'
|
4
|
-
import config from './config.js'
|
5
|
-
|
6
|
-
// https://vitejs.dev/config/
|
7
|
-
export default defineConfig(({ command }) => {
|
8
|
-
const isBuild = command === 'build'
|
9
|
-
return {
|
10
|
-
define: { __MICRO_APPNAME__: JSON.stringify(config.microAppName) },
|
11
|
-
base: isBuild ? `/${config.microAppName}` : '/',
|
12
|
-
plugins: [vue(), dasFeWebVitePlugin()],
|
13
|
-
}
|
14
|
-
})
|
1
|
+
import { defineConfig } from 'vite'
|
2
|
+
import vue from '@vitejs/plugin-vue'
|
3
|
+
import { dasFeWebVitePlugin } from '@das-fed/cli'
|
4
|
+
import config from './config.js'
|
5
|
+
|
6
|
+
// https://vitejs.dev/config/
|
7
|
+
export default defineConfig(({ command }) => {
|
8
|
+
const isBuild = command === 'build'
|
9
|
+
return {
|
10
|
+
define: { __MICRO_APPNAME__: JSON.stringify(config.microAppName) },
|
11
|
+
base: isBuild ? `/${config.microAppName}` : '/',
|
12
|
+
plugins: [vue(), dasFeWebVitePlugin()],
|
13
|
+
}
|
14
|
+
})
|
package/src/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export{dasFeWebVitePlugin}from"./vite-plugins/index.js";
|
1
|
+
export{dasFeWebVitePlugin}from"./vite-plugins/index.js";export{default as dasFeWebResolveVitePlugin}from"./vite-plugins/das-fe-resolve/index.js";
|
@@ -0,0 +1 @@
|
|
1
|
+
import{resolve,extname}from"path";import dayjs from"dayjs";import fs from"fs-extra";import{parse as lexerParse}from"es-module-lexer";import MagicString from"magic-string";import{parseImportCode}from"../../utils/parse-import-code.js";let dasFeExternal=e=>{var r=process.cwd();resolve(r,"node_modules");let n=["@das-fed/web","@das-fed/ui","@das-fed/utils"];return{name:"das-fe-web-app-external",enforce:"pre",apply:"build",async transform(e,r){if(!(-1<r.indexOf("?"))&&[".vue",".ts",".js",".jsx",".tsx"].includes(extname(r))){if([".ts",".js"].includes(extname(r))&&r.indexOf("node_modules")<0){var s,[r,,]=lexerParse(e),a=new MagicString(e);for(s of r){var t=e.slice(s.s,s.e);!t.startsWith("@das-fed/")||t.endsWith(".js")||(t.endsWith("/index")?a.overwrite(s.s,s.e,t+".js"):a.overwrite(s.s,s.e,t+"/index.js"))}e=a.toString()}var i,r=parseImportCode(e);if(r)for(i of r.filter(e=>e.name.startsWith("@das-fed/")).filter(e=>!n.includes(e.name)))i.name.endsWith(".js")||(e=i.name.endsWith("/index")?e.replaceAll(`'${i.name}'`,`'${i.name}.js'`):e.replaceAll(`'${i.name}'`,`'${i.name}/index.js'`));return e}}}};export default e=>[dasFeExternal()];
|
@@ -1 +1 @@
|
|
1
|
-
import{resolve,extname}from"path";import fs from"fs-extra";import MagicString from"magic-string";import stripComments from"strip-comments";import kebabCase from"lodash-es/kebabCase.js";import{parseImportCode}from"../../utils/parse-import-code.js";let cwd=process.cwd(),nodeModulesDir=resolve(cwd,"node_modules"),nodeModulesDasUIDir=resolve(cwd,"node_modules/@das-fed/ui"),dasFeUIEsmMapPath=resolve(nodeModulesDasUIDir,"esm-map.json"),dasFeUIEsmMapPathPathExits=fs.existsSync(dasFeUIEsmMapPath),esmMap=dasFeUIEsmMapPathPathExits?fs.readJSONSync(dasFeUIEsmMapPath):{},iconComponentName="DasIcon",getEsmPath=e=>{let s=esmMap[e];return s=s.endsWith("/index")?s.slice(0,-6):s},DasFeUIEsm=e=>({name:"das-fed-ui-esm",enforce:"pre",async transform(e,s){if(!(-1<s.indexOf("?"))&&!(-1<s.indexOf("@das-fed/ui/packages/icon"))&&[".vue",".ts",".js",".jsx",".tsx"].includes(extname(s))){s=parseImportCode(e,"@das-fed/ui");if(s){var t,o=new MagicString(e);for(t of s){let a="";for(var r of t.members){var
|
1
|
+
import{resolve,extname}from"path";import fs from"fs-extra";import MagicString from"magic-string";import stripComments from"strip-comments";import kebabCase from"lodash-es/kebabCase.js";import{parseImportCode}from"../../utils/parse-import-code.js";let cwd=process.cwd(),nodeModulesDir=resolve(cwd,"node_modules"),nodeModulesDasUIDir=resolve(cwd,"node_modules/@das-fed/ui"),dasFeUIEsmMapPath=resolve(nodeModulesDasUIDir,"esm-map.json"),dasFeUIEsmMapPathPathExits=fs.existsSync(dasFeUIEsmMapPath),esmMap=dasFeUIEsmMapPathPathExits?fs.readJSONSync(dasFeUIEsmMapPath):{},iconComponentName="DasIcon",getEsmPath=e=>{let s=esmMap[e];if(s)return s=s.endsWith("/index")?s.slice(0,-6):s},DasFeUIEsm=e=>({name:"das-fed-ui-esm",enforce:"pre",async transform(e,s){if(!(-1<s.indexOf("?"))&&!(-1<s.indexOf("@das-fed/ui/packages/icon"))&&[".vue",".ts",".js",".jsx",".tsx"].includes(extname(s))){s=parseImportCode(e,"@das-fed/ui");if(s){var t,o=new MagicString(e);for(t of s){let a="";for(var r of t.members){var i=r.name,d=getEsmPath(i);if(d){a+=`import { ${r.code} } from '@das-fed/ui${d}';`;let e=resolve(nodeModulesDir,`@das-fed/ui${d}/style.css`),s=`import '@das-fed/ui${d}/style.css';`;i.startsWith(iconComponentName)&&(r=getEsmPath(iconComponentName),e=resolve(nodeModulesDir,`@das-fed/ui${r}/style.css`),s=`import '@das-fed/ui${r}/style.css';`);d=await fs.exists(e);d&&(a+=s)}}a&&o.overwrite(t.start,t.end,a)}return o.toString()}}}});export default(e={})=>[DasFeUIEsm(e)];
|
@@ -1 +1 @@
|
|
1
|
-
import{resolve,extname}from"path";import fs from"fs-extra";import
|
1
|
+
import{resolve,extname}from"path";import fs from"fs-extra";import MagicString from"magic-string";import{parseImportCode}from"../../utils/parse-import-code.js";let cwd=process.cwd(),dasFeWeb=e=>{let a;return{name:"das-fe-web",config:(e,{})=>({resolve:{alias:{"@":resolve(process.cwd(),"src")}}}),configResolved(e){a=e},buildStart:async()=>{a.cwd=resolve(process.cwd())},transformIndexHtml:{order:"post",handler:()=>{var e=a.base||"./";let s="development"===a.mode?e+"config.local.js":e+"config.js";return[{tag:"script",attrs:{src:s}}]}}}},dasFeWebEsmMapPath=resolve(cwd,"node_modules","@das-fed/web/esm-map.json"),dasFeWebEsmMapPathExits=fs.existsSync(dasFeWebEsmMapPath),esmMap=dasFeWebEsmMapPathExits?fs.readJSONSync(dasFeWebEsmMapPath):{},dasFeWebEsm=async e=>({name:"das-fed-web-esm",enforce:"pre",transform(e,a){if(dasFeWebEsmMapPathExits&&!(-1<a.indexOf("?"))&&[".vue",".ts",".js",".jsx",".tsx"].includes(extname(a))){a=parseImportCode(e,"@das-fed/web");if(a){let s=new MagicString(e);return a.map(e=>{let a="";e.members.map(e=>{var s=e.name,s=esmMap[s];s&&(a+=`import { ${e.code} } from '@das-fed/web${s}';`)}),s.overwrite(e.start,e.end,a)}),s.toString()}}}});export default e=>[dasFeWeb(e),dasFeWebEsm(e)];
|
@@ -0,0 +1 @@
|
|
1
|
+
import{resolve,extname}from"path";import dayjs from"dayjs";import fs from"fs-extra";import{parse as lexerParse}from"es-module-lexer";import MagicString from"magic-string";import{parseImportCode}from"../../utils/parse-import-code.js";let pureOpt=e=>{process.cwd();let{base:s="./",apply:r="build",type:a="singleApp",external:t=["vue","vue-router",/^@das-fed\//],entry:p="src/das-web-app.ts",outputDir:i="dist",...n}=e||{};return{base:s,apply:r,type:a,external:t,entry:p,outputDir:i,isSingleApp:"singleApp"===a,isDasMainApp:"mainApp"===a,isDasMicroApp:"microApp"===a,...n}},dasFeWebApp=e=>{let r=process.cwd(),{base:a,apply:s,external:t,entry:p,isSingleApp:i}=pureOpt(e);if(i)return{};let n;return{name:"das-fe-web-app",apply:s,config:(e,{})=>{let s=e?.build?.assetsDir??"assets";(s=s||"")&&!s.endsWith("/")&&(s+="/");e=dayjs().format("YYYY-MM-DD-HH-mm-ss-SSS");return{base:a,build:{lib:{entry:resolve(r,p),name:"index",fileName:"index",formats:["es"]},rollupOptions:{external:t,output:{chunkFileNames:`[name]-[hash]-${e}.js`}}}}},configResolved(e){n=e}}},dasWebAppExternal=e=>{e=pureOpt(e).isSingleApp;if(e)return{};e=process.cwd();resolve(e,"node_modules");let i=["@das-fed/web","@das-fed/ui","@das-fed/utils"];return{name:"das-fe-web-app-external",enforce:"pre",apply:"build",async transform(e,s){if(!(-1<s.indexOf("?"))&&[".vue",".ts",".js",".jsx",".tsx"].includes(extname(s))){if(e=e.replace("import '@das-fed/web/packages/style'",""),[".ts",".js"].includes(extname(s))&&s.indexOf("node_modules")<0){var r,[s,,]=lexerParse(e),a=new MagicString(e);for(r of s){var t=e.slice(r.s,r.e);!t.startsWith("@das-fed/")||t.endsWith(".js")||(t.endsWith("/index")?a.overwrite(r.s,r.e,t+".js"):a.overwrite(r.s,r.e,t+"/index.js"))}e=a.toString()}var p,s=parseImportCode(e);if(s)for(p of s.filter(e=>e.name.startsWith("@das-fed/")).filter(e=>!i.includes(e.name)))p.name.endsWith(".js")||(e=p.name.endsWith("/index")?e.replaceAll(`'${p.name}'`,`'${p.name}.js'`):e.replaceAll(`'${p.name}'`,`'${p.name}/index.js'`));return e}}}};export default e=>[dasFeWebApp(e),dasWebAppExternal(e)];
|
@@ -0,0 +1 @@
|
|
1
|
+
import{resolve}from"path";import fs from"fs-extra";export default(s="/src/main.ts")=>{let a=process.cwd();return{name:"das-fe-dynamic-entry",apply:"serve",transformIndexHtml:{order:"pre",handler:async r=>{var e="/src/main.dev.ts";return await fs.exists(resolve(a,"."+e))?r.replace(s,e):r}}}};
|
@@ -1 +1 @@
|
|
1
|
-
import vueJsx from"@vitejs/plugin-vue-jsx";import AutoImportPlugin from"unplugin-auto-import/vite";import ComponentsPlugin from"unplugin-vue-components/vite";import{ElementPlusResolver,AntDesignVueResolver}from"unplugin-vue-components/resolvers";import viteCompression from"vite-plugin-compression";import dasFeWeb from"./das-fe-web/index.js";import dasFeUI from"./das-fe-ui/index.js";import dasFeUtils from"./das-fe-utils/index.js";import dasFePretty from"./das-fe-pretty/index.js";import visualizerPlugin from"./visualizer/index.js";let dasFeWebVitePlugin=async(e={})=>{var{
|
1
|
+
import vueJsx from"@vitejs/plugin-vue-jsx";import AutoImportPlugin from"unplugin-auto-import/vite";import ComponentsPlugin from"unplugin-vue-components/vite";import{ElementPlusResolver,AntDesignVueResolver}from"unplugin-vue-components/resolvers";import viteCompression from"vite-plugin-compression";import dasFeWeb from"./das-fe-web/index.js";import dasFeUI from"./das-fe-ui/index.js";import dasFeUtils from"./das-fe-utils/index.js";import dasFePretty from"./das-fe-pretty/index.js";import dasFeWebApp from"./das-fe-web-app/index.js";import visualizerPlugin from"./visualizer/index.js";import dynamicEntry from"./dynamic-entry/index.js";let dasFeWebVitePlugin=async(e={})=>{var{entry:e="/src/main.ts",dasWeb:s={styleResolve:!0},dasUI:i={},dasUtils:t={},compression:o={},visualizer:r=null,autoImport:n={},components:m={},pretty:l={},dasWebApp:p={}}=e||{},s=[vueJsx(),dasFeWeb(s),dasFeUI(i),dasFeUtils(t),viteCompression(o),visualizerPlugin(r),dasFePretty(l),dasFeWebApp(p),dynamicEntry(e)];return n.disabled||s.push(AutoImportPlugin({resolvers:[ElementPlusResolver(),AntDesignVueResolver()],dts:"./src/das-fe-local-runtime/auto-imports.d.ts",...n})),m.disabled||s.push(ComponentsPlugin({resolvers:[ElementPlusResolver(),AntDesignVueResolver()],dts:"./src/das-fe-local-runtime/components.d.ts",...m})),s};export{dasFeWebVitePlugin};
|
@@ -1 +0,0 @@
|
|
1
|
-
import fs from"fs-extra";import prettier from"prettier";import strip from"strip-comments";import json5 from"json5";let getWindowConfig=async r=>{r=(await fs.readFile(r)).toString(),r=(await prettier.format(strip(r),{parser:"typescript"})).split(";").find(r=>r.match("window.config")).replace(/\s/g,"").replace("window.config=","");return json5.parse(r)};export{getWindowConfig};
|
@@ -1 +0,0 @@
|
|
1
|
-
window.config={};
|
@@ -1 +0,0 @@
|
|
1
|
-
window.config={};
|
@@ -1 +0,0 @@
|
|
1
|
-
let m={path:"/demo",component:()=>"virtual:module",meta:{keepAlive:!0}},l=(e,p)=>{var t=(s,e)=>async e=>{let t="string"==typeof e?e:"",a=("object"==typeof e&&(t=e.value),{method:s,url:t,headers:{}});return"get"!==a.method&&(a.params={...a.params,timestamp:(new Date).getTime()}),(a=p?await p(a):a).baseURL&&a.urlPrefix&&(a.baseURL=a.baseURL+a.urlPrefix),a};return{get:t("get"),post:t("post"),put:t("put"),patch:t("patch"),delete:t("delete")}},f=(t,e)=>l(null,async e=>(e.urlPrefix=t,e)),a=f("/test"),h=a.get("/user"),r=a.post("/user"),i=a.put("/user"),c=a.delete("/user"),p=Object.freeze(Object.defineProperty({__proto__:null,addUser:r,deleteUser:c,editUser:i,getUser:h},Symbol.toStringTag,{value:"Module"})),_={name:"示例",code:"demo",path:m.path,apis:p,btns:{add:{name:"新增按钮",apis:[r]},edit:{name:"编辑按钮",apis:[i]},delete:{name:"删除按钮",apis:[c]}}},g={path:"/",component:()=>"virtual:module"},b={name:"公告列表",code:"notice",path:g.path,apis:p,btns:{add:{name:"新增按钮",apis:[r]},edit:{name:"编辑按钮",apis:[i]},delete:{name:"删除按钮",apis:[c]}}},v=Object.assign({"./demo/index.ts":_,"./hello/index.ts":b}),U={code:"cms",name:"内容运营",modules:v};export{U as default};
|