@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.
Files changed (33) hide show
  1. package/dom/bin/jsview-browser-debug-dom.min.js +1 -1
  2. package/dom/bin/jsview-dom.min.js +1 -1
  3. package/dom/jsv-dom.js +3 -1
  4. package/loader/loader.js +3 -3
  5. package/package.json +7 -8
  6. package/patches/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +3085 -2968
  7. package/patches/node_modules/@vue/compiler-sfc/package.json +6 -6
  8. package/patches/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +8123 -8038
  9. package/patches/node_modules/@vue/runtime-core/package.json +3 -3
  10. package/patches/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js +1681 -1663
  11. package/patches/node_modules/@vue/runtime-dom/package.json +3 -3
  12. package/patches/node_modules/react-dom/cjs/react-dom.development.js +29868 -0
  13. package/patches/node_modules/react-dom/cjs/react-dom.production.min.js +323 -0
  14. package/patches/node_modules/react-dom/package.json +62 -0
  15. package/patches/node_modules/react-scripts/config/paths.js +4 -1
  16. package/patches/node_modules/react-scripts/config/webpack.config.js +3 -3
  17. package/patches/node_modules/vite/dist/node/chunks/{dep-0fc8e132.js → dep-ed9cb113.js} +46837 -46866
  18. package/patches/node_modules/vite/dist/node/jsview-vite-extension.js +155 -0
  19. package/patches/node_modules/vite/package.json +48 -39
  20. package/patches/node_modules/vue-router/dist/vue-router.mjs +22 -5
  21. package/patches/node_modules/vue-router/package.json +12 -12
  22. package/tools/jsview-common.js +150 -0
  23. package/tools/jsview-jsmap-serve.mjs +119 -0
  24. package/tools/jsview-post-build.js +58 -52
  25. package/tools/jsview-post-install.js +73 -23
  26. package/tools/jsview-run-android.js +39 -35
  27. package/patches/node_modules/vite/dist/node/jsview-react.vite.config.js +0 -7
  28. package/patches/node_modules/vite/dist/node/jsview-vue.vite.config.js +0 -7
  29. package/patches/node_modules/vite/dist/node/jsview.vite.config.js +0 -64
  30. package/tools/common.js +0 -63
  31. package/tools/jsview-jsmap-serve.js +0 -105
  32. package/tools/jsview-post-install-react.js +0 -15
  33. package/tools/jsview-post-install-vue.js +0 -20
package/tools/common.js DELETED
@@ -1,63 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require("fs");
4
- const path = require("path");
5
-
6
- function cpSync(workDir, src, dest, ignore=[]) {
7
- const exists = fs.existsSync(src);
8
- const stats = exists && fs.statSync(src);
9
- const isDirectory = exists && stats.isDirectory();
10
- if (isDirectory) {
11
- if (fs.existsSync(dest) == false) {
12
- fs.mkdirSync(dest);
13
- }
14
- fs.readdirSync(src).forEach(function(childItemName) {
15
- cpSync(
16
- workDir,
17
- path.join(src, childItemName),
18
- path.join(dest, childItemName),
19
- ignore
20
- );
21
- });
22
- } else {
23
- const filename = path.basename(src);
24
- if (ignore && ignore.includes(filename)) {
25
- return;
26
- }
27
- console.info(
28
- " " + path.relative(workDir, src) + " -> " + path.relative(workDir, dest)
29
- );
30
- fs.copyFileSync(src, dest);
31
- }
32
- }
33
-
34
- function rmSync(path) {
35
- if (!!fs.rmSync) {
36
- fs.rmSync(path, { recursive: true, force: true });
37
- } else {
38
- deleteFolderRecursive(path)
39
- }
40
- }
41
-
42
- function deleteFolderRecursive(path) {
43
- var files = [];
44
- if (fs.existsSync(path)) {
45
- files = fs.readdirSync(path);
46
- files.forEach(function(file, index) {
47
- var curPath = path + "/" + file;
48
- if (fs.lstatSync(curPath).isDirectory()) {
49
- // recurse
50
- deleteFolderRecursive(curPath);
51
- } else {
52
- // delete file
53
- fs.unlinkSync(curPath);
54
- }
55
- });
56
- fs.rmdirSync(path);
57
- }
58
- }
59
-
60
- module.exports = {
61
- cpSync,
62
- rmSync,
63
- }
@@ -1,105 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require("fs");
4
- const http = require('http');
5
- const os = require('os');
6
-
7
- let baseDir = __dirname;
8
-
9
- let script_name = __filename.substr(__dirname.length + 1)
10
-
11
- let redirect_url;
12
- if (process.argv.length >= 2) {
13
- let args_start = 0;
14
- for (let i = 0; i < process.argv.length; i++) {
15
- if (process.argv[i].endsWith(script_name)) {
16
- args_start = i + 1;
17
- break;
18
- }
19
- }
20
- const args = process.argv.slice(args_start)
21
- redirect_url = args[0]
22
- if (!redirect_url.endsWith('/')) {
23
- redirect_url = redirect_url + '/';
24
- }
25
- }
26
-
27
- function requestListener(req, res) {
28
- console.log("[request] " + req.url);
29
-
30
- if (req.url.endsWith("\.map")) { // return map source file content
31
- if (redirect_url) {
32
- // redirect with 302 HTTP code in response
33
- let redirect_target = redirect_url
34
- + convertMapBaseUrl(req.url)
35
- console.log(`redirect ${req.url} -> ${redirect_target}`)
36
- res.writeHead(302, { "Location": redirect_target });
37
- return res.end();
38
- }
39
-
40
- try {
41
- const fileContent = fs.readFileSync(baseDir + '/' + req.url);
42
-
43
- res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' });
44
- res.write(fileContent);
45
- res.end();
46
- return;
47
- } catch (ex) {
48
- console.log("Failed to process " + req.url + "\nException: " + ex);
49
- }
50
- }
51
-
52
- res.writeHead(404);
53
- res.end();
54
- };
55
-
56
- function convertMapBaseUrl(origin_url) {
57
- if (origin_url.startsWith('/map/')) {
58
- /* 去掉子目录/map/ */
59
- return origin_url.substr(5);
60
- } else if (origin_url.startsWith('/')) {
61
- /* 去掉'/' */
62
- return origin_url.substring(1, origin_url.length);
63
- } else {
64
- return origin_url;
65
- }
66
- }
67
-
68
- function getIPAddress() {
69
- let ret = [];
70
-
71
- var interfaces = os.networkInterfaces();
72
- for (var devname in interfaces) {
73
- var iface = interfaces[devname];
74
-
75
- for (var i = 0; i < iface.length; i++) {
76
- var alias = iface[i];
77
- if (alias.family === 'IPv4' && !alias.internal)
78
- ret.push(alias.address);
79
- }
80
- }
81
- return ret;
82
- }
83
-
84
- function main() {
85
- if (process.argv.length >= 3) {
86
- baseDir = process.argv[2];
87
- }
88
-
89
- const server = http.createServer(requestListener);
90
- const port = 57245;
91
- server.listen(port, '0.0.0.0', () => {
92
- console.log('');
93
- console.log('JavaScript source map running at:');
94
- if (redirect_url) {
95
- console.log('with redirect url=' + redirect_url)
96
- }
97
- console.log(' - Local: localhost:' + port);
98
- getIPAddress().forEach(ip => {
99
- console.log(' - Network: ' + ip + ':' + port);
100
- });
101
- console.log('');
102
- });
103
- }
104
-
105
- main();
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const { doPostInstall } = require('./jsview-post-install');
4
-
5
- function main() {
6
- const pkgNeedPatch = [
7
- 'react-scripts',
8
- ];
9
- doPostInstall('react', pkgNeedPatch, argv.skipCheckVersion);
10
- }
11
-
12
- const argv = {
13
- skipCheckVersion: process.argv.includes('--skip-check-version'),
14
- }
15
- main(argv);
@@ -1,20 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const { doPostInstall } = require('./jsview-post-install');
4
-
5
- function main(argv) {
6
- const pkgNeedPatch = [
7
- '@vue/compiler-sfc',
8
- '@vue/runtime-core',
9
- '@vue/runtime-dom',
10
- 'postcss-js',
11
- 'vite',
12
- 'vue-router',
13
- ];
14
- doPostInstall('vue', pkgNeedPatch, argv.skipCheckVersion);
15
- }
16
-
17
- const argv = {
18
- skipCheckVersion: process.argv.includes('--skip-check-version'),
19
- }
20
- main(argv);