Skip to content

v0.12.0

Compare
Choose a tag to compare
@thescientist13 thescientist13 released this 08 May 16:13
· 588 commits to master since this release

Overview

This release aimed primarily to extend Greenwood's capabilities to handle Single Page Application (SPA) project types by adding it as a new mode configuration option, added support for being able to reverse proxy requests (like for API calls), and also made prerendering optional as a new (opt-out) configuration option. Additionally, if using plugin-graphql, you can now provide your own custom schema and resolvers.

Changelog

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

  1. Fix inline <script> marker detection not correctly matching when Rollup bundles the inline source and changes its contents
  2. Added support for reverse proxy configuration for devServer
  3. Added configuration to allow pre-rendering to be optional
  4. Introduced a Single Page Application (SPA) configuration mode
  5. Support ad-hoc / custom GraphQL resolvers and definitions (schemas)
  6. add support for resolving sourcemaps (in development)

Breaking Changes

None

Known Issues

  1. Greenwood not working on Windows
  2. dev server proxy is not forwarding query params
  3. top level page or page template <meta> tags not showing up in output HTML

Diff

% git diff v0.11.1 v0.12.0 --stat
 .eslintrc.js                                                    |   1 +
 lerna.json                                                      |   2 +-
 nyc.config.js                                                   |   2 +-
 package.json                                                    |   1 +
 packages/cli/package.json                                       |   4 +-
 packages/cli/src/commands/build.js                              |  68 ++++----
 packages/cli/src/config/rollup.config.js                        |  23 +--
 packages/cli/src/lifecycles/config.js                           |  25 ++-
 packages/cli/src/lifecycles/graph.js                            |  23 ++-
 packages/cli/src/lifecycles/prerender.js                        | 111 +++++++++++++
 packages/cli/src/lifecycles/serialize.js                        |  83 ----------
 packages/cli/src/lifecycles/serve.js                            |  16 +-
 packages/cli/src/plugins/resource/plugin-dev-proxy.js           |  45 +++++
 packages/cli/src/plugins/resource/plugin-node-modules.js        |   6 +-
 packages/cli/src/plugins/resource/plugin-source-maps.js         |  40 +++++
 packages/cli/src/plugins/resource/plugin-standard-html.js       |  14 +-
 .../build.config.error-mode/build.config.error-mode.spec.js     |   2 +-
 .../build.config.error-prerender.spec.js                        |  46 ++++++
 .../test/cases/build.config.error-prerender/greenwood.config.js |   3 +
 .../cases/build.config.mode-mpa/build.config.mode-mpa.spec.js   |   2 +
 .../cases/build.config.mode-spa/build.config.mode-spa.spec.js   | 244 ++++++++++++++++++++++++++++
 .../cli/test/cases/build.config.mode-spa/greenwood.config.js    |   3 +
 packages/cli/test/cases/build.config.mode-spa/package.json      |   9 +
 .../test/cases/build.config.mode-spa/src/components/footer.js   |  49 ++++++
 packages/cli/test/cases/build.config.mode-spa/src/index.html    |  29 ++++
 packages/cli/test/cases/build.config.mode-spa/src/index.js      |  32 ++++
 .../cli/test/cases/build.config.mode-spa/src/routes/about.js    |   9 +
 .../cli/test/cases/build.config.mode-spa/src/routes/home.js     |   9 +
 .../cases/build.config.prerender/build.config.prerender.spec.js | 117 +++++++++++++
 .../cli/test/cases/build.config.prerender/greenwood.config.js   |   3 +
 .../test/cases/build.config.prerender/src/components/header.js  |  22 +++
 .../cli/test/cases/build.config.prerender/src/pages/index.html  |  13 ++
 .../build.default.import-node-modules.spec.js                   |  16 +-
 .../build.default.import-node-modules/src/pages/index.html      |   4 +-
 packages/plugin-babel/package.json                              |   4 +-
 packages/plugin-google-analytics/package.json                   |   4 +-
 packages/plugin-graphql/README.md                               |  91 ++++++++++-
 packages/plugin-graphql/package.json                            |   4 +-
 packages/plugin-graphql/src/core/server.js                      |   2 +-
 packages/plugin-graphql/src/queries/config.gql                  |   1 +
 packages/plugin-graphql/src/schema/config.js                    |   1 +
 packages/plugin-graphql/src/schema/schema.js                    | 104 +++++++-----
 .../test/cases/query-custom-schema/greenwood.config.js          |   9 +
 .../test/cases/query-custom-schema/query-custom-schema.spec.js  | 133 +++++++++++++++
 .../test/cases/query-custom-schema/src/assets/logo1.png         | Bin 0 -> 1150 bytes
 .../test/cases/query-custom-schema/src/assets/logo2.png         | Bin 0 -> 1150 bytes
 .../test/cases/query-custom-schema/src/assets/logo3.png         | Bin 0 -> 1150 bytes
 .../test/cases/query-custom-schema/src/data/queries/gallery.gql |   9 +
 .../test/cases/query-custom-schema/src/data/schema/gallery.js   |  44 +++++
 .../test/cases/query-custom-schema/src/pages/index.html         |  35 ++++
 packages/plugin-graphql/test/unit/schema/config.spec.js         |   8 +
 packages/plugin-import-commonjs/package.json                    |   4 +-
 packages/plugin-import-css/package.json                         |   8 +-
 packages/plugin-polyfills/package.json                          |   4 +-
 packages/plugin-postcss/package.json                            |   4 +-
 www/package.json                                                |   2 +-
 www/pages/docs/configuration.md                                 |  25 ++-
 www/pages/docs/data.md                                          |   2 +
 www/pages/docs/layouts.md                                       |  21 ++-
 www/pages/index.html                                            |   2 +-
 yarn.lock                                                       |  80 ++++++++-
 61 files changed, 1458 insertions(+), 219 deletions(-)