@omnia/tooling-vue 8.0.191-dev → 8.0.193-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.
- package/internal-do-not-import-from-here/config/tooling.output.json +1 -1
- package/internal-do-not-import-from-here/config/wctypings.d.ts +61 -0
- package/internal-do-not-import-from-here/shared.d.ts +3 -0
- package/internal-do-not-import-from-here/tasks/ComponentDocRegistrations.js +1 -1
- package/internal-do-not-import-from-here/tasks/bundle.d.ts +6 -6
- package/internal-do-not-import-from-here/tasks/bundle.js +38 -29
- package/internal-do-not-import-from-here/tasks/doc.js +1 -1
- package/internal-do-not-import-from-here/vite/hmr/graph.d.ts +2 -1
- package/internal-do-not-import-from-here/vite/hmr/graph.js +2 -0
- package/internal-do-not-import-from-here/vite/hmr/transformers/internal/dynamicBundle.js +2 -2
- package/internal-do-not-import-from-here/vite/hmr/utils/path.d.ts +2 -1
- package/internal-do-not-import-from-here/vite/hmr/utils/path.js +2 -1
- package/internal-do-not-import-from-here/vite/middlewares/HmrMiddleware.js +3 -3
- package/internal-do-not-import-from-here/vite/middlewares/StaticFileMiddleware.js +5 -5
- package/internal-do-not-import-from-here/vite/middlewares/WebpackMiddleware.js +3 -3
- package/internal-do-not-import-from-here/webpack-loaders/replacement-loader.d.ts +1 -0
- package/internal-do-not-import-from-here/webpack-loaders/{vue-component-loader.js → replacement-loader.js} +2 -1
- package/internal-do-not-import-from-here/webpack-loaders/ts-loader.js +3 -0
- package/internal-do-not-import-from-here/webpack-loaders/tsx-loader.js +1 -1
- package/internal-do-not-import-from-here/webpack-plugins/omnia.webpack.plugins.js +1 -1
- package/package.json +3 -3
- package/internal-do-not-import-from-here/webpack-loaders/vue-component-loader.d.ts +0 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { Configuration } from 'webpack';
|
|
2
2
|
import { BuildOptions } from '@omnia/tooling-composers';
|
|
3
|
-
import {
|
|
3
|
+
import { guid } from "@omnia/fx-models";
|
|
4
4
|
declare function bundleManifest(entries: any): Promise<void>;
|
|
5
5
|
declare function createVueWebpackConfig(currentEntry: any, entries: any, bundleOutputDir: any, viteHmrOption?: 'prebundle' | 'dynamic'): Configuration;
|
|
6
6
|
declare function processManifestGenerated(entries: any, outDir: any): void;
|
|
7
7
|
declare function createCombinedManfest(omniaServiceId: any, manifestIds: any, targetManifestId: any, targetManifestName: any, outputDir: any): Promise<void>;
|
|
8
8
|
declare function cleanUpComposer(): void;
|
|
9
9
|
declare function getBuildOption(): BuildOptions;
|
|
10
|
-
declare function getServiceId():
|
|
11
|
-
declare function ensureManifestDependencyInRuntime(currentManifestId:
|
|
12
|
-
declare function addDependency(currentManifest:
|
|
10
|
+
declare function getServiceId(): guid;
|
|
11
|
+
declare function ensureManifestDependencyInRuntime(currentManifestId: guid, manifestBundleFilePath: any): void;
|
|
12
|
+
declare function addDependency(currentManifest: guid, dependentManifest: guid, dependentOmniaServiceId: guid): void;
|
|
13
13
|
declare function checkDuplicateBundle(): boolean;
|
|
14
14
|
declare function registerManifestsReference(manifests: Array<{
|
|
15
15
|
path: string;
|
|
16
|
-
serviceId?:
|
|
17
|
-
resourceId?:
|
|
16
|
+
serviceId?: guid;
|
|
17
|
+
resourceId?: guid;
|
|
18
18
|
}>): void;
|
|
19
19
|
export { ensureManifestDependencyInRuntime, bundleManifest, getServiceId, getBuildOption, cleanUpComposer, createVueWebpackConfig, createCombinedManfest, registerManifestsReference, checkDuplicateBundle, processManifestGenerated, addDependency };
|
|
@@ -238,7 +238,7 @@ function buildEntries(serve = false) {
|
|
|
238
238
|
$.composers.ManifestRegistry.setCurrentManifestPath("node_modules");
|
|
239
239
|
$.composers
|
|
240
240
|
.Composer
|
|
241
|
-
.registerManifest(
|
|
241
|
+
.registerManifest((0, fx_models_1.maybeGuid)(bundleOptions.commonsChunk.name))
|
|
242
242
|
.registerResources({
|
|
243
243
|
resourcePaths: [fakeFile]
|
|
244
244
|
});
|
|
@@ -363,7 +363,7 @@ function beforeBundleManifest(entries) {
|
|
|
363
363
|
else if (wcRegistrations.find(rk => name.indexOf(rk.manifest.resourceId.toString()) > -1)) {
|
|
364
364
|
const manifestPath = $.tooling.utils.root(outDirManifestMetadata + "/" + name + '.manifest.json');
|
|
365
365
|
const content = {
|
|
366
|
-
name: `omniaWebpackJsonp['${getServiceId()}']['${$.tooling.utils.
|
|
366
|
+
name: `omniaWebpackJsonp['${getServiceId()}']['${$.tooling.utils.getguid(name)}']`,
|
|
367
367
|
content: {
|
|
368
368
|
[entries[name][0]]: {
|
|
369
369
|
id: entries[name][0].toLowerCase(),
|
|
@@ -504,6 +504,10 @@ function afterBundleManifest(entries) {
|
|
|
504
504
|
return new Promise(function (resolve, reject) {
|
|
505
505
|
let startTime = new Date().getTime();
|
|
506
506
|
$.tooling.log('Creating combined manifests');
|
|
507
|
+
// generate tooling output
|
|
508
|
+
const info = shared_1.ConfigurationManager.outputInfo.get();
|
|
509
|
+
info.o$ = globalThis["o$"] || {};
|
|
510
|
+
shared_1.ConfigurationManager.outputInfo.update(info);
|
|
507
511
|
createCombinedManfests($.tooling.composer.OmniaOutput.OutputBundlePath).then(function () {
|
|
508
512
|
try {
|
|
509
513
|
$.tooling.logTime('Done - Creating combined manifests', startTime);
|
|
@@ -691,7 +695,7 @@ function createVueWebpackConfig(currentEntry, entries, bundleOutputDir, viteHmrO
|
|
|
691
695
|
}
|
|
692
696
|
}));
|
|
693
697
|
}
|
|
694
|
-
plugins.push(new $.omniaWebpackPlugins.BuildWebpackRequire(getServiceId(), $.tooling.utils.
|
|
698
|
+
plugins.push(new $.omniaWebpackPlugins.BuildWebpackRequire(getServiceId(), $.tooling.utils.getguid(Object.keys(currentEntry)[0])));
|
|
695
699
|
}
|
|
696
700
|
plugins.push(new $.omniaWebpackPlugins.ChunkAssets(function (compilation, fileName) {
|
|
697
701
|
chunkAsset(entries, compilation, fileName, viteHmrOption);
|
|
@@ -736,7 +740,7 @@ function createVueWebpackConfig(currentEntry, entries, bundleOutputDir, viteHmrO
|
|
|
736
740
|
path: $.tooling.utils.root(bundleOutputDir),
|
|
737
741
|
filename: '[name].js',
|
|
738
742
|
chunkLoadingGlobal: "omniaWebpackJsonp['" + getServiceId() + "']['__register_module__']",
|
|
739
|
-
hotUpdateGlobal: ("webpackHotUpdate_" + (isBundleCommonChunk ? getServiceId() : getServiceId() + $.tooling.utils.
|
|
743
|
+
hotUpdateGlobal: ("webpackHotUpdate_" + (isBundleCommonChunk ? getServiceId() : getServiceId() + $.tooling.utils.getguid(Object.keys(currentEntry)[0]))).replace(/-/g, "")
|
|
740
744
|
},
|
|
741
745
|
module: {
|
|
742
746
|
noParse: buildOption.noParse || /wwwroot\\scripts(.*).js|wwwroot\/scripts(.*).js/,
|
|
@@ -882,7 +886,7 @@ function createWebpackConfigForManifestMetadata(entry, metadataOutputDir) {
|
|
|
882
886
|
new $.webpack.DllPlugin({
|
|
883
887
|
entryOnly: false,
|
|
884
888
|
path: $.path.join($.tooling.utils.root(""), metadataOutputDir, '[name].manifest.json'),
|
|
885
|
-
name: `omniaWebpackJsonp['${entensionId}']['${$.tooling.utils.
|
|
889
|
+
name: `omniaWebpackJsonp['${entensionId}']['${$.tooling.utils.getguid(Object.keys(entry)[0])}']`
|
|
886
890
|
})
|
|
887
891
|
]
|
|
888
892
|
});
|
|
@@ -1036,7 +1040,7 @@ function processManifestGenerated(entries, outDir) {
|
|
|
1036
1040
|
var manifestsPaths = (0, globby_1.globbySync)(outDir.replace(/\/$/, '') + '/*.*', {});
|
|
1037
1041
|
if (manifestsPaths) {
|
|
1038
1042
|
for (let p of manifestsPaths) {
|
|
1039
|
-
var manifestId = $.tooling.utils.
|
|
1043
|
+
var manifestId = $.tooling.utils.getguid($.tooling.utils.getFileName(p));
|
|
1040
1044
|
if (manifestId) {
|
|
1041
1045
|
var entryPaths = entries[$.tooling.utils.getFileName(p)];
|
|
1042
1046
|
if (entryPaths &&
|
|
@@ -1279,7 +1283,7 @@ function buildReferenceManifest(currentEntry, entries) {
|
|
|
1279
1283
|
manifests.push(new $.omniaWebpackPlugins.DllReferencePlugin({
|
|
1280
1284
|
context: $.tooling.utils.root(""),
|
|
1281
1285
|
manifest: $.tooling.utils.root(outDirManifestMetadata + "/" + entryName + ".manifest.json"),
|
|
1282
|
-
//name: `md${++trackingModuleRefId}` //utils.
|
|
1286
|
+
//name: `md${++trackingModuleRefId}` //utils.getguid(entryName)
|
|
1283
1287
|
//manifest: require($.tooling.utils.root(outDirManifestMetadata + "/" + entryName + ".manifest.json"))
|
|
1284
1288
|
}));
|
|
1285
1289
|
}
|
|
@@ -1385,14 +1389,18 @@ function getBuildOption() {
|
|
|
1385
1389
|
}
|
|
1386
1390
|
exports.getBuildOption = getBuildOption;
|
|
1387
1391
|
function getServiceId() {
|
|
1388
|
-
|
|
1392
|
+
const serviceInfo = $.composers.ServiceManifestRegistry.getServiceInfo();
|
|
1393
|
+
let result;
|
|
1389
1394
|
if (serviceInfo === null) {
|
|
1390
|
-
if (serviceId === null)
|
|
1395
|
+
if (serviceId === null) {
|
|
1391
1396
|
throw new Error("A service has not been registered, please use Composer.registerManifest(serviceId,serviceName).asWorker or .asWebApp)");
|
|
1392
|
-
|
|
1397
|
+
}
|
|
1398
|
+
result = serviceId;
|
|
1399
|
+
}
|
|
1400
|
+
else {
|
|
1401
|
+
result = (0, fx_models_1.maybeGuid)(serviceInfo.id.toLowerCase());
|
|
1393
1402
|
}
|
|
1394
|
-
|
|
1395
|
-
return serviceId;
|
|
1403
|
+
return result;
|
|
1396
1404
|
}
|
|
1397
1405
|
exports.getServiceId = getServiceId;
|
|
1398
1406
|
function createVueEntryFormComponentRegistrations(registrations) {
|
|
@@ -1403,7 +1411,7 @@ function createVueEntryFormComponentRegistrations(registrations) {
|
|
|
1403
1411
|
let entryPointPath = (0, shared_1.convertManifestPathToEntryPath)(r.manifestPath, [r.componentOptions.entryPoint]);
|
|
1404
1412
|
let entryId = r.manifest.resourceId;
|
|
1405
1413
|
if (r.manifest.resourceName) {
|
|
1406
|
-
entryId = `${r.manifest.resourceName}_${entryId}
|
|
1414
|
+
entryId = (0, fx_models_1.maybeGuid)(`${r.manifest.resourceName}_${entryId}`);
|
|
1407
1415
|
}
|
|
1408
1416
|
r.componentOptions.entryPointPath = entryPointPath[0];
|
|
1409
1417
|
entryPaths[entryId.toString()] = entryPointPath;
|
|
@@ -1425,8 +1433,8 @@ function ensureManifestDependencyInRuntime(currentManifestId, manifestBundleFile
|
|
|
1425
1433
|
if (manifest.dependingOnManifests.find(d => d.resourceId == dependOnmanifestId) === undefined) {
|
|
1426
1434
|
hasNewDependency = true;
|
|
1427
1435
|
manifest.dependingOnManifests.push({
|
|
1428
|
-
resourceId: dependOnmanifestId
|
|
1429
|
-
omniaServiceId: dependOnServiceId
|
|
1436
|
+
resourceId: dependOnmanifestId,
|
|
1437
|
+
omniaServiceId: dependOnServiceId || getServiceId()
|
|
1430
1438
|
});
|
|
1431
1439
|
}
|
|
1432
1440
|
}
|
|
@@ -1473,7 +1481,7 @@ function ensureManifestDependencyInRuntime(currentManifestId, manifestBundleFile
|
|
|
1473
1481
|
hasDependency = true;
|
|
1474
1482
|
}
|
|
1475
1483
|
if (hasDependency) {
|
|
1476
|
-
addDependency($.tooling.utils.
|
|
1484
|
+
addDependency((0, fx_models_1.maybeGuid)($.tooling.utils.getguid(entryName)));
|
|
1477
1485
|
break;
|
|
1478
1486
|
}
|
|
1479
1487
|
}
|
|
@@ -1506,7 +1514,8 @@ function buildManifestsDependency(entries, manifestId, manifestBundleContent) {
|
|
|
1506
1514
|
if (bundleOptions && bundleOptions.commonsChunk && bundleOptions.commonsChunk.name.toString().toLowerCase().indexOf(manifestId.toLowerCase()) > -1) {
|
|
1507
1515
|
return;
|
|
1508
1516
|
}
|
|
1509
|
-
Object.keys(entries).forEach((
|
|
1517
|
+
Object.keys(entries).forEach((val) => {
|
|
1518
|
+
const entryName = val;
|
|
1510
1519
|
var hasDependency = false;
|
|
1511
1520
|
if (entryName.toLowerCase() !== manifestId.toLowerCase()
|
|
1512
1521
|
&& entryName.indexOf(fx_models_1.OmniaResourceManifests.FxWorkers.toString()) === -1
|
|
@@ -1536,18 +1545,18 @@ function buildManifestsDependency(entries, manifestId, manifestBundleContent) {
|
|
|
1536
1545
|
function addDependency(currentManifest, dependentManifest, dependentOmniaServiceId) {
|
|
1537
1546
|
const omniaServiceId = getServiceId();
|
|
1538
1547
|
if (currentManifest !== dependentManifest && $.composers.LoadableManifestRegistry
|
|
1539
|
-
.getManifestDependencies($.tooling.utils.
|
|
1548
|
+
.getManifestDependencies((0, fx_models_1.maybeGuid)($.tooling.utils.getguid(currentManifest)), omniaServiceId)
|
|
1540
1549
|
.find(d => d.resourceId === dependentManifest && d.omniaServiceId === omniaServiceId) === undefined) {
|
|
1541
1550
|
$.composers.ManifestRegistry.setCurrentManifestPath("node_modules"); // set anythings to bypass error
|
|
1542
1551
|
if (dependentOmniaServiceId === null) {
|
|
1543
1552
|
$.composers
|
|
1544
1553
|
.LoadableManifestRegistry
|
|
1545
|
-
.addManifestDependency($.tooling.utils.
|
|
1554
|
+
.addManifestDependency((0, fx_models_1.maybeGuid)($.tooling.utils.getguid(currentManifest)), (0, fx_models_1.maybeGuid)($.tooling.utils.getguid(dependentManifest)));
|
|
1546
1555
|
}
|
|
1547
1556
|
else {
|
|
1548
1557
|
$.composers
|
|
1549
1558
|
.LoadableManifestRegistry
|
|
1550
|
-
.addManifestDependency($.tooling.utils.
|
|
1559
|
+
.addManifestDependency((0, fx_models_1.maybeGuid)($.tooling.utils.getguid(currentManifest)), (0, fx_models_1.maybeGuid)($.tooling.utils.getguid(dependentManifest)), dependentOmniaServiceId);
|
|
1551
1560
|
}
|
|
1552
1561
|
$.composers.ManifestRegistry.setCurrentManifestPath();
|
|
1553
1562
|
}
|
|
@@ -1556,7 +1565,7 @@ exports.addDependency = addDependency;
|
|
|
1556
1565
|
function chunkAsset(entries, compilation, fileName, viteHmrOption) {
|
|
1557
1566
|
//console.log(chunk.name)
|
|
1558
1567
|
if (fileName) {
|
|
1559
|
-
const manifestId = $.tooling.utils.
|
|
1568
|
+
const manifestId = (0, fx_models_1.maybeGuid)($.tooling.utils.getguid(fileName));
|
|
1560
1569
|
if (manifestId && $.path.extname(fileName) === ".js") {
|
|
1561
1570
|
const omniaServiceId = getServiceId();
|
|
1562
1571
|
let content = compilation.assets[fileName].source();
|
|
@@ -1609,17 +1618,17 @@ function validateBundleContent(content, fileName) {
|
|
|
1609
1618
|
function replaceOmniaBuildTokens(content, manifestId) {
|
|
1610
1619
|
return content
|
|
1611
1620
|
.replace(/@OmniaBuildTokens.OmniaServiceId/g, getServiceId())
|
|
1612
|
-
.replace(/@OmniaBuildTokens.ManifestId/g, $.tooling.utils.
|
|
1613
|
-
//.replace(/@omniabuildtokens.manifestid/g, $.tooling.utils.
|
|
1621
|
+
.replace(/@OmniaBuildTokens.ManifestId/g, $.tooling.utils.getguid(manifestId));
|
|
1622
|
+
//.replace(/@omniabuildtokens.manifestid/g, $.tooling.utils.getguid(manifestId))
|
|
1614
1623
|
}
|
|
1615
1624
|
function replaceWebpackRequireOmniaFx(content, manifestId) {
|
|
1616
1625
|
return content
|
|
1617
|
-
.replace(/__webpack_require__\("d7327742-5647-4075-b7ab-4f9ca852addb"\)/g, `__webpack_require__("d7327742-5647-4075-b7ab-4f9ca852addb").setCurrentManifest("${getServiceId()}", "${$.tooling.utils.
|
|
1618
|
-
.replace(/__webpack_require__\(".\/node_modules\/@omnia\/fx\/ux\/index.js"\)/g, `__webpack_require__("./node_modules/@omnia/fx/ux/index.js").setCurrentManifest("${getServiceId()}", "${$.tooling.utils.
|
|
1619
|
-
.replace(/__webpack_require__\("14a8d443-2e58-450b-a462-258bdaf69b49"\)/g, `__webpack_require__("14a8d443-2e58-450b-a462-258bdaf69b49").setCurrentManifest("${getServiceId()}", "${$.tooling.utils.
|
|
1620
|
-
.replace(/__webpack_require__\(".\/node_modules\/@omnia\/fx\/index.js"\)/g, `__webpack_require__("./node_modules/@omnia/fx/index.js").setCurrentManifest("${getServiceId()}", "${$.tooling.utils.
|
|
1621
|
-
.replace(/__webpack_require__\(".\/node_modules\/@omnia\/runtime\/fx\/index.js"\)/g, `__webpack_require__("./node_modules/@omnia/runtime/fx/index.js").setCurrentManifest("${getServiceId()}", "${$.tooling.utils.
|
|
1622
|
-
.replace(/omniaApi.fx.apis.extendApi\(/g, `omniaApi.fx.apis.extendApi("${getServiceId()}", "${$.tooling.utils.
|
|
1626
|
+
.replace(/__webpack_require__\("d7327742-5647-4075-b7ab-4f9ca852addb"\)/g, `__webpack_require__("d7327742-5647-4075-b7ab-4f9ca852addb").setCurrentManifest("${getServiceId()}", "${$.tooling.utils.getguid(manifestId)}")`)
|
|
1627
|
+
.replace(/__webpack_require__\(".\/node_modules\/@omnia\/fx\/ux\/index.js"\)/g, `__webpack_require__("./node_modules/@omnia/fx/ux/index.js").setCurrentManifest("${getServiceId()}", "${$.tooling.utils.getguid(manifestId)}")`)
|
|
1628
|
+
.replace(/__webpack_require__\("14a8d443-2e58-450b-a462-258bdaf69b49"\)/g, `__webpack_require__("14a8d443-2e58-450b-a462-258bdaf69b49").setCurrentManifest("${getServiceId()}", "${$.tooling.utils.getguid(manifestId)}")`)
|
|
1629
|
+
.replace(/__webpack_require__\(".\/node_modules\/@omnia\/fx\/index.js"\)/g, `__webpack_require__("./node_modules/@omnia/fx/index.js").setCurrentManifest("${getServiceId()}", "${$.tooling.utils.getguid(manifestId)}")`)
|
|
1630
|
+
.replace(/__webpack_require__\(".\/node_modules\/@omnia\/runtime\/fx\/index.js"\)/g, `__webpack_require__("./node_modules/@omnia/runtime/fx/index.js").setCurrentManifest("${getServiceId()}", "${$.tooling.utils.getguid(manifestId)}")`)
|
|
1631
|
+
.replace(/omniaApi.fx.apis.extendApi\(/g, `omniaApi.fx.apis.extendApi("${getServiceId()}", "${$.tooling.utils.getguid(manifestId)}", `);
|
|
1623
1632
|
}
|
|
1624
1633
|
function checkDuplicateBundle() {
|
|
1625
1634
|
let foundDuplicated = false;
|
|
@@ -106,7 +106,7 @@ extendApi(api => api.fx.docs.registrations, api => {
|
|
|
106
106
|
// create dynamic doc manifest
|
|
107
107
|
tooling_composers_1.ManifestRegistry.setCurrentManifestPath(`${path_1.default.relative(tooling_1.utils.root(""), path_1.default.resolve(__dirname))}/`);
|
|
108
108
|
tooling_composers_1.Composer
|
|
109
|
-
.registerManifest((0, shared_1.getBuildOption)().docResourceManifestId ||
|
|
109
|
+
.registerManifest((0, shared_1.getBuildOption)().docResourceManifestId || (0, fx_models_1.guid)(), "omnia.fx.docs.components.registraions")
|
|
110
110
|
.registerResources({
|
|
111
111
|
resourcePaths: ["./ComponentDocRegistrations.ts"]
|
|
112
112
|
})
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ESBuildTransformResult } from 'vite';
|
|
2
|
+
import { guid } from '@omnia/fx-models';
|
|
2
3
|
import type { FileGraph } from './typings';
|
|
3
4
|
interface ManifestDependency {
|
|
4
5
|
entryName: string;
|
|
@@ -11,7 +12,7 @@ interface ManifestDependency {
|
|
|
11
12
|
export declare function getFileGraph(unknownId: string): FileGraph;
|
|
12
13
|
export declare function toFileGraphId(unknownId: string): string;
|
|
13
14
|
export declare function toModuleId(unknownId: string): string;
|
|
14
|
-
export declare function buildFileGraphs(entries: Record<
|
|
15
|
+
export declare function buildFileGraphs(entries: Record<guid, Array<string>>): Promise<Record<string, ManifestDependency>>;
|
|
15
16
|
export declare function buildFileGraph(unknownId: string, code: string): Promise<{
|
|
16
17
|
fileGraph: FileGraph;
|
|
17
18
|
code: string;
|
|
@@ -12,6 +12,7 @@ const vueJsx_1 = require("./vueJsx");
|
|
|
12
12
|
const $ = tslib_1.__importStar(require("../../variables"));
|
|
13
13
|
const shared_1 = require("../../shared");
|
|
14
14
|
const doc_1 = require("../../tasks/doc");
|
|
15
|
+
const tooling_1 = require("@omnia/tooling");
|
|
15
16
|
let fileGraphs = {};
|
|
16
17
|
let manifests = {};
|
|
17
18
|
const initialManifests = [
|
|
@@ -155,6 +156,7 @@ async function buildFileGraph(unknownId, code) {
|
|
|
155
156
|
return { fileGraph, code };
|
|
156
157
|
}
|
|
157
158
|
fileGraph.js.scanned = true;
|
|
159
|
+
code = (0, tooling_1.replaceTokens)(code);
|
|
158
160
|
code = (0, shared_1.transformDefineVueComponent)(code, fileGraph.id);
|
|
159
161
|
const esbuildTransformResult = await (0, vite_1.transformWithEsbuild)(code, id, esbuildTransformOptions);
|
|
160
162
|
code = esbuildTransformResult.code;
|
|
@@ -16,7 +16,7 @@ function getWebpackResolveModulePath(stats, requestModulePath) {
|
|
|
16
16
|
s.modules?.forEach(m => {
|
|
17
17
|
const foundReason = m.reasons?.find(r => r.userRequest === requestModulePath);
|
|
18
18
|
if (foundReason) {
|
|
19
|
-
result = m.id
|
|
19
|
+
result = m.id;
|
|
20
20
|
return result;
|
|
21
21
|
}
|
|
22
22
|
});
|
|
@@ -50,7 +50,7 @@ exports.dynamicBundle = (0, base_1.defineTransformer)("omnia-bundle", () => {
|
|
|
50
50
|
}
|
|
51
51
|
$.tooling.log(`[${fileGraph.id}] Found new dependencies:\n` + nonResolvingModulePaths.join('\n'));
|
|
52
52
|
$.tooling.log(`[${fileGraph.id}] Bundling dependencies...`);
|
|
53
|
-
const dynamicBundleResourceId = fx_models_1.
|
|
53
|
+
const dynamicBundleResourceId = (0, fx_models_1.guid)();
|
|
54
54
|
const entryPoint = {
|
|
55
55
|
['dynamicbundle_' + dynamicBundleResourceId]: nonResolvingModulePaths
|
|
56
56
|
};
|
|
@@ -6,6 +6,7 @@ const path_1 = tslib_1.__importDefault(require("path"));
|
|
|
6
6
|
const vite_1 = require("vite");
|
|
7
7
|
const globby_1 = require("globby");
|
|
8
8
|
const envUtils = tslib_1.__importStar(require("./env"));
|
|
9
|
+
const fx_models_1 = require("@omnia/fx-models");
|
|
9
10
|
exports.OMNIA_BUNDLE_REQUEST = '/omnia/bundles';
|
|
10
11
|
exports.HMR_ESM_REQUEST = '/hmr/esm';
|
|
11
12
|
exports.HMR_DYNAMIC_BUNDLE_REQUEST = '/hmr/dynamicbundles';
|
|
@@ -74,7 +75,7 @@ function parseOmniaBundlePath(value) {
|
|
|
74
75
|
const [resourceId, bundleFileExtension] = pathName.split('/');
|
|
75
76
|
const fromWorker = queryParams ? queryParams.split('&').some(q => q.startsWith(exports.WORKER_IDENTIFIER)) : false;
|
|
76
77
|
return {
|
|
77
|
-
resourceId,
|
|
78
|
+
resourceId: (0, fx_models_1.maybeGuid)(resourceId),
|
|
78
79
|
fromWorker,
|
|
79
80
|
bundleFileExtension
|
|
80
81
|
};
|
|
@@ -64,8 +64,8 @@ function registerHmrMiddleware(server) {
|
|
|
64
64
|
res.statusMessage = message;
|
|
65
65
|
console.error(message);
|
|
66
66
|
}
|
|
67
|
-
else if (resourceId == fx_models_1.OmniaResourceManifests.Vendor
|
|
68
|
-
resourceId == fx_models_1.OmniaResourceManifests.FxWorkers
|
|
67
|
+
else if (resourceId == fx_models_1.OmniaResourceManifests.Vendor ||
|
|
68
|
+
resourceId == fx_models_1.OmniaResourceManifests.FxWorkers) {
|
|
69
69
|
const serviceId = $.tooling.composer.getServiceId();
|
|
70
70
|
const bundleDirPath = utils_1.envUtils.getBundleOutputDirPath();
|
|
71
71
|
const bundleFileName = manifest.resourceName ? `${manifest.resourceName}_${resourceId}.${bundleFileExtension}` : `${resourceId}.${bundleFileExtension}`;
|
|
@@ -164,7 +164,7 @@ function ensureManifestInfo(entries) {
|
|
|
164
164
|
}
|
|
165
165
|
};
|
|
166
166
|
Object.keys(entries).forEach(key => {
|
|
167
|
-
const manifestId = $.tooling.utils.
|
|
167
|
+
const manifestId = (0, fx_models_1.maybeGuid)($.tooling.utils.getguid(key));
|
|
168
168
|
if (manifestId) {
|
|
169
169
|
setDummyVersion(manifestId);
|
|
170
170
|
}
|
|
@@ -43,7 +43,7 @@ function registerStaticFileMiddleware(server) {
|
|
|
43
43
|
let pathSections = path.split('/');
|
|
44
44
|
if (pathSections.length === 5) {
|
|
45
45
|
let resourceExt = pathSections[4];
|
|
46
|
-
let manifestId = pathSections[3];
|
|
46
|
+
let manifestId = (0, fx_models_1.maybeGuid)(pathSections[3]);
|
|
47
47
|
if (manifestId === shared_1.LocalizationId) {
|
|
48
48
|
res.setHeader('content-type', 'application/x-javascript');
|
|
49
49
|
let localizeObject = $.composers.getLocalizations();
|
|
@@ -64,10 +64,10 @@ function registerStaticFileMiddleware(server) {
|
|
|
64
64
|
res.setHeader('Cache-Control', 'public, max-age=31536000');
|
|
65
65
|
// Have issue server side rendering write out load vendor, fx core with version from hosting that not from current serving
|
|
66
66
|
// so hard code no-cache for them
|
|
67
|
-
if (manifestId === fx_models_1.OmniaResourceManifests.Vendor
|
|
68
|
-
|| manifestId === fx_models_1.OmniaResourceManifests.FxShared
|
|
69
|
-
|| manifestId === fx_models_1.OmniaResourceManifests.FxCore
|
|
70
|
-
|| manifestId === fx_models_1.OmniaResourceManifests.FxCoreBoot
|
|
67
|
+
if (manifestId === fx_models_1.OmniaResourceManifests.Vendor
|
|
68
|
+
|| manifestId === fx_models_1.OmniaResourceManifests.FxShared
|
|
69
|
+
|| manifestId === fx_models_1.OmniaResourceManifests.FxCore
|
|
70
|
+
|| manifestId === fx_models_1.OmniaResourceManifests.FxCoreBoot) {
|
|
71
71
|
res.setHeader('Cache-Control', 'no-cache');
|
|
72
72
|
}
|
|
73
73
|
let manifest = $.tooling.composer.getManifestById(manifestId);
|
|
@@ -90,14 +90,14 @@ function registerWebpackMiddleWareBundle(entries) {
|
|
|
90
90
|
writeToDisk: (filePath) => {
|
|
91
91
|
if (OmniaMiddleware_1.resolvableManifest?.resolved) {
|
|
92
92
|
if (_initialized) {
|
|
93
|
-
let manifestId = $.tooling.utils.
|
|
93
|
+
let manifestId = $.tooling.utils.getguid(filePath);
|
|
94
94
|
if (manifestId) {
|
|
95
95
|
let manifest = $.tooling.composer.getManifestById(manifestId);
|
|
96
96
|
if (manifest) {
|
|
97
97
|
let manifestsData = $.tooling.composer.getManifestsJson();
|
|
98
98
|
let bundleType = path_1.default.extname(filePath).replace('.', '');
|
|
99
99
|
manifest.version = manifest.version || {};
|
|
100
|
-
manifest.version[bundleType] = $.tooling.utils.
|
|
100
|
+
manifest.version[bundleType] = $.tooling.utils.generateguid().replace(/-/g, '');
|
|
101
101
|
$.tooling.composer.updateManifestData(manifestsData);
|
|
102
102
|
// check if the manifest in agroup
|
|
103
103
|
if (manifestsData.groupedResouresAndComponents) {
|
|
@@ -108,7 +108,7 @@ function registerWebpackMiddleWareBundle(entries) {
|
|
|
108
108
|
bundler.createCombinedManfest(bundler.getServiceId(), manifestGroup.manifestIdsInGroup, manifestGroup.resourceId, manifestGroup.resourceName, $.tooling.composer.OmniaOutput.OutputBundlePath).then(() => {
|
|
109
109
|
tooling_1.utils.log(`Webpack bundle changed -> ${manifestGroup.resourceName ? manifestGroup.resourceName + '_' : ''}${manifestGroup.resourceId}.js`);
|
|
110
110
|
manifestGroup.version = manifest.version || {};
|
|
111
|
-
manifestGroup.version['js'] = $.tooling.utils.
|
|
111
|
+
manifestGroup.version['js'] = $.tooling.utils.generateguid().replace(/-/g, '');
|
|
112
112
|
$.tooling.composer.updateManifestData(manifestsData);
|
|
113
113
|
});
|
|
114
114
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (content: any, context: any): string;
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
5
|
+
const tooling_1 = require("@omnia/tooling");
|
|
5
6
|
const shared_1 = require("../shared");
|
|
6
7
|
function default_1(content, context) {
|
|
7
8
|
const filePath = "./" + path_1.default.relative(process.cwd(), this.resourcePath).replace(/\\/g, "/");
|
|
8
9
|
content = (0, shared_1.transformDefineVueComponent)(content, filePath);
|
|
9
|
-
return content;
|
|
10
|
+
return (0, tooling_1.replaceTokens)(content);
|
|
10
11
|
}
|
|
11
12
|
exports.default = default_1;
|
|
@@ -10,6 +10,9 @@ function default_1() {
|
|
|
10
10
|
{
|
|
11
11
|
loader: path.resolve(__dirname, $.isExtensionEnv ? './esbuild-custom-loader.js' : './esbuild-custom-loader.ts'),
|
|
12
12
|
},
|
|
13
|
+
{
|
|
14
|
+
loader: path.resolve(__dirname, $.isExtensionEnv ? './replacement-loader.js' : './replacement-loader.ts'),
|
|
15
|
+
},
|
|
13
16
|
{
|
|
14
17
|
loader: 'esbuild-loader',
|
|
15
18
|
options: {
|
|
@@ -51,7 +51,7 @@ function default_1() {
|
|
|
51
51
|
loader: path.resolve(__dirname, $.isExtensionEnv ? './esbuild-custom-loader.js' : './esbuild-custom-loader.ts'),
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
|
-
loader: path.resolve(__dirname, $.isExtensionEnv ? './
|
|
54
|
+
loader: path.resolve(__dirname, $.isExtensionEnv ? './replacement-loader.js' : './replacement-loader.ts'),
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
loader: 'esbuild-loader',
|
|
@@ -149,7 +149,7 @@ class BuildWebpackRequire {
|
|
|
149
149
|
modifyAsset(assets, fileName, [
|
|
150
150
|
{
|
|
151
151
|
insertToEOF: true,
|
|
152
|
-
replacement: "globalThis.omniaWebpackJsonp['" + this.omniaServiceId + "']['" + $.tooling.utils.
|
|
152
|
+
replacement: "globalThis.omniaWebpackJsonp['" + this.omniaServiceId + "']['" + $.tooling.utils.getguid(fileName.toLowerCase()) + "'] = omniaWebpackJsonp['" + this.omniaServiceId + "']['" + this.manifestId + "'];"
|
|
153
153
|
}
|
|
154
154
|
]);
|
|
155
155
|
}
|
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.193-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.193-dev",
|
|
23
|
+
"@omnia/tooling-composers": "8.0.193-dev",
|
|
24
24
|
"@types/mousetrap": "1.5.34",
|
|
25
25
|
"@types/quill": "1.3.6",
|
|
26
26
|
"@types/zepto": "1.0.29",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function (content: any, context: any): any;
|