Skip to content

Commit 07e4f9d

Browse files
authored
breaking: require Node.js version >= 20.19 (#1671)
* fix: By bumping node version to v20.19 we will fix the @handlebars/parser issue - Reported in #1669 * fix: Do use lockfile! - Without this the CI fails, because it installs incorrect dependencies * fix: Node version requirement >= 20.19 - Fixes #1669 Caused by: ``` require() of ES Module .../.pnpm/@handlebars+parser@file+..+handlebars-parser/node_modules/@handlebars/parser/dist/cjs/index.js not supported. Instead change the require of index.js in null to a dynamic import() which is available in all CommonJS modules. ``` When using older node in consuming app.
1 parent 0f35016 commit 07e4f9d

File tree

8 files changed

+97
-86
lines changed

8 files changed

+97
-86
lines changed

.github/workflows/addon-docs.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
# Fetch tags pointing to the current commit
2424
TAGS=$(git tag --points-at $GITHUB_SHA)
2525
echo "Tags found: $TAGS"
26-
26+
2727
# Check if a tag exists and if the ref is 'refs/heads/main' or 'refs/heads/master'
2828
if [ -n "$TAGS" ] && ([[ "${GITHUB_REF}" == "refs/heads/main" ]] || [[ "${GITHUB_REF}" == "refs/heads/master" ]]); then
2929
echo "SHORT_CIRCUIT=true" >> $GITHUB_ENV
@@ -41,7 +41,7 @@ jobs:
4141
cache: pnpm
4242
- name: Install Dependencies
4343
if: env.SHORT_CIRCUIT == 'false'
44-
run: pnpm install --no-lockfile
44+
run: pnpm install
4545
- name: Deploy Docs
4646
if: env.SHORT_CIRCUIT == 'false'
47-
run: pnpm ember deploy production
47+
run: pnpm ember deploy production

.github/workflows/ci-cd.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Install Node
2222
uses: actions/setup-node@v4
2323
with:
24-
node-version: 18.x
24+
node-version: 20.19.x
2525
- uses: pnpm/action-setup@v4
2626
with:
2727
version: 9
@@ -46,12 +46,12 @@ jobs:
4646
- name: Install Node
4747
uses: actions/setup-node@v4
4848
with:
49-
node-version: 18.x
49+
node-version: 20.19.x
5050
- uses: pnpm/action-setup@v4
5151
with:
5252
version: 9
5353
- name: Install dependencies
54-
run: pnpm i --no-lockfile
54+
run: pnpm i
5555
- name: Test
5656
run: pnpm test:${{ matrix.script-name }}
5757

@@ -71,7 +71,7 @@ jobs:
7171
- name: Install Node
7272
uses: actions/setup-node@v4
7373
with:
74-
node-version: 18.x
74+
node-version: 20.19.x
7575
- uses: pnpm/action-setup@v4
7676
with:
7777
version: 9
@@ -103,7 +103,7 @@ jobs:
103103
- name: Install Node
104104
uses: actions/setup-node@v4
105105
with:
106-
node-version: 18.x
106+
node-version: 20.19.x
107107
- uses: pnpm/action-setup@v4
108108
with:
109109
version: 9

.tool-versions

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
nodejs 18.20.3
2-
pnpm 9.9.0
1+
nodejs 20.19
2+
pnpm 9.9.0

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"@glimmer/component": "^1.1.2",
3737
"@glimmer/syntax": "^0.87.1",
3838
"@glimmer/tracking": "^1.1.2",
39-
"@handlebars/parser": "^2.1.0",
39+
"@handlebars/parser": "^2.2.0",
4040
"broccoli-bridge": "^1.0.0",
4141
"broccoli-caching-writer": "^3.0.3",
4242
"broccoli-filter": "^1.3.0",
@@ -190,7 +190,7 @@
190190
}
191191
},
192192
"engines": {
193-
"node": ">= 18"
193+
"node": ">= 20.19"
194194
},
195195
"publishConfig": {
196196
"registry": "https://registry.npmjs.org"

pnpm-lock.yaml

+73-72
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test-apps/new-addon/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"webpack": "^5.96.1"
5353
},
5454
"engines": {
55-
"node": "16.* || >= 18"
55+
"node": ">= 20.19"
5656
},
5757
"ember": {
5858
"edition": "octane"

tests/dummy/app/templates/docs/deploying.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ jobs:
136136
cache: pnpm
137137
- name: Install Dependencies
138138
if: env.SHORT_CIRCUIT == 'false'
139-
run: pnpm install --no-lockfile
139+
run: pnpm install
140140
- name: Deploy Docs
141141
if: env.SHORT_CIRCUIT == 'false'
142142
run: pnpm ember deploy production

tests/dummy/app/templates/docs/usage.md

+10
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ To use AddonDocs, your addon must have a `devDependency` of **Ember v2.8** or hi
77
Note that your addon can still support older versions of Ember – it's just that you won't be able to run your AddonDocs documentation site against those older versions. (This means you also cannot write acceptance/application tests against your docs sites on older versions of Ember.)
88

99

10+
### Node version
11+
12+
Due to [this issue](https://github.com/ember-learn/ember-cli-addon-docs/issues/1669) there is a requirement for consuming app to use [node>=20.19](https://nodejs.org/en/blog/release/v20.19.0/). Otherwise you might get following error during build:
13+
14+
```
15+
require() of ES Module .../.pnpm/@handlebars+parser@file+..+handlebars-parser/node_modules/@handlebars/parser/dist/cjs/index.js not supported.
16+
Instead change the require of index.js in null to a dynamic import() which is available in all CommonJS modules.
17+
```
18+
19+
1020
## Installation
1121

1222
```sh

0 commit comments

Comments
 (0)