@omnia/tooling-vue 8.0.334-dev → 8.0.336-dev
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.
|
@@ -259,9 +259,16 @@ function extractTypes(types, componentInfo) {
|
|
|
259
259
|
function convertComponentOptionsToString(component) {
|
|
260
260
|
function getEmits() {
|
|
261
261
|
let result = "";
|
|
262
|
-
Object.keys(component.emits)
|
|
262
|
+
const emits = Object.keys(component.emits);
|
|
263
|
+
const models = Object.keys(component.models);
|
|
264
|
+
emits.forEach(name => {
|
|
263
265
|
result = `${result} "${name}",`;
|
|
264
266
|
});
|
|
267
|
+
models.forEach(name => {
|
|
268
|
+
if (emits.indexOf(name) === -1) {
|
|
269
|
+
result = `${result} "update:${name}",`;
|
|
270
|
+
}
|
|
271
|
+
});
|
|
265
272
|
return result;
|
|
266
273
|
}
|
|
267
274
|
function getProps() {
|
|
@@ -334,6 +334,7 @@ function buildManifestMetadata(entries) {
|
|
|
334
334
|
}
|
|
335
335
|
$.tooling.logTime('Build manifests metadata done', startTime);
|
|
336
336
|
compiler.close((err, result) => { });
|
|
337
|
+
compiler = null;
|
|
337
338
|
resolve(entries);
|
|
338
339
|
});
|
|
339
340
|
}
|
|
@@ -463,103 +464,108 @@ function bundleManifest(entries) {
|
|
|
463
464
|
webpackConfigs.push(vueWebpackConfig);
|
|
464
465
|
});
|
|
465
466
|
// run on each batch 500 manifets to prevent memory leak and perf
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
// //compiler.close((err, result) => { })
|
|
476
|
-
// return;
|
|
477
|
-
// }
|
|
478
|
-
// if (stats.hasErrors()) {
|
|
479
|
-
// $.tooling.log('Bundle manifest have error : \r\n', $.tooling.LogTypes.Error);
|
|
480
|
-
// let errors = stats.toJson().errors;
|
|
481
|
-
// errors.forEach((err: any) => {
|
|
482
|
-
// $.tooling.log(err.stack || err, $.tooling.LogTypes.Error);
|
|
483
|
-
// })
|
|
484
|
-
// reject();
|
|
485
|
-
// //compiler.close((err, result) => { })
|
|
486
|
-
// return;
|
|
487
|
-
// }
|
|
488
|
-
// compiler.close((err, result) => { });
|
|
489
|
-
// compiler = null;
|
|
490
|
-
// if (end === webpackConfigs.length) {
|
|
491
|
-
// if (checkDuplicateBundle()) { // detect duplicated bundle
|
|
492
|
-
// $.tooling.log('Bundle manifest have error that found duplicated bundles', $.tooling.LogTypes.Error);
|
|
493
|
-
// reject();
|
|
494
|
-
// //compiler.close((err, result) => { })
|
|
495
|
-
// return;
|
|
496
|
-
// }
|
|
497
|
-
// // merge stylex.css
|
|
498
|
-
// const stylexFiles: string[] = globbySync([`${$.tooling.utils.root($.tooling.composer.OmniaOutput.OutputBundlePath).replace(/\\/g, "/")}/*.stylex.css`]);
|
|
499
|
-
// stylexFiles?.forEach(stylexFilePath => {
|
|
500
|
-
// const manifestCssFilePath = stylexFilePath.replace(".stylex.css", ".css");
|
|
501
|
-
// const styelxCss = fsExtra.readFileSync(stylexFilePath, 'utf8');
|
|
502
|
-
// if (!fsExtra.existsSync(manifestCssFilePath)) {
|
|
503
|
-
// fsExtra.outputFileSync(manifestCssFilePath, styelxCss);
|
|
504
|
-
// } else {
|
|
505
|
-
// const css = fsExtra.readFileSync(manifestCssFilePath, 'utf8');
|
|
506
|
-
// fsExtra.outputFileSync(manifestCssFilePath, `${styelxCss}
|
|
507
|
-
// ${css}`);
|
|
508
|
-
// }
|
|
509
|
-
// fsExtra.removeSync(stylexFilePath);
|
|
510
|
-
// });
|
|
511
|
-
// resolve(entries)
|
|
512
|
-
// } else {
|
|
513
|
-
// start = start + 500;
|
|
514
|
-
// end = (end + 500) > webpackConfigs.length ? webpackConfigs.length : end + 500
|
|
515
|
-
// recursiveCompile();
|
|
516
|
-
// }
|
|
517
|
-
// });
|
|
518
|
-
// }
|
|
519
|
-
// recursiveCompile();
|
|
520
|
-
let compiler = $.webpack(webpackConfigs);
|
|
521
|
-
compiler.run((err, stats) => {
|
|
522
|
-
if (checkDuplicateBundle()) { // detect duplicated bundle
|
|
523
|
-
$.tooling.log('Bundle manifest have error that found duplicated bundles', $.tooling.LogTypes.Error);
|
|
524
|
-
reject();
|
|
525
|
-
//compiler.close((err, result) => { })
|
|
526
|
-
return;
|
|
527
|
-
}
|
|
528
|
-
if (err) {
|
|
529
|
-
$.tooling.log('Bundle manifest error : \r\n', $.tooling.LogTypes.Error);
|
|
530
|
-
$.tooling.log(err.stack || err, $.tooling.LogTypes.Error);
|
|
531
|
-
reject();
|
|
532
|
-
//compiler.close((err, result) => { })
|
|
533
|
-
return;
|
|
534
|
-
}
|
|
535
|
-
if (stats.hasErrors()) {
|
|
536
|
-
$.tooling.log('Bundle manifest have error : \r\n', $.tooling.LogTypes.Error);
|
|
537
|
-
let errors = stats.toJson().errors;
|
|
538
|
-
errors.forEach((err) => {
|
|
467
|
+
let start = 0;
|
|
468
|
+
let end = webpackConfigs.length > 500 ? 500 : webpackConfigs.length;
|
|
469
|
+
function recursiveCompile() {
|
|
470
|
+
let compiler = $.webpack(webpackConfigs.slice(start, end));
|
|
471
|
+
let startTime = new Date().getTime();
|
|
472
|
+
tooling_1.utils.logTime(`Bundle a batch manifests from ${start} to ${end} running...`, startTime);
|
|
473
|
+
compiler.run((err, stats) => {
|
|
474
|
+
if (err) {
|
|
475
|
+
$.tooling.log('Bundle manifest error : \r\n', $.tooling.LogTypes.Error);
|
|
539
476
|
$.tooling.log(err.stack || err, $.tooling.LogTypes.Error);
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
477
|
+
reject();
|
|
478
|
+
//compiler.close((err, result) => { })
|
|
479
|
+
return;
|
|
480
|
+
}
|
|
481
|
+
if (stats.hasErrors()) {
|
|
482
|
+
$.tooling.log('Bundle manifest have error : \r\n', $.tooling.LogTypes.Error);
|
|
483
|
+
let errors = stats.toJson().errors;
|
|
484
|
+
errors.forEach((err) => {
|
|
485
|
+
$.tooling.log(err.stack || err, $.tooling.LogTypes.Error);
|
|
486
|
+
});
|
|
487
|
+
reject();
|
|
488
|
+
//compiler.close((err, result) => { })
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
compiler.close((err, result) => { });
|
|
492
|
+
compiler = null;
|
|
493
|
+
if (end === webpackConfigs.length) {
|
|
494
|
+
if (checkDuplicateBundle()) { // detect duplicated bundle
|
|
495
|
+
$.tooling.log('Bundle manifest have error that found duplicated bundles', $.tooling.LogTypes.Error);
|
|
496
|
+
reject();
|
|
497
|
+
//compiler.close((err, result) => { })
|
|
498
|
+
return;
|
|
499
|
+
}
|
|
500
|
+
// merge stylex.css
|
|
501
|
+
const stylexFiles = (0, globby_1.globbySync)([`${$.tooling.utils.root($.tooling.composer.OmniaOutput.OutputBundlePath).replace(/\\/g, "/")}/*.stylex.css`]);
|
|
502
|
+
stylexFiles?.forEach(stylexFilePath => {
|
|
503
|
+
const manifestCssFilePath = stylexFilePath.replace(".stylex.css", ".css");
|
|
504
|
+
const styelxCss = fsExtra.readFileSync(stylexFilePath, 'utf8');
|
|
505
|
+
if (!fsExtra.existsSync(manifestCssFilePath)) {
|
|
506
|
+
fsExtra.outputFileSync(manifestCssFilePath, styelxCss);
|
|
507
|
+
}
|
|
508
|
+
else {
|
|
509
|
+
const css = fsExtra.readFileSync(manifestCssFilePath, 'utf8');
|
|
510
|
+
fsExtra.outputFileSync(manifestCssFilePath, `${styelxCss}
|
|
511
|
+
${css}`);
|
|
512
|
+
}
|
|
513
|
+
fsExtra.removeSync(stylexFilePath);
|
|
514
|
+
});
|
|
515
|
+
tooling_1.utils.logTime(`Bundle a batch manifests from ${start} to ${end} done`, startTime);
|
|
516
|
+
resolve(entries);
|
|
553
517
|
}
|
|
554
518
|
else {
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
519
|
+
tooling_1.utils.logTime(`Bundle a batch manifests from ${start} to ${end} done`, startTime);
|
|
520
|
+
start = start + 500;
|
|
521
|
+
end = (end + 500) > webpackConfigs.length ? webpackConfigs.length : end + 500;
|
|
522
|
+
recursiveCompile();
|
|
558
523
|
}
|
|
559
|
-
fsExtra.removeSync(stylexFilePath);
|
|
560
524
|
});
|
|
561
|
-
|
|
562
|
-
|
|
525
|
+
}
|
|
526
|
+
recursiveCompile();
|
|
527
|
+
// let compiler = $.webpack(webpackConfigs)
|
|
528
|
+
// compiler.run((err, stats) => {
|
|
529
|
+
// if (checkDuplicateBundle()) { // detect duplicated bundle
|
|
530
|
+
// $.tooling.log('Bundle manifest have error that found duplicated bundles', $.tooling.LogTypes.Error);
|
|
531
|
+
// reject();
|
|
532
|
+
// //compiler.close((err, result) => { })
|
|
533
|
+
// return;
|
|
534
|
+
// }
|
|
535
|
+
// if (err) {
|
|
536
|
+
// $.tooling.log('Bundle manifest error : \r\n', $.tooling.LogTypes.Error);
|
|
537
|
+
// $.tooling.log(err.stack || err, $.tooling.LogTypes.Error);
|
|
538
|
+
// reject();
|
|
539
|
+
// //compiler.close((err, result) => { })
|
|
540
|
+
// return;
|
|
541
|
+
// }
|
|
542
|
+
// if (stats.hasErrors()) {
|
|
543
|
+
// $.tooling.log('Bundle manifest have error : \r\n', $.tooling.LogTypes.Error);
|
|
544
|
+
// let errors = stats.toJson().errors;
|
|
545
|
+
// errors.forEach((err: any) => {
|
|
546
|
+
// $.tooling.log(err.stack || err, $.tooling.LogTypes.Error);
|
|
547
|
+
// })
|
|
548
|
+
// reject();
|
|
549
|
+
// //compiler.close((err, result) => { })
|
|
550
|
+
// return;
|
|
551
|
+
// }
|
|
552
|
+
// compiler.close((err, result) => { });
|
|
553
|
+
// // merge stylex.css
|
|
554
|
+
// const stylexFiles: string[] = globbySync([`${$.tooling.utils.root($.tooling.composer.OmniaOutput.OutputBundlePath).replace(/\\/g, "/")}/*.stylex.css`]);
|
|
555
|
+
// stylexFiles?.forEach(stylexFilePath => {
|
|
556
|
+
// const manifestCssFilePath = stylexFilePath.replace(".stylex.css", ".css");
|
|
557
|
+
// const styelxCss = fsExtra.readFileSync(stylexFilePath, 'utf8');
|
|
558
|
+
// if (!fsExtra.existsSync(manifestCssFilePath)) {
|
|
559
|
+
// fsExtra.outputFileSync(manifestCssFilePath, styelxCss);
|
|
560
|
+
// } else {
|
|
561
|
+
// const css = fsExtra.readFileSync(manifestCssFilePath, 'utf8');
|
|
562
|
+
// fsExtra.outputFileSync(manifestCssFilePath, `${styelxCss}
|
|
563
|
+
// ${css}`);
|
|
564
|
+
// }
|
|
565
|
+
// fsExtra.removeSync(stylexFilePath);
|
|
566
|
+
// });
|
|
567
|
+
// resolve(entries)
|
|
568
|
+
// });
|
|
563
569
|
}
|
|
564
570
|
}
|
|
565
571
|
catch (e) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omnia/tooling-vue",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "8.0.
|
|
4
|
+
"version": "8.0.336-dev",
|
|
5
5
|
"description": "Used to bundle and serve manifests web component that build on Vue framework.",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
],
|
|
20
20
|
"author": "Precio Fishbone",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@omnia/fx-models": "8.0.
|
|
23
|
-
"@omnia/tooling-composers": "8.0.
|
|
22
|
+
"@omnia/fx-models": "8.0.336-dev",
|
|
23
|
+
"@omnia/tooling-composers": "8.0.336-dev",
|
|
24
24
|
"@types/mousetrap": "1.5.34",
|
|
25
25
|
"@types/quill": "1.3.6",
|
|
26
26
|
"@types/zepto": "1.0.29",
|