Skip to content

v0.33.0-alpha.0

Pre-release
Pre-release

Choose a tag to compare

@thescientist13 thescientist13 released this 25 May 19:42
· 148 commits to master since this release

Overview

This first release in the v0.33.0 release line introduces an overhaul to Greenwood's init scaffolding CLI, now pre-cleans all build and output directories automatically, and some fixes some misc bugs.

# 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.33.0%20label%3Aalpha.0

  1. adopt prompt based user experience for the init experience
  2. expand package manager options for init scaffolding
  3. pre-clean all build output directories
  4. supported import map generation export condition matches are overwriting themselves
  5. SSR pages and layouts using custom HTML element with constructor props returns undefined for compilation object

Features (Early Access)

Docs are still in progress for the init command so please see the below references for now, and please feel free to ask in Discord if you have any questions / feedback if trying these changes out early.

Init

The Init scaffolding CLI has been improved to be a prompt based experience, which will walk you through selecting a number of scaffolding options for your project's name, TypeScript configuration, and package manager installation.

# notice we are using @alpha here
$ npx @greenwood/init@alpha

There are corresponding flags for all prompts and options too, which you can see by passing the --help flag

➜  scratch npx @greenwood/init@alpha --help
-------------------------------------------------------
Initialize a Greenwood Project (v0.33.0-alpha.0) ♻️
-------------------------------------------------------
Usage: @greenwood/init [options]

Options:
  -V, --version           output the version number
  -y, --yes               Accept all default options
  --name <name>           Name and directory location to scaffold your application with
  --ts [choice]           Optionally configure your project with TypeScript (choices: "yes", "no")
  -i, --install <choice>  Install dependencies with the package manager of your choice (choices: "npm", "pnpm", "yarn", "no")
  -h, --help              display help for command

For example, to automatically create and name a project using TypeScript and PNPM, you could use this command

$ npx @greenwood/init@latest --name my-app --ts --i pnpm

Breaking Changes

Constructor Props

The signature for constructor props has changed slightly, now allowing for access to the compilation object

// before compilation was undefined
constructor(request, compilation) {
  // ...
}
// after, we pass an object with access to both
constructor({ request, compilation }) {
  //
}

Known Issues

  1. fix missing TS flag from Init scaffolding TS base template
  2. init scaffolded version field in package.json is being to set to current Greenwood's current version

Diff

v0.32.0...v0.33.0-alpha.0