@das-fed/cli 7.1.0-dev.18 → 7.1.0-dev.19

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.
Files changed (23) hide show
  1. package/package.json +1 -1
  2. package/src/commands/build/nginx.main.conf +54 -54
  3. package/src/commands/build/nginx.micro.conf +56 -56
  4. package/src/commands/init/template/.pnpmfile.cjs +29 -29
  5. package/src/commands/init/template/.prettierignore +21 -21
  6. package/src/commands/init/template/.prettierrc +8 -8
  7. package/src/commands/init/template/package.json +7 -7
  8. package/src/commands/init/template/packages/microapp/index.html +13 -13
  9. package/src/commands/init/template/packages/microapp/package.json +25 -25
  10. package/src/commands/init/template/packages/microapp/public/config.js +3 -3
  11. package/src/commands/init/template/packages/microapp/src/das-web-app.ts +11 -11
  12. package/src/commands/init/template/packages/microapp/src/main.dev.ts +16 -16
  13. package/src/commands/init/template/packages/microapp/src/main.ts +10 -10
  14. package/src/commands/init/template/packages/microapp/src/views/demo/api/index.ts +6 -6
  15. package/src/commands/init/template/packages/microapp/src/views/demo/app.vue +157 -157
  16. package/src/commands/init/template/packages/microapp/src/views/demo/i18n/index.ts +16 -16
  17. package/src/commands/init/template/packages/microapp/src/views/demo/router.ts +12 -12
  18. package/src/commands/init/template/packages/microapp/src/views/demo/theme/index.ts +18 -18
  19. package/src/commands/init/template/packages/microapp/tsconfig.json +32 -32
  20. package/src/commands/init/template/packages/microapp/tsconfig.node.json +10 -10
  21. package/src/commands/init/template/packages/microapp/vite.config.ts +7 -7
  22. package/src/commands/init/template/pnpm-workspace.yaml +6 -6
  23. package/src/commands/init/template/scripts/build.js +34 -34
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@das-fed/cli",
3
- "version": "7.1.0-dev.18",
3
+ "version": "7.1.0-dev.19",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -1,55 +1,55 @@
1
- worker_processes 4;
2
- worker_rlimit_nofile 6000;
3
- events {
4
- worker_connections 1000;
5
- }
6
- http {
7
- include mime.types;
8
- default_type application/octet-stream;
9
-
10
- # 使用gzip压缩
11
- gzip on;
12
- gzip_proxied any;
13
- gzip_http_version 1.0;
14
- gzip_min_length 1100;
15
- gzip_buffers 4 16k;
16
- gzip_comp_level 1;
17
- gzip_vary on;
18
- gzip_types text/plain application/x-javascript text/css application/xml text/javascript application/json application/javascript image/x-icon;
19
- gzip_disable "MSIE [1-6]\.";
20
-
21
- # proxy配置
22
- proxy_http_version 1.1;
23
- proxy_connect_timeout 86400s;
24
- proxy_read_timeout 86400s;
25
- proxy_send_timeout 86400s;
26
- proxy_set_header Upgrade $http_upgrade;
27
- proxy_set_header Connection "upgrade";
28
- proxy_set_header Host $host;
29
- proxy_set_header X-Real-IP $remote_addr;
30
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
31
- proxy_set_header X-Forwarded-Proto $scheme;
32
- proxy_set_header X-Frame-Options SAMEORIGIN;
33
-
34
-
35
-
36
- sendfile on;
37
- keepalive_timeout 65;
38
- client_max_body_size 500m;
39
- server_tokens off;
40
- server {
41
- listen 80;
42
- etag on;
43
- location / {
44
- root /usr/share/nginx/html;
45
- index index.html index.htm;
46
- try_files $uri $uri/ /index.html;
47
- expires 0;
48
- }
49
-
50
- error_page 500 502 503 504 /50x.html;
51
- location = /50x.html {
52
- root html;
53
- }
54
- }
1
+ worker_processes 4;
2
+ worker_rlimit_nofile 6000;
3
+ events {
4
+ worker_connections 1000;
5
+ }
6
+ http {
7
+ include mime.types;
8
+ default_type application/octet-stream;
9
+
10
+ # 使用gzip压缩
11
+ gzip on;
12
+ gzip_proxied any;
13
+ gzip_http_version 1.0;
14
+ gzip_min_length 1100;
15
+ gzip_buffers 4 16k;
16
+ gzip_comp_level 1;
17
+ gzip_vary on;
18
+ gzip_types text/plain application/x-javascript text/css application/xml text/javascript application/json application/javascript image/x-icon;
19
+ gzip_disable "MSIE [1-6]\.";
20
+
21
+ # proxy配置
22
+ proxy_http_version 1.1;
23
+ proxy_connect_timeout 86400s;
24
+ proxy_read_timeout 86400s;
25
+ proxy_send_timeout 86400s;
26
+ proxy_set_header Upgrade $http_upgrade;
27
+ proxy_set_header Connection "upgrade";
28
+ proxy_set_header Host $host;
29
+ proxy_set_header X-Real-IP $remote_addr;
30
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
31
+ proxy_set_header X-Forwarded-Proto $scheme;
32
+ proxy_set_header X-Frame-Options SAMEORIGIN;
33
+
34
+
35
+
36
+ sendfile on;
37
+ keepalive_timeout 65;
38
+ client_max_body_size 500m;
39
+ server_tokens off;
40
+ server {
41
+ listen 80;
42
+ etag on;
43
+ location / {
44
+ root /usr/share/nginx/html;
45
+ index index.html index.htm;
46
+ try_files $uri $uri/ /index.html;
47
+ expires 0;
48
+ }
49
+
50
+ error_page 500 502 503 504 /50x.html;
51
+ location = /50x.html {
52
+ root html;
53
+ }
54
+ }
55
55
  }
@@ -1,57 +1,57 @@
1
- worker_processes 2;
2
- worker_rlimit_nofile 2000;
3
- events {
4
- worker_connections 1000;
5
- }
6
- http {
7
- include mime.types;
8
- default_type application/octet-stream;
9
- # 使用gzip压缩
10
- gzip on;
11
- gzip_proxied any;
12
- gzip_http_version 1.0;
13
- gzip_min_length 1100;
14
- gzip_buffers 4 16k;
15
- gzip_comp_level 1;
16
- gzip_vary on;
17
- gzip_types text/plain application/x-javascript text/css application/xml text/javascript application/json application/javascript image/x-icon;
18
- gzip_disable "MSIE [1-6]\.";
19
-
20
- # proxy配置
21
- proxy_http_version 1.1;
22
- proxy_connect_timeout 86400s;
23
- proxy_read_timeout 86400s;
24
- proxy_send_timeout 86400s;
25
- proxy_set_header Upgrade $http_upgrade;
26
- proxy_set_header Connection "upgrade";
27
- proxy_set_header Host $host;
28
- proxy_set_header X-Real-IP $remote_addr;
29
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
30
- proxy_set_header X-Forwarded-Proto $scheme;
31
- proxy_set_header X-Frame-Options SAMEORIGIN;
32
-
33
-
34
- sendfile on;
35
- keepalive_timeout 65;
36
- client_max_body_size 500m;
37
- server_tokens off;
38
- server {
39
- listen 80;
40
- etag on;
41
-
42
- location ~ ^/(api|oss)/ {
43
- proxy_pass http://gateway:9080;
44
- }
45
-
46
- location {url} {
47
- alias /usr/share/nginx/html;
48
- try_files $uri $uri/ /index.html;
49
- expires 0;
50
- }
51
-
52
- error_page 500 502 503 504 /50x.html;
53
- location = /50x.html {
54
- root html;
55
- }
56
- }
1
+ worker_processes 2;
2
+ worker_rlimit_nofile 2000;
3
+ events {
4
+ worker_connections 1000;
5
+ }
6
+ http {
7
+ include mime.types;
8
+ default_type application/octet-stream;
9
+ # 使用gzip压缩
10
+ gzip on;
11
+ gzip_proxied any;
12
+ gzip_http_version 1.0;
13
+ gzip_min_length 1100;
14
+ gzip_buffers 4 16k;
15
+ gzip_comp_level 1;
16
+ gzip_vary on;
17
+ gzip_types text/plain application/x-javascript text/css application/xml text/javascript application/json application/javascript image/x-icon;
18
+ gzip_disable "MSIE [1-6]\.";
19
+
20
+ # proxy配置
21
+ proxy_http_version 1.1;
22
+ proxy_connect_timeout 86400s;
23
+ proxy_read_timeout 86400s;
24
+ proxy_send_timeout 86400s;
25
+ proxy_set_header Upgrade $http_upgrade;
26
+ proxy_set_header Connection "upgrade";
27
+ proxy_set_header Host $host;
28
+ proxy_set_header X-Real-IP $remote_addr;
29
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
30
+ proxy_set_header X-Forwarded-Proto $scheme;
31
+ proxy_set_header X-Frame-Options SAMEORIGIN;
32
+
33
+
34
+ sendfile on;
35
+ keepalive_timeout 65;
36
+ client_max_body_size 500m;
37
+ server_tokens off;
38
+ server {
39
+ listen 80;
40
+ etag on;
41
+
42
+ location ~ ^/(api|oss)/ {
43
+ proxy_pass http://gateway:9080;
44
+ }
45
+
46
+ location {url} {
47
+ alias /usr/share/nginx/html;
48
+ try_files $uri $uri/ /index.html;
49
+ expires 0;
50
+ }
51
+
52
+ error_page 500 502 503 504 /50x.html;
53
+ location = /50x.html {
54
+ root html;
55
+ }
56
+ }
57
57
  }
@@ -1,29 +1,29 @@
1
- const parseArgs = (args) => {
2
- return args.reduce((acc, arg) => {
3
- const [key, value] = arg.split('=')
4
- acc[key.replace(/^--/, '')] = value
5
- return acc
6
- }, {})
7
- }
8
- const argv = parseArgs(process.argv.slice(2))
9
- const frameworkVersion = argv['config.frameworkVersion']
10
-
11
- function readPackage(pkg, context) {
12
- const lockPackages = {
13
- '@das-fed/cli': frameworkVersion,
14
- '@das-fed/ui': frameworkVersion,
15
- '@das-fed/utils': frameworkVersion,
16
- '@das-fed/web': frameworkVersion,
17
- '@das-fed/web-components': frameworkVersion,
18
- 'mpegts.js': '1.7.3',
19
- }
20
- Object.keys(pkg.dependencies)
21
- .filter((key) => pkg.dependencies[key] && lockPackages[key])
22
- .forEach((key) => (pkg.dependencies[key] = lockPackages[key]))
23
- Object.keys(pkg.devDependencies)
24
- .filter((key) => pkg.dependencies[key] && lockPackages[key])
25
- .forEach((key) => (pkg.dependencies[key] = lockPackages[key]))
26
- return pkg
27
- }
28
-
29
- module.exports = { hooks: { readPackage } }
1
+ const parseArgs = (args) => {
2
+ return args.reduce((acc, arg) => {
3
+ const [key, value] = arg.split('=')
4
+ acc[key.replace(/^--/, '')] = value
5
+ return acc
6
+ }, {})
7
+ }
8
+ const argv = parseArgs(process.argv.slice(2))
9
+ const frameworkVersion = argv['config.frameworkVersion']
10
+
11
+ function readPackage(pkg, context) {
12
+ const lockPackages = {
13
+ '@das-fed/cli': frameworkVersion,
14
+ '@das-fed/ui': frameworkVersion,
15
+ '@das-fed/utils': frameworkVersion,
16
+ '@das-fed/web': frameworkVersion,
17
+ '@das-fed/web-components': frameworkVersion,
18
+ 'mpegts.js': '1.7.3',
19
+ }
20
+ Object.keys(pkg.dependencies)
21
+ .filter((key) => pkg.dependencies[key] && lockPackages[key])
22
+ .forEach((key) => (pkg.dependencies[key] = lockPackages[key]))
23
+ Object.keys(pkg.devDependencies)
24
+ .filter((key) => pkg.dependencies[key] && lockPackages[key])
25
+ .forEach((key) => (pkg.dependencies[key] = lockPackages[key]))
26
+ return pkg
27
+ }
28
+
29
+ module.exports = { hooks: { readPackage } }
@@ -1,21 +1,21 @@
1
- ## OS
2
- .DS_Store
3
- .idea
4
- .editorconfig
5
- pnpm-lock.yaml
6
- .npmrc
7
-
8
- # Ignored suffix
9
- *.log
10
- *.md
11
- *.svg
12
- *.png
13
- *.ico
14
- *ignore
15
-
16
- ## Local
17
- .husky
18
-
19
- ## Built-files
20
- .cache
21
- dist
1
+ ## OS
2
+ .DS_Store
3
+ .idea
4
+ .editorconfig
5
+ pnpm-lock.yaml
6
+ .npmrc
7
+
8
+ # Ignored suffix
9
+ *.log
10
+ *.md
11
+ *.svg
12
+ *.png
13
+ *.ico
14
+ *ignore
15
+
16
+ ## Local
17
+ .husky
18
+
19
+ ## Built-files
20
+ .cache
21
+ dist
@@ -1,8 +1,8 @@
1
- {
2
- "singleQuote": true,
3
- "tabWidth": 2,
4
- "printWidth": 120,
5
- "semi": false,
6
- "trailingComma": "all",
7
- "bracketSpacing": true
8
- }
1
+ {
2
+ "singleQuote": true,
3
+ "tabWidth": 2,
4
+ "printWidth": 120,
5
+ "semi": false,
6
+ "trailingComma": "all",
7
+ "bracketSpacing": true
8
+ }
@@ -1,7 +1,7 @@
1
- {
2
- "private": "true",
3
- "type": "module",
4
- "scripts": {
5
- "build": "node scripts/build"
6
- }
7
- }
1
+ {
2
+ "private": "true",
3
+ "type": "module",
4
+ "scripts": {
5
+ "build": "node scripts/build"
6
+ }
7
+ }
@@ -1,13 +1,13 @@
1
- <!doctype html>
2
- <html lang="zh-CN">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <link rel="icon" type="image/svg+xml" href="" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title></title>
8
- </head>
9
- <body>
10
- <div id="app"></div>
11
- <script type="module" src="/src/main.ts"></script>
12
- </body>
13
- </html>
1
+ <!doctype html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title></title>
8
+ </head>
9
+ <body>
10
+ <div id="app"></div>
11
+ <script type="module" src="/src/main.ts"></script>
12
+ </body>
13
+ </html>
@@ -1,25 +1,25 @@
1
- {
2
- "name": "@das-fed-apps/%packageName%",
3
- "version": "0.0.0",
4
- "type": "module",
5
- "scripts": {
6
- "dev": "das-cli dev",
7
- "build": "das-cli build",
8
- "preview": "vite preview"
9
- },
10
- "dependencies": {
11
- "@das-fed/ui": "6.4.0-dev.83",
12
- "@das-fed/utils": "6.4.0-dev.83",
13
- "@das-fed/web": "6.4.0-dev.83",
14
- "vue": "^3.5.13",
15
- "vue-router": "^4.5.0",
16
- "dayjs": "^1.11.10"
17
- },
18
- "devDependencies": {
19
- "@das-fed/cli": "6.4.0-dev.83",
20
- "@vitejs/plugin-vue": "^5.0.4",
21
- "typescript": "^5.7.2",
22
- "vite": "^5.2.7",
23
- "vue-tsc": "^1.6.5"
24
- }
25
- }
1
+ {
2
+ "name": "@das-fed-apps/%packageName%",
3
+ "version": "0.0.0",
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "das-cli dev",
7
+ "build": "das-cli build",
8
+ "preview": "vite preview"
9
+ },
10
+ "dependencies": {
11
+ "@das-fed/ui": "6.4.0-dev.83",
12
+ "@das-fed/utils": "6.4.0-dev.83",
13
+ "@das-fed/web": "6.4.0-dev.83",
14
+ "vue": "^3.5.13",
15
+ "vue-router": "^4.5.0",
16
+ "dayjs": "^1.11.10"
17
+ },
18
+ "devDependencies": {
19
+ "@das-fed/cli": "6.4.0-dev.83",
20
+ "@vitejs/plugin-vue": "^5.0.4",
21
+ "typescript": "^5.7.2",
22
+ "vite": "^5.2.7",
23
+ "vue-tsc": "^1.6.5"
24
+ }
25
+ }
@@ -1,3 +1,3 @@
1
- window.config = {
2
- microAppName: '%microAppName%',
3
- }
1
+ window.config = {
2
+ microAppName: '%microAppName%',
3
+ }
@@ -1,11 +1,11 @@
1
- import '@das-fed/web/packages/style'
2
-
3
- export default () => {
4
- return {
5
- microAppName: '%microAppName%',
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
- theme: { glob: import.meta.glob('@/**/**/theme/*.ts', { eager: true, import: 'default' }) },
9
- i18n: { glob: import.meta.glob('@/**/**/i18n/*.ts', { eager: true, import: 'default' }) },
10
- }
11
- }
1
+ import '@das-fed/web/packages/style'
2
+
3
+ export default () => {
4
+ return {
5
+ microAppName: '%microAppName%',
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
+ theme: { glob: import.meta.glob('@/**/**/theme/*.ts', { eager: true, import: 'default' }) },
9
+ i18n: { glob: import.meta.glob('@/**/**/i18n/*.ts', { eager: true, import: 'default' }) },
10
+ }
11
+ }
@@ -1,16 +1,16 @@
1
- import { createDasWebApp, mainAppFramework } from '@das-fed/web'
2
- import '@das-fed/web/packages/style'
3
-
4
- createDasWebApp({
5
- root: { component: mainAppFramework.Layout },
6
- router: { routers: mainAppFramework.routes },
7
- microApps: [
8
- {
9
- microAppName: '%microAppName%',
10
- router: { glob: import.meta.glob('@/views/**/**/router.ts', { eager: true, import: 'default' }) },
11
- plugins: { glob: import.meta.glob('@/plugins/*/index.ts', { eager: true, import: 'default' }) },
12
- theme: { glob: import.meta.glob('@/**/**/theme/*.ts', { eager: true, import: 'default' }) },
13
- i18n: { glob: import.meta.glob('@/**/**/i18n/*.ts', { eager: true, import: 'default' }) },
14
- },
15
- ],
16
- })
1
+ import { createDasWebApp, mainAppFramework } from '@das-fed/web'
2
+ import '@das-fed/web/packages/style'
3
+
4
+ createDasWebApp({
5
+ root: { component: mainAppFramework.Layout },
6
+ router: { routers: mainAppFramework.routes },
7
+ microApps: [
8
+ {
9
+ microAppName: '%microAppName%',
10
+ router: { glob: import.meta.glob('@/views/**/**/router.ts', { eager: true, import: 'default' }) },
11
+ plugins: { glob: import.meta.glob('@/plugins/*/index.ts', { eager: true, import: 'default' }) },
12
+ theme: { glob: import.meta.glob('@/**/**/theme/*.ts', { eager: true, import: 'default' }) },
13
+ i18n: { glob: import.meta.glob('@/**/**/i18n/*.ts', { eager: true, import: 'default' }) },
14
+ },
15
+ ],
16
+ })
@@ -1,10 +1,10 @@
1
- import { createDasWebApp } from '@das-fed/web'
2
- import '@das-fed/web/packages/style'
3
-
4
- createDasWebApp({
5
- microAppName: '%microAppName%',
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
- theme: { glob: import.meta.glob('@/**/**/theme/*.ts', { eager: true, import: 'default' }) },
9
- i18n: { glob: import.meta.glob('@/**/**/i18n/*.ts', { eager: true, import: 'default' }) },
10
- })
1
+ import { createDasWebApp } from '@das-fed/web'
2
+ import '@das-fed/web/packages/style'
3
+
4
+ createDasWebApp({
5
+ microAppName: '%microAppName%',
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
+ theme: { glob: import.meta.glob('@/**/**/theme/*.ts', { eager: true, import: 'default' }) },
9
+ i18n: { glob: import.meta.glob('@/**/**/i18n/*.ts', { eager: true, import: 'default' }) },
10
+ })
@@ -1,6 +1,6 @@
1
- import { createService } from '@das-fed/utils/create-api-service'
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/create-api-service'
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,32 +1,32 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2020",
4
- "useDefineForClassFields": true,
5
- "module": "ESNext",
6
- "lib": ["ES2020", "DOM", "DOM.Iterable"],
7
- "skipLibCheck": true,
8
-
9
- /* Bundler mode */
10
- "moduleResolution": "bundler",
11
- "allowImportingTsExtensions": true,
12
- "resolveJsonModule": true,
13
- "isolatedModules": true,
14
- "noEmit": true,
15
- "jsx": "preserve",
16
- "jsxImportSource": "vue", // vue 3.4+ 需要显示指定jsx导出为vue
17
-
18
- /* Linting */
19
- "strict": true,
20
- "noUnusedLocals": false,
21
- "noUnusedParameters": true,
22
- "noFallthroughCasesInSwitch": true,
23
-
24
- /* @ alias */
25
- "baseUrl": "./",
26
- "paths": {
27
- "@/*": ["src/*"]
28
- }
29
- },
30
- "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
31
- "references": [{ "path": "./tsconfig.node.json" }]
32
- }
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "useDefineForClassFields": true,
5
+ "module": "ESNext",
6
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
7
+ "skipLibCheck": true,
8
+
9
+ /* Bundler mode */
10
+ "moduleResolution": "bundler",
11
+ "allowImportingTsExtensions": true,
12
+ "resolveJsonModule": true,
13
+ "isolatedModules": true,
14
+ "noEmit": true,
15
+ "jsx": "preserve",
16
+ "jsxImportSource": "vue", // vue 3.4+ 需要显示指定jsx导出为vue
17
+
18
+ /* Linting */
19
+ "strict": true,
20
+ "noUnusedLocals": false,
21
+ "noUnusedParameters": true,
22
+ "noFallthroughCasesInSwitch": true,
23
+
24
+ /* @ alias */
25
+ "baseUrl": "./",
26
+ "paths": {
27
+ "@/*": ["src/*"]
28
+ }
29
+ },
30
+ "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
31
+ "references": [{ "path": "./tsconfig.node.json" }]
32
+ }
@@ -1,10 +1,10 @@
1
- {
2
- "compilerOptions": {
3
- "composite": true,
4
- "skipLibCheck": true,
5
- "module": "ESNext",
6
- "moduleResolution": "bundler",
7
- "allowSyntheticDefaultImports": true
8
- },
9
- "include": ["vite.config.ts"]
10
- }
1
+ {
2
+ "compilerOptions": {
3
+ "composite": true,
4
+ "skipLibCheck": true,
5
+ "module": "ESNext",
6
+ "moduleResolution": "bundler",
7
+ "allowSyntheticDefaultImports": true
8
+ },
9
+ "include": ["vite.config.ts"]
10
+ }
@@ -1,7 +1,7 @@
1
- import { defineConfig } from 'vite'
2
- import { dasFeWebVitePlugin } from '@das-fed/cli'
3
-
4
- // https://vitejs.dev/config/
5
- export default defineConfig({
6
- plugins: [dasFeWebVitePlugin({ dasWebApp: { type: 'microApp' } })],
7
- })
1
+ import { defineConfig } from 'vite'
2
+ import { dasFeWebVitePlugin } from '@das-fed/cli'
3
+
4
+ // https://vitejs.dev/config/
5
+ export default defineConfig({
6
+ plugins: [dasFeWebVitePlugin({ dasWebApp: { type: 'microApp' } })],
7
+ })
@@ -1,6 +1,6 @@
1
- # pnpm-workspace.yaml
2
- packages:
3
- # all packages in direct subdirs of packages/
4
- - 'packages/*'
5
-
6
- - 'packages/*/packages/*'
1
+ # pnpm-workspace.yaml
2
+ packages:
3
+ # all packages in direct subdirs of packages/
4
+ - 'packages/*'
5
+
6
+ - 'packages/*/packages/*'
@@ -1,34 +1,34 @@
1
- import path from 'path'
2
- import fs from 'fs'
3
- import { execSync } from 'child_process'
4
- import { fileURLToPath } from 'url'
5
-
6
- const __filename = fileURLToPath(import.meta.url)
7
- const __dirname = path.dirname(__filename)
8
-
9
- const getFirstPackage = (dirPath) => {
10
- const items = fs.readdirSync(dirPath)
11
- for (const item of items) {
12
- const fullPath = path.join(dirPath, item)
13
- if (fs.statSync(fullPath).isDirectory()) return fullPath
14
- }
15
- return null
16
- }
17
-
18
- const copyDirectorySync = (src, dest) => {
19
- if (!fs.existsSync(dest)) fs.mkdirSync(dest, { recursive: true })
20
- const items = fs.readdirSync(src)
21
- items.forEach((item) => {
22
- const srcPath = path.join(src, item)
23
- const destPath = path.join(dest, item)
24
- if (fs.statSync(srcPath).isDirectory()) {
25
- copyDirectorySync(srcPath, destPath)
26
- } else {
27
- fs.copyFileSync(srcPath, destPath)
28
- }
29
- })
30
- }
31
-
32
- const cwd = getFirstPackage(path.resolve(__dirname, `../packages`))
33
- execSync('pnpm run build', { cwd, stdio: 'inherit' })
34
- copyDirectorySync(path.join(cwd, 'dist'), path.join(__dirname, '../dist'))
1
+ import path from 'path'
2
+ import fs from 'fs'
3
+ import { execSync } from 'child_process'
4
+ import { fileURLToPath } from 'url'
5
+
6
+ const __filename = fileURLToPath(import.meta.url)
7
+ const __dirname = path.dirname(__filename)
8
+
9
+ const getFirstPackage = (dirPath) => {
10
+ const items = fs.readdirSync(dirPath)
11
+ for (const item of items) {
12
+ const fullPath = path.join(dirPath, item)
13
+ if (fs.statSync(fullPath).isDirectory()) return fullPath
14
+ }
15
+ return null
16
+ }
17
+
18
+ const copyDirectorySync = (src, dest) => {
19
+ if (!fs.existsSync(dest)) fs.mkdirSync(dest, { recursive: true })
20
+ const items = fs.readdirSync(src)
21
+ items.forEach((item) => {
22
+ const srcPath = path.join(src, item)
23
+ const destPath = path.join(dest, item)
24
+ if (fs.statSync(srcPath).isDirectory()) {
25
+ copyDirectorySync(srcPath, destPath)
26
+ } else {
27
+ fs.copyFileSync(srcPath, destPath)
28
+ }
29
+ })
30
+ }
31
+
32
+ const cwd = getFirstPackage(path.resolve(__dirname, `../packages`))
33
+ execSync('pnpm run build', { cwd, stdio: 'inherit' })
34
+ copyDirectorySync(path.join(cwd, 'dist'), path.join(__dirname, '../dist'))