@lwrjs/fs-asset-provider 0.10.0-alpha.2 → 0.10.0-alpha.20

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.
@@ -26,11 +26,11 @@ __markAsModule(exports);
26
26
  __export(exports, {
27
27
  default: () => src_default
28
28
  });
29
- var import_fs = __toModule(require("fs"));
29
+ var import_fs_extra = __toModule(require("fs-extra"));
30
30
  var import_path = __toModule(require("path"));
31
31
  var import_shared_utils = __toModule(require("@lwrjs/shared-utils"));
32
32
  function hash(filePath) {
33
- const result = import_fs.default.statSync(filePath);
33
+ const result = import_fs_extra.default.statSync(filePath);
34
34
  return (result.mtimeMs * 1e4).toString();
35
35
  }
36
36
  var FsAssetProvider = class {
@@ -76,7 +76,7 @@ var FsAssetProvider = class {
76
76
  if (!this.cachedAssets.has(fullAssetPath)) {
77
77
  const [assetPath2] = fullAssetPath.split("?");
78
78
  const ext = (0, import_path.extname)(`x.${assetPath2}`).toLowerCase().substring(1);
79
- if (ext && import_fs.default.existsSync(assetPath2)) {
79
+ if (ext && import_fs_extra.default.existsSync(assetPath2)) {
80
80
  const ownHash = hash(assetPath2);
81
81
  const mimeType = (0, import_shared_utils.mimeLookup)(assetPath2);
82
82
  const assetDef = {
@@ -86,7 +86,7 @@ var FsAssetProvider = class {
86
86
  ownHash,
87
87
  content: (passedEncoding) => {
88
88
  const encoding = passedEncoding || (mimeType && mimeType.startsWith("text/") ? "utf-8" : null);
89
- return import_fs.default.readFileSync(assetPath2, {encoding});
89
+ return import_fs_extra.default.readFileSync(assetPath2, {encoding});
90
90
  }
91
91
  };
92
92
  this.cachedAssets.set(fullAssetPath, assetDef);
@@ -94,6 +94,7 @@ var FsAssetProvider = class {
94
94
  this.watcher.add(assetPath2);
95
95
  }
96
96
  } else {
97
+ import_shared_utils.logger.debug(`[${this.name}] Asset ${fullAssetPath} did not exist on filesystem at ${assetPath2}`);
97
98
  return void 0;
98
99
  }
99
100
  }
package/build/es/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import fs from 'fs';
1
+ import fs from 'fs-extra';
2
2
  import { extname } from 'path';
3
- import { mimeLookup, normalizeAssetSpecifier } from '@lwrjs/shared-utils';
3
+ import { logger, mimeLookup, normalizeAssetSpecifier } from '@lwrjs/shared-utils';
4
4
  function hash(filePath) {
5
5
  const result = fs.statSync(filePath);
6
6
  return (result.mtimeMs * 10000).toString();
@@ -73,6 +73,7 @@ export default class FsAssetProvider {
73
73
  }
74
74
  }
75
75
  else {
76
+ logger.debug(`[${this.name}] Asset ${fullAssetPath} did not exist on filesystem at ${assetPath}`);
76
77
  // returned undefined move on to next provider
77
78
  return undefined;
78
79
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.10.0-alpha.2",
7
+ "version": "0.10.0-alpha.20",
8
8
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
9
9
  "repository": {
10
10
  "type": "git",
@@ -30,13 +30,14 @@
30
30
  "build/**/*.d.ts"
31
31
  ],
32
32
  "dependencies": {
33
- "@lwrjs/shared-utils": "0.10.0-alpha.2"
33
+ "@lwrjs/shared-utils": "0.10.0-alpha.20",
34
+ "fs-extra": "^11.1.1"
34
35
  },
35
36
  "devDependencies": {
36
- "@lwrjs/types": "0.10.0-alpha.2"
37
+ "@lwrjs/types": "0.10.0-alpha.20"
37
38
  },
38
39
  "engines": {
39
- "node": ">=16.0.0 <20"
40
+ "node": ">=16.0.0"
40
41
  },
41
- "gitHead": "592cda0637513885477829beea35a86407b342d4"
42
+ "gitHead": "45a867fc54e98f77dd442ccd5f668e23027b9246"
42
43
  }