@lwrjs/app-service 0.11.0-alpha.6 → 0.11.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.
|
@@ -1,44 +1,26 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
2
|
var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
|
|
8
3
|
var __export = (target, all) => {
|
|
9
4
|
for (var name in all)
|
|
10
5
|
__defProp(target, name, {get: all[name], enumerable: true});
|
|
11
6
|
};
|
|
12
|
-
var __exportStar = (target, module2, desc) => {
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
16
|
-
__defProp(target, key, {get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable});
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toModule = (module2) => {
|
|
21
|
-
return __exportStar(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? {get: () => module2.default, enumerable: true} : {value: module2, enumerable: true})), module2);
|
|
22
|
-
};
|
|
23
7
|
|
|
24
8
|
// packages/@lwrjs/app-service/src/moduleProvider/utils.ts
|
|
25
9
|
__markAsModule(exports);
|
|
26
10
|
__export(exports, {
|
|
27
11
|
createAppRouteViewBootstrapModule: () => createAppRouteViewBootstrapModule,
|
|
28
|
-
createAppWorkerBootstrapModule: () => createAppWorkerBootstrapModule
|
|
29
|
-
normalizeBootstrap: () => normalizeBootstrap
|
|
12
|
+
createAppWorkerBootstrapModule: () => createAppWorkerBootstrapModule
|
|
30
13
|
});
|
|
31
|
-
var import_shared_utils = __toModule(require("@lwrjs/shared-utils"));
|
|
32
14
|
function getDefaultImportName(service) {
|
|
33
15
|
return `loaderService_${service.replace(/\//gi, "_").replace(/@/gi, "")}`;
|
|
34
16
|
}
|
|
35
17
|
function createServicesSource(services) {
|
|
36
|
-
const imports = services.map((
|
|
37
|
-
const defaultImportName = getDefaultImportName(
|
|
38
|
-
return `import ${defaultImportName} from '${
|
|
18
|
+
const imports = services.map(({name}) => {
|
|
19
|
+
const defaultImportName = getDefaultImportName(name);
|
|
20
|
+
return `import ${defaultImportName} from '${name}'`;
|
|
39
21
|
});
|
|
40
|
-
const body = services.map((
|
|
41
|
-
const defaultImportName = getDefaultImportName(
|
|
22
|
+
const body = services.map(({name}) => {
|
|
23
|
+
const defaultImportName = getDefaultImportName(name);
|
|
42
24
|
return `${defaultImportName}(services)`;
|
|
43
25
|
});
|
|
44
26
|
return [...imports, ...body].join(";\n") + ";";
|
|
@@ -65,12 +47,6 @@ function getServiceApiModule(format, moduleLoader) {
|
|
|
65
47
|
return moduleLoader;
|
|
66
48
|
}
|
|
67
49
|
}
|
|
68
|
-
function normalizeBootstrap(bootstrap) {
|
|
69
|
-
return {
|
|
70
|
-
...import_shared_utils.DEFAULT_LWR_BOOTSTRAP_CONFIG,
|
|
71
|
-
...bootstrap
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
50
|
function createAppRouteViewBootstrapModule(route, options, lockerConfig) {
|
|
75
51
|
const {bootstrap} = route;
|
|
76
52
|
const {services, syntheticShadow, ssr} = bootstrap;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LwrLockerConfig, NormalizedLwrErrorRoute, NormalizedLwrRoute } from '@lwrjs/types';
|
|
2
2
|
/**
|
|
3
3
|
* Create the virtual source for the application bootstrap module with a worker root
|
|
4
4
|
* @returns the generated source
|
|
5
5
|
*/
|
|
6
6
|
export declare function createAppWorkerBootstrapModule(workerSpecifier: string, route: NormalizedLwrRoute | NormalizedLwrErrorRoute, options: ModuleSourceOptions): string;
|
|
7
|
-
export declare function normalizeBootstrap(bootstrap?: LwrAppBootstrapConfig): NormalizedLwrAppBootstrapConfig;
|
|
8
7
|
interface ModuleSourceOptions {
|
|
9
8
|
hmrEnabled: boolean;
|
|
10
9
|
format: string;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { DEFAULT_LWR_BOOTSTRAP_CONFIG } from '@lwrjs/shared-utils';
|
|
2
1
|
function getDefaultImportName(service) {
|
|
3
2
|
return `loaderService_${service.replace(/\//gi, '_').replace(/@/gi, '')}`;
|
|
4
3
|
}
|
|
5
4
|
function createServicesSource(services) {
|
|
6
|
-
const imports = services.map((
|
|
7
|
-
const defaultImportName = getDefaultImportName(
|
|
8
|
-
return `import ${defaultImportName} from '${
|
|
5
|
+
const imports = services.map(({ name }) => {
|
|
6
|
+
const defaultImportName = getDefaultImportName(name);
|
|
7
|
+
return `import ${defaultImportName} from '${name}'`;
|
|
9
8
|
});
|
|
10
|
-
const body = services.map((
|
|
11
|
-
const defaultImportName = getDefaultImportName(
|
|
9
|
+
const body = services.map(({ name }) => {
|
|
10
|
+
const defaultImportName = getDefaultImportName(name);
|
|
12
11
|
return `${defaultImportName}(services)`;
|
|
13
12
|
});
|
|
14
13
|
return [...imports, ...body].join(';\n') + ';';
|
|
@@ -48,12 +47,6 @@ function getServiceApiModule(format, moduleLoader) {
|
|
|
48
47
|
return moduleLoader;
|
|
49
48
|
}
|
|
50
49
|
}
|
|
51
|
-
export function normalizeBootstrap(bootstrap) {
|
|
52
|
-
return {
|
|
53
|
-
...DEFAULT_LWR_BOOTSTRAP_CONFIG,
|
|
54
|
-
...bootstrap,
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
50
|
/**
|
|
58
51
|
* Create the virtual source for the application bootstrap module
|
|
59
52
|
* @returns the generated source
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.11.0-alpha.
|
|
7
|
+
"version": "0.11.0-alpha.7",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"build/**/*.d.ts"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@lwrjs/diagnostics": "0.11.0-alpha.
|
|
37
|
-
"@lwrjs/shared-utils": "0.11.0-alpha.
|
|
36
|
+
"@lwrjs/diagnostics": "0.11.0-alpha.7",
|
|
37
|
+
"@lwrjs/shared-utils": "0.11.0-alpha.7"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@lwrjs/types": "0.11.0-alpha.
|
|
40
|
+
"@lwrjs/types": "0.11.0-alpha.7"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|
|
43
43
|
"node": ">=16.0.0"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "872180fbd00df214ab91971d7ec80ba138a73756"
|
|
46
46
|
}
|