- 2910260: Update changesets version
- d2cd76d: Test Runner: prevent config exception when lightdom shims are present
-
f779095: Removes
EleventyRenderPlugin
from custom-elements-manifest 11ty plugin config. Ensure you add it yourself.Before:
module.exports = function (eleventyConfig) { eleventyConfig.addPlugin(CustomElementsManifestPlugin); };
After:
import { EleventyRenderPlugin } from "@11ty/eleventy"; // 3.0.0 only export default function (eleventyConfig) { eleventyConfig.addPlugin(CustomElementsManifestPlugin); eleventyConfig.addPlugin(EleventyRenderPlugin); }
- 4a03ced: SSR: add shim for
ResizeObserver
- 921e5d5: TypeScript CSS Import Transforms: allow importing from bare specifiers
-
1ca3515: Custom Elements Manifest: Removed support for non-standard inline
{@default value}
JSDoc tags. Use standard syntax insteadBefore:
/** * @cssprop --foo {@default bar} Foo */
After:
/** * @cssprop [--foo=bar] Foo */
-
c9bd577: Custom Elements Manifest: added
custom-elements-manifest.js
, which exports the functiongetAllManifests
import { getAllManifests } from "@patternfly/pfe-tools/custom-elements-manifest/custom-elements-manifest/.js"; for (const manifest of getAllManifests()) { const packageName = manifest.packageJson?.name ?? "package"; console.log( `Available Elements in ${packageName}`, ...manifest.getTagNames() ); }
-
c9bd577:
a11ySnapshot
: Added chai assertions for various accessibility-tree scenariosExamples:
describe("<pf-accordion>", function () { beforeEach(() => fixture(html` <pf-accordion> <pf-accordion-header id="header1">header-1</pf-accordion-header> <pf-accordion-panel>panel-1</pf-accordion-panel> </pf-accordion> `) ); describe("clicking the first heading", function () { beforeEach(clickFirstHeading); it("expands the first panel", async function () { expect(await a11ySnapshot()).to.axContainName("panel-1"); }); it("focuses the first panel", async function () { expect(await a11ySnapshot()).to.have.axTreeFocusOn( document.getElementById("header1") ); }); it("shows the collapse all button", async function () { expect(await a11ySnapshot()).to.axContainRole("button"); }); }); });
-
c9bd577: Added
querySnapshot
accessibility testing helperdescribe("then clicking the toggle", function () { beforeEach(async function () { await clickElementAtCenter(toggle); }); it("expands the disclosure panel", async function () { const snapshot = await a11ySnapshot(); const expanded = querySnapshot(snapshot, { expanded: true }); expect(expanded).to.be.ok; }); });
-
c9bd577: TypeScript: Add static version transformer. This adds a runtime-only static
version
field to custom element classes.import "@patternfly/elements/pf-button/pf-button.js"; const PFE_VERSION = await customElements .whenDefined("pf-button") .then((PfButton) => PfButton.version);
- c9bd577: updated dependencies
- 9d68f3d: Dev Server: load lightdom shim files
- 9d68f3d: Dev Server: reload on typescript file changes
- f3f68c9: Windows compatibility for various tools packages
- c9bd577: Dev Server: use last modified time for the dev server cache
- c9bd577: Test Runner Config: import the production version of Lit for tests, reducing console chatter during test runs
- aca8409: React: ensure that only classes which are exported get wrapped
- c57c5dd: Dev Server: redirect demo links to css lightdom subresources
- 9995136: React: corrected syntax error in some generated modules
- d50a651: Dev Server: update icon and theme colours
- 65079fb: Update typescript types
-
de4cfa4: Remove
DocsPage
render functions -
de4cfa4: Dev server config no longer uses
nodeResolution
. Instead you must provide configuration for the import map plugin.import { pfeDevServerConfig, getPatternflyIconNodemodulesImports, } from "@patternfly/pfe-tools/dev-server/config.js"; export default pfeDevServerConfig({ importMapOptions: { providers: { "zero-md": "nodemodules", "@patternfly/icons": "nodemodules", "@patternfly/elements": "nodemodules", "@patternfly/pfe-tools": "nodemodules", "@patternfly/pfe-core": "nodemodules", }, inputMap: { imports: { ...(await getPatternflyIconNodemodulesImports(import.meta.url)), }, }, }, });
-
de4cfa4: Remove react and vue test wrapper helpers. Use React wrapper components instead.
- 502e931: React wrapper generator: add parameters to support different packages
- e6ca914: Update dependencies
- fd1202d:
typescript/css-imports
: prevent shared css modules from being inlined to files; emit them instead. - 22d7536: Update typescript version
- 50f462c: Update dependencies, including Lit version 3
- 57b7dba20: Test: add
clickElementAtOffset
utility function for tests - dcdbce66d: Test: add
clickElementAtCenter
utility function for tests
- 91850fbf8: fixed TypeScript typings for react wrappers
- 1924229ea: Generate TypeScript typings for React wrapper components
-
f4a7ae7d7: React: adds
@patternfly/pfe-tools/react/generate-wrappers.js
Use this to generate React component wrappers for Lit custom elements, based on their
custom-elements.json
manifest.import { generateReactWrappers } from "@patternfly/pfe-tools/react/generate-wrappers.js"; const inURL = new URL("../elements/custom-elements.json", import.meta.url); const outURL = new URL("../elements/react/", import.meta.url); await generateReactWrappers(inURL, outURL);
- 699a812bf:
11ty
: prevent duplicate IDs on code pages when multiple elements are documented
- cdd1d4232:
DocsPage
: renders headings as markdown (PR) - d7dd0353b:
dev-server
: Corrects aliased elements redirects
- d5c6c199f: Dev Server: fixes
*-lightdom.css
support in config
-
4832b29ab: Test Helpers: Added
allUpdates
test helper, which waits until an element completely finishes updating.const element = await fixture(html`<my-el></my-el>`); await allUpdates(element);
- a4c20b70d: Dev Server: updates router to use project subpath configuration
- 69e7f5b9e: Added
site.componentSubpath
config to.pfe.config.json
, representing the site subpath for component pages and demos. Default is'components'
.
- 90b3ade12: Removes special characters from component slugs ie.
special (characters)
becomesspecial-characters
-
79f30b8f6:
11ty/plugins/custom-elements-manifest.cjs
: addedrenderTitleInOverview
option, a boolean flag which defaults totrue
.When true, this option renders an
<h1>
in the element's docs page's "Overview" section.Note: the next major release will switch this option to
false
by default, so to prepare your docs pages, add your own headings:BEFORE:
{% renderOverview %} <pf-jazz-hands></pf-jazz-hands> {% endrenderOverview %}
AFTER:
<section class="band"> <h1 id="jazz-hands">Jazz Hands</h1> </section> {% renderOverview %} <pf-jazz-hands></pf-jazz-hands> {% endrenderOverview %}
- cfc5913c6:
pfe-tools
:- Updated dev server header styles to match look and feel of 11ty documentation site
- Added
repoHost
toPfeConfig
which enables customizing the dev server repository host name and icon
-
d01c7e067: Removed and deprecated esbuild and cem/a features
- ❌ Removed esbuild helpers
- 💱 Moved custom-elements-manifest config helper to
custom-elements-manifest/config.js
- 💱 Moved dev-server config helper to
dev-server/config.js
- 💱 Moved test-runner config helper to
test-runner/config.js
⚠️ Deprecated custom-elements-manifest helpers
-
c76a65b93: ✨ Added
minify
option to@patternfly/pfe-tools/typescript/transformers/css-imports.cjs
-
99db432f4: ✨ Added
anchors
11ty plugin, based on @orchidjs/eleventy-plugin-ids -
d4a99f6c2: ✨ Added
@patternfly/pfe-tools
package-
✨ Added dev server and test runner configs
-
✨ Added custom-elements-manifest analyzer configs and plugins
-
✨ Added typescript transform to inline css imports
-
✨ Added 11ty plugins to render custom element manifests, etc.
-
✨ Added test helpers like
a11ySnapshot
-
✨ Added
Logger
stub for quieter tests -
✨ Added
colored(colorString)
assertion to chai when usingcreateFixture
expect("rgba(0,0,0,0)").to.be.colored("transparent");
-
✨ Added an optional unified config file for custom elements manifest, dev server, and docs pages
Create a
.pfe.config.json
file at the root of your project to customize the pfe tools builds.The default values are:
{ "tagPrefix": "pfe", "demoURLPrefix": "https://patternflyelements.org/", "sourceControlURLPrefix": "https://github.com/patternfly/patternfly-elements/tree/main/", "aliases": {}, "site": { "title": "PatternFly Elements", "description": "PatternFly Elements: A set of community-created web components based on PatternFly design.", "favicon": "/brand/logo/svg/pfe-icon-blue.svg", "logoUrl": "/brand/logo/svg/pfe-icon-white-shaded.svg", "stylesheets": [] } }
See
@patternfly/pfe-tools/config.d.ts
for more information.
-
- 0a22a3375:
dev-server
: refresh element css when files change - 3ab1de179: Allowed TypeScript modules to import multiple CSS modules when inlining CSS.
- f03a41941: 11ty plugin: calculate path to demo files in more circumstances
- 42d5cd9fb:
a11ySnapshot
: fixed typescript types - 5d3315fd4: Prepared release candidate
- b3b472ef6: update 11ty
- 3035d9163: analyzer: find demos in different repo setups
- 66b025d86: dev-server: fixed demo script import and styles
- 0a22a3375:
dev-server
: refresh element css when files change - f03a41941: 11ty plugin: calculate path to demo files in more circumstances
- 42d5cd9fb:
a11ySnapshot
: fixed typescript types
- b3b472ef6: update 11ty
- 66b025d86: dev-server: fixed demo script import and styles
- 3035d9163: analyzer: find demos in different repo setups
- c76a65b93: ✨ Added
minify
option to@patternfly/pfe-tools/typescript/transformers/css-imports.cjs
- 3ab1de179: Allowed TypeScript modules to import multiple CSS modules when inlining CSS.
- 99db432f4: ✨ Added
anchors
11ty plugin, based on @orchidjs/eleventy-plugin-ids
-
d01c7e067: Removed and deprecated esbuild and cem/a features
- ❌ Removed esbuild helpers
- 💱 Moved custom-elements-manifest config helper to
custom-elements-manifest/config.js
- 💱 Moved dev-server config helper to
dev-server/config.js
- 💱 Moved test-runner config helper to
test-runner/config.js
⚠️ Deprecated custom-elements-manifest helpers
- 5d3315fd: Prepared release candidate
-
457eaa9d0:
pfe-tools
: Set typescript compilerOptionscomposite: true
pfe-tooltip
: Added return type for anonymous function for content in constructor
- 6369ee00d: load elementinternals polyfill in dev server
- fb96c92ed: Added
disabled
property to a11y snapshot type - b841afe40: tools: made
a11ySnapshot
helper a bit more ergonomic - 0fe6c52db: Added constructible stylesheets polyfill to dev server
- b841afe40: tools: fixed demo server hamburger buttons
- d47ecddf: Added
A11ySnapshot
type to pfe-tools
- 8294d385: Fixed package publishing automation scripts.
- 6b6e2617: Updates use of pfe-button
- fcdcc274: Removing pfe-page-status
- 0ef73073: Removing pfe-collapse
- 4400866a: Adds a11y tree testing to test runner config
- 9d10155b: Update element internals polyfill, fixes clicking on label in safari
- 4400866a: update dependencies
- daba8a53: Changing from pfe-datetime to pfe-timestamp
- 07ad1d3d: Adds testing utilities to stub Logger methods
- b1c439d5: Removed esbuild target configuration relying on tsconfig.json for configuration options.
- dcb85646: Adds tsconfig option to dev server config
- 4ccd1ff8: Adds
deslugify
function to config module Fixes demo manifest utility functions - gets the correct path by deslugifying the demo url.
- 29c0b6cd: Update the TS target in dev server
- eeebb45d: Replace
<pfe-progress-indicator>
with<pfe-spinner>
-
3f0c6ca2: Adds an optional unified config file for custom elements manifest, dev server, and docs pages
Create a
.pfe.config.json
file at the root of your project to customize the pfe tools builds.The default values are:
{ "tagPrefix": "pfe", "demoURLPrefix": "https://patternflyelements.org/", "sourceControlURLPrefix": "https://github.com/patternfly/patternfly-elements/tree/main/", "aliases": {}, "site": { "title": "PatternFly Elements", "description": "PatternFly Elements: A set of community-created web components based on PatternFly design.", "favicon": "/brand/logo/svg/pfe-icon-blue.svg", "logoUrl": "/brand/logo/svg/pfe-icon-white-shaded.svg", "stylesheets": [] } }
See
@patternfly/pfe-tools/config.d.ts
for more information.
- bfad8b4b: Updates dependencies
- bfad8b4b: fix local module resolution in dev server
- a423b010: fix typescript config and update dependencies
- bfad8b4b: dev server: Resolve local elements from their source files
- c625b329: Store nav state
- a44b5484: Serve changes to TypeScript sources
- 58fe3a75: Include dev server webfonts in npm tarball
- 4ff704d4: Add html template to npm tarball
- 654a9489: Remove
githubUrl
site option - uses sourceControlPrefixURL instead - e3de6bde: Adds
site.stylesheets
option to dev server config. REMOVESsite.tagPrefix
option in favor oftagPrefix
option
- 017bcb52: Fixes use of custom elements manifest and related 11ty plugins in daughter repos
- c2f867fd: Rename cssCustomPropertyDefaultPlugin to jsdocDescriptionDefaultPlugin and render colour swatches on docs site
-
fce3a836: Allow for multiple demos.
Elements can now have multiple demos, and the demos now load their scripts using script tags, instead of inlining them via nunjucks using filename conventions.
BREAKING CHANGES: dev server urls now use
/components
instead of/demo
-
fce3a836: Adds demo plugin for custom-elements-manifests
-
05a4fab9: Add custom-elements-manifest plugins to mark ECMAScript private fields and to read the version number from package.json
- 921e7999: Remove pfe-specific styles from demo pages
-
b8da03e8:
singleFileBuild
now scansnode_modules
for installed@patternfly/pfe-*
packages (exceptcore
,tools
,sass
, andstyles
) and generates an entrypoint file for them.Users can alternatively pass
componentsEntryPointsContent
, which is the string contents of a javascript module that exports the desired components.These changes make using
singleFileBuild
more useful and ergonomic for daughter repositories (e.g. RHDS)const elements = await readdir(new URL("../elements", import.meta.url)); /** * @example * export * from '/path/to/redhat-ux/red-hat-design-system/elements/rh-alert/rh-alert.js'; * export * from '/path/to/redhat-ux/red-hat-design-system/elements/rh-table/rh-table.js'; */ const componentsEntryPointContents = elements.reduce( (acc, x) => `${acc} export * from '${fileURLToPath( new URL(`../elements/${x}/${x}.js`, import.meta.url) )}';`, "" ); await singleFileBuild({ componentsEntryPointContents, outfile: "rhds.min.js", });
- f2ffb072: pass user options to dev server
- d7128af3: Use declarative shadow DOM for dev server, remove SPA code, calculate demo variables on the server side
-
2b2aeb57: Adds
colored(colorString)
assertion to chai when usingcreateFixture
expect("rgba(0,0,0,0)").to.be.colored("transparent");
-
15051be0: Use web-dev-server-plugin-lit-css. By default, config will transform all .scss files using
dart-sass
. Users may customize the options for lit-css:export default pfeDevServerConfig({ litcssOptions: { include: ["**/elements/*/*.css"], }, });
- 4a597fed: Add package exports for test helpers
- b4ac6f24: Updates dependencies
- b595cafb: corrects passing options to
nunjucksSPAMiddleware(_options)
for repo demo configuration
- bb5b6265: Add
additionalPackages
option tosingleFileBundle
- effe009a: Adds a maximize toggle to the dev SPA
- 4997735b: update dependencies
- c10f6783: Publish 11ty plugin files
- 621fcb38: Adds table-of-contents 11ty plugin Fixes bugs in 11ty plugins
- cd04ae82: Adds 11ty plugins to pfe-tools
- dd9b1128: Include dev server assets in the package bundle
- 9a957683: Moves development server wholly into pfe-tools, and exposes some customization properties so daughter repos can customize the page
- 6c39715c: Automatically replaces
process.env.NODE_ENV
withproduction
both in the development server and in the production bundles.
- f1e4d5a9: Correctly resolve all node_modules sources in dev server
-
447b2d75: Remove support for custom
esbuild
export conditionPreviously, the dev-server config would try to import typescript sources using the
esbuild
export condition, but this proved awkward when daughter repos would try to import the same packages by the esbuild condition, only to discover that there was no typescript source file because it was compiled away before hitting NPMTherefore, removed export conditions entirely and now rely on a hacky mod to the built-in web dev server node-resolution algorithm
In our tests, this appeared to work in both primary cases:
- Developing local packages in
patternfly/patternfly-elements
- Developing local packages in a 'daughter' repo which installed
@patternfly/pfe-tools
If you find that you're getting 404 errors to modules you're sure exist, or other such weird behaviour when resolving js sources from your monorepo, please open a new issue
- Developing local packages in
- f26d5ab5: fail gracefully when dev server can't find workspace packages
- f71bfa9c: update dependencies
- b5d40799: try to guess repository root dir when computing dev server config
- f726d147: Add
reporter
option to test runner config factory
- d9df3236: Update dependencies
- 0f235f7e: Update documentation
- 049aaca6: Update dependencies
- cd6ca2f0: minify lit-html template literals in builds
- a6253d3c: Generate the single-file bundle entrypoint at runtime
- cfd010ff: add
singleFileBuild
to esbuild helpers
- cbf0c490: Update dependencies
- a1da0422: export
transformSass
helper from esbuild.js
- 9765268c: Ship built files instead of sources