Skip to the content

Upgrade

Move Pattern Dump to a new version: the exact npm version your project pins, what to read first, and what changed in 0.9, 0.8.2, 0.8.1, 0.8 and 0.7.

pd init pins pattern-dump to the exact version that ran it, 0.9.0 with no ^. A new release never arrives on its own: your project changes version when you move the pin, and only then.

Move the pin

Read the release's upgrade notes first: a release's entry in Releases starts with what to change when you come from the release before, under "Upgrading from". The sections below sum up the last five.

Then install the new version, exactly, in the project folder:

npm install --save-dev --save-exact pattern-dump@<version>

<version> is the release, such as 0.9.0, and --save-exact keeps the pin exact in package.json. In a repository with a style guide and a site as two projects, as in a site on a style guide, move the pin in both.

Restart pd dev, and run the audit and the build:

npm run audit
npm run build

A release can check more than the one before. An audit or a build that passed can fail after an upgrade, in CI too, and the messages say what to change.

Upgrading to 0.9

0.9.0 asks one change of a site: a global named workbenchUrl is now a config problem.

"site.globals.workbenchUrl": templates get site.workbenchUrl from Pattern Dump (site.workbenchUrl, or pd dev's own workbench): remove this global and use site.workbenchUrl

Pattern Dump now gives templates site.workbenchUrl itself: the configured address in pd build, and its own workbench in pd dev. Remove the global and keep site.workbenchUrl in the config. A template that read the global reads the same name, so it needs no change.

Two things look different in the workbench. The Relationships tab's "Style uses" is now "Borrows classes from", and the Nav Rail is at least 19.75rem wide, to hold the full-height button in the viewport row. A class that an assets.css file or a template's <style> defines is no longer listed as one no stylesheet defines.

Upgrading to 0.8.2

0.8.2 fixes three things and needs no change to your project. A pd- tag can go over several lines, and a fence or inline code in a tag's content can show a pd- tag as code (Placed components). A style guide's pd build writes the images that {{pd-image}} places in its previews and docs.

Upgrading to 0.8.1

Sample data stays in the workbench

A component's sample .json no longer reaches a site page. On a page, a component gets only what it is given, its template's defaults (defaultValue) and the global data; the workbench, its previews and a page's live examples show it with its sample data as before. The checks that kept sample keys off the pages went with it, so sample data may set any key, and a header or footer in the frame can have sample data of its own. Layouts has the details.

Helpers need their arguments

A helper called with too few arguments now fails the render and names itself, such as defaultValue needs 2 arguments, got 1, and and and or refuse a third. A template that showed [object Object], or relied on a comparison quietly being false, fails until you give the helper its arguments.

axe-core 4.11.4, exactly

The package depends on axe-core 4.11.4 and jsdom 27.4.0 exactly. With another axe-core installed, pd dev, pd build and pd audit stop and name the version to install.

Reports in your cache folder

The audit report, the diagnostics graph and the other reports moved from the system's temporary folder to your own cache folder. Run pd audit has the paths.

The build refuses more output folders

--out and site.outDir are checked against everything Pattern Dump reads, the data and scripts folders, the helpers and the site's head file among them. A build whose output overlaps one of them stops, naming it.

pd --version

pd --version and pd -v print the version installed in the project.

Upgrading to 0.8

storefront is now site

The part of Pattern Dump that builds a website is called the site, and the config follows. The key storefront is now site, with the same keys inside, except one: the values every page shares, storefront.site, are now site.globals. Layouts still read them as {{site.…}}.

Before:

export default defineConfig({
  storefront: {
    pagesDir: "./pages",
    site: {
      title: "Acme",
    },
  },
});

After:

export default defineConfig({
  site: {
    pagesDir: "./pages",
    globals: {
      title: "Acme",
    },
  },
});

A config with the old names still loads, read as the new ones, with a warning per key, such as [pd] warning: <config file>: storefront.site is now site.globals. Both names at once is a problem, and the only one reported: both "site" and "storefront" are set: storefront is the old name of site, keep site only. The old names load until 1.0, which removes them.

The same goes for pd init: --storefront is now --with-site and --no-storefront is --without-site. The old flags still work until 1.0, and pd init first prints which flag each is now, such as ! --storefront is now --with-site.

Messages follow too: they name site.*, and terminal lines about site pages start with [site], where they started with [storefront].

The config's types are named Site…, such as SiteConfig. Each Storefront… name is a deprecated alias of the same type, removed in 1.0, except StorefrontConfig: it is the shape of the old storefront key, with its globals under site.

Code colours on site pages

Highlighted code now carries a class per kind of token, pd-code-<kind>, in place of generated classes such as __shiki_17h8wv. Pattern Dump links /_pd/code.css into every site page that shows code, and a site sets the colours from its own tokens with the --pd-code-<kind> custom properties. /_pd/shiki.css no longer holds token colours: a site that linked it for them links /_pd/code.css instead, or nothing, since Pattern Dump links it.

The audit checks every variant

pd audit, the Audit tab and the audit in pd build now check every variant under its own id, and a component a handle collision left out of the tree is an entry with a HANDLE_COLLISION error. Each variant also counts in a rule's blast radius. An audit that passed in 0.7 can fail in 0.8, and check your work shows how to read it.

Upgrading to 0.7

Component metadata comes from the frontmatter only

A component's .md sets its title, description, status, requireScript and the other keys only in the --- block at its top. A key: line in the body, or in a file without the block, is text now and sets nothing. A quoted value loses its quotes.

requireScript takes a list

Several scripts are one list:

---
requireScript: [toggle, menu]
---

Repeating the requireScript: line no longer adds a script: only the last line counts.

A data variant without a template is reported

A <name>~<variant>.json with no <name>.hbs to overlay is left out, as before, and is now reported: pd dev names it in the terminal and the Console, where it was dropped without a word.

pd build replaces its output at the end

pd build writes into a hidden folder beside each output and replaces the output only when every check has passed. A build that stops leaves the earlier output as it was.

Before 0.7

The upgrade notes for 0.6 and earlier are in their releases' entries, from 0.6.0 on down.

Up to date

The pin is on the new version, the audit and the build pass, and the next release's notes say what changes after that.