Skip to content

Commit 9374a57

Browse files
committed
Merge branch 'code-server-v2' into main-patch
2 parents 1b5c8e1 + 0e9d248 commit 9374a57

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1246
-162
lines changed

.yarnrc

-4
This file was deleted.

build/gulpfile.reh.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,10 @@ const serverWithWebEntryPoints = [
125125
...vscodeWebEntryPoints
126126
];
127127

128-
function getNodeVersion() {
128+
function getNodeVersion () {
129+
// NOTE@coder: Always use the current version to avoid native module errors.
130+
return process.versions.node;
131+
129132
const yarnrc = fs.readFileSync(path.join(REPO_ROOT, 'remote', '.yarnrc'), 'utf8');
130133
const target = /^target "(.*)"$/m.exec(yarnrc)[1];
131134
return target;
@@ -358,7 +361,7 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
358361
const minifyTask = task.define(`minify-vscode-${type}`, task.series(
359362
optimizeTask,
360363
util.rimraf(`out-vscode-${type}-min`),
361-
common.minifyTask(`out-vscode-${type}`, `https://ticino.blob.core.windows.net/sourcemaps/${commit}/core`)
364+
common.minifyTask(`out-vscode-${type}`, '')
362365
));
363366
gulp.task(minifyTask);
364367

build/lib/node.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
77
const path = require("path");
88
const fs = require("fs");
99
const root = path.dirname(path.dirname(__dirname));
10-
const yarnrcPath = path.join(root, 'remote', '.yarnrc');
11-
const yarnrc = fs.readFileSync(yarnrcPath, 'utf8');
12-
const version = /^target\s+"([^"]+)"$/m.exec(yarnrc)[1];
10+
// NOTE@coder: Always use the current version to avoid native module errors.
11+
// const yarnrcPath = path.join(root, 'remote', '.yarnrc');
12+
// const yarnrc = fs.readFileSync(yarnrcPath, 'utf8');
13+
// const version = /^target\s+"([^"]+)"$/m.exec(yarnrc)[1];
14+
const version = process.versions.node;
1315
const platform = process.platform;
1416
const arch = platform === 'darwin' ? 'x64' : process.arch;
1517
const node = platform === 'win32' ? 'node.exe' : 'node';

build/lib/node.ts

+5-7
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,15 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import * as path from 'path';
7-
import * as fs from 'fs';
87

98
const root = path.dirname(path.dirname(__dirname));
10-
const yarnrcPath = path.join(root, 'remote', '.yarnrc');
11-
const yarnrc = fs.readFileSync(yarnrcPath, 'utf8');
12-
const version = /^target\s+"([^"]+)"$/m.exec(yarnrc)![1];
13-
9+
// NOTE@coder: Always use the current version to avoid native module errors.
10+
// const yarnrcPath = path.join(root, 'remote', '.yarnrc');
11+
// const yarnrc = fs.readFileSync(yarnrcPath, 'utf8');
12+
// const version = /^target\s+"([^"]+)"$/m.exec(yarnrc)[1];
13+
const version = process.versions.node;
1414
const platform = process.platform;
1515
const arch = platform === 'darwin' ? 'x64' : process.arch;
16-
1716
const node = platform === 'win32' ? 'node.exe' : 'node';
1817
const nodePath = path.join(root, '.build', 'node', `v${version}`, `${platform}-${arch}`, node);
19-
2018
console.log(nodePath);

build/lib/util.js

+2
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ function streamToPromise(stream) {
269269
}
270270
exports.streamToPromise = streamToPromise;
271271
function getElectronVersion() {
272+
// NOTE@coder: Always use the current version to avoid native module errors.
273+
return process.versions.node;
272274
const yarnrc = fs.readFileSync(path.join(root, '.yarnrc'), 'utf8');
273275
const target = /^target "(.*)"$/m.exec(yarnrc)[1];
274276
return target;

build/lib/util.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,8 @@ export function streamToPromise(stream: NodeJS.ReadWriteStream): Promise<void> {
336336
}
337337

338338
export function getElectronVersion(): string {
339+
// NOTE@coder: Always use the current version to avoid native module errors.
340+
return process.versions.node;
339341
const yarnrc = fs.readFileSync(path.join(root, '.yarnrc'), 'utf8');
340342
const target = /^target "(.*)"$/m.exec(yarnrc)![1];
341343
return target;
@@ -403,4 +405,3 @@ export function buildWebNodePaths(outDir: string) {
403405
result.taskName = 'build-web-node-paths';
404406
return result;
405407
}
406-

extensions/postinstall.js

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ function processRoot() {
2424
rimraf.sync(filePath);
2525
}
2626
}
27+
28+
// Delete .bin so it doesn't contain broken symlinks that trip up nfpm.
29+
rimraf.sync(path.join(__dirname, 'node_modules', '.bin'));
2730
}
2831

2932
function processLib() {

package.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@
6464
"@vscode/sudo-prompt": "^9.3.0",
6565
"@vscode/vscode-languagedetection": "1.0.21",
6666
"applicationinsights": "1.0.8",
67+
"cookie": "^0.4.1",
68+
"forwarded-parse": "^2.1.2",
6769
"graceful-fs": "4.2.8",
6870
"http-proxy-agent": "^2.1.0",
6971
"https-proxy-agent": "^2.2.3",
7072
"iconv-lite-umd": "0.6.8",
7173
"jschardet": "3.0.0",
72-
"keytar": "7.2.0",
7374
"minimist": "^1.2.5",
7475
"native-is-elevated": "0.4.3",
75-
"native-keymap": "3.0.1",
7676
"native-watchdog": "1.3.0",
7777
"node-pty": "0.11.0-beta11",
7878
"spdlog": "^0.13.0",
@@ -130,7 +130,6 @@
130130
"cssnano": "^4.1.11",
131131
"debounce": "^1.0.0",
132132
"deemon": "^1.4.0",
133-
"electron": "13.5.1",
134133
"eslint": "6.8.0",
135134
"eslint-plugin-header": "3.1.1",
136135
"eslint-plugin-jsdoc": "^19.1.0",
@@ -220,6 +219,9 @@
220219
"url": "https://github.com/microsoft/vscode/issues"
221220
},
222221
"optionalDependencies": {
222+
"electron": "13.5.1",
223+
"keytar": "7.2.0",
224+
"native-keymap": "3.0.1",
223225
"vscode-windows-registry": "1.0.4",
224226
"windows-foreground-love": "0.4.0",
225227
"windows-mutex": "0.4.1",

product.json

+34-15
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,35 @@
11
{
2-
"nameShort": "Code - OSS",
3-
"nameLong": "Code - OSS",
4-
"applicationName": "code-oss",
5-
"dataFolderName": ".vscode-oss",
6-
"win32MutexName": "vscodeoss",
7-
"licenseName": "MIT",
8-
"licenseUrl": "https://github.com/microsoft/vscode/blob/main/LICENSE.txt",
2+
"nameShort": "Code Server",
3+
"nameLong": "Code Server",
4+
"applicationName": "code-server",
5+
"dataFolderName": ".code-server",
6+
"win32MutexName": "codeserver",
97
"serverGreeting": [],
10-
"win32DirName": "Microsoft Code OSS",
11-
"win32NameVersion": "Microsoft Code OSS",
8+
"licenseName": "MIT",
9+
"licenseUrl": "https://github.com/cdr/code-server/blob/main/LICENSE.txt",
10+
"win32DirName": "Code Server OSS",
11+
"win32NameVersion": "Code Server OSS",
1212
"win32RegValueName": "CodeOSS",
1313
"win32AppId": "{{E34003BB-9E10-4501-8C11-BE3FAA83F23F}",
1414
"win32x64AppId": "{{D77B7E06-80BA-4137-BCF4-654B95CCEBC5}",
1515
"win32arm64AppId": "{{D1ACE434-89C5-48D1-88D3-E2991DF85475}",
1616
"win32UserAppId": "{{C6065F05-9603-4FC4-8101-B9781A25D88E}",
1717
"win32x64UserAppId": "{{CC6B787D-37A0-49E8-AE24-8559A032BE0C}",
1818
"win32arm64UserAppId": "{{3AEBF0C8-F733-4AD4-BADE-FDB816D53D7B}",
19-
"win32AppUserModelId": "Microsoft.CodeOSS",
20-
"win32ShellNameShort": "C&ode - OSS",
21-
"darwinBundleIdentifier": "com.visualstudio.code.oss",
22-
"linuxIconName": "com.visualstudio.code.oss",
19+
"win32AppUserModelId": "Coder.CodeServer",
20+
"win32ShellNameShort": "C&ode Server",
21+
"darwinBundleIdentifier": "com.coder.code.server",
22+
"linuxIconName": "com.coder.code.server",
2323
"licenseFileName": "LICENSE.txt",
24-
"reportIssueUrl": "https://github.com/microsoft/vscode/issues/new",
24+
"reportIssueUrl": "https://github.com/cdr/code-server/issues/new",
2525
"urlProtocol": "code-oss",
2626
"webviewContentExternalBaseUrlTemplate": "https://{{uuid}}.vscode-webview.net/insider/dc1a6699060423b8c4d2ced736ad70195378fddf/out/vs/workbench/contrib/webview/browser/pre/",
2727
"extensionAllowedProposedApi": [
2828
"ms-vscode.vscode-js-profile-flame",
2929
"ms-vscode.vscode-js-profile-table",
3030
"GitHub.remotehub",
31-
"GitHub.remotehub-insiders"
31+
"GitHub.remotehub-insiders",
32+
"coder.vscode-link"
3233
],
3334
"builtInExtensions": [
3435
{
@@ -91,5 +92,23 @@
9192
"publisherDisplayName": "Microsoft"
9293
}
9394
}
95+
],
96+
"//": "https://github.com/VSCodium/vscodium/pull/155/files",
97+
"documentationUrl": "https://go.microsoft.com/fwlink/?LinkID=533484#vscode",
98+
"keyboardShortcutsUrlMac": "https://go.microsoft.com/fwlink/?linkid=832143",
99+
"keyboardShortcutsUrlLinux": "https://go.microsoft.com/fwlink/?linkid=832144",
100+
"keyboardShortcutsUrlWin": "https://go.microsoft.com/fwlink/?linkid=832145",
101+
"introductoryVideosUrl": "https://go.microsoft.com/fwlink/?linkid=832146",
102+
"tipsAndTricksUrl": "https://go.microsoft.com/fwlink/?linkid=852118",
103+
"newsletterSignupUrl": "https://www.research.net/r/vsc-newsletter",
104+
"extensionsGallery": {
105+
"serviceUrl": "https://open-vsx.org/vscode/gallery",
106+
"itemUrl": "https://open-vsx.org/vscode/item",
107+
"resourceUrlTemplate": "https://open-vsx.org/vscode/asset/{publisher}/{name}/{version}/Microsoft.VisualStudio.Code.WebResources/{path}",
108+
"controlUrl": "",
109+
"recommendationsUrl": ""
110+
},
111+
"linkProtectionTrustedDomains": [
112+
"https://open-vsx.org"
94113
]
95114
}

remote/.yarnrc

-3
This file was deleted.

resources/server/code-192.png

2.7 KB
Loading

resources/server/code-512.png

11.7 KB
Loading

resources/server/code.png

18.9 KB
Loading
Loading

resources/server/favicon.ico

-28.9 KB
Binary file not shown.

resources/server/favicon.svg

+1
Loading

resources/server/web.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ fi
1010
function code() {
1111
cd $ROOT
1212

13-
# Sync built-in extensions
14-
yarn download-builtin-extensions
13+
# # Sync built-in extensions
14+
# yarn download-builtin-extensions
1515

16-
# Load remote node
17-
yarn gulp node
16+
# # Load remote node
17+
# yarn gulp node
1818

1919
NODE=$(node build/lib/node.js)
2020

src/tsec.exemptions.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"vs/workbench/services/keybinding/test/electron-browser/keyboardMapperTestUtils.ts"
1111
],
1212
"ban-trustedtypes-createpolicy": [
13+
"vs/workbench/browser/client.ts",
1314
"vs/base/browser/dom.ts",
1415
"vs/base/browser/markdownRenderer.ts",
1516
"vs/base/worker/defaultWorkerFactory.ts",

src/vs/base/common/auth.ts

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* eslint-disable header/header */
2+
/*---------------------------------------------------------------------------------------------
3+
* Copyright (c) Coder Technologies. All rights reserved.
4+
* Licensed under the MIT License. See License.txt in the project root for license information.
5+
*--------------------------------------------------------------------------------------------*/
6+
7+
export enum AuthType {
8+
Password = 'password',
9+
None = 'none',
10+
}

src/vs/base/common/network.ts

+16-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6+
import { memoize } from 'vs/base/common/decorators';
67
import * as platform from 'vs/base/common/platform';
78
import { URI } from 'vs/base/common/uri';
89

@@ -127,6 +128,19 @@ class RemoteAuthoritiesImpl {
127128
this._connectionTokens[authority] = connectionToken;
128129
}
129130

131+
@memoize
132+
/** @coder Added this to work against a relative path. */
133+
get remoteResourcePath(): string {
134+
if (platform.isWeb) {
135+
const remoteResourceUri = URI.parse(window.location.toString());
136+
137+
// Web may be hosted from a nested path, so we must prepend it.
138+
return URI.joinPath(remoteResourceUri, Schemas.vscodeRemoteResource).path;
139+
}
140+
141+
return `/${Schemas.vscodeRemoteResource}`;
142+
}
143+
130144
rewrite(uri: URI): URI {
131145
if (this._delegate) {
132146
return this._delegate(uri);
@@ -142,10 +156,11 @@ class RemoteAuthoritiesImpl {
142156
if (typeof connectionToken === 'string') {
143157
query += `&tkn=${encodeURIComponent(connectionToken)}`;
144158
}
159+
145160
return URI.from({
146161
scheme: platform.isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource,
147162
authority: `${host}:${port}`,
148-
path: `/vscode-remote-resource`,
163+
path: this.remoteResourcePath,
149164
query
150165
});
151166
}

src/vs/base/common/product.ts

+16
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import { IStringDictionary } from 'vs/base/common/collections';
7+
import { AuthType } from 'vs/base/common/auth';
78

89
export interface IBuiltInExtension {
910
readonly name: string;
@@ -31,6 +32,21 @@ export type ExtensionVirtualWorkspaceSupport = {
3132
};
3233

3334
export interface IProductConfiguration {
35+
//#region Code Server Additions
36+
37+
readonly codeServerVersion?: string;
38+
readonly auth?: AuthType;
39+
40+
readonly logoutEndpointUrl: string;
41+
readonly proxyEndpointUrlTemplate?: string;
42+
readonly serviceWorker?: {
43+
readonly url: string;
44+
readonly scope: string;
45+
}
46+
readonly icons: Array<{ src: string; type: string; sizes: string }>;
47+
48+
//#regionend
49+
3450
readonly version: string;
3551
readonly date?: string;
3652
readonly quality?: string;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/* eslint-disable header/header */
2+
/*---------------------------------------------------------------------------------------------
3+
* Copyright (c) Coder Technologies. All rights reserved.
4+
* Licensed under the MIT License. See License.txt in the project root for license information.
5+
*--------------------------------------------------------------------------------------------*/
6+
7+
/// <reference lib="webworker" />
8+
9+
const sw = self as unknown as ServiceWorkerGlobalScope;
10+
11+
sw.addEventListener('install', () => {
12+
console.debug('[Service Worker] installed');
13+
});
14+
15+
sw.addEventListener('activate', (event) => {
16+
event.waitUntil(sw.clients.claim());
17+
console.debug('[Service Worker] activated');
18+
});
19+
20+
sw.addEventListener('fetch', () => {
21+
// Without this event handler we won't be recognized as a PWA.
22+
});

0 commit comments

Comments
 (0)