Skip to content

Commit

Permalink
fix(tools)!: eleventy 3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
bennypowers committed Oct 11, 2024
1 parent 4799ed8 commit f779095
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
21 changes: 21 additions & 0 deletions .changeset/spicy-islands-yawn.md
Original file line number Diff line number Diff line change
@@ -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);
}
```
3 changes: 0 additions & 3 deletions tools/pfe-tools/11ty/plugins/custom-elements-manifest.cjs
Original file line number Diff line number Diff line change
@@ -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');
Expand All @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion tools/pfe-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit f779095

Please sign in to comment.