Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release/0.10.0 #436

Merged
merged 58 commits into from
Apr 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
97005ee
Rfc/issue 355 no bundle development (#417)
thescientist13 Nov 12, 2020
4b3d46a
Rfc/issue 185 Transforms API (pt. 1) (#422)
hutchgrant Nov 13, 2020
ec0e71b
Enhancement/issue 427 css bundling rollup (#438)
thescientist13 Dec 13, 2020
2cebebd
v0.10.0-alpha.0
thescientist13 Dec 13, 2020
341771d
Bug/issue 443 html in markdown not rendering (#444)
thescientist13 Dec 20, 2020
72f7662
add github action for release branches (#451)
thescientist13 Dec 20, 2020
6c798bb
Bug/issue 445 missing dependency (#447)
thescientist13 Dec 20, 2020
0fcdee3
v0.10.0-alpha.1
thescientist13 Dec 20, 2020
076bb1a
Docs/issue 430 update technical documentation to reflect current proj…
thescientist13 Dec 30, 2020
19ffc61
Enhancement/issue 426 restore userland postcss (#453)
thescientist13 Dec 30, 2020
683986c
Bug/issue 386 graph not matching filesystem order (#449)
thescientist13 Dec 30, 2020
5a736bc
prebump www workspace
thescientist13 Dec 30, 2020
015a2e2
v0.10.0-alpha.2
thescientist13 Dec 30, 2020
bc1b66d
fix duplicate path seperator (#461)
thescientist13 Dec 30, 2020
edb725c
v0.10.0-alpha.3
thescientist13 Dec 30, 2020
9e42163
Fix/issue 463 pretty urls in prodServer (#464)
hutchgrant Dec 31, 2020
9c032ca
better handling for pages with index in their name (#462)
thescientist13 Jan 7, 2021
88138cd
Rfc/issue 185 resources refactor (#466)
thescientist13 Jan 23, 2021
896ee5f
Fix/issue 432 correct shelf and markdown plugins (#459)
hutchgrant Jan 23, 2021
d52f033
resolve multiple <slot> elements rendering on the home page (#454)
thescientist13 Jan 23, 2021
43d4985
prebump www package
thescientist13 Jan 23, 2021
0e43afb
v0.10.0-alpha.4
thescientist13 Jan 23, 2021
ffca6bf
issue 429 javascript module imports (#465)
hutchgrant Feb 6, 2021
2ab2927
update plugin README docs (#468)
thescientist13 Feb 6, 2021
c5c6cc8
pin Netlify node version v12.13.0 (#469)
thescientist13 Feb 6, 2021
ec29eca
Server Plugin API (#471)
hutchgrant Feb 18, 2021
aeb49c2
Enhancement/issue 426 restore postcss as plugins (#473)
thescientist13 Feb 18, 2021
1ac7ff5
update live-reload plugin per expected intercept return value (#478)
thescientist13 Feb 20, 2021
962fdb4
pre bump www
thescientist13 Feb 20, 2021
6c4bc4b
v0.10.0-alpha.5
thescientist13 Feb 20, 2021
a5e8477
hoist cssnano to cli package (#480)
thescientist13 Feb 20, 2021
f940aaa
pre bump www
thescientist13 Feb 20, 2021
6e5b3dd
v0.10.0-alpha.6
thescientist13 Feb 20, 2021
7b76b7f
Enhancement/issue 434 expand script style link tag production bundlin…
thescientist13 Feb 27, 2021
ed867fa
Bug/issue 431 template <head> tags merge order (#475)
thescientist13 Feb 27, 2021
285aa2f
restore default meta tags and update www (#474)
thescientist13 Feb 27, 2021
08b710b
Bug/issue 456 top level pages not building correctly (#476)
thescientist13 Feb 27, 2021
2269937
set node v12 as minimum version (#486)
thescientist13 Mar 5, 2021
c7cb890
better import CSS detection for browsers (#483)
thescientist13 Mar 5, 2021
039eeda
filter only JS packages for importMap and add tests (#485)
thescientist13 Mar 5, 2021
eb9834b
bump www to next alpha
thescientist13 Mar 5, 2021
e79a373
v0.10.0-alpha.7
thescientist13 Mar 5, 2021
3b82fb3
Enhancement/issue 426 plugin babel (#481)
thescientist13 Mar 19, 2021
cc13529
Enhancement/issue 278 graphql plugin (#487)
thescientist13 Mar 19, 2021
84aadde
bump www to next alpha release
thescientist13 Mar 19, 2021
dd165b0
v0.10.0-alpha.8
thescientist13 Mar 19, 2021
38dcf27
removed some text that accidently got into the docs (#490)
thescientist13 Mar 20, 2021
71f0854
add additional handling for chrome headers (#493)
thescientist13 Mar 26, 2021
103b773
handle no bundling of remote URLs and add error handling for sync rol…
thescientist13 Mar 26, 2021
508b7d0
bump www package to next alpha
thescientist13 Mar 26, 2021
1d23bbe
v0.10.0-alpha.9
thescientist13 Mar 26, 2021
16e19dd
Enhancement/issue 354 restore optimization config for no bundle (#477)
thescientist13 Apr 3, 2021
4bc284f
Chore/issue 428 refactor smoke test and cases (#497)
thescientist13 Apr 3, 2021
ac91b48
Website/issue 268 update project vision (#499)
thescientist13 Apr 3, 2021
b4c1422
bump www to next alpha
thescientist13 Apr 3, 2021
a3f20bc
v0.10.0-alpha.10
thescientist13 Apr 3, 2021
656f620
style linting fixes
thescientist13 Apr 3, 2021
d502a90
update README to reflect current project status post 0.10.0 release
thescientist13 Apr 3, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
**/public/**
**/node_modules/**
!.eslintrc.js
!.mocharc.js
!.mocharc.js
packages/plugin-babel/test/cases/**/*main.js
8 changes: 1 addition & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
const path = require('path');

module.exports = {
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
babelOptions: {
configFile: path.join(__dirname, './packages/cli/src/config/babel.config.js')
}
sourceType: 'module'
},
env: {
browser: true,
Expand Down
67 changes: 57 additions & 10 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,53 @@
## Welcome!
We're excited for your interest in Greenwood, and maybe even your contribution!

> _We encourage all contributors to have first read about the project's vision and motivation's on the website's [About page](https://www.greenwoodjs.io/about/). Greenwood is opinionated in the sense that is designed to support development for the web platform and deliver a first class developer experience tailored around that, so that anyone can create a modern and performant website (or webapp, if you prefer). So if that page is the "why", this page is the "how"._

## Technical Design Overview

The Greenwood GitHub repository is a combination [Yarn workspace](https://classic.yarnpkg.com/en/docs/workspaces/) and [Lerna monorepo](https://github.com/lerna/lerna). The root level _package.json_ defines the workspaces and shared tooling used throughout the project, like for linting, testing, etc.

The two main directories are:
- [_packages/_](https://github.com/ProjectEvergreen/greenwood/tree/master/packages) - Packages published to NPM under the `@greenwood/` scope
- [_www/_](https://github.com/ProjectEvergreen/greenwood/tree/master/www) - [website](https://www.greenwoodjs.io) / documentation code


> _This guide is mainly intended to walk through the **cli** package, it being the principal pacakge within the project supporting all other packages._

### CLI

The CLI is the main entry point for Greenwood, similar to how the [front-controller pattern](https://en.wikipedia.org/wiki/Front_controller) works. When users run a command like `greenwood build`, they are effectively invoking the file _src/index.js_ within the `@greenwood/cli` package.

At a high level, this is how a command goes through the CLI:
1. Each documented command a user can run maps to a script in the _commands/_ directory.
1. Each command can invoke any number of lifecycles from the _lifecycles/_ directory.
1. Lifecycles capture specific steps needed to build a site, serve it, generate a content dependency graph, etc.


### Layout
The [layout](https://github.com/ProjectEvergreen/greenwood/tree/master/packages/cli/src) of the CLI package is as follows:

- _index.js_ - Front controller
- _commands/_ - map to runnable userland commands
- _config/_ - Tooling configuration that Greenwood creates
- _data/_ - Custom GraphQL server and client side utilities
- _lib/_ - Customfized Local third party libraries and utility files
- _lifecycles/_ - Tasks that can be composed by commands to support the full needs of that command
- _plugins/_ - Custom defaukt plugins maintained by the CLI project
- _templates/_ - Default templates and / or pages provided by Grennwood.

We'll focus on the most important two here:


### Lifecycles
Aside from the config and graph lifecycles, all lifecycles (and config files and plugins) typically expect a compilation object to be passed in.

Lifeycles include handling:
- starting a production or development server for a compilation
- optimizing a compilation for production
- prerendering a compilation for production
- fetching external (content) data sources


## Issues
Please make sure to have the following prepared (where applicable)
Expand All @@ -14,8 +61,8 @@ Please make sure to have the following prepared (where applicable)

## Pull Requests
Pull requests are the best! To best help facililate contributions to the project, here are some requests:
- We generally we prefer an issue be opened first, to help faciliate general discussion outside of the code review process itself and align on the ask and any expections. However, for typos in docs and minor "chore" like tasks a PR is usually sufficient. When in doubt, open an issue.
- For bugs, please consider reviewing the issue tracker.
- We generally prefer an issue be opened first, to help faciliate general discussion outside of the code review process itself and align on the ask and any expections. However, for typos in docs and minor "chore" like tasks a PR is usually sufficient. When in doubt, open an issue.
- For bugs, please consider reviewing the issue tracker first.
- For branching, we generally follow the convention `<issue-label>/issue-<number>-<issue-title>`, e.g. _bug/issue-12-fixed-bug-with-yada-yada-yada_
- To test the CI build scripts locally, run the `yarn` commands mentioned in the below section on CI.

Expand All @@ -31,21 +78,21 @@ A preview is also made available within the status checks section of the PR in G

## Local Development
To develop for the project, you'll want to follow these steps:
1. Have [NodeJS LTS](https://nodejs.org) installed (>= 10.x) and [Yarn](https://yarnpkg.com/)
1. Have [NodeJS LTS](https://nodejs.org) installed (>= 12.x) and [Yarn](https://yarnpkg.com/)
1. Clone the repository
1. Run `yarn install`
1. Run `yarn lerna bootstrap`

### Tasks
The Greenwood website is currently built by Greenwood itself, and all files for it are located in this repository in the _www/_ directory. In addition to unit tests, you will want to verify all changes by running the website locally.
### Scripts
The [Greenwood website](https://www.greenwoodjs.io/) is currently built by Greenwood, and all files for it are located in this repository under the [_www/_ directory](https://github.com/ProjectEvergreen/greenwood/tree/master/www) workspace. In addition to unit tests, you will want to verify any changes by running the website locally.

Below are the development tasks available for working on this project:
- `yarn develop` - Develop for the website locally using the dev server at `localhost:1984` in your browser.
- `yarn build` - Builds the website for production.
- `yarn serve` - Builds the website for production and runs it on a local webserver at `localhost:8000`

### Packages
Greenwood is organized into packages as a monorepo, managed by [Lerna](https://lerna.js.org/) and [Yarn Workspaces](https://yarnpkg.com/lang/en/docs/workspaces/). You can find all of these in the _packages/_ directory. Each package will manage its own:
As mentioned above, Greenwood is organized into packages as a monorepo, managed by [Lerna](https://lerna.js.org/) and [Yarn Workspaces](https://yarnpkg.com/lang/en/docs/workspaces/). You can find all of these in the _packages/_ directory. Each package will manage its own:
- Dependencies
- README
- Test Cases
Expand All @@ -65,7 +112,7 @@ Yarn workspaces will automatically handle installing _node_modules_ in the appro


## Unit Testing
[TDD](https://en.wikipedia.org/wiki/Test-driven_development) is the recommended approach for developing for Greenwood and for the style of test writing we use [BDD style testing](https://en.wikipedia.org/wiki/Behavior-driven_development); "cases". Cases are used to capture the various configurations and expected outputs of Greenwood when running its commands, in a way that is closer to how a user would be expecting Greenwood to work.
[TDD](https://en.wikipedia.org/wiki/Test-driven_development) is the recommended approach for developing for Greenwood and for the style of test writing we use [BDD style testing](https://en.wikipedia.org/wiki/Behavior-driven_development); "cases". Cases are used to capture the various configurations and expected outputs of Gre enwood when running its commands, in a way that is closer to how a user would be expecting Greenwood to work.

### Running Tests
To run tests in watch mode, use:
Expand All @@ -87,15 +134,15 @@ Below are some tips to help with running / debugging tests:
> **PLEASE DO NOT COMMIT ANY OF THESE ABOVE CHANGES THOUGH**

### Writing Tests
Cases follow a convention starting with the command (e.g. `build`) and and the capability and features being tested, like configuration with a particular option (e.g. `publicPath`):
Cases follow a convention starting with the command (e.g. `build`) and and the capability and features being tested, like configuration with a particular option (e.g. `port`):
```shell
<command>.<capability>.<feature>.spec.js
```

Examples:
- _build.default.spec.js_ - Would test `greenwood build` with no config and no workspace.
- _build.config.workspace-custom.spec.js_ - Would test `greenwood build` with a config that had a custom `workspace`
- _build.config.workspace-public-path.spec.js_ - Would test `greenwood build` with a config that had a custom `workspace` and `publicPath` set.
- _build.config.workspace-dev-server-port.spec.js_ - Would test `greenwood build` with a config that had a custom `workspace` and `devServer.port` set.

### Notes
Here are some thigns to keep in mind while writing your tests, due to the asynchronous nature of Greenwwood:
Expand All @@ -104,7 +151,7 @@ Here are some thigns to keep in mind while writing your tests, due to the asynch
- Avoid arrow functions in mocha tests (e.g. `() => `) as this [can cause unexpected behaviors.](https://mochajs.org/#arrow-functions). Just use `function` instead.

## Internet Explorer
For situations that require testing Internet Explorer or Edge browser, Microsoft [provides Virtual Machines](https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/) for various combinations of Windows and Internet Explorer versions. [VirtualBox](https://www.virtualbox.org/) is a good platform to use for these VMs.
For situations that require testing Internet Explorer or Edge browser, Microsoft provides [Virtual Machines](https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/) for various combinations of Windows and Internet Explorer versions. [VirtualBox](https://www.virtualbox.org/) is a good platform to use for these VMs.

To test from a VM, you can
1. Run `yarn serve`
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
node: [10, 12]
node: [12, 14]

steps:
- uses: actions/checkout@v1
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release Branch Integration

on:
push:
branches:
- release/**

jobs:

build:
runs-on: ubuntu-18.04

strategy:
matrix:
node-version: [12.x]

steps:
- uses: actions/checkout@v1
- name: Install Chromium Library Dependencies
run: |
sh ./.github/workflows/chromium-lib-install.sh
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Installing project dependencies
run: |
yarn install --frozen-lockfile && yarn lerna bootstrap
- name: Lint
run: |
yarn lint
- name: Test
run: |
yarn test
- name: Build
run: |
yarn clean && yarn build
env:
CI: true
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
## Overview
Greenwood is a modern and performant static site generator supporting Web Component based development. For more information about how to get started, lookup our docs, or learn more about the project, please visit our [website](https://www.greenwoodjs.io/).

> Greenwood is currently working towards a [1.0 release](https://github.com/ProjectEvergreen/greenwood/issues/418) with plans in our [next release (v.0.10.0)](https://github.com/ProjectEvergreen/greenwood/pull/436) to introduce some exciting [new changes and concepts](https://github.com/ProjectEvergreen/greenwood/releases/tag/v0.10.0-alpha.0) to the project. Check out our [roadmap](https://github.com/ProjectEvergreen/greenwood/projects) to see what we're working on next and feel free to reach out through our [issue tracker](https://github.com/ProjectEvergreen/greenwood/issues) if you have any issues. Additionally, please review our [Request for Contributions doc](https://docs.google.com/document/d/1MwDkszKvq81QgIYa8utJgyUgSpLZQx9eKCWjIikvfHU/) if would like to help us in building Greenwood! ✌️
> Greenwood is currently working towards a [1.0 release](https://github.com/ProjectEvergreen/greenwood/issues/418) with our [recent release (v.0.10.0)](https://github.com/ProjectEvergreen/greenwood/pull/436) introducing some exciting [new changes and concepts](https://github.com/ProjectEvergreen/greenwood/releases/tag/v0.10.0) to the project. Check out our [roadmap](https://github.com/ProjectEvergreen/greenwood/projects) to see what we're working on next and feel free to reach out through our [issue tracker](https://github.com/ProjectEvergreen/greenwood/issues) if you have any issues. Additionally, please review our [Request for Contributions doc](https://docs.google.com/document/d/1MwDkszKvq81QgIYa8utJgyUgSpLZQx9eKCWjIikvfHU/) if would like to help us in building Greenwood! ✌️

## Getting Started
Our website has a complete [Getting Started](http://www.greenwoodjs.io/getting-started) section that will walk you through creating a Greenwood project from scratch.
Expand All @@ -31,13 +31,13 @@ Then in your _package.json_, you can run the CLI like so:
"scripts": {
"build": "greenwood build",
"start": "greenwood develop",
"eject": "greenwood eject",
"serve": "greenwood serve"
}
```

- `npm run build`: generates a static build of your project
- `npm start`: starts a local development server for your project
- `npm run eject`: ejects configurations to your working directory for additional customizations
- `greenwood build`: Generates a production build of your project
- `greenwood develop`: Starts a local development server for your project
- `greenwood serve`: Generates a production build of the project and serves it locally on a simple web server.

## Documentation
All of our documentation is on our [website](https://www.greenwoodjs.io/) (which itself is built by Greenwood!). See our website documentation to learn more about:
Expand Down
18 changes: 13 additions & 5 deletions greenwood.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
const path = require('path');
const pluginGoogleAnalytics = require('./packages/plugin-google-analytics/src/index');
const pluginGraphQL = require('./packages/plugin-graphql/src/index');
const pluginImportCss = require('./packages/plugin-import-css/src/index');
const pluginPolyfills = require('./packages/plugin-polyfills/src/index');
const pluginPostCss = require('./packages/plugin-postcss/src/index');

const META_DESCRIPTION = 'A modern and performant static site generator supporting Web Component based development';
const FAVICON_HREF = '/assets/favicon.ico';

module.exports = {
workspace: path.join(__dirname, 'www'),
mode: 'mpa',
title: 'Greenwood',
meta: [
{ name: 'description', content: META_DESCRIPTION },
Expand All @@ -21,16 +25,20 @@ module.exports = {
{ name: 'google-site-verification', content: '4rYd8k5aFD0jDnN0CCFgUXNe4eakLP4NnA18mNnK5P0' }
],
plugins: [
...pluginGoogleAnalytics({
pluginGoogleAnalytics({
analyticsId: 'UA-147204327-1'
}),
...pluginPolyfills()
...pluginGraphQL(),
pluginPolyfills(),
pluginPostCss(),
...pluginImportCss()
],
markdown: {
plugins: [
require('rehype-slug'),
require('rehype-autolink-headings'),
require('remark-github')
'@mapbox/rehype-prism',
'rehype-slug',
'rehype-autolink-headings',
'remark-github'
]
}
};
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.9.0",
"version": "0.10.0-alpha.10",
"packages": [
"packages/*",
"www"
Expand Down
5 changes: 4 additions & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
command = "yarn build"

[build.processing]
skip_processing = true
skip_processing = true

[build.environment]
NODE_VERSION = "12.13.0"
12 changes: 6 additions & 6 deletions nyc.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module.exports = {
all: true,

include: [
'packages/cli/src/data/*.js',
'packages/cli/src/commands/*.js',
'packages/cli/src/lib/*.js',
'packages/cli/src/lifecycles/*.js',
'packages/cli/src/tasks/*.js',
'packages/cli/src/plugins/*.js',
'packages/plugin-*/src/*.js'
],

Expand All @@ -19,10 +19,10 @@ module.exports = {

checkCoverage: true,

statements: 85,
branches: 75,
functions: 90,
lines: 85,
statements: 80,
branches: 65,
functions: 85,
lines: 80,

watermarks: {
statements: [75, 85],
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"clean": "rimraf ./**/.greenwood/** && rimraf ./**/public/** && rimraf ./coverage",
"clean:deps": "rimraf **/node_modules/**",
"build": "node . build",
"serve": "yarn build && cd ./public && ws",
"serve": "node . serve",
"develop": "node . develop",
"test": "export BROWSERSLIST_IGNORE_OLD_DATA=true && nyc mocha",
"test:tdd": "yarn test --watch",
Expand All @@ -27,9 +27,9 @@
},
"devDependencies": {
"@ls-lint/ls-lint": "^1.9.2",
"babel-eslint": "^10.0.3",
"chai": "^4.2.0",
"eslint": "^6.8.0",
"glob-promise": "^3.4.0",
"jsdom": "^14.0.0",
"lerna": "^3.16.4",
"mocha": "^6.1.4",
Expand Down
Loading