@shijiu/jsview-vue 1.9.642 → 1.9.643

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/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "./dom/*.js",
8
8
  "./loader/*.js"
9
9
  ],
10
- "version": "1.9.642",
10
+ "version": "1.9.643",
11
11
  "bin": {
12
12
  "jsview-post-build": "./scripts/jsview-post-build.js",
13
13
  "jsview-post-install": "./scripts/jsview-post-install.js",
@@ -25,19 +25,19 @@ function installPackages(options) {
25
25
  console.info("\nPatching jsview from " + options.patchDir);
26
26
  cpSync(
27
27
  options.rootDir,
28
- options.patchDir + "/node_modules",
29
- options.rootDir + "/node_modules"
28
+ path.resolve(options.patchDir, 'node_modules'),
29
+ path.resolve(options.rootDir, 'node_modules')
30
30
  );
31
31
 
32
32
  console.info("\nCleanup node_modules cache... ");
33
- const nodeModuleCacheDir = options.rootDir + "/node_modules/.cache";
33
+ const nodeModuleCacheDir = path.resolve(options.rootDir, 'node_modules', '.cache');
34
34
  rmSync(nodeModuleCacheDir);
35
35
  }
36
36
 
37
37
  async function printRevision(options) {
38
- const jsveiwVersionFile = options.jsviewDir + "/dom/target_core_revision.js";
38
+ const jsviewVersionFile = path.resolve(options.jsviewDir, 'dom', 'target_core_revision.js');
39
39
 
40
- const jsviewTargetVersion = require(jsveiwVersionFile);
40
+ const jsviewTargetVersion = require(jsviewVersionFile);
41
41
 
42
42
  console.log("");
43
43
  console.log("**************************************************");
@@ -2,6 +2,7 @@
2
2
 
3
3
  const fs = require('fs');
4
4
  const path = require('path');
5
+ const { pathToFileURL } = require('url');
5
6
  const { cpSync, rmSync } = require('./common');
6
7
 
7
8
  function checkNpmCommand() {
@@ -37,19 +38,20 @@ function installPatches(options) {
37
38
  console.info('\nPatching jsview from ' + options.patchesDir);
38
39
  cpSync(
39
40
  options.projectDir,
40
- options.patchesDir + '/node_modules',
41
- options.projectDir + '/node_modules'
41
+ path.resolve(options.patchesDir, 'node_modules'),
42
+ path.resolve(options.projectDir, 'node_modules')
42
43
  );
43
44
 
44
45
  console.info('\nCleanup node_modules cache... ');
45
- const nodeModuleCacheDir = options.projectDir + '/node_modules/.cache';
46
+ const nodeModuleCacheDir = path.resolve(options.projectDir, 'node_modules', '.cache');
46
47
  rmSync(nodeModuleCacheDir);
47
48
  }
48
49
 
49
50
  async function printRevision(options) {
50
- const jsveiwVersionFile = options.jsviewDir + '/dom/target_core_revision.mjs';
51
+ const jsviewVersionFile = path.resolve(options.jsviewDir, 'dom', 'target_core_revision.mjs');
51
52
 
52
- const { default: jsviewTargetVersion } = await import(jsveiwVersionFile);
53
+ const jsviewVersionURL = pathToFileURL(jsviewVersionFile);
54
+ const { default: jsviewTargetVersion } = await import(jsviewVersionURL);
53
55
 
54
56
  console.log('**************************************************');
55
57
  console.log('* Update revision to:');
@@ -60,11 +62,11 @@ async function printRevision(options) {
60
62
  // print plugin info
61
63
  let pluginCount = 0;
62
64
  {
63
- let pluginDirPath = path.join(options.jsviewDir, '/utils/JsViewPlugin');
65
+ let pluginDirPath = path.resolve(options.jsviewDir, 'utils', 'JsViewPlugin');
64
66
  fs.readdirSync(pluginDirPath).forEach((file) => {
65
- var pathname = path.join(pluginDirPath, file);
67
+ var pathname = path.resolve(pluginDirPath, file);
66
68
  if (fs.statSync(pathname).isDirectory()) {
67
- let versionFilePath = path.join(pathname, 'version.js');
69
+ let versionFilePath = path.resolve(pathname, 'version.js');
68
70
  if (fs.existsSync(versionFilePath)) {
69
71
  const targetVersion = require(versionFilePath);
70
72
  console.log(`* [${path.basename
@@ -2,6 +2,7 @@
2
2
 
3
3
  const childProcess = require('child_process');
4
4
  const path = require('path');
5
+ const { pathToFileURL } = require('url');
5
6
 
6
7
  async function getOptions() {
7
8
  const options = {
@@ -18,8 +19,9 @@ async function getOptions() {
18
19
  const projectDir = process.cwd();
19
20
  const modulesDir = path.resolve(projectDir, 'node_modules');
20
21
  const jsviewDir = path.resolve(modulesDir, '@shijiu', 'jsview-vue');
21
- const jsveiwVersionFile = path.resolve(jsviewDir, 'dom', 'target_core_revision.mjs');
22
- const { default: jsviewTargetVersion } = await import(jsveiwVersionFile);
22
+ const jsviewVersionFile = path.resolve(jsviewDir, 'dom', 'target_core_revision.mjs');
23
+ const jsviewVersionURL = pathToFileURL(jsviewVersionFile);
24
+ const { default: jsviewTargetVersion } = await import(jsviewVersionURL);
23
25
  options.coreRevision = jsviewTargetVersion.CoreRevision;
24
26
  options.jseUrl = jsviewTargetVersion.JseUrl;
25
27