From 5eb1d84e482963cf7c0c05987666999c5f6f613b Mon Sep 17 00:00:00 2001 From: Asher Date: Wed, 16 Oct 2024 19:49:04 -0800 Subject: [PATCH] Update import paths --- patches/insecure-notification.diff | 6 +++--- patches/integration.diff | 14 +++++++++++--- patches/logout.diff | 16 ++++++++-------- patches/update-check.diff | 12 ++++++------ 4 files changed, 28 insertions(+), 20 deletions(-) diff --git a/patches/insecure-notification.diff b/patches/insecure-notification.diff index f589b85d7..7e2768f96 100644 --- a/patches/insecure-notification.diff +++ b/patches/insecure-notification.diff @@ -17,9 +17,9 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts --- code-server.orig/lib/vscode/src/vs/workbench/browser/client.ts +++ code-server/lib/vscode/src/vs/workbench/browser/client.ts @@ -1,7 +1,10 @@ - import { Disposable } from 'vs/base/common/lifecycle'; -+import { localize } from 'vs/nls'; -+import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; + import { Disposable } from "../../base/common/lifecycle.js"; ++import { localize } from '../../nls.js'; ++import { INotificationService, Severity } from '../../platform/notification/common/notification.js'; export class CodeServerClient extends Disposable { constructor ( diff --git a/patches/integration.diff b/patches/integration.diff index abc9d166a..f687f62c0 100644 --- a/patches/integration.diff +++ b/patches/integration.diff @@ -126,7 +126,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts --- /dev/null +++ code-server/lib/vscode/src/vs/workbench/browser/client.ts @@ -0,0 +1,46 @@ -+import { Disposable } from 'vs/base/common/lifecycle'; ++import { Disposable } from "../../base/common/lifecycle.js"; + +export class CodeServerClient extends Disposable { + constructor ( @@ -276,12 +276,20 @@ Index: code-server/lib/vscode/src/server-main.js =================================================================== --- code-server.orig/lib/vscode/src/server-main.js +++ code-server/lib/vscode/src/server-main.js -@@ -339,4 +339,7 @@ function prompt(question) { +@@ -339,4 +339,15 @@ function prompt(question) { }); } -start(); -+export default async function loadCodeWithNls() { ++async function loadCodeWithNls() { + const nlsConfiguration = await resolveNLSConfiguration({ userLocale: 'en', osLocale: 'en', commit: product.commit, userDataPath: '', nlsMetadataPath: __dirname }); + return loadCode(nlsConfiguration); +} ++ ++// This alias prevents the name getting mangled during obfuscation which would ++// make it difficult to import. ++export { loadCodeWithNls as loadCodeWithNls }; ++ ++if (!process.env.CODE_SERVER_PARENT_PID) { ++ start(); ++} diff --git a/patches/logout.diff b/patches/logout.diff index afa839ef5..53a0ae0b3 100644 --- a/patches/logout.diff +++ b/patches/logout.diff @@ -53,14 +53,14 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts --- code-server.orig/lib/vscode/src/vs/workbench/browser/client.ts +++ code-server/lib/vscode/src/vs/workbench/browser/client.ts @@ -1,11 +1,15 @@ - import { Disposable } from 'vs/base/common/lifecycle'; - import { localize } from 'vs/nls'; -+import { MenuId, MenuRegistry } from 'vs/platform/actions/common/actions'; -+import { CommandsRegistry } from 'vs/platform/commands/common/commands'; - import { ILogService } from 'vs/platform/log/common/log'; - import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; - import { IProductService } from 'vs/platform/product/common/productService'; - import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; + import { Disposable } from "../../base/common/lifecycle.js"; + import { localize } from '../../nls.js'; ++import { MenuId, MenuRegistry } from '../../platform/actions/common/actions.js'; ++import { CommandsRegistry } from '../../platform/commands/common/commands.js'; + import { ILogService } from '../../platform/log/common/log.js'; + import { INotificationService, Severity } from '../../platform/notification/common/notification.js'; + import { IProductService } from '../../platform/product/common/productService.js'; + import { IStorageService, StorageScope, StorageTarget } from '../../platform/storage/common/storage.js'; export class CodeServerClient extends Disposable { + static LOGOUT_COMMAND_ID = 'code-server.logout'; diff --git a/patches/update-check.diff b/patches/update-check.diff index 4f14e4055..c621cb741 100644 --- a/patches/update-check.diff +++ b/patches/update-check.diff @@ -13,12 +13,12 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts --- code-server.orig/lib/vscode/src/vs/workbench/browser/client.ts +++ code-server/lib/vscode/src/vs/workbench/browser/client.ts @@ -1,10 +1,16 @@ - import { Disposable } from 'vs/base/common/lifecycle'; - import { localize } from 'vs/nls'; -+import { ILogService } from 'vs/platform/log/common/log'; - import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; -+import { IProductService } from 'vs/platform/product/common/productService'; -+import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; + import { Disposable } from "../../base/common/lifecycle.js"; + import { localize } from '../../nls.js'; ++import { ILogService } from '../../platform/log/common/log.js'; + import { INotificationService, Severity } from '../../platform/notification/common/notification.js'; ++import { IProductService } from '../../platform/product/common/productService.js'; ++import { IStorageService, StorageScope, StorageTarget } from '../../platform/storage/common/storage.js'; export class CodeServerClient extends Disposable { constructor (