@zenuml/core 2.0.18 → 2.0.20
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/.nvmrc +1 -0
- package/README.md +4 -17
- package/{dist/cy → cy}/defect-406-alt-under-creation.html +7 -6
- package/{dist/cy → cy}/smoke-creation.html +1 -0
- package/{dist/cy → cy}/smoke-fragment-issue.html +1 -0
- package/{dist/cy → cy}/smoke-fragment.html +1 -0
- package/{dist/cy → cy}/smoke-interaction.html +1 -0
- package/{dist/cy → cy}/smoke-return.html +1 -0
- package/{dist/cy → cy}/smoke.html +3 -1
- package/cypress.config.ts +14 -0
- package/dist/style.css +1 -1
- package/dist/zenuml-core.mjs +13175 -13212
- package/dist/zenuml-core.umd.js +94 -94
- package/docs/asciidoc/contributor.adoc +0 -42
- package/{dist/embed.html → embed.html} +13 -2
- package/index.html +2 -2
- package/package.json +11 -9
- package/pnpm-lock.yaml +198 -132
- package/vite.config.js +16 -4
- package/vite.config.lib.js +23 -0
- package/cypress.json +0 -7
- package/docs/invalid-host-header-error.md +0 -20
- package/vue.config.spec.js +0 -8
- package/vue.temp.config.js +0 -76
package/vite.config.js
CHANGED
|
@@ -1,12 +1,24 @@
|
|
|
1
|
+
import { resolve } from 'path'
|
|
1
2
|
import { defineConfig } from 'vite'
|
|
2
3
|
import { createVuePlugin as vue } from 'vite-plugin-vue2'
|
|
4
|
+
import { execSync } from 'child_process'
|
|
3
5
|
|
|
6
|
+
function getCypressHtmlFiles() {
|
|
7
|
+
const cypressFolder = resolve(__dirname, 'cy')
|
|
8
|
+
const strings = execSync(`find ${cypressFolder} -name '*.html'`)
|
|
9
|
+
.toString()
|
|
10
|
+
.split('\n')
|
|
11
|
+
// remove empty string
|
|
12
|
+
strings.pop()
|
|
13
|
+
return strings;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const cypressHtmlFiles = getCypressHtmlFiles();
|
|
17
|
+
console.log(cypressHtmlFiles);
|
|
4
18
|
export default defineConfig({
|
|
5
19
|
build: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
name: '@zenuml/core',
|
|
9
|
-
fileName: 'zenuml-core',
|
|
20
|
+
rollupOptions: {
|
|
21
|
+
input: ['index.html', 'embed.html', ...cypressHtmlFiles]
|
|
10
22
|
}
|
|
11
23
|
},
|
|
12
24
|
plugins: [vue()],
|
|
@@ -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/cypress.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# Error message: Invalid Host header
|
|
2
|
-
|
|
3
|
-
It appears when we expose http://localhost:8080 as https://air.zenuml.com via Cloudflare
|
|
4
|
-
tunnels. We see this error on Chrome, Safari and Firefox.
|
|
5
|
-
|
|
6
|
-
## Where is this from?
|
|
7
|
-
|
|
8
|
-
It only happens when the site is served via `yarn start` and not when we serve it via
|
|
9
|
-
`http-server dist`. So it is most likely a configuration with the dev server.
|
|
10
|
-
|
|
11
|
-
## Solution
|
|
12
|
-
|
|
13
|
-
According to [this answer on StackOverflow](https://stackoverflow.com/a/43647767/529187),
|
|
14
|
-
we can add the following to `vue.config.js`:
|
|
15
|
-
|
|
16
|
-
```js
|
|
17
|
-
devServer: {
|
|
18
|
-
allowedHosts: ["air.zenuml.com"]
|
|
19
|
-
}
|
|
20
|
-
```
|
package/vue.config.spec.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest'
|
|
2
|
-
const config = require('./vue.config')
|
|
3
|
-
describe('vue.config.js', function () {
|
|
4
|
-
it('should get pages', () => {
|
|
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"}};
|
|
6
|
-
expect(config.pages).toEqual(expectedPages)
|
|
7
|
-
})
|
|
8
|
-
});
|
package/vue.temp.config.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
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
|
-
}
|