Skip to content

Commit 316f7ef

Browse files
royraRoy Razon
andauthored
fix compatibility with node v22 (#493)
- remove import `with` keyword, see #492. tried replacing with newer `assert` syntax but it was [breaking](nodejs/node#52104 (comment)) older node 18 versions. - upgrade azure package to support node v22 - bump packaged oclif node version to latest LTS (20.13.1) - bump node version for CI workflows to 20.x - keep supported version in package.json to >=18.0.0 --------- Co-authored-by: Roy Razon <roy@livecycle.io>
1 parent 8e54df5 commit 316f7ef

14 files changed

Lines changed: 53 additions & 43 deletions

File tree

.github/workflows/awesome-lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
fetch-depth: 0
1515
- uses: actions/setup-node@v4
1616
with:
17-
node-version: 18
17+
node-version: '20.x'
1818
- name: Check awesome-list linter
1919
# https://github.com/sindresorhus/awesome/blob/main/pull_request_template.md
2020
run: npx --yes awesome-lint ./README.md

.github/workflows/check-package-mismatches.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ jobs:
1212
- uses: actions/checkout@v4
1313
- uses: actions/setup-node@v4
1414
with:
15-
node-version: 18
15+
node-version: '20.x'
1616
- name: Check mismatched dependencies in workspace
1717
run: npx --yes syncpack@11.2.1 check-mismatches

.github/workflows/gh-release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727

2828
- uses: actions/setup-node@v4
2929
with:
30-
node-version: '18.x'
30+
node-version: '20.x'
3131
cache: yarn
3232

3333
- run: yarn

.github/workflows/lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
- uses: actions/setup-node@v4
1717
with:
18-
node-version: '18.x'
18+
node-version: '20.x'
1919
cache: yarn
2020

2121
- run: yarn

.github/workflows/npm-publish-canary.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626

2727
- uses: actions/setup-node@v4
2828
with:
29-
node-version: '18.x'
29+
node-version: '20.x'
3030
cache: yarn
3131

3232
- run: yarn

.github/workflows/test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
- uses: actions/setup-node@v4
1515
with:
16-
node-version: '18.x'
16+
node-version: '20.x'
1717
cache: yarn
1818

1919
- run: yarn
@@ -31,7 +31,7 @@ jobs:
3131

3232
- uses: actions/setup-node@v4
3333
with:
34-
node-version: '18.x'
34+
node-version: '20.x'
3535
cache: yarn
3636

3737
- run: yarn

packages/cli/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@
9494
"topicSeparator": " ",
9595
"update": {
9696
"node": {
97-
"version": "18.19.0",
97+
"version": "20.13.1",
9898
"options": [
99-
"--no-warnings=ExperimentalWarning",
99+
"--disable-warning=ExperimentalWarning",
100100
"--enable-source-maps"
101101
]
102102
},

packages/driver-azure/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"@azure/arm-resources": "^5.2.0",
1919
"@azure/arm-storage": "^18.2.0",
2020
"@azure/arm-subscriptions": "^5.1.0",
21-
"@azure/identity": "^3.2.2",
21+
"@azure/identity": "^4.2.0",
2222
"@azure/logger": "^1.0.4",
2323
"@azure/storage-blob": "^12.17.0",
2424
"@inquirer/prompts": "^3.3.0",
@@ -59,4 +59,4 @@
5959
"prepack": "yarn clean && yarn build",
6060
"prepare": "cd ../.. && husky install"
6161
}
62-
}
62+
}

packages/driver-kube-pod/src/driver/client/common.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ export const bodyOrUndefined = async <T, Response extends { body: T } = { body:
1515
export type HasMetadata = { metadata?: k8s.V1ObjectMeta }
1616
export type HasKind = { kind?: string }
1717
export type Package = { version: string; name: string }
18+
19+
export const defaultPackage: Package = { name: 'preevy', version: 'unknown' } as const

packages/driver-kube-pod/src/driver/client/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {
3131
addAllTypesAnnotation,
3232
readAllTypesAnnotation,
3333
} from './metadata.js'
34-
import { Package } from './common.js'
34+
import { Package, defaultPackage } from './common.js'
3535
import { logError } from './log-error.js'
3636

3737
const stringify = stringifyModule.default
@@ -186,7 +186,7 @@ export const kubeCreationClient = ({
186186
namespace: string
187187
profileId: string
188188
template: Buffer | string | Promise<Buffer | string>
189-
package: Package | Promise<Package>
189+
package: Package | undefined | Promise<Package | undefined>
190190
storageClass: string | undefined
191191
storageSize: number
192192
}) => {
@@ -278,7 +278,7 @@ export const kubeCreationClient = ({
278278
})
279279
),
280280
strategy: serverSideApply
281-
? applyStrategies.serverSideApply({ fieldManager: (await packageDetails).name })
281+
? applyStrategies.serverSideApply({ fieldManager: (await packageDetails ?? defaultPackage).name })
282282
: applyStrategies.clientSideApply,
283283
})
284284

0 commit comments

Comments
 (0)