@lwrjs/nunjucks-view-provider 0.9.0-alpha.3 → 0.9.0-alpha.30
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 +4 -3
- package/build/es/index.js +4 -4
- package/package.json +7 -8
package/build/cjs/index.cjs
CHANGED
|
@@ -41,10 +41,11 @@ var NunJucksViewProvider = class {
|
|
|
41
41
|
this.name = "lwr-nunjucks-view-provider";
|
|
42
42
|
this.emitter = providerConfig.appEmitter;
|
|
43
43
|
const {
|
|
44
|
-
runtimeEnvironment: {watchFiles}
|
|
44
|
+
runtimeEnvironment: {watchFiles},
|
|
45
|
+
watcherFactory
|
|
45
46
|
} = providerConfig;
|
|
46
|
-
if (watchFiles) {
|
|
47
|
-
this.watcher =
|
|
47
|
+
if (watchFiles && watcherFactory) {
|
|
48
|
+
this.watcher = watcherFactory.setupWatcher(this.onViewChange.bind(this));
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
async onViewChange(fileChanged) {
|
package/build/es/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
import nunjucks from 'nunjucks';
|
|
3
3
|
import grayMatter from 'gray-matter';
|
|
4
|
-
import { getViewSourceFromFile, canResolveView
|
|
4
|
+
import { getViewSourceFromFile, canResolveView } from '@lwrjs/shared-utils';
|
|
5
5
|
import { NunjucksCustomLoader, addHelperMethods } from './nunjucks-env-utils.js';
|
|
6
6
|
export default class NunJucksViewProvider {
|
|
7
7
|
constructor(pluginConfig, providerConfig) {
|
|
@@ -13,9 +13,9 @@ export default class NunJucksViewProvider {
|
|
|
13
13
|
this.name = 'lwr-nunjucks-view-provider';
|
|
14
14
|
this.emitter = providerConfig.appEmitter;
|
|
15
15
|
// Setup watcher
|
|
16
|
-
const { runtimeEnvironment: { watchFiles }, } = providerConfig;
|
|
17
|
-
if (watchFiles) {
|
|
18
|
-
this.watcher = setupWatcher(this.onViewChange.bind(this));
|
|
16
|
+
const { runtimeEnvironment: { watchFiles }, watcherFactory, } = providerConfig;
|
|
17
|
+
if (watchFiles && watcherFactory) {
|
|
18
|
+
this.watcher = watcherFactory.setupWatcher(this.onViewChange.bind(this));
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
async onViewChange(fileChanged) {
|
package/package.json
CHANGED
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.9.0-alpha.
|
|
7
|
+
"version": "0.9.0-alpha.30",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "https://github.com/salesforce/lwr.git",
|
|
11
|
+
"url": "https://github.com/salesforce-experience-platform-emu/lwr.git",
|
|
12
12
|
"directory": "packages/@lwrjs/nunjucks-view-provider"
|
|
13
13
|
},
|
|
14
14
|
"bugs": {
|
|
15
|
-
"url": "https://github.com/salesforce/lwr/issues"
|
|
15
|
+
"url": "https://github.com/salesforce-experience-platform-emu/lwr/issues"
|
|
16
16
|
},
|
|
17
17
|
"type": "module",
|
|
18
18
|
"types": "build/es/index.d.ts",
|
|
@@ -30,17 +30,16 @@
|
|
|
30
30
|
"build/**/*.d.ts"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@lwrjs/
|
|
34
|
-
"@lwrjs/shared-utils": "0.9.0-alpha.3",
|
|
33
|
+
"@lwrjs/shared-utils": "0.9.0-alpha.30",
|
|
35
34
|
"gray-matter": "^4.0.2",
|
|
36
35
|
"nunjucks": "^3.2.2",
|
|
37
36
|
"parse5-sax-parser": "^6.0.1"
|
|
38
37
|
},
|
|
39
38
|
"devDependencies": {
|
|
40
|
-
"@lwrjs/types": "0.9.0-alpha.
|
|
39
|
+
"@lwrjs/types": "0.9.0-alpha.30"
|
|
41
40
|
},
|
|
42
41
|
"engines": {
|
|
43
|
-
"node": ">=
|
|
42
|
+
"node": ">=16.0.0 <20"
|
|
44
43
|
},
|
|
45
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "6e18768b8e47066c41ae0b792bf4aa766b0b784b"
|
|
46
45
|
}
|