Skip to content

v0.32.0

Choose a tag to compare

@thescientist13 thescientist13 released this 13 Apr 01:40
· 158 commits to master since this release

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@latest

Changelog

https://github.com/ProjectEvergreen/greenwood/issues?q=label%3Av0.32.0

  1. bump to minimum NodeJS 20.x version of 20.18.3
  2. allow greater than range for upper NodeJS minimum version in engines
  3. types support for public capabilities of Greenwood
  4. AWS Adapter plugin
  5. Built-In TypeScript support
  6. support an array for collections frontmatter key
  7. bundled static assets from node_modules not getting uploaded to Cloudflare
  8. incomplete import map generation (when there are lots of dependencies)
  9. add missing types for content as data module imports
  10. ensure built-in TS support accounts for frontmatter imports
  11. content as data client returning undefined in production builds when pre-rendering
  12. exclude CSS Modules plugin from custom transforming itself
  13. front matter in externally sourced pages using typescript source plugins
  14. consolidate and better document hoisted Lit renderer plugin dependencies
  15. prerendered (SSG) pages are showing duplicated Lit custom element template output
  16. request.json not working in API Routes with current AWS based adapter plugins (AWS, Netlify)
  17. TypeScript based layouts
  18. Allow source plugins to access existing graph (thank you @EskiMojo14 🙌 )
  19. API routes with dynamic bundle chunks are not getting synced or bundled correctly
  20. diacritics in routes generated by external source plugins cause crashes during build
  21. Support passing options to markdown plugins
  22. pages from source plugins not getting tracked in collections
  23. 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.

Known Issues

  1. Stackblitz demo not working

Diff

v0.31.1...v0.32.0