@shijiu/jsview 1.9.829 → 1.9.837
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/loader/jsview-loader.js +3 -0
- package/package.json +1 -1
- package/patches/node_modules/vite/dist/node/jsview-vite-extension.js +7 -4
- package/tools/jsview-common.js +14 -1
- package/tools/jsview-post-build.js +6 -1
- package/tools/jsview-post-install.js +4 -1
- package/tools/jsview-run-android.js +5 -2
package/loader/jsview-loader.js
CHANGED
|
@@ -52,6 +52,9 @@ export default class JsViewLoader {
|
|
|
52
52
|
// 加载jsv-dom的调试版本
|
|
53
53
|
await import("../dom/jsv-browser-debug-dom.js");
|
|
54
54
|
|
|
55
|
+
// 将jsv-forge-define单独做chunk, 解决npm run build后出现的循环import问题。
|
|
56
|
+
await import("../dom/jsv-forge-define.js");
|
|
57
|
+
|
|
55
58
|
this.#forgeAppClass = JsViewBrowserForgeApp;
|
|
56
59
|
}
|
|
57
60
|
}
|
package/package.json
CHANGED
|
@@ -24,12 +24,15 @@ const jsviewConfig = defineConfig({
|
|
|
24
24
|
},
|
|
25
25
|
rollupOptions: {
|
|
26
26
|
output: {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
assetFileNames: (chunkInfo) => chunkInfo.name.endsWith('.css')
|
|
28
|
+
? 'css/[name].[hash].css' : 'assets/[name].[hash].[ext]',
|
|
29
29
|
//chunkFileNames: 'js/[name].[hash].js',
|
|
30
30
|
chunkFileNames: 'js/chunk.jsv.[hash].js',
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
entryFileNames: 'js/main.jsv.[hash].js',
|
|
32
|
+
format: 'esm',
|
|
33
|
+
manualChunks: {
|
|
34
|
+
'vue': ['vue', '\0plugin-vue:export-helper'], // 将vue和_export_sfc独立出来,防止被集成在main.js中导致import deadloop.
|
|
35
|
+
},
|
|
33
36
|
},
|
|
34
37
|
},
|
|
35
38
|
sourcemap: true,
|
package/tools/jsview-common.js
CHANGED
|
@@ -179,7 +179,7 @@ function getOptions(framework)
|
|
|
179
179
|
options.jsviewPatchesDir = path.resolve(options.jsviewDir, 'patches');
|
|
180
180
|
options.jsviewPatchModulesDir = path.resolve(options.jsviewPatchesDir, 'node_modules');
|
|
181
181
|
options.jsviewToolsDir = path.resolve(options.jsviewDir, 'tools');
|
|
182
|
-
options.
|
|
182
|
+
options.jsviewDomRevisionFile = path.resolve(options.jsviewDir, 'dom', 'target_core_revision.mjs');
|
|
183
183
|
|
|
184
184
|
options.jsviewVueDir = path.resolve(options.modulesDir, '@shijiu', 'jsview-vue');
|
|
185
185
|
options.jsviewReactDir = path.resolve(options.modulesDir, '@shijiu', 'jsview-react');
|
|
@@ -286,7 +286,20 @@ function execCommand(cmdline, withOutput)
|
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
288
|
|
|
289
|
+
function checkNodeVersion(minMajorVersion = 16)
|
|
290
|
+
{
|
|
291
|
+
const versions = process.version.replace('v', '').split('.');
|
|
292
|
+
const [majorVersion, minorVersion, patchVersion] = versions;
|
|
293
|
+
|
|
294
|
+
console.log(`Node version: v${majorVersion}.${minorVersion}.${patchVersion}`);
|
|
295
|
+
if (majorVersion < minMajorVersion) {
|
|
296
|
+
console.error('JsView Error: Node version is too low! Please upgrade your Node.js first.');
|
|
297
|
+
process.exit(1);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
289
301
|
module.exports = {
|
|
302
|
+
checkNodeVersion,
|
|
290
303
|
cpSync,
|
|
291
304
|
execCommand,
|
|
292
305
|
getOptions,
|
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
const crypto = require('crypto');
|
|
5
5
|
const fs = require('fs');
|
|
6
6
|
const path = require('path');
|
|
7
|
-
const {
|
|
7
|
+
const {
|
|
8
|
+
checkNodeVersion,
|
|
9
|
+
getOptions,
|
|
10
|
+
} = require('./jsview-common');
|
|
8
11
|
|
|
9
12
|
// main.js处理AppData信息
|
|
10
13
|
async function prepareMainAppData(options, fileMd5)
|
|
@@ -175,6 +178,8 @@ function makeDebugMap(options)
|
|
|
175
178
|
|
|
176
179
|
async function main()
|
|
177
180
|
{
|
|
181
|
+
checkNodeVersion();
|
|
182
|
+
|
|
178
183
|
const options = getOptions();
|
|
179
184
|
|
|
180
185
|
const vueConfigFile = path.resolve(options.projectDir, 'vue.config.js');
|
|
@@ -5,6 +5,7 @@ const fs = require('fs');
|
|
|
5
5
|
const path = require('path');
|
|
6
6
|
const url = require('url');
|
|
7
7
|
const {
|
|
8
|
+
checkNodeVersion,
|
|
8
9
|
cpSync,
|
|
9
10
|
execCommand,
|
|
10
11
|
getOptions,
|
|
@@ -127,7 +128,7 @@ function installPatches(options, pkgNeedPatch)
|
|
|
127
128
|
|
|
128
129
|
async function printRevision(options)
|
|
129
130
|
{
|
|
130
|
-
const jsviewVersionURL = url.pathToFileURL(options.
|
|
131
|
+
const jsviewVersionURL = url.pathToFileURL(options.jsviewDomRevisionFile);
|
|
131
132
|
const { default: jsviewTargetVersion } = await import(jsviewVersionURL);
|
|
132
133
|
|
|
133
134
|
console.log('**************************************************');
|
|
@@ -188,6 +189,8 @@ function doPostInstall(framework, pkgNeedPatch, skipCheckVersion)
|
|
|
188
189
|
|
|
189
190
|
function main(argv)
|
|
190
191
|
{
|
|
192
|
+
checkNodeVersion();
|
|
193
|
+
|
|
191
194
|
let pkgNeedPatch;
|
|
192
195
|
|
|
193
196
|
switch (argv.framework) {
|
|
@@ -5,6 +5,7 @@ const childProcess = require('child_process');
|
|
|
5
5
|
const path = require('path');
|
|
6
6
|
const url = require('url');
|
|
7
7
|
const {
|
|
8
|
+
checkNodeVersion,
|
|
8
9
|
getOptions,
|
|
9
10
|
parseArguments
|
|
10
11
|
} = require('./jsview-common');
|
|
@@ -21,8 +22,8 @@ async function getExtraOptions(argv)
|
|
|
21
22
|
options.androidPackage = argv.unparsed[0];
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
const
|
|
25
|
-
const { default: jsviewTargetRevision } = await import(
|
|
25
|
+
const jsviewDomRevisionFile = url.pathToFileURL(options.jsviewDomRevisionFile);
|
|
26
|
+
const { default: jsviewTargetRevision } = await import(jsviewDomRevisionFile);
|
|
26
27
|
options.jsviewCoreRevision = jsviewTargetRevision.CoreRevision;
|
|
27
28
|
options.jsviewEngineUrl = jsviewTargetRevision.JseUrl;
|
|
28
29
|
|
|
@@ -65,6 +66,8 @@ function androidStartActivity(options)
|
|
|
65
66
|
|
|
66
67
|
async function main(argv)
|
|
67
68
|
{
|
|
69
|
+
checkNodeVersion();
|
|
70
|
+
|
|
68
71
|
const options = await getExtraOptions(argv);
|
|
69
72
|
|
|
70
73
|
printRevision(options);
|