@shijiu/jsview 1.9.915 → 1.9.921
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/dom/bin/jsview-dom-browser.min.js +1 -1
- package/dom/bin/jsview-dom-native.min.js +1 -1
- package/dom/target_core_revision.mjs +4 -4
- package/package.json +1 -1
- package/patches/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +2 -17
- package/patches/node_modules/@vue/compiler-sfc/dist/jsview-css-to-js.js +87 -53
- package/patches/node_modules/@vue/compiler-sfc/dist/jsview-style-format.js +4 -4
- package/patches/node_modules/@vue/compiler-sfc/dist/jsview-style-types.js +3 -0
- package/patches/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts +1531 -0
- package/patches/node_modules/vite/dist/node/jsview-vite-extension.js +3 -0
- package/tools/jsview-batch-upgrade.mjs +33 -37
|
@@ -33,6 +33,9 @@ const jsviewConfig = defineConfig({
|
|
|
33
33
|
manualChunks: {
|
|
34
34
|
'export-sfc': ['\0plugin-vue:export-helper'], // 将_export_sfc独立出来,防止被集成在jsview-vue中导致import deadloop.
|
|
35
35
|
'vue': ['vue'], // 将vue独立出来,防止被集成在main.js中导致import deadloop.
|
|
36
|
+
// 将dom-entry和forge-define分割出来,防止被集成在main.js中导致import deadloop.
|
|
37
|
+
'forge-define': ['@shijiu/jsview/dom/jsv-forge-define.mjs'],
|
|
38
|
+
'jsivew-dom-entry': ['@shijiu/jsview/dom/index.mjs'],
|
|
36
39
|
},
|
|
37
40
|
},
|
|
38
41
|
},
|
|
@@ -25,6 +25,7 @@ function getOptions(argv)
|
|
|
25
25
|
|
|
26
26
|
const scriptPath = path.resolve(process.cwd(), process.argv[1]);
|
|
27
27
|
options.rootDir = scriptPath.replaceAll(/node_modules\/@shijiu\/jsview.*/g, '');
|
|
28
|
+
options.rootDir = options.rootDir.replaceAll(/node_modules\\@shijiu\\jsview.*/g, ''); // for windows
|
|
28
29
|
|
|
29
30
|
options.stages = argv.stages?.split(',') ?? [];
|
|
30
31
|
|
|
@@ -134,7 +135,7 @@ function replaceStageContent(options, sourcePathList, msgPrefix,
|
|
|
134
135
|
console.info(msgPrefix + ': Upgraded ' + path.relative(options.rootDir, filePath));
|
|
135
136
|
}
|
|
136
137
|
|
|
137
|
-
return
|
|
138
|
+
return;
|
|
138
139
|
}
|
|
139
140
|
|
|
140
141
|
function removeStageFile(options, sourcePathList, msgPrefix,
|
|
@@ -165,28 +166,27 @@ function removeStageFile(options, sourcePathList, msgPrefix,
|
|
|
165
166
|
console.info(msgPrefix + ': Upgraded ' + path.relative(options.rootDir, filePath));
|
|
166
167
|
}
|
|
167
168
|
|
|
168
|
-
return
|
|
169
|
+
return;
|
|
169
170
|
}
|
|
170
171
|
|
|
171
172
|
function upgradeStagePixel(options) {
|
|
172
173
|
const msgPrefix = 'Stage ' + options.stagePixels;
|
|
173
174
|
console.info(msgPrefix + ': Upgrading pixels...');
|
|
174
175
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
return ret;
|
|
176
|
+
// 过滤 (+ px), (+ 'px'), (+ "px"), (+ `px`), ( + ' px ') 等
|
|
177
|
+
replaceStageContent(options, options.sourcePathList, msgPrefix,
|
|
178
|
+
/ *\+ ['"`]* *px *['"`]*/g, '');
|
|
179
|
+
// 过滤 (00px), ('00px'), ("00px"), (`00px`), ('00px') 等
|
|
180
|
+
replaceStageContent(options, options.sourcePathList, msgPrefix,
|
|
181
|
+
/['"`]*([0-9]+)px['"`]*/g, '$1');
|
|
182
|
+
// 过滤 (' 00px '), (" 00px "), (` 00px `), ('00px ') 等
|
|
183
|
+
replaceStageContent(options, options.sourcePathList, msgPrefix,
|
|
184
|
+
/['"`] *([0-9]+)px *['"`]/g, '$1');
|
|
185
|
+
// 过滤 ('${00}px'), ("${00}px"), (`${00}px`), ( ' ${00}px ') 等
|
|
186
|
+
replaceStageContent(options, options.sourcePathList, msgPrefix,
|
|
187
|
+
/['"`]*(\${.*?})px *['"`]*/g, '$1');
|
|
188
|
+
|
|
189
|
+
return;
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
function upgradeStageAnimation(options)
|
|
@@ -205,10 +205,10 @@ function upgradeStageHashHistory(options)
|
|
|
205
205
|
const msgPrefix = 'Stage ' + options.stageHashHistory;
|
|
206
206
|
console.info(msgPrefix + ': Upgrading hash history...');
|
|
207
207
|
|
|
208
|
-
|
|
209
|
-
|
|
208
|
+
replaceStageContent(options, options.sourcePathList, msgPrefix,
|
|
209
|
+
'createJsvHashHistory', 'jsvCreateHashHistory');
|
|
210
210
|
|
|
211
|
-
return
|
|
211
|
+
return;
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
function upgradeStageAudiotrack(options)
|
|
@@ -216,10 +216,10 @@ function upgradeStageAudiotrack(options)
|
|
|
216
216
|
const msgPrefix = 'Stage ' + options.stageAudiotrack;
|
|
217
217
|
console.info(msgPrefix + ': Upgrading audiotrack...');
|
|
218
218
|
|
|
219
|
-
|
|
220
|
-
|
|
219
|
+
replaceStageContent(options, options.sourcePathList, msgPrefix,
|
|
220
|
+
'<audiotrack', '<jsv-audiotrack');
|
|
221
221
|
|
|
222
|
-
return
|
|
222
|
+
return;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
function upgradeStageImportPostfix(options)
|
|
@@ -274,7 +274,7 @@ function upgradeStageImportPostfix(options)
|
|
|
274
274
|
console.info(msgPrefix + ': Upgraded ' + path.relative(options.rootDir, filePath));
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
-
return
|
|
277
|
+
return;
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
function upgradeStageAppConfig(options)
|
|
@@ -291,19 +291,15 @@ function upgradeStageAppConfig(options)
|
|
|
291
291
|
|
|
292
292
|
const appConfigFilePath = path.resolve(appConfigDir, 'app_config.json');
|
|
293
293
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
if (ret < 0) {
|
|
297
|
-
console.error(msgPrefix + ': Failed to upgrading app config file, is not found.');
|
|
298
|
-
process.exit(1);
|
|
299
|
-
}
|
|
294
|
+
removeStageFile(options, [ appConfigFilePath ], msgPrefix,
|
|
295
|
+
[ 'app_config.json' ], 'app.config.json');
|
|
300
296
|
|
|
301
297
|
const sourcePathList = getFilesRecursive(appConfigDir);
|
|
302
298
|
|
|
303
|
-
|
|
304
|
-
|
|
299
|
+
removeStageFile(options, sourcePathList, msgPrefix,
|
|
300
|
+
[ '.js', '.json' ], '.mjs');
|
|
305
301
|
|
|
306
|
-
return
|
|
302
|
+
return;
|
|
307
303
|
}
|
|
308
304
|
|
|
309
305
|
function upgradeStageMainEntry(options)
|
|
@@ -321,10 +317,10 @@ function upgradeStageMainEntry(options)
|
|
|
321
317
|
process.exit(1);
|
|
322
318
|
}
|
|
323
319
|
|
|
324
|
-
|
|
325
|
-
|
|
320
|
+
removeStageFile(options, [ mainEntryFilePath ], msgPrefix,
|
|
321
|
+
[ 'main.ts' ], 'main.tsx');
|
|
326
322
|
|
|
327
|
-
return
|
|
323
|
+
return;
|
|
328
324
|
}
|
|
329
325
|
|
|
330
326
|
function main(argv)
|
|
@@ -379,7 +375,7 @@ function main(argv)
|
|
|
379
375
|
|
|
380
376
|
const requiredUsages = {
|
|
381
377
|
'--stages': `Upgrade stages, separate by comma(,). The value means the following:
|
|
382
|
-
1. Fix pixels. "[0-9
|
|
378
|
+
1. Fix pixels. "[0-9]px => [0-9]", "delete (+ \`px\`),(+ 'px'),(+ "px")"
|
|
383
379
|
2. Fix animation. ":onAnimationEnd => @animationend"
|
|
384
380
|
3. Fix hash history. "createJsvHashHistory => jsvCreateHashHistory"
|
|
385
381
|
4. Fix audiotrack. "<audiotrack => <jsv-audiotrack"
|