@lwrjs/core 0.13.0-alpha.6 → 0.13.0-alpha.7
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.
|
@@ -55,7 +55,7 @@ function createProviderContext(serverContext) {
|
|
|
55
55
|
notifyViewSourceChanged,
|
|
56
56
|
notifyAssetSourceChanged
|
|
57
57
|
} = serverContext.appEmitter;
|
|
58
|
-
const siteMetadata = staticSiteGenerator.outputDir && import_fs.default.existsSync(staticSiteGenerator.outputDir) ? new import_site_metadata.SiteMetadataImpl({rootDir: staticSiteGenerator.outputDir}) : void 0;
|
|
58
|
+
const siteMetadata = staticSiteGenerator.outputDir && import_fs.default.existsSync(staticSiteGenerator.outputDir) ? new import_site_metadata.SiteMetadataImpl({rootDir: staticSiteGenerator.outputDir, i18n}) : void 0;
|
|
59
59
|
return {
|
|
60
60
|
appObserver: (0, import_shared_utils.deepFreeze)({onModuleDefinitionChange, onModuleSourceChange}),
|
|
61
61
|
appEmitter: {
|
|
@@ -232,14 +232,18 @@ var SiteGenerator = class {
|
|
|
232
232
|
addBundleToSiteMetadata(bundleDefinition, url, siteConfig) {
|
|
233
233
|
if (siteConfig.siteMetadata) {
|
|
234
234
|
const locale = siteConfig.locale;
|
|
235
|
-
const specifier =
|
|
236
|
-
const imports = bundleDefinition.bundleRecord.imports?.map((moduleRef) => (0,
|
|
237
|
-
const dynamicImports = bundleDefinition.bundleRecord.dynamicImports?.map((moduleRef) => (0,
|
|
235
|
+
const specifier = (0, import_site_metadata.getSiteBundleId)(bundleDefinition, locale, siteConfig.i18n);
|
|
236
|
+
const imports = bundleDefinition.bundleRecord.imports?.map((moduleRef) => (0, import_site_metadata.getSiteBundleId)(moduleRef, locale, siteConfig.i18n)) || [];
|
|
237
|
+
const dynamicImports = bundleDefinition.bundleRecord.dynamicImports?.map((moduleRef) => (0, import_site_metadata.getSiteBundleId)(moduleRef, locale, siteConfig.i18n));
|
|
238
|
+
const includedModules = bundleDefinition.bundleRecord.includedModules?.map((moduleRef) => {
|
|
239
|
+
const moduleId = (0, import_shared_utils.explodeSpecifier)(moduleRef);
|
|
240
|
+
return (0, import_site_metadata.getSiteBundleId)(moduleId, locale, siteConfig.i18n);
|
|
241
|
+
}) || [];
|
|
238
242
|
const version = bundleDefinition.version === import_shared_utils.VERSION_NOT_PROVIDED ? void 0 : bundleDefinition.version;
|
|
239
243
|
const bundleMetadata = {
|
|
240
244
|
version,
|
|
241
245
|
path: decodeURIComponent(url),
|
|
242
|
-
includedModules
|
|
246
|
+
includedModules,
|
|
243
247
|
imports,
|
|
244
248
|
dynamicImports
|
|
245
249
|
};
|
|
@@ -555,7 +559,7 @@ var SiteGenerator = class {
|
|
|
555
559
|
endpoints,
|
|
556
560
|
skipBaseDocumentGeneration,
|
|
557
561
|
...featureFlags,
|
|
558
|
-
siteMetadata: new import_site_metadata.SiteMetadataImpl({rootDir: outputDir}),
|
|
562
|
+
siteMetadata: new import_site_metadata.SiteMetadataImpl({rootDir: outputDir, i18n}),
|
|
559
563
|
i18n
|
|
560
564
|
};
|
|
561
565
|
}
|
|
@@ -7,7 +7,7 @@ export function createProviderContext(serverContext) {
|
|
|
7
7
|
const { onModuleDefinitionChange, onModuleSourceChange } = serverContext.appObserver;
|
|
8
8
|
const { notifyModuleDefinitionChanged, notifyModuleSourceChanged, notifyViewSourceChanged, notifyAssetSourceChanged, } = serverContext.appEmitter;
|
|
9
9
|
const siteMetadata = staticSiteGenerator.outputDir && fs.existsSync(staticSiteGenerator.outputDir)
|
|
10
|
-
? new SiteMetadataImpl({ rootDir: staticSiteGenerator.outputDir })
|
|
10
|
+
? new SiteMetadataImpl({ rootDir: staticSiteGenerator.outputDir, i18n })
|
|
11
11
|
: undefined;
|
|
12
12
|
return {
|
|
13
13
|
appObserver: deepFreeze({ onModuleDefinitionChange, onModuleSourceChange }),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { performance } from 'perf_hooks';
|
|
2
2
|
import { logger } from '@lwrjs/diagnostics';
|
|
3
|
-
import { getSpecifier, getFeatureFlags, hashContent, isSelfUrl, getModuleUriPrefix, getMappingUriPrefix, isExternalUrl, mimeLookup, getViewUri, sortLocalesByFallback, VERSION_NOT_PROVIDED, PROTOCOL_FILE, normalizeFromFileURL, isExternalSpecifier, } from '@lwrjs/shared-utils';
|
|
4
|
-
import { SiteMetadataImpl } from '@lwrjs/static/site-metadata';
|
|
3
|
+
import { getSpecifier, getFeatureFlags, hashContent, isSelfUrl, getModuleUriPrefix, getMappingUriPrefix, isExternalUrl, mimeLookup, getViewUri, sortLocalesByFallback, VERSION_NOT_PROVIDED, PROTOCOL_FILE, normalizeFromFileURL, isExternalSpecifier, explodeSpecifier, } from '@lwrjs/shared-utils';
|
|
4
|
+
import { SiteMetadataImpl, getSiteBundleId } from '@lwrjs/static/site-metadata';
|
|
5
5
|
import { join, dirname, extname, normalize } from 'path';
|
|
6
6
|
import fs from 'fs-extra';
|
|
7
7
|
import { writeResponse } from './utils/stream.js';
|
|
@@ -299,16 +299,18 @@ export default class SiteGenerator {
|
|
|
299
299
|
addBundleToSiteMetadata(bundleDefinition, url, siteConfig) {
|
|
300
300
|
if (siteConfig.siteMetadata) {
|
|
301
301
|
const locale = siteConfig.locale;
|
|
302
|
-
const specifier = siteConfig.i18n
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
const
|
|
306
|
-
|
|
302
|
+
const specifier = getSiteBundleId(bundleDefinition, locale, siteConfig.i18n);
|
|
303
|
+
const imports = bundleDefinition.bundleRecord.imports?.map((moduleRef) => getSiteBundleId(moduleRef, locale, siteConfig.i18n)) || [];
|
|
304
|
+
const dynamicImports = bundleDefinition.bundleRecord.dynamicImports?.map((moduleRef) => getSiteBundleId(moduleRef, locale, siteConfig.i18n));
|
|
305
|
+
const includedModules = bundleDefinition.bundleRecord.includedModules?.map((moduleRef) => {
|
|
306
|
+
const moduleId = explodeSpecifier(moduleRef);
|
|
307
|
+
return getSiteBundleId(moduleId, locale, siteConfig.i18n);
|
|
308
|
+
}) || [];
|
|
307
309
|
const version = bundleDefinition.version === VERSION_NOT_PROVIDED ? undefined : bundleDefinition.version;
|
|
308
310
|
const bundleMetadata = {
|
|
309
311
|
version,
|
|
310
312
|
path: decodeURIComponent(url),
|
|
311
|
-
includedModules
|
|
313
|
+
includedModules,
|
|
312
314
|
imports,
|
|
313
315
|
dynamicImports,
|
|
314
316
|
};
|
|
@@ -738,7 +740,7 @@ export default class SiteGenerator {
|
|
|
738
740
|
skipBaseDocumentGeneration,
|
|
739
741
|
// Only include LEGACY_LOADER if true
|
|
740
742
|
...featureFlags,
|
|
741
|
-
siteMetadata: new SiteMetadataImpl({ rootDir: outputDir }),
|
|
743
|
+
siteMetadata: new SiteMetadataImpl({ rootDir: outputDir, i18n }),
|
|
742
744
|
i18n,
|
|
743
745
|
};
|
|
744
746
|
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.13.0-alpha.
|
|
7
|
+
"version": "0.13.0-alpha.7",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -43,34 +43,34 @@
|
|
|
43
43
|
"build": "tsc -b"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@lwrjs/app-service": "0.13.0-alpha.
|
|
47
|
-
"@lwrjs/asset-registry": "0.13.0-alpha.
|
|
48
|
-
"@lwrjs/asset-transformer": "0.13.0-alpha.
|
|
49
|
-
"@lwrjs/base-view-provider": "0.13.0-alpha.
|
|
50
|
-
"@lwrjs/base-view-transformer": "0.13.0-alpha.
|
|
51
|
-
"@lwrjs/client-modules": "0.13.0-alpha.
|
|
52
|
-
"@lwrjs/config": "0.13.0-alpha.
|
|
53
|
-
"@lwrjs/diagnostics": "0.13.0-alpha.
|
|
54
|
-
"@lwrjs/esbuild": "0.13.0-alpha.
|
|
55
|
-
"@lwrjs/fs-asset-provider": "0.13.0-alpha.
|
|
56
|
-
"@lwrjs/fs-watch": "0.13.0-alpha.
|
|
57
|
-
"@lwrjs/html-view-provider": "0.13.0-alpha.
|
|
58
|
-
"@lwrjs/instrumentation": "0.13.0-alpha.
|
|
59
|
-
"@lwrjs/loader": "0.13.0-alpha.
|
|
60
|
-
"@lwrjs/lwc-module-provider": "0.13.0-alpha.
|
|
61
|
-
"@lwrjs/lwc-ssr": "0.13.0-alpha.
|
|
62
|
-
"@lwrjs/markdown-view-provider": "0.13.0-alpha.
|
|
63
|
-
"@lwrjs/module-bundler": "0.13.0-alpha.
|
|
64
|
-
"@lwrjs/module-registry": "0.13.0-alpha.
|
|
65
|
-
"@lwrjs/npm-module-provider": "0.13.0-alpha.
|
|
66
|
-
"@lwrjs/nunjucks-view-provider": "0.13.0-alpha.
|
|
67
|
-
"@lwrjs/o11y": "0.13.0-alpha.
|
|
68
|
-
"@lwrjs/resource-registry": "0.13.0-alpha.
|
|
69
|
-
"@lwrjs/router": "0.13.0-alpha.
|
|
70
|
-
"@lwrjs/server": "0.13.0-alpha.
|
|
71
|
-
"@lwrjs/shared-utils": "0.13.0-alpha.
|
|
72
|
-
"@lwrjs/static": "0.13.0-alpha.
|
|
73
|
-
"@lwrjs/view-registry": "0.13.0-alpha.
|
|
46
|
+
"@lwrjs/app-service": "0.13.0-alpha.7",
|
|
47
|
+
"@lwrjs/asset-registry": "0.13.0-alpha.7",
|
|
48
|
+
"@lwrjs/asset-transformer": "0.13.0-alpha.7",
|
|
49
|
+
"@lwrjs/base-view-provider": "0.13.0-alpha.7",
|
|
50
|
+
"@lwrjs/base-view-transformer": "0.13.0-alpha.7",
|
|
51
|
+
"@lwrjs/client-modules": "0.13.0-alpha.7",
|
|
52
|
+
"@lwrjs/config": "0.13.0-alpha.7",
|
|
53
|
+
"@lwrjs/diagnostics": "0.13.0-alpha.7",
|
|
54
|
+
"@lwrjs/esbuild": "0.13.0-alpha.7",
|
|
55
|
+
"@lwrjs/fs-asset-provider": "0.13.0-alpha.7",
|
|
56
|
+
"@lwrjs/fs-watch": "0.13.0-alpha.7",
|
|
57
|
+
"@lwrjs/html-view-provider": "0.13.0-alpha.7",
|
|
58
|
+
"@lwrjs/instrumentation": "0.13.0-alpha.7",
|
|
59
|
+
"@lwrjs/loader": "0.13.0-alpha.7",
|
|
60
|
+
"@lwrjs/lwc-module-provider": "0.13.0-alpha.7",
|
|
61
|
+
"@lwrjs/lwc-ssr": "0.13.0-alpha.7",
|
|
62
|
+
"@lwrjs/markdown-view-provider": "0.13.0-alpha.7",
|
|
63
|
+
"@lwrjs/module-bundler": "0.13.0-alpha.7",
|
|
64
|
+
"@lwrjs/module-registry": "0.13.0-alpha.7",
|
|
65
|
+
"@lwrjs/npm-module-provider": "0.13.0-alpha.7",
|
|
66
|
+
"@lwrjs/nunjucks-view-provider": "0.13.0-alpha.7",
|
|
67
|
+
"@lwrjs/o11y": "0.13.0-alpha.7",
|
|
68
|
+
"@lwrjs/resource-registry": "0.13.0-alpha.7",
|
|
69
|
+
"@lwrjs/router": "0.13.0-alpha.7",
|
|
70
|
+
"@lwrjs/server": "0.13.0-alpha.7",
|
|
71
|
+
"@lwrjs/shared-utils": "0.13.0-alpha.7",
|
|
72
|
+
"@lwrjs/static": "0.13.0-alpha.7",
|
|
73
|
+
"@lwrjs/view-registry": "0.13.0-alpha.7",
|
|
74
74
|
"chokidar": "^3.6.0",
|
|
75
75
|
"esbuild": "^0.9.7",
|
|
76
76
|
"fs-extra": "^11.2.0",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"ws": "^8.16.0"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@lwrjs/types": "0.13.0-alpha.
|
|
83
|
+
"@lwrjs/types": "0.13.0-alpha.7",
|
|
84
84
|
"@types/ws": "^8.5.10",
|
|
85
85
|
"mock-fs": "^5.2.0"
|
|
86
86
|
},
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"volta": {
|
|
94
94
|
"extends": "../../../package.json"
|
|
95
95
|
},
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "4b77dea6ac8d473a4113ad7b345b3a37b0b8a3f8"
|
|
97
97
|
}
|