Skip to content
Draft
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
50 changes: 0 additions & 50 deletions .eslint-allowed-bracket-notation-files
Original file line number Diff line number Diff line change
Expand Up @@ -246,56 +246,6 @@ src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxApiService
src/vs/sessions/electron-browser/sessions.ts
src/vs/sessions/test/browser/chatGroupsView.test.ts

# Build, CI, and scripts (48 files)
build/azure-pipelines/common/apply-sdk-canary-override.ts
build/azure-pipelines/common/createBuild.ts
build/azure-pipelines/common/downloadNotice.ts
build/azure-pipelines/common/getPublishAuthTokens.ts
build/azure-pipelines/common/publish.ts
build/azure-pipelines/common/releaseBuild.ts
build/azure-pipelines/common/sign-win32.ts
build/azure-pipelines/common/sign.ts
build/azure-pipelines/distro/mixin-quality.ts
build/azure-pipelines/oss/audit-notices.ts
build/azure-pipelines/oss/merge-notices.ts
build/azure-pipelines/oss/scan-licenses.ts
build/azure-pipelines/upload-cdn.ts
build/azure-pipelines/upload-nlsmetadata.ts
build/azure-pipelines/upload-sourcemaps.ts
build/azure-pipelines/win32/codesign.ts
build/darwin/create-dmg.ts
build/darwin/create-universal-app.ts
build/darwin/sign-server.ts
build/darwin/sign.ts
build/darwin/verify-macho.ts
build/gulpfile.reh.ts
build/gulpfile.vscode.linux.ts
build/gulpfile.vscode.ts
build/gulpfile.vscode.win32.ts
build/hygiene.ts
build/lib/builtInExtensions.ts
build/lib/compilation.ts
build/lib/electron.ts
build/lib/fetch.ts
build/lib/getVersion.ts
build/lib/i18n.ts
build/lib/policies/exportPolicyData.ts
build/lib/preLaunch.ts
build/lib/test/render.test.ts
build/linux/debian/install-sysroot.ts
build/linux/libcxx-fetcher.ts
build/npm/postinstall.ts
build/npm/preinstall.ts
build/npm/update-localization-extension.ts
build/rspack/rspack.serve-out.config.mts
build/win32/explorer-dll-fetcher.ts
scripts/code-agent-host.js
scripts/code-server.js
scripts/code-sessions-web.js
scripts/code-web.js
scripts/sync-agent-host-protocol.ts
scripts/test-agent-host-e2e.ts

# Application bootstrap, server, and environment (41 files)
src/bootstrap-cli.ts
src/bootstrap-esm.ts
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/common/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ class ESRPReleaseService {
};

// The Release service expects x5c as a '.' separated string, not the standard array format
(header as Record<string, unknown>)['x5c'] = this.requestSigningCertificates.map(c => getCertificateBuffer(c).toString('base64url')).join('.');
(header as Record<string, unknown>).x5c = this.requestSigningCertificates.map(c => getCertificateBuffer(c).toString('base64url')).join('.');

return jws.sign({
header,
Expand Down
4 changes: 2 additions & 2 deletions build/azure-pipelines/distro/mixin-quality.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ function main() {
throw new Error('Unexpected builtInExtensions array, expected object with include/exclude or array of extensions');

} else if (distro.builtInExtensions) {
const include = distro.builtInExtensions['include'] ?? [];
const exclude = distro.builtInExtensions['exclude'] ?? [];
const include = distro.builtInExtensions.include ?? [];
const exclude = distro.builtInExtensions.exclude ?? [];

log('OSS built-in extensions:', builtInExtensions.map(e => e.name));
log('Including built-in extensions:', include.map(e => e.name));
Expand Down
6 changes: 3 additions & 3 deletions build/azure-pipelines/oss/audit-notices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,16 +456,16 @@ function printReport(noticePath: string, stats: NoticeStats, xref: CrossRefResul
function main(): void {
const args = parseArgs(process.argv.slice(2));

if (!args['notice']) {
if (!args.notice) {
console.error('Usage: npx tsx build/azure-pipelines/oss/audit-notices.ts --notice <path> [--repo <path>]');
console.error('');
console.error(' --notice Path to ThirdPartyNotices.txt');
console.error(' --repo Path to the repo root (defaults to cwd)');
process.exit(1);
}

const noticePath = path.resolve(args['notice']);
const repoRoot = path.resolve(args['repo'] ?? process.cwd());
const noticePath = path.resolve(args.notice);
const repoRoot = path.resolve(args.repo ?? process.cwd());

if (!fs.existsSync(noticePath)) {
console.error(`Error: NOTICE file not found: ${noticePath}`);
Expand Down
16 changes: 8 additions & 8 deletions build/azure-pipelines/oss/merge-notices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,12 @@ export function computeUnaccounted(

async function mainAsync(): Promise<void> {
const args = parseArgs(process.argv.slice(2));
const cgPath = args['cg'] || '';
const extPath = args['extensions'] || '';
const outputPath = args['output'];
const cglicensesPath = args['cglicenses'] || '';
const cgPath = args.cg || '';
const extPath = args.extensions || '';
const outputPath = args.output;
const cglicensesPath = args.cglicenses || '';
const strict = process.argv.includes('--strict');
const provenance = args['provenance'] !== undefined;
const provenance = args.provenance !== undefined;

if (!outputPath) {
console.error('Usage: merge-notices.js --cg <path> --extensions <path> --output <path> [--cglicenses <path>] [--strict]');
Expand Down Expand Up @@ -221,7 +221,7 @@ async function mainAsync(): Promise<void> {
// SPDX expression instead of real license text); for them the scanner entry
// must WIN the collision, overriding CG's stub with the real fetched text.
const stubOverrideKeys = new Set<string>();
const stubOverridePath = args['stuboverride'] || (extPath ? extPath + '.stuboverride.json' : '');
const stubOverridePath = args.stuboverride || (extPath ? extPath + '.stuboverride.json' : '');
if (stubOverridePath && fs.existsSync(stubOverridePath)) {
try {
const raw: unknown = JSON.parse(fs.readFileSync(stubOverridePath, 'utf8'));
Expand Down Expand Up @@ -328,7 +328,7 @@ async function mainAsync(): Promise<void> {
// Load the scanner's presence index (packages on disk with no license
// file). This lets applyOverrides tell "present but unlicensed" (inject)
// apart from "not shipped" (stale -> warn + skip).
const presencePath = args['presence'] || (extPath ? extPath + '.presence.json' : '');
const presencePath = args.presence || (extPath ? extPath + '.presence.json' : '');
const presentNames = new Set<string>();
if (presencePath && fs.existsSync(presencePath)) {
try {
Expand Down Expand Up @@ -480,7 +480,7 @@ required to debug changes to any libraries licensed under the GNU Lesser General
// produced no row for). Cross-checked against the final merged notice below so
// packages rescued downstream (e.g. a cglicenses.json override) are excluded.
// Never throws — a missing/garbled sibling just yields an empty list.
const unresolvedPath = args['unresolved'] || (extPath ? extPath + '.unresolved.json' : '');
const unresolvedPath = args.unresolved || (extPath ? extPath + '.unresolved.json' : '');
let unresolvedList: Array<{ name: string; version: string; reason: string }> = [];
if (unresolvedPath && fs.existsSync(unresolvedPath)) {
try {
Expand Down
12 changes: 6 additions & 6 deletions build/azure-pipelines/oss/scan-licenses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -998,8 +998,8 @@ function findCargoLockFiles(repoRoot: string): string[] {

async function main(): Promise<void> {
const args = parseArgs(process.argv.slice(2));
const repoRoot = args['repo'];
const outputPath = args['output'];
const repoRoot = args.repo;
const outputPath = args.output;

if (!repoRoot || !outputPath) {
console.error('Usage: scan-licenses.js --repo <path> --output <path> [--cg <ThirdPartyNotices.generated.txt>]');
Expand All @@ -1015,7 +1015,7 @@ async function main(): Promise<void> {
// "stub" bodies (CG emitted the SPDX expression instead of real text) and to
// gate fetches (don't re-fetch crates CG already covered with real text).
const cgBodies = new Map<string, string>();
const cgNoticePath = args['cg'];
const cgNoticePath = args.cg;
if (cgNoticePath && fs.existsSync(cgNoticePath)) {
try {
for (const e of parseNoticeFile(cgNoticePath)) {
Expand Down Expand Up @@ -2129,7 +2129,7 @@ async function main(): Promise<void> {
// Write the presence index as a sibling file. A package counts as
// "present but unlicensed" only if it was never resolved with a license
// anywhere (filter out anything that later landed in `entries`).
const presencePath = args['presence'] || (outputPath + '.presence.json');
const presencePath = args.presence || (outputPath + '.presence.json');
const presence = [...noLicenseSeen.entries()]
.filter(([k]) => !entries.has(k))
.map(([, v]) => ({ name: v.name, version: v.version }))
Expand All @@ -2139,15 +2139,15 @@ async function main(): Promise<void> {
// Write the stub-override index as a sibling file. merge-notices.ts reads it
// to let these cargo entries beat CG on `<name>@<version>` collision (CG
// otherwise always wins). Mirrors the presence.json sibling pattern.
const stubOverridePath = args['stuboverride'] || (outputPath + '.stuboverride.json');
const stubOverridePath = args.stuboverride || (outputPath + '.stuboverride.json');
const stubOverrideList = [...stubOverrideKeys].sort();
fs.writeFileSync(stubOverridePath, JSON.stringify(stubOverrideList, null, '\t'), 'utf8');

// Write the unresolved index as a sibling file. These are packages the scanner
// tried to resolve but produced NO row for. merge-notices.ts cross-checks this
// against the final merged NOTICE so packages rescued downstream (e.g. a
// cglicenses.json override) are excluded. Mirrors the presence.json sibling.
const unresolvedPath = args['unresolved'] || (outputPath + '.unresolved.json');
const unresolvedPath = args.unresolved || (outputPath + '.unresolved.json');
const unresolvedSorted = unresolved.slice().sort((a, b) => a.name.toLowerCase().localeCompare(b.name.toLowerCase()));
fs.writeFileSync(unresolvedPath, JSON.stringify(unresolvedSorted, null, '\t'), 'utf8');

Expand Down
14 changes: 7 additions & 7 deletions build/gulpfile.vscode.win32.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ function packageInnoSetup(iss: string, options: { definitions?: Record<string, u
const definitions = options.definitions || {};

if (process.argv.some(arg => arg === '--debug-inno')) {
definitions['Debug'] = 'true';
definitions.Debug = 'true';
}

if (process.argv.some(arg => arg === '--sign')) {
definitions['Sign'] = 'true';
definitions.Sign = 'true';
}

const keys = Object.keys(definitions);
Expand Down Expand Up @@ -79,7 +79,7 @@ function buildWin32Setup(arch: string, target: string): task.CallbackTask {
const originalProductJsonPath = path.join(sourcePath, productJsonRelativePath);
const productJsonPath = path.join(outputPath, 'product.json');
const productJson = JSON.parse(fs.readFileSync(originalProductJsonPath, 'utf8'));
productJson['target'] = target;
productJson.target = target;

const definitions: Record<string, unknown> = {
NameLong: product.nameLong,
Expand Down Expand Up @@ -114,12 +114,12 @@ function buildWin32Setup(arch: string, target: string): task.CallbackTask {
};

if (quality === 'stable' || quality === 'insider') {
definitions['AppxPackage'] = `${quality === 'stable' ? 'code' : 'code_insider'}_${arch}.appx`;
definitions['AppxPackageDll'] = `${quality === 'stable' ? 'code' : 'code_insider'}_explorer_command_${arch}.dll`;
definitions['AppxPackageName'] = `${product.win32AppUserModelId}`;
definitions.AppxPackage = `${quality === 'stable' ? 'code' : 'code_insider'}_${arch}.appx`;
definitions.AppxPackageDll = `${quality === 'stable' ? 'code' : 'code_insider'}_explorer_command_${arch}.dll`;
definitions.AppxPackageName = `${product.win32AppUserModelId}`;
const ctxMenu = (product as { win32ContextMenu?: Record<string, { clsid: string }> }).win32ContextMenu;
if (ctxMenu && ctxMenu[arch]) {
definitions['FileExplorerContextMenuCLSID'] = ctxMenu[arch].clsid;
definitions.FileExplorerContextMenuCLSID = ctxMenu[arch].clsid;
}
}

Expand Down
2 changes: 1 addition & 1 deletion build/lib/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export class XLF {
reject(new Error(`XLF parsing error: Failed to parse XLIFF string. ${err}`));
}

const fileNodes: any[] = result['xliff']['file'];
const fileNodes: any[] = result.xliff.file;
if (!fileNodes) {
reject(new Error(`XLF parsing error: XLIFF file does not contain "xliff" or "file" node(s) required for parsing.`));
}
Expand Down
4 changes: 2 additions & 2 deletions build/lib/policies/exportPolicyData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ function runPolicyExport(codeScript: string, outputPath: string, userDataPath: s
}

const env = { ...process.env };
delete env['VSCODE_PORTABLE'];
delete env['VSCODE_APPDATA'];
delete env.VSCODE_PORTABLE;
delete env.VSCODE_APPDATA;
return new Promise((resolve, reject) => {
const child = spawn(codeScript, args, {
cwd: rootPath,
Expand Down
8 changes: 4 additions & 4 deletions build/lib/test/render.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ suite('Render Functions', () => {
minimumVersion: '1.85',
renderADMX: () => [],
renderADMLStrings: (translations?: LanguageTranslations) => [
`<string id="TestPolicy">Test Policy ${translations?.['testModule']?.['test.policy'] || 'Default'}</string>`
`<string id="TestPolicy">Test Policy ${translations?.testModule?.['test.policy'] || 'Default'}</string>`
],
renderADMLPresentation: () => '<presentation id="TestPolicy"><textBox refId="TestPolicy"/></presentation>',
renderProfile: () => [],
Expand Down Expand Up @@ -387,7 +387,7 @@ suite('Render Functions', () => {
<key>pfm_name</key>
<string>TestPolicy</string>
<key>pfm_description</key>
<string>${translations?.['testModule']?.['test.desc'] || 'Default Desc'}</string>
<string>${translations?.testModule?.['test.desc'] || 'Default Desc'}</string>
</dict>`,
renderJsonValue: () => null
};
Expand Down Expand Up @@ -525,7 +525,7 @@ suite('Render Functions', () => {
<key>pfm_name</key>
<string>TestPolicy</string>
<key>pfm_description</key>
<string>${translations?.['testModule']?.['test.desc'] || 'Default Desc'}</string>
<string>${translations?.testModule?.['test.desc'] || 'Default Desc'}</string>
</dict>`,
renderJsonValue: () => null
};
Expand Down Expand Up @@ -705,7 +705,7 @@ suite('Render Functions', () => {
`</policy>`
],
renderADMLStrings: (translations?: LanguageTranslations) => [
`<string id="TestPolicy">${translations?.['testModule']?.['test.policy'] || 'Test Policy'}</string>`
`<string id="TestPolicy">${translations?.testModule?.['test.policy'] || 'Test Policy'}</string>`
],
renderADMLPresentation: () => '<presentation id="TestPolicy"/>',
renderProfile: () => [],
Expand Down
6 changes: 3 additions & 3 deletions build/linux/debian/install-sysroot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ export async function getChromiumSysroot(arch: DebianArchString): Promise<string
const sysrootInfo = JSON.parse(fs.readFileSync(sysrootDictLocation, 'utf8'));
const sysrootArch = `bullseye_${arch}`;
const sysrootDict: SysrootDictEntry = sysrootInfo[sysrootArch];
const tarballFilename = sysrootDict['Tarball'];
const tarballSha = sysrootDict['Sha256Sum'];
const sysroot = path.join(tmpdir(), sysrootDict['SysrootDir']);
const tarballFilename = sysrootDict.Tarball;
const tarballSha = sysrootDict.Sha256Sum;
const sysroot = path.join(tmpdir(), sysrootDict.SysrootDir);
const url = [URL_PREFIX, URL_PATH, tarballSha].join('/');
const stamp = path.join(sysroot, '.stamp');
if (fs.existsSync(stamp) && fs.readFileSync(stamp).toString() === url) {
Expand Down
36 changes: 18 additions & 18 deletions build/npm/postinstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function setNpmrcConfig(dir: string, env: NodeJS.ProcessEnv) {
}

// Use our bundled node-gyp version
env['npm_config_node_gyp'] =
env.npm_config_node_gyp =
process.platform === 'win32'
? path.join(import.meta.dirname, 'gyp', 'node_modules', '.bin', 'node-gyp.cmd')
: path.join(import.meta.dirname, 'gyp', 'node_modules', '.bin', 'node-gyp');
Expand All @@ -126,9 +126,9 @@ function setNpmrcConfig(dir: string, env: NodeJS.ProcessEnv) {
// in preinstall sync with this logic.
// Change was first introduced in https://github.com/nodejs/node/commit/6e0a2bb54c5bbeff0e9e33e1a0c683ed980a8a0f
if ((dir === 'remote' || dir === 'build') && process.platform === 'darwin') {
env['npm_config_force_process_config'] = 'true';
env.npm_config_force_process_config = 'true';
} else {
delete env['npm_config_force_process_config'];
delete env.npm_config_force_process_config;
}

if (dir === 'build') {
Expand All @@ -137,7 +137,7 @@ function setNpmrcConfig(dir: string, env: NodeJS.ProcessEnv) {
// This is fixed in v0.25.1 however the version is not published to npm, refs
// https://github.com/tree-sitter/node-tree-sitter/issues/268.
// env['npm_config_target'] = process.versions.node;
env['npm_config_arch'] = process.arch;
env.npm_config_arch = process.arch;
}
}

Expand Down Expand Up @@ -262,10 +262,10 @@ async function main() {
if (dir === 'build') {
nativeTasks.push(() => {
const env: NodeJS.ProcessEnv = { ...process.env };
if (process.env['CC']) { env['CC'] = 'gcc'; }
if (process.env['CXX']) { env['CXX'] = 'g++'; }
if (process.env['CXXFLAGS']) { env['CXXFLAGS'] = ''; }
if (process.env['LDFLAGS']) { env['LDFLAGS'] = ''; }
if (process.env['CC']) { env.CC = 'gcc'; }
if (process.env['CXX']) { env.CXX = 'g++'; }
if (process.env['CXXFLAGS']) { env.CXXFLAGS = ''; }
if (process.env['LDFLAGS']) { env.LDFLAGS = ''; }
setNpmrcConfig('build', env);
return npmInstallAsync('build', { env });
});
Expand All @@ -277,21 +277,21 @@ async function main() {
nativeTasks.push(() => {
const env: NodeJS.ProcessEnv = { ...process.env };
if (process.env['VSCODE_REMOTE_CC']) {
env['CC'] = process.env['VSCODE_REMOTE_CC'];
env.CC = process.env['VSCODE_REMOTE_CC'];
} else {
delete env['CC'];
delete env.CC;
}
if (process.env['VSCODE_REMOTE_CXX']) {
env['CXX'] = process.env['VSCODE_REMOTE_CXX'];
env.CXX = process.env['VSCODE_REMOTE_CXX'];
} else {
delete env['CXX'];
delete env.CXX;
}
if (process.env['CXXFLAGS']) { delete env['CXXFLAGS']; }
if (process.env['CFLAGS']) { delete env['CFLAGS']; }
if (process.env['LDFLAGS']) { delete env['LDFLAGS']; }
if (process.env['VSCODE_REMOTE_CXXFLAGS']) { env['CXXFLAGS'] = process.env['VSCODE_REMOTE_CXXFLAGS']; }
if (process.env['VSCODE_REMOTE_LDFLAGS']) { env['LDFLAGS'] = process.env['VSCODE_REMOTE_LDFLAGS']; }
if (process.env['VSCODE_REMOTE_NODE_GYP']) { env['npm_config_node_gyp'] = process.env['VSCODE_REMOTE_NODE_GYP']; }
if (process.env['CXXFLAGS']) { delete env.CXXFLAGS; }
if (process.env['CFLAGS']) { delete env.CFLAGS; }
if (process.env['LDFLAGS']) { delete env.LDFLAGS; }
if (process.env['VSCODE_REMOTE_CXXFLAGS']) { env.CXXFLAGS = process.env['VSCODE_REMOTE_CXXFLAGS']; }
if (process.env['VSCODE_REMOTE_LDFLAGS']) { env.LDFLAGS = process.env['VSCODE_REMOTE_LDFLAGS']; }
if (process.env['VSCODE_REMOTE_NODE_GYP']) { env.npm_config_node_gyp = process.env['VSCODE_REMOTE_NODE_GYP']; }
setNpmrcConfig('remote', env);
return npmInstallAsync(remoteDir, { env });
});
Expand Down
4 changes: 2 additions & 2 deletions build/npm/update-localization-extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ function update(options: Options) {
throw new Error('No directory found at ' + idOrPath);
}
const packageJSON = JSON.parse(fs.readFileSync(path.join(locExtFolder, 'package.json')).toString()) as PackageJson;
const contributes = packageJSON['contributes'];
const contributes = packageJSON.contributes;
if (!contributes) {
throw new Error('The extension must define a "localizations" contribution in the "package.json"');
}
const localizations = contributes['localizations'];
const localizations = contributes.localizations;
if (!localizations) {
throw new Error('The extension must define a "localizations" contribution of type array in the "package.json"');
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/code-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function main() {

const serverArgs = process.argv.slice(2).filter(v => v !== '--launch');
const addr = await startServer(serverArgs);
if (args['launch']) {
if (args.launch) {
open.default(addr);
}
}
Expand Down
Loading