eleventy-plugin-vento 4.1.1-beta.0 → 4.2.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,55 @@
1
1
  # eleventy-plugin-vento
2
2
 
3
+ ## 4.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - fc6aa07: Update `ventojs` to 1.12.16
8
+
9
+ ### Patch Changes
10
+
11
+ - 02d75fd: Adjust `nestedVarname` for Eleventy-provided shortcodes so that conflicts in internal template variable names are less likely. Should not have significant impact on builds.
12
+ - 12e04fe: Made `DEBUG` messages regarding whether Eleventy or Vento was caching a template more verbose
13
+
14
+ ## 4.1.1
15
+
16
+ ### Patch Changes
17
+
18
+ - 335f21e: Select type updates (shouldn't affect compilation, however should improve DX)
19
+
20
+ Changes are:
21
+
22
+ - split types into separate files
23
+ - namespace `ventojs` type imports
24
+ - make `PluginOptions` optional by default
25
+ - make Eleventy types more readable
26
+ - declare a special (`EleventyVentoEnvironment`) for this plugin to replace Vento's own `Environment`
27
+
28
+ - 070109a: Refactored files and functions internally that shouldn't have any impact on usage or performance:
29
+
30
+ - Split `debug` functions into separate exports, renamed `runCompatiblityCheck -> compatibilityCheck` (dd4c379b)
31
+ - Utilities are now split into separate files (e06a83ab)
32
+ - Main file renamed from `index.ts` to `plugin.ts` (1b122d2a)
33
+
34
+ - c382be0: Wrap all filters as regular synchronous functions to avoid ambiguity with sync and async handling. (fixes #96)
35
+
36
+ This change enforces explicit use of the `await` keyword to unwrap returned values from filters before chaining more or printing the result.
37
+
38
+ ```diff
39
+ <!-- Single filters -->
40
+ - {{ "Hello, async!" |> someAsyncFilter }}
41
+ + {{ "Hello, async!" |> await someAsyncFilter }}
42
+
43
+ <!-- Filter chains -->
44
+ - {{ "Hello, async!" |> someAsyncFilter |> someSyncFilter }}
45
+ + {{ "Hello, async!" |> await someAsyncFilter |> someSyncFilter }}
46
+ ```
47
+
48
+ See the [Vento docs on async chains](https://vento.js.org/syntax/pipes/#chain-pipes) for more information.
49
+
50
+ - 9eaa059: Update `debug` to v4.4.0
51
+ - 0b0f96a: Update ventojs to v1.12.14
52
+
3
53
  ## 4.1.1-beta.0
4
54
 
5
55
  ### Patch Changes
package/dist/plugin.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { UserConfig } from '@11ty/eleventy';
1
+ import UserConfig from '@11ty/eleventy/UserConfig';
2
2
  import { LiteralUnion } from 'type-fest';
3
3
  import * as ventojs from 'ventojs';
4
4
  import { Plugin } from 'ventojs/src/environment.js';
package/dist/plugin.js CHANGED
@@ -7,8 +7,8 @@ import createVentoEnv from "ventojs";
7
7
 
8
8
  // src/utils/create-vento-tag.ts
9
9
  function createVentoTag(tagInfo) {
10
+ let LEVEL = 1;
10
11
  const IS_PAIRED = tagInfo.group === "pairedShortcodes";
11
- let INT = 0;
12
12
  const tag = (env, code, output, tokens) => {
13
13
  if (!code.startsWith(tagInfo.name)) return;
14
14
  const { dataVarname } = env.options;
@@ -20,7 +20,7 @@ function createVentoTag(tagInfo) {
20
20
  const args = [code.replace(tagInfo.name, "").trim()];
21
21
  const compiled = [];
22
22
  if (IS_PAIRED) {
23
- const nestedVarname = `__arg${INT++}`;
23
+ const nestedVarname = `__content${output.startsWith("__content") ? LEVEL++ : 0}`;
24
24
  args.unshift(env.compileFilters(tokens, nestedVarname, env.options.autoescape));
25
25
  compiled.push(
26
26
  "{",
@@ -45,7 +45,7 @@ function createVentoTag(tagInfo) {
45
45
  return compiled.join("\n");
46
46
  };
47
47
  return Object.defineProperty(tag, "name", {
48
- value: tagInfo.name + IS_PAIRED ? `PairedTag` : `Tag`
48
+ value: `${tagInfo.name}_${IS_PAIRED ? `EleventyPairedTag` : `EleventyTag`}`
49
49
  });
50
50
  }
51
51
 
@@ -67,10 +67,9 @@ function createVentoEngine(options) {
67
67
  }
68
68
  function loadFilters(filters) {
69
69
  for (const [name, fn] of Object.entries(filters)) {
70
- env.filters[name] = async function(...args) {
70
+ env.filters[name] = function(...args) {
71
71
  const { page, eleventy } = this.data;
72
- const filterResult = await fn.apply({ ...this, page, eleventy }, args);
73
- return filterResult;
72
+ return fn.apply({ ...this, page, eleventy }, args);
74
73
  };
75
74
  }
76
75
  }
@@ -95,12 +94,11 @@ function createVentoEngine(options) {
95
94
  } else {
96
95
  template = env.compile(source, file);
97
96
  debugCache(
98
- `Cache MISS for \`%s\`, compiled new template:
99
- Use Vento cache: %o
97
+ `Cache MISS for \`%s\`, compiled new template; %s
100
98
 
101
99
  ${template}`,
102
100
  file,
103
- useVentoCache
101
+ useVentoCache ? "let Vento cache result" : "defer result caching to Eleventy"
104
102
  );
105
103
  if (useVentoCache) {
106
104
  env.cache.set(file, template);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eleventy-plugin-vento",
3
- "version": "4.1.1-beta.0",
3
+ "version": "4.2.0",
4
4
  "description": "Adds support for the Vento templating language to Eleventy.",
5
5
  "type": "module",
6
6
  "engines": {
@@ -37,26 +37,28 @@
37
37
  "license": "MIT",
38
38
  "dependencies": {
39
39
  "debug": "4.4.0",
40
- "ventojs": "1.12.13"
40
+ "ventojs": "1.12.16"
41
41
  },
42
42
  "devDependencies": {
43
43
  "11ty.ts": "0.0.5",
44
- "@11ty/eleventy": "3.0.0",
45
- "@changesets/cli": "2.27.10",
46
- "@eslint/js": "9.16.0",
44
+ "@11ty/eleventy": "3.0.1-alpha.5",
45
+ "@changesets/cli": "2.28.1",
46
+ "@eslint/js": "9.22.0",
47
47
  "@types/debug": "4.1.12",
48
48
  "@types/eslint-config-prettier": "6.11.3",
49
- "@types/eslint__js": "8.42.3",
50
- "@types/node": "22.10.1",
51
- "eslint": "9.16.0",
52
- "eslint-config-prettier": "9.1.0",
53
- "eslint-plugin-unicorn": "56.0.1",
54
- "globals": "15.13.0",
55
- "tsup": "8.3.5",
56
- "type-fest": "4.30.0",
57
- "typescript": "5.7.2",
58
- "typescript-eslint": "8.18.0",
59
- "vitest": "2.1.8"
49
+ "@types/node": "22.13.10",
50
+ "eslint": "9.22.0",
51
+ "eslint-config-prettier": "10.1.1",
52
+ "eslint-plugin-unicorn": "57.0.0",
53
+ "globals": "16.0.0",
54
+ "nano-spawn": "0.2.0",
55
+ "picocolors": "1.1.1",
56
+ "tsup": "8.4.0",
57
+ "tsx": "4.19.3",
58
+ "type-fest": "4.37.0",
59
+ "typescript": "5.8.2",
60
+ "typescript-eslint": "8.26.1",
61
+ "vitest": "3.0.8"
60
62
  },
61
63
  "prettier": {
62
64
  "bracketSameLine": true,
@@ -73,6 +75,7 @@
73
75
  "dev": "tsup --watch ./src",
74
76
  "ci:version": "changeset version && pnpm install --no-frozen-lockfile",
75
77
  "ci:publish": "changeset publish",
78
+ "ci:generate-renovate-changesets": "tsx .github/scripts/renovate-changesets.ts",
76
79
  "format": "pnpm dlx prettier --config ./package.json --write ."
77
80
  }
78
81
  }