@das-fed/cli 6.4.0-hot.32 → 6.4.0-hot.33
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 +1 -1
- package/src/commands/init/index.js +1 -1
- package/src/commands/build/extra/auth/index.js +0 -1
- package/src/commands/build/extra/i18n/index.js +0 -2
- package/src/commands/build/extra/i18n/vite.config.ts +0 -1
- package/src/commands/build/extra/index.js +0 -1
- package/src/commands/build/extra/theme/index.js +0 -1
- package/src/commands/init/template/README.md +0 -29
- package/src/commands/init/template/config.js +0 -3
- package/src/commands/init/template/index.html +0 -12
- package/src/commands/init/template/public/config.js +0 -4
- package/src/commands/init/template/src/das-web-app.ts +0 -9
- package/src/commands/init/template/src/main.ts +0 -9
- package/src/commands/init/template/src/micro-app.ts +0 -8
- package/src/commands/init/template/src/views/demo/app.vue +0 -61
- package/src/commands/init/template/src/views/demo/i18n/index.ts +0 -14
- package/src/commands/init/template/src/views/demo/router.ts +0 -13
- package/src/commands/init/template/src/views/demo/theme/index.ts +0 -7
- package/src/commands/init/template/src/views/hello/api/index.ts +0 -6
- package/src/commands/init/template/src/views/hello/app.vue +0 -157
- package/src/commands/init/template/src/views/hello/assets/das.png +0 -0
- package/src/commands/init/template/src/views/hello/assets/vite.svg +0 -1
- package/src/commands/init/template/src/views/hello/assets/vue.svg +0 -1
- package/src/commands/init/template/src/views/hello/i18n/index.ts +0 -16
- package/src/commands/init/template/src/views/hello/router.ts +0 -12
- package/src/commands/init/template/src/views/hello/theme/index.ts +0 -18
- package/src/commands/init/template/src/vite-env.d.ts +0 -1
- package/src/commands/init/template/tsconfig.app.json +0 -28
- package/src/commands/init/template/tsconfig.json +0 -11
- package/src/commands/init/template/tsconfig.node.json +0 -13
- package/src/commands/init/template/vite.config.ts +0 -11
- package/src/vite-plugins/das-fe-resolve/index.js +0 -1
- package/src/vite-plugins/das-fe-ui/index.js +0 -1
- package/src/vite-plugins/das-fe-utils/index.js +0 -1
- package/src/vite-plugins/das-fe-web/index.js +0 -1
- package/src/vite-plugins/dynamic-entry/index.js +0 -1
package/package.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import inquirer from"inquirer";import glob from"fast-glob";import{dirname,resolve}from"path";import{fileURLToPath}from"url";import fs from"fs-extra";import{consola}from"consola";import{execSync}from"child_process";
|
1
|
+
import inquirer from"inquirer";import glob from"fast-glob";import{dirname,resolve}from"path";import{fileURLToPath}from"url";import fs from"fs-extra";import{consola}from"consola";import{execSync}from"child_process";let __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),getPackageJson=()=>{var e=resolve(__dirname,"../../../package.json");return fs.existsSync(e)?fs.readJSONSync(e):{}};export default{alias:["create","create-app","-c"],handle:async e=>{var a=getPackageJson(),a=(consola.box(`Using ${a.name} v`+a.version),consola.info("create app for @das-fed"),consola.warn("必须使用 pnpm 作为依赖安装工具"),await inquirer.prompt([{name:"inputName",type:"input",message:"请输入应用名称,要求全小写(请与git地址最后一级保持一致,比如:http://xxx/payment-center.git;则为payment-center)"}])).inputName,[r]=(a||(consola.error("应用名称必填!"),process.exit()),a.split("/").slice(-1)),i="enterpriseadmin/"+r,a=(consola.success(`子应用名称为: ${i} (enterpriseadmin为默认加入的前缀)`),await inquirer.prompt([{name:"overwrite",type:"confirm",message:"初始化项目将覆盖当前目录的文件及文件夹,是否继续?"}])).overwrite;if(!a)return process.exit();var o,s=process.cwd(),t=resolve(__dirname,"./template");for(o of await glob(["**/**"],{cwd:t,dot:!0})){var n=resolve(s,o);await fs.copy(resolve(t,o),n,{overwrite:!0})}var p,a=resolve(s,"./packages/microapp"),c=resolve(s,"./packages/"+r),a=(await fs.ensureDir(c),await fs.copy(a,c,{overwrite:!0}),await fs.remove(a),await glob(["**/**"],{cwd:c,dot:!0}));for(p of a){var l,m=resolve(c,p);(-1<p.indexOf("public/config.js")||-1<p.indexOf("src/main.dev.ts")||-1<p.indexOf("src/main.ts"))&&(l=(await fs.readFile(m)).toString(),await fs.writeFile(m,l.replaceAll("%microAppName%",i))),-1<p.indexOf("package.json")&&(l=(await fs.readFile(m)).toString(),await fs.writeFile(m,l.replaceAll("%packageName%",r)))}var a=["vue","vue-router","pinia-plugin-persistedstate"],d=["@vitejs/plugin-vue","typescript","vite","vue-tsc"];let f=(await inquirer.prompt([{name:"version",type:"input",message:"请输入需要安装的@das-fed版本"}])).version,v=(f||(consola.error("@das-fed版本必填!"),process.exit()),["@das-fed/web","@das-fed/ui","@das-fed/utils"]),u=["@das-fed/cli"];f&&(v=v.map(e=>e+"@"+f),u=u.map(e=>e+"@"+f)),a.push(...v),d.push(...u),execSync("pnpm add "+a.join(" "),{cwd:c,stdio:"inherit"}),execSync("pnpm add -D "+d.join(" "),{cwd:c,stdio:"inherit"}),console.log(""),consola.success("项目初始化完成!"),consola.box("run: pnpm run dev")}};
|
@@ -1 +0,0 @@
|
|
1
|
-
let extraAuth=async()=>{};export{extraAuth};
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import{resolve,relative,dirname}from"path";import{fileURLToPath}from"url";import fs from"fs-extra";import{build}from"vite";import prettier from"prettier";import glob from"fast-glob";let __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),extractWrappedChinese=e=>{var s,e=(s=e.replace(/<!--[\s\S]*?-->/g,"").replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"").replace(/^\s*console\..*$/gm,"")).replace(/(\bi18n\b|\bt\b)\s*\(([^)]*)$/gm,(e,r,t,i)=>{var a=s.indexOf(")",i);return-1!==a?e+s.slice(i+e.length,a+1).replace(/\n\s*/g,""):e});let a=/[\u4e00-\u9fa5]+/g,l=/(?:i18n|t)\s*\(\s*(['"`])/,o=[];return e.split("\n").forEach(e=>{for(;null!==(t=a.exec(e));){var[r]=t,t=t.index,i=t+r.length,t=e.slice(0,t).trim(),i=e.slice(i).trim();l.test(t)&&i.includes(")")&&o.push(r)}}),o},extraI18n=async e=>{var{cwd:r=process.cwd()}=e||{},e=resolve(r,"i18n-colletion.local.ts"),t=(await fs.exists(e)||(await fs.ensureFile(e),await fs.writeFile(e,"export default import.meta.glob(['./src/**/**/i18n/*.ts','!./src/**/**/i18n/useI18n.ts'], { eager: true, import: 'default' })")),resolve(__dirname,"./.temp"));await fs.ensureDir(t);let i=`index.${(new Date).getTime()}.cjs`;await build({configFile:resolve(__dirname,"./vite.config.ts"),build:{emptyOutDir:!0,outDir:t,lib:{entry:e,fileName:()=>i,formats:["cjs"]}}});var a,s,l=(await import("./.temp/"+i)).default;let o={};for(a in l)Object.assign(o,l[a]);for(s of await glob(["src/**/**/*.vue","src/**/**/*.ts","!src/**/**/i18n/*.ts"],{cwd:r,onlyFiles:!0})){var n=resolve(r,s),n=(await fs.readFile(n)).toString(),n=extractWrappedChinese(n);0<n.length&&n.map(e=>o[e]="")}var f=resolve(r,"public/i18n-collection");await fs.ensureDir(f),await fs.emptyDir(f);for(let a of["zh-CN","en"]){let i="export default {";Object.keys(o).map(e=>{var r=o[e];let t=r[a]||"";"zh-CN"===a&&(t=r[a]||r["zh-cn"]||r),i+=`'${e}': "${t}",\r
|
2
|
-
`}),i+="}";var m=resolve(f,a+".js");await fs.ensureFile(m),await fs.writeFile(m,await prettier.format(i,{parser:"typescript"}))}};export{extraI18n};
|
@@ -1 +0,0 @@
|
|
1
|
-
export default {}
|
@@ -1 +0,0 @@
|
|
1
|
-
import{extraI18n}from"./i18n/index.js";import{extraTheme}from"./theme/index.js";import{extraAuth}from"./auth/index.js";let extra=async e=>{await Promise.all([extraI18n(e),extraTheme(e),extraAuth(e)])};export{extra};
|
@@ -1 +0,0 @@
|
|
1
|
-
let extraTheme=async()=>{};export{extraTheme};
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# pnpm-workspace app for @das-fed
|
2
|
-
|
3
|
-
## install
|
4
|
-
|
5
|
-
```
|
6
|
-
pnpm i
|
7
|
-
```
|
8
|
-
|
9
|
-
## dev
|
10
|
-
|
11
|
-
```
|
12
|
-
pnpm run dev
|
13
|
-
```
|
14
|
-
|
15
|
-
## build
|
16
|
-
|
17
|
-
```
|
18
|
-
pnpm run build
|
19
|
-
```
|
20
|
-
|
21
|
-
## config配置
|
22
|
-
|
23
|
-
### 如需本地开发开启sso登录
|
24
|
-
|
25
|
-
public/config.js,public/config.local.js中设置配置【sso: true, baseURL: 'http://ssoServer.com'】,其中baseURL为某个支持sso登录的环境地址
|
26
|
-
|
27
|
-
|
28
|
-
### 如本地需要登录失效后重定向到登录页面
|
29
|
-
public/config.js,public/config.local.js中设置配置【noRedireLogin: false】
|
@@ -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>
|
7
|
-
</head>
|
8
|
-
<body>
|
9
|
-
<div id="app"></div>
|
10
|
-
<script type="module" src="/src/main.ts"></script>
|
11
|
-
</body>
|
12
|
-
</html>
|
@@ -1,9 +0,0 @@
|
|
1
|
-
export default () => {
|
2
|
-
return {
|
3
|
-
microAppName: __MICRO_APPNAME__,
|
4
|
-
router: { glob: import.meta.glob('@/views/**/router.ts', { eager: true, import: 'default' }) },
|
5
|
-
plugins: { glob: import.meta.glob('@/plugins/*/index.ts', { eager: true, import: 'default' }) },
|
6
|
-
theme: { glob: import.meta.glob('@/**/theme/*.ts', { eager: true, import: 'default' }) },
|
7
|
-
i18n: { glob: import.meta.glob('@/**/i18n/*.ts', { eager: true, import: 'default' }) },
|
8
|
-
}
|
9
|
-
}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import { createDasWebApp } from '@das-fed/web'
|
2
|
-
import '@das-fed/web/packages/style'
|
3
|
-
|
4
|
-
createDasWebApp({
|
5
|
-
// @ts-ignore
|
6
|
-
microAppName: __MICRO_APPNAME__,
|
7
|
-
router: { glob: import.meta.glob('@/views/**/router.ts', { eager: true, import: 'default' }) },
|
8
|
-
plugins: { glob: import.meta.glob('@/plugins/*/index.ts', { eager: true, import: 'default' }) },
|
9
|
-
})
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import { createDasWebApp } from '@das-fed/web'
|
2
|
-
|
3
|
-
createDasWebApp({
|
4
|
-
// @ts-ignore
|
5
|
-
microAppName: __MICRO_APPNAME__,
|
6
|
-
router: { glob: import.meta.glob('@/views/**/router.ts', { eager: true, import: 'default' }) },
|
7
|
-
plugins: { glob: import.meta.glob('@/plugins/*/index.ts', { eager: true, import: 'default' }) },
|
8
|
-
})
|
@@ -1,61 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<div class="demo-container">
|
3
|
-
<h2>
|
4
|
-
{{ t('demo-msg') }}
|
5
|
-
</h2>
|
6
|
-
|
7
|
-
<a href="http://aiot-ui.rd.chn-das.com/das-ui" target="_blank">
|
8
|
-
<p class="read-the-docs">{{ t('demo-doc-tip') }}</p>
|
9
|
-
</a>
|
10
|
-
|
11
|
-
<div>{{ t('demo-component-msg') }}</div>
|
12
|
-
<div class="alert-container">
|
13
|
-
<div v-for="item in ['info', 'success', 'warning', 'error']" :key="item" class="alert-item">
|
14
|
-
<DasAlert show-icon :message="`${item} Text`" :type="item" />
|
15
|
-
</div>
|
16
|
-
</div>
|
17
|
-
|
18
|
-
<div>@das-fed/ui组件库中DasIcon使用案例</div>
|
19
|
-
<DasIconAdd />
|
20
|
-
</div>
|
21
|
-
</template>
|
22
|
-
|
23
|
-
<script setup lang="ts">
|
24
|
-
import { t } from '@das-fed/web'
|
25
|
-
import { DasAlert, DasIconAdd } from '@das-fed/ui'
|
26
|
-
</script>
|
27
|
-
|
28
|
-
<style>
|
29
|
-
.demo-container {
|
30
|
-
margin: 0 auto;
|
31
|
-
padding: 2rem;
|
32
|
-
text-align: center;
|
33
|
-
height: 100%;
|
34
|
-
background: var(--hello-bg);
|
35
|
-
color: var(--hello-color);
|
36
|
-
}
|
37
|
-
.demo-container h2 {
|
38
|
-
color: var(--hello-color);
|
39
|
-
}
|
40
|
-
.alert-container {
|
41
|
-
background: var(--demo-alert-bg);
|
42
|
-
color: var(--demo-alert-color);
|
43
|
-
padding: 20px;
|
44
|
-
margin: 10px 0;
|
45
|
-
border-radius: 10px;
|
46
|
-
box-sizing: border-box;
|
47
|
-
height: auto;
|
48
|
-
min-width: 600px;
|
49
|
-
}
|
50
|
-
.alert-item {
|
51
|
-
margin-top: 20px;
|
52
|
-
}
|
53
|
-
.alert-item:first-child {
|
54
|
-
margin-top: 0;
|
55
|
-
}
|
56
|
-
.read-the-docs {
|
57
|
-
cursor: pointer;
|
58
|
-
font-size: 14px;
|
59
|
-
font-weight: 400;
|
60
|
-
}
|
61
|
-
</style>
|
@@ -1,14 +0,0 @@
|
|
1
|
-
export default {
|
2
|
-
'demo-msg': {
|
3
|
-
'zh-CN': '这是第一个示例路由页面',
|
4
|
-
en: 'This is Demo Page',
|
5
|
-
},
|
6
|
-
'demo-doc-tip': {
|
7
|
-
'zh-CN': '查看完整组件库文档',
|
8
|
-
en: 'read the components doc',
|
9
|
-
},
|
10
|
-
'demo-component-msg': {
|
11
|
-
'zh-CN': '@das-fed/ui组件库中DasAlert使用案例',
|
12
|
-
en: 'the DasAlert example of @das-fed/ui',
|
13
|
-
},
|
14
|
-
}
|
@@ -1,13 +0,0 @@
|
|
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: '/demo',
|
11
|
-
component: () => import('./app.vue'),
|
12
|
-
meta: { keepAlive: true },
|
13
|
-
} as RouteRecordRaw
|
@@ -1,157 +0,0 @@
|
|
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>
|
Binary file
|
@@ -1 +0,0 @@
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
@@ -1 +0,0 @@
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>
|
@@ -1,16 +0,0 @@
|
|
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 +0,0 @@
|
|
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 +0,0 @@
|
|
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 +0,0 @@
|
|
1
|
-
/// <reference types="vite/client" />
|
@@ -1,28 +0,0 @@
|
|
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,13 +0,0 @@
|
|
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,11 +0,0 @@
|
|
1
|
-
import { defineConfig } from 'vite'
|
2
|
-
import { dasFeWebVitePlugin } from '@das-fed/cli'
|
3
|
-
import config from './config.js'
|
4
|
-
|
5
|
-
// https://vitejs.dev/config/
|
6
|
-
export default defineConfig(({ command }) => {
|
7
|
-
return {
|
8
|
-
define: { __MICRO_APPNAME__: JSON.stringify(config.microAppName) },
|
9
|
-
plugins: [dasFeWebVitePlugin()],
|
10
|
-
}
|
11
|
-
})
|
@@ -1 +0,0 @@
|
|
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 +0,0 @@
|
|
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 +0,0 @@
|
|
1
|
-
import{extname}from"path";import MagicString from"magic-string";import{parseImportCode}from"../../utils/parse-import-code.js";import{resolve}from"path";import fs from"fs-extra";let cwd=process.cwd(),nodeModulesDir=resolve(cwd,"node_modules"),esmMapPath=resolve(nodeModulesDir,"@das-fed/utils/esm-map.json"),esmMapPathExits=fs.existsSync(esmMapPath),esmMap=esmMapPathExits?fs.readJSONSync(esmMapPath):{};export default(e=0)=>({name:"das-fed-ui-esm",enforce:"pre",transform(e,t){if(!(-1<t.indexOf("?"))&&[".vue",".ts",".js",".jsx",".tsx"].includes(extname(t))){t=parseImportCode(e,"@das-fed/utils");if(t){let s=new MagicString(e);return t.map(e=>{let t="";e.members.map(e=>{var s=e.name,s=esmMap[s];s&&(t+=`import { ${e.code} } from '@das-fed/utils${s}';`)}),s.overwrite(e.start,e.end,t)}),s.toString()}}}});
|
@@ -1 +0,0 @@
|
|
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)];
|
@@ -1 +0,0 @@
|
|
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}}}};
|