@lwrjs/config 0.10.0-alpha.11 → 0.10.0-alpha.13
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/defaults.cjs +3 -1
- package/build/cjs/global-config.cjs +8 -5
- package/build/cjs/modules.cjs +2 -0
- package/build/cjs/validation/app-config-context.cjs +1 -0
- package/build/es/defaults.js +2 -0
- package/build/es/global-config.js +8 -5
- package/build/es/modules.js +2 -0
- package/build/es/utils/routes.d.ts +2 -2
- package/build/es/validation/app-config-context.d.ts +6 -6
- package/build/es/validation/app-config-context.js +1 -0
- package/build/es/validation/app-config.d.ts +1 -1
- package/package.json +6 -6
package/build/cjs/defaults.cjs
CHANGED
|
@@ -84,6 +84,7 @@ var DEFAULT_VIEW_TRANSFORM_PLUGINS = ["@lwrjs/base-view-transformer"];
|
|
|
84
84
|
var SSR_VIEW_TRANSFORM_PLUGIN = "@lwrjs/lwc-ssr/viewTransformer";
|
|
85
85
|
var DEFAULT_ASSET_PROVIDERS = ["@lwrjs/fs-asset-provider"];
|
|
86
86
|
var DEFAULT_ASSET_TRANSFORM_PLUGINS = ["@lwrjs/asset-transformer"];
|
|
87
|
+
var DEFAULT_URI_TRANSFORM_PLUGINS = [];
|
|
87
88
|
var DEFAULT_AMD_LOADER = "lwr/loader";
|
|
88
89
|
var DEFAULT_AMD_LOADER_LEGACY = "lwr/loaderLegacy";
|
|
89
90
|
var DEFAULT_ESM_LOADER = "lwr/esmLoader";
|
|
@@ -153,5 +154,6 @@ var DEFAULT_LWR_CONFIG = {
|
|
|
153
154
|
routeHandlers: {},
|
|
154
155
|
bundleConfig: getDefaultBundleConfig(MODE),
|
|
155
156
|
serverType: DEFAULT_SERVER_TYPE,
|
|
156
|
-
locker: import_shared_utils.DEFAULT_LWR_LOCKER_CONFIG
|
|
157
|
+
locker: import_shared_utils.DEFAULT_LWR_LOCKER_CONFIG,
|
|
158
|
+
uriTransformers: DEFAULT_URI_TRANSFORM_PLUGINS
|
|
157
159
|
};
|
|
@@ -93,6 +93,7 @@ function normalizeConfig(config) {
|
|
|
93
93
|
assetProviders: (0, import_services.normalizeServices)(config.assetProviders),
|
|
94
94
|
assetTransformers: (0, import_services.normalizeServices)(config.assetTransformers),
|
|
95
95
|
resourceProviders: (0, import_services.normalizeServices)(config.resourceProviders),
|
|
96
|
+
uriTransformers: (0, import_services.normalizeServices)(config.uriTransformers),
|
|
96
97
|
viewProviders: (0, import_services.normalizeServices)(config.viewProviders),
|
|
97
98
|
viewTransformers: (0, import_services.normalizeServices)(config.viewTransformers),
|
|
98
99
|
routes: (0, import_routes.normalizeRoutes)(config.routes, config.routeHandlers),
|
|
@@ -122,6 +123,7 @@ function normalizeConfigPaths(config) {
|
|
|
122
123
|
assetProviders: (0, import_services.normalizeServicePaths)(config.assetProviders, rootDir),
|
|
123
124
|
assetTransformers: (0, import_services.normalizeServicePaths)(config.assetTransformers, rootDir),
|
|
124
125
|
resourceProviders: (0, import_services.normalizeServicePaths)(config.resourceProviders, rootDir),
|
|
126
|
+
uriTransformers: (0, import_services.normalizeServicePaths)(config.uriTransformers, rootDir),
|
|
125
127
|
viewProviders: (0, import_services.normalizeServicePaths)(config.viewProviders, rootDir),
|
|
126
128
|
viewTransformers: (0, import_services.normalizeServicePaths)(config.viewTransformers, rootDir),
|
|
127
129
|
routes: (0, import_routes.normalizeRoutePaths)(config.routes, resourcePaths),
|
|
@@ -145,14 +147,15 @@ function applySsrConfig(config) {
|
|
|
145
147
|
function applyStaticProviderConfig(config) {
|
|
146
148
|
return {
|
|
147
149
|
...config,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
150
|
+
assetProviders: [["@lwrjs/static/asset-provider", void 0]],
|
|
151
|
+
assetTransformers: [],
|
|
152
|
+
resourceProviders: [["@lwrjs/static/resource-provider", {}]],
|
|
153
|
+
moduleProviders: [["@lwrjs/static/module-provider", void 0]],
|
|
151
154
|
bundleProviders: [
|
|
152
|
-
["@lwrjs/
|
|
155
|
+
["@lwrjs/static/bundle-provider", void 0],
|
|
153
156
|
["@lwrjs/module-bundler/amd-runtime-bundle-provider", void 0]
|
|
154
157
|
],
|
|
155
|
-
|
|
158
|
+
uriTransformers: [["@lwrjs/lambda/mrt-static-uri-transformer", void 0]]
|
|
156
159
|
};
|
|
157
160
|
}
|
|
158
161
|
function resolveGlobalConfig(configArg, options) {
|
package/build/cjs/modules.cjs
CHANGED
|
@@ -69,6 +69,7 @@ async function loadServices(config) {
|
|
|
69
69
|
const assetProviders = await loadServiceEntries(config.assetProviders, config.rootDir, config.cacheDir);
|
|
70
70
|
const assetTransformers = await loadServiceEntries(config.assetTransformers, config.rootDir, config.cacheDir);
|
|
71
71
|
const resourceProviders = await loadServiceEntries(config.resourceProviders, config.rootDir, config.cacheDir);
|
|
72
|
+
const uriTransformers = await loadServiceEntries(config.uriTransformers, config.rootDir, config.cacheDir);
|
|
72
73
|
const viewProviders = await loadServiceEntries(config.viewProviders, config.rootDir, config.cacheDir);
|
|
73
74
|
const viewTransformers = await loadServiceEntries(config.viewTransformers, config.rootDir, config.cacheDir);
|
|
74
75
|
return {
|
|
@@ -77,6 +78,7 @@ async function loadServices(config) {
|
|
|
77
78
|
assetProviders,
|
|
78
79
|
assetTransformers,
|
|
79
80
|
resourceProviders,
|
|
81
|
+
uriTransformers,
|
|
80
82
|
viewProviders,
|
|
81
83
|
viewTransformers
|
|
82
84
|
};
|
package/build/es/defaults.js
CHANGED
|
@@ -46,6 +46,7 @@ const DEFAULT_VIEW_TRANSFORM_PLUGINS = ['@lwrjs/base-view-transformer'];
|
|
|
46
46
|
export const SSR_VIEW_TRANSFORM_PLUGIN = '@lwrjs/lwc-ssr/viewTransformer';
|
|
47
47
|
const DEFAULT_ASSET_PROVIDERS = ['@lwrjs/fs-asset-provider'];
|
|
48
48
|
const DEFAULT_ASSET_TRANSFORM_PLUGINS = ['@lwrjs/asset-transformer'];
|
|
49
|
+
const DEFAULT_URI_TRANSFORM_PLUGINS = [];
|
|
49
50
|
export const DEFAULT_AMD_LOADER = 'lwr/loader';
|
|
50
51
|
export const DEFAULT_AMD_LOADER_LEGACY = 'lwr/loaderLegacy';
|
|
51
52
|
export const DEFAULT_ESM_LOADER = 'lwr/esmLoader';
|
|
@@ -120,5 +121,6 @@ export const DEFAULT_LWR_CONFIG = {
|
|
|
120
121
|
bundleConfig: getDefaultBundleConfig(MODE),
|
|
121
122
|
serverType: DEFAULT_SERVER_TYPE,
|
|
122
123
|
locker: DEFAULT_LWR_LOCKER_CONFIG,
|
|
124
|
+
uriTransformers: DEFAULT_URI_TRANSFORM_PLUGINS,
|
|
123
125
|
};
|
|
124
126
|
//# sourceMappingURL=defaults.js.map
|
|
@@ -118,6 +118,7 @@ function normalizeConfig(config) {
|
|
|
118
118
|
assetProviders: normalizeServices(config.assetProviders),
|
|
119
119
|
assetTransformers: normalizeServices(config.assetTransformers),
|
|
120
120
|
resourceProviders: normalizeServices(config.resourceProviders),
|
|
121
|
+
uriTransformers: normalizeServices(config.uriTransformers),
|
|
121
122
|
viewProviders: normalizeServices(config.viewProviders),
|
|
122
123
|
viewTransformers: normalizeServices(config.viewTransformers),
|
|
123
124
|
// normalize routes and capture all route handlers
|
|
@@ -159,6 +160,7 @@ function normalizeConfigPaths(config) {
|
|
|
159
160
|
assetProviders: normalizeServicePaths(config.assetProviders, rootDir),
|
|
160
161
|
assetTransformers: normalizeServicePaths(config.assetTransformers, rootDir),
|
|
161
162
|
resourceProviders: normalizeServicePaths(config.resourceProviders, rootDir),
|
|
163
|
+
uriTransformers: normalizeServicePaths(config.uriTransformers, rootDir),
|
|
162
164
|
viewProviders: normalizeServicePaths(config.viewProviders, rootDir),
|
|
163
165
|
viewTransformers: normalizeServicePaths(config.viewTransformers, rootDir),
|
|
164
166
|
// normalize all route paths
|
|
@@ -203,14 +205,15 @@ export function applySsrConfig(config) {
|
|
|
203
205
|
export function applyStaticProviderConfig(config) {
|
|
204
206
|
return {
|
|
205
207
|
...config,
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
208
|
+
assetProviders: [['@lwrjs/static/asset-provider', undefined]],
|
|
209
|
+
assetTransformers: [],
|
|
210
|
+
resourceProviders: [['@lwrjs/static/resource-provider', {}]],
|
|
211
|
+
moduleProviders: [['@lwrjs/static/module-provider', undefined]],
|
|
209
212
|
bundleProviders: [
|
|
210
|
-
['@lwrjs/
|
|
213
|
+
['@lwrjs/static/bundle-provider', undefined],
|
|
211
214
|
['@lwrjs/module-bundler/amd-runtime-bundle-provider', undefined],
|
|
212
215
|
],
|
|
213
|
-
|
|
216
|
+
uriTransformers: [['@lwrjs/lambda/mrt-static-uri-transformer', undefined]],
|
|
214
217
|
};
|
|
215
218
|
}
|
|
216
219
|
/**
|
package/build/es/modules.js
CHANGED
|
@@ -59,6 +59,7 @@ export async function loadServices(config) {
|
|
|
59
59
|
const assetProviders = await loadServiceEntries(config.assetProviders, config.rootDir, config.cacheDir);
|
|
60
60
|
const assetTransformers = await loadServiceEntries(config.assetTransformers, config.rootDir, config.cacheDir);
|
|
61
61
|
const resourceProviders = await loadServiceEntries(config.resourceProviders, config.rootDir, config.cacheDir);
|
|
62
|
+
const uriTransformers = await loadServiceEntries(config.uriTransformers, config.rootDir, config.cacheDir);
|
|
62
63
|
const viewProviders = await loadServiceEntries(config.viewProviders, config.rootDir, config.cacheDir);
|
|
63
64
|
const viewTransformers = await loadServiceEntries(config.viewTransformers, config.rootDir, config.cacheDir);
|
|
64
65
|
return {
|
|
@@ -67,6 +68,7 @@ export async function loadServices(config) {
|
|
|
67
68
|
assetProviders,
|
|
68
69
|
assetTransformers,
|
|
69
70
|
resourceProviders,
|
|
71
|
+
uriTransformers,
|
|
70
72
|
viewProviders,
|
|
71
73
|
viewTransformers,
|
|
72
74
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LwrErrorRoute, LwrRoute, NormalizedLwrErrorRoute, NormalizedLwrRoute, ResourcePaths, RouteHandlersConfig } from '@lwrjs/types';
|
|
2
|
-
type ViewOrErrorRoute = LwrRoute | LwrErrorRoute;
|
|
3
|
-
type NormalizedRoute<T extends ViewOrErrorRoute> = T extends LwrRoute ? NormalizedLwrRoute : NormalizedLwrErrorRoute;
|
|
2
|
+
declare type ViewOrErrorRoute = LwrRoute | LwrErrorRoute;
|
|
3
|
+
declare type NormalizedRoute<T extends ViewOrErrorRoute> = T extends LwrRoute ? NormalizedLwrRoute : NormalizedLwrErrorRoute;
|
|
4
4
|
export declare function normalizeRoutes<T extends ViewOrErrorRoute>(routes: T[], routeHandlers: RouteHandlersConfig): NormalizedRoute<T>[];
|
|
5
5
|
export declare function normalizeRoutePaths<T extends ViewOrErrorRoute>(routes: T[] | undefined, resourcePaths: ResourcePaths): NormalizedRoute<T>[];
|
|
6
6
|
export declare function normalizeRouteHandlerPaths(routeHandlers: RouteHandlersConfig, resourcePaths: ResourcePaths): RouteHandlersConfig;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AssetDirConfig, AssetFileConfig, LwrErrorRoute, LwrRoute, NormalizedLwrGlobalConfig, NormalizedLwrAppBootstrapConfig, LwrLockerConfig, RouteHandlersConfig } from '@lwrjs/types';
|
|
2
2
|
import { Node } from 'jsonc-parser';
|
|
3
3
|
import { Diagnostic } from '@lwrjs/diagnostics';
|
|
4
|
-
type RequiredAssetDirConfig = Required<AssetDirConfig>;
|
|
5
|
-
type RequiredAssetFileConfig = Required<AssetFileConfig>;
|
|
6
|
-
type RequiredLwrRoute = Required<LwrRoute>;
|
|
7
|
-
type RequiredLwrErrorRoute = Required<LwrErrorRoute>;
|
|
8
|
-
type RequiredLwrLockerConfig = Required<LwrLockerConfig>;
|
|
4
|
+
declare type RequiredAssetDirConfig = Required<AssetDirConfig>;
|
|
5
|
+
declare type RequiredAssetFileConfig = Required<AssetFileConfig>;
|
|
6
|
+
declare type RequiredLwrRoute = Required<LwrRoute>;
|
|
7
|
+
declare type RequiredLwrErrorRoute = Required<LwrErrorRoute>;
|
|
8
|
+
declare type RequiredLwrLockerConfig = Required<LwrLockerConfig>;
|
|
9
9
|
interface ConfigMap {
|
|
10
10
|
root: NormalizedLwrGlobalConfig;
|
|
11
11
|
assetDir: RequiredAssetDirConfig;
|
|
@@ -16,7 +16,7 @@ interface ConfigMap {
|
|
|
16
16
|
bootstrap: NormalizedLwrAppBootstrapConfig;
|
|
17
17
|
locker: RequiredLwrLockerConfig;
|
|
18
18
|
}
|
|
19
|
-
export declare const ROOT_ATTRIBUTE_KEYS: ["amdLoader", "apiVersion", "assets", "assetProviders", "assetTransformers", "bundleConfig", "bundleProviders", "cacheDir", "contentDir", "environment", "errorRoutes", "esmLoader", "staticSiteGenerator", "globalData", "globalDataDir", "hooks", "ignoreLwrConfigFile", "lwrConfigFile", "layoutsDir", "locker", "lwc", "lwrVersion", "moduleProviders", "port", "basePath", "resourceProviders", "rootDir", "routeHandlers", "routes", "serverMode", "minify", "serverType", "viewProviders", "viewTransformers"];
|
|
19
|
+
export declare const ROOT_ATTRIBUTE_KEYS: ["amdLoader", "apiVersion", "assets", "assetProviders", "assetTransformers", "bundleConfig", "bundleProviders", "cacheDir", "contentDir", "environment", "errorRoutes", "esmLoader", "staticSiteGenerator", "globalData", "globalDataDir", "hooks", "ignoreLwrConfigFile", "lwrConfigFile", "layoutsDir", "locker", "lwc", "lwrVersion", "moduleProviders", "port", "basePath", "resourceProviders", "rootDir", "routeHandlers", "routes", "serverMode", "minify", "serverType", "uriTransformers", "viewProviders", "viewTransformers"];
|
|
20
20
|
export declare const ASSET_DIR_ATTRIBUTE_KEYS: ["alias", "dir", "urlPath"];
|
|
21
21
|
export declare const ASSET_FILE_ATTRIBUTE_KEYS: ["alias", "file", "urlPath"];
|
|
22
22
|
export declare const LOCKER_ATTRIBUTE_KEYS: ["enabled", "trustedComponents", "clientOnly"];
|
|
@@ -4,7 +4,7 @@ export declare const SOURCE_BY_PHASE: {
|
|
|
4
4
|
pre: string;
|
|
5
5
|
post: string;
|
|
6
6
|
};
|
|
7
|
-
type ConfigPhase = 'file' | 'pre' | 'post';
|
|
7
|
+
declare type ConfigPhase = 'file' | 'pre' | 'post';
|
|
8
8
|
export declare function validateLwrAppConfig(config: string | LwrGlobalConfig, phase: ConfigPhase): void | never;
|
|
9
9
|
export {};
|
|
10
10
|
//# sourceMappingURL=app-config.d.ts.map
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.10.0-alpha.
|
|
7
|
+
"version": "0.10.0-alpha.13",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
"package.cjs"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@lwrjs/diagnostics": "0.10.0-alpha.
|
|
40
|
-
"@lwrjs/shared-utils": "0.10.0-alpha.
|
|
41
|
-
"fs-extra": "^11.1.
|
|
39
|
+
"@lwrjs/diagnostics": "0.10.0-alpha.13",
|
|
40
|
+
"@lwrjs/shared-utils": "0.10.0-alpha.13",
|
|
41
|
+
"fs-extra": "^11.1.1",
|
|
42
42
|
"jsonc-parser": "^3.0.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@lwrjs/types": "0.10.0-alpha.
|
|
45
|
+
"@lwrjs/types": "0.10.0-alpha.13"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"lwc": "2.x"
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"engines": {
|
|
51
51
|
"node": ">=16.0.0 <20"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "f6d142d5a027554cb1685389e0b173734149683d"
|
|
54
54
|
}
|