@shijiu/jsview 1.9.825 → 1.9.829
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
|
@@ -25,7 +25,11 @@ const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
|
|
|
25
25
|
// like /todos/42/static/js/bundle.7289d.js. We have to know the root.
|
|
26
26
|
const publicUrlOrPath = getPublicUrlOrPath(
|
|
27
27
|
process.env.NODE_ENV === 'development',
|
|
28
|
-
|
|
28
|
+
// JsView Modified >>>
|
|
29
|
+
// index.html 使用相对路径
|
|
30
|
+
//require(resolveApp('package.json')).homepage,
|
|
31
|
+
require(resolveApp('package.json')).homepage ?? './',
|
|
32
|
+
// JsView Modified <<<
|
|
29
33
|
process.env.PUBLIC_URL
|
|
30
34
|
);
|
|
31
35
|
|
|
@@ -6,6 +6,7 @@ import fullReload from 'vite-plugin-full-reload';
|
|
|
6
6
|
// https://vitejs.dev/config/
|
|
7
7
|
const jsviewConfig = defineConfig({
|
|
8
8
|
assetsInclude: ['**/*.bmp'],
|
|
9
|
+
base: './', // index.html 使用相对路径
|
|
9
10
|
build: {
|
|
10
11
|
assetsInlineLimit: 0,
|
|
11
12
|
//cssTarget: 'css/', // 未生效
|
|
@@ -152,4 +153,4 @@ function jsvSaveUrlToCache(urls) {
|
|
|
152
153
|
export {
|
|
153
154
|
jsvCreateJsViewViteConfig,
|
|
154
155
|
jsvSaveUrlToCache,
|
|
155
|
-
}
|
|
156
|
+
}
|
package/tools/jsview-common.js
CHANGED
|
@@ -244,7 +244,7 @@ function cpSync(workDir, srcPath, destPath, ignore=[])
|
|
|
244
244
|
|
|
245
245
|
function rmSync(workDir, filePath)
|
|
246
246
|
{
|
|
247
|
-
const desc = '
|
|
247
|
+
const desc = ' -* ' + path.relative(workDir, filePath);
|
|
248
248
|
console.info(desc);
|
|
249
249
|
fs.rmSync(filePath, { recursive: true, force: true });
|
|
250
250
|
}
|
|
@@ -255,7 +255,7 @@ function symlinkSync(workDir, targetPath, toPath)
|
|
|
255
255
|
|
|
256
256
|
const relativePath = path.relative(path.dirname(toPath), targetPath);
|
|
257
257
|
|
|
258
|
-
const desc = ' ' + path.relative(workDir, toPath) + '
|
|
258
|
+
const desc = ' ' + path.relative(workDir, toPath) + ' -< ' + path.relative(workDir, relativePath);
|
|
259
259
|
console.info(desc);
|
|
260
260
|
fs.symlinkSync(relativePath, toPath, 'dir');
|
|
261
261
|
}
|
|
@@ -33,9 +33,16 @@ function checkNpmCommand()
|
|
|
33
33
|
|
|
34
34
|
function checkNpmLinkForDebug(options, linkablePkgNames)
|
|
35
35
|
{
|
|
36
|
+
const pkgObj = getPackageObject(options.projectDir);
|
|
37
|
+
|
|
36
38
|
// node 16 不会安装本地包的二次依赖, 需要手动安装。
|
|
37
39
|
let missingDepPkgs = '';
|
|
38
40
|
for (const linkableName of linkablePkgNames) {
|
|
41
|
+
let linkableTarget = pkgObj.dependencies?.[linkableName];
|
|
42
|
+
if (!linkableTarget || !linkableTarget.startsWith('file:')) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
|
|
39
46
|
const linkablePath = path.resolve(options.modulesDir, linkableName);
|
|
40
47
|
const linkablePkgObj = getPackageObject(linkablePath);
|
|
41
48
|
|
|
@@ -59,11 +66,12 @@ function checkNpmLinkForDebug(options, linkablePkgNames)
|
|
|
59
66
|
missingDepPkgs += ' ' + devDepPkg;
|
|
60
67
|
}
|
|
61
68
|
}
|
|
62
|
-
|
|
63
|
-
|
|
69
|
+
if (missingDepPkgs !== '') {
|
|
70
|
+
console.log('Install missing dependencies')
|
|
71
|
+
execCommand('npm install --no-save ' + missingDepPkgs);
|
|
72
|
+
}
|
|
64
73
|
|
|
65
74
|
// node 18 不会将本地依赖安装成链接,需要手动改成链接。
|
|
66
|
-
const pkgObj = getPackageObject(options.projectDir);
|
|
67
75
|
for (const linkableName of linkablePkgNames) {
|
|
68
76
|
let linkableTarget = pkgObj.dependencies?.[linkableName];
|
|
69
77
|
if (!linkableTarget || !linkableTarget.startsWith('file:')) {
|
|
@@ -161,24 +169,11 @@ function doPostInstall(framework, pkgNeedPatch, skipCheckVersion)
|
|
|
161
169
|
|
|
162
170
|
const linkablePkgNames = [
|
|
163
171
|
'@shijiu/jsview',
|
|
172
|
+
'@shijiu/jsview-vue',
|
|
173
|
+
'@shijiu/jsview-vue-samples',
|
|
174
|
+
'@shijiu/jsview-react',
|
|
175
|
+
'@shijiu/jsview-react-samples',
|
|
164
176
|
];
|
|
165
|
-
switch (framework) {
|
|
166
|
-
case 'vue':
|
|
167
|
-
linkablePkgNames.push(
|
|
168
|
-
'@shijiu/jsview-vue',
|
|
169
|
-
'@shijiu/jsview-vue-samples',
|
|
170
|
-
)
|
|
171
|
-
break;
|
|
172
|
-
case 'react':
|
|
173
|
-
linkablePkgNames.push(
|
|
174
|
-
'@shijiu/jsview-react',
|
|
175
|
-
'@shijiu/jsview-react-samples',
|
|
176
|
-
)
|
|
177
|
-
break;
|
|
178
|
-
default:
|
|
179
|
-
console.error('JsView Error: Bad framework: ' + framework);
|
|
180
|
-
break;
|
|
181
|
-
}
|
|
182
177
|
|
|
183
178
|
checkNpmCommand();
|
|
184
179
|
|