v0.32.0
Overview
This new minor release v0.32.0, in addition to misc enhancements and bug fixes, adds built-in support for TypeScript and introduces an adapter for AWS. There was also a minimum NodeJS version bump and upgrade WCC to v0.17.0. Read more in our release blog post.
# npm
$ npm i -D @greenwood/cli@latest
# Yarn 1.x (classic)
$ yarn upgrade @greenwood/cli@latest --dev
# pnpm
$ pnpm i -D @greenwood/cli@latestChangelog
https://github.com/ProjectEvergreen/greenwood/issues?q=label%3Av0.32.0
- bump to minimum NodeJS
20.xversion of20.18.3 - allow greater than range for upper NodeJS minimum version in engines
- types support for public capabilities of Greenwood
- AWS Adapter plugin
- Built-In TypeScript support
- support an array for collections frontmatter key
- bundled static assets from node_modules not getting uploaded to Cloudflare
- incomplete import map generation (when there are lots of dependencies)
- add missing types for content as data module imports
- ensure built-in TS support accounts for frontmatter imports
- content as data client returning
undefinedin production builds when pre-rendering - exclude CSS Modules plugin from custom transforming itself
- front matter in externally sourced pages using typescript source plugins
- consolidate and better document hoisted Lit renderer plugin dependencies
- prerendered (SSG) pages are showing duplicated Lit custom element template output
request.jsonnot working in API Routes with current AWS based adapter plugins (AWS, Netlify)- TypeScript based layouts
- Allow source plugins to access existing graph (thank you @EskiMojo14 🙌 )
- API routes with dynamic bundle chunks are not getting synced or bundled correctly
- diacritics in routes generated by external source plugins cause crashes during build
- Support passing options to markdown plugins
- pages from source plugins not getting tracked in collections
- upgrade WCC v0.17.0
Breaking Changes
Minimum NodeJS Version
The minimum NodeJS version on the 20.x line has been bumped to 20.18.3 which formally marks JSON Import Attributes as stable, which will remove any warning messages when running Greenwood.
Though not a breaking change, the minimum 22.x version has now been changed to have an upper bound using >= instead of ^
# before
^22.12.0
# after
>=22.12.0
Resource and Server Interface
With the introduction of types in Greenwood, the previously documented usage for creating Resource and Server plugins referenced an interface file, which was just a class to extend from, and wasn't really much of an interface at all.
In addition, you'll no longer need to do the super() call, and you'll want compilation and any options to be instance members of your own class.
For example, before you might have had:
import { ResourceInterface } from "@greenwood/cli/src/lib/resource-interface.js";
class ExampleResource extends ResourceInterface {
constructor(compilation, options) {
super(compilation, options);
// ...
}
// ...
}Now, you can use JSDoc based type imports and instance properties
/** @type {import('@greenwood/cli').Resource} */
class ExampleResource {
constructor(compilation, options) {
this.compilation = compilation;
this.options = options;
// ...
}
// ...
}Exports Map / Module field
Though not likely a breaking change to anyone using Greenwood, as an internal change, Greenwood removed the non-standard module field from all package.json files and converted entirely to use the exports field.
// before
{
"main": "./src/index.js",
"module": "./src/index.js",
},// after
{
"main": "./src/index.js",
"exports": {
".": {
"types": "./src/types/index.d.ts",
"import": "./src/index.js"
}
}
}TypeScript Plugin
Starting with this release, the TypeScript plugin is officially considered deprecated, so please follow our docs for integrating built-in TypeScript support into your Greenwood project.