@lwrjs/static 0.10.0-alpha.19 → 0.10.0-alpha.21

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.
@@ -55,7 +55,9 @@ var StaticAssetProvider = class {
55
55
  const fileAssetPath = this.normalizeSpecifier(assetIdentifier, this.resourcePaths);
56
56
  const metadata = this.siteAssets.assets[fileAssetPath];
57
57
  if (!metadata) {
58
- import_shared_utils.logger.warn(`[${this.name}] Did not find requested specifier ${fileAssetPath}`);
58
+ if (import_path.default.dirname(fileAssetPath) !== (this.basePath ? this.basePath : "/")) {
59
+ import_shared_utils.logger.warn(`[${this.name}] Did not find requested specifier ${fileAssetPath}`);
60
+ }
59
61
  return void 0;
60
62
  }
61
63
  const siteAssetPath = import_path.default.join(this.siteRootDir, metadata.path);
@@ -30,6 +30,7 @@ var import_shared_utils = __toModule(require("@lwrjs/shared-utils"));
30
30
  var import_path = __toModule(require("path"));
31
31
  var import_fs_extra = __toModule(require("fs-extra"));
32
32
  var import_static_utils = __toModule(require("../utils/static-utils"));
33
+ var LWR_SSR_BUNDLE_PREFIX = "@lwrjs/lwc-ssr/";
33
34
  var StaticBundleProvider = class {
34
35
  constructor(_config, context) {
35
36
  this.name = "static-bundle-provider";
@@ -44,7 +45,9 @@ var StaticBundleProvider = class {
44
45
  const {specifier, name, namespace, version} = moduleId;
45
46
  const metadata = this.siteBundles.bundles[specifier];
46
47
  if (!metadata) {
47
- import_shared_utils.logger.warn(`[${this.name}] did not find requested specifier ${specifier}`);
48
+ if (!specifier.startsWith(LWR_SSR_BUNDLE_PREFIX)) {
49
+ import_shared_utils.logger.warn(`[${this.name}] did not find requested specifier ${specifier}`);
50
+ }
48
51
  return void 0;
49
52
  }
50
53
  const bundlePath = import_path.default.join(this.siteRootDir, metadata.path);
@@ -53,7 +53,8 @@ var StaticResourceProvider = class {
53
53
  import_shared_utils.logger.info(`[${this.name}] Resource read from lambda ${resourceIdentity.specifier}`);
54
54
  return import_fs_extra.default.createReadStream(resourcePath);
55
55
  },
56
- src: resourcePath
56
+ src: resourcePath,
57
+ inline: metadata.inline
57
58
  };
58
59
  }
59
60
  };
@@ -30,7 +30,10 @@ export default class StaticAssetProvider {
30
30
  const fileAssetPath = this.normalizeSpecifier(assetIdentifier, this.resourcePaths);
31
31
  const metadata = this.siteAssets.assets[fileAssetPath];
32
32
  if (!metadata) {
33
- logger.warn(`[${this.name}] Did not find requested specifier ${fileAssetPath}`);
33
+ // Ignore root asset misses (may be views)
34
+ if (path.dirname(fileAssetPath) !== (this.basePath ? this.basePath : '/')) {
35
+ logger.warn(`[${this.name}] Did not find requested specifier ${fileAssetPath}`);
36
+ }
34
37
  return undefined;
35
38
  }
36
39
  // FS path including ssg root
@@ -2,6 +2,7 @@ import { explodeSpecifier, getSpecifier, logger } from '@lwrjs/shared-utils';
2
2
  import path from 'path';
3
3
  import fs from 'fs-extra';
4
4
  import { resolveStaticBundleVersion } from '../utils/static-utils';
5
+ const LWR_SSR_BUNDLE_PREFIX = '@lwrjs/lwc-ssr/';
5
6
  export default class StaticBundleProvider {
6
7
  constructor(_config, context) {
7
8
  this.name = 'static-bundle-provider';
@@ -16,7 +17,10 @@ export default class StaticBundleProvider {
16
17
  const { specifier, name, namespace, version } = moduleId;
17
18
  const metadata = this.siteBundles.bundles[specifier];
18
19
  if (!metadata) {
19
- logger.warn(`[${this.name}] did not find requested specifier ${specifier}`);
20
+ // ignore ssr module requests
21
+ if (!specifier.startsWith(LWR_SSR_BUNDLE_PREFIX)) {
22
+ logger.warn(`[${this.name}] did not find requested specifier ${specifier}`);
23
+ }
20
24
  return undefined;
21
25
  }
22
26
  // Have to make the bundle code available for SSR
@@ -28,6 +28,7 @@ export default class StaticResourceProvider {
28
28
  return fs.createReadStream(resourcePath);
29
29
  },
30
30
  src: resourcePath,
31
+ inline: metadata.inline,
31
32
  };
32
33
  }
33
34
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.10.0-alpha.19",
7
+ "version": "0.10.0-alpha.21",
8
8
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
9
9
  "repository": {
10
10
  "type": "git",
@@ -48,10 +48,10 @@
48
48
  "build/**/*.d.ts"
49
49
  ],
50
50
  "dependencies": {
51
- "@lwrjs/shared-utils": "0.10.0-alpha.19"
51
+ "@lwrjs/shared-utils": "0.10.0-alpha.21"
52
52
  },
53
53
  "devDependencies": {
54
- "@lwrjs/types": "0.10.0-alpha.19",
54
+ "@lwrjs/types": "0.10.0-alpha.21",
55
55
  "@types/express": "^4.17.17",
56
56
  "jest-express": "^1.12.0",
57
57
  "mock-res": "^0.6.0"
@@ -62,5 +62,5 @@
62
62
  "volta": {
63
63
  "extends": "../../../package.json"
64
64
  },
65
- "gitHead": "0bd55139c08ddf5a532978cfa9e037eaf27e78e2"
65
+ "gitHead": "9213e6934ff9c90f32527d761754b6db75332593"
66
66
  }