Skip to content

Commit

Permalink
Chore: Update to node 20 (grafana#76097)
Browse files Browse the repository at this point in the history
* chore(node): update node version to 20

* chore(node): bump to 20.8.0, update drone variables

* chore(drone): update yaml config

* chore(yarn): bump yarn to latest to fix building binaries ERR_IMPORT_ASSERTION_TYPE_MISSING errors

* test(grafana-data): update whitespace in time formats for node 20 (18.13+)

* chore(node): move to LTS 20.8.1

* chore(node): bump to LTS 20.9.0
  • Loading branch information
jackw authored Oct 26, 2023
1 parent 314bea9 commit 69af9f9
Show file tree
Hide file tree
Showing 10 changed files with 262 additions and 262 deletions.
70 changes: 35 additions & 35 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ steps:
- commands:
- yarn install --immutable
depends_on: []
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: yarn-install
- commands:
- apk add --update git bash
- yarn betterer ci
depends_on:
- yarn-install
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: betterer-frontend
- commands:
- apk add --update curl jq bash
Expand Down Expand Up @@ -158,7 +158,7 @@ steps:
- yarn-install
environment:
TEST_MAX_WORKERS: 50%
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: test-frontend
trigger:
event:
Expand Down Expand Up @@ -222,7 +222,7 @@ steps:
- commands:
- yarn install --immutable
depends_on: []
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: yarn-install
- commands:
- yarn run prettier:check
Expand All @@ -232,7 +232,7 @@ steps:
- yarn-install
environment:
TEST_MAX_WORKERS: 50%
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: lint-frontend
- commands:
- apk add --update git
Expand All @@ -247,7 +247,7 @@ steps:
- yarn run i18n:compile
depends_on:
- yarn-install
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: verify-i18n
trigger:
event:
Expand Down Expand Up @@ -529,7 +529,7 @@ steps:
- commands:
- yarn install --immutable
depends_on: []
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: yarn-install
- commands:
- apk add --update jq bash
Expand All @@ -540,7 +540,7 @@ steps:
- yarn-install
environment:
NODE_OPTIONS: --max_old_space_size=8192
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: build-frontend-packages
- failure: ignore
image: grafana/drone-downstream
Expand Down Expand Up @@ -678,7 +678,7 @@ steps:
- build-frontend-packages
environment:
NODE_OPTIONS: --max_old_space_size=4096
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: build-storybook
when:
paths:
Expand Down Expand Up @@ -1035,7 +1035,7 @@ steps:
- commands:
- yarn install --immutable
depends_on: []
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: yarn-install
- commands:
- pip3 install codespell
Expand All @@ -1048,7 +1048,7 @@ steps:
- yarn-install
environment:
NODE_OPTIONS: --max_old_space_size=8192
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: lint-docs
- commands:
- mkdir -p /hugo/content/docs/grafana/latest
Expand Down Expand Up @@ -1388,7 +1388,7 @@ steps:
- commands:
- yarn install --immutable
depends_on: []
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: yarn-install
- commands:
- pip3 install codespell
Expand All @@ -1401,7 +1401,7 @@ steps:
- yarn-install
environment:
NODE_OPTIONS: --max_old_space_size=8192
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: lint-docs
- commands:
- mkdir -p /hugo/content/docs/grafana/latest
Expand Down Expand Up @@ -1462,22 +1462,22 @@ steps:
- commands:
- yarn install --immutable
depends_on: []
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: yarn-install
- commands:
- apk add --update git bash
- yarn betterer ci
depends_on:
- yarn-install
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: betterer-frontend
- commands:
- yarn run ci:test-frontend
depends_on:
- yarn-install
environment:
TEST_MAX_WORKERS: 50%
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: test-frontend
trigger:
branch: main
Expand Down Expand Up @@ -1519,7 +1519,7 @@ steps:
- commands:
- yarn install --immutable
depends_on: []
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: yarn-install
- commands:
- yarn run prettier:check
Expand All @@ -1529,7 +1529,7 @@ steps:
- yarn-install
environment:
TEST_MAX_WORKERS: 50%
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: lint-frontend
- commands:
- apk add --update git
Expand All @@ -1544,7 +1544,7 @@ steps:
- yarn run i18n:compile
depends_on:
- yarn-install
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: verify-i18n
trigger:
branch: main
Expand Down Expand Up @@ -1778,7 +1778,7 @@ steps:
- commands:
- yarn install --immutable
depends_on: []
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: yarn-install
- commands:
- apk add --update jq
Expand All @@ -1789,7 +1789,7 @@ steps:
- yarn install --mode=update-lockfile
depends_on:
- yarn-install
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: update-package-json-version
- commands:
- apk add --update jq bash
Expand All @@ -1801,7 +1801,7 @@ steps:
- update-package-json-version
environment:
NODE_OPTIONS: --max_old_space_size=8192
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: build-frontend-packages
- commands:
- /src/grafana-build package --distro=linux/amd64,linux/arm64 --go-version=1.20.10
Expand Down Expand Up @@ -1926,7 +1926,7 @@ steps:
- build-frontend-packages
environment:
NODE_OPTIONS: --max_old_space_size=4096
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: build-storybook
when:
paths:
Expand Down Expand Up @@ -1976,7 +1976,7 @@ steps:
GRAFANA_MISC_STATS_API_KEY:
from_secret: grafana_misc_stats_api_key
failure: ignore
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: publish-frontend-metrics
when:
repo:
Expand Down Expand Up @@ -2058,7 +2058,7 @@ steps:
environment:
NPM_TOKEN:
from_secret: npm_token
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: release-canary-npm-packages
when:
paths:
Expand Down Expand Up @@ -2686,7 +2686,7 @@ steps:
- commands:
- yarn install --immutable
depends_on: []
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: yarn-install
- commands:
- ./bin/build artifacts npm retrieve --tag ${DRONE_TAG}
Expand Down Expand Up @@ -2953,22 +2953,22 @@ steps:
- commands:
- yarn install --immutable
depends_on: []
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: yarn-install
- commands:
- apk add --update git bash
- yarn betterer ci
depends_on:
- yarn-install
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: betterer-frontend
- commands:
- yarn run ci:test-frontend
depends_on:
- yarn-install
environment:
TEST_MAX_WORKERS: 50%
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: test-frontend
trigger:
event:
Expand Down Expand Up @@ -3365,22 +3365,22 @@ steps:
- commands:
- yarn install --immutable
depends_on: []
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: yarn-install
- commands:
- apk add --update git bash
- yarn betterer ci
depends_on:
- yarn-install
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: betterer-frontend
- commands:
- yarn run ci:test-frontend
depends_on:
- yarn-install
environment:
TEST_MAX_WORKERS: 50%
image: node:18.12.0-alpine
image: node:20.9.0-alpine
name: test-frontend
trigger:
cron:
Expand Down Expand Up @@ -4386,7 +4386,7 @@ steps:
- commands:
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM alpine/git:2.40.1
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM golang:1.20.10-alpine
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM node:18.12.0-alpine
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM node:20.9.0-alpine
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM google/cloud-sdk:431.0.0
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM grafana/grafana-ci-deploy:1.3.3
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM alpine:3.18.3
Expand Down Expand Up @@ -4420,7 +4420,7 @@ steps:
- commands:
- trivy --exit-code 1 --severity HIGH,CRITICAL alpine/git:2.40.1
- trivy --exit-code 1 --severity HIGH,CRITICAL golang:1.20.10-alpine
- trivy --exit-code 1 --severity HIGH,CRITICAL node:18.12.0-alpine
- trivy --exit-code 1 --severity HIGH,CRITICAL node:20.9.0-alpine
- trivy --exit-code 1 --severity HIGH,CRITICAL google/cloud-sdk:431.0.0
- trivy --exit-code 1 --severity HIGH,CRITICAL grafana/grafana-ci-deploy:1.3.3
- trivy --exit-code 1 --severity HIGH,CRITICAL alpine:3.18.3
Expand Down Expand Up @@ -4667,6 +4667,6 @@ kind: secret
name: gcr_credentials
---
kind: signature
hmac: 29a933affceb9cc39b285d936de9e6327deedbb80f1285fa645d596f89ede442
hmac: 975f4bc4ea819f11b9abf46a1e17fc55161551ab02b5c6a905393def886ad4ae

...
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.12.0
v20.9.0
426 changes: 213 additions & 213 deletions .yarn/releases/yarn-3.6.1.cjs → .yarn/releases/yarn-3.6.4.cjs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ nodeLinker: pnp
packageExtensions:
'@storybook/[email protected]':
dependencies:
'@storybook/react-webpack5': '7.4.5'
'@storybook/react-webpack5': 7.4.5
[email protected]:
dependencies:
assert: 2.0.0
Expand Down Expand Up @@ -35,7 +35,7 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-outdated.cjs
spec: 'https://mskelton.dev/yarn-outdated/v2'

yarnPath: .yarn/releases/yarn-3.6.1.cjs
yarnPath: .yarn/releases/yarn-3.6.4.cjs
# Uncomment the following lines if you want to use Verdaccio local npm registry. Read more at packages/README.md
# npmScopes:
# grafana:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1

ARG BASE_IMAGE=alpine:3.18.3
ARG JS_IMAGE=node:18-alpine3.18
ARG JS_IMAGE=node:20-alpine3.18
ARG JS_PLATFORM=linux/amd64
ARG GO_IMAGE=golang:1.20.10-alpine3.18

Expand Down
4 changes: 2 additions & 2 deletions contribute/developer-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ We recommend using [Homebrew](https://brew.sh/) for installing any missing depen
```
brew install git
brew install go
brew install node@18
brew install node@20
npm install -g yarn
```

Expand Down Expand Up @@ -61,7 +61,7 @@ To remove precommit hooks, run
make lefthook-uninstall
```

> [!NOTE]
> [!NOTE]
> Contributors working on the frontend are highly encouraged to install the precommit hooks, even if your IDE formats on save, so the `.betterer.results` file is kept up to sync.
## Build Grafana
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -442,9 +442,9 @@
]
},
"engines": {
"node": ">= 18"
"node": ">= 20"
},
"packageManager": "[email protected].1",
"packageManager": "[email protected].4",
"dependenciesMeta": {
"[email protected]": {
"unplugged": true
Expand Down
6 changes: 3 additions & 3 deletions packages/grafana-data/src/datetime/formats.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('Date Formats', () => {
''
);

expect(format).toBe('MM/DD/YYYY, hh:mm:ss A');
expect(format).toBe('MM/DD/YYYY, hh:mm:ssA');
});
});

Expand Down Expand Up @@ -52,8 +52,8 @@ describe('systemDateFormats', () => {

it('contains correct browser-localized date formats', () => {
systemDateFormats.useBrowserLocale();
expect(systemDateFormats.fullDate).toBe('MM/DD/YYYY, hh:mm:ss A');
expect(systemDateFormats.fullDateMS).toBe('MM/DD/YYYY, hh:mm:ss.SSS A');
expect(systemDateFormats.fullDate).toBe('MM/DD/YYYY, hh:mm:ssA');
expect(systemDateFormats.fullDateMS).toBe('MM/DD/YYYY, hh:mm:ss.SSSA');
expect(systemDateFormats.interval.millisecond).toBe('HH:mm:ss.SSS');
expect(systemDateFormats.interval.second).toBe('HH:mm:ss');
expect(systemDateFormats.interval.minute).toBe('HH:mm');
Expand Down
Loading

0 comments on commit 69af9f9

Please sign in to comment.