@shijiu/jsview 1.9.760 → 1.9.778
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/dom/bin/jsview-browser-debug-dom.min.js +1 -1
- package/dom/bin/jsview-dom.min.js +1 -1
- package/dom/jsv-dom.js +3 -1
- package/loader/loader.js +3 -3
- package/package.json +7 -8
- package/patches/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +3085 -2968
- package/patches/node_modules/@vue/compiler-sfc/package.json +6 -6
- package/patches/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +8123 -8038
- package/patches/node_modules/@vue/runtime-core/package.json +3 -3
- package/patches/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js +1681 -1663
- package/patches/node_modules/@vue/runtime-dom/package.json +3 -3
- package/patches/node_modules/react-dom/cjs/react-dom.development.js +29868 -0
- package/patches/node_modules/react-dom/cjs/react-dom.production.min.js +323 -0
- package/patches/node_modules/react-dom/package.json +62 -0
- package/patches/node_modules/react-scripts/config/paths.js +4 -1
- package/patches/node_modules/react-scripts/config/webpack.config.js +3 -3
- package/patches/node_modules/vite/dist/node/chunks/{dep-0fc8e132.js → dep-ed9cb113.js} +46837 -46866
- package/patches/node_modules/vite/dist/node/jsview-vite-extension.js +155 -0
- package/patches/node_modules/vite/package.json +48 -39
- package/patches/node_modules/vue-router/dist/vue-router.mjs +22 -5
- package/patches/node_modules/vue-router/package.json +12 -12
- package/tools/jsview-common.js +150 -0
- package/tools/jsview-jsmap-serve.mjs +119 -0
- package/tools/jsview-post-build.js +58 -52
- package/tools/jsview-post-install.js +73 -23
- package/tools/jsview-run-android.js +39 -35
- package/patches/node_modules/vite/dist/node/jsview-react.vite.config.js +0 -7
- package/patches/node_modules/vite/dist/node/jsview-vue.vite.config.js +0 -7
- package/patches/node_modules/vite/dist/node/jsview.vite.config.js +0 -64
- package/tools/common.js +0 -63
- package/tools/jsview-jsmap-serve.js +0 -105
- package/tools/jsview-post-install-react.js +0 -15
- package/tools/jsview-post-install-vue.js +0 -20
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { defineConfig } from 'vite'
|
|
2
|
+
import fs from 'fs'
|
|
3
|
+
import path from 'path'
|
|
4
|
+
import fullReload from 'vite-plugin-full-reload';
|
|
5
|
+
|
|
6
|
+
// https://vitejs.dev/config/
|
|
7
|
+
const jsviewConfig = defineConfig({
|
|
8
|
+
assetsInclude: ['**/*.bmp'],
|
|
9
|
+
build: {
|
|
10
|
+
assetsInlineLimit: 0,
|
|
11
|
+
//cssTarget: 'css/', // 未生效
|
|
12
|
+
commonjsOptions: {
|
|
13
|
+
include: [
|
|
14
|
+
/js-binary-schema-parser/,
|
|
15
|
+
/gifuct-js/,
|
|
16
|
+
/qr.js/
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
emptyOutDir: true,
|
|
20
|
+
minify: true,
|
|
21
|
+
modulePreload: {
|
|
22
|
+
polyfill: false
|
|
23
|
+
},
|
|
24
|
+
rollupOptions: {
|
|
25
|
+
output: {
|
|
26
|
+
format: 'esm',
|
|
27
|
+
entryFileNames: 'js/main.jsv.[hash].js',
|
|
28
|
+
//chunkFileNames: 'js/[name].[hash].js',
|
|
29
|
+
chunkFileNames: 'js/chunk.jsv.[hash].js',
|
|
30
|
+
assetFileNames: (chunkInfo) => chunkInfo.name.endsWith('.css')
|
|
31
|
+
? 'css/[name].[hash].css' : 'assets/[name].[hash].[ext]'
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
sourcemap: true,
|
|
35
|
+
target: 'es2022', // 不转译async/await
|
|
36
|
+
},
|
|
37
|
+
isCustomElement: (tag) => {
|
|
38
|
+
return tag == 'fdiv' || tag.startsWith('jsv-')
|
|
39
|
+
},
|
|
40
|
+
optimizeDeps: {
|
|
41
|
+
include: [
|
|
42
|
+
'gifuct-js',
|
|
43
|
+
'qr.js'
|
|
44
|
+
],
|
|
45
|
+
exclude: [
|
|
46
|
+
'@shijiu/jsview/loader/jsview-main.js', // 解决windows上出现解析异常的问题。
|
|
47
|
+
'jsview',
|
|
48
|
+
'jsview-vue',
|
|
49
|
+
'jsview-vue-samples',
|
|
50
|
+
'jsview-react-samples',
|
|
51
|
+
'jsview-vue-samples',
|
|
52
|
+
'node_modules/@shijiu',
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
plugins: [
|
|
56
|
+
fullReload('node_modules/@shijiu/**/*'),
|
|
57
|
+
],
|
|
58
|
+
resolve: {
|
|
59
|
+
alias: {
|
|
60
|
+
// 'jsview': path.resolve(process.cwd(), 'node_modules/@shijiu/jsview'),
|
|
61
|
+
'jsview-vue': path.resolve(process.cwd(), 'node_modules/@shijiu/jsview-vue'),
|
|
62
|
+
'jsview-vue-samples': path.resolve(process.cwd(), 'node_modules/@shijiu/jsview-vue-samples'),
|
|
63
|
+
'jsview-react': path.resolve(process.cwd(), 'node_modules/@shijiu/jsview-react'),
|
|
64
|
+
'jsview-react-samples': path.resolve(process.cwd(), 'node_modules/@shijiu/jsview-react-samples'),
|
|
65
|
+
'/js/main.jsv.js': path.resolve(process.cwd(), 'node_modules/@shijiu/jsview/loader/jsview-main.js'),
|
|
66
|
+
},
|
|
67
|
+
preserveSymlinks: true
|
|
68
|
+
},
|
|
69
|
+
server: {
|
|
70
|
+
host: true,
|
|
71
|
+
open: process.platform === "darwin",
|
|
72
|
+
watch: {
|
|
73
|
+
ignored: [
|
|
74
|
+
'!**/node_modules/@shijiu/**',
|
|
75
|
+
],
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
function getModuleDir() {
|
|
81
|
+
const moduleDir = path.resolve(process.cwd(), 'node_modules');
|
|
82
|
+
return moduleDir;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function ensureFramework(originConfig) {
|
|
86
|
+
const checkFramework = function (name) {
|
|
87
|
+
if (name.indexOf('vue') >= 0) {
|
|
88
|
+
return 'vue';
|
|
89
|
+
} else if (name.indexOf('react') >= 0) {
|
|
90
|
+
return 'react';
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return null;
|
|
94
|
+
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
let framework = 'unknown';
|
|
98
|
+
for (const plugins of originConfig.plugins) {
|
|
99
|
+
if (Array.isArray(plugins)) {
|
|
100
|
+
for (const plugin of plugins) {
|
|
101
|
+
framework = checkFramework(plugin.name);
|
|
102
|
+
if (framework) {
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
} else {
|
|
107
|
+
const plugin = plugins;
|
|
108
|
+
framework = checkFramework(plugin.name);
|
|
109
|
+
}
|
|
110
|
+
if (framework) {
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return framework;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function jsvCreateJsViewViteConfig(originConfig) {
|
|
119
|
+
let aliasJsView;
|
|
120
|
+
|
|
121
|
+
const moduleDir = getModuleDir();
|
|
122
|
+
const framework = ensureFramework(originConfig);
|
|
123
|
+
switch (framework) {
|
|
124
|
+
case 'vue':
|
|
125
|
+
aliasJsView = path.resolve(moduleDir, '@shijiu/jsview-vue');
|
|
126
|
+
break;
|
|
127
|
+
case 'react':
|
|
128
|
+
aliasJsView = path.resolve(moduleDir, '@shijiu/jsview-react');
|
|
129
|
+
break;
|
|
130
|
+
default:
|
|
131
|
+
throw new Error('JsView Error: Failed to support framework: ' + framework);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
jsviewConfig.resolve.alias['jsview'] = aliasJsView;
|
|
135
|
+
|
|
136
|
+
return jsviewConfig;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function jsvSaveUrlToCache(urls) {
|
|
140
|
+
if ((urls?.network?.length ?? -1 )<= 0) {
|
|
141
|
+
console.error("JsView Error: Failed to find network info.");
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const moduleDir = getModuleDir();
|
|
146
|
+
const urlCacheDir = path.resolve(moduleDir, '.vite', 'jsview')
|
|
147
|
+
const urlCacheFilePath = path.resolve(urlCacheDir, 'network.mjs')
|
|
148
|
+
fs.mkdirSync(urlCacheDir, { recursive: true });
|
|
149
|
+
fs.writeFileSync(urlCacheFilePath, `export default "${urls.network[0]}"`)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export {
|
|
153
|
+
jsvCreateJsViewViteConfig,
|
|
154
|
+
jsvSaveUrlToCache,
|
|
155
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Evan You",
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
"dist",
|
|
29
29
|
"client.d.ts",
|
|
30
30
|
"index.cjs",
|
|
31
|
-
"src/client",
|
|
32
31
|
"types"
|
|
33
32
|
],
|
|
34
33
|
"engines": {
|
|
@@ -47,87 +46,94 @@
|
|
|
47
46
|
"dev": "rimraf dist && pnpm run build-bundle -w",
|
|
48
47
|
"build": "rimraf dist && run-s build-bundle build-types",
|
|
49
48
|
"build-bundle": "rollup --config rollup.config.ts --configPlugin typescript",
|
|
50
|
-
"build-types": "run-s build-temp-types
|
|
51
|
-
"build-temp
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
49
|
+
"build-types": "run-s build-types-temp build-types-pre-patch build-types-roll build-types-post-patch build-types-check",
|
|
50
|
+
"build-types-temp": "tsc --emitDeclarationOnly --outDir temp/node -p src/node",
|
|
51
|
+
"build-types-pre-patch": "tsx scripts/prePatchTypes.ts",
|
|
52
|
+
"build-types-roll": "api-extractor run && rimraf temp",
|
|
53
|
+
"build-types-post-patch": "tsx scripts/postPatchTypes.ts",
|
|
54
|
+
"build-types-check": "tsx scripts/checkBuiltTypes.ts && tsc --project tsconfig.check.json",
|
|
55
55
|
"lint": "eslint --cache --ext .ts src/**",
|
|
56
56
|
"format": "prettier --write --cache --parser typescript \"src/**/*.ts\"",
|
|
57
57
|
"prepublishOnly": "npm run build"
|
|
58
58
|
},
|
|
59
59
|
"//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"esbuild": "^0.
|
|
62
|
-
"postcss": "^8.4.
|
|
61
|
+
"esbuild": "^0.16.3",
|
|
62
|
+
"postcss": "^8.4.19",
|
|
63
63
|
"resolve": "^1.22.1",
|
|
64
|
-
"rollup": "
|
|
64
|
+
"rollup": "^3.7.0"
|
|
65
65
|
},
|
|
66
66
|
"optionalDependencies": {
|
|
67
67
|
"fsevents": "~2.3.2"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@ampproject/remapping": "^2.2.0",
|
|
71
|
-
"@babel/parser": "^7.
|
|
72
|
-
"@babel/types": "^7.
|
|
73
|
-
"@jridgewell/trace-mapping": "^0.3.
|
|
74
|
-
"@rollup/plugin-alias": "^
|
|
75
|
-
"@rollup/plugin-commonjs": "^
|
|
76
|
-
"@rollup/plugin-dynamic-import-vars": "^
|
|
77
|
-
"@rollup/plugin-json": "^
|
|
78
|
-
"@rollup/plugin-node-resolve": "
|
|
79
|
-
"@rollup/plugin-typescript": "^
|
|
80
|
-
"@rollup/pluginutils": "^
|
|
81
|
-
"
|
|
82
|
-
"acorn": "^8.
|
|
83
|
-
"cac": "^6.7.
|
|
71
|
+
"@babel/parser": "^7.20.5",
|
|
72
|
+
"@babel/types": "^7.20.5",
|
|
73
|
+
"@jridgewell/trace-mapping": "^0.3.17",
|
|
74
|
+
"@rollup/plugin-alias": "^4.0.2",
|
|
75
|
+
"@rollup/plugin-commonjs": "^23.0.3",
|
|
76
|
+
"@rollup/plugin-dynamic-import-vars": "^2.0.1",
|
|
77
|
+
"@rollup/plugin-json": "^5.0.2",
|
|
78
|
+
"@rollup/plugin-node-resolve": "15.0.1",
|
|
79
|
+
"@rollup/plugin-typescript": "^10.0.1",
|
|
80
|
+
"@rollup/pluginutils": "^5.0.2",
|
|
81
|
+
"acorn": "^8.8.1",
|
|
82
|
+
"acorn-walk": "^8.2.0",
|
|
83
|
+
"cac": "^6.7.14",
|
|
84
84
|
"chokidar": "^3.5.3",
|
|
85
85
|
"connect": "^3.7.0",
|
|
86
86
|
"connect-history-api-fallback": "^2.0.0",
|
|
87
|
-
"convert-source-map": "^1.
|
|
87
|
+
"convert-source-map": "^1.9.0",
|
|
88
88
|
"cors": "^2.8.5",
|
|
89
89
|
"cross-spawn": "^7.0.3",
|
|
90
90
|
"debug": "^4.3.4",
|
|
91
|
-
"
|
|
92
|
-
"dotenv
|
|
93
|
-
"
|
|
91
|
+
"dep-types": "link:./src/types",
|
|
92
|
+
"dotenv": "^16.0.3",
|
|
93
|
+
"dotenv-expand": "^9.0.0",
|
|
94
|
+
"es-module-lexer": "^1.1.0",
|
|
94
95
|
"estree-walker": "^3.0.1",
|
|
95
96
|
"etag": "^1.8.1",
|
|
96
|
-
"fast-glob": "^3.2.
|
|
97
|
+
"fast-glob": "^3.2.12",
|
|
97
98
|
"http-proxy": "^1.18.1",
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"magic-string": "^0.26.2",
|
|
99
|
+
"launch-editor-middleware": "^2.6.0",
|
|
100
|
+
"magic-string": "^0.27.0",
|
|
101
101
|
"micromatch": "^4.0.5",
|
|
102
|
-
"mlly": "^0.5.
|
|
102
|
+
"mlly": "^0.5.17",
|
|
103
103
|
"mrmime": "^1.0.1",
|
|
104
104
|
"okie": "^1.0.1",
|
|
105
105
|
"open": "^8.4.0",
|
|
106
|
+
"parse5": "^7.1.2",
|
|
106
107
|
"periscopic": "^3.0.4",
|
|
107
108
|
"picocolors": "^1.0.0",
|
|
108
|
-
"
|
|
109
|
+
"picomatch": "^2.3.1",
|
|
110
|
+
"postcss-import": "^15.0.1",
|
|
109
111
|
"postcss-load-config": "^4.0.1",
|
|
110
|
-
"postcss-modules": "^
|
|
112
|
+
"postcss-modules": "^6.0.0",
|
|
111
113
|
"resolve.exports": "^1.1.0",
|
|
112
|
-
"rollup-plugin-license": "^2.8.1",
|
|
113
114
|
"sirv": "^2.0.2",
|
|
114
115
|
"source-map-js": "^1.0.2",
|
|
115
116
|
"source-map-support": "^0.5.21",
|
|
116
117
|
"strip-ansi": "^7.0.1",
|
|
117
|
-
"strip-literal": "^0.4.
|
|
118
|
+
"strip-literal": "^0.4.2",
|
|
118
119
|
"tsconfck": "^2.0.1",
|
|
119
|
-
"tslib": "^2.4.
|
|
120
|
+
"tslib": "^2.4.1",
|
|
120
121
|
"types": "link:./types",
|
|
121
|
-
"ufo": "^0.8.
|
|
122
|
-
"ws": "^8.
|
|
122
|
+
"ufo": "^0.8.6",
|
|
123
|
+
"ws": "^8.11.0"
|
|
123
124
|
},
|
|
124
125
|
"peerDependencies": {
|
|
126
|
+
"@types/node": ">= 14",
|
|
125
127
|
"less": "*",
|
|
126
128
|
"sass": "*",
|
|
127
129
|
"stylus": "*",
|
|
130
|
+
"sugarss": "*",
|
|
128
131
|
"terser": "^5.4.0"
|
|
129
132
|
},
|
|
130
133
|
"peerDependenciesMeta": {
|
|
134
|
+
"@types/node": {
|
|
135
|
+
"optional": true
|
|
136
|
+
},
|
|
131
137
|
"sass": {
|
|
132
138
|
"optional": true
|
|
133
139
|
},
|
|
@@ -137,6 +143,9 @@
|
|
|
137
143
|
"less": {
|
|
138
144
|
"optional": true
|
|
139
145
|
},
|
|
146
|
+
"sugarss": {
|
|
147
|
+
"optional": true
|
|
148
|
+
},
|
|
140
149
|
"terser": {
|
|
141
150
|
"optional": true
|
|
142
151
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* vue-router v4.1.
|
|
2
|
+
* vue-router v4.1.6
|
|
3
3
|
* (c) 2022 Eduardo San Martin Morote
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
@@ -1349,7 +1349,14 @@ function createRouterMatcher(routes, globalOptions) {
|
|
|
1349
1349
|
// if (parent && isAliasRecord(originalRecord)) {
|
|
1350
1350
|
// parent.children.push(originalRecord)
|
|
1351
1351
|
// }
|
|
1352
|
-
|
|
1352
|
+
// Avoid adding a record that doesn't display anything. This allows passing through records without a component to
|
|
1353
|
+
// not be reached and pass through the catch all route
|
|
1354
|
+
if ((matcher.record.components &&
|
|
1355
|
+
Object.keys(matcher.record.components).length) ||
|
|
1356
|
+
matcher.record.name ||
|
|
1357
|
+
matcher.record.redirect) {
|
|
1358
|
+
insertMatcher(matcher);
|
|
1359
|
+
}
|
|
1353
1360
|
}
|
|
1354
1361
|
return originalMatcher
|
|
1355
1362
|
? () => {
|
|
@@ -1407,6 +1414,13 @@ function createRouterMatcher(routes, globalOptions) {
|
|
|
1407
1414
|
throw createRouterError(1 /* ErrorTypes.MATCHER_NOT_FOUND */, {
|
|
1408
1415
|
location,
|
|
1409
1416
|
});
|
|
1417
|
+
// warn if the user is passing invalid params so they can debug it better when they get removed
|
|
1418
|
+
if ((process.env.NODE_ENV !== 'production')) {
|
|
1419
|
+
const invalidParams = Object.keys(location.params || {}).filter(paramName => !matcher.keys.find(k => k.name === paramName));
|
|
1420
|
+
if (invalidParams.length) {
|
|
1421
|
+
warn(`Discarded invalid param(s) "${invalidParams.join('", "')}" when navigating. See https://github.com/vuejs/router/blob/main/packages/router/CHANGELOG.md#414-2022-08-22 for more details.`);
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1410
1424
|
name = matcher.record.name;
|
|
1411
1425
|
params = assign(
|
|
1412
1426
|
// paramsFromLocation is a new object
|
|
@@ -1566,11 +1580,11 @@ function isSameParam(a, b) {
|
|
|
1566
1580
|
function checkSameParams(a, b) {
|
|
1567
1581
|
for (const key of a.keys) {
|
|
1568
1582
|
if (!key.optional && !b.keys.find(isSameParam.bind(null, key)))
|
|
1569
|
-
return warn(`Alias "${b.record.path}" and the original record: "${a.record.path}"
|
|
1583
|
+
return warn(`Alias "${b.record.path}" and the original record: "${a.record.path}" must have the exact same param named "${key.name}"`);
|
|
1570
1584
|
}
|
|
1571
1585
|
for (const key of b.keys) {
|
|
1572
1586
|
if (!key.optional && !a.keys.find(isSameParam.bind(null, key)))
|
|
1573
|
-
return warn(`Alias "${b.record.path}" and the original record: "${a.record.path}"
|
|
1587
|
+
return warn(`Alias "${b.record.path}" and the original record: "${a.record.path}" must have the exact same param named "${key.name}"`);
|
|
1574
1588
|
}
|
|
1575
1589
|
}
|
|
1576
1590
|
/**
|
|
@@ -1590,7 +1604,7 @@ function checkChildMissingNameWithEmptyPath(mainNormalizedRecord, parent) {
|
|
|
1590
1604
|
function checkMissingParamsInAbsolutePath(record, parent) {
|
|
1591
1605
|
for (const key of parent.keys) {
|
|
1592
1606
|
if (!record.keys.find(isSameParam.bind(null, key)))
|
|
1593
|
-
return warn(`Absolute path "${record.record.path}"
|
|
1607
|
+
return warn(`Absolute path "${record.record.path}" must have the exact same param named "${key.name}" as its parent "${parent.record.path}".`);
|
|
1594
1608
|
}
|
|
1595
1609
|
}
|
|
1596
1610
|
function isRecordChildOf(record, parent) {
|
|
@@ -2198,6 +2212,9 @@ function useLink(props) {
|
|
|
2198
2212
|
}, { flush: 'post' });
|
|
2199
2213
|
}
|
|
2200
2214
|
}
|
|
2215
|
+
/**
|
|
2216
|
+
* NOTE: update {@link _RouterLinkI}'s `$slots` type when updating this
|
|
2217
|
+
*/
|
|
2201
2218
|
return {
|
|
2202
2219
|
route,
|
|
2203
2220
|
href: computed(() => route.value.href),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-router",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.6",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"unpkg": "dist/vue-router.global.js",
|
|
6
6
|
"jsdelivr": "dist/vue-router.global.js",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"attributes": "vetur/attributes.json"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@vue/devtools-api": "^6.
|
|
58
|
+
"@vue/devtools-api": "^6.4.5"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@microsoft/api-extractor": "^7.29.2",
|
|
@@ -66,21 +66,21 @@
|
|
|
66
66
|
"@sucrase/jest-plugin": "^2.1.1",
|
|
67
67
|
"@types/jest": "^27.4.1",
|
|
68
68
|
"@types/jsdom": "^16.2.13",
|
|
69
|
-
"@types/nightwatch": "^2.3.
|
|
69
|
+
"@types/nightwatch": "^2.3.12",
|
|
70
70
|
"@vitejs/plugin-vue": "^2.3.3",
|
|
71
|
-
"@vue/compiler-sfc": "^3.2.
|
|
72
|
-
"@vue/server-renderer": "^3.2.
|
|
73
|
-
"@vue/test-utils": "^2.0
|
|
71
|
+
"@vue/compiler-sfc": "^3.2.41",
|
|
72
|
+
"@vue/server-renderer": "^3.2.41",
|
|
73
|
+
"@vue/test-utils": "^2.2.0",
|
|
74
74
|
"browserstack-local": "^1.4.5",
|
|
75
|
-
"chromedriver": "^
|
|
75
|
+
"chromedriver": "^106.0.1",
|
|
76
76
|
"connect-history-api-fallback": "^1.6.0",
|
|
77
77
|
"conventional-changelog-cli": "^2.1.1",
|
|
78
|
-
"dotenv": "^16.0.
|
|
78
|
+
"dotenv": "^16.0.3",
|
|
79
79
|
"faked-promise": "^2.2.2",
|
|
80
|
-
"geckodriver": "^3.0
|
|
80
|
+
"geckodriver": "^3.2.0",
|
|
81
81
|
"jest": "^27.5.1",
|
|
82
82
|
"jest-mock-warn": "^1.1.0",
|
|
83
|
-
"nightwatch": "^2.
|
|
83
|
+
"nightwatch": "^2.4.1",
|
|
84
84
|
"nightwatch-helpers": "^1.2.0",
|
|
85
85
|
"rimraf": "^3.0.2",
|
|
86
86
|
"rollup": "^2.78.0",
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
"rollup-plugin-terser": "^7.0.2",
|
|
89
89
|
"rollup-plugin-typescript2": "^0.32.1",
|
|
90
90
|
"typescript": "~4.7.4",
|
|
91
|
-
"vite": "^
|
|
92
|
-
"vue": "^3.2.
|
|
91
|
+
"vite": "^3.1.8",
|
|
92
|
+
"vue": "^3.2.41"
|
|
93
93
|
},
|
|
94
94
|
"scripts": {
|
|
95
95
|
"dev": "jest --watch",
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
function parseArguments(beginWithHyphen = true) {
|
|
7
|
+
let options = {
|
|
8
|
+
unparsed: []
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// arg0: node
|
|
12
|
+
// arg1: script.js
|
|
13
|
+
const arguList = process.argv.slice(2);
|
|
14
|
+
const unparsed = [];
|
|
15
|
+
for (argu of arguList) {
|
|
16
|
+
let [key, value] = argu.split('=');
|
|
17
|
+
if (argu.includes('=') == false) {
|
|
18
|
+
value = true;
|
|
19
|
+
}
|
|
20
|
+
if (key.startsWith('-') == false) {
|
|
21
|
+
if (beginWithHyphen) {
|
|
22
|
+
console.error('Failed to parse argument: ' + argu);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
} else {
|
|
25
|
+
options.unparsed.push(key);
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
let formattedKey = key.replace(/^-*/, '');
|
|
31
|
+
formattedKey = formattedKey.replace(/-(.)/g, (x) => x[1].toUpperCase())
|
|
32
|
+
|
|
33
|
+
let formattedValue = value;
|
|
34
|
+
if (value === undefined
|
|
35
|
+
|| value === null
|
|
36
|
+
|| value === 'undefined'
|
|
37
|
+
|| value === 'null'
|
|
38
|
+
|| value === '') {
|
|
39
|
+
formattedValue = null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
options[formattedKey] = formattedValue;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return options;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**************************************************
|
|
49
|
+
* jsview-test-project
|
|
50
|
+
* ├── dist
|
|
51
|
+
* │ ├── debug
|
|
52
|
+
* │ │ └── map
|
|
53
|
+
* │ └── js
|
|
54
|
+
* ├── node_modules
|
|
55
|
+
* │ ├── .vite
|
|
56
|
+
* │ │ └── jsview
|
|
57
|
+
* │ ├── @shijiu
|
|
58
|
+
* │ │ ├── jsview -> ../../../../@shijiu/jsview
|
|
59
|
+
* │ │ │ ├── dom
|
|
60
|
+
* │ │ │ │ ├── bin
|
|
61
|
+
* │ │ │ │ ├── code
|
|
62
|
+
* │ │ │ ├── loader
|
|
63
|
+
* │ │ │ ├── patches
|
|
64
|
+
* │ │ │ │ └── node_modules
|
|
65
|
+
* │ │ │ ├── tools
|
|
66
|
+
* │ │ ├── jsview-vue -> ../../../../@shijiu/jsview-vue
|
|
67
|
+
* │ │ │ └── utils
|
|
68
|
+
* │ │ └── jsview-vue-samples -> ../../../../@shijiu/jsview-vue-samples
|
|
69
|
+
* └── src
|
|
70
|
+
* └── appConfig
|
|
71
|
+
**************************************************/
|
|
72
|
+
function getOptions(framework) {
|
|
73
|
+
const options = {};
|
|
74
|
+
|
|
75
|
+
options.projectDir = process.cwd();
|
|
76
|
+
|
|
77
|
+
options.modulesDir = path.resolve(options.projectDir, 'node_modules');
|
|
78
|
+
options.jsviewDir = path.resolve(options.modulesDir, '@shijiu', 'jsview');
|
|
79
|
+
options.jsviewPatchesDir = path.resolve(options.jsviewDir, 'patches');
|
|
80
|
+
options.jsviewPatchModulesDir = path.resolve(options.jsviewPatchesDir, 'node_modules');
|
|
81
|
+
options.jsviewToolsDir = path.resolve(options.jsviewDir, 'tools');
|
|
82
|
+
options.jsviewRevisionFile = path.resolve(options.jsviewDir, 'dom', 'target_core_revision.mjs');
|
|
83
|
+
|
|
84
|
+
options.jsviewVueDir = path.resolve(options.modulesDir, '@shijiu', 'jsview-vue');
|
|
85
|
+
options.jsviewReactDir = path.resolve(options.modulesDir, '@shijiu', 'jsview-react');
|
|
86
|
+
if (framework) {
|
|
87
|
+
options.jsviewFrameworkDir = path.resolve(options.modulesDir, '@shijiu', 'jsview-' + framework);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
options.appConfigDir = path.resolve(options.projectDir, 'src', 'appConfig');
|
|
91
|
+
|
|
92
|
+
options.distDir = path.resolve(options.projectDir, 'dist');
|
|
93
|
+
options.distJsDir = path.resolve(options.distDir, 'js');
|
|
94
|
+
options.distDebugDir = path.resolve(options.distDir, 'debug');
|
|
95
|
+
options.distDebugMapDir = path.resolve(options.distDebugDir, 'map');
|
|
96
|
+
|
|
97
|
+
const cacheName = (framework == 'vue' ? '.vite' : '.cache');
|
|
98
|
+
options.cacheDir = path.resolve(options.modulesDir, cacheName);
|
|
99
|
+
options.baseUrlFile = path.resolve(options.cacheDir, 'jsview', 'network.mjs');
|
|
100
|
+
|
|
101
|
+
return options;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function cpSync(workDir, src, dest, ignore=[]) {
|
|
105
|
+
const exists = fs.existsSync(src);
|
|
106
|
+
const stats = exists && fs.statSync(src);
|
|
107
|
+
const isDirectory = exists && stats.isDirectory();
|
|
108
|
+
if (isDirectory) {
|
|
109
|
+
if (fs.existsSync(dest) == false) {
|
|
110
|
+
fs.mkdirSync(dest);
|
|
111
|
+
}
|
|
112
|
+
fs.readdirSync(src).forEach(function(childItemName) {
|
|
113
|
+
cpSync(
|
|
114
|
+
workDir,
|
|
115
|
+
path.join(src, childItemName),
|
|
116
|
+
path.join(dest, childItemName),
|
|
117
|
+
ignore
|
|
118
|
+
);
|
|
119
|
+
});
|
|
120
|
+
} else {
|
|
121
|
+
const filename = path.basename(src);
|
|
122
|
+
if (ignore && ignore.includes(filename)) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
console.info(
|
|
126
|
+
' ' + path.relative(workDir, src) + ' -> ' + path.relative(workDir, dest)
|
|
127
|
+
);
|
|
128
|
+
fs.copyFileSync(src, dest);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function rmSync(path) {
|
|
133
|
+
fs.rmSync(path, { recursive: true, force: true });
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function symlinkSync(target, to) {
|
|
137
|
+
rmSync(to);
|
|
138
|
+
|
|
139
|
+
const targetPath = path.relative(path.dirname(to), target);
|
|
140
|
+
|
|
141
|
+
fs.symlinkSync(targetPath, to, 'dir');
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
module.exports = {
|
|
145
|
+
cpSync,
|
|
146
|
+
getOptions,
|
|
147
|
+
parseArguments,
|
|
148
|
+
rmSync,
|
|
149
|
+
symlinkSync,
|
|
150
|
+
}
|