@lwrjs/types 0.9.0-alpha.13 → 0.9.0-alpha.14

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.
Files changed (2) hide show
  1. package/build/index.d.ts +64 -23
  2. package/package.json +2 -2
package/build/index.d.ts CHANGED
@@ -163,9 +163,10 @@ export interface ServerModeConfig {
163
163
  };
164
164
  featureFlags: FeatureFlags;
165
165
  }
166
- export interface FeatureFlags {
167
- LEGACY_LOADER: boolean;
168
- SSR_STATIC_BUNDLES: boolean;
166
+ export interface FeatureFlags extends Record<string, boolean | undefined> {
167
+ LEGACY_LOADER?: boolean;
168
+ SSR_STATIC_BUNDLES?: boolean;
169
+ SSR_SANDBOX_WORKER?: boolean;
169
170
  }
170
171
  export interface RuntimeEnvironment extends ServerModeConfig {
171
172
  apiVersion: string;
@@ -271,10 +272,16 @@ export interface ModuleRegistry {
271
272
  getPublicApi(): PublicModuleRegistry;
272
273
  }
273
274
  export declare type PublicModuleRegistry = Pick<ModuleRegistry, 'getModule' | 'getModuleEntry' | 'resolveModuleUri'>;
275
+ export interface BundleProvider {
276
+ name: string;
277
+ bundle<T extends AbstractModuleId, R extends RuntimeEnvironment>(moduleId: T, runtimeEnvironment: R, runtimeParams: RuntimeParams, configOverrides?: BundleConfig): Promise<BundleDefinition | undefined>;
278
+ }
274
279
  export interface ModuleBundler {
280
+ addBundleProviders(providers: BundleProvider[]): void;
275
281
  getModuleBundle<T extends AbstractModuleId, R extends RuntimeEnvironment>(moduleId: T, runtimeEnvironment: R, runtimeParams?: RuntimeParams, bundleConfigOverrides?: BundleConfig): Promise<BundleDefinition>;
282
+ resolveModuleUri<R extends RuntimeEnvironment, S extends string | undefined>(moduleId: Required<Pick<ModuleId, 'specifier' | 'version'>>, runtimeEnvironment: R, runtimeParams?: RuntimeParams, signature?: S): S extends string ? string : Promise<string>;
276
283
  }
277
- export declare type PublicModuleBundler = Pick<ModuleBundler, 'getModuleBundle'>;
284
+ export declare type PublicModuleBundler = Pick<ModuleBundler, 'getModuleBundle' | 'resolveModuleUri'>;
278
285
  export interface BundleRecord {
279
286
  imports?: BaseModuleReference[];
280
287
  dynamicImports?: BaseDynamicModuleReference[];
@@ -299,9 +306,9 @@ export interface ProviderAppConfig {
299
306
  amdLoader: string;
300
307
  esmLoader: string;
301
308
  environment?: EnvironmentConfig;
309
+ bundleConfig: BundleConfig;
302
310
  }
303
311
  export interface ProviderContext {
304
- compiler: Compiler;
305
312
  appObserver: Pick<LwrAppObserver, 'onModuleDefinitionChange' | 'onModuleSourceChange' | 'onAssetSourceChange' | 'onViewSourceChange'>;
306
313
  appEmitter: Pick<LwrAppEmitter, 'notifyModuleDefinitionChanged' | 'notifyAssetSourceChanged' | 'notifyModuleSourceChanged' | 'notifyViewSourceChanged'>;
307
314
  moduleRegistry: PublicModuleRegistry;
@@ -409,7 +416,7 @@ export interface AssetRegistry {
409
416
  getPublicApi(): PublicAssetRegistry;
410
417
  }
411
418
  export declare type PublicAssetRegistry = Pick<AssetRegistry, 'getAsset' | 'resolveAssetUri'>;
412
- export interface CompilerConfig {
419
+ export interface LwcCompilerConfig {
413
420
  name: string;
414
421
  namespace?: string;
415
422
  filename: string;
@@ -443,22 +450,6 @@ export interface CompilerResult {
443
450
  export interface BundleFiles {
444
451
  [filename: string]: string;
445
452
  }
446
- export interface Compiler {
447
- convertToAmd(source: string, { id }: {
448
- id: string;
449
- }): Promise<CompilerResult>;
450
- getModuleMetadata(compiledSource: string): Promise<Partial<CompiledMetadata>>;
451
- lockerize(compiledModule: ModuleCompiled, lockerConfig: LwrLockerConfig, sourcemap: boolean): CompilerResult;
452
- minifyJavascript(source: string): Promise<CompilerResult>;
453
- parseJavascript(source: string, options: ParseOptions): Promise<CompilerResult>;
454
- minifyCSS(source: string): Promise<CompilerResult>;
455
- }
456
- export interface ParseOptions {
457
- envMode: string;
458
- }
459
- export interface CompilerContext {
460
- runtimeEnvironment: RuntimeEnvironment;
461
- }
462
453
  export interface ClientBootstrapConfig {
463
454
  appId?: string;
464
455
  bootstrapModule: string;
@@ -501,7 +492,6 @@ export interface MetricsConfig {
501
492
  export interface ServerContext {
502
493
  appObserver: LwrAppObserver;
503
494
  appEmitter: LwrAppEmitter;
504
- compiler: Compiler;
505
495
  moduleRegistry: ModuleRegistry;
506
496
  moduleBundler: ModuleBundler;
507
497
  viewRegistry: ViewRegistry;
@@ -510,6 +500,7 @@ export interface ServerContext {
510
500
  appConfig: NormalizedLwrGlobalConfig;
511
501
  runtimeEnvironment: RuntimeEnvironment;
512
502
  watcherFactory?: WatcherFactory;
503
+ siteMetadata?: SiteMetadata;
513
504
  }
514
505
  export interface Observer<V> {
515
506
  next: (value: V) => void;
@@ -586,4 +577,54 @@ export interface LwrStringBuilder {
586
577
  toString(): string;
587
578
  original: string;
588
579
  }
580
+ export interface SiteMetadata {
581
+ /**
582
+ * Get the current metadata about the pre-built module bundles for the site.
583
+ */
584
+ getSiteBundles(): SiteBundles;
585
+ /**
586
+ * Get the current metadata about the pre-built resources for the site.
587
+ */
588
+ getSiteResources(): SiteResources;
589
+ /**
590
+ * Get the current metadata about the pre-built assets for the site.
591
+ */
592
+ getSiteAssets(): SiteAssets;
593
+ /**
594
+ * To save out metadata for the current site
595
+ * @param staticRoot
596
+ * @returns
597
+ */
598
+ persistSiteMetadata(): Promise<void>;
599
+ }
600
+ export interface SiteBundles {
601
+ environment: SiteBundlesEnvironment;
602
+ bundles: Record<string, SiteBundle>;
603
+ }
604
+ export interface SiteResources {
605
+ environment: SiteResourcesEnvironment;
606
+ resources: Record<string, SiteArtifact>;
607
+ }
608
+ export interface SiteAssets {
609
+ assets: Record<string, SiteArtifact>;
610
+ }
611
+ export interface SiteBundlesEnvironment {
612
+ format: ModuleFormat;
613
+ featureFlags?: FeatureFlags;
614
+ }
615
+ export interface SiteResourcesEnvironment {
616
+ format: ModuleFormat;
617
+ featureFlags?: FeatureFlags;
618
+ }
619
+ export interface SiteArtifact {
620
+ path: string;
621
+ mimeType?: string;
622
+ }
623
+ export interface SiteBundle extends SiteArtifact {
624
+ version?: Version;
625
+ bundleRecord: {
626
+ includedModules: string[];
627
+ imports: string[];
628
+ };
629
+ }
589
630
  //# sourceMappingURL=index.d.ts.map
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.13",
11
+ "version": "0.9.0-alpha.14",
12
12
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
13
13
  "repository": {
14
14
  "type": "git",
@@ -29,5 +29,5 @@
29
29
  "devDependencies": {
30
30
  "chokidar": "^3.5.3"
31
31
  },
32
- "gitHead": "fa30915a685f6e8c5c2895d0c053d59145780123"
32
+ "gitHead": "64e0ba617151429da6e09f1a9686628f64183d25"
33
33
  }