Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
with:
node-version: '20.x'
node-version: '24.x'
cache: 'yarn'
- run: yarn install --frozen-lockfile
- run: yarn test:coverage
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Install node
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
with:
node-version: '20.x'
node-version: '24.x'
cache: 'yarn'

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync_lab_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
- name: Install Node
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
with:
node-version: '20.x'
node-version: '24.x'

- name: Install npm dependencies
run: |
Expand Down
65 changes: 33 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"dist:osx-arm64-dev": "yarn build && CSC_IDENTITY_AUTO_DISCOVERY=false electron-builder --macos --arm64 --publish never",
"dist:win-64": "yarn build && electron-builder --win --publish never",
"dist:win-arm64": "yarn build && yarn electron-builder --arm64 --publish never",
"update_workflow_conda_lock": "cd workflow_env && rimraf *.lock && conda-lock --kind explicit -f publish_env.yaml && cd -",
"update_conda_lock": "cd env_installer && rimraf *.lock && conda-lock --kind explicit -f jlab_server.yaml && cd -",
"update_workflow_conda_lock": "cd workflow_env && rimraf --glob *.lock && conda-lock --kind explicit -f publish_env.yaml && cd -",
"update_conda_lock": "cd env_installer && rimraf --glob *.lock && conda-lock --kind explicit -f jlab_server.yaml && cd -",
"clean_env_installer": "rimraf ./env_installer/jlab_server.tar.gz && rimraf ./env_installer/jlab_server",
"create_env_installer": "yarn clean_env_installer && conda-lock install --no-validate-platform --prefix ./env_installer/jlab_server ./env_installer/conda-${ENV_PLATFORM}.lock && yarn copy_extras_to_bundled_env && conda pack -p ./env_installer/jlab_server -o ./env_installer/jlab_server.tar.gz",
"create_env_installer:linux-64": "ENV_PLATFORM=linux-64 yarn create_env_installer",
Expand Down Expand Up @@ -157,6 +157,7 @@
"darkModeSupport": true,
"hardenedRuntime": true,
"gatekeeperAssess": false,
"minimumSystemVersion": "12.0.0",
"artifactName": "${productName}-${arch}.${ext}",
"extraResources": [
{
Expand All @@ -182,54 +183,54 @@
"repository": "https://github.com/jupyterlab/jupyterlab-desktop",
"license": "BSD-3-Clause",
"devDependencies": {
"@electron/notarize": "^3.1.1",
"@eslint/js": "^10.0.1",
"@jupyter-notebook/web-components": "0.9.1",
"@leeoniya/ufuzzy": "1.0.14",
"@playwright/test": "^1.59.1",
"@types/ejs": "^3.1.0",
"@types/js-yaml": "^4.0.3",
"@leeoniya/ufuzzy": "1.0.19",
"@playwright/test": "^1.61.0",
"@types/ejs": "^3.1.5",
"@types/js-yaml": "^4.0.9",
"@types/node": "^24",
"@types/semver": "^7.3.4",
"@types/tar": "^6.1.5",
"@types/yargs": "^17.0.18",
"@vitest/coverage-v8": "^4.1.5",
"electron": "^27.0.2",
"electron-builder": "^24.9.1",
"electron-notarize": "^1.2.2",
"@types/semver": "^7.7.1",
"@types/tar": "^6.1.13",
"@types/yargs": "^17.0.35",
"@vitest/coverage-v8": "^4.1.9",
"electron": "^42.4.0",
"electron-builder": "^26.15.3",
"electron-playwright-helpers": "^2.1.0",
"eslint": "^10.5.0",
"eslint-config-prettier": "^10.1.8",
"fs-extra": "~9.1.0",
"fs-extra": "^11.3.5",
"globals": "^17.6.0",
"istextorbinary": "^6.0.0",
"meow": "^6.0.1",
"istextorbinary": "^9.5.0",
"meow": "^9.0.0",
"node-watch": "^0.7.4",
"prettier": "~2.1.1",
"read-package-tree": "^5.1.6",
"rimraf": "~3.0.0",
"shx": "^0.3.4",
"rimraf": "^4.4.1",
"shx": "^0.4.0",
"typescript": "^6.0.0",
"typescript-eslint": "^8.61.0",
"vitest": "^4.1.5",
"webpack": "^5.76.0",
"typescript-eslint": "^8.61.1",
"vitest": "^4.1.9",
"webpack": "^5.107.2",
"webpack-cli": "^4.5.0"
},
"resolutions": {
"serialize-javascript": "^6.0.2",
"micromatch": "^4.0.8"
},
"dependencies": {
"@lumino/signaling": "^1.10.0",
"ejs": "^3.1.10",
"electron-log": "^4.4.8",
"fast-xml-parser": "^5.8.0",
"@lumino/signaling": "^2.1.5",
"ejs": "^6.0.1",
"electron-log": "^5.4.4",
"fast-xml-parser": "^5.9.0",
"fix-path": "^3.0.0",
"js-yaml": "^4.1.0",
"semver": "^7.5.4",
"tar": "^6.2.1",
"update-electron-app": "^2.0.1",
"which": "^2.0.2",
"winreg": "^1.2.4",
"yargs": "^17.6.2"
"js-yaml": "^4.2.0",
"semver": "^7.8.4",
"tar": "^7.5.16",
"update-electron-app": "^3.2.0",
"which": "^7.0.0",
"winreg": "^1.2.5",
"yargs": "^17.7.2"
}
}
9 changes: 5 additions & 4 deletions scripts/notarize.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/* Based on https://kilianvalkhof.com/2019/electron/notarizing-your-electron-application/ */

const { notarize } = require('electron-notarize');

exports.default = async function notarizing(context) {
const { electronPlatformName, appOutDir } = context;
if (
Expand All @@ -11,14 +9,17 @@ exports.default = async function notarizing(context) {
return;
}

// @electron/notarize v3 is ESM; import it dynamically from this CJS hook.
// notarytool is the only tool now, so the v2 `tool` and `appBundleId` keys
// are gone.
const { notarize } = await import('@electron/notarize');

const appName = context.packager.appInfo.productFilename;

return await notarize({
appBundleId: 'org.jupyter.jupyterlab-desktop',
appPath: `${appOutDir}/${appName}.app`,
appleId: process.env.APPLEID,
appleIdPassword: process.env.APPLEIDPASS,
tool: 'notarytool',
teamId: process.env.APPLE_TEAM_ID
});
};
3 changes: 2 additions & 1 deletion src/main/app.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import { updateElectronApp } from 'update-electron-app';
import {
app,
autoUpdater,
Expand Down Expand Up @@ -567,7 +568,7 @@ export class JupyterApplication implements IApplication, IDisposable {
log.error(message);
});

require('update-electron-app')();
updateElectronApp();
}

private _validateRemoteServerUrl(url: string): Promise<IJupyterServerInfo> {
Expand Down
8 changes: 4 additions & 4 deletions src/main/dialog/themedview.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import { BrowserView } from 'electron';
import { WebContentsView } from 'electron';
import * as fs from 'fs';
import * as path from 'path';
import { DarkThemeBGColor, LightThemeBGColor } from '../utils';

export class ThemedView {
constructor(options: ThemedView.IOptions) {
this._isDarkTheme = options.isDarkTheme;
this._view = new BrowserView({
this._view = new WebContentsView({
webPreferences: {
preload: options.preload || path.join(__dirname, './preload.js')
}
Expand All @@ -19,7 +19,7 @@ export class ThemedView {
);
}

get view(): BrowserView {
get view(): WebContentsView {
return this._view;
}

Expand Down Expand Up @@ -119,7 +119,7 @@ export class ThemedView {
}

private _isDarkTheme: boolean;
private _view: BrowserView;
private _view: WebContentsView;
}

export namespace ThemedView {
Expand Down
29 changes: 15 additions & 14 deletions src/main/labview/labview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// Distributed under the terms of the Modified BSD License.

import {
BrowserView,
clipboard,
dialog,
Menu,
MenuItemConstructorOptions
MenuItemConstructorOptions,
WebContentsView
} from 'electron';
import log from 'electron-log';
import * as path from 'path';
Expand Down Expand Up @@ -56,7 +56,7 @@ export class LabView implements IDisposable {
partition = `partition-${Date.now()}`;
}
}
this._view = new BrowserView({
this._view = new WebContentsView({
webPreferences: {
preload: path.join(__dirname, './preload.js'),
partition
Expand Down Expand Up @@ -126,7 +126,7 @@ export class LabView implements IDisposable {
}
}

public get view(): BrowserView {
public get view(): WebContentsView {
return this._view;
}

Expand Down Expand Up @@ -305,21 +305,22 @@ export class LabView implements IDisposable {
});
}

dispose(): Promise<void> {
async dispose(): Promise<void> {
this._evm.dispose();

// if local or remote with no data persistence, clear session data
if (
this._sessionConfig.isRemote &&
!this._sessionConfig.persistSessionData
!this._sessionConfig.persistSessionData &&
!this._parent.window.isDestroyed()
) {
if (!this._parent.window.isDestroyed()) {
return clearSession(this._view.webContents.session);
} else {
return Promise.resolve();
}
} else {
return Promise.resolve();
await clearSession(this._view.webContents.session);
}

// A WebContentsView's webContents is not destroyed on detach or window
// close (electron/electron#42884); close it so the dropped view frees its renderer.
if (!this._view.webContents.isDestroyed()) {
this._view.webContents.close();
}
}

Expand Down Expand Up @@ -547,7 +548,7 @@ export class LabView implements IDisposable {
});
}

private _view: BrowserView;
private _view: WebContentsView;
private _parent: SessionWindow;
private _sessionConfig: SessionConfig;
private _jlabBaseUrl: string;
Expand Down
32 changes: 11 additions & 21 deletions src/main/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -992,31 +992,21 @@ export class Registry implements IRegistry, IDisposable {
}
}

private _getExecutableInstances(
private async _getExecutableInstances(
executableName: string,
path: string
): Promise<string[]> {
return new Promise<string[]>((resolve, reject) => {
which(
executableName,
{ all: true, path: path },
(err: any, result: string | string[]) => {
if (err) {
if (err.code === 'ENOENT') {
resolve([]);
} else {
reject(err);
}
} else {
if (typeof result === 'string') {
resolve([result]);
} else {
resolve(result);
}
}
}
);
// which v7 is promise-only (the callback API was removed in v3); nothrow
// returns null instead of throwing when the executable is not found.
const result = await which(executableName, {
all: true,
path,
nothrow: true
});
if (!result) {
return [];
}
return typeof result === 'string' ? [result] : result;
}

private _runPythonModuleCommand(
Expand Down
Loading
Loading