@lwrjs/nunjucks-view-provider 0.22.8 → 0.22.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
CHANGED
|
@@ -102,7 +102,7 @@ var NunJucksViewProvider = class {
|
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
|
-
const fullPath = import_path.default.resolve(sourcePath);
|
|
105
|
+
const fullPath = (0, import_shared_utils.toForwardSlash)(import_path.default.resolve(sourcePath));
|
|
106
106
|
if (watcher) {
|
|
107
107
|
this.watchView(fullPath, viewId);
|
|
108
108
|
}
|
|
@@ -46,7 +46,7 @@ var NunjucksCustomLoader = class extends import_nunjucks.Loader {
|
|
|
46
46
|
});
|
|
47
47
|
const isAbsolute = import_path.default.isAbsolute(templatePath);
|
|
48
48
|
const isRelative = templatePath.startsWith("./");
|
|
49
|
-
const fullTemplatePath = isAbsolute ? templatePath : isRelative ? import_path.default.join(sourceDir, templatePath) : import_path.default.join(rootDir, templatePath);
|
|
49
|
+
const fullTemplatePath = isAbsolute ? templatePath : isRelative ? (0, import_shared_utils.toForwardSlash)(import_path.default.join(sourceDir, templatePath)) : (0, import_shared_utils.toForwardSlash)(import_path.default.join(rootDir, templatePath));
|
|
50
50
|
if (!import_fs.default.existsSync(fullTemplatePath)) {
|
|
51
51
|
throw new Error(`Unable to resolve nunjucks template. File not found on: "${fullTemplatePath}"`);
|
|
52
52
|
}
|
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 } from '@lwrjs/shared-utils';
|
|
4
|
+
import { getViewSourceFromFile, canResolveView, toForwardSlash } 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) {
|
|
@@ -93,7 +93,7 @@ export default class NunJucksViewProvider {
|
|
|
93
93
|
},
|
|
94
94
|
};
|
|
95
95
|
// Watch for changes
|
|
96
|
-
const fullPath = path.resolve(sourcePath);
|
|
96
|
+
const fullPath = toForwardSlash(path.resolve(sourcePath));
|
|
97
97
|
if (watcher) {
|
|
98
98
|
this.watchView(fullPath, viewId);
|
|
99
99
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import { normalizeResourcePath } from '@lwrjs/shared-utils';
|
|
3
|
+
import { normalizeResourcePath, toForwardSlash } from '@lwrjs/shared-utils';
|
|
4
4
|
import { Loader } from 'nunjucks';
|
|
5
5
|
export class NunjucksCustomLoader extends Loader {
|
|
6
6
|
constructor(config) {
|
|
@@ -20,8 +20,8 @@ export class NunjucksCustomLoader extends Loader {
|
|
|
20
20
|
const fullTemplatePath = isAbsolute
|
|
21
21
|
? templatePath
|
|
22
22
|
: isRelative
|
|
23
|
-
? path.join(sourceDir, templatePath)
|
|
24
|
-
: path.join(rootDir, templatePath);
|
|
23
|
+
? toForwardSlash(path.join(sourceDir, templatePath))
|
|
24
|
+
: toForwardSlash(path.join(rootDir, templatePath));
|
|
25
25
|
if (!fs.existsSync(fullTemplatePath)) {
|
|
26
26
|
throw new Error(`Unable to resolve nunjucks template. File not found on: "${fullTemplatePath}"`);
|
|
27
27
|
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.22.
|
|
7
|
+
"version": "0.22.9",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -33,16 +33,16 @@
|
|
|
33
33
|
"build": "tsc -b"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@lwrjs/shared-utils": "0.22.
|
|
36
|
+
"@lwrjs/shared-utils": "0.22.9",
|
|
37
37
|
"gray-matter": "^4.0.2",
|
|
38
38
|
"nunjucks": "^3.2.4"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@lwrjs/types": "0.22.
|
|
41
|
+
"@lwrjs/types": "0.22.9",
|
|
42
42
|
"memfs": "^4.13.0"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|
|
45
45
|
"node": ">=22.0.0"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "d0c112cd7b6eb940d6e554d0bbd93fb535465fdc"
|
|
48
48
|
}
|