@lwrjs/config 0.12.0-alpha.0 → 0.12.0-alpha.2
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.
|
@@ -83,7 +83,7 @@ var ROOT_ATTRIBUTE_KEYS = createKeys("root", [
|
|
|
83
83
|
]);
|
|
84
84
|
var ASSET_DIR_ATTRIBUTE_KEYS = createKeys("assetDir", ["alias", "dir", "urlPath", "root"]);
|
|
85
85
|
var ASSET_FILE_ATTRIBUTE_KEYS = createKeys("assetFile", ["alias", "file", "urlPath"]);
|
|
86
|
-
var LOCKER_ATTRIBUTE_KEYS = createKeys("locker", ["enabled", "trustedComponents"
|
|
86
|
+
var LOCKER_ATTRIBUTE_KEYS = createKeys("locker", ["enabled", "trustedComponents"]);
|
|
87
87
|
var I18N_ATTRIBUTE_KEYS = createKeys("i18n", ["defaultLocale", "locales", "uriPattern"]);
|
|
88
88
|
var STATIC_SITE_GENERATOR_ATTRIBUTE_KEYS = createKeys("staticSiteGenerator", [
|
|
89
89
|
"outputDir",
|
|
@@ -437,28 +437,6 @@ var ValidationContext = class {
|
|
|
437
437
|
});
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
assertClientLockerSSR(routesNode, lockerNode) {
|
|
441
|
-
if (routesNode && lockerNode) {
|
|
442
|
-
const enabled = (0, import_jsonc_parser.findNodeAtLocation)(lockerNode, ["enabled"]);
|
|
443
|
-
const clientOnly = (0, import_jsonc_parser.findNodeAtLocation)(lockerNode, ["clientOnly"]);
|
|
444
|
-
const compileTimeLocker = enabled && enabled.value === true && (!clientOnly || clientOnly.value === false);
|
|
445
|
-
if (compileTimeLocker && routesNode.children) {
|
|
446
|
-
const hasSSR = routesNode.children.some((n) => {
|
|
447
|
-
const bootstrap = (0, import_jsonc_parser.findNodeAtLocation)(n, ["bootstrap"]);
|
|
448
|
-
if (bootstrap) {
|
|
449
|
-
const ssr = (0, import_jsonc_parser.findNodeAtLocation)(bootstrap, ["ssr"]);
|
|
450
|
-
return ssr?.value === true;
|
|
451
|
-
}
|
|
452
|
-
});
|
|
453
|
-
if (hasSSR) {
|
|
454
|
-
this.diagnostics.push({
|
|
455
|
-
description: import_diagnostics.descriptions.CONFIG_PARSER.COMPILE_LOCKER_SSR(),
|
|
456
|
-
location: this.getLocationFromNode(lockerNode)
|
|
457
|
-
});
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
440
|
assertRequiredKeys(node, property, requiredPropertyKeys) {
|
|
463
441
|
const missingProps = requiredPropertyKeys.filter((p) => (0, import_jsonc_parser.findNodeAtLocation)(node, [p]) === void 0);
|
|
464
442
|
if (missingProps.length > 0) {
|
|
@@ -242,7 +242,6 @@ function validateRoot(node, validationContext, preMerge) {
|
|
|
242
242
|
validateLocker(lockerNode, validationContext);
|
|
243
243
|
validateI18NConfig((0, import_jsonc_parser.findNodeAtLocation)(node, ["i18n"]), validationContext, preMerge);
|
|
244
244
|
validateBundleConfig(bundleConfigNode, validationContext);
|
|
245
|
-
validationContext.assertClientLockerSSR(routes, lockerNode);
|
|
246
245
|
validationContext.assertNotEmptyString((0, import_jsonc_parser.findNodeAtLocation)(node, ["apiVersion"]), "apiVersion");
|
|
247
246
|
validationContext.assertNotEmptyString((0, import_jsonc_parser.findNodeAtLocation)(node, ["lwrVersion"]), "lwrVersion");
|
|
248
247
|
validationContext.assertIsSpecifier((0, import_jsonc_parser.findNodeAtLocation)(node, ["amdLoader"]), "amdLoader");
|
|
@@ -28,7 +28,7 @@ interface ConfigMap {
|
|
|
28
28
|
export declare const ROOT_ATTRIBUTE_KEYS: ["amdLoader", "apiVersion", "assets", "assetProviders", "assetTransformers", "bundleConfig", "bundleProviders", "cacheDir", "contentDir", "environment", "errorRoutes", "esmLoader", "staticSiteGenerator", "globalData", "globalDataDir", "hooks", "i18n", "ignoreLwrConfigFile", "lwrConfigFile", "layoutsDir", "locker", "lwc", "lwrVersion", "moduleProviders", "port", "basePath", "resourceProviders", "rootDir", "routeHandlers", "routes", "serverMode", "minify", "serverType", "uriTransformers", "viewProviders", "viewTransformers"];
|
|
29
29
|
export declare const ASSET_DIR_ATTRIBUTE_KEYS: ["alias", "dir", "urlPath", "root"];
|
|
30
30
|
export declare const ASSET_FILE_ATTRIBUTE_KEYS: ["alias", "file", "urlPath"];
|
|
31
|
-
export declare const LOCKER_ATTRIBUTE_KEYS: ["enabled", "trustedComponents"
|
|
31
|
+
export declare const LOCKER_ATTRIBUTE_KEYS: ["enabled", "trustedComponents"];
|
|
32
32
|
export declare const I18N_ATTRIBUTE_KEYS: ["defaultLocale", "locales", "uriPattern"];
|
|
33
33
|
export declare const STATIC_SITE_GENERATOR_ATTRIBUTE_KEYS: ["outputDir", "skipBaseDocumentGeneration", "skipCleanOutputDir", "_additionalModules", "_additionalRoutePaths"];
|
|
34
34
|
export declare const ROUTE_ATTRIBUTE_KEYS: ["bootstrap", "subRoutes", "contentTemplate", "id", "cache", "layoutTemplate", "method", "path", "rootComponent", "routeHandler", "properties"];
|
|
@@ -63,7 +63,6 @@ export declare class ValidationContext {
|
|
|
63
63
|
assertIsStringOrObject(node: Node | undefined, property: string, index?: number): void;
|
|
64
64
|
assertIsService(node: Node | undefined, property: string, index?: number): void;
|
|
65
65
|
assertUniqueIds(nodes: Node[], property: string): void;
|
|
66
|
-
assertClientLockerSSR(routesNode: Node | undefined, lockerNode: Node | undefined): void;
|
|
67
66
|
assertRequiredKeys(node: Node, property: string, requiredPropertyKeys: string[]): void;
|
|
68
67
|
assertValidKeys<T extends keyof ConfigMap>(node: Node, property: T, validPropertyKeys: (keyof ConfigMap[T])[]): void;
|
|
69
68
|
assertNoBundleConfigDupes(node: Node, dupes: string[]): void;
|
|
@@ -47,7 +47,7 @@ export const ROOT_ATTRIBUTE_KEYS = createKeys('root', [
|
|
|
47
47
|
]);
|
|
48
48
|
export const ASSET_DIR_ATTRIBUTE_KEYS = createKeys('assetDir', ['alias', 'dir', 'urlPath', 'root']);
|
|
49
49
|
export const ASSET_FILE_ATTRIBUTE_KEYS = createKeys('assetFile', ['alias', 'file', 'urlPath']);
|
|
50
|
-
export const LOCKER_ATTRIBUTE_KEYS = createKeys('locker', ['enabled', 'trustedComponents'
|
|
50
|
+
export const LOCKER_ATTRIBUTE_KEYS = createKeys('locker', ['enabled', 'trustedComponents']);
|
|
51
51
|
export const I18N_ATTRIBUTE_KEYS = createKeys('i18n', ['defaultLocale', 'locales', 'uriPattern']);
|
|
52
52
|
export const STATIC_SITE_GENERATOR_ATTRIBUTE_KEYS = createKeys('staticSiteGenerator', [
|
|
53
53
|
'outputDir',
|
|
@@ -420,28 +420,6 @@ export class ValidationContext {
|
|
|
420
420
|
});
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
|
-
assertClientLockerSSR(routesNode, lockerNode) {
|
|
424
|
-
if (routesNode && lockerNode) {
|
|
425
|
-
const enabled = findNodeAtLocation(lockerNode, ['enabled']);
|
|
426
|
-
const clientOnly = findNodeAtLocation(lockerNode, ['clientOnly']);
|
|
427
|
-
const compileTimeLocker = enabled && enabled.value === true && (!clientOnly || clientOnly.value === false);
|
|
428
|
-
if (compileTimeLocker && routesNode.children) {
|
|
429
|
-
const hasSSR = routesNode.children.some((n) => {
|
|
430
|
-
const bootstrap = findNodeAtLocation(n, ['bootstrap']);
|
|
431
|
-
if (bootstrap) {
|
|
432
|
-
const ssr = findNodeAtLocation(bootstrap, ['ssr']);
|
|
433
|
-
return ssr?.value === true;
|
|
434
|
-
}
|
|
435
|
-
});
|
|
436
|
-
if (hasSSR) {
|
|
437
|
-
this.diagnostics.push({
|
|
438
|
-
description: descriptions.CONFIG_PARSER.COMPILE_LOCKER_SSR(),
|
|
439
|
-
location: this.getLocationFromNode(lockerNode),
|
|
440
|
-
});
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
423
|
assertRequiredKeys(node, property, requiredPropertyKeys) {
|
|
446
424
|
// All of the given properties must exist on the node
|
|
447
425
|
const missingProps = requiredPropertyKeys.filter((p) => findNodeAtLocation(node, [p]) === undefined);
|
|
@@ -271,7 +271,6 @@ function validateLocker(node, validationContext) {
|
|
|
271
271
|
* - errorRoutes...
|
|
272
272
|
* - assets...
|
|
273
273
|
* - locker...
|
|
274
|
-
* - SSR is only used with clientOnly locker (or locker is disabled)
|
|
275
274
|
* - route and errorRoute ids must be unique
|
|
276
275
|
* - apiVersion: string
|
|
277
276
|
* - lwrVersion: string
|
|
@@ -308,7 +307,6 @@ function validateRoot(node, validationContext, preMerge) {
|
|
|
308
307
|
validateLocker(lockerNode, validationContext);
|
|
309
308
|
validateI18NConfig(findNode(node, ['i18n']), validationContext, preMerge);
|
|
310
309
|
validateBundleConfig(bundleConfigNode, validationContext);
|
|
311
|
-
validationContext.assertClientLockerSSR(routes, lockerNode);
|
|
312
310
|
validationContext.assertNotEmptyString(findNode(node, ['apiVersion']), 'apiVersion');
|
|
313
311
|
validationContext.assertNotEmptyString(findNode(node, ['lwrVersion']), 'lwrVersion');
|
|
314
312
|
validationContext.assertIsSpecifier(findNode(node, ['amdLoader']), 'amdLoader');
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.12.0-alpha.
|
|
7
|
+
"version": "0.12.0-alpha.2",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -41,14 +41,14 @@
|
|
|
41
41
|
"test": "jest"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@lwrjs/diagnostics": "0.12.0-alpha.
|
|
45
|
-
"@lwrjs/instrumentation": "0.12.0-alpha.
|
|
46
|
-
"@lwrjs/shared-utils": "0.12.0-alpha.
|
|
44
|
+
"@lwrjs/diagnostics": "0.12.0-alpha.2",
|
|
45
|
+
"@lwrjs/instrumentation": "0.12.0-alpha.2",
|
|
46
|
+
"@lwrjs/shared-utils": "0.12.0-alpha.2",
|
|
47
47
|
"fs-extra": "^11.1.1",
|
|
48
48
|
"jsonc-parser": "^3.0.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@lwrjs/types": "0.12.0-alpha.
|
|
51
|
+
"@lwrjs/types": "0.12.0-alpha.2",
|
|
52
52
|
"jest": "^26.6.3",
|
|
53
53
|
"ts-jest": "^26.5.6"
|
|
54
54
|
},
|
|
@@ -64,10 +64,10 @@
|
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
"engines": {
|
|
67
|
-
"node": ">=
|
|
67
|
+
"node": ">=18.0.0"
|
|
68
68
|
},
|
|
69
69
|
"volta": {
|
|
70
70
|
"extends": "../../../package.json"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "586a2aa659882483af9249dc3db7fe07bc842a25"
|
|
73
73
|
}
|