Skip to content

Commit f5cfa6d

Browse files
authored
Update node version in SDK and CLI (#935)
1 parent 835f5a0 commit f5cfa6d

6 files changed

Lines changed: 101 additions & 85 deletions

File tree

.changeset/dirty-owls-itch.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'e2b': patch
3+
'@e2b/cli': patch
4+
---
5+
6+
Update node

codegen.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ RUN pip install black==23.7.0 pyyaml==6.0.2 e2b-openapi-python-client==0.26.2
3939
# Install Node.js and npm
4040
RUN apt-get update && \
4141
apt-get install -y curl && \
42-
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
42+
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
4343
apt-get install -y nodejs && \
4444
apt-get clean && \
4545
rm -rf /var/lib/apt/lists/*

packages/cli/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"@types/handlebars": "^4.1.0",
5454
"@types/inquirer": "^9.0.7",
5555
"@types/json2md": "^1.5.4",
56-
"@types/node": "^18.18.6",
56+
"@types/node": "^20.19.19",
5757
"@types/npmcli__package-json": "^4.0.4",
5858
"@types/statuses": "^2.0.5",
5959
"@types/update-notifier": "6.0.5",
@@ -96,6 +96,6 @@
9696
"yup": "^1.3.2"
9797
},
9898
"engines": {
99-
"node": ">=18"
99+
"node": ">=20"
100100
}
101-
}
101+
}

packages/cli/src/commands/template/buildWithProxy.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,19 +156,22 @@ async function proxy(
156156
},
157157
} as http.RequestOptions
158158

159-
if (!options.headers!.Authorization) {
159+
// Type-safe header manipulation
160+
const headers = options.headers as http.OutgoingHttpHeaders
161+
162+
if (!headers.Authorization) {
160163
if (targetUrl.pathname.startsWith('/v2/token')) {
161-
options.headers!.Authorization = `Basic ${credsBase64}`
164+
headers.Authorization = `Basic ${credsBase64}`
162165
} else if (
163166
targetUrl.pathname == '/v2/' ||
164167
targetUrl.pathname == '/v2'
165168
) {
166-
options.headers!.Authorization = `Bearer ${credsBase64}`
169+
headers.Authorization = `Bearer ${credsBase64}`
167170
} else if (
168171
// Exclude the artifacts-uploads namespace
169172
!targetUrl.pathname.startsWith('/artifacts-uploads/namespaces')
170173
) {
171-
options.headers!.Authorization = `Bearer ${token}`
174+
headers.Authorization = `Bearer ${token}`
172175
}
173176
}
174177

packages/js-sdk/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
},
4545
"devDependencies": {
4646
"@testing-library/react": "^16.2.0",
47-
"@types/node": "^18.18.6",
47+
"@types/node": "^20.19.19",
4848
"@types/platform": "^1.3.6",
4949
"@types/react": "^18.3.11",
5050
"@typescript-eslint/eslint-plugin": "^7.11.0",
@@ -97,9 +97,9 @@
9797
"tar": "^7.4.3"
9898
},
9999
"engines": {
100-
"node": ">=18"
100+
"node": ">=20"
101101
},
102102
"browserslist": [
103103
"defaults"
104104
]
105-
}
105+
}

0 commit comments

Comments
 (0)