Skip to content

Commit 35e68a5

Browse files
docs/document new minimum NodeJS LTS version requirements (#159)
1 parent 7ea14d4 commit 35e68a5

File tree

6 files changed

+38
-22
lines changed

6 files changed

+38
-22
lines changed

src/pages/docs/introduction/setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Greenwood has a few options for getting a new project started. You can also chec
1010

1111
## Init
1212

13-
The recommended way to start a new Greenwood project, our **init** CLI will scaffold out a starter project for you. Just run a single command and then follow the prompts.
13+
The recommended way to start a new Greenwood project, our **init** CLI will scaffold out a starter project for you. Just run a single command and then follow the prompts. Make sure you have the [latest LTS version of Node](https://nodejs.org/en/download) installed.
1414

1515
To scaffold into the _current_ directory, run:
1616

src/pages/docs/pages/server-rendering.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -302,24 +302,42 @@ For request handling, Greenwood will pass a native `Request` object and a Greenw
302302

303303
## Custom Imports
304304

305-
To use custom imports on the server side for prerendering or SSR use cases (ex. CSS, JSON), you will need to invoke Greenwood using **NodeJS** from the CLI and pass it the `--loaders` flag along with the path to Greenwood's provided loader function.
305+
To use custom imports (non JavaScript resources) on the server side for prerendering or SSR use cases, you will need to invoke Greenwood using **NodeJS** from the CLI and pass the `--imports` flag along with the path to Greenwood's provided register function. _**This feature requires NodeJS version `>=21.10.0`**_.
306306

307307
<!-- prettier-ignore-start -->
308-
<app-ctc-block variant="shell" paste-contents="node --loader ./node_modules/@greenwood/cli/src/loader.js ./node_modules/@greenwood/cli/src/index.js <command>">
308+
309+
<app-ctc-block variant="shell" paste-contents="node --import @greenwood/cli/register ./node_modules/@greenwood/cli/src/index.js <command>">
309310

310311
```shell
311-
$ node --loader ./node_modules/@greenwood/cli/src/loader.js ./node_modules/@greenwood/cli/src/index.js <command>
312+
$ node --import @greenwood/cli/register ./node_modules/@greenwood/cli/src/index.js <command>
312313
```
313314

314315
</app-ctc-block>
315316

316317
<!-- prettier-ignore-end -->
317318

318-
Then you will be able to run this, or for any custom format you want using a plugin.
319+
Or most commonly as an npm script in your _package.json_
320+
321+
<!-- prettier-ignore-start -->
322+
323+
<app-ctc-block variant="snippet" heading="package.json">
324+
325+
```json
326+
{
327+
"scripts": {
328+
"build": "node --import @greenwood/cli/register ./node_modules/@greenwood/cli/src/index.js build"
329+
}
330+
}
331+
```
332+
333+
</app-ctc-block>
334+
335+
<!-- prettier-ignore-end -->
336+
337+
Now any custom resource plugins will operate on the server side, enabling compatibility with non-JavaScript resources not supported by NodeJS, like CSS Module Scripts.
319338

320339
```js
321340
import sheet from "./styles.css" with { type: "css" };
322-
import data from "./data.json" with { type: "json" };
323341

324-
console.log({ sheet, data });
342+
console.log({ sheet });
325343
```

src/pages/guides/getting-started/index.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,14 @@ This _Getting Started_ guide will walk you through creating a basic static conte
2020

2121
You will need the following installed on your machine:
2222

23-
1. [**NodeJS LTS**](https://nodejs.org/en/download/package-manager) (required) - We recommend using a Node version manager (like NVM) to install the latest stable version of Node
23+
1. [**NodeJS LTS**](https://nodejs.org/en/download) (required) - We recommend using a Node version manager (like NVM) to install the latest stable version of Node
2424
1. [**Git**](https://git-scm.com/) (optional) - Can be useful for [cloning and inspecting](https://github.com/ProjectEvergreen/greenwood-getting-started) the companion repo for this guide, or otherwise managing your Greenwood project through version control
2525

26-
You can verify that both NodeJS and NPM are installed correctly by checking their version from the command line:
26+
You can verify that NodeJS has been installed correctly by checking its version from the command line:
2727

2828
```bash
2929
$ node -v
30-
v18.12.1
31-
32-
$ npm -v
33-
8.19.2
30+
v22.13.0
3431
```
3532

3633
## Setup

src/pages/guides/hosting/aws.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ If you're using GitHub, you can use GitHub Actions to automate the pushing of bu
6767
1. At the root of your repo add a GitHub Action called _.github/workflows/publish.yml_ and adapt as needed for your own branch, build commands, and package manager.
6868

6969
<!-- prettier-ignore-start -->
70+
7071
<app-ctc-block variant="snippet" heading=".github/workflows/publish.yml">
7172

7273
```yml
@@ -79,14 +80,14 @@ If you're using GitHub, you can use GitHub Actions to automate the pushing of bu
7980

8081
jobs:
8182
build:
82-
runs-on: ubuntu-20.04
83+
runs-on: ubuntu-latest
8384

8485
# match to your version of NodeJS
8586
steps:
86-
- uses: actions/checkout@v2
87-
- uses: actions/setup-node@v3
87+
- uses: actions/checkout@v4
88+
- uses: actions/setup-node@v4
8889
with:
89-
node-version: 18.20.2
90+
node-version: 22
9091

9192
- name: Install Dependencies
9293
run: |

src/pages/guides/hosting/github.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ Following the steps [outlined here](https://pages.github.com/), first make sure
6767

6868
jobs:
6969
build-and-deploy:
70-
runs-on: ubuntu-20.04
70+
runs-on: ubuntu-latest
7171

7272
# match to your version of NodeJS
7373
steps:
74-
- uses: actions/checkout@v2
75-
- uses: actions/setup-node@v3
74+
- uses: actions/checkout@v4
75+
- uses: actions/setup-node@v4
7676
with:
77-
node-version: 18.20.2
77+
node-version: 22
7878

7979
# or replace with yarn, pnpm, etc
8080
- name: Install Dependencies

src/pages/guides/hosting/netlify.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ For static hosting, nothing is needed other than connecting your repository and
2727
skip_processing = true
2828

2929
[build.environment]
30-
NODE_VERSION = "18.x"
30+
NODE_VERSION = "22.x"
3131
```
3232

3333
</app-ctc-block>

0 commit comments

Comments
 (0)