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.28.0 #1034

Merged
merged 32 commits into from
Apr 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3526e91
Feature/issue 957 node 18 upgrade (#1014)
thescientist13 Dec 10, 2022
44a785c
upgrade missed github actions for runner OS upgrade for Node 18 (#1035)
thescientist13 Dec 10, 2022
0f2af78
Feature/issue 1007 api routes (#1017)
thescientist13 Dec 17, 2022
79c4550
v0.28.0-alpha.0
thescientist13 Dec 17, 2022
bed73d3
refine content and fix typo for API routes docs content (#1037)
thescientist13 Jan 19, 2023
6fac45d
Feature/issue 948 web api standardization (#1045)
thescientist13 Feb 5, 2023
a839999
update test-loader forwarding for resolve hook
thescientist13 Feb 7, 2023
e3f6378
v0.28.0-alpha.1
thescientist13 Feb 7, 2023
6e686c7
remove setMaxListeners suppression call (#1046)
thescientist13 Feb 18, 2023
2776206
Enhancement/correctly name standard resource plugins (#1055)
thescientist13 Feb 18, 2023
14e0068
Bug/issue 1064 restore spa fallback handling for client side routing …
thescientist13 Feb 18, 2023
b9a57a6
Bug/issue 1059 api routes and api calls overlap (#1062)
thescientist13 Feb 18, 2023
b23c5dd
v0.28.0-alpha.2
thescientist13 Feb 20, 2023
5123b09
Bug/issue 1072 serve command not serving prerendered ssr content (#1073)
thescientist13 Feb 24, 2023
5056470
v0.28.0-alpha.3
thescientist13 Feb 24, 2023
a6e3234
refactor copy lifecycle to use leverage fs.copyFile instead of stream…
thescientist13 Mar 11, 2023
b1777ca
upgrade actions/setup-node for node 18 (#1071)
thescientist13 Mar 11, 2023
bcd2524
update repository and homepage fields for all package jsons (#1077)
thescientist13 Mar 11, 2023
0f3e230
add support for standard `<video>` and `<audio> `formats (#1054)
thescientist13 Mar 11, 2023
9fa5633
Enhancement/restore rollup local workspace resolution (#1066)
thescientist13 Mar 11, 2023
10118cd
v0.28.0-alpha.4
thescientist13 Mar 25, 2023
6a7b1a8
document releasing dist tags (#1083)
thescientist13 Apr 1, 2023
691e2d4
Feature/issue 972 WCC JSX import plugin (#1085)
thescientist13 Apr 1, 2023
2149f65
Enhancement/issue 946 decouple build and serve commands from workspac…
thescientist13 Apr 1, 2023
6834a69
break after first found resource match for dev server serve lifecyle …
thescientist13 Apr 1, 2023
f3465a1
resource plugins refactoring for serve lifecycle and extensions (#1067)
thescientist13 Apr 1, 2023
54e6633
v0.28.0-alpha.5
thescientist13 Apr 1, 2023
13a0265
exclude failing SSR specs from non experimental test cases (#1080)
thescientist13 Apr 9, 2023
23d660e
port was hardcoded with serve command and SSR (#1092)
thescientist13 Apr 9, 2023
94a3165
fix matching for bundling inline script tags (#1089)
thescientist13 Apr 9, 2023
81ae521
update package keywords and deps (#1093)
thescientist13 Apr 9, 2023
4503a71
v0.28.0 release blog post (#1086)
thescientist13 Apr 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 12 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,15 @@
*.woff binary
*.woff2 binary
*.ttf binary
*.eot binary
*.eot binary
*.flv binary
*.mp4 binary
*.3gp binary
*.mov binary
*.avi binary
*.wmv binary
*.ogg binary
*.oga binary
*.ogg binary
*.mp3 binary
*.wav binary
24 changes: 17 additions & 7 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,25 @@ Note: If you have issues running tests due to timeouts, you can increase the set

## Release Management

Lerna is used to manage the publishing of packages within the workspace under a single unified version. Assuming you are logged into **npm** locally and have 2FA access to publish, the command to run is
Lerna is used to manage the publishing of packages within the workspace under a single unified version. Assuming you are logged into **npm** locally and have 2FA access to publish, the following workflows should be used

After running these commands, Lerna should then prompt you through the steps to pick the version and all packages that will get updated.

### Alpha Release

Greenwood typically works on new minor versions in a dedicated branch and release line called "alpha". This leverages NPM's concept of dist tags. While on a release branch, run the following to publish a new _alpha_ release.

```sh
# from the root of the repo
$ yarn lerna publish

# if Lerna is not displaying all packages as needing publishing, cancel and use
$ yarn lerna publish --force-publish
$ yarn lerna publish --force-publish --dist-tag alpha
```

Lerna should then prompt you through the steps to pick the version and all packages that will get updated.
> Typically you will want to select the _Custom Preminor_ option from the list, which Lerna should appropriately yield the expected version.

### Standard Release

> _Sometimes when doing pre-minor releases, it will be required to manually bump the `version` in www/package.json_
For a normal release (e.g. "latest") the following command can be run from the mainline branch of the repo.
```sh
# from the root of the repo
$ yarn lerna publish --force-publish
```
6 changes: 3 additions & 3 deletions .github/workflows/ci-exp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ on: [pull_request]
jobs:

build:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

strategy:
matrix:
node: [16]
node: [18]

steps:
- uses: actions/checkout@v1
- name: Install Chromium Library Dependencies
run: |
sh ./.github/workflows/chromium-lib-install.sh
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Installing project dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-win-exp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ jobs:

strategy:
matrix:
node: [16]
node: [18]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Installing project dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ jobs:

strategy:
matrix:
node: [14, 16]
node: [18]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Installing project dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ on: [pull_request]
jobs:

build:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

strategy:
matrix:
node: [14, 16]
node: [18]

steps:
- uses: actions/checkout@v1
- name: Install Chromium Library Dependencies
run: |
sh ./.github/workflows/chromium-lib-install.sh
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Installing project dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ on:
jobs:

build:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

strategy:
matrix:
node: [14]
node: [18]

steps:
- uses: actions/checkout@v1
- name: Install Chromium Library Dependencies
run: |
sh ./.github/workflows/chromium-lib-install.sh
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Installing project dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ on:
jobs:

build:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

strategy:
matrix:
node-version: [14]
node-version: [18]

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@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Installing project dependencies
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.DS_Store
*.log
.greenwood/
.nyc_output/
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.17.0
18.12.1
9 changes: 4 additions & 5 deletions greenwood.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ import { greenwoodPluginPolyfills } from '@greenwood/plugin-polyfills';
import { greenwoodPluginPostCss } from '@greenwood/plugin-postcss';
import { greenwoodPluginRendererPuppeteer } from '@greenwood/plugin-renderer-puppeteer';
import rollupPluginAnalyzer from 'rollup-plugin-analyzer';
import { fileURLToPath, URL } from 'url';

export default {
workspace: fileURLToPath(new URL('./www', import.meta.url)),
workspace: new URL('./www/', import.meta.url),
optimization: 'inline',
staticRouter: true,
interpolateFrontmatter: true,
Expand All @@ -19,6 +18,8 @@ export default {
greenwoodPluginPostCss(),
greenwoodPluginImportJson(),
greenwoodPluginImportCss(),
greenwoodPluginIncludeHTML(),
greenwoodPluginRendererPuppeteer(),
{
type: 'rollup',
name: 'rollup-plugin-analyzer',
Expand All @@ -32,9 +33,7 @@ export default {
})
];
}
},
greenwoodPluginIncludeHTML(),
greenwoodPluginRendererPuppeteer()
}
],
markdown: {
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.27.5",
"version": "0.28.0-alpha.5",
"packages": [
"packages/*",
"www"
Expand Down
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
skip_processing = true

[build.environment]
NODE_VERSION = "14.16.0"
NODE_VERSION = "18.12.1"

[[redirects]]
from = "/docs/tech-stack/"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"build": "cross-env __GWD_ROLLUP_MODE__=strict node . build",
"serve": "node . serve",
"develop": "node . develop",
"test": "cross-env BROWSERSLIST_IGNORE_OLD_DATA=true __GWD_ROLLUP_MODE__=strict c8 mocha --exclude \"./packages/**/test/cases/exp-*/**\" \"./packages/**/**/*.spec.js\"",
"test": "cross-env BROWSERSLIST_IGNORE_OLD_DATA=true __GWD_ROLLUP_MODE__=strict NODE_NO_WARNINGS=1 c8 mocha --exclude \"./packages/**/test/cases/exp-*/**\" --exclude \"./packages/cli/test/cases/serve.default.ssr/**\" --exclude \"./packages/cli/test/cases/*.default.ssr-static-export/**\" \"./packages/**/**/*.spec.js\"",
"test:exp": "cross-env BROWSERSLIST_IGNORE_OLD_DATA=true __GWD_ROLLUP_MODE__=strict NODE_NO_WARNINGS=1 node --experimental-loader $(pwd)/test/test-loader.js ./node_modules/mocha/bin/mocha \"./packages/**/**/*.spec.js\"",
"test:exp:win": "cross-env BROWSERSLIST_IGNORE_OLD_DATA=true __GWD_ROLLUP_MODE__=strict NODE_NO_WARNINGS=1 node --experimental-loader file:\\\\%cd%\\test\\test-loader.js ./node_modules/mocha/bin/mocha --exclude \"./packages/init/test/cases/**\" \"./packages/**/**/*.spec.js\"",
"test:tdd": "yarn test --watch",
Expand Down
19 changes: 13 additions & 6 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
{
"name": "@greenwood/cli",
"version": "0.27.5",
"version": "0.28.0-alpha.5",
"description": "Greenwood CLI.",
"type": "module",
"repository": "https://github.com/ProjectEvergreen/greenwood/tree/master/packages/cli",
"repository": "https://github.com/ProjectEvergreen/greenwood",
"homepage": "https://github.com/ProjectEvergreen/greenwood/tree/master/packages/cli",
"author": "Owen Buckley <owen@thegreenhouse.io>",
"license": "MIT",
"keywords": [
"Greenwood",
"Static Site Generator",
"Web Components"
"Full Stack Web Development",
"Web Components",
"HTML",
"CSS",
"JavaScript",
"NodeJS"
],
"engines": {
"node": ">=14"
"node": ">=18.12.1"
},
"bin": {
"greenwood": "./src/index.js"
Expand All @@ -24,9 +30,11 @@
"access": "public"
},
"dependencies": {
"@rollup/plugin-commonjs": "^21.0.0",
"@rollup/plugin-node-resolve": "^13.0.0",
"@rollup/plugin-replace": "^2.3.4",
"@rollup/plugin-terser": "^0.1.0",
"@web/rollup-plugin-import-meta-assets": "^1.0.0",
"acorn": "^8.0.1",
"acorn-walk": "^8.0.0",
"commander": "^2.20.0",
Expand All @@ -36,7 +44,6 @@
"koa": "^2.13.0",
"livereload": "^0.9.1",
"markdown-toc": "^1.2.0",
"node-fetch": "^2.6.1",
"node-html-parser": "^1.2.21",
"rehype-raw": "^5.0.0",
"rehype-stringify": "^8.0.0",
Expand All @@ -45,7 +52,7 @@
"remark-rehype": "^7.0.0",
"rollup": "^2.58.0",
"unified": "^9.2.0",
"wc-compiler": "~0.6.1"
"wc-compiler": "~0.8.0"
},
"devDependencies": {
"@babel/runtime": "^7.10.4",
Expand Down
13 changes: 8 additions & 5 deletions packages/cli/src/commands/build.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { bundleCompilation } from '../lifecycles/bundle.js';
import { checkResourceExists } from '../lib/resource-utils.js';
import { copyAssets } from '../lifecycles/copy.js';
import fs from 'fs';
import fs from 'fs/promises';
import { preRenderCompilationWorker, preRenderCompilationCustom, staticRenderCompilation } from '../lifecycles/prerender.js';
import { ServerInterface } from '../lib/server-interface.js';

Expand All @@ -11,12 +12,14 @@ const runProductionBuild = async (compilation) => {
try {
const { prerender } = compilation.config;
const outputDir = compilation.context.outputDir;
const prerenderPlugin = (compilation.config.plugins.filter(plugin => plugin.type === 'renderer') || []).length === 1
? compilation.config.plugins.filter(plugin => plugin.type === 'renderer')[0].provider(compilation)
const prerenderPlugin = compilation.config.plugins.find(plugin => plugin.type === 'renderer')
? compilation.config.plugins.find(plugin => plugin.type === 'renderer').provider(compilation)
: {};

if (!fs.existsSync(outputDir)) {
fs.mkdirSync(outputDir);
if (!await checkResourceExists(outputDir)) {
await fs.mkdir(outputDir, {
recursive: true
});
}

if (prerender || prerenderPlugin.prerender) {
Expand Down
20 changes: 9 additions & 11 deletions packages/cli/src/commands/eject.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
import fs from 'fs';
import path from 'path';
import { fileURLToPath, URL } from 'url';
import fs from 'fs/promises';

const ejectConfiguration = async (compilation) => {
return new Promise(async (resolve, reject) => {
try {
const configFilePath = fileURLToPath(new URL('../config', import.meta.url));
const configFiles = fs.readdirSync(configFilePath);
const configFileDirUrl = new URL('../config/', import.meta.url);
const configFiles = await fs.readdir(configFileDirUrl);

configFiles.forEach((configFile) => {
const from = path.join(configFilePath, configFile);
const to = `${compilation.context.projectDirectory}/${configFile}`;
for (const file of configFiles) {
const from = new URL(`./${file}`, configFileDirUrl);
const to = new URL(`./${file}`, compilation.context.projectDirectory);

fs.copyFileSync(from, to);
await fs.copyFile(from, to);

console.log(`Ejected ${configFile} successfully.`);
});
console.log(`Ejected ${file} successfully.`);
}

console.debug('all configuration files ejected.');

Expand Down
6 changes: 4 additions & 2 deletions packages/cli/src/commands/serve.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { getStaticServer, getHybridServer } from '../lifecycles/serve.js';
import { checkResourceExists } from '../lib/resource-utils.js';

const runProdServer = async (compilation) => {

return new Promise(async (resolve, reject) => {

try {
const port = compilation.config.port;
const hasDynamicRoutes = compilation.graph.filter(page => page.isSSR && ((page.data.hasOwnProperty('static') && !page.data.static) || !compilation.config.prerender));
const server = hasDynamicRoutes.length > 0 ? getHybridServer : getStaticServer;
const hasApisDir = await checkResourceExists(compilation.context.apisDir);
const hasDynamicRoutes = compilation.graph.find(page => page.isSSR && !page.data.static);
const server = (hasDynamicRoutes && !compilation.config.prerender) || hasApisDir ? getHybridServer : getStaticServer;

(await server(compilation)).listen(port, () => {
console.info(`Started server at localhost:${port}`);
Expand Down