Skip to content

Commit

Permalink
Bump version of node, npm and ts (#16151)
Browse files Browse the repository at this point in the history
* Bump version of node, npm and ts

* Fix compilation errors

* Logging

* Fix for windows

* comments

* More comments

* Fixes

* Fixes

* Fix formatting
  • Loading branch information
DonJayamanne authored Oct 28, 2024
1 parent 8f20e71 commit d4faf9a
Show file tree
Hide file tree
Showing 18 changed files with 99 additions and 81 deletions.
6 changes: 2 additions & 4 deletions .devcontainer/dev-with-python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ FROM mcr.microsoft.com/vscode/devcontainers/python:3
ENV NVM_DIR /usr/local/nvm
RUN mkdir -p $NVM_DIR
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
ENV NODE_VERSION 18.15.0
ENV NODE_VERSION 20.17.0
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH

RUN echo "source $NVM_DIR/nvm.sh && \
nvm install $NODE_VERSION && \
nvm alias default $NODE_VERSION && \
nvm use default && \
npm i -g npm@9.5.0" | bash
npm i -g npm@10.8.2" | bash

# Copy environment.yml (if found) to a temp locaition so we update the environment. Also
# copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists.
Expand All @@ -40,5 +40,3 @@ RUN git clone https://github.com/romkatv/powerlevel10k $HOME/.oh-my-zsh/custom/t
RUN curl https://raw.githubusercontent.com/DonJayamanne/vscode-jupyter/containerChanges/.devcontainer/.p10k.zsh > ~/.p10k.zsh
RUN echo "# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh." >> ~/.zshrc
RUN echo "[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh" >> ~/.zshrc


6 changes: 2 additions & 4 deletions .devcontainer/dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.169.0/containers/python-3-miniconda/.devcontainer/base.Dockerfile

FROM node:18.15.0-bullseye-slim
FROM node:20.17.0-bullseye-slim

RUN apt-get -y update
RUN apt-get -y install apt-utils git gnupg2 curl locales ca-certificates sudo
Expand All @@ -26,7 +26,7 @@ RUN bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "$
RUN apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts

# # Finally install npm
RUN echo "npm i -g npm@9.5.0" | bash
RUN echo "npm i -g npm@10.8.2" | bash

RUN apt install curl -y
RUN sh -c "$(curl -fsSL https://github.com/deluan/zsh-in-docker/releases/download/v1.1.5/zsh-in-docker.sh)" -- \
Expand All @@ -38,5 +38,3 @@ RUN git clone https://github.com/romkatv/powerlevel10k $HOME/.oh-my-zsh/custom/t
RUN curl https://raw.githubusercontent.com/DonJayamanne/vscode-jupyter/containerChanges/.devcontainer/.p10k.zsh > ~/.p10k.zsh
RUN echo "# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh." >> ~/.zshrc
RUN echo "[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh" >> ~/.zshrc


4 changes: 2 additions & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ on:
workflow_dispatch:

env:
NODE_VERSION: 18.15.0
NPM_VERSION: 9.5.0
NODE_VERSION: 20.17.0
NPM_VERSION: 10.8.2
PYTHON_VERSION: 3.8
DENO_VERSION: '~1.37'
MOCHA_REPORTER_JUNIT: true # Use the mocha-multi-reporters and send output to both console (spec) and JUnit (mocha-junit-reporter). Also enables a reporter which exits the process running the tests if it haven't already.
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.15.0
v20.17.0
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

### Prerequisites

1. [Node.js](https://nodejs.org/) 18.15.0
2. [npm](https://www.npmjs.com/) 9.5.0
1. [Node.js](https://nodejs.org/) 20.17.0
2. [npm](https://www.npmjs.com/) 10.8.2
3. [Python](https://www.python.org/) 3.6 or later
4. Windows, macOS, or Linux
5. [Visual Studio Code](https://code.visualstudio.com/)
Expand Down
4 changes: 2 additions & 2 deletions build/azure-pipeline.pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ extends:
displayName: Install zmq dependencies
condition: or(eq(variables.vsceTarget, ''), contains(variables.vsceTarget, 'linux'), contains(variables.vsceTarget, 'alpine'))
- script: npm i -g npm@9.5.0
displayName: npm 9.5.0
- script: npm i -g npm@10.8.2
displayName: npm 10.8.2

- task: UsePythonVersion@0
inputs:
Expand Down
4 changes: 2 additions & 2 deletions build/azure-pipeline.stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ extends:
displayName: Install zmq dependencies
condition: or(eq(variables.vsceTarget, ''), contains(variables.vsceTarget, 'linux'), contains(variables.vsceTarget, 'alpine'))
- script: npm i -g npm@9.5.0
displayName: npm 9.5.0
- script: npm i -g npm@10.8.2
displayName: npm 10.8.2

- task: UsePythonVersion@0
inputs:
Expand Down
50 changes: 34 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2224,7 +2224,7 @@
"@types/memoize-one": "^4.1.1",
"@types/mocha": "^9.1.0",
"@types/nock": "^10.0.3",
"@types/node": "^18.15.0",
"@types/node": "^20.17.0",
"@types/node-fetch": "^2.5.7",
"@types/pdfkit": "^0.11.0",
"@types/promisify-node": "^0.4.0",
Expand Down Expand Up @@ -2338,7 +2338,7 @@
"tsconfig-paths-webpack-plugin": "^3.2.0",
"tsx": "^3.13.0",
"typemoq": "^2.1.0",
"typescript": "^5.5.4",
"typescript": "^5.6.3",
"unicode-properties": "^1.3.1",
"utf-8-validate": "^5.0.8",
"util": "^0.12.4",
Expand Down
6 changes: 4 additions & 2 deletions src/notebooks/controllers/kernelSource/baseKernelSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,16 @@ export class BaseKernelSelector extends DisposableBase implements IDisposable {
let timeout: NodeJS.Timer | undefined;
this._register(
this.provider.onDidChangeStatus(() => {
timeout && clearTimeout(timeout);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
timeout && clearTimeout(timeout as any);
switch (this.provider.status) {
case 'discovering':
quickPick.busy = true;
break;
case 'idle':
timeout = setTimeout(() => (quickPick.busy = false), 500);
this._register(new Disposable(() => timeout && clearTimeout(timeout)));
// eslint-disable-next-line @typescript-eslint/no-explicit-any
this._register(new Disposable(() => timeout && clearTimeout(timeout as any)));
break;
}
}, this)
Expand Down
6 changes: 4 additions & 2 deletions src/platform/common/providerBasedQuickPick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,16 @@ export class BaseProviderBasedQuickPick<T extends { id: string }> extends Dispos
let timeout: NodeJS.Timer | undefined;
provider.onDidChangeStatus(
() => {
timeout && clearTimeout(timeout);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
timeout && clearTimeout(timeout as any);
switch (provider.status) {
case 'discovering':
quickPick.busy = true;
break;
case 'idle':
timeout = setTimeout(() => (quickPick.busy = false), 500);
disposables.push(new Disposable(() => timeout && clearTimeout(timeout)));
// eslint-disable-next-line @typescript-eslint/no-explicit-any
disposables.push(new Disposable(() => timeout && clearTimeout(timeout as any)));
break;
}
},
Expand Down
6 changes: 4 additions & 2 deletions src/standalone/intellisense/diagnosticsProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,10 @@ export class NotebookCellBangInstallDiagnosticsProvider
return;
}
const cell = this.cellsToProcess.values().next().value;
this.cellsToProcess.delete(cell);
this.analyzeNotebookCell(cell);
if (cell) {
this.cellsToProcess.delete(cell);
this.analyzeNotebookCell(cell);
}
// Schedule processing of next cell (this way we dont chew CPU and block the UI).
setTimeout(() => this.analyzeNotebookCells(), 0);
}
Expand Down
7 changes: 5 additions & 2 deletions src/standalone/userJupyterServer/jupyterPasswordConnect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,11 @@ export class JupyterPasswordConnect {

// Session cookie is the first one
if (cookies.size > 0) {
sessionCookieName = cookies.entries().next().value[0];
sessionCookieValue = cookies.entries().next().value[1];
const cookie = cookies.entries().next().value;
if (cookie) {
sessionCookieName = cookie[0];
sessionCookieValue = cookie[1];
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ export async function waitForCondition<T>(
// Start up a timer again, but don't do it until after
// the condition is false.
timer = setTimeout(timerFunc, intervalTimeoutMs);
disposables.push({ dispose: () => clearTimeout(timer) });
disposables.push({ dispose: () => clearTimeout(timer as any) });
} else {
dispose(disposables);
resolve(success as NonNullable<T>);
}
};
disposables.push({ dispose: () => clearTimeout(timer) });
disposables.push({ dispose: () => clearTimeout(timer as any) });
timer = setTimeout(timerFunc, 0);
if (cancelToken) {
cancelToken.onCancellationRequested(
Expand Down
2 changes: 1 addition & 1 deletion src/test/index.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ function activateExtensionScript() {
const initializationPromise = initialize();
const promise = Promise.race([initializationPromise, failed]);
// eslint-disable-next-line no-console
promise.finally(() => clearTimeout(timer!)).catch((e) => console.error(e));
promise.finally(() => clearTimeout(timer! as any)).catch((e) => console.error(e));
return initializationPromise;
}

Expand Down
61 changes: 28 additions & 33 deletions src/test/standardTest.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,43 +87,38 @@ async function installPythonExtension(vscodeExecutablePath: string, extensionsDi
}
console.info(`Installing Python Extension ${PythonExtension} to ${extensionsDir}`);
const cliPath = resolveCliPathFromVSCodeExecutablePath(vscodeExecutablePath, platform);
spawnSync(
cliPath,
[
'--install-extension',
PythonExtension,
'--pre-release',
'--extensions-dir',
extensionsDir,
'--disable-telemetry'
],
{
encoding: 'utf-8',
stdio: 'inherit'
}
);
await installExtension(PythonExtension, cliPath, extensionsDir, ['--pre-release']);

// Make sure pylance is there too as we'll use it for intellisense tests
console.info(`Installing Pylance Extension to ${extensionsDir}`);
spawnSync(
cliPath,
['--install-extension', PylanceExtension, '--extensions-dir', extensionsDir, '--disable-telemetry'],
{
encoding: 'utf-8',
stdio: 'inherit'
}
);
await installExtension(PylanceExtension, cliPath, extensionsDir);

// Make sure renderers is there too as we'll use it for widget tests
console.info(`Installing Renderer Extension to ${extensionsDir}`);
spawnSync(
cliPath,
['--install-extension', RendererExtension, '--extensions-dir', extensionsDir, '--disable-telemetry'],
{
encoding: 'utf-8',
stdio: 'inherit'
}
);
await installExtension(RendererExtension, cliPath, extensionsDir);
}

// Make sure renderers is there too as we'll use it for widget tests
async function installExtension(extension: string, cliPath: string, extensionsDir: string, args: string[] = []) {
console.info(`Installing ${extension} Extension to ${extensionsDir}`);
args = ['--install-extension', extension, ...args, '--extensions-dir', extensionsDir, '--disable-telemetry'];
const output =
process.platform === 'win32'
? spawnSync(cliPath, args, {
encoding: 'utf-8',
stdio: 'inherit',
shell: true // Without this, node 20 would fail to install the extensions on Windows. See https://github.com/nodejs/node/issues/52554
})
: spawnSync(cliPath, args, {
encoding: 'utf-8',
stdio: 'inherit'
});

if (output.error) {
throw output.error;
}
if (output.stderr) {
console.error(`Error installing ${extension} Extension to ${extensionsDir}`);
console.error(output.stderr);
}
}

async function createSettings(): Promise<string> {
Expand Down
2 changes: 1 addition & 1 deletion src/test/testRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export async function run(): Promise<void> {
timer = setTimeout(() => reject(ex), MAX_EXTENSION_ACTIVATION_TIME);
});
const promise = Promise.race([initialize(), failed]);
promise.then(() => clearTimeout(timer!)).catch(() => clearTimeout(timer!));
promise.then(() => clearTimeout(timer! as any)).catch(() => clearTimeout(timer! as any));
return promise;
}
// Run the tests.
Expand Down
2 changes: 1 addition & 1 deletion src/test/vscode-notebook-perf/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.15.0
v20.17.0

0 comments on commit d4faf9a

Please sign in to comment.