@lwrjs/static 0.17.2-alpha.30 → 0.17.2-alpha.31

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.
@@ -3,8 +3,13 @@ import { hashContent, mimeLookup, normalizeResourcePath } from '@lwrjs/shared-ut
3
3
  import path from 'path';
4
4
  import fs from 'fs-extra';
5
5
  export default class StaticAssetProvider {
6
+ name = 'static-asset-provider';
7
+ siteAssets;
8
+ resourcePaths;
9
+ siteRootDir;
10
+ basePath;
11
+ assetsOnLambda;
6
12
  constructor(_config, context) {
7
- this.name = 'static-asset-provider';
8
13
  if (!context.siteMetadata) {
9
14
  throw new Error(`[${this.name}] Site metadata was not found`);
10
15
  }
@@ -8,8 +8,14 @@ import { cacheCountStore } from '@lwrjs/instrumentation';
8
8
  import { getTracer, BundleSpan } from '@lwrjs/instrumentation';
9
9
  const BUNDLE_SOURCE_NOT_FOUND = 'Bundle Source Path Not Found';
10
10
  export default class StaticBundleProvider {
11
+ name = 'static-bundle-provider';
12
+ codeCache;
13
+ siteRootDir;
14
+ bundleConfig;
15
+ i18n;
16
+ siteMetadata;
17
+ bundleCacheSize;
11
18
  constructor(config, context) {
12
- this.name = 'static-bundle-provider';
13
19
  if (!context.siteMetadata) {
14
20
  throw new Error(`[${this.name}] Site metadata was not found`);
15
21
  }
@@ -3,8 +3,13 @@ import { VERSION_SIGIL, explodeSpecifier, getSpecifier, isLambdaEnv } from '@lwr
3
3
  import path from 'path';
4
4
  import { getSiteBundleId, parseSiteId, resolveStaticBundleVersion } from '../site-metadata.js';
5
5
  export default class StaticModuleProvider {
6
+ name = 'static-module-provider';
7
+ siteRootDir;
8
+ externals;
9
+ fingerprintIndex;
10
+ i18n;
11
+ siteMetadata;
6
12
  constructor(_config, context) {
7
- this.name = 'static-module-provider';
8
13
  if (!context.siteMetadata) {
9
14
  throw new Error(`[${this.name}] Site metadata was not found`);
10
15
  }
@@ -4,8 +4,11 @@ import path from 'path';
4
4
  import fs from 'fs-extra';
5
5
  import { getSiteResourceId } from '../site-metadata.js';
6
6
  export default class StaticResourceProvider {
7
+ name = 'static-resource-provider';
8
+ siteRootDir;
9
+ siteMetadata;
10
+ resourceRegistry;
7
11
  constructor(_config, context) {
8
- this.name = 'static-resource-provider';
9
12
  if (!context.siteMetadata) {
10
13
  throw new Error(`[${this.name}] Site metadata was not found`);
11
14
  }
@@ -13,6 +13,14 @@ export const SITE_VERSION_PREFIX = `|${VERSION_SIGIL}/`;
13
13
  export const SITE_LOCALE_PREFIX = `|${LOCALE_SIGIL}/`;
14
14
  export const SITE_SSR_PREFIX = `|${SSR_SIGIL}`;
15
15
  export class SiteMetadataImpl {
16
+ options;
17
+ siteBundles;
18
+ debugSiteBundles;
19
+ siteResources;
20
+ debugSiteResources;
21
+ siteAssets;
22
+ bundleDecisionTree;
23
+ resourceDecisionTree;
16
24
  constructor(options) {
17
25
  this.options = options;
18
26
  this.siteBundles = this.readStaticBundleMetadata(options.rootDir, STATIC_BUNDLE_METADATA_PATH);
@@ -33,9 +33,7 @@ const CHOICE_PROD = 'prod';
33
33
  const CHOICE_DEBUG = 'debug';
34
34
  // Tree of decisions to lead you to the right artifact
35
35
  export default class DecisionTreeImpl {
36
- constructor() {
37
- this.root = new TreeNode(); // Root node does not hold any decision value
38
- }
36
+ root = new TreeNode(); // Root node does not hold any decision value
39
37
  // Insert an artifact into the tree based on a path of decisions
40
38
  insert(siteArtifactId, artifact, debug, localeFallbacks) {
41
39
  // The decision path is the set of choices needed to get to the right metadata
@@ -179,9 +177,12 @@ export default class DecisionTreeImpl {
179
177
  * It maintains the rank of all choices at this node, allowing a later node with a higher rank to replace the current one as the best option.
180
178
  */
181
179
  class TreeNode {
180
+ decisionValue; // The decision value at this node (version ['1_0' or WILDCARD etc], localeId ['en-MX' or WILDCARD etc], etc.)
181
+ children = new Map(); // Maps a decision key to the next TreeNode
182
+ artifact = undefined; // Final artifact at a leaf node
183
+ parentPath; // parent path (i.e. foo/bar|DEBUG|1_0|WILD_CARD) just used for debugging
184
+ rank; // choice rank to prioritize lower ranked choices
182
185
  constructor(value = '', parentPath = '') {
183
- this.children = new Map(); // Maps a decision key to the next TreeNode
184
- this.artifact = undefined; // Final artifact at a leaf node
185
186
  this.decisionValue = value;
186
187
  this.parentPath = parentPath;
187
188
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.17.2-alpha.30",
7
+ "version": "0.17.2-alpha.31",
8
8
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
9
9
  "repository": {
10
10
  "type": "git",
@@ -56,13 +56,13 @@
56
56
  "build/**/*.d.ts"
57
57
  ],
58
58
  "dependencies": {
59
- "@lwrjs/diagnostics": "0.17.2-alpha.30",
60
- "@lwrjs/instrumentation": "0.17.2-alpha.30",
61
- "@lwrjs/shared-utils": "0.17.2-alpha.30",
59
+ "@lwrjs/diagnostics": "0.17.2-alpha.31",
60
+ "@lwrjs/instrumentation": "0.17.2-alpha.31",
61
+ "@lwrjs/shared-utils": "0.17.2-alpha.31",
62
62
  "lru-cache": "^10.4.3"
63
63
  },
64
64
  "devDependencies": {
65
- "@lwrjs/types": "0.17.2-alpha.30",
65
+ "@lwrjs/types": "0.17.2-alpha.31",
66
66
  "@types/express": "^4.17.21",
67
67
  "jest": "29.7.0",
68
68
  "jest-express": "^1.12.0",
@@ -76,5 +76,5 @@
76
76
  "volta": {
77
77
  "extends": "../../../package.json"
78
78
  },
79
- "gitHead": "818bbb13d2d4b14d128c4c4f23229c9ce7458a23"
79
+ "gitHead": "bbb087ab080321047b10bbcda40e88e69b6a69a5"
80
80
  }