@lwrjs/types 0.9.0-alpha.17 → 0.9.0-alpha.19

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/config.d.ts CHANGED
@@ -41,6 +41,9 @@ export interface LwrLockerConfig {
41
41
  trustedComponents?: string[];
42
42
  clientOnly?: boolean;
43
43
  }
44
+ export interface RouteHandlersConfig {
45
+ [id: string]: string;
46
+ }
44
47
  export interface LocalizedViewRequest extends ViewRequest {
45
48
  locale?: string;
46
49
  }
@@ -88,6 +91,7 @@ export interface LwrGlobalConfig {
88
91
  viewTransformers?: ServiceConfig[];
89
92
  routes?: LwrRoute[];
90
93
  errorRoutes?: LwrErrorRoute[];
94
+ routeHandlers?: RouteHandlersConfig;
91
95
  bundleConfig?: BundleConfig;
92
96
  serverType?: ServerTypes;
93
97
  staticSiteGenerator?: StaticSiteGenerator;
@@ -123,8 +127,7 @@ export interface ServerBuild {
123
127
  globalData: GlobalData;
124
128
  hooks: HooksPlugin[];
125
129
  services: Services;
126
- routes: Route<NormalizedLwrRoute>[];
127
- errorRoutes: Route<NormalizedLwrErrorRoute>[];
130
+ routeHandlers: RouteHandlers;
128
131
  }
129
132
  export interface Services {
130
133
  moduleProviders: ResolvedServiceEntry<ModuleProvider>[];
@@ -135,9 +138,9 @@ export interface Services {
135
138
  assetProviders: ResolvedServiceEntry<AssetProvider>[];
136
139
  assetTransformers: ResolvedServiceEntry<AssetTransformPlugin>[];
137
140
  }
138
- export declare type Route<T extends LwrBaseRoute> = (T extends LwrRoute ? Omit<NormalizedLwrRoute, 'routeHandler'> : Omit<NormalizedLwrErrorRoute, 'routeHandler'>) & {
139
- routeHandler?: RouteHandlerFunction;
140
- };
141
+ export interface RouteHandlers {
142
+ [id: string]: RouteHandlerFunction;
143
+ }
141
144
  interface AssetConfigCommon {
142
145
  urlPath: string;
143
146
  alias?: string;
package/build/index.d.ts CHANGED
@@ -6,7 +6,7 @@ import type { WatchOptions } from 'chokidar';
6
6
  import { EventEmitter } from 'events';
7
7
  import fs from 'fs';
8
8
  import { Readable } from 'stream';
9
- import { BundleConfig, EnvironmentConfig, HooksPlugin, LwrLockerConfig, LwrRoute, LwrErrorRoute, NormalizedLwrErrorRoute, NormalizedLwrGlobalConfig, NormalizedLwrRoute, ResolverModuleRecord, Route, BundleConfigOverrides } from './config.js';
9
+ import { BundleConfig, EnvironmentConfig, HooksPlugin, LwrLockerConfig, NormalizedLwrErrorRoute, NormalizedLwrGlobalConfig, NormalizedLwrRoute, ResolverModuleRecord, BundleConfigOverrides, RouteHandlers } from './config.js';
10
10
  import { AssetReference, CompiledView, PublicViewRegistry, ViewProvider, ViewRegistry, ViewTransformPlugin } from './views.js';
11
11
  export * from './lwr-shim.js';
12
12
  export * from './config.js';
@@ -504,8 +504,7 @@ export interface ServerContext {
504
504
  siteMetadata?: SiteMetadata;
505
505
  appConfig: NormalizedLwrGlobalConfig;
506
506
  runtimeEnvironment: RuntimeEnvironment;
507
- routes: Route<LwrRoute>[];
508
- errorRoutes: Route<LwrErrorRoute>[];
507
+ routeHandlers: RouteHandlers;
509
508
  }
510
509
  export interface Observer<V> {
511
510
  next: (value: V) => void;
@@ -607,33 +606,21 @@ export interface SiteMetadata {
607
606
  persistSiteMetadata(): Promise<void>;
608
607
  }
609
608
  export interface SiteBundles {
610
- environment: SiteBundlesEnvironment;
611
609
  bundles: Record<string, SiteBundle>;
612
610
  }
613
611
  export interface SiteResources {
614
- environment: SiteResourcesEnvironment;
615
612
  resources: Record<string, SiteArtifact>;
616
613
  }
617
614
  export interface SiteAssets {
618
615
  assets: Record<string, SiteArtifact>;
619
616
  }
620
- export interface SiteBundlesEnvironment {
621
- format: ModuleFormat;
622
- featureFlags?: FeatureFlags;
623
- }
624
- export interface SiteResourcesEnvironment {
625
- format: ModuleFormat;
626
- featureFlags?: FeatureFlags;
627
- }
628
617
  export interface SiteArtifact {
629
618
  path: string;
630
619
  mimeType?: string;
631
620
  }
632
621
  export interface SiteBundle extends SiteArtifact {
633
622
  version?: Version;
634
- bundleRecord: {
635
- includedModules?: string[];
636
- imports: string[];
637
- };
623
+ imports: string[];
624
+ includedModules?: string[];
638
625
  }
639
626
  //# sourceMappingURL=index.d.ts.map
package/build/views.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import { LwrErrorRoute, LwrRoute, Route, RouteHandlerFunction, RouteHandlerView, View } from './config.js';
2
+ import { LwrErrorRoute, LwrRoute, RouteHandlerFunction, RouteHandlerView, View } from './config.js';
3
3
  import { AssetSource, AssetUri, Endpoints, FlattenedModuleGraphs, ImportMetadata, Json, LwrStringBuilder, ResourceDefinition, RuntimeEnvironment, RuntimeParams, Specifier, TransformPluginContext } from './index.js';
4
4
  export declare type ViewIdentity = Pick<View, 'rootComponent' | 'contentTemplate'>;
5
5
  export interface ViewSource {
@@ -185,9 +185,9 @@ export interface ViewRegistry {
185
185
  }
186
186
  export declare type PublicViewRegistry = Pick<ViewRegistry, 'getView' | 'getViewDefinition'>;
187
187
  export interface ViewHandler {
188
- getViewContent(viewRequest: ViewRequest, route: Route<LwrRoute | LwrErrorRoute>, runtimeEnvironment: RuntimeEnvironment, runtimeParams: RuntimeParams): Promise<ViewResponse>;
189
- getViewJson(viewRequest: ViewRequest, route: Route<LwrRoute | LwrErrorRoute>, runtimeEnvironment: RuntimeEnvironment, runtimeParams: RuntimeParams): Promise<ViewResponse>;
190
- getViewConfiguration(viewRequest: ViewRequest, route: Route<LwrRoute | LwrErrorRoute>, runtimeEnvironment: RuntimeEnvironment, runtimeParams: RuntimeParams): Promise<ViewResponse | undefined>;
188
+ getViewContent(viewRequest: ViewRequest, route: LwrRoute | LwrErrorRoute, runtimeEnvironment: RuntimeEnvironment, runtimeParams: RuntimeParams): Promise<ViewResponse>;
189
+ getViewJson(viewRequest: ViewRequest, route: LwrRoute | LwrErrorRoute, runtimeEnvironment: RuntimeEnvironment, runtimeParams: RuntimeParams): Promise<ViewResponse>;
190
+ getViewConfiguration(viewRequest: ViewRequest, route: LwrRoute | LwrErrorRoute, runtimeEnvironment: RuntimeEnvironment, runtimeParams: RuntimeParams): Promise<ViewResponse | undefined>;
191
191
  }
192
192
  export interface SsrRequestContext {
193
193
  props: Json;
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "build": "tsc -b"
9
9
  },
10
10
  "type": "module",
11
- "version": "0.9.0-alpha.17",
11
+ "version": "0.9.0-alpha.19",
12
12
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
13
13
  "repository": {
14
14
  "type": "git",
@@ -33,5 +33,5 @@
33
33
  "node": "14.19.1",
34
34
  "yarn": "1.22.19"
35
35
  },
36
- "gitHead": "447417ff091802927b25cfc1bcb01da02264f41b"
36
+ "gitHead": "65623ff6f03a217321d7d342df391fb05c90eb19"
37
37
  }