@lwrjs/fs-asset-provider 0.8.0-alpha.6 → 0.8.0-alpha.9
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.
- package/build/cjs/index.cjs +3 -7
- package/build/es/index.js +3 -8
- package/package.json +4 -4
package/build/cjs/index.cjs
CHANGED
|
@@ -50,7 +50,7 @@ var FsAssetProvider = class {
|
|
|
50
50
|
async onModuleChange(fileChanged) {
|
|
51
51
|
let cachedAsset = this.cachedAssets.get(fileChanged);
|
|
52
52
|
if (!cachedAsset) {
|
|
53
|
-
throw new Error("We are observing a file we have not yet processed, this
|
|
53
|
+
throw new Error("We are observing a file we have not yet processed, this shouldnt happen...");
|
|
54
54
|
}
|
|
55
55
|
this.cachedAssets.delete(fileChanged);
|
|
56
56
|
cachedAsset = await this.getAsset(fileChanged);
|
|
@@ -66,16 +66,12 @@ var FsAssetProvider = class {
|
|
|
66
66
|
const ext = (0, import_path.extname)(`x.${assetPath}`).toLowerCase().substr(1);
|
|
67
67
|
if (ext && import_fs.default.existsSync(assetPath)) {
|
|
68
68
|
const ownHash = hash(assetPath);
|
|
69
|
-
const mimeType = (0, import_shared_utils.mimeLookup)(assetPath);
|
|
70
69
|
const assetDef = {
|
|
71
70
|
entry: assetPath,
|
|
72
71
|
ext,
|
|
73
|
-
mime:
|
|
72
|
+
mime: (0, import_shared_utils.mimeLookup)(assetPath),
|
|
74
73
|
ownHash,
|
|
75
|
-
content: (
|
|
76
|
-
const encoding = passedEncoding || (mimeType && mimeType.startsWith("text/") ? "utf-8" : null);
|
|
77
|
-
return import_fs.default.readFileSync(assetPath, {encoding});
|
|
78
|
-
}
|
|
74
|
+
content: (encoding) => import_fs.default.readFileSync(assetPath, encoding)
|
|
79
75
|
};
|
|
80
76
|
this.cachedAssets.set(fullAssetPath, assetDef);
|
|
81
77
|
if (this.watcher) {
|
package/build/es/index.js
CHANGED
|
@@ -19,7 +19,7 @@ export default class FsAssetProvider {
|
|
|
19
19
|
async onModuleChange(fileChanged) {
|
|
20
20
|
let cachedAsset = this.cachedAssets.get(fileChanged);
|
|
21
21
|
if (!cachedAsset) {
|
|
22
|
-
throw new Error(
|
|
22
|
+
throw new Error('We are observing a file we have not yet processed, this shouldnt happen...');
|
|
23
23
|
}
|
|
24
24
|
// Update the cache entry
|
|
25
25
|
this.cachedAssets.delete(fileChanged);
|
|
@@ -38,17 +38,12 @@ export default class FsAssetProvider {
|
|
|
38
38
|
const ext = extname(`x.${assetPath}`).toLowerCase().substr(1);
|
|
39
39
|
if (ext && fs.existsSync(assetPath)) {
|
|
40
40
|
const ownHash = hash(assetPath);
|
|
41
|
-
const mimeType = mimeLookup(assetPath);
|
|
42
41
|
const assetDef = {
|
|
43
42
|
entry: assetPath,
|
|
44
43
|
ext: ext,
|
|
45
|
-
mime:
|
|
44
|
+
mime: mimeLookup(assetPath),
|
|
46
45
|
ownHash,
|
|
47
|
-
content: (
|
|
48
|
-
const encoding = passedEncoding ||
|
|
49
|
-
(mimeType && mimeType.startsWith('text/') ? 'utf-8' : null);
|
|
50
|
-
return fs.readFileSync(assetPath, { encoding });
|
|
51
|
-
},
|
|
46
|
+
content: (encoding) => fs.readFileSync(assetPath, encoding),
|
|
52
47
|
};
|
|
53
48
|
this.cachedAssets.set(fullAssetPath, assetDef);
|
|
54
49
|
if (this.watcher) {
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.8.0-alpha.
|
|
7
|
+
"version": "0.8.0-alpha.9",
|
|
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.8.0-alpha.
|
|
33
|
+
"@lwrjs/shared-utils": "0.8.0-alpha.9"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@lwrjs/types": "0.8.0-alpha.
|
|
36
|
+
"@lwrjs/types": "0.8.0-alpha.9"
|
|
37
37
|
},
|
|
38
38
|
"engines": {
|
|
39
39
|
"node": ">=14.15.4 <19"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "037c471903c6753fc6866ef598571b0df83e58f9"
|
|
42
42
|
}
|