@zenuml/core 2.0.17 → 2.0.18
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/.eslintrc.json +0 -0
- package/README.md +0 -1
- package/README_CN.md +0 -2
- package/dist/CNAME.txt +1 -0
- package/dist/cy/defect-406-alt-under-creation.html +37 -0
- package/dist/cy/smoke-creation.html +23 -0
- package/dist/cy/smoke-fragment-issue.html +35 -0
- package/dist/cy/smoke-fragment.html +39 -0
- package/dist/cy/smoke-interaction.html +32 -0
- package/dist/cy/smoke-return.html +36 -0
- package/dist/cy/smoke.html +40 -0
- package/dist/embed-container-demo.html +50 -0
- package/dist/embed.html +173 -0
- package/dist/favicon.ico +0 -0
- package/dist/style.css +1 -0
- package/dist/zenuml-core.mjs +30592 -0
- package/dist/zenuml-core.umd.js +562 -0
- package/index.html +84 -0
- package/package.json +30 -36
- package/pnpm-lock.yaml +9559 -0
- package/tailwind.config.js +1 -1
- package/types/svg.d.ts +4 -0
- package/vite.config.js +23 -0
- package/vue.config.spec.js +3 -48
- package/vue.temp.config.js +76 -0
- package/.nvmrc +0 -1
- package/dist/zenuml/core.common.js +0 -46154
- package/dist/zenuml/core.common.js.map +0 -1
- package/dist/zenuml/core.css +0 -5
- package/dist/zenuml/core.umd.js +0 -46165
- package/dist/zenuml/core.umd.js.map +0 -1
- package/dist/zenuml/core.umd.min.js +0 -18
- package/dist/zenuml/core.umd.min.js.map +0 -1
package/tailwind.config.js
CHANGED
package/types/svg.d.ts
ADDED
package/vite.config.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineConfig } from 'vite'
|
|
2
|
+
import { createVuePlugin as vue } from 'vite-plugin-vue2'
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
build: {
|
|
6
|
+
lib: {
|
|
7
|
+
entry: 'src/core.ts',
|
|
8
|
+
name: '@zenuml/core',
|
|
9
|
+
fileName: 'zenuml-core',
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
plugins: [vue()],
|
|
13
|
+
test: {
|
|
14
|
+
environment: 'jsdom',
|
|
15
|
+
deps: {
|
|
16
|
+
inline: [
|
|
17
|
+
''
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
)
|
package/vue.config.spec.js
CHANGED
|
@@ -1,53 +1,8 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
|
1
2
|
const config = require('./vue.config')
|
|
2
3
|
describe('vue.config.js', function () {
|
|
3
4
|
it('should get pages', () => {
|
|
4
|
-
const expectedPages = {
|
|
5
|
-
"cy/smoke-creation.html": {
|
|
6
|
-
"entry": "src/main.ts",
|
|
7
|
-
"filename": "cy/smoke-creation.html",
|
|
8
|
-
"template": "public/cy/smoke-creation.html"
|
|
9
|
-
},
|
|
10
|
-
"cy/smoke-fragment-issue.html": {
|
|
11
|
-
"entry": "src/main.ts",
|
|
12
|
-
"filename": "cy/smoke-fragment-issue.html",
|
|
13
|
-
"template": "public/cy/smoke-fragment-issue.html"
|
|
14
|
-
},
|
|
15
|
-
"cy/smoke-fragment.html": {
|
|
16
|
-
"entry": "src/main.ts",
|
|
17
|
-
"filename": "cy/smoke-fragment.html",
|
|
18
|
-
"template": "public/cy/smoke-fragment.html"
|
|
19
|
-
},
|
|
20
|
-
"cy/smoke-interaction.html": {
|
|
21
|
-
"entry": "src/main.ts",
|
|
22
|
-
"filename": "cy/smoke-interaction.html",
|
|
23
|
-
"template": "public/cy/smoke-interaction.html"
|
|
24
|
-
},
|
|
25
|
-
"cy/smoke-return.html": {
|
|
26
|
-
"entry": "src/main.ts",
|
|
27
|
-
"filename": "cy/smoke-return.html",
|
|
28
|
-
"template": "public/cy/smoke-return.html"
|
|
29
|
-
},
|
|
30
|
-
"cy/smoke.html": {
|
|
31
|
-
"entry": "src/main.ts",
|
|
32
|
-
"filename": "cy/smoke.html",
|
|
33
|
-
"template": "public/cy/smoke.html"
|
|
34
|
-
},
|
|
35
|
-
"embed-container-demo.html": {
|
|
36
|
-
"entry": "src/main.ts",
|
|
37
|
-
"filename": "embed-container-demo.html",
|
|
38
|
-
"template": "public/embed-container-demo.html"
|
|
39
|
-
},
|
|
40
|
-
"embed.html": {
|
|
41
|
-
"entry": "src/main.ts",
|
|
42
|
-
"filename": "embed.html",
|
|
43
|
-
"template": "public/embed.html"
|
|
44
|
-
},
|
|
45
|
-
"index.html": {
|
|
46
|
-
"entry": "src/main.ts",
|
|
47
|
-
"filename": "index.html",
|
|
48
|
-
"template": "public/index.html"
|
|
49
|
-
}
|
|
50
|
-
};
|
|
5
|
+
const expectedPages = {"embed-container-demo.html":{"entry":"src/main.ts","template":"public/embed-container-demo.html","filename":"embed-container-demo.html"},"cy/smoke-fragment-issue.html":{"entry":"src/main.ts","template":"public/cy/smoke-fragment-issue.html","filename":"cy/smoke-fragment-issue.html"},"cy/smoke-creation.html":{"entry":"src/main.ts","template":"public/cy/smoke-creation.html","filename":"cy/smoke-creation.html"},"cy/smoke-interaction.html":{"entry":"src/main.ts","template":"public/cy/smoke-interaction.html","filename":"cy/smoke-interaction.html"},"cy/defect-406-alt-under-creation.html":{"entry":"src/main.ts","template":"public/cy/defect-406-alt-under-creation.html","filename":"cy/defect-406-alt-under-creation.html"},"cy/smoke.html":{"entry":"src/main.ts","template":"public/cy/smoke.html","filename":"cy/smoke.html"},"cy/smoke-return.html":{"entry":"src/main.ts","template":"public/cy/smoke-return.html","filename":"cy/smoke-return.html"},"cy/smoke-fragment.html":{"entry":"src/main.ts","template":"public/cy/smoke-fragment.html","filename":"cy/smoke-fragment.html"},"embed.html":{"entry":"src/main.ts","template":"public/embed.html","filename":"embed.html"}};
|
|
51
6
|
expect(config.pages).toEqual(expectedPages)
|
|
52
7
|
})
|
|
53
|
-
});
|
|
8
|
+
});
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
const {execSync} = require("child_process");
|
|
2
|
+
process.env.VUE_APP_GIT_HASH = execSync('git rev-parse --short HEAD').toString().trim()
|
|
3
|
+
process.env.VUE_APP_GIT_BRANCH = execSync('git branch --show-current').toString().trim();
|
|
4
|
+
|
|
5
|
+
module.exports = {
|
|
6
|
+
pages: getPages(),
|
|
7
|
+
chainWebpack: config =>{
|
|
8
|
+
// A workaround that allows npm link or yarn link
|
|
9
|
+
// https://cli.vuejs.org/guide/troubleshooting.html#symbolic-links-in-node-modules
|
|
10
|
+
config.resolve.symlinks(false)
|
|
11
|
+
|
|
12
|
+
config.plugin('define').tap((definitions) => {
|
|
13
|
+
definitions[0]['VERSION'] = JSON.stringify(require('./package.json').version);
|
|
14
|
+
definitions[0]['BUILD_TIME'] = JSON.stringify(new Date());
|
|
15
|
+
return definitions;
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
// We need to clear the pre-built svg rule
|
|
19
|
+
// use `vue-cli-service inspect to check the webpack
|
|
20
|
+
// the built-in webpack uses file-loader
|
|
21
|
+
const svgRule = config.module.rule('svg')
|
|
22
|
+
svgRule.store.clear();
|
|
23
|
+
svgRule
|
|
24
|
+
.test(/\.svg$/)
|
|
25
|
+
.type('asset/inline')
|
|
26
|
+
.end();
|
|
27
|
+
},
|
|
28
|
+
configureWebpack: {
|
|
29
|
+
resolve: {
|
|
30
|
+
fallback: {
|
|
31
|
+
"fs": false,
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
devServer: {
|
|
36
|
+
allowedHosts: "all",
|
|
37
|
+
historyApiFallback: true,
|
|
38
|
+
hot: true,
|
|
39
|
+
host: '0.0.0.0',
|
|
40
|
+
port: 8080,
|
|
41
|
+
client: {
|
|
42
|
+
webSocketURL: 'auto://0.0.0.0:0/ws',
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
function getPageObject(file) {
|
|
49
|
+
// remove first level of directory, keep the rest
|
|
50
|
+
const subFilePath = file.split('/').slice(1).join('/')
|
|
51
|
+
return {
|
|
52
|
+
[subFilePath]: {
|
|
53
|
+
entry: 'src/main.ts',
|
|
54
|
+
template: file,
|
|
55
|
+
filename: subFilePath
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
// https://cli.vuejs.org/config/#pages
|
|
62
|
+
function getPages() {
|
|
63
|
+
|
|
64
|
+
// get all html files in public folder recursively
|
|
65
|
+
const files = execSync('find public -name "*.html"').toString().trim().split('\n');
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
function skipEmbedContainerDemo(file) {
|
|
69
|
+
return file !== 'embed-container-demo.html';
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const pages = files.filter(skipEmbedContainerDemo)
|
|
73
|
+
.map(getPageObject);
|
|
74
|
+
// merge items in pages array into one object
|
|
75
|
+
return Object.assign({}, ...pages);
|
|
76
|
+
}
|
package/.nvmrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
14.21
|