Skip to content

typing support for public capabilities of Greenwood #1250

@thescientist13

Description

@thescientist13

Summary

While Greenwood is a build tool without much of a public API other than its CLI and plugins, there are some areas that should probably provide typing to users through JSDocs, maybe TS but I'm not super keen on TypeScript in libraries.

Details

Most obvious ones that come to mind are:

  1. greenwood.config.js, even if just JS Docs style, ex.
    /** @type {import('@greenwood/cli').GreenwoodConfig} */
    export default {
      /* config options here */
    }
  2. Plugins API (and get rid of that silly ResourceInterface lol)
  3. Content as Data - like the data client
  4. others?

We would also want to make sure we validate these through CI somehow, ideally using these config files in our own projects and / or test cases.


Raised in #1292 (comment), a good point was raised about authoring Greenwood plugins (and probably also greenwood.config.js in TypeScript. Might need to make another issue for that once we can land this one first, unless its easy to do it all in one go with something like sucrase, which we are using now in WCC.

Metadata

Metadata

Labels

CLIPluginsGreenwood PluginsRFCProposal and changes to workflows, architecture, APIs, etcalpha.0breakingdocumentationGreenwood specific docsfeatureNew feature or requestv0.32.0

Type

No type

Projects

Status

✅ Done

Relationships

None yet

Development

No branches or pull requests

Issue actions