eleventy-plugin-vento 4.5.1 → 4.6.0

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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # eleventy-plugin-vento
2
2
 
3
+ ## 4.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 1a822a6: 🎉 Update `ventojs` to v2 🎉
8
+
9
+ **Note:** Vento v2 introduces some breaking changes that _shouldn't_ have an impact on functionality of this plugin unless you're going through this plugin to modify Vento's internal functionality.
10
+
11
+ The internals of this plugin were reworked in order to ensure that tests still pass. If you come across any issues while using Vento v2 please raise an issue!
12
+
13
+ ## 4.6.0-beta.0
14
+
15
+ ### Minor Changes
16
+
17
+ - 5ed2cca: Update `ventojs` to v2
18
+
3
19
  ## 4.5.1
4
20
 
5
21
  ### Patch Changes
@@ -217,7 +233,7 @@
217
233
 
218
234
  While more verbose, this change ensures that there isn't any ambiguity between a tag that needs ignoring and JS negation expressions:
219
235
 
220
- ```hbs
236
+ ```vto
221
237
  <!-- These are functionally equivalent and can lead to collisions in rendering functionality -->
222
238
 
223
239
  {{! conditionStatementToIgnore }}
@@ -339,7 +355,7 @@
339
355
 
340
356
  Of course, the big news is that **paired** shortcodes are now officially supported by this plugin!! Prior to this release, paired shortcodes were exposed just like regular shortcodes, but were plain JS functions. With this release you can now use paired shortcodes just like any other tag.
341
357
 
342
- ```hbs
358
+ ```vto
343
359
  <!-- Before: everything is jammed into the function call :( -->
344
360
  {{ blockquote("<p>Call me Ishmael. Some years ago—never mind how long precisely—having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world.</p>\n<p>It is a way I have of driving off the spleen and regulating the circulation.</p>", "Herman Melville", "1851") }}
345
361
 
@@ -396,7 +412,7 @@
396
412
 
397
413
  Prior to this release this feature was referred to as the "SSR" or "hybrid-rendering" syntax. It's purpose was to skip over processing a tag like Vento's built-in `{{ echo }}` tag, but with a much shorter syntax: `{{! ... }}`. Any code following a `!` in your markup is wrapped in `{{ }}` and output as-is.
398
414
 
399
- ```hbs
415
+ ```vto
400
416
  {{!> console.log('Hello world'); }} <!-- tag remains in output -->
401
417
  ```
402
418
 
package/dist/plugin.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import UserConfig from '@11ty/eleventy/UserConfig';
2
2
  import { LiteralUnion } from 'type-fest';
3
3
  import * as ventojs from 'ventojs';
4
- import { Plugin } from 'ventojs/src/environment.js';
4
+ import { Plugin } from 'ventojs/core/environment.js';
5
5
 
6
6
  interface PluginOptions {
7
7
  /**
package/dist/plugin.js CHANGED
@@ -9,7 +9,8 @@ import createVentoEnv from "ventojs";
9
9
  function createVentoTag(tagInfo) {
10
10
  let LEVEL = 1;
11
11
  const IS_PAIRED = tagInfo.group === "pairedShortcodes";
12
- const tag = (env, code, output, tokens) => {
12
+ const tag = (env, token, output, tokens) => {
13
+ const code = token[1];
13
14
  const match = code === tagInfo.name || code.startsWith(`${tagInfo.name} `);
14
15
  if (!match) {
15
16
  return;
@@ -28,12 +29,8 @@ function createVentoTag(tagInfo) {
28
29
  compiled.push(
29
30
  "{",
30
31
  `let ${nestedVarname} = "";`,
31
- ...env.compileTokens(tokens, nestedVarname, [`/${tagInfo.name}`])
32
+ ...env.compileTokens(tokens, nestedVarname, `/${tagInfo.name}`)
32
33
  );
33
- if (tokens.length > 0 && (tokens[0][0] !== "tag" || tokens[0][1] !== `/${tagInfo.name}`)) {
34
- throw new Error(`Vento: Missing closing tag for ${tagInfo.name} tag: ${code}`);
35
- }
36
- tokens.shift();
37
34
  }
38
35
  args.unshift(thisArg);
39
36
  compiled.push(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eleventy-plugin-vento",
3
- "version": "4.5.1",
3
+ "version": "4.6.0",
4
4
  "description": "Adds support for the Vento templating language to Eleventy.",
5
5
  "type": "module",
6
6
  "engines": {
@@ -37,25 +37,25 @@
37
37
  "license": "MIT",
38
38
  "dependencies": {
39
39
  "debug": "4.4.1",
40
- "ventojs": "1.15.2"
40
+ "ventojs": "2.0.1"
41
41
  },
42
42
  "devDependencies": {
43
43
  "11ty.ts": "0.0.6",
44
44
  "@11ty/eleventy": "3.1.2",
45
- "@changesets/cli": "2.29.5",
46
- "@eslint/js": "9.32.0",
45
+ "@changesets/cli": "2.29.6",
46
+ "@eslint/js": "9.34.0",
47
47
  "@types/debug": "4.1.12",
48
- "@types/node": "22.17.0",
49
- "eslint": "9.32.0",
48
+ "@types/node": "22.18.0",
49
+ "eslint": "9.34.0",
50
50
  "eslint-config-prettier": "10.1.8",
51
- "eslint-plugin-unicorn": "60.0.0",
51
+ "eslint-plugin-unicorn": "61.0.1",
52
52
  "globals": "16.3.0",
53
- "knip": "5.62.0",
53
+ "knip": "5.63.0",
54
54
  "tsup": "8.5.0",
55
- "tsx": "4.20.3",
55
+ "tsx": "4.20.5",
56
56
  "type-fest": "4.41.0",
57
57
  "typescript": "5.9.2",
58
- "typescript-eslint": "8.38.0",
58
+ "typescript-eslint": "8.41.0",
59
59
  "vitest": "3.2.4"
60
60
  },
61
61
  "prettier": {
@@ -66,10 +66,10 @@
66
66
  },
67
67
  "scripts": {
68
68
  "test": "vitest --run",
69
- "check": "pnpm --color run '/^check:/'",
70
- "check:lint": "eslint '.'",
71
- "check:types": "tsc --noEmit",
72
- "check:project": "knip",
69
+ "lint": "pnpm --color run '/^lint:/'",
70
+ "lint:syntax": "eslint '.'",
71
+ "lint:types": "tsc --noEmit",
72
+ "lint:project": "knip",
73
73
  "build": "tsup",
74
74
  "dev": "tsup --watch ./src",
75
75
  "ci:version": "changeset version && pnpm install --no-frozen-lockfile",
package/readme.md CHANGED
@@ -77,7 +77,7 @@ View the [full list of options](https://vento.js.org/configuration/#options/) to
77
77
  > [!NOTE]
78
78
  > Remember, Vento can pipe any JS data type to any built-in global as the first-argument or any `.prototype` method in addition to declared filters. For instance to print the `eleventy` variable as JSON you could use the following snippet:
79
79
  >
80
- > ```nunjucks
80
+ > ```vto
81
81
  > {{ eleventy |> JSON.stringify }}
82
82
  > ```
83
83
  >
@@ -120,13 +120,13 @@ Single and Paired Shortcodes added via Eleventy's `.addShortcode()`, `.addAsyncS
120
120
 
121
121
  When using shortcodes in your templates, write them like any other Vento tag:
122
122
 
123
- ```nunjucks
123
+ ```vto
124
124
  {{ myShortcode }}
125
125
  ```
126
126
 
127
127
  To pass arguments, add a space and your arguments, comma-separated. Arguments are interpreted as JavaScript so type-safety should be considered (quote strings, use booleans if your shortcode expects them, etc.)
128
128
 
129
- ```nunjucks
129
+ ```vto
130
130
  {{ myShortcode 'arg1', 'arg2' }}
131
131
  {{ myBooleanShortcode false, false, true }}
132
132
  {{ myNumberShortcode 10, 20, 0 }}
@@ -135,7 +135,7 @@ To pass arguments, add a space and your arguments, comma-separated. Arguments ar
135
135
 
136
136
  For paired shortcodes, the syntax is the same, just add a closing tag. Paired shortcodes also accept arguments and can re-process nested Vento tags (including other shortcodes).
137
137
 
138
- ```nunjucks
138
+ ```vto
139
139
  {{ codeBlock 'css' }} <!-- takes arguments too -->
140
140
  a {
141
141
  color: red;