eleventy-plugin-vento 2.6.0 → 3.0.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.
Files changed (88) hide show
  1. package/CHANGELOG.md +223 -0
  2. package/LICENSE +1 -1
  3. package/package.json +61 -56
  4. package/readme.md +98 -76
  5. package/src/engine.js +85 -0
  6. package/src/index.js +130 -0
  7. package/src/modules/create-vento-tag.js +56 -0
  8. package/src/modules/ignore-tag.js +15 -0
  9. package/src/modules/utils.js +22 -0
  10. package/.editorconfig +0 -16
  11. package/.github/actions/setup/action.yml +0 -25
  12. package/.github/renovate.json +0 -13
  13. package/.github/workflows/ci.yml +0 -15
  14. package/.github/workflows/release.yml +0 -33
  15. package/.node-version +0 -1
  16. package/.vscode/settings.json +0 -4
  17. package/.vscode/tests.code-snippets +0 -16
  18. package/VentoPlugin.js +0 -140
  19. package/eslint.config.js +0 -67
  20. package/jsconfig.json +0 -11
  21. package/lib/ssr.js +0 -23
  22. package/release.config.js +0 -31
  23. package/tests/autotrim/__snapshots__/autotrim-all.html +0 -53
  24. package/tests/autotrim/__snapshots__/autotrim-single.html +0 -75
  25. package/tests/autotrim/autotrim.test.js +0 -17
  26. package/tests/autotrim/build/autotrim-all.html +0 -53
  27. package/tests/autotrim/build/autotrim-single.html +0 -75
  28. package/tests/autotrim/index.vto +0 -23
  29. package/tests/basic/__snapshots__/template-basic.html +0 -4
  30. package/tests/basic/basic.test.js +0 -9
  31. package/tests/basic/index.vto +0 -7
  32. package/tests/computed-data/__snapshots__/from-local-key.html +0 -4
  33. package/tests/computed-data/computed-data.test.js +0 -9
  34. package/tests/computed-data/from-local-key.vto +0 -9
  35. package/tests/engine-overrides/__snapshots__/as-html-engine.html +0 -4
  36. package/tests/engine-overrides/__snapshots__/as-md-engine.html +0 -2
  37. package/tests/engine-overrides/as-html-engine.html +0 -7
  38. package/tests/engine-overrides/as-md-engine.md +0 -7
  39. package/tests/engine-overrides/eleventy.config.js +0 -4
  40. package/tests/engine-overrides/engine-overrides.test.js +0 -14
  41. package/tests/filters/__snapshots__/filters-arguments.html +0 -1
  42. package/tests/filters/__snapshots__/filters-basic.html +0 -2
  43. package/tests/filters/basic.vto +0 -5
  44. package/tests/filters/eleventy.config.js +0 -13
  45. package/tests/filters/filters.test.js +0 -19
  46. package/tests/filters/with-arguments.vto +0 -1
  47. package/tests/filters/with-this.vto +0 -1
  48. package/tests/get-instance.js +0 -38
  49. package/tests/includes/__snapshots__/includes-basic.html +0 -8
  50. package/tests/includes/__snapshots__/includes-data.html +0 -8
  51. package/tests/includes/_includes/partial.vto +0 -4
  52. package/tests/includes/basic.vto +0 -7
  53. package/tests/includes/includes.test.js +0 -14
  54. package/tests/includes/with-data.vto +0 -7
  55. package/tests/layouts/__snapshots__/example-layout-1.html +0 -27
  56. package/tests/layouts/__snapshots__/example-layout-2.html +0 -24
  57. package/tests/layouts/_includes/layout1.vto +0 -20
  58. package/tests/layouts/_includes/layout2.vto +0 -17
  59. package/tests/layouts/layouts.test.js +0 -14
  60. package/tests/layouts/page1.vto +0 -11
  61. package/tests/layouts/page2.vto +0 -11
  62. package/tests/permalinks/__snapshots__/permalink-nested.html +0 -15
  63. package/tests/permalinks/__snapshots__/permalink-root.html +0 -15
  64. package/tests/permalinks/_includes/layout.vto +0 -13
  65. package/tests/permalinks/at-nested.vto +0 -7
  66. package/tests/permalinks/at-root.vto +0 -7
  67. package/tests/permalinks/dynamic/dynamic-permalink.vto +0 -6
  68. package/tests/permalinks/dynamic/dynamic.11tydata.json +0 -3
  69. package/tests/permalinks/dynamic-js/dynamic-js.11tydata.js +0 -5
  70. package/tests/permalinks/dynamic-js/dynamic-permalink-js.vto +0 -6
  71. package/tests/permalinks/permalinks.test.js +0 -25
  72. package/tests/permalinks/skip.vto +0 -7
  73. package/tests/shortcodes/__snapshots__/shortcode-with-arguments.html +0 -2
  74. package/tests/shortcodes/basic.vto +0 -1
  75. package/tests/shortcodes/eleventy.config.js +0 -4
  76. package/tests/shortcodes/shortcodes.test.js +0 -14
  77. package/tests/shortcodes/with-arguments.vto +0 -2
  78. package/tests/ssr/__snapshots__/ssr-data.html +0 -1
  79. package/tests/ssr/__snapshots__/ssr-echo.html +0 -7
  80. package/tests/ssr/__snapshots__/ssr-exec.html +0 -1
  81. package/tests/ssr/__snapshots__/ssr-for.html +0 -3
  82. package/tests/ssr/__snapshots__/ssr-if.html +0 -5
  83. package/tests/ssr/data.vto +0 -1
  84. package/tests/ssr/echo.vto +0 -7
  85. package/tests/ssr/exec.vto +0 -1
  86. package/tests/ssr/for.vto +0 -3
  87. package/tests/ssr/if.vto +0 -5
  88. package/tests/ssr/ssr.test.js +0 -29
@@ -1,17 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>{{ title }}</title>
7
- </head>
8
- <body>
9
- <header>
10
- <h1>Page title: {{ title }}</h1>
11
- </header>
12
- <main>{{ content }}</main>
13
- <footer>
14
- <p>I am a footer, outside the layout</p>
15
- </footer>
16
- </body>
17
- </html>
@@ -1,14 +0,0 @@
1
- import { expect, test } from 'vitest';
2
- import { runBuild } from '#test-instance';
3
-
4
- const results = await runBuild(import.meta.dirname);
5
-
6
- test('render page with example layout 1', async () => {
7
- const page = results.find(({ url }) => url === '/page1/');
8
- await expect(page.content).toMatchFileSnapshot('./__snapshots__/example-layout-1.html');
9
- });
10
-
11
- test('render page with example layout 2', async () => {
12
- const page = results.find(({ url }) => url === '/page2/');
13
- await expect(page.content).toMatchFileSnapshot('./__snapshots__/example-layout-2.html');
14
- });
@@ -1,11 +0,0 @@
1
- ---
2
- title: Page with layout
3
- layout: layout1.vto
4
- ---
5
-
6
- <p>This is a page that uses the first layout.</p>
7
-
8
- <p>This is another paragraph.</p>
9
- <p>This is another paragraph.</p>
10
- <p>This is another paragraph.</p>
11
-
@@ -1,11 +0,0 @@
1
- ---
2
- title: Page with layout
3
- layout: layout2.vto
4
- ---
5
-
6
- <p>This is a page that uses the second layout.</p>
7
-
8
- <p>This is another paragraph.</p>
9
- <p>This is another paragraph.</p>
10
- <p>This is another paragraph.</p>
11
-
@@ -1,15 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head><title>Nested Page</title></head>
4
- <body>
5
- <header>
6
- <h1>Page title: Nested Page</h1>
7
- </header>
8
- <main>
9
- This content lives at `/page/at/nested/permalink/`
10
- </main>
11
- <footer>
12
- <p>Page footer</p>
13
- </footer>
14
- </body>
15
- </html>
@@ -1,15 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head><title>Root page</title></head>
4
- <body>
5
- <header>
6
- <h1>Page title: Root page</h1>
7
- </header>
8
- <main>
9
- This should render on the homepage.
10
- </main>
11
- <footer>
12
- <p>Page footer</p>
13
- </footer>
14
- </body>
15
- </html>
@@ -1,13 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head><title>{{ title }}</title></head>
4
- <body>
5
- <header>
6
- <h1>Page title: {{ title }}</h1>
7
- </header>
8
- <main>{{ content }}</main>
9
- <footer>
10
- <p>Page footer</p>
11
- </footer>
12
- </body>
13
- </html>
@@ -1,7 +0,0 @@
1
- ---
2
- permalink: /page/at/nested/permalink/
3
- title: Nested Page
4
- layout: layout.vto
5
- ---
6
-
7
- This content lives at `/page/at/nested/permalink/`
@@ -1,7 +0,0 @@
1
- ---
2
- permalink: /
3
- title: Root page
4
- layout: layout.vto
5
- ---
6
-
7
- This should render on the homepage.
@@ -1,6 +0,0 @@
1
- ---
2
- title: Directory data test page
3
- layout: layout.vto
4
- ---
5
-
6
- This page has directory data set with dynamic permalinks
@@ -1,3 +0,0 @@
1
- {
2
- "permalink": "/{{ title |> slugify }}.html"
3
- }
@@ -1,5 +0,0 @@
1
- export default {
2
- permalink({ title }) {
3
- return `${this.slugify(title)}.html`;
4
- },
5
- };
@@ -1,6 +0,0 @@
1
- ---
2
- title: Directory data test page (js)
3
- layout: layout.vto
4
- ---
5
-
6
- This page has directory data set with dynamic permalinks
@@ -1,25 +0,0 @@
1
- import { expect, test } from 'vitest';
2
- import { runBuild } from '#test-instance';
3
-
4
- const results = await runBuild(import.meta.dirname);
5
-
6
- test('render a page at a nested permalink', async () => {
7
- const page = results.find(({ url }) => url === '/page/at/nested/permalink/');
8
- await expect(page.content).toMatchFileSnapshot('./__snapshots__/permalink-nested.html');
9
- });
10
-
11
- test('render a page at root url', async () => {
12
- const page = results.find(({ url }) => url === '/');
13
- expect(page.content).toMatchFileSnapshot('./__snapshots__/permalink-root.html');
14
- });
15
-
16
- test('render a page at a dynamic permalink', async () => {
17
- const page = results.find(({ url }) => url === '/directory-data-test-page.html');
18
-
19
- expect(page).toBeDefined();
20
- });
21
-
22
- test('skips rendering a file', () => {
23
- const writtenTemplates = results.filter(({ url }) => Boolean(url));
24
- expect(writtenTemplates.length).toBe(4);
25
- });
@@ -1,7 +0,0 @@
1
- ---
2
- title: Skipped
3
- layout: layout.vto
4
- permalink: false
5
- ---
6
-
7
- Leave me out of this.
@@ -1,2 +0,0 @@
1
- Release the possums!!!
2
- Release 5 MILLION possums!!!
@@ -1 +0,0 @@
1
- {{ helloWorld() }}
@@ -1,4 +0,0 @@
1
- export default function (eleventyConfig) {
2
- eleventyConfig.addShortcode('helloWorld', () => 'Hello world!');
3
- eleventyConfig.addShortcode('possumPosse', (number = 'the') => `Release ${number} possums!!!`);
4
- }
@@ -1,14 +0,0 @@
1
- import { expect, test } from 'vitest';
2
- import { runBuild } from '#test-instance';
3
-
4
- const results = await runBuild(import.meta.dirname);
5
-
6
- test('shortcode without argument', () => {
7
- const page = results.find(({ url }) => url === '/basic/');
8
- expect(page.content).toBe('Hello world!\n');
9
- });
10
-
11
- test('shortcode with arguments', async () => {
12
- const page = results.find(({ url }) => url === '/with-arguments/');
13
- await expect(page.content).toMatchFileSnapshot('./__snapshots__/shortcode-with-arguments.html');
14
- });
@@ -1,2 +0,0 @@
1
- {{ possumPosse() }}
2
- {{ possumPosse('5 MILLION') }}
@@ -1 +0,0 @@
1
- <p>{{ dynamicValue }}</p>
@@ -1,7 +0,0 @@
1
- {{ echo }}
2
-
3
- {{ dataValue }}
4
-
5
- <p>Some more {{ dataValue }}</p>
6
-
7
- {{ /echo }}
@@ -1 +0,0 @@
1
- {{> console.log('hello world!') }}
@@ -1,3 +0,0 @@
1
- {{ for value of [1,2,3] }}
2
- {{ value }}
3
- {{ /for }}
@@ -1,5 +0,0 @@
1
- {{ if true }}
2
-
3
- <p>Some content</p>
4
-
5
- {{ /if }}
@@ -1 +0,0 @@
1
- <p>{{! dynamicValue }}</p>
@@ -1,7 +0,0 @@
1
- {{! echo }}
2
-
3
- {{! dataValue }}
4
-
5
- <p>Some more {{! dataValue }}</p>
6
-
7
- {{! /echo }}
@@ -1 +0,0 @@
1
- {{!> console.log('hello world!') }}
package/tests/ssr/for.vto DELETED
@@ -1,3 +0,0 @@
1
- {{! for value of [1,2,3] }}
2
- {{! value }}
3
- {{! /for }}
package/tests/ssr/if.vto DELETED
@@ -1,5 +0,0 @@
1
- {{! if true }}
2
-
3
- <p>Some content</p>
4
-
5
- {{! /if }}
@@ -1,29 +0,0 @@
1
- import { expect, test } from 'vitest';
2
- import { runBuild } from '#test-instance';
3
-
4
- const results = await runBuild(import.meta.dirname);
5
-
6
- test('render if', async () => {
7
- const page = results.find(({ url }) => url === '/if/');
8
- await expect(page.content).toMatchFileSnapshot('./__snapshots__/ssr-if.html');
9
- });
10
-
11
- test('render data', async () => {
12
- const page = results.find(({ url }) => url === '/data/');
13
- await expect(page.content).toMatchFileSnapshot('./__snapshots__/ssr-data.html');
14
- });
15
-
16
- test('render for', async () => {
17
- const page = results.find(({ url }) => url === '/for/');
18
- await expect(page.content).toMatchFileSnapshot('./__snapshots__/ssr-for.html');
19
- });
20
-
21
- test('render echo', async () => {
22
- const page = results.find(({ url }) => url === '/echo/');
23
- await expect(page.content).toMatchFileSnapshot('./__snapshots__/ssr-echo.html');
24
- });
25
-
26
- test('render exec', async () => {
27
- const page = results.find(({ url }) => url === '/exec/');
28
- await expect(page.content).toMatchFileSnapshot('./__snapshots__/ssr-exec.html');
29
- });