@shijiu/jsview 1.9.760 → 1.9.779

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 (34) 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/bin/jsview-engine-js-browser.min.js +1 -1
  4. package/dom/jsv-dom.js +3 -1
  5. package/loader/loader.js +3 -3
  6. package/package.json +7 -8
  7. package/patches/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +3085 -2968
  8. package/patches/node_modules/@vue/compiler-sfc/package.json +6 -6
  9. package/patches/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +8123 -8038
  10. package/patches/node_modules/@vue/runtime-core/package.json +3 -3
  11. package/patches/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js +1681 -1663
  12. package/patches/node_modules/@vue/runtime-dom/package.json +3 -3
  13. package/patches/node_modules/react-dom/cjs/react-dom.development.js +29868 -0
  14. package/patches/node_modules/react-dom/cjs/react-dom.production.min.js +323 -0
  15. package/patches/node_modules/react-dom/package.json +62 -0
  16. package/patches/node_modules/react-scripts/config/paths.js +4 -1
  17. package/patches/node_modules/react-scripts/config/webpack.config.js +3 -3
  18. package/patches/node_modules/vite/dist/node/chunks/{dep-0fc8e132.js → dep-ed9cb113.js} +46837 -46866
  19. package/patches/node_modules/vite/dist/node/jsview-vite-extension.js +155 -0
  20. package/patches/node_modules/vite/package.json +48 -39
  21. package/patches/node_modules/vue-router/dist/vue-router.mjs +22 -5
  22. package/patches/node_modules/vue-router/package.json +12 -12
  23. package/tools/jsview-common.js +169 -0
  24. package/tools/jsview-jsmap-serve.mjs +127 -0
  25. package/tools/jsview-post-build.js +63 -55
  26. package/tools/jsview-post-install.js +92 -42
  27. package/tools/jsview-run-android.js +46 -38
  28. package/patches/node_modules/vite/dist/node/jsview-react.vite.config.js +0 -7
  29. package/patches/node_modules/vite/dist/node/jsview-vue.vite.config.js +0 -7
  30. package/patches/node_modules/vite/dist/node/jsview.vite.config.js +0 -64
  31. package/tools/common.js +0 -63
  32. package/tools/jsview-jsmap-serve.js +0 -105
  33. package/tools/jsview-post-install-react.js +0 -15
  34. package/tools/jsview-post-install-vue.js +0 -20
@@ -1,64 +0,0 @@
1
- import { defineConfig } from 'vite'
2
- import { resolve as pathResolve } from 'path'
3
- import fullReload from 'vite-plugin-full-reload';
4
-
5
- // https://vitejs.dev/config/
6
- export default defineConfig({
7
- assetsInclude: ['**/*.bmp'],
8
- build: {
9
- assetsInlineLimit: 0,
10
- //cssTarget: 'css/', // 未生效
11
- emptyOutDir: true,
12
- minify: false,
13
- polyfillModulePreload: false,
14
- rollupOptions: {
15
- output: {
16
- format: 'esm',
17
- entryFileNames: 'js/main.jsv.[hash].js',
18
- //chunkFileNames: 'js/[name].[hash].js',
19
- chunkFileNames: 'js/chunk.jsv.[hash].js',
20
- assetFileNames: (chunkInfo) => chunkInfo.name.endsWith('.css')
21
- ? 'css/[name].[hash].css' : 'assets/[name].[hash].[ext]'
22
- },
23
- },
24
- sourcemap: true,
25
- target: 'es2022', // 不转译async/await
26
- },
27
- isCustomElement: (tag) => {
28
- return tag == 'fdiv' || tag.startsWith('jsv-')
29
- },
30
- optimizeDeps: {
31
- exclude: [
32
- '@shijiu/jsview/loader/jsview-main.js', // 解决windows上出现解析异常的问题。
33
- 'jsview',
34
- 'jsview-vue',
35
- 'jsview-vue-samples',
36
- 'jsview-react-samples',
37
- 'jsview-vue-samples',
38
- 'node_modules/@shijiu',
39
- ],
40
- },
41
- plugins: [
42
- fullReload('node_modules/@shijiu/**/*'),
43
- ],
44
- resolve: {
45
- alias: {
46
- // 'jsview': pathResolve(process.cwd(), 'node_modules/@shijiu/jsview'),
47
- 'jsview-vue': pathResolve(process.cwd(), 'node_modules/@shijiu/jsview-vue'),
48
- 'jsview-vue-samples': pathResolve(process.cwd(), 'node_modules/@shijiu/jsview-vue-samples'),
49
- 'jsview-react': pathResolve(process.cwd(), 'node_modules/@shijiu/jsview-react'),
50
- 'jsview-react-samples': pathResolve(process.cwd(), 'node_modules/@shijiu/jsview-react-samples'),
51
- '/js/main.jsv.js': pathResolve(process.cwd(), 'node_modules/@shijiu/jsview/loader/jsview-main.js'),
52
- },
53
- preserveSymlinks: true
54
- },
55
- server: {
56
- host: true,
57
- open: process.platform === "darwin",
58
- watch: {
59
- ignored: [
60
- '!**/node_modules/@shijiu/**',
61
- ],
62
- }
63
- },
64
- });
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);