mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-20 02:08:47 +00:00
Small cleanups
This commit is contained in:
@@ -279,7 +279,12 @@ export const monacoTypecheckWatchTask = task.define('monaco-typecheck-watch', cr
|
||||
export const monacoTypecheckTask = task.define('monaco-typecheck', createTscCompileTask(false));
|
||||
|
||||
//#endregion
|
||||
|
||||
/**
|
||||
* Sets a field on an object only if it's not already set, otherwise throws an error
|
||||
* @param obj The object to modify
|
||||
* @param field The field name to set
|
||||
* @param value The value to set
|
||||
*/
|
||||
function setUnsetField(obj: Record<string, unknown>, field: string, value: unknown) {
|
||||
if (obj[field] !== undefined) {
|
||||
throw new Error(`Field "${field}" is already set (but was expected to not be).`);
|
||||
|
||||
@@ -289,10 +289,11 @@ function packageTask(type: string, platform: string, arch: string, sourceFolderN
|
||||
return !isUIExtension(manifest);
|
||||
}).map((extensionPath) => path.basename(path.dirname(extensionPath)))
|
||||
.filter(name => name !== 'vscode-api-tests' && name !== 'vscode-test-resolver'); // Do not ship the test extensions
|
||||
const marketplaceExtensions = JSON.parse(fs.readFileSync(path.join(REPO_ROOT, 'product.json'), 'utf8')).builtInExtensions
|
||||
.filter((entry: { platforms?: string[]; clientOnly?: boolean }) => !entry.platforms || new Set(entry.platforms).has(platform))
|
||||
.filter((entry: { clientOnly?: boolean }) => !entry.clientOnly)
|
||||
.map((entry: { name: string }) => entry.name);
|
||||
const builtInExtensions: Array<{ name: string; platforms?: string[]; clientOnly?: boolean }> = JSON.parse(fs.readFileSync(path.join(REPO_ROOT, 'product.json'), 'utf8')).builtInExtensions;
|
||||
const marketplaceExtensions = builtInExtensions
|
||||
.filter(entry => !entry.platforms || new Set(entry.platforms).has(platform))
|
||||
.filter(entry => !entry.clientOnly)
|
||||
.map(entry => entry.name);
|
||||
const extensionPaths = [...localWorkspaceExtensions, ...marketplaceExtensions]
|
||||
.map(name => `.build/extensions/${name}/**`);
|
||||
|
||||
|
||||
6
build/lib/typings/@vscode/gulp-electron.d.ts
vendored
6
build/lib/typings/@vscode/gulp-electron.d.ts
vendored
@@ -1,8 +1,12 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
declare module '@vscode/gulp-electron' {
|
||||
|
||||
interface MainFunction {
|
||||
(options: any): NodeJS.ReadWriteStream;
|
||||
|
||||
dest(destination: string, options: any): NodeJS.ReadWriteStream;
|
||||
}
|
||||
|
||||
|
||||
3
build/lib/typings/gulp-untar.d.ts
vendored
3
build/lib/typings/gulp-untar.d.ts
vendored
@@ -6,9 +6,6 @@
|
||||
declare module 'gulp-untar' {
|
||||
import type { Transform } from 'stream';
|
||||
|
||||
/**
|
||||
* Extract TAR files
|
||||
*/
|
||||
function untar(): Transform;
|
||||
|
||||
export = untar;
|
||||
|
||||
5
build/lib/typings/rcedit.d.ts
vendored
5
build/lib/typings/rcedit.d.ts
vendored
@@ -1,5 +1,8 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
declare module 'rcedit' {
|
||||
|
||||
export default function rcedit(exePath, options, cb): Promise<void>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user