Skip to content

Commit f9006ba

Browse files
authored
Bump node, update pacakges (#16718)
* Update node and ts * Remove ock * Add nock back * Updates * Updates * Fixes * Updates
1 parent 91d59f9 commit f9006ba

File tree

11 files changed

+638
-991
lines changed

11 files changed

+638
-991
lines changed

.devcontainer/dev-with-python/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ FROM mcr.microsoft.com/vscode/devcontainers/python:3
66
ENV NVM_DIR /usr/local/nvm
77
RUN mkdir -p $NVM_DIR
88
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
9-
ENV NODE_VERSION 20.17.0
9+
ENV NODE_VERSION 22.15.1
1010
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
1111
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
1212

.devcontainer/dev/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.169.0/containers/python-3-miniconda/.devcontainer/base.Dockerfile
22

3-
FROM node:20.17.0-bullseye-slim
3+
FROM node:22.15.1-bullseye-slim
44

55
RUN apt-get -y update
66
RUN apt-get -y install apt-utils git gnupg2 curl locales ca-certificates sudo

.github/workflows/build-test.yml

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

2828
env:
29-
NODE_VERSION: 20.17.0
29+
NODE_VERSION: 22.15.1
3030
NPM_VERSION: 10.8.2
3131
PYTHON_VERSION: 3.8
3232
DENO_VERSION: '~1.37'

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v20.17.0
1+
22.15.1

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
### Prerequisites
1515

16-
1. [Node.js](https://nodejs.org/) 20.17.0
16+
1. [Node.js](https://nodejs.org/) 22.15.1
1717
2. [npm](https://www.npmjs.com/) 10.8.2
1818
3. [Python](https://www.python.org/) 3.6 or later
1919
4. Windows, macOS, or Linux

package-lock.json

Lines changed: 598 additions & 950 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2369,9 +2369,9 @@
23692369
"zeromqold": "npm:zeromq@^6.0.0-beta.6"
23702370
},
23712371
"devDependencies": {
2372-
"@actions/core": "^1.9.1",
2373-
"@actions/github": "^4.0.0",
2374-
"@actions/glob": "^0.3.0",
2372+
"@actions/core": "^1.11.1",
2373+
"@actions/github": "^6.0.1",
2374+
"@actions/glob": "^0.5.0",
23752375
"@babel/polyfill": "^7.4.4",
23762376
"@istanbuljs/nyc-config-typescript": "^1.0.2",
23772377
"@sinonjs/fake-timers": "^6.0.1",
@@ -2395,8 +2395,8 @@
23952395
"@types/memoize-one": "^4.1.1",
23962396
"@types/mocha": "^10.0.10",
23972397
"@types/nock": "^10.0.3",
2398-
"@types/node": "^20.17.0",
2399-
"@types/node-fetch": "^2.5.7",
2398+
"@types/node": "^22.15.1",
2399+
"@types/node-fetch": "^2.6.12",
24002400
"@types/pdfkit": "^0.11.0",
24012401
"@types/promisify-node": "^0.4.0",
24022402
"@types/react": "^16.4.14",
@@ -2419,7 +2419,7 @@
24192419
"@types/uuid": "^3.4.3",
24202420
"@types/uuid-to-hex": "^1.1.0",
24212421
"@types/vscode-notebook-renderer": "^1.60.0",
2422-
"@types/webpack-env": "^1.18.1",
2422+
"@types/webpack-env": "^1.18.8",
24232423
"@types/ws": "^6.0.1",
24242424
"@typescript-eslint/eslint-plugin": "^6.9.0",
24252425
"@typescript-eslint/eslint-plugin-tslint": "^6.9.0",
@@ -2506,9 +2506,9 @@
25062506
"ts-mock-imports": "^1.3.0",
25072507
"ts-mockito": "^2.6.1",
25082508
"tsconfig-paths-webpack-plugin": "^3.2.0",
2509-
"tsx": "^3.13.0",
2509+
"tsx": "^4.19.4",
25102510
"typemoq": "^2.1.0",
2511-
"typescript": "^5.7.2",
2511+
"typescript": "^5.8.3",
25122512
"unicode-properties": "^1.3.1",
25132513
"utf-8-validate": "^5.0.8",
25142514
"util": "^0.12.4",

src/platform/vscode-path/platform.ts

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ export interface INodeProcess {
3939
arch: string;
4040
env: IProcessEnvironment;
4141
versions?: {
42+
node?: string;
4243
electron?: string;
44+
chrome?: string;
4345
};
44-
sandboxed?: boolean;
4546
type?: string;
4647
cwd: () => string;
4748
}
@@ -57,15 +58,13 @@ let nodeProcess: INodeProcess | undefined = undefined;
5758
if (typeof globals.vscode !== 'undefined' && typeof globals.vscode.process !== 'undefined') {
5859
// Native environment (sandboxed)
5960
nodeProcess = globals.vscode.process;
60-
} else if (typeof process !== 'undefined') {
61+
} else if (typeof process !== 'undefined' && typeof process?.versions?.node === 'string') {
6162
// Native environment (non-sandboxed)
6263
nodeProcess = process;
6364
}
6465

6566
const isElectronProcess = typeof nodeProcess?.versions?.electron === 'string';
66-
const isElectronRenderer =
67-
isElectronProcess && nodeProcess?.type && ['renderer', 'utility'].includes(nodeProcess?.type);
68-
export const isElectronSandboxed = isElectronRenderer && nodeProcess?.sandboxed;
67+
const isElectronRenderer = isElectronProcess && nodeProcess?.type === 'renderer';
6968

7069
interface INavigator {
7170
userAgent: string;
@@ -74,25 +73,8 @@ interface INavigator {
7473
}
7574
declare const navigator: INavigator;
7675

77-
// Web environment
78-
if (typeof navigator === 'object' && !isElectronRenderer) {
79-
_userAgent = navigator.userAgent;
80-
_isWindows = _userAgent.indexOf('Windows') >= 0;
81-
_isMacintosh = _userAgent.indexOf('Macintosh') >= 0;
82-
_isIOS =
83-
(_userAgent.indexOf('Macintosh') >= 0 ||
84-
_userAgent.indexOf('iPad') >= 0 ||
85-
_userAgent.indexOf('iPhone') >= 0) &&
86-
!!navigator.maxTouchPoints &&
87-
navigator.maxTouchPoints > 0;
88-
_isLinux = _userAgent.indexOf('Linux') >= 0;
89-
_isWeb = true;
90-
_locale = navigator.language;
91-
_language = _locale;
92-
}
93-
9476
// Native environment
95-
else if (typeof nodeProcess === 'object') {
77+
if (typeof nodeProcess === 'object') {
9678
_isWindows = nodeProcess.platform === 'win32';
9779
_isMacintosh = nodeProcess.platform === 'darwin';
9880
_isLinux = nodeProcess.platform === 'linux';
@@ -115,6 +97,23 @@ else if (typeof nodeProcess === 'object') {
11597
_isNative = true;
11698
}
11799

100+
// Web environment
101+
else if (typeof navigator === 'object' && !isElectronRenderer) {
102+
_userAgent = navigator.userAgent;
103+
_isWindows = _userAgent.indexOf('Windows') >= 0;
104+
_isMacintosh = _userAgent.indexOf('Macintosh') >= 0;
105+
_isIOS =
106+
(_userAgent.indexOf('Macintosh') >= 0 ||
107+
_userAgent.indexOf('iPad') >= 0 ||
108+
_userAgent.indexOf('iPhone') >= 0) &&
109+
!!navigator.maxTouchPoints &&
110+
navigator.maxTouchPoints > 0;
111+
_isLinux = _userAgent.indexOf('Linux') >= 0;
112+
_isWeb = true;
113+
_locale = navigator.language;
114+
_language = _locale;
115+
}
116+
118117
// Unknown environment
119118
else {
120119
console.error('Unable to resolve platform.');

src/test/mocks/mementos.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class MockMemento implements Memento {
1212
public get<T>(key: string, defaultValue?: T): T {
1313
const exists = this._value.hasOwnProperty(key);
1414
// eslint-disable-next-line @typescript-eslint/no-explicit-any
15-
return exists ? this._value[key] : (defaultValue! as any);
15+
return exists ? (this._value[key] as any) : (defaultValue! as any);
1616
}
1717
// eslint-disable-next-line @typescript-eslint/no-explicit-any
1818
public update(key: string, value: any): Thenable<void> {

src/test/mocks/vsc/extHostedTypes.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -793,12 +793,11 @@ export namespace vscMockExtHostedTypes {
793793

794794
get(uri: vscUri.URI): TextEdit[] {
795795
if (!this._textEdits.has(uri.toString())) {
796-
// @ts-ignore
797-
return undefined;
796+
return [];
798797
}
799798
// @ts-ignore
800799
const { edits } = this._textEdits.get(uri.toString());
801-
return edits ? edits.slice() : undefined;
800+
return edits ? edits.slice() : [];
802801
}
803802

804803
entries(): [vscUri.URI, TextEdit[]][] {

src/webviews/webview-side/ipywidgets/renderer/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ function convertVSCodeOutputToExecuteResultOrDisplayData(outputItem: OutputItem)
1818
_vsc_test_cellIndex?: number;
1919
})
2020
| undefined {
21-
return outputItem.mime.toLowerCase().includes('json') ? outputItem.json() : outputItem.text();
21+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
22+
return outputItem.mime.toLowerCase().includes('json') ? outputItem.json() : (outputItem.text() as any);
2223
}
2324

2425
/**

0 commit comments

Comments
 (0)