Skip to content

Releases: ProjectEvergreen/greenwood

v0.32.0

13 Apr 01:40
Compare
Choose a tag to compare

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

v0.32.0-alpha.9

05 Apr 19:59
Compare
Choose a tag to compare
v0.32.0-alpha.9 Pre-release
Pre-release

Overview

This latest release in the v0.32.0 release line updates the minimum version of WCC, adds support for passing options to markdown plugins, and fixes a bug wherein source plugin pages where not getting added to collections.

This is the last planned alpha release. GA release will be cut in about a week after all the final docs PRs are completed.

# npm
$ npm i -D @greenwood/cli@alpha

# Yarn 1.x (classic)
$ yarn upgrade @greenwood/cli@alpha --dev

# pnpm
$ pnpm i -D @greenwood/cli@alpha

Changelog

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

  1. Support passing options to markdown plugins
  2. pages from source plugins not getting tracked in collections
  3. upgrade WCC v0.17.0

Breaking Changes

N / A

Known Issues

N / A

Diff

v0.32.0-alpha.8...v0.32.0-alpha.9

v0.32.0-alpha.8

30 Mar 14:32
Compare
Choose a tag to compare
v0.32.0-alpha.8 Pre-release
Pre-release

Overview

This latest release in the v0.32.0 release line includes a couple small enhancements as well as bug fixes.

# npm
$ npm i -D @greenwood/cli@alpha

# Yarn 1.x (classic)
$ yarn upgrade @greenwood/cli@alpha --dev

# pnpm
$ pnpm i -D @greenwood/cli@alpha

Changelog

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

  1. request.json not working in API Routes with current AWS based adapter plugins (AWS, Netlify)
  2. TypeScript based layouts
  3. Allow source plugins to access existing graph (thank you @EskiMojo14 🙌 )
  4. API routes with dynamic bundle chunks are not getting synced or bundled correctly
  5. diacritics in routes generated by external source plugins cause crashes during build

Breaking Changes

N / A

Known Issues

N / A

Diff

v0.32.0-alpha.7...v0.32.0-alpha.8

v0.32.0-alpha.7

22 Mar 19:08
Compare
Choose a tag to compare

v0.32.0-alpha.6

17 Mar 18:39
Compare
Choose a tag to compare

v0.32.0-alpha.5

09 Mar 15:21
Compare
Choose a tag to compare
v0.32.0-alpha.5 Pre-release
Pre-release

Overview

This latest release in the v0.32.0 release line fixes some issue with Greenwood's types (and hopefully the last one for a while 😅 🤞 ).

# npm
$ npm i -D @greenwood/cli@alpha

# Yarn 1.x (classic)
$ yarn upgrade @greenwood/cli@alpha --dev

# pnpm
$ pnpm i -D @greenwood/cli@alpha

Changelog

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

  1. Rollup Plugin type definition is incorrect

Breaking Changes

N / A

Known Issues

  1. TS based frontmatter imports are not working
  2. Source plugin based types are not correct

Diff

v0.32.0-alpha.4...v0.32.0-alpha.5

v0.32.0-alpha.4

09 Mar 14:27
Compare
Choose a tag to compare
v0.32.0-alpha.4 Pre-release
Pre-release

Overview

This latest release in the v0.32.0 release line fixes some issue with Greenwood's types.

NOTE: Please bump to v0.32.0-alpha.5 to get some small hot fixes with some of Greenwood's types

# npm
$ npm i -D @greenwood/cli@alpha

# Yarn 1.x (classic)
$ yarn upgrade @greenwood/cli@alpha --dev

# pnpm
$ pnpm i -D @greenwood/cli@alpha

Changelog

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

  1. Copy plugin has the wrong type configuration

Breaking Changes

N / A

Known Issues

  1. Rollup Plugin type definition is incorrect

Diff

v0.32.0-alpha.3...v0.32.0-alpha.4

v0.32.0-alpha.3

09 Mar 02:52
Compare
Choose a tag to compare
v0.32.0-alpha.3 Pre-release
Pre-release

Overview

This latest release in the v0.32.0 release line fixes some issue with Greenwood's types.

NOTE: Please bump to v0.32.0-alpha.5 to get some small hot fixes with some of Greenwood's types

# npm
$ npm i -D @greenwood/cli@alpha

# Yarn 1.x (classic)
$ yarn upgrade @greenwood/cli@alpha --dev

# pnpm
$ pnpm i -D @greenwood/cli@alpha

Changelog

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

  1. devServer.proxy should have been optional

Breaking Changes

N / A

Known Issues

  1. Copy plugin has the wrong type configuration

Diff

v0.32.0-alpha.2...v0.32.0-alpha.3

v0.32.0-alpha.2

09 Mar 02:06
Compare
Choose a tag to compare
v0.32.0-alpha.2 Pre-release
Pre-release

Overview

This third release in the v0.32.0 release line fixes some issue with Greenwood's types

NOTE: Please bump to v0.32.0-alpha.5 to get some small hot fixes with some of Greenwood's types

# npm
$ npm i -D @greenwood/cli@alpha

# Yarn 1.x (classic)
$ yarn upgrade @greenwood/cli@alpha --dev

# pnpm
$ pnpm i -D @greenwood/cli@alpha

Changelog

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

  1. Fixup Greenwood types

Breaking Changes

N / A

Known Issues

  1. devServer.proxy should have been optional

Diff

v0.32.0-alpha.1...v0.32.0-alpha.2

v0.32.0-alpha.1

09 Mar 01:19
Compare
Choose a tag to compare
v0.32.0-alpha.1 Pre-release
Pre-release

Overview

This second release in the v0.32.0 release line introduces built-in TypeScript support for Greenwood, refines some of Greenwood's type definitions, frontmatter collections can now be an array, and fixes a couple of bugs.

NOTE: Please bump to v0.32.0-alpha.5 to get some small hot fixes with some of Greenwood's types

# npm
$ npm i -D @greenwood/cli@alpha

# Yarn 1.x (classic)
$ yarn upgrade @greenwood/cli@alpha --dev

# pnpm
$ pnpm i -D @greenwood/cli@alpha

Changelog

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

  1. Built-In TypeScript support
  2. support an array for collections frontmatter key
  3. bundled static assets from node_modules not getting uploaded to Cloudflare
  4. incomplete import map generation (when there are lots of dependencies)

Features (Early Access)

TypeScript

With this release, Greenwood now provides built-in support for TypeScript, with the ability to fallback to using tsc if certain TypeScript features you're using (like Decorators, enums, namespaces, etc) are not supported through just type stripping alone. Docs are still in progress for types and TypeScript, so please see the below references for now, and please feel free to ask in Discord if you have any questions / feedback if trying this stuff out early.

You can see some example repos here:

NodeJS Version

You'll need to use version >=22.6.0 and need to set the --experimental-strip-types flag for any Greenwood commands

{
  "scripts": {
    "build": "NODE_OPTIONS='--experimental-strip-types' greenwood build"
  }
}

If you're feeling adventurous, you can use >=23.x.x and omit the flag, and keep an eye on this PR for when unflagged typestripping support may come to Node LTS 22.x 👀

TypeScript

You'll need to install typescript into your project in devDependencies

$ npm i typescript --save-dev

Configuration File

You can now author your configuration file (and plugins) in TypeScript by having a greenwood.config.ts file

import type { Config } from '@greenwood/cli';

const config: Config = {
  // ...
}

export default config;

TypeScript Plugin

If you're using Greenwood's TypeScript plugin, you can remove that from your Greenwood configuration file (as it is now considered deprecated).

tsconfig.json

You'll need these minimum settings in your tsconfig.json for compilerOptions, but feel free to add your own on top. We also recommend adding "erasableSyntaxOnly": true.

{
  "compilerOptions": {
    "module": "preserve",
    "moduleResolution": "bundler",
    "allowImportingTsExtensions": true,
    "verbatimModuleSyntax": false,
    "noEmit": true
  }
}

Type Definitions

Below are some common type definitions you can add to your project based on what features / plugins you might be using with Greenwood.

// Greenwood Raw plugin
declare module "*?type=raw" {
  const content: string;
  export default content;
}

// Greenwood CSS Modules plugin
declare module "*.module.css" {
  const classes: { [key: string]: string };
  export default classes;
}

// CSS Import Attribute
// https://github.com/microsoft/TypeScript/issues/46135
declare module "*.css" {
  const sheet: CSSStyleSheet;

  export default sheet;
}

tsc Fallback

As mentioned, built-in type-stripping may not handle all TypeScript features, or even JavaScript features like Decorators. If that's the case, you can enable the useTsc flag in your configuration file to fallback to using tsc with the full power of the TypeScript compiler.

import type { Config } from '@greenwood/cli';

const config: Config = {
  useTsc: true
};

export default config;

Breaking Changes

TypeScript Plugin

Starting with this release, the TypeScript plugin is officially considered deprecated, so please follow the above steps for integrating built-in TypeScript support into your project. When the official v0.32.0 release goes out, the package will be deprecated on NPM.

Known Issues

  1. Plugin types are broken
  2. Excessive configuration file detected logs

Diff

v0.32.0-alpha.0...v0.32.0-alpha.1