From f77909583384b38abde273888dcb04842613fe65 Mon Sep 17 00:00:00 2001 From: Benny Powers Date: Fri, 11 Oct 2024 15:11:09 +0300 Subject: [PATCH] fix(tools)!: eleventy 3 support --- .changeset/spicy-islands-yawn.md | 21 +++++++++++++++++++ .../11ty/plugins/custom-elements-manifest.cjs | 3 --- tools/pfe-tools/package.json | 2 +- 3 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 .changeset/spicy-islands-yawn.md diff --git a/.changeset/spicy-islands-yawn.md b/.changeset/spicy-islands-yawn.md new file mode 100644 index 0000000000..52fd1351ff --- /dev/null +++ b/.changeset/spicy-islands-yawn.md @@ -0,0 +1,21 @@ +--- +"@patternfly/pfe-tools": major +--- +Removes `EleventyRenderPlugin` from custom-elements-manifest 11ty plugin config. Ensure you add it yourself. + +Before: + +```js +module.exports = function(eleventyConfig) { + eleventyConfig.addPlugin(CustomElementsManifestPlugin); +} +``` + +After: +```js +import { EleventyRenderPlugin } from '@11ty/eleventy'; // 3.0.0 only +export default function(eleventyConfig) { + eleventyConfig.addPlugin(CustomElementsManifestPlugin); + eleventyConfig.addPlugin(EleventyRenderPlugin); +} +``` diff --git a/tools/pfe-tools/11ty/plugins/custom-elements-manifest.cjs b/tools/pfe-tools/11ty/plugins/custom-elements-manifest.cjs index 03b4fee93e..c7465d8db5 100644 --- a/tools/pfe-tools/11ty/plugins/custom-elements-manifest.cjs +++ b/tools/pfe-tools/11ty/plugins/custom-elements-manifest.cjs @@ -1,5 +1,4 @@ // @ts-check -const { EleventyRenderPlugin } = require('@11ty/eleventy'); const { join } = require('node:path'); const { existsSync } = require('node:fs'); const { glob } = require('glob'); @@ -13,8 +12,6 @@ const isDir = dir => stat(dir).then(x => x.isDirectory, () => false); * @param {import('./types').PluginOptions} pluginOpts */ module.exports = function configFunction(eleventyConfig, pluginOpts = {}) { - eleventyConfig.addPlugin(EleventyRenderPlugin); - eleventyConfig.addGlobalData('env', () => process.env); eleventyConfig.addGlobalData('demos', async function demos() { diff --git a/tools/pfe-tools/package.json b/tools/pfe-tools/package.json index 9d197221c4..bdb26d9ab6 100644 --- a/tools/pfe-tools/package.json +++ b/tools/pfe-tools/package.json @@ -63,7 +63,7 @@ "**/*.{js,cjs,d.ts,map}" ], "peerDependencies": { - "@11ty/eleventy": "^2.0.1", + "@11ty/eleventy": "^2.0.1 || ^3.0.0", "@11ty/eleventy-plugin-directory-output": "^1.0.1", "@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0", "@changesets/cli": "^2.27.1",