Skip to content

Commit f0607e9

Browse files
committed
Flesh out lib/vscode migration. WIP
1 parent 507ce72 commit f0607e9

Some content is hidden

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

65 files changed

+3092
-925
lines changed

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,8 @@
1616
**/extensions/markdown-language-features/notebook-out/**
1717
**/extensions/typescript-basics/test/colorize-fixtures/**
1818
**/extensions/**/dist/**
19+
# These are code-server code symlinks.
20+
src/vs/base/common/util.ts
21+
src/vs/base/common/ipc.d.ts
22+
src/vs/base/node/proxy_agent.ts
23+
src/vs/server/uriTransformer.ts

.eslintrc.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,10 +802,12 @@
802802
"target": "**/vs/server/**",
803803
"restrictions": [
804804
"vs/nls",
805+
"**/vs/code/**/{common,server,browser,node,electron-sandbox,electron-browser}/**",
805806
"**/vs/base/**/{common,node}/**",
806807
"**/vs/base/parts/**/{common,node}/**",
807808
"**/vs/platform/**/{common,node}/**",
808809
"**/vs/workbench/**/{common,node}/**",
810+
"**/vs/workbench/workbench.web.api",
809811
"**/vs/server/**",
810812
"*" // node modules
811813
]

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ node_modules/
77
extensions/**/dist/
88
/out*/
99
/extensions/**/out/
10-
src/vs/server
10+
# NOTE@coder: remove to provide our own server
11+
# src/vs/server
1112
resources/server
1213
build/node_modules
1314
coverage/

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@
8484
"editor.defaultFormatter": "vscode.typescript-language-features",
8585
"editor.formatOnSave": true,
8686
},
87+
"typescript.format.insertSpaceAfterConstructor": false,
88+
"javascript.format.insertSpaceAfterConstructor": false,
89+
"javascript.format.insertSpaceBeforeFunctionParenthesis": false,
90+
"typescript.format.insertSpaceBeforeFunctionParenthesis": false,
91+
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
92+
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
8793
"typescript.tsc.autoDetect": "off",
8894
"notebook.experimental.useMarkdownRenderer": true,
8995
"testing.autoRun.mode": "rerun",

build/gulpfile.reh.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ BUILD_TARGETS.forEach(({ platform, arch }) => {
4242
});
4343

4444
function getNodeVersion() {
45+
// NOTE@coder: Fix version due to .yarnrc removal.
46+
return process.versions.node;
4547
const yarnrc = fs.readFileSync(path.join(REPO_ROOT, 'remote', '.yarnrc'), 'utf8');
4648
const target = /^target "(.*)"$/m.exec(yarnrc)[1];
4749
return target;

build/hygiene.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@ const copyrightHeaderLines = [
1919
' *--------------------------------------------------------------------------------------------*/',
2020
];
2121

22+
/**
23+
* @remark While this helps delineate Coder's additions to the upstream project,
24+
* this notice should be examined within the context of the application.
25+
* Code from both maintainers often overlaps.
26+
*/
27+
const coderCopyrightHeaderLines = [
28+
'/*---------------------------------------------------------------------------------------------',
29+
' * Copyright (c) Coder Technologies. All rights reserved.',
30+
' * Licensed under the MIT License. See License.txt in the project root for license information.',
31+
' *--------------------------------------------------------------------------------------------*/',
32+
];
33+
2234
function hygiene(some, linting = true) {
2335
const gulpeslint = require('gulp-eslint');
2436
const tsfmt = require('typescript-formatter');
@@ -62,7 +74,7 @@ function hygiene(some, linting = true) {
6274
const lines = file.__lines;
6375

6476
for (let i = 0; i < copyrightHeaderLines.length; i++) {
65-
if (lines[i] !== copyrightHeaderLines[i]) {
77+
if (lines[i] !== copyrightHeaderLines[i] && lines[i] !== coderCopyrightHeaderLines[i]) {
6678
console.error(file.relative + ': Missing or bad copyright statement');
6779
errorCount++;
6880
break;

build/lib/extensions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function fromLocal(extensionPath: string, forWeb: boolean): Stream {
6767
if (isWebPacked) {
6868
input = updateExtensionPackageJSON(input, (data: any) => {
6969
delete data.scripts;
70-
delete data.dependencies;
70+
// https://github.com/cdr/code-server/pull/2041#issuecomment-685910322
7171
delete data.devDependencies;
7272
if (data.main) {
7373
data.main = data.main.replace('/out/', /dist/);

build/lib/node.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ const path = require("path");
88
const fs = require("fs");
99
const root = path.dirname(path.dirname(__dirname));
1010
const yarnrcPath = path.join(root, 'remote', '.yarnrc');
11-
const yarnrc = fs.readFileSync(yarnrcPath, 'utf8');
12-
const version = /^target\s+"([^"]+)"$/m.exec(yarnrc)[1];
11+
// NOTE@coder: Fix version due to .yarnrc removal.
12+
const version = process.versions.node;
1313
const platform = process.platform;
1414
const arch = platform === 'darwin' ? 'x64' : process.arch;
1515
const node = platform === 'win32' ? 'node.exe' : 'node';

build/lib/node.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@
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];
139

10+
// NOTE@coder: Fix version due to .yarnrc removal.
11+
const version = process.versions.node;
1412
const platform = process.platform;
1513
const arch = platform === 'darwin' ? 'x64' : process.arch;
1614

build/lib/util.js

Lines changed: 2 additions & 0 deletions
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: Fix version due to .yarnrc removal.
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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,6 @@ export function streamToPromise(stream: NodeJS.ReadWriteStream): Promise<void> {
336336
}
337337

338338
export function getElectronVersion(): string {
339-
const yarnrc = fs.readFileSync(path.join(root, '.yarnrc'), 'utf8');
340-
const target = /^target "(.*)"$/m.exec(yarnrc)![1];
341-
return target;
339+
// NOTE@coder: Fix version due to .yarnrc removal.
340+
return process.versions.node;
342341
}

build/package.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
"version": "1.0.0",
44
"license": "MIT",
55
"devDependencies": {
6-
"@azure/cosmos": "^3.9.3",
7-
"@azure/storage-blob": "^12.4.0",
86
"@types/ansi-colors": "^3.2.0",
97
"@types/azure": "0.9.19",
108
"@types/byline": "^4.2.32",
@@ -37,23 +35,20 @@
3735
"@typescript-eslint/experimental-utils": "~2.13.0",
3836
"@typescript-eslint/parser": "^3.3.0",
3937
"applicationinsights": "1.0.8",
40-
"azure-storage": "^2.1.0",
4138
"byline": "^5.0.0",
4239
"colors": "^1.4.0",
4340
"commander": "^7.0.0",
44-
"electron-osx-sign": "^0.4.16",
45-
"esbuild": "^0.12.1",
41+
"esbuild": "^0.12.6",
4642
"fs-extra": "^9.1.0",
4743
"got": "11.8.1",
4844
"iconv-lite-umd": "0.6.8",
4945
"jsonc-parser": "^2.3.0",
5046
"mime": "^1.4.1",
5147
"mkdirp": "^1.0.4",
5248
"p-limit": "^3.1.0",
53-
"plist": "^3.0.1",
5449
"source-map": "0.6.1",
5550
"typescript": "^4.4.0-dev.20210528",
56-
"vsce": "1.48.0",
51+
"vsce": "1.88.0",
5752
"vscode-universal": "deepak1556/universal#61454d96223b774c53cda10f72c2098c0ce02d58"
5853
},
5954
"scripts": {

0 commit comments

Comments
 (0)