Skip to content

Commit

Permalink
Merge pull request #12558 from backstage/rugvip/node18
Browse files Browse the repository at this point in the history
Switch Node.js versions to 16 & 18
  • Loading branch information
Rugvip committed Nov 7, 2022
2 parents 7c75dfa + 864c876 commit dbf618b
Show file tree
Hide file tree
Showing 42 changed files with 179 additions and 112 deletions.
6 changes: 6 additions & 0 deletions .changeset/blue-items-shop.md
@@ -0,0 +1,6 @@
---
'@backstage/plugin-cost-insights': patch
'@backstage/plugin-techdocs': patch
---

Bumped `canvas` dependency to the latest version, which has better Node.js v18 support.
6 changes: 6 additions & 0 deletions .changeset/eighty-planets-train.md
@@ -0,0 +1,6 @@
---
'@backstage/backend-common': patch
'@backstage/cli': patch
---

Bumped `tar` dependency to `^6.1.12` in order to ensure Node.js v18 compatibility.
8 changes: 8 additions & 0 deletions .changeset/silent-moles-chew.md
@@ -0,0 +1,8 @@
---
'@backstage/backend-common': patch
'@backstage/plugin-kubernetes': patch
'@backstage/plugin-kubernetes-backend': patch
'@backstage/plugin-kubernetes-common': patch
---

Pin `@kubernetes/client-node` version to `0.17.0`.
19 changes: 19 additions & 0 deletions .changeset/thirty-deers-float.md
@@ -0,0 +1,19 @@
---
'@backstage/create-app': patch
---

Switched Node.js version to support version 16 & 18, rather than 14 & 16. To switch the Node.js version in your own project, apply the following change to the root `package.json`:

```diff
"engines": {
- "node": "14 || 16"
+ "node": "16 || 18"
},
```

As well as the following change to `packages/app/package.json`:

```diff
- "@types/node": "^14.14.32",
+ "@types/node": "^16.11.26",
```
5 changes: 5 additions & 0 deletions .changeset/two-timers-pump.md
@@ -0,0 +1,5 @@
---
'@backstage/cli': minor
---

Switched `tsconfig.json` to target and support `ES2021`, in line with the bump to Node.js 16 & 18.
31 changes: 31 additions & 0 deletions .changeset/witty-carrots-live.md
@@ -0,0 +1,31 @@
---
'@backstage/create-app': patch
---

Fixed incorrect comments in the templated `app-config.yaml` and `app-config.production.yaml`. The `backend.listen` directive is not in fact needed to override the `backend.baseUrl`, the backend listens to all interfaces by default. The configuration has also been updated to listen to all interfaces, rather than just IPv4 ones, as this is required for Node.js v18. The production configuration now also shows the option to specify `backend.listen` as a single string.

To apply this changes to an existing app, make the following change to `app-config.yaml`:

```diff
- # Uncomment the following host directive to bind to all IPv4 interfaces and
- # not just the baseUrl hostname.
- # host: 0.0.0.0
+ # Uncomment the following host directive to bind to specific interfaces
+ # host: 127.0.0.1
```

And the following change to `app-config.production.yaml`:

```diff
- listen:
- port: 7007
- # The following host directive binds to all IPv4 interfaces when its value
- # is "0.0.0.0". This is the most permissive setting. The right value depends
- # on your specific deployment. If you remove the host line entirely, the
- # backend will bind on the interface that corresponds to the backend.baseUrl
- # hostname.
- host: 0.0.0.0
+ # The listener can also be expressed as a single <host>:<port> string. In this case we bind to
+ # all interfaces, the most permissive setting. The right value depends on your specific deployment.
+ listen: ':7007'
```
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [14.x, 16.x]
node-version: [16.x, 18.x]

env:
CI: true
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [14.x, 16.x]
node-version: [16.x, 18.x]

env:
CI: true
Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [14.x, 16.x]
node-version: [16.x, 18.x]

services:
postgres13:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_microsite.yml
Expand Up @@ -10,7 +10,7 @@ jobs:

strategy:
matrix:
node-version: [14.x]
node-version: [16.x]

env:
CI: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_nightly.yml
Expand Up @@ -11,7 +11,7 @@ jobs:

strategy:
matrix:
node-version: [14.x]
node-version: [16.x]

env:
CI: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy_packages.yml
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x]
node-version: [16.x, 18.x]

services:
postgres13:
Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:

strategy:
matrix:
node-version: [14.x]
node-version: [16.x]

env:
CI: 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync_snyk-github-issues.yml
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
node-version: [14.x]
node-version: [16.x]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify_e2e-linux.yml
Expand Up @@ -31,7 +31,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
node-version: [14.x, 16.x]
node-version: [16.x, 18.x]

env:
CI: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify_e2e-techdocs.yml
Expand Up @@ -18,7 +18,7 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x]
node-version: [16.x, 18.x]

env:
CI: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify_e2e-tugboat.yml
Expand Up @@ -52,7 +52,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '16.x'

- name: yarn install
run: yarn --cwd cypress install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify_e2e-windows.yml
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
matrix:
os: [windows-2019]
node-version: [14.x, 16.x]
node-version: [16.x, 18.x]

env:
CI: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify_kubernetes.yml
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x]
node-version: [16.x, 18.x]

env:
CI: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify_microsite.yml
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
node-version: [14.x]
node-version: [16.x]

env:
CI: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify_windows.yml
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x]
node-version: [16.x, 18.x]

env:
CI: true
Expand Down
2 changes: 1 addition & 1 deletion contrib/docker/devops/Dockerfile
@@ -1,4 +1,4 @@
ARG IMAGE_TAG=14-alpine
ARG IMAGE_TAG=16-alpine

FROM node:${IMAGE_TAG}

Expand Down
2 changes: 1 addition & 1 deletion contrib/docker/frontend-with-nginx/Dockerfile.dockerbuild
Expand Up @@ -35,7 +35,7 @@



FROM node:14-buster AS build
FROM node:16-buster AS build

RUN mkdir /app
COPY . /app
Expand Down
4 changes: 2 additions & 2 deletions cypress/tsconfig.json
Expand Up @@ -10,7 +10,7 @@
"incremental": true,
"isolatedModules": true,
"jsx": "react",
"lib": ["DOM", "DOM.Iterable", "ScriptHost", "ES2020", "ESNext.Promise"],
"lib": ["DOM", "DOM.Iterable", "ScriptHost", "ES2021", "ESNext.Promise"],
"module": "ESNext",
"moduleResolution": "node",
"noEmit": true,
Expand All @@ -31,7 +31,7 @@
"strictNullChecks": true,
"strictPropertyInitialization": true,
"stripInternal": true,
"target": "ES2019",
"target": "ES2021",
"types": ["node", "cypress"]
}
}
4 changes: 2 additions & 2 deletions docs/features/search/how-to-guides.md
Expand Up @@ -171,6 +171,6 @@ const highlightOverride = {
};
```

[obj-mode]: https://nodejs.org/docs/latest-v14.x/api/stream.html#stream_object_mode
[read-stream]: https://nodejs.org/docs/latest-v14.x/api/stream.html#stream_readable_streams
[obj-mode]: https://nodejs.org/dist/latest-v16.x/docs/api/stream.html#stream_object_mode
[read-stream]: https://nodejs.org/dist/latest-v16.x/docs/api/stream.html#readable-streams
[async-gen]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of#iterating_over_async_generators
6 changes: 3 additions & 3 deletions docs/getting-started/running-backstage-locally.md
Expand Up @@ -21,12 +21,12 @@ This is made easy with a version manager such as
# Installing current LTS release
nvm install --lts
> Installing latest LTS version.
> Downloading and installing node v14.15.1...
> Now using node v14.15.1 (npm v6.14.8)
> Downloading and installing node v16.16.0...
> Now using node v16.16.0 (npm v8.11.0)

# Checking your version
node --version
> v14.15.1
> v16.16.0
```

- Yarn
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/quickstart-app-plugin.md
Expand Up @@ -20,7 +20,7 @@ title: Adding Custom Plugin to Existing Monorepo App
> functionality, extend the Sidebar to make our life easy. Finally, we add
> custom code to display GitHub repository information.
>
> This document assumes you have Node.js 14 active along with Yarn and Python.
> This document assumes you have Node.js 16 active along with Yarn and Python.
> Please note, that at the time of this writing, the current version is
> 0.1.1-alpha.21. This guide can still be used with future versions, just,
> verify as you go. If you run into issues, you can compare your setup with mine
Expand Down
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -2,7 +2,7 @@
"name": "root",
"private": true,
"engines": {
"node": "14 || 16"
"node": "16 || 18"
},
"scripts": {
"dev": "concurrently \"yarn start\" \"yarn start-backend\"",
Expand Down Expand Up @@ -73,6 +73,7 @@
"husky": "^8.0.0",
"lint-staged": "^13.0.0",
"minimist": "^1.2.5",
"node-gyp": "^9.1.0",
"prettier": "^2.2.1",
"semver": "^7.3.2",
"shx": "^0.3.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/backend-common/package.json
Expand Up @@ -42,7 +42,7 @@
"@backstage/types": "workspace:^",
"@google-cloud/storage": "^6.0.0",
"@keyv/redis": "^2.2.3",
"@kubernetes/client-node": "^0.17.0",
"@kubernetes/client-node": "0.17.0",
"@manypkg/get-packages": "^1.1.3",
"@octokit/rest": "^19.0.3",
"@types/cors": "^2.8.6",
Expand Down Expand Up @@ -80,7 +80,7 @@
"request": "^2.88.2",
"selfsigned": "^2.0.0",
"stoppable": "^1.1.0",
"tar": "^6.1.2",
"tar": "^6.1.12",
"uuid": "^8.3.2",
"winston": "^3.2.1",
"yauzl": "^2.10.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/config/tsconfig.json
Expand Up @@ -11,7 +11,7 @@
"incremental": true,
"isolatedModules": true,
"jsx": "react",
"lib": ["DOM", "DOM.Iterable", "ScriptHost", "ES2020"],
"lib": ["DOM", "DOM.Iterable", "ScriptHost", "ES2021"],
"module": "ESNext",
"moduleResolution": "node",
"noEmit": false,
Expand All @@ -32,7 +32,7 @@
"strictNullChecks": true,
"strictPropertyInitialization": true,
"stripInternal": true,
"target": "ES2019",
"target": "ES2021",
"types": ["node", "jest", "webpack-env"],
"useDefineForClassFields": true
}
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Expand Up @@ -117,7 +117,7 @@
"style-loader": "^3.3.1",
"sucrase": "^3.20.2",
"swc-loader": "^0.2.3",
"tar": "^6.1.2",
"tar": "^6.1.12",
"terser-webpack-plugin": "^5.1.3",
"util": "^0.12.3",
"webpack": "^5.70.0",
Expand Down
Expand Up @@ -9,14 +9,9 @@ backend:
# callers. When its value is "http://localhost:7007", it's strictly private
# and can't be reached by others.
baseUrl: http://localhost:7007
listen:
port: 7007
# The following host directive binds to all IPv4 interfaces when its value
# is "0.0.0.0". This is the most permissive setting. The right value depends
# on your specific deployment. If you remove the host line entirely, the
# backend will bind on the interface that corresponds to the backend.baseUrl
# hostname.
host: 0.0.0.0
# The listener can also be expressed as a single <host>:<port> string. In this case we bind to
# all interfaces, the most permissive setting. The right value depends on your specific deployment.
listen: ':7007'

# config options: https://node-postgres.com/api/client
database:
Expand Down
5 changes: 2 additions & 3 deletions packages/create-app/templates/default-app/app-config.yaml.hbs
Expand Up @@ -15,9 +15,8 @@ backend:
baseUrl: http://localhost:7007
listen:
port: 7007
# Uncomment the following host directive to bind to all IPv4 interfaces and
# not just the baseUrl hostname.
# host: 0.0.0.0
# Uncomment the following host directive to bind to specific interfaces
# host: 127.0.0.1
csp:
connect-src: ["'self'", 'http:', 'https:']
# Content-Security-Policy directives follow the Helmet format: https://helmetjs.github.io/#reference
Expand Down
2 changes: 1 addition & 1 deletion packages/create-app/templates/default-app/package.json.hbs
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"private": true,
"engines": {
"node": "14 || 16"
"node": "16 || 18"
},
"scripts": {
"dev": "concurrently \"yarn start\" \"yarn start-backend\"",
Expand Down
1 change: 1 addition & 0 deletions packages/e2e-test/src/commands/run.ts
Expand Up @@ -507,6 +507,7 @@ async function testBackendStart(appDir: string, ...args: string[]) {
// Skipping the whole block
throw new Error(stderr);
}
await new Promise(resolve => setTimeout(resolve, 500));

print('Try to fetch entities from the backend');
// Try fetch entities, should be ok
Expand Down

0 comments on commit dbf618b

Please sign in to comment.