@lwrjs/fs-asset-provider 0.9.0-alpha.11 → 0.9.0-alpha.13

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.
@@ -29,7 +29,6 @@ __export(exports, {
29
29
  var import_fs = __toModule(require("fs"));
30
30
  var import_path = __toModule(require("path"));
31
31
  var import_shared_utils = __toModule(require("@lwrjs/shared-utils"));
32
- var import_shared_utils2 = __toModule(require("@lwrjs/shared-utils"));
33
32
  function hash(filePath) {
34
33
  const result = import_fs.default.statSync(filePath);
35
34
  return (result.mtimeMs * 1e4).toString();
@@ -40,11 +39,12 @@ var FsAssetProvider = class {
40
39
  this.cachedAssets = new Map();
41
40
  const {
42
41
  appEmitter,
43
- runtimeEnvironment: {watchFiles}
42
+ runtimeEnvironment: {watchFiles},
43
+ watcherFactory
44
44
  } = providerConfig;
45
45
  this.emitter = appEmitter;
46
- if (watchFiles) {
47
- this.watcher = (0, import_shared_utils2.setupWatcher)(this.onModuleChange.bind(this));
46
+ if (watchFiles && watcherFactory) {
47
+ this.watcher = watcherFactory.setupWatcher(this.onModuleChange.bind(this));
48
48
  }
49
49
  }
50
50
  async onModuleChange(fileChanged) {
package/build/es/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import fs from 'fs';
2
2
  import { extname } from 'path';
3
3
  import { mimeLookup } from '@lwrjs/shared-utils';
4
- import { setupWatcher } from '@lwrjs/shared-utils';
5
4
  function hash(filePath) {
6
5
  const result = fs.statSync(filePath);
7
6
  return (result.mtimeMs * 10000).toString();
@@ -10,10 +9,10 @@ export default class FsAssetProvider {
10
9
  constructor(pluginConfig, providerConfig) {
11
10
  this.name = 'fs-asset-provider';
12
11
  this.cachedAssets = new Map();
13
- const { appEmitter, runtimeEnvironment: { watchFiles }, } = providerConfig;
12
+ const { appEmitter, runtimeEnvironment: { watchFiles }, watcherFactory, } = providerConfig;
14
13
  this.emitter = appEmitter;
15
- if (watchFiles) {
16
- this.watcher = setupWatcher(this.onModuleChange.bind(this));
14
+ if (watchFiles && watcherFactory) {
15
+ this.watcher = watcherFactory.setupWatcher(this.onModuleChange.bind(this));
17
16
  }
18
17
  }
19
18
  async onModuleChange(fileChanged) {
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.9.0-alpha.11",
7
+ "version": "0.9.0-alpha.13",
8
8
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
9
9
  "repository": {
10
10
  "type": "git",
@@ -30,13 +30,13 @@
30
30
  "build/**/*.d.ts"
31
31
  ],
32
32
  "dependencies": {
33
- "@lwrjs/shared-utils": "0.9.0-alpha.11"
33
+ "@lwrjs/shared-utils": "0.9.0-alpha.13"
34
34
  },
35
35
  "devDependencies": {
36
- "@lwrjs/types": "0.9.0-alpha.11"
36
+ "@lwrjs/types": "0.9.0-alpha.13"
37
37
  },
38
38
  "engines": {
39
39
  "node": ">=14.15.4 <19"
40
40
  },
41
- "gitHead": "3cb1275b364ae7373c1868c79e6082a122dbef9c"
41
+ "gitHead": "fa30915a685f6e8c5c2895d0c053d59145780123"
42
42
  }