@lwrjs/config 0.12.0-alpha.10 → 0.12.0-alpha.12
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/build/cjs/hooks.cjs +12 -0
- package/build/cjs/index.cjs +1 -4
- package/build/es/hooks.d.ts +2 -1
- package/build/es/hooks.js +12 -0
- package/build/es/index.d.ts +1 -1
- package/build/es/index.js +1 -1
- package/package.json +6 -6
package/build/cjs/hooks.cjs
CHANGED
|
@@ -25,6 +25,7 @@ var __toModule = (module2) => {
|
|
|
25
25
|
__markAsModule(exports);
|
|
26
26
|
__export(exports, {
|
|
27
27
|
executeConfigHooks: () => executeConfigHooks,
|
|
28
|
+
executeContextHooks: () => executeContextHooks,
|
|
28
29
|
executeInstrumentationHooks: () => executeInstrumentationHooks,
|
|
29
30
|
executeStartHooks: () => executeStartHooks
|
|
30
31
|
});
|
|
@@ -92,3 +93,14 @@ function executeInstrumentationHooks(hooks) {
|
|
|
92
93
|
span.end();
|
|
93
94
|
return retVal;
|
|
94
95
|
}
|
|
96
|
+
async function executeContextHooks(hooks, serverContext) {
|
|
97
|
+
if (!hooks.length) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
for (const hook of hooks) {
|
|
101
|
+
if (!hook.setupServerContext) {
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
await hook.setupServerContext(serverContext, hooks);
|
|
105
|
+
}
|
|
106
|
+
}
|
package/build/cjs/index.cjs
CHANGED
|
@@ -28,9 +28,6 @@ __export(exports, {
|
|
|
28
28
|
LWR_VERSION: () => import_package.lwrVersion,
|
|
29
29
|
NODE_VERSION: () => import_package.nodeVersion,
|
|
30
30
|
PWA_KIT_RUNTIME_VERSION: () => import_package.pwaKitRuntimeVersion,
|
|
31
|
-
executeConfigHooks: () => import_hooks.executeConfigHooks,
|
|
32
|
-
executeInstrumentationHooks: () => import_hooks.executeInstrumentationHooks,
|
|
33
|
-
executeStartHooks: () => import_hooks.executeStartHooks,
|
|
34
31
|
getLwrConfigFromFile: () => import_global_config.getLwrConfigFromFile,
|
|
35
32
|
getRuntimeEnvironment: () => import_runtime_config.getRuntimeEnvironment,
|
|
36
33
|
loadConfig: () => import_global_config.loadConfig,
|
|
@@ -40,5 +37,5 @@ __export(exports, {
|
|
|
40
37
|
var import_package = __toModule(require("@lwrjs/config/package"));
|
|
41
38
|
var import_global_config = __toModule(require("./global-config.cjs"));
|
|
42
39
|
var import_runtime_config = __toModule(require("./runtime-config.cjs"));
|
|
43
|
-
|
|
40
|
+
__exportStar(exports, __toModule(require("./hooks.cjs")));
|
|
44
41
|
var import_app_config = __toModule(require("./validation/app-config.cjs"));
|
package/build/es/hooks.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GlobalData, HooksPlugin, NormalizedLwrGlobalConfig, RuntimeEnvironment } from '@lwrjs/types';
|
|
1
|
+
import type { GlobalData, HooksPlugin, NormalizedLwrGlobalConfig, RuntimeEnvironment, ServerContext } from '@lwrjs/types';
|
|
2
2
|
/**
|
|
3
3
|
* Run `initConfigs` hooks
|
|
4
4
|
*
|
|
@@ -30,4 +30,5 @@ export declare function executeConfigHooks(hooks: HooksPlugin[], globalConfig: N
|
|
|
30
30
|
*/
|
|
31
31
|
export declare function executeStartHooks(hooks: HooksPlugin[], globalConfig: NormalizedLwrGlobalConfig, runtimeEnvironment: RuntimeEnvironment, skipValidate?: boolean): void;
|
|
32
32
|
export declare function executeInstrumentationHooks(hooks: HooksPlugin[]): boolean;
|
|
33
|
+
export declare function executeContextHooks(hooks: HooksPlugin[], serverContext: ServerContext): Promise<void>;
|
|
33
34
|
//# sourceMappingURL=hooks.d.ts.map
|
package/build/es/hooks.js
CHANGED
|
@@ -92,4 +92,16 @@ export function executeInstrumentationHooks(hooks) {
|
|
|
92
92
|
span.end();
|
|
93
93
|
return retVal;
|
|
94
94
|
}
|
|
95
|
+
export async function executeContextHooks(hooks, serverContext) {
|
|
96
|
+
if (!hooks.length) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
for (const hook of hooks) {
|
|
100
|
+
if (!hook.setupServerContext) {
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
// eslint-disable-next-line no-await-in-loop
|
|
104
|
+
await hook.setupServerContext(serverContext, hooks);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
95
107
|
//# sourceMappingURL=hooks.js.map
|
package/build/es/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { lwrVersion as LWR_VERSION, lwcVersion as LWC_VERSION, nodeVersion as NODE_VERSION, pwaKitRuntimeVersion as PWA_KIT_RUNTIME_VERSION, } from '@lwrjs/config/package';
|
|
2
2
|
export { loadConfig, resolveGlobalConfig as normalizeConfig, getLwrConfigFromFile } from './global-config.js';
|
|
3
3
|
export { getRuntimeEnvironment } from './runtime-config.js';
|
|
4
|
-
export
|
|
4
|
+
export * from './hooks.js';
|
|
5
5
|
export { validateLwrAppConfig } from './validation/app-config.js';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/build/es/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { lwrVersion as LWR_VERSION, lwcVersion as LWC_VERSION, nodeVersion as NODE_VERSION, pwaKitRuntimeVersion as PWA_KIT_RUNTIME_VERSION, } from '@lwrjs/config/package';
|
|
2
2
|
export { loadConfig, resolveGlobalConfig as normalizeConfig, getLwrConfigFromFile } from './global-config.js';
|
|
3
3
|
export { getRuntimeEnvironment } from './runtime-config.js';
|
|
4
|
-
export
|
|
4
|
+
export * from './hooks.js';
|
|
5
5
|
export { validateLwrAppConfig } from './validation/app-config.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
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.12",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -42,14 +42,14 @@
|
|
|
42
42
|
"test": "jest"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@lwrjs/diagnostics": "0.12.0-alpha.
|
|
46
|
-
"@lwrjs/instrumentation": "0.12.0-alpha.
|
|
47
|
-
"@lwrjs/shared-utils": "0.12.0-alpha.
|
|
45
|
+
"@lwrjs/diagnostics": "0.12.0-alpha.12",
|
|
46
|
+
"@lwrjs/instrumentation": "0.12.0-alpha.12",
|
|
47
|
+
"@lwrjs/shared-utils": "0.12.0-alpha.12",
|
|
48
48
|
"fs-extra": "^11.1.1",
|
|
49
49
|
"jsonc-parser": "^3.0.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@lwrjs/types": "0.12.0-alpha.
|
|
52
|
+
"@lwrjs/types": "0.12.0-alpha.12",
|
|
53
53
|
"jest": "^26.6.3",
|
|
54
54
|
"ts-jest": "^26.5.6"
|
|
55
55
|
},
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"volta": {
|
|
71
71
|
"extends": "../../../package.json"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "bc8a88bce246e9ec00641955152de526ea030ebb"
|
|
74
74
|
}
|