eleventy-plugin-vento 5.4.0 → 5.4.2
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/CHANGELOG.md +12 -0
- package/dist/plugin.mjs +3 -9
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# eleventy-plugin-vento
|
|
2
2
|
|
|
3
|
+
## 5.4.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3ae32e5: Revise error creation method to explicitly check for `undefined` in `ctx.position` and `ctx.file` as opposed to coercing to booleans. This resolves edge cases where errors thrown with a position of `0` would incorrectly log position warnings.
|
|
8
|
+
|
|
9
|
+
## 5.4.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 744f059: correct minor formatting issue in errors
|
|
14
|
+
|
|
3
15
|
## 5.4.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/plugin.mjs
CHANGED
|
@@ -4,7 +4,6 @@ import createVentoEnv from "ventojs";
|
|
|
4
4
|
import { VentoError } from "ventojs/core/errors.js";
|
|
5
5
|
import { styleText } from "node:util";
|
|
6
6
|
import createDebugger from "debug";
|
|
7
|
-
|
|
8
7
|
//#region src/utils/create-vento-tag.ts
|
|
9
8
|
function createVentoTag(tagInfo) {
|
|
10
9
|
let LEVEL = 1;
|
|
@@ -32,7 +31,6 @@ function createVentoTag(tagInfo) {
|
|
|
32
31
|
};
|
|
33
32
|
return Object.defineProperty(tag, "name", { value: `${tagInfo.name}_${IS_PAIRED ? `EleventyPairedTag` : `EleventyTag`}` });
|
|
34
33
|
}
|
|
35
|
-
|
|
36
34
|
//#endregion
|
|
37
35
|
//#region src/utils/logging.ts
|
|
38
36
|
const debug = {
|
|
@@ -50,7 +48,6 @@ const debug = {
|
|
|
50
48
|
function warn(...messages) {
|
|
51
49
|
for (const message of messages) console.error(styleText("gray", "[warning]"), styleText("yellow", message));
|
|
52
50
|
}
|
|
53
|
-
|
|
54
51
|
//#endregion
|
|
55
52
|
//#region src/utils/errors.ts
|
|
56
53
|
const LINE_TERMINATOR = /(\r\n?|[\n\u2028\u2029])/;
|
|
@@ -62,7 +59,7 @@ var EleventyVentoError = class extends Error {
|
|
|
62
59
|
static async createFromContext(error) {
|
|
63
60
|
const ctx = await error.getContext();
|
|
64
61
|
const err = new this("An unknown error occured processing Vento templates", ctx, error);
|
|
65
|
-
if (
|
|
62
|
+
if (ctx.position === void 0 || ctx.file === void 0) warn(`A \`${ctx.type}\` was thrown, but the exact position within the source code cannot be obtained`, "Use DEBUG=\"Eleventy:Vento*\" to view raw `ErrorContext` information");
|
|
66
63
|
debug.error("Received `ErrorContext` from Vento: %O", ctx);
|
|
67
64
|
if (ctx.file === void 0) return err;
|
|
68
65
|
err.message = `${ctx.type} in ${ctx.file}`;
|
|
@@ -76,7 +73,7 @@ var EleventyVentoError = class extends Error {
|
|
|
76
73
|
err.message += `${indent} ${" ".repeat(sourceColumn - 1)}^`;
|
|
77
74
|
if (!ctx.code || ctx.line === void 0 || ctx.column === void 0) return err;
|
|
78
75
|
const codelines = codeToLines(ctx.code);
|
|
79
|
-
err.message += `\n\n${indent}
|
|
76
|
+
err.message += `\n\n${indent} │ /// compiled Vento function for ${ctx.file} ///\n${indent} │ ${codelines[ctx.line - 1].trimEnd()}\n${indent} ${" ".repeat(ctx.column - 1)}^`;
|
|
80
77
|
return err;
|
|
81
78
|
}
|
|
82
79
|
};
|
|
@@ -102,7 +99,6 @@ function locateInCode(lines, position) {
|
|
|
102
99
|
}
|
|
103
100
|
throw new Error(`Positon ${position} is out of bounds for the provided source`);
|
|
104
101
|
}
|
|
105
|
-
|
|
106
102
|
//#endregion
|
|
107
103
|
//#region src/engine.ts
|
|
108
104
|
function createVentoEngine(options) {
|
|
@@ -179,7 +175,6 @@ async function renderVentoTemplate(template, data, from) {
|
|
|
179
175
|
throw error;
|
|
180
176
|
}
|
|
181
177
|
}
|
|
182
|
-
|
|
183
178
|
//#endregion
|
|
184
179
|
//#region src/plugin.ts
|
|
185
180
|
function VentoPlugin(eleventyConfig, userOptions) {
|
|
@@ -260,6 +255,5 @@ function VentoPlugin(eleventyConfig, userOptions) {
|
|
|
260
255
|
});
|
|
261
256
|
debug.main("eleventy-plugin-vento initialized");
|
|
262
257
|
}
|
|
263
|
-
|
|
264
258
|
//#endregion
|
|
265
|
-
export { VentoPlugin };
|
|
259
|
+
export { VentoPlugin };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eleventy-plugin-vento",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.2",
|
|
4
4
|
"description": "Adds support for the Vento templating language to Eleventy.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -42,19 +42,19 @@
|
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"11ty.ts": "0.0.7",
|
|
44
44
|
"@11ty/eleventy": "3.1.2",
|
|
45
|
-
"@changesets/cli": "2.
|
|
45
|
+
"@changesets/cli": "2.30.0",
|
|
46
46
|
"@eslint/js": "10.0.1",
|
|
47
47
|
"@types/debug": "4.1.12",
|
|
48
|
-
"@types/node": "24.
|
|
49
|
-
"eslint": "10.0.
|
|
48
|
+
"@types/node": "24.12.0",
|
|
49
|
+
"eslint": "10.0.3",
|
|
50
50
|
"eslint-config-prettier": "10.1.8",
|
|
51
51
|
"eslint-plugin-unicorn": "63.0.0",
|
|
52
52
|
"globals": "17.4.0",
|
|
53
|
-
"knip": "5.
|
|
53
|
+
"knip": "5.86.0",
|
|
54
54
|
"prettier": "3.8.1",
|
|
55
|
-
"tsdown": "0.
|
|
55
|
+
"tsdown": "0.21.1",
|
|
56
56
|
"typescript": "5.9.3",
|
|
57
|
-
"typescript-eslint": "8.
|
|
57
|
+
"typescript-eslint": "8.57.0",
|
|
58
58
|
"vitest": "4.0.18"
|
|
59
59
|
}
|
|
60
60
|
}
|