mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge from vscode e3c4990c67c40213af168300d1cfeb71d680f877 (#16569)
This commit is contained in:
@@ -1 +1 @@
|
||||
2021-04-07T03:52:18.011Z
|
||||
2021-08-23T03:52:18.011Z
|
||||
|
||||
@@ -5,15 +5,101 @@
|
||||
'use strict';
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const fs = require("fs");
|
||||
const url = require("url");
|
||||
const crypto = require("crypto");
|
||||
const azure = require("azure-storage");
|
||||
const mime = require("mime");
|
||||
const cosmos_1 = require("@azure/cosmos");
|
||||
const retry_1 = require("./retry");
|
||||
if (process.argv.length !== 6) {
|
||||
console.error('Usage: node createAsset.js PLATFORM TYPE NAME FILE');
|
||||
if (process.argv.length !== 8) {
|
||||
console.error('Usage: node createAsset.js PRODUCT OS ARCH TYPE NAME FILE');
|
||||
process.exit(-1);
|
||||
}
|
||||
// Contains all of the logic for mapping details to our actual product names in CosmosDB
|
||||
function getPlatform(product, os, arch, type) {
|
||||
switch (os) {
|
||||
case 'win32':
|
||||
switch (product) {
|
||||
case 'client':
|
||||
const asset = arch === 'ia32' ? 'win32' : `win32-${arch}`;
|
||||
switch (type) {
|
||||
case 'archive':
|
||||
return `${asset}-archive`;
|
||||
case 'setup':
|
||||
return asset;
|
||||
case 'user-setup':
|
||||
return `${asset}-user`;
|
||||
default:
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
case 'server':
|
||||
if (arch === 'arm64') {
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
return arch === 'ia32' ? 'server-win32' : `server-win32-${arch}`;
|
||||
case 'web':
|
||||
if (arch === 'arm64') {
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
return arch === 'ia32' ? 'server-win32-web' : `server-win32-${arch}-web`;
|
||||
default:
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
case 'linux':
|
||||
switch (type) {
|
||||
case 'snap':
|
||||
return `linux-snap-${arch}`;
|
||||
case 'archive-unsigned':
|
||||
switch (product) {
|
||||
case 'client':
|
||||
return `linux-${arch}`;
|
||||
case 'server':
|
||||
return `server-linux-${arch}`;
|
||||
case 'web':
|
||||
return arch === 'standalone' ? 'web-standalone' : `server-linux-${arch}-web`;
|
||||
default:
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
case 'deb-package':
|
||||
return `linux-deb-${arch}`;
|
||||
case 'rpm-package':
|
||||
return `linux-rpm-${arch}`;
|
||||
default:
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
case 'darwin':
|
||||
switch (product) {
|
||||
case 'client':
|
||||
if (arch === 'x64') {
|
||||
return 'darwin';
|
||||
}
|
||||
return `darwin-${arch}`;
|
||||
case 'server':
|
||||
return 'server-darwin';
|
||||
case 'web':
|
||||
if (arch !== 'x64') {
|
||||
throw `What should the platform be?: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
return 'server-darwin-web';
|
||||
default:
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
default:
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
}
|
||||
// Contains all of the logic for mapping types to our actual types in CosmosDB
|
||||
function getRealType(type) {
|
||||
switch (type) {
|
||||
case 'user-setup':
|
||||
return 'setup';
|
||||
case 'deb-package':
|
||||
case 'rpm-package':
|
||||
return 'package';
|
||||
default:
|
||||
return type;
|
||||
}
|
||||
}
|
||||
function hashStream(hashName, stream) {
|
||||
return new Promise((c, e) => {
|
||||
const shasum = crypto.createHash(hashName);
|
||||
@@ -45,7 +131,10 @@ function getEnv(name) {
|
||||
return result;
|
||||
}
|
||||
async function main() {
|
||||
const [, , platform, type, fileName, filePath] = process.argv;
|
||||
const [, , product, os, arch, unprocessedType, fileName, filePath] = process.argv;
|
||||
// getPlatform needs the unprocessedType
|
||||
const platform = getPlatform(product, os, arch, unprocessedType);
|
||||
const type = getRealType(unprocessedType);
|
||||
const quality = getEnv('VSCODE_QUALITY');
|
||||
const commit = getEnv('BUILD_SOURCEVERSION');
|
||||
console.log('Creating asset...');
|
||||
@@ -65,14 +154,27 @@ async function main() {
|
||||
console.log(`Blob ${quality}, ${blobName} already exists, not publishing again.`);
|
||||
return;
|
||||
}
|
||||
console.log('Uploading blobs to Azure storage...');
|
||||
await uploadBlob(blobService, quality, blobName, filePath, fileName);
|
||||
const mooncakeBlobService = azure.createBlobService(storageAccount, process.env['MOONCAKE_STORAGE_ACCESS_KEY'], `${storageAccount}.blob.core.chinacloudapi.cn`)
|
||||
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
|
||||
// mooncake is fussy and far away, this is needed!
|
||||
blobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
|
||||
mooncakeBlobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
|
||||
console.log('Uploading blobs to Azure storage and Mooncake Azure storage...');
|
||||
await retry_1.retry(() => Promise.all([
|
||||
uploadBlob(blobService, quality, blobName, filePath, fileName),
|
||||
uploadBlob(mooncakeBlobService, quality, blobName, filePath, fileName)
|
||||
]));
|
||||
console.log('Blobs successfully uploaded.');
|
||||
// TODO: Understand if blobName and blobPath are the same and replace blobPath with blobName if so.
|
||||
const assetUrl = `${process.env['AZURE_CDN_URL']}/${quality}/${blobName}`;
|
||||
const blobPath = url.parse(assetUrl).path;
|
||||
const mooncakeUrl = `${process.env['MOONCAKE_CDN_URL']}${blobPath}`;
|
||||
const asset = {
|
||||
platform,
|
||||
type,
|
||||
url: `${process.env['AZURE_CDN_URL']}/${quality}/${blobName}`,
|
||||
url: assetUrl,
|
||||
hash: sha1hash,
|
||||
mooncakeUrl,
|
||||
sha256hash,
|
||||
size
|
||||
};
|
||||
@@ -83,7 +185,8 @@ async function main() {
|
||||
console.log('Asset:', JSON.stringify(asset, null, ' '));
|
||||
const client = new cosmos_1.CosmosClient({ endpoint: process.env['AZURE_DOCUMENTDB_ENDPOINT'], key: process.env['AZURE_DOCUMENTDB_MASTERKEY'] });
|
||||
const scripts = client.database('builds').container(quality).scripts;
|
||||
await (0, retry_1.retry)(() => scripts.storedProcedure('createAsset').execute('', [commit, asset, true]));
|
||||
await retry_1.retry(() => scripts.storedProcedure('createAsset').execute('', [commit, asset, true]));
|
||||
console.log(` Done ✔️`);
|
||||
}
|
||||
main().then(() => {
|
||||
console.log('Asset successfully created');
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as fs from 'fs';
|
||||
import * as url from 'url';
|
||||
import { Readable } from 'stream';
|
||||
import * as crypto from 'crypto';
|
||||
import * as azure from 'azure-storage';
|
||||
@@ -24,11 +25,98 @@ interface Asset {
|
||||
supportsFastUpdate?: boolean;
|
||||
}
|
||||
|
||||
if (process.argv.length !== 6) {
|
||||
console.error('Usage: node createAsset.js PLATFORM TYPE NAME FILE');
|
||||
if (process.argv.length !== 8) {
|
||||
console.error('Usage: node createAsset.js PRODUCT OS ARCH TYPE NAME FILE');
|
||||
process.exit(-1);
|
||||
}
|
||||
|
||||
// Contains all of the logic for mapping details to our actual product names in CosmosDB
|
||||
function getPlatform(product: string, os: string, arch: string, type: string): string {
|
||||
switch (os) {
|
||||
case 'win32':
|
||||
switch (product) {
|
||||
case 'client':
|
||||
const asset = arch === 'ia32' ? 'win32' : `win32-${arch}`;
|
||||
switch (type) {
|
||||
case 'archive':
|
||||
return `${asset}-archive`;
|
||||
case 'setup':
|
||||
return asset;
|
||||
case 'user-setup':
|
||||
return `${asset}-user`;
|
||||
default:
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
case 'server':
|
||||
if (arch === 'arm64') {
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
return arch === 'ia32' ? 'server-win32' : `server-win32-${arch}`;
|
||||
case 'web':
|
||||
if (arch === 'arm64') {
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
return arch === 'ia32' ? 'server-win32-web' : `server-win32-${arch}-web`;
|
||||
default:
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
case 'linux':
|
||||
switch (type) {
|
||||
case 'snap':
|
||||
return `linux-snap-${arch}`;
|
||||
case 'archive-unsigned':
|
||||
switch (product) {
|
||||
case 'client':
|
||||
return `linux-${arch}`;
|
||||
case 'server':
|
||||
return `server-linux-${arch}`;
|
||||
case 'web':
|
||||
return arch === 'standalone' ? 'web-standalone' : `server-linux-${arch}-web`;
|
||||
default:
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
case 'deb-package':
|
||||
return `linux-deb-${arch}`;
|
||||
case 'rpm-package':
|
||||
return `linux-rpm-${arch}`;
|
||||
default:
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
case 'darwin':
|
||||
switch (product) {
|
||||
case 'client':
|
||||
if (arch === 'x64') {
|
||||
return 'darwin';
|
||||
}
|
||||
return `darwin-${arch}`;
|
||||
case 'server':
|
||||
return 'server-darwin';
|
||||
case 'web':
|
||||
if (arch !== 'x64') {
|
||||
throw `What should the platform be?: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
return 'server-darwin-web';
|
||||
default:
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
default:
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
}
|
||||
|
||||
// Contains all of the logic for mapping types to our actual types in CosmosDB
|
||||
function getRealType(type: string) {
|
||||
switch (type) {
|
||||
case 'user-setup':
|
||||
return 'setup';
|
||||
case 'deb-package':
|
||||
case 'rpm-package':
|
||||
return 'package';
|
||||
default:
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
||||
function hashStream(hashName: string, stream: Readable): Promise<string> {
|
||||
return new Promise<string>((c, e) => {
|
||||
const shasum = crypto.createHash(hashName);
|
||||
@@ -68,7 +156,10 @@ function getEnv(name: string): string {
|
||||
}
|
||||
|
||||
async function main(): Promise<void> {
|
||||
const [, , platform, type, fileName, filePath] = process.argv;
|
||||
const [, , product, os, arch, unprocessedType, fileName, filePath] = process.argv;
|
||||
// getPlatform needs the unprocessedType
|
||||
const platform = getPlatform(product, os, arch, unprocessedType);
|
||||
const type = getRealType(unprocessedType);
|
||||
const quality = getEnv('VSCODE_QUALITY');
|
||||
const commit = getEnv('BUILD_SOURCEVERSION');
|
||||
|
||||
@@ -98,17 +189,33 @@ async function main(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('Uploading blobs to Azure storage...');
|
||||
const mooncakeBlobService = azure.createBlobService(storageAccount, process.env['MOONCAKE_STORAGE_ACCESS_KEY']!, `${storageAccount}.blob.core.chinacloudapi.cn`)
|
||||
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
|
||||
|
||||
await uploadBlob(blobService, quality, blobName, filePath, fileName);
|
||||
// mooncake is fussy and far away, this is needed!
|
||||
blobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
|
||||
mooncakeBlobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
|
||||
|
||||
console.log('Uploading blobs to Azure storage and Mooncake Azure storage...');
|
||||
|
||||
await retry(() => Promise.all([
|
||||
uploadBlob(blobService, quality, blobName, filePath, fileName),
|
||||
uploadBlob(mooncakeBlobService, quality, blobName, filePath, fileName)
|
||||
]));
|
||||
|
||||
console.log('Blobs successfully uploaded.');
|
||||
|
||||
// TODO: Understand if blobName and blobPath are the same and replace blobPath with blobName if so.
|
||||
const assetUrl = `${process.env['AZURE_CDN_URL']}/${quality}/${blobName}`;
|
||||
const blobPath = url.parse(assetUrl).path;
|
||||
const mooncakeUrl = `${process.env['MOONCAKE_CDN_URL']}${blobPath}`;
|
||||
|
||||
const asset: Asset = {
|
||||
platform,
|
||||
type,
|
||||
url: `${process.env['AZURE_CDN_URL']}/${quality}/${blobName}`,
|
||||
url: assetUrl,
|
||||
hash: sha1hash,
|
||||
mooncakeUrl,
|
||||
sha256hash,
|
||||
size
|
||||
};
|
||||
@@ -123,6 +230,8 @@ async function main(): Promise<void> {
|
||||
const client = new CosmosClient({ endpoint: process.env['AZURE_DOCUMENTDB_ENDPOINT']!, key: process.env['AZURE_DOCUMENTDB_MASTERKEY'] });
|
||||
const scripts = client.database('builds').container(quality).scripts;
|
||||
await retry(() => scripts.storedProcedure('createAsset').execute('', [commit, asset, true]));
|
||||
|
||||
console.log(` Done ✔️`);
|
||||
}
|
||||
|
||||
main().then(() => {
|
||||
|
||||
@@ -40,7 +40,7 @@ async function main() {
|
||||
};
|
||||
const client = new cosmos_1.CosmosClient({ endpoint: process.env['AZURE_DOCUMENTDB_ENDPOINT'], key: process.env['AZURE_DOCUMENTDB_MASTERKEY'] });
|
||||
const scripts = client.database('builds').container(quality).scripts;
|
||||
await (0, retry_1.retry)(() => scripts.storedProcedure('createBuild').execute('', [Object.assign(Object.assign({}, build), { _partitionKey: '' })]));
|
||||
await retry_1.retry(() => scripts.storedProcedure('createBuild').execute('', [Object.assign(Object.assign({}, build), { _partitionKey: '' })]));
|
||||
}
|
||||
main().then(() => {
|
||||
console.log('Build successfully created');
|
||||
|
||||
@@ -4,12 +4,12 @@ set -e
|
||||
cd $BUILD_STAGINGDIRECTORY
|
||||
mkdir extraction
|
||||
cd extraction
|
||||
git clone --depth 1 https://github.com/Microsoft/vscode-extension-telemetry.git
|
||||
git clone --depth 1 https://github.com/Microsoft/vscode-chrome-debug-core.git
|
||||
git clone --depth 1 https://github.com/Microsoft/vscode-node-debug2.git
|
||||
git clone --depth 1 https://github.com/Microsoft/vscode-node-debug.git
|
||||
git clone --depth 1 https://github.com/Microsoft/vscode-html-languageservice.git
|
||||
git clone --depth 1 https://github.com/Microsoft/vscode-json-languageservice.git
|
||||
git clone --depth 1 https://github.com/microsoft/vscode-extension-telemetry.git
|
||||
git clone --depth 1 https://github.com/microsoft/vscode-chrome-debug-core.git
|
||||
git clone --depth 1 https://github.com/microsoft/vscode-node-debug2.git
|
||||
git clone --depth 1 https://github.com/microsoft/vscode-node-debug.git
|
||||
git clone --depth 1 https://github.com/microsoft/vscode-html-languageservice.git
|
||||
git clone --depth 1 https://github.com/microsoft/vscode-json-languageservice.git
|
||||
node $BUILD_SOURCESDIRECTORY/node_modules/.bin/vscode-telemetry-extractor --sourceDir $BUILD_SOURCESDIRECTORY --excludedDir $BUILD_SOURCESDIRECTORY/extensions --outputDir . --applyEndpoints
|
||||
node $BUILD_SOURCESDIRECTORY/node_modules/.bin/vscode-telemetry-extractor --config $BUILD_SOURCESDIRECTORY/build/azure-pipelines/common/telemetry-config.json -o .
|
||||
mkdir -p $BUILD_SOURCESDIRECTORY/.build/telemetry
|
||||
|
||||
@@ -39,7 +39,7 @@ async function publish(commit, files) {
|
||||
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
|
||||
await assertContainer(blobService, commit);
|
||||
for (const file of files) {
|
||||
const blobName = (0, path_1.basename)(file);
|
||||
const blobName = path_1.basename(file);
|
||||
const blobExists = await doesBlobExist(blobService, commit, blobName);
|
||||
if (blobExists) {
|
||||
console.log(`Blob ${commit}, ${blobName} already exists, not publishing again.`);
|
||||
@@ -58,7 +58,7 @@ function main() {
|
||||
}
|
||||
const opts = minimist(process.argv.slice(2));
|
||||
const [directory] = opts._;
|
||||
const files = fileNames.map(fileName => (0, path_1.join)(directory, fileName));
|
||||
const files = fileNames.map(fileName => path_1.join(directory, fileName));
|
||||
publish(commit, files).catch(err => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
|
||||
@@ -39,7 +39,7 @@ async function main() {
|
||||
}
|
||||
console.log(`Releasing build ${commit}...`);
|
||||
const scripts = client.database('builds').container(quality).scripts;
|
||||
await (0, retry_1.retry)(() => scripts.storedProcedure('releaseBuild').execute('', [commit]));
|
||||
await retry_1.retry(() => scripts.storedProcedure('releaseBuild').execute('', [commit]));
|
||||
}
|
||||
main().then(() => {
|
||||
console.log('Build successfully released');
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const url = require("url");
|
||||
const azure = require("azure-storage");
|
||||
const mime = require("mime");
|
||||
const cosmos_1 = require("@azure/cosmos");
|
||||
const retry_1 = require("./retry");
|
||||
function log(...args) {
|
||||
console.log(...[`[${new Date().toISOString()}]`, ...args]);
|
||||
}
|
||||
function error(...args) {
|
||||
console.error(...[`[${new Date().toISOString()}]`, ...args]);
|
||||
}
|
||||
if (process.argv.length < 3) {
|
||||
error('Usage: node sync-mooncake.js <quality>');
|
||||
process.exit(-1);
|
||||
}
|
||||
async function sync(commit, quality) {
|
||||
log(`Synchronizing Mooncake assets for ${quality}, ${commit}...`);
|
||||
const client = new cosmos_1.CosmosClient({ endpoint: process.env['AZURE_DOCUMENTDB_ENDPOINT'], key: process.env['AZURE_DOCUMENTDB_MASTERKEY'] });
|
||||
const container = client.database('builds').container(quality);
|
||||
const query = `SELECT TOP 1 * FROM c WHERE c.id = "${commit}"`;
|
||||
const res = await container.items.query(query, {}).fetchAll();
|
||||
if (res.resources.length !== 1) {
|
||||
throw new Error(`No builds found for ${commit}`);
|
||||
}
|
||||
const build = res.resources[0];
|
||||
log(`Found build for ${commit}, with ${build.assets.length} assets`);
|
||||
const storageAccount = process.env['AZURE_STORAGE_ACCOUNT_2'];
|
||||
const blobService = azure.createBlobService(storageAccount, process.env['AZURE_STORAGE_ACCESS_KEY_2'])
|
||||
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
|
||||
const mooncakeBlobService = azure.createBlobService(storageAccount, process.env['MOONCAKE_STORAGE_ACCESS_KEY'], `${storageAccount}.blob.core.chinacloudapi.cn`)
|
||||
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
|
||||
// mooncake is fussy and far away, this is needed!
|
||||
blobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
|
||||
mooncakeBlobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
|
||||
for (const asset of build.assets) {
|
||||
try {
|
||||
const blobPath = url.parse(asset.url).path;
|
||||
if (!blobPath) {
|
||||
throw new Error(`Failed to parse URL: ${asset.url}`);
|
||||
}
|
||||
const blobName = blobPath.replace(/^\/\w+\//, '');
|
||||
log(`Found ${blobName}`);
|
||||
if (asset.mooncakeUrl) {
|
||||
log(` Already in Mooncake ✔️`);
|
||||
continue;
|
||||
}
|
||||
const readStream = blobService.createReadStream(quality, blobName, undefined);
|
||||
const blobOptions = {
|
||||
contentSettings: {
|
||||
contentType: mime.lookup(blobPath),
|
||||
cacheControl: 'max-age=31536000, public'
|
||||
}
|
||||
};
|
||||
const writeStream = mooncakeBlobService.createWriteStreamToBlockBlob(quality, blobName, blobOptions, undefined);
|
||||
log(` Uploading to Mooncake...`);
|
||||
await new Promise((c, e) => readStream.pipe(writeStream).on('finish', c).on('error', e));
|
||||
log(` Updating build in DB...`);
|
||||
const mooncakeUrl = `${process.env['MOONCAKE_CDN_URL']}${blobPath}`;
|
||||
await (0, retry_1.retry)(() => container.scripts.storedProcedure('setAssetMooncakeUrl')
|
||||
.execute('', [commit, asset.platform, asset.type, mooncakeUrl]));
|
||||
log(` Done ✔️`);
|
||||
}
|
||||
catch (err) {
|
||||
error(err);
|
||||
}
|
||||
}
|
||||
log(`All done ✔️`);
|
||||
}
|
||||
function main() {
|
||||
const commit = process.env['BUILD_SOURCEVERSION'];
|
||||
if (!commit) {
|
||||
error('Skipping publish due to missing BUILD_SOURCEVERSION');
|
||||
return;
|
||||
}
|
||||
const quality = process.argv[2];
|
||||
sync(commit, quality).catch(err => {
|
||||
error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
main();
|
||||
@@ -1,131 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as url from 'url';
|
||||
import * as azure from 'azure-storage';
|
||||
import * as mime from 'mime';
|
||||
import { CosmosClient } from '@azure/cosmos';
|
||||
import { retry } from './retry';
|
||||
|
||||
function log(...args: any[]) {
|
||||
console.log(...[`[${new Date().toISOString()}]`, ...args]);
|
||||
}
|
||||
|
||||
function error(...args: any[]) {
|
||||
console.error(...[`[${new Date().toISOString()}]`, ...args]);
|
||||
}
|
||||
|
||||
if (process.argv.length < 3) {
|
||||
error('Usage: node sync-mooncake.js <quality>');
|
||||
process.exit(-1);
|
||||
}
|
||||
|
||||
interface Build {
|
||||
assets: Asset[];
|
||||
}
|
||||
|
||||
interface Asset {
|
||||
platform: string;
|
||||
type: string;
|
||||
url: string;
|
||||
mooncakeUrl: string;
|
||||
hash: string;
|
||||
sha256hash: string;
|
||||
size: number;
|
||||
supportsFastUpdate?: boolean;
|
||||
}
|
||||
|
||||
async function sync(commit: string, quality: string): Promise<void> {
|
||||
log(`Synchronizing Mooncake assets for ${quality}, ${commit}...`);
|
||||
|
||||
const client = new CosmosClient({ endpoint: process.env['AZURE_DOCUMENTDB_ENDPOINT']!, key: process.env['AZURE_DOCUMENTDB_MASTERKEY'] });
|
||||
const container = client.database('builds').container(quality);
|
||||
|
||||
const query = `SELECT TOP 1 * FROM c WHERE c.id = "${commit}"`;
|
||||
const res = await container.items.query<Build>(query, {}).fetchAll();
|
||||
|
||||
if (res.resources.length !== 1) {
|
||||
throw new Error(`No builds found for ${commit}`);
|
||||
}
|
||||
|
||||
const build = res.resources[0];
|
||||
|
||||
log(`Found build for ${commit}, with ${build.assets.length} assets`);
|
||||
|
||||
const storageAccount = process.env['AZURE_STORAGE_ACCOUNT_2']!;
|
||||
|
||||
const blobService = azure.createBlobService(storageAccount, process.env['AZURE_STORAGE_ACCESS_KEY_2']!)
|
||||
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
|
||||
|
||||
const mooncakeBlobService = azure.createBlobService(storageAccount, process.env['MOONCAKE_STORAGE_ACCESS_KEY']!, `${storageAccount}.blob.core.chinacloudapi.cn`)
|
||||
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
|
||||
|
||||
// mooncake is fussy and far away, this is needed!
|
||||
blobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
|
||||
mooncakeBlobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
|
||||
|
||||
for (const asset of build.assets) {
|
||||
try {
|
||||
const blobPath = url.parse(asset.url).path;
|
||||
|
||||
if (!blobPath) {
|
||||
throw new Error(`Failed to parse URL: ${asset.url}`);
|
||||
}
|
||||
|
||||
const blobName = blobPath.replace(/^\/\w+\//, '');
|
||||
|
||||
log(`Found ${blobName}`);
|
||||
|
||||
if (asset.mooncakeUrl) {
|
||||
log(` Already in Mooncake ✔️`);
|
||||
continue;
|
||||
}
|
||||
|
||||
const readStream = blobService.createReadStream(quality, blobName, undefined!);
|
||||
const blobOptions: azure.BlobService.CreateBlockBlobRequestOptions = {
|
||||
contentSettings: {
|
||||
contentType: mime.lookup(blobPath),
|
||||
cacheControl: 'max-age=31536000, public'
|
||||
}
|
||||
};
|
||||
|
||||
const writeStream = mooncakeBlobService.createWriteStreamToBlockBlob(quality, blobName, blobOptions, undefined);
|
||||
|
||||
log(` Uploading to Mooncake...`);
|
||||
await new Promise((c, e) => readStream.pipe(writeStream).on('finish', c).on('error', e));
|
||||
|
||||
log(` Updating build in DB...`);
|
||||
const mooncakeUrl = `${process.env['MOONCAKE_CDN_URL']}${blobPath}`;
|
||||
await retry(() => container.scripts.storedProcedure('setAssetMooncakeUrl')
|
||||
.execute('', [commit, asset.platform, asset.type, mooncakeUrl]));
|
||||
|
||||
log(` Done ✔️`);
|
||||
} catch (err) {
|
||||
error(err);
|
||||
}
|
||||
}
|
||||
|
||||
log(`All done ✔️`);
|
||||
}
|
||||
|
||||
function main(): void {
|
||||
const commit = process.env['BUILD_SOURCEVERSION'];
|
||||
|
||||
if (!commit) {
|
||||
error('Skipping publish due to missing BUILD_SOURCEVERSION');
|
||||
return;
|
||||
}
|
||||
|
||||
const quality = process.argv[2];
|
||||
|
||||
sync(commit, quality).catch(err => {
|
||||
error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
|
||||
main();
|
||||
@@ -35,13 +35,13 @@ steps:
|
||||
displayName: Restore modules for just build folder and compile it
|
||||
|
||||
- download: current
|
||||
artifact: vscode-darwin-$(VSCODE_ARCH)
|
||||
artifact: unsigned_vscode_client_darwin_$(VSCODE_ARCH)_archive
|
||||
displayName: Download $(VSCODE_ARCH) artifact
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
unzip $(Pipeline.Workspace)/vscode-darwin-$(VSCODE_ARCH)/VSCode-darwin-$(VSCODE_ARCH).zip -d $(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH)
|
||||
mv $(Pipeline.Workspace)/vscode-darwin-$(VSCODE_ARCH)/VSCode-darwin-$(VSCODE_ARCH).zip $(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH).zip
|
||||
unzip $(Pipeline.Workspace)/unsigned_vscode_client_darwin_$(VSCODE_ARCH)_archive/VSCode-darwin-$(VSCODE_ARCH).zip -d $(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH)
|
||||
mv $(Pipeline.Workspace)/unsigned_vscode_client_darwin_$(VSCODE_ARCH)_archive/VSCode-darwin-$(VSCODE_ARCH).zip $(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH).zip
|
||||
displayName: Unzip & move
|
||||
|
||||
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
|
||||
@@ -108,22 +108,18 @@ steps:
|
||||
condition: and(succeeded(), ne(variables['VSCODE_ARCH'], 'arm64'))
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
|
||||
# For legacy purposes, arch for x64 is just 'darwin'
|
||||
case $VSCODE_ARCH in
|
||||
x64) ASSET_ID="darwin" ;;
|
||||
arm64) ASSET_ID="darwin-arm64" ;;
|
||||
universal) ASSET_ID="darwin-universal" ;;
|
||||
esac
|
||||
echo "##vso[task.setvariable variable=ASSET_ID]$ASSET_ID"
|
||||
displayName: Set asset id variable
|
||||
|
||||
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
|
||||
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
|
||||
AZURE_STORAGE_ACCESS_KEY="$(ticino-storage-key)" \
|
||||
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
|
||||
node build/azure-pipelines/common/createAsset.js \
|
||||
"$ASSET_ID" \
|
||||
archive \
|
||||
"VSCode-$ASSET_ID.zip" \
|
||||
../VSCode-darwin-$(VSCODE_ARCH).zip
|
||||
displayName: Publish Clients
|
||||
- script: mv $(agent.builddirectory)/VSCode-darwin-x64.zip $(agent.builddirectory)/VSCode-darwin.zip
|
||||
displayName: Rename x64 build to it's legacy name
|
||||
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'))
|
||||
|
||||
- publish: $(Agent.BuildDirectory)/VSCode-$(ASSET_ID).zip
|
||||
artifact: vscode_client_darwin_$(VSCODE_ARCH)_archive
|
||||
|
||||
@@ -138,19 +138,19 @@ steps:
|
||||
condition: and(succeeded(), ne(variables['VSCODE_ARCH'], 'universal'), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||
|
||||
- download: current
|
||||
artifact: vscode-darwin-x64
|
||||
artifact: unsigned_vscode_client_darwin_x64_archive
|
||||
displayName: Download x64 artifact
|
||||
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'universal'))
|
||||
|
||||
- download: current
|
||||
artifact: vscode-darwin-arm64
|
||||
artifact: unsigned_vscode_client_darwin_arm64_archive
|
||||
displayName: Download arm64 artifact
|
||||
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'universal'))
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
cp $(Pipeline.Workspace)/vscode-darwin-x64/VSCode-darwin-x64.zip $(agent.builddirectory)/VSCode-darwin-x64.zip
|
||||
cp $(Pipeline.Workspace)/vscode-darwin-arm64/VSCode-darwin-arm64.zip $(agent.builddirectory)/VSCode-darwin-arm64.zip
|
||||
cp $(Pipeline.Workspace)/unsigned_vscode_client_darwin_x64_archive/VSCode-darwin-x64.zip $(agent.builddirectory)/VSCode-darwin-x64.zip
|
||||
cp $(Pipeline.Workspace)/unsigned_vscode_client_darwin_arm64_archive/VSCode-darwin-arm64.zip $(agent.builddirectory)/VSCode-darwin-arm64.zip
|
||||
unzip $(agent.builddirectory)/VSCode-darwin-x64.zip -d $(agent.builddirectory)/VSCode-darwin-x64
|
||||
unzip $(agent.builddirectory)/VSCode-darwin-arm64.zip -d $(agent.builddirectory)/VSCode-darwin-arm64
|
||||
DEBUG=* node build/darwin/create-universal-app.js
|
||||
@@ -280,26 +280,27 @@ steps:
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
|
||||
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
|
||||
AZURE_STORAGE_ACCESS_KEY="$(ticino-storage-key)" \
|
||||
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
|
||||
VSCODE_ARCH="$(VSCODE_ARCH)" ./build/azure-pipelines/darwin/publish-server.sh
|
||||
displayName: Publish Servers
|
||||
|
||||
# package Remote Extension Host
|
||||
pushd .. && mv vscode-reh-darwin vscode-server-darwin && zip -Xry vscode-server-darwin.zip vscode-server-darwin && popd
|
||||
|
||||
# package Remote Extension Host (Web)
|
||||
pushd .. && mv vscode-reh-web-darwin vscode-server-darwin-web && zip -Xry vscode-server-darwin-web.zip vscode-server-darwin-web && popd
|
||||
displayName: Prepare to publish servers
|
||||
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- publish: $(Agent.BuildDirectory)/VSCode-darwin-$(VSCODE_ARCH).zip
|
||||
artifact: vscode-darwin-$(VSCODE_ARCH)
|
||||
artifact: unsigned_vscode_client_darwin_$(VSCODE_ARCH)_archive
|
||||
displayName: Publish client archive
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- publish: $(Agent.BuildDirectory)/vscode-server-darwin.zip
|
||||
artifact: vscode-server-darwin-$(VSCODE_ARCH)
|
||||
artifact: vscode_server_darwin_$(VSCODE_ARCH)_archive-unsigned
|
||||
displayName: Publish server archive
|
||||
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- publish: $(Agent.BuildDirectory)/vscode-server-darwin-web.zip
|
||||
artifact: vscode-server-darwin-$(VSCODE_ARCH)-web
|
||||
artifact: vscode_web_darwin_$(VSCODE_ARCH)_archive-unsigned
|
||||
displayName: Publish web server archive
|
||||
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
@@ -308,5 +309,5 @@ steps:
|
||||
VSCODE_ARCH="$(VSCODE_ARCH)" \
|
||||
yarn gulp upload-vscode-configuration
|
||||
displayName: Upload configuration (for Bing settings search)
|
||||
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'))
|
||||
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
continueOnError: true
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
if [ "$VSCODE_ARCH" == "x64" ]; then
|
||||
# package Remote Extension Host
|
||||
pushd .. && mv vscode-reh-darwin vscode-server-darwin && zip -Xry vscode-server-darwin.zip vscode-server-darwin && popd
|
||||
|
||||
# publish Remote Extension Host
|
||||
node build/azure-pipelines/common/createAsset.js \
|
||||
server-darwin \
|
||||
archive-unsigned \
|
||||
"vscode-server-darwin.zip" \
|
||||
../vscode-server-darwin.zip
|
||||
fi
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
REPO="$(pwd)"
|
||||
ROOT="$REPO/.."
|
||||
|
||||
PLATFORM_LINUX="linux-alpine"
|
||||
|
||||
# Publish Remote Extension Host
|
||||
LEGACY_SERVER_BUILD_NAME="vscode-reh-$PLATFORM_LINUX"
|
||||
SERVER_BUILD_NAME="vscode-server-$PLATFORM_LINUX"
|
||||
SERVER_TARBALL_FILENAME="vscode-server-$PLATFORM_LINUX.tar.gz"
|
||||
SERVER_TARBALL_PATH="$ROOT/$SERVER_TARBALL_FILENAME"
|
||||
|
||||
rm -rf $ROOT/vscode-server-*.tar.*
|
||||
(cd $ROOT && mv $LEGACY_SERVER_BUILD_NAME $SERVER_BUILD_NAME && tar --owner=0 --group=0 -czf $SERVER_TARBALL_PATH $SERVER_BUILD_NAME)
|
||||
|
||||
node build/azure-pipelines/common/createAsset.js "server-$PLATFORM_LINUX" archive-unsigned "$SERVER_TARBALL_FILENAME" "$SERVER_TARBALL_PATH"
|
||||
|
||||
# Publish Remote Extension Host (Web)
|
||||
LEGACY_SERVER_BUILD_NAME="vscode-reh-web-$PLATFORM_LINUX"
|
||||
SERVER_BUILD_NAME="vscode-server-$PLATFORM_LINUX-web"
|
||||
SERVER_TARBALL_FILENAME="vscode-server-$PLATFORM_LINUX-web.tar.gz"
|
||||
SERVER_TARBALL_PATH="$ROOT/$SERVER_TARBALL_FILENAME"
|
||||
|
||||
rm -rf $ROOT/vscode-server-*-web.tar.*
|
||||
(cd $ROOT && mv $LEGACY_SERVER_BUILD_NAME $SERVER_BUILD_NAME && tar --owner=0 --group=0 -czf $SERVER_TARBALL_PATH $SERVER_BUILD_NAME)
|
||||
|
||||
node build/azure-pipelines/common/createAsset.js "server-$PLATFORM_LINUX-web" archive-unsigned "$SERVER_TARBALL_FILENAME" "$SERVER_TARBALL_PATH"
|
||||
@@ -13,8 +13,6 @@ TARBALL_PATH="$ROOT/$TARBALL_FILENAME"
|
||||
rm -rf $ROOT/code-*.tar.*
|
||||
(cd $ROOT && tar -czf $TARBALL_PATH $BUILDNAME)
|
||||
|
||||
node build/azure-pipelines/common/createAsset.js "$PLATFORM_LINUX" archive-unsigned "$TARBALL_FILENAME" "$TARBALL_PATH"
|
||||
|
||||
# Publish Remote Extension Host
|
||||
LEGACY_SERVER_BUILD_NAME="vscode-reh-$PLATFORM_LINUX"
|
||||
SERVER_BUILD_NAME="vscode-server-$PLATFORM_LINUX"
|
||||
@@ -24,8 +22,6 @@ SERVER_TARBALL_PATH="$ROOT/$SERVER_TARBALL_FILENAME"
|
||||
rm -rf $ROOT/vscode-server-*.tar.*
|
||||
(cd $ROOT && mv $LEGACY_SERVER_BUILD_NAME $SERVER_BUILD_NAME && tar --owner=0 --group=0 -czf $SERVER_TARBALL_PATH $SERVER_BUILD_NAME)
|
||||
|
||||
node build/azure-pipelines/common/createAsset.js "server-$PLATFORM_LINUX" archive-unsigned "$SERVER_TARBALL_FILENAME" "$SERVER_TARBALL_PATH"
|
||||
|
||||
# Publish Remote Extension Host (Web)
|
||||
LEGACY_SERVER_BUILD_NAME="vscode-reh-web-$PLATFORM_LINUX"
|
||||
SERVER_BUILD_NAME="vscode-server-$PLATFORM_LINUX-web"
|
||||
@@ -35,8 +31,6 @@ SERVER_TARBALL_PATH="$ROOT/$SERVER_TARBALL_FILENAME"
|
||||
rm -rf $ROOT/vscode-server-*-web.tar.*
|
||||
(cd $ROOT && mv $LEGACY_SERVER_BUILD_NAME $SERVER_BUILD_NAME && tar --owner=0 --group=0 -czf $SERVER_TARBALL_PATH $SERVER_BUILD_NAME)
|
||||
|
||||
node build/azure-pipelines/common/createAsset.js "server-$PLATFORM_LINUX-web" archive-unsigned "$SERVER_TARBALL_FILENAME" "$SERVER_TARBALL_PATH"
|
||||
|
||||
# Publish DEB
|
||||
case $VSCODE_ARCH in
|
||||
x64) DEB_ARCH="amd64" ;;
|
||||
@@ -47,8 +41,6 @@ PLATFORM_DEB="linux-deb-$VSCODE_ARCH"
|
||||
DEB_FILENAME="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/)"
|
||||
DEB_PATH="$REPO/.build/linux/deb/$DEB_ARCH/deb/$DEB_FILENAME"
|
||||
|
||||
node build/azure-pipelines/common/createAsset.js "$PLATFORM_DEB" package "$DEB_FILENAME" "$DEB_PATH"
|
||||
|
||||
# Publish RPM
|
||||
case $VSCODE_ARCH in
|
||||
x64) RPM_ARCH="x86_64" ;;
|
||||
@@ -61,8 +53,6 @@ PLATFORM_RPM="linux-rpm-$VSCODE_ARCH"
|
||||
RPM_FILENAME="$(ls $REPO/.build/linux/rpm/$RPM_ARCH/ | grep .rpm)"
|
||||
RPM_PATH="$REPO/.build/linux/rpm/$RPM_ARCH/$RPM_FILENAME"
|
||||
|
||||
node build/azure-pipelines/common/createAsset.js "$PLATFORM_RPM" package "$RPM_FILENAME" "$RPM_PATH"
|
||||
|
||||
# Publish Snap
|
||||
# Pack snap tarball artifact, in order to preserve file perms
|
||||
mkdir -p $REPO/.build/linux/snap-tarball
|
||||
@@ -73,3 +63,4 @@ rm -rf $SNAP_TARBALL_PATH
|
||||
# Export DEB_PATH, RPM_PATH
|
||||
echo "##vso[task.setvariable variable=DEB_PATH]$DEB_PATH"
|
||||
echo "##vso[task.setvariable variable=RPM_PATH]$RPM_PATH"
|
||||
echo "##vso[task.setvariable variable=TARBALL_PATH]$TARBALL_PATH"
|
||||
@@ -117,19 +117,37 @@ steps:
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
|
||||
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
|
||||
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
|
||||
./build/azure-pipelines/linux/alpine/publish.sh
|
||||
displayName: Publish
|
||||
REPO="$(pwd)"
|
||||
ROOT="$REPO/.."
|
||||
|
||||
PLATFORM_LINUX="linux-alpine"
|
||||
|
||||
# Publish Remote Extension Host
|
||||
LEGACY_SERVER_BUILD_NAME="vscode-reh-$PLATFORM_LINUX"
|
||||
SERVER_BUILD_NAME="vscode-server-$PLATFORM_LINUX"
|
||||
SERVER_TARBALL_FILENAME="vscode-server-$PLATFORM_LINUX.tar.gz"
|
||||
SERVER_TARBALL_PATH="$ROOT/$SERVER_TARBALL_FILENAME"
|
||||
|
||||
rm -rf $ROOT/vscode-server-*.tar.*
|
||||
(cd $ROOT && mv $LEGACY_SERVER_BUILD_NAME $SERVER_BUILD_NAME && tar --owner=0 --group=0 -czf $SERVER_TARBALL_PATH $SERVER_BUILD_NAME)
|
||||
|
||||
# Publish Remote Extension Host (Web)
|
||||
LEGACY_SERVER_BUILD_NAME="vscode-reh-web-$PLATFORM_LINUX"
|
||||
SERVER_BUILD_NAME="vscode-server-$PLATFORM_LINUX-web"
|
||||
SERVER_TARBALL_FILENAME="vscode-server-$PLATFORM_LINUX-web.tar.gz"
|
||||
SERVER_TARBALL_PATH="$ROOT/$SERVER_TARBALL_FILENAME"
|
||||
|
||||
rm -rf $ROOT/vscode-server-*-web.tar.*
|
||||
(cd $ROOT && mv $LEGACY_SERVER_BUILD_NAME $SERVER_BUILD_NAME && tar --owner=0 --group=0 -czf $SERVER_TARBALL_PATH $SERVER_BUILD_NAME)
|
||||
displayName: Prepare for publish
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- publish: $(Agent.BuildDirectory)/vscode-server-linux-alpine.tar.gz
|
||||
artifact: vscode-server-linux-alpine
|
||||
artifact: vscode_server_linux_alpine_archive-unsigned
|
||||
displayName: Publish server archive
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- publish: $(Agent.BuildDirectory)/vscode-server-linux-alpine-web.tar.gz
|
||||
artifact: vscode-server-linux-alpine-web
|
||||
artifact: vscode_web_linux_alpine_archive-unsigned
|
||||
displayName: Publish web server archive
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
@@ -245,27 +245,32 @@ steps:
|
||||
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
|
||||
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
|
||||
VSCODE_ARCH="$(VSCODE_ARCH)" \
|
||||
./build/azure-pipelines/linux/publish.sh
|
||||
displayName: Publish
|
||||
./build/azure-pipelines/linux/prepare-publish.sh
|
||||
displayName: Prepare for Publish
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- publish: $(DEB_PATH)
|
||||
artifact: vscode-linux-deb-$(VSCODE_ARCH)
|
||||
artifact: vscode_client_linux_$(VSCODE_ARCH)_deb-package
|
||||
displayName: Publish deb package
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- publish: $(RPM_PATH)
|
||||
artifact: vscode-linux-rpm-$(VSCODE_ARCH)
|
||||
artifact: vscode_client_linux_$(VSCODE_ARCH)_rpm-package
|
||||
displayName: Publish rpm package
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- publish: $(TARBALL_PATH)
|
||||
artifact: vscode_client_linux_$(VSCODE_ARCH)_archive-unsigned
|
||||
displayName: Publish client archive
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- publish: $(Agent.BuildDirectory)/vscode-server-linux-$(VSCODE_ARCH).tar.gz
|
||||
artifact: vscode-server-linux-$(VSCODE_ARCH)
|
||||
artifact: vscode_server_linux_$(VSCODE_ARCH)_archive-unsigned
|
||||
displayName: Publish server archive
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- publish: $(Agent.BuildDirectory)/vscode-server-linux-$(VSCODE_ARCH)-web.tar.gz
|
||||
artifact: vscode-server-linux-$(VSCODE_ARCH)-web
|
||||
artifact: vscode_web_linux_$(VSCODE_ARCH)_archive-unsigned
|
||||
displayName: Publish web server archive
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
|
||||
@@ -50,15 +50,11 @@ steps:
|
||||
esac
|
||||
(cd $SNAP_ROOT/code-* && sudo --preserve-env snapcraft prime $SNAPCRAFT_TARGET_ARGS && snap pack prime --compression=lzo --filename="$SNAP_PATH")
|
||||
|
||||
# Publish snap package
|
||||
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
|
||||
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
|
||||
node build/azure-pipelines/common/createAsset.js "linux-snap-$(VSCODE_ARCH)" package "$SNAP_FILENAME" "$SNAP_PATH"
|
||||
|
||||
# Export SNAP_PATH
|
||||
echo "##vso[task.setvariable variable=SNAP_PATH]$SNAP_PATH"
|
||||
displayName: Prepare for publish
|
||||
|
||||
- publish: $(SNAP_PATH)
|
||||
artifact: vscode-linux-snap-$(VSCODE_ARCH)
|
||||
artifact: vscode_client_linux_$(VSCODE_ARCH)_snap
|
||||
displayName: Publish snap package
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
@@ -86,6 +86,8 @@ variables:
|
||||
value: ${{ eq(parameters.ENABLE_TERRAPIN, true) }}
|
||||
- name: VSCODE_QUALITY
|
||||
value: ${{ parameters.VSCODE_QUALITY }}
|
||||
- name: VSCODE_RELEASE
|
||||
value: ${{ parameters.VSCODE_RELEASE }}
|
||||
- name: VSCODE_BUILD_STAGE_WINDOWS
|
||||
value: ${{ or(eq(parameters.VSCODE_BUILD_WIN32, true), eq(parameters.VSCODE_BUILD_WIN32_32BIT, true), eq(parameters.VSCODE_BUILD_WIN32_ARM64, true)) }}
|
||||
- name: VSCODE_BUILD_STAGE_LINUX
|
||||
@@ -301,37 +303,30 @@ stages:
|
||||
steps:
|
||||
- template: darwin/product-build-darwin-sign.yml
|
||||
|
||||
- ${{ if and(eq(variables['VSCODE_PUBLISH'], true), eq(parameters.VSCODE_COMPILE_ONLY, false)) }}:
|
||||
- stage: Mooncake
|
||||
- ${{ if and(eq(parameters.VSCODE_COMPILE_ONLY, false), ne(variables['VSCODE_PUBLISH'], 'false')) }}:
|
||||
- stage: Publish
|
||||
dependsOn:
|
||||
- ${{ if eq(variables['VSCODE_BUILD_STAGE_WINDOWS'], true) }}:
|
||||
- Windows
|
||||
- ${{ if eq(variables['VSCODE_BUILD_STAGE_LINUX'], true) }}:
|
||||
- Linux
|
||||
- ${{ if eq(variables['VSCODE_BUILD_STAGE_MACOS'], true) }}:
|
||||
- macOS
|
||||
condition: succeededOrFailed()
|
||||
- Compile
|
||||
pool:
|
||||
vmImage: "Ubuntu-18.04"
|
||||
variables:
|
||||
- name: BUILDS_API_URL
|
||||
value: $(System.CollectionUri)$(System.TeamProject)/_apis/build/builds/$(Build.BuildId)/
|
||||
jobs:
|
||||
- job: SyncMooncake
|
||||
displayName: Sync Mooncake
|
||||
- job: PublishBuild
|
||||
timeoutInMinutes: 180
|
||||
displayName: Publish Build
|
||||
steps:
|
||||
- template: sync-mooncake.yml
|
||||
- template: product-publish.yml
|
||||
|
||||
- ${{ if and(eq(parameters.VSCODE_COMPILE_ONLY, false), or(eq(parameters.VSCODE_RELEASE, true), and(in(parameters.VSCODE_QUALITY, 'insider', 'exploration'), eq(variables['VSCODE_SCHEDULEDBUILD'], true)))) }}:
|
||||
- stage: Release
|
||||
dependsOn:
|
||||
- ${{ if eq(variables['VSCODE_BUILD_STAGE_WINDOWS'], true) }}:
|
||||
- Windows
|
||||
- ${{ if eq(variables['VSCODE_BUILD_STAGE_LINUX'], true) }}:
|
||||
- Linux
|
||||
- ${{ if eq(variables['VSCODE_BUILD_STAGE_MACOS'], true) }}:
|
||||
- macOS
|
||||
pool:
|
||||
vmImage: "Ubuntu-18.04"
|
||||
jobs:
|
||||
- job: ReleaseBuild
|
||||
displayName: Release Build
|
||||
steps:
|
||||
- template: release.yml
|
||||
- ${{ if or(eq(parameters.VSCODE_RELEASE, true), and(in(parameters.VSCODE_QUALITY, 'insider', 'exploration'), eq(variables['VSCODE_SCHEDULEDBUILD'], true))) }}:
|
||||
- stage: Release
|
||||
dependsOn:
|
||||
- Publish
|
||||
pool:
|
||||
vmImage: "Ubuntu-18.04"
|
||||
jobs:
|
||||
- job: ReleaseBuild
|
||||
displayName: Release Build
|
||||
steps:
|
||||
- template: product-release.yml
|
||||
|
||||
@@ -118,14 +118,6 @@ steps:
|
||||
displayName: Publish Webview
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
VERSION=`node -p "require(\"./package.json\").version"`
|
||||
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
|
||||
node build/azure-pipelines/common/createBuild.js $VERSION
|
||||
displayName: Create build
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
# we gotta tarball everything in order to preserve file permissions
|
||||
- script: |
|
||||
set -e
|
||||
|
||||
114
build/azure-pipelines/product-publish.ps1
Normal file
114
build/azure-pipelines/product-publish.ps1
Normal file
@@ -0,0 +1,114 @@
|
||||
. build/azure-pipelines/win32/exec.ps1
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
$ARTIFACT_PROCESSED_WILDCARD_PATH = "$env:PIPELINE_WORKSPACE/artifacts_processed_*/artifacts_processed_*"
|
||||
$ARTIFACT_PROCESSED_FILE_PATH = "$env:PIPELINE_WORKSPACE/artifacts_processed_$env:SYSTEM_STAGEATTEMPT/artifacts_processed_$env:SYSTEM_STAGEATTEMPT.txt"
|
||||
|
||||
function Get-PipelineArtifact {
|
||||
param($Name = '*')
|
||||
try {
|
||||
$res = Invoke-RestMethod "$($env:BUILDS_API_URL)artifacts?api-version=6.0" -Headers @{
|
||||
Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN"
|
||||
} -MaximumRetryCount 5 -RetryIntervalSec 1
|
||||
|
||||
if (!$res) {
|
||||
return
|
||||
}
|
||||
|
||||
$res.value | Where-Object { $_.name -Like $Name }
|
||||
} catch {
|
||||
Write-Warning $_
|
||||
}
|
||||
}
|
||||
|
||||
# This set will keep track of which artifacts have already been processed
|
||||
$set = [System.Collections.Generic.HashSet[string]]::new()
|
||||
|
||||
if (Test-Path $ARTIFACT_PROCESSED_WILDCARD_PATH) {
|
||||
# Grab the latest artifact_processed text file and load all assets already processed from that.
|
||||
# This means that the latest artifact_processed_*.txt file has all of the contents of the previous ones.
|
||||
# Note: The kusto-like syntax only works in PS7+ and only in scripts, not at the REPL.
|
||||
Get-ChildItem $ARTIFACT_PROCESSED_WILDCARD_PATH
|
||||
| Sort-Object
|
||||
| Select-Object -Last 1
|
||||
| Get-Content
|
||||
| ForEach-Object {
|
||||
$set.Add($_) | Out-Null
|
||||
Write-Host "Already processed artifact: $_"
|
||||
}
|
||||
}
|
||||
|
||||
# Create the artifact file that will be used for this run
|
||||
New-Item -Path $ARTIFACT_PROCESSED_FILE_PATH -Force | Out-Null
|
||||
|
||||
# Determine which stages we need to watch
|
||||
$stages = @(
|
||||
if ($env:VSCODE_BUILD_STAGE_WINDOWS -eq 'True') { 'Windows' }
|
||||
if ($env:VSCODE_BUILD_STAGE_LINUX -eq 'True') { 'Linux' }
|
||||
if ($env:VSCODE_BUILD_STAGE_MACOS -eq 'True') { 'macOS' }
|
||||
)
|
||||
|
||||
do {
|
||||
Start-Sleep -Seconds 10
|
||||
|
||||
$artifacts = Get-PipelineArtifact -Name 'vscode_*'
|
||||
if (!$artifacts) {
|
||||
continue
|
||||
}
|
||||
|
||||
$artifacts | ForEach-Object {
|
||||
$artifactName = $_.name
|
||||
if($set.Add($artifactName)) {
|
||||
Write-Host "Processing artifact: '$artifactName. Downloading from: $($_.resource.downloadUrl)"
|
||||
|
||||
try {
|
||||
Invoke-RestMethod $_.resource.downloadUrl -OutFile "$env:AGENT_TEMPDIRECTORY/$artifactName.zip" -Headers @{
|
||||
Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN"
|
||||
} -MaximumRetryCount 5 -RetryIntervalSec 1 | Out-Null
|
||||
|
||||
Expand-Archive -Path "$env:AGENT_TEMPDIRECTORY/$artifactName.zip" -DestinationPath $env:AGENT_TEMPDIRECTORY | Out-Null
|
||||
} catch {
|
||||
Write-Warning $_
|
||||
$set.Remove($artifactName) | Out-Null
|
||||
continue
|
||||
}
|
||||
|
||||
$null,$product,$os,$arch,$type = $artifactName -split '_'
|
||||
$asset = Get-ChildItem -rec "$env:AGENT_TEMPDIRECTORY/$artifactName"
|
||||
Write-Host "Processing artifact with the following values:"
|
||||
# turning in into an object just to log nicely
|
||||
@{
|
||||
product = $product
|
||||
os = $os
|
||||
arch = $arch
|
||||
type = $type
|
||||
asset = $asset.Name
|
||||
} | Format-Table
|
||||
|
||||
exec { node build/azure-pipelines/common/createAsset.js $product $os $arch $type $asset.Name $asset.FullName }
|
||||
$artifactName >> $ARTIFACT_PROCESSED_FILE_PATH
|
||||
}
|
||||
}
|
||||
|
||||
# Get the timeline and see if it says the other stage completed
|
||||
try {
|
||||
$timeline = Invoke-RestMethod "$($env:BUILDS_API_URL)timeline?api-version=6.0" -Headers @{
|
||||
Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN"
|
||||
} -MaximumRetryCount 5 -RetryIntervalSec 1
|
||||
} catch {
|
||||
Write-Warning $_
|
||||
continue
|
||||
}
|
||||
|
||||
foreach ($stage in $stages) {
|
||||
$otherStageFinished = $timeline.records | Where-Object { $_.name -eq $stage -and $_.type -eq 'stage' -and $_.state -eq 'completed' }
|
||||
if (!$otherStageFinished) {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
$artifacts = Get-PipelineArtifact -Name 'vscode_*'
|
||||
$artifactsStillToProcess = $artifacts.Count -ne $set.Count
|
||||
} while (!$otherStageFinished -or $artifactsStillToProcess)
|
||||
|
||||
Write-Host "Processed $($set.Count) artifacts."
|
||||
89
build/azure-pipelines/product-publish.yml
Normal file
89
build/azure-pipelines/product-publish.yml
Normal file
@@ -0,0 +1,89 @@
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: "12.x"
|
||||
|
||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||
inputs:
|
||||
versionSpec: "1.x"
|
||||
|
||||
- task: AzureKeyVault@1
|
||||
displayName: "Azure Key Vault: Get Secrets"
|
||||
inputs:
|
||||
azureSubscription: "vscode-builds-subscription"
|
||||
KeyVaultName: vscode
|
||||
|
||||
- pwsh: |
|
||||
. build/azure-pipelines/win32/exec.ps1
|
||||
cd build
|
||||
exec { yarn }
|
||||
displayName: Install dependencies
|
||||
|
||||
- download: current
|
||||
patterns: '**/artifacts_processed_*.txt'
|
||||
displayName: Download all artifacts_processed text files
|
||||
|
||||
- pwsh: |
|
||||
. build/azure-pipelines/win32/exec.ps1
|
||||
|
||||
if (Test-Path "$(Pipeline.Workspace)/artifacts_processed_*/artifacts_processed_*.txt") {
|
||||
Write-Host "Artifacts already processed so a build must have already been created."
|
||||
return
|
||||
}
|
||||
|
||||
$env:AZURE_DOCUMENTDB_MASTERKEY = "$(builds-docdb-key-readwrite)"
|
||||
$VERSION = node -p "require('./package.json').version"
|
||||
Write-Host "Creating build with version: $VERSION"
|
||||
exec { node build/azure-pipelines/common/createBuild.js $VERSION }
|
||||
displayName: Create build if it hasn't been created before
|
||||
|
||||
- pwsh: |
|
||||
$env:VSCODE_MIXIN_PASSWORD = "$(github-distro-mixin-password)"
|
||||
$env:AZURE_DOCUMENTDB_MASTERKEY = "$(builds-docdb-key-readwrite)"
|
||||
$env:AZURE_STORAGE_ACCESS_KEY = "$(ticino-storage-key)"
|
||||
$env:AZURE_STORAGE_ACCESS_KEY_2 = "$(vscode-storage-key)"
|
||||
$env:MOONCAKE_STORAGE_ACCESS_KEY = "$(vscode-mooncake-storage-key)"
|
||||
build/azure-pipelines/product-publish.ps1
|
||||
env:
|
||||
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||
displayName: Process artifacts
|
||||
|
||||
- publish: $(Pipeline.Workspace)/artifacts_processed_$(System.StageAttempt)/artifacts_processed_$(System.StageAttempt).txt
|
||||
artifact: artifacts_processed_$(System.StageAttempt)
|
||||
displayName: Publish what artifacts were published for this stage attempt
|
||||
|
||||
- pwsh: |
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
# Determine which stages we need to watch
|
||||
$stages = @(
|
||||
if ($env:VSCODE_BUILD_STAGE_WINDOWS -eq 'True') { 'Windows' }
|
||||
if ($env:VSCODE_BUILD_STAGE_LINUX -eq 'True') { 'Linux' }
|
||||
if ($env:VSCODE_BUILD_STAGE_MACOS -eq 'True') { 'macOS' }
|
||||
)
|
||||
Write-Host "Stages to check: $stages"
|
||||
|
||||
# Get the timeline and see if it says the other stage completed
|
||||
$timeline = Invoke-RestMethod "$($env:BUILDS_API_URL)timeline?api-version=6.0" -Headers @{
|
||||
Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN"
|
||||
} -MaximumRetryCount 5 -RetryIntervalSec 1
|
||||
|
||||
$failedStages = @()
|
||||
foreach ($stage in $stages) {
|
||||
$didStageFail = $timeline.records | Where-Object {
|
||||
$_.name -eq $stage -and $_.type -eq 'stage' -and $_.result -ne 'succeeded' -and $_.result -ne 'succeededWithIssues'
|
||||
}
|
||||
|
||||
if($didStageFail) {
|
||||
$failedStages += $stage
|
||||
} else {
|
||||
Write-Host "'$stage' did not fail."
|
||||
}
|
||||
}
|
||||
|
||||
if ($failedStages.Length) {
|
||||
throw "Failed stages: $($failedStages -join ', '). This stage will now fail so that it is easier to retry failed jobs."
|
||||
}
|
||||
env:
|
||||
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||
displayName: Determine if stage should succeed
|
||||
@@ -63,8 +63,8 @@ function getNewFileHeader(tag) {
|
||||
``,
|
||||
`/*---------------------------------------------------------------------------------------------`,
|
||||
` * Copyright (c) Microsoft Corporation. All rights reserved.`,
|
||||
` * Licensed under the MIT License.`,
|
||||
` * See https://github.com/Microsoft/azuredatastudio/blob/main/LICENSE.txt for license information.`,
|
||||
` * Licensed under the Source EULA.`,
|
||||
` * See https://github.com/microsoft/azuredatastudio/blob/main/LICENSE.txt for license information.`,
|
||||
` *--------------------------------------------------------------------------------------------*/`,
|
||||
``,
|
||||
`/**`,
|
||||
|
||||
@@ -75,8 +75,8 @@ function getNewFileHeader(tag: string) {
|
||||
``,
|
||||
`/*---------------------------------------------------------------------------------------------`,
|
||||
` * Copyright (c) Microsoft Corporation. All rights reserved.`,
|
||||
` * Licensed under the MIT License.`,
|
||||
` * See https://github.com/Microsoft/azuredatastudio/blob/main/LICENSE.txt for license information.`,
|
||||
` * Licensed under the Source EULA.`,
|
||||
` * See https://github.com/microsoft/azuredatastudio/blob/main/LICENSE.txt for license information.`,
|
||||
` *--------------------------------------------------------------------------------------------*/`,
|
||||
``,
|
||||
`/**`,
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: "14.x"
|
||||
|
||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||
inputs:
|
||||
versionSpec: "1.x"
|
||||
|
||||
- task: AzureKeyVault@1
|
||||
displayName: "Azure Key Vault: Get Secrets"
|
||||
inputs:
|
||||
azureSubscription: "vscode-builds-subscription"
|
||||
KeyVaultName: vscode
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
|
||||
(cd build ; yarn)
|
||||
|
||||
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
|
||||
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
|
||||
MOONCAKE_STORAGE_ACCESS_KEY="$(vscode-mooncake-storage-key)" \
|
||||
node build/azure-pipelines/common/sync-mooncake.js "$VSCODE_QUALITY"
|
||||
@@ -119,13 +119,19 @@ steps:
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
|
||||
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
|
||||
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
|
||||
./build/azure-pipelines/web/publish.sh
|
||||
displayName: Publish
|
||||
REPO="$(pwd)"
|
||||
ROOT="$REPO/.."
|
||||
|
||||
WEB_BUILD_NAME="vscode-web"
|
||||
WEB_TARBALL_FILENAME="vscode-web.tar.gz"
|
||||
WEB_TARBALL_PATH="$ROOT/$WEB_TARBALL_FILENAME"
|
||||
|
||||
rm -rf $ROOT/vscode-web.tar.*
|
||||
|
||||
cd $ROOT && tar --owner=0 --group=0 -czf $WEB_TARBALL_PATH $WEB_BUILD_NAME
|
||||
displayName: Prepare for publish
|
||||
|
||||
- publish: $(Agent.BuildDirectory)/vscode-web.tar.gz
|
||||
artifact: vscode-web-standalone
|
||||
artifact: vscode_web_linux_standalone_archive-unsigned
|
||||
displayName: Publish web archive
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
REPO="$(pwd)"
|
||||
ROOT="$REPO/.."
|
||||
|
||||
# Publish Web Client
|
||||
WEB_BUILD_NAME="vscode-web"
|
||||
WEB_TARBALL_FILENAME="vscode-web.tar.gz"
|
||||
WEB_TARBALL_PATH="$ROOT/$WEB_TARBALL_FILENAME"
|
||||
|
||||
rm -rf $ROOT/vscode-web.tar.*
|
||||
|
||||
(cd $ROOT && tar --owner=0 --group=0 -czf $WEB_TARBALL_PATH $WEB_BUILD_NAME)
|
||||
|
||||
node build/azure-pipelines/common/createAsset.js web-standalone archive-unsigned "$WEB_TARBALL_FILENAME" "$WEB_TARBALL_PATH"
|
||||
@@ -13,24 +13,31 @@ $Zip = "$Repo\.build\win32-$Arch\archive\VSCode-win32-$Arch.zip"
|
||||
$LegacyServer = "$Root\vscode-reh-win32-$Arch"
|
||||
$Server = "$Root\vscode-server-win32-$Arch"
|
||||
$ServerZip = "$Repo\.build\vscode-server-win32-$Arch.zip"
|
||||
$LegacyWeb = "$Root\vscode-reh-web-win32-$Arch"
|
||||
$Web = "$Root\vscode-server-win32-$Arch-web"
|
||||
$WebZip = "$Repo\.build\vscode-server-win32-$Arch-web.zip"
|
||||
$Build = "$Root\VSCode-win32-$Arch"
|
||||
|
||||
# Create server archive
|
||||
if ("$Arch" -ne "arm64") {
|
||||
exec { xcopy $LegacyServer $Server /H /E /I }
|
||||
exec { .\node_modules\7zip\7zip-lite\7z.exe a -tzip $ServerZip $Server -r }
|
||||
exec { xcopy $LegacyWeb $Web /H /E /I }
|
||||
exec { .\node_modules\7zip\7zip-lite\7z.exe a -tzip $WebZip $Web -r }
|
||||
}
|
||||
|
||||
# get version
|
||||
$PackageJson = Get-Content -Raw -Path "$Build\resources\app\package.json" | ConvertFrom-Json
|
||||
$Version = $PackageJson.version
|
||||
|
||||
$AssetPlatform = if ("$Arch" -eq "ia32") { "win32" } else { "win32-$Arch" }
|
||||
$ARCHIVE_NAME = "VSCode-win32-$Arch-$Version.zip"
|
||||
$SYSTEM_SETUP_NAME = "VSCodeSetup-$Arch-$Version.exe"
|
||||
$USER_SETUP_NAME = "VSCodeUserSetup-$Arch-$Version.exe"
|
||||
|
||||
exec { node build/azure-pipelines/common/createAsset.js "$AssetPlatform-archive" archive "VSCode-win32-$Arch-$Version.zip" $Zip }
|
||||
exec { node build/azure-pipelines/common/createAsset.js "$AssetPlatform" setup "VSCodeSetup-$Arch-$Version.exe" $SystemExe }
|
||||
exec { node build/azure-pipelines/common/createAsset.js "$AssetPlatform-user" setup "VSCodeUserSetup-$Arch-$Version.exe" $UserExe }
|
||||
|
||||
if ("$Arch" -ne "arm64") {
|
||||
exec { node build/azure-pipelines/common/createAsset.js "server-$AssetPlatform" archive "vscode-server-win32-$Arch.zip" $ServerZip }
|
||||
}
|
||||
# Set variables for upload
|
||||
Move-Item $Zip "$Repo\.build\win32-$Arch\archive\$ARCHIVE_NAME"
|
||||
Write-Host "##vso[task.setvariable variable=ARCHIVE_NAME]$ARCHIVE_NAME"
|
||||
Move-Item $SystemExe "$Repo\.build\win32-$Arch\system-setup\$SYSTEM_SETUP_NAME"
|
||||
Write-Host "##vso[task.setvariable variable=SYSTEM_SETUP_NAME]$SYSTEM_SETUP_NAME"
|
||||
Move-Item $UserExe "$Repo\.build\win32-$Arch\user-setup\$USER_SETUP_NAME"
|
||||
Write-Host "##vso[task.setvariable variable=USER_SETUP_NAME]$USER_SETUP_NAME"
|
||||
@@ -295,31 +295,31 @@ steps:
|
||||
$env:AZURE_STORAGE_ACCESS_KEY_2 = "$(vscode-storage-key)"
|
||||
$env:AZURE_DOCUMENTDB_MASTERKEY = "$(builds-docdb-key-readwrite)"
|
||||
$env:VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)"
|
||||
.\build\azure-pipelines\win32\publish.ps1
|
||||
.\build\azure-pipelines\win32\prepare-publish.ps1
|
||||
displayName: Publish
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- publish: $(System.DefaultWorkingDirectory)\.build\win32-$(VSCODE_ARCH)\archive\VSCode-win32-$(VSCODE_ARCH).zip
|
||||
artifact: vscode-win32-$(VSCODE_ARCH)
|
||||
- publish: $(System.DefaultWorkingDirectory)\.build\win32-$(VSCODE_ARCH)\archive\$(ARCHIVE_NAME)
|
||||
artifact: vscode_client_win32_$(VSCODE_ARCH)_archive
|
||||
displayName: Publish archive
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- publish: $(System.DefaultWorkingDirectory)\.build\win32-$(VSCODE_ARCH)\system-setup\VSCodeSetup.exe
|
||||
artifact: vscode-win32-$(VSCODE_ARCH)-setup
|
||||
- publish: $(System.DefaultWorkingDirectory)\.build\win32-$(VSCODE_ARCH)\system-setup\$(SYSTEM_SETUP_NAME)
|
||||
artifact: vscode_client_win32_$(VSCODE_ARCH)_setup
|
||||
displayName: Publish system setup
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- publish: $(System.DefaultWorkingDirectory)\.build\win32-$(VSCODE_ARCH)\user-setup\VSCodeSetup.exe
|
||||
artifact: vscode-win32-$(VSCODE_ARCH)-user-setup
|
||||
- publish: $(System.DefaultWorkingDirectory)\.build\win32-$(VSCODE_ARCH)\user-setup\$(USER_SETUP_NAME)
|
||||
artifact: vscode_client_win32_$(VSCODE_ARCH)_user-setup
|
||||
displayName: Publish user setup
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- publish: $(System.DefaultWorkingDirectory)\.build\vscode-server-win32-$(VSCODE_ARCH).zip
|
||||
artifact: vscode-server-win32-$(VSCODE_ARCH)
|
||||
artifact: vscode_server_win32_$(VSCODE_ARCH)_archive
|
||||
displayName: Publish server archive
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'), ne(variables['VSCODE_ARCH'], 'arm64'))
|
||||
|
||||
- publish: $(System.DefaultWorkingDirectory)\.build\vscode-server-win32-$(VSCODE_ARCH)-web.zip
|
||||
artifact: vscode-server-win32-$(VSCODE_ARCH)-web
|
||||
artifact: vscode_web_win32_$(VSCODE_ARCH)_archive
|
||||
displayName: Publish web server archive
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'), ne(variables['VSCODE_ARCH'], 'arm64'))
|
||||
|
||||
@@ -23,7 +23,7 @@ async function main() {
|
||||
const outAppPath = path.join(buildDir, `VSCode-darwin-${arch}`, appName);
|
||||
const productJsonPath = path.resolve(outAppPath, 'Contents', 'Resources', 'app', 'product.json');
|
||||
const infoPlistPath = path.resolve(outAppPath, 'Contents', 'Info.plist');
|
||||
await (0, vscode_universal_1.makeUniversalApp)({
|
||||
await vscode_universal_1.makeUniversalApp({
|
||||
x64AppPath,
|
||||
arm64AppPath,
|
||||
x64AsarPath,
|
||||
|
||||
@@ -51,7 +51,7 @@ module.exports.indentationFilter = [
|
||||
'!test/monaco/out/**',
|
||||
'!test/smoke/out/**',
|
||||
'!extensions/typescript-language-features/test-workspace/**',
|
||||
'!extensions/notebook-markdown-extensions/notebook-out/**',
|
||||
'!extensions/markdown-math/notebook-out/**',
|
||||
'!extensions/vscode-api-tests/testWorkspace/**',
|
||||
'!extensions/vscode-api-tests/testWorkspace2/**',
|
||||
'!extensions/vscode-custom-editor-tests/test-workspace/**',
|
||||
@@ -89,7 +89,7 @@ module.exports.indentationFilter = [
|
||||
'!**/*.dockerfile',
|
||||
'!extensions/markdown-language-features/media/*.js',
|
||||
'!extensions/markdown-language-features/notebook-out/*.js',
|
||||
'!extensions/notebook-markdown-extensions/notebook-out/*.js',
|
||||
'!extensions/markdown-math/notebook-out/*.js',
|
||||
'!extensions/simple-browser/media/*.js',
|
||||
];
|
||||
|
||||
@@ -119,7 +119,7 @@ module.exports.copyrightFilter = [
|
||||
'!resources/completions/**',
|
||||
'!extensions/configuration-editing/build/inline-allOf.ts',
|
||||
'!extensions/markdown-language-features/media/highlight.css',
|
||||
'!extensions/notebook-markdown-extensions/notebook-out/**',
|
||||
'!extensions/markdown-math/notebook-out/**',
|
||||
'!extensions/html-language-features/server/src/modes/typescript/*',
|
||||
'!extensions/*/server/bin/*',
|
||||
'!src/vs/editor/test/node/classification/typescript-test.ts',
|
||||
|
||||
@@ -14,7 +14,7 @@ const i18n = require('./lib/i18n');
|
||||
const standalone = require('./lib/standalone');
|
||||
const cp = require('child_process');
|
||||
const compilation = require('./lib/compilation');
|
||||
const monacoapi = require('./monaco/api');
|
||||
const monacoapi = require('./lib/monaco-api');
|
||||
const fs = require('fs');
|
||||
|
||||
let root = path.dirname(__dirname);
|
||||
@@ -49,7 +49,7 @@ let BUNDLED_FILE_HEADER = [
|
||||
' * Copyright (c) Microsoft Corporation. All rights reserved.',
|
||||
' * Version: ' + headerVersion,
|
||||
' * Released under the Source EULA',
|
||||
' * https://github.com/Microsoft/vscode/blob/master/LICENSE.txt',
|
||||
' * https://github.com/microsoft/vscode/blob/main/LICENSE.txt',
|
||||
' *-----------------------------------------------------------*/',
|
||||
''
|
||||
].join('\n');
|
||||
@@ -279,7 +279,7 @@ const finalEditorResourcesTask = task.define('final-editor-resources', () => {
|
||||
// version.txt
|
||||
gulp.src('build/monaco/version.txt')
|
||||
.pipe(es.through(function (data) {
|
||||
data.contents = Buffer.from(`monaco-editor-core: https://github.com/Microsoft/vscode/tree/${sha1}`);
|
||||
data.contents = Buffer.from(`monaco-editor-core: https://github.com/microsoft/vscode/tree/${sha1}`);
|
||||
this.emit('data', data);
|
||||
}))
|
||||
.pipe(gulp.dest('out-monaco-editor-core')),
|
||||
|
||||
@@ -8,7 +8,6 @@ require('events').EventEmitter.defaultMaxListeners = 100;
|
||||
|
||||
const gulp = require('gulp');
|
||||
const path = require('path');
|
||||
const child_process = require('child_process');
|
||||
const nodeUtil = require('util');
|
||||
const es = require('event-stream');
|
||||
const filter = require('gulp-filter');
|
||||
@@ -20,8 +19,6 @@ const glob = require('glob');
|
||||
const root = path.dirname(__dirname);
|
||||
const commit = util.getVersion(root);
|
||||
const plumber = require('gulp-plumber');
|
||||
const fancyLog = require('fancy-log');
|
||||
const ansiColors = require('ansi-colors');
|
||||
const ext = require('./lib/extensions');
|
||||
|
||||
const extensionsPath = path.join(path.dirname(__dirname), 'extensions');
|
||||
@@ -59,6 +56,7 @@ const compilations = glob.sync('**/tsconfig.json', {
|
||||
// 'json-language-features/server/tsconfig.json',
|
||||
// 'markdown-language-features/preview-src/tsconfig.json',
|
||||
// 'markdown-language-features/tsconfig.json',
|
||||
// 'markdown-math/tsconfig.json',
|
||||
// 'merge-conflict/tsconfig.json',
|
||||
// 'microsoft-authentication/tsconfig.json',
|
||||
// 'npm/tsconfig.json',
|
||||
@@ -207,45 +205,17 @@ gulp.task(compileExtensionsBuildLegacyTask);
|
||||
|
||||
//#region Extension media
|
||||
|
||||
// Additional projects to webpack. These typically build code for webviews
|
||||
const webpackMediaConfigFiles = [
|
||||
'markdown-language-features/webpack.config.js',
|
||||
'simple-browser/webpack.config.js',
|
||||
];
|
||||
|
||||
// Additional projects to run esbuild on. These typically build code for webviews
|
||||
const esbuildMediaScripts = [
|
||||
'markdown-language-features/esbuild.js',
|
||||
'notebook-markdown-extensions/esbuild.js',
|
||||
];
|
||||
|
||||
const compileExtensionMediaTask = task.define('compile-extension-media', () => buildExtensionMedia(false));
|
||||
const compileExtensionMediaTask = task.define('compile-extension-media', () => ext.buildExtensionMedia(false));
|
||||
gulp.task(compileExtensionMediaTask);
|
||||
exports.compileExtensionMediaTask = compileExtensionMediaTask;
|
||||
|
||||
const watchExtensionMedia = task.define('watch-extension-media', () => buildExtensionMedia(true));
|
||||
const watchExtensionMedia = task.define('watch-extension-media', () => ext.buildExtensionMedia(true));
|
||||
gulp.task(watchExtensionMedia);
|
||||
exports.watchExtensionMedia = watchExtensionMedia;
|
||||
|
||||
const compileExtensionMediaBuildTask = task.define('compile-extension-media-build', () => buildExtensionMedia(false, '.build/extensions'));
|
||||
const compileExtensionMediaBuildTask = task.define('compile-extension-media-build', () => ext.buildExtensionMedia(false, '.build/extensions'));
|
||||
gulp.task(compileExtensionMediaBuildTask);
|
||||
|
||||
async function buildExtensionMedia(isWatch, outputRoot) {
|
||||
const webpackConfigLocations = webpackMediaConfigFiles.map(p => {
|
||||
return {
|
||||
configPath: path.join(extensionsPath, p),
|
||||
outputRoot: outputRoot ? path.join(root, outputRoot, path.dirname(p)) : undefined
|
||||
};
|
||||
});
|
||||
return Promise.all([
|
||||
webpackExtensions('webpacking extension media', isWatch, webpackConfigLocations),
|
||||
esbuildExtensions('esbuilding extension media', isWatch, esbuildMediaScripts.map(p => ({
|
||||
script: path.join(extensionsPath, p),
|
||||
outputRoot: outputRoot ? path.join(root, outputRoot, path.dirname(p)) : undefined
|
||||
}))),
|
||||
]);
|
||||
}
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region Azure Pipelines
|
||||
@@ -320,121 +290,5 @@ async function buildWebExtensions(isWatch) {
|
||||
path.join(extensionsPath, '**', 'extension-browser.webpack.config.js'),
|
||||
{ ignore: ['**/node_modules'] }
|
||||
);
|
||||
return webpackExtensions('packaging web extension', isWatch, webpackConfigLocations.map(configPath => ({ configPath })));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} taskName
|
||||
* @param {boolean} isWatch
|
||||
* @param {{ configPath: string, outputRoot?: boolean}} webpackConfigLocations
|
||||
*/
|
||||
async function webpackExtensions(taskName, isWatch, webpackConfigLocations) {
|
||||
const webpack = require('webpack');
|
||||
|
||||
const webpackConfigs = [];
|
||||
|
||||
for (const { configPath, outputRoot } of webpackConfigLocations) {
|
||||
const configOrFnOrArray = require(configPath);
|
||||
function addConfig(configOrFn) {
|
||||
let config;
|
||||
if (typeof configOrFn === 'function') {
|
||||
config = configOrFn({}, {});
|
||||
webpackConfigs.push(config);
|
||||
} else {
|
||||
config = configOrFn;
|
||||
}
|
||||
|
||||
if (outputRoot) {
|
||||
config.output.path = path.join(outputRoot, path.relative(path.dirname(configPath), config.output.path));
|
||||
}
|
||||
|
||||
webpackConfigs.push(configOrFn);
|
||||
}
|
||||
addConfig(configOrFnOrArray);
|
||||
}
|
||||
function reporter(fullStats) {
|
||||
if (Array.isArray(fullStats.children)) {
|
||||
for (const stats of fullStats.children) {
|
||||
const outputPath = stats.outputPath;
|
||||
if (outputPath) {
|
||||
const relativePath = path.relative(extensionsPath, outputPath).replace(/\\/g, '/');
|
||||
const match = relativePath.match(/[^\/]+(\/server|\/client)?/);
|
||||
fancyLog(`Finished ${ansiColors.green(taskName)} ${ansiColors.cyan(match[0])} with ${stats.errors.length} errors.`);
|
||||
}
|
||||
if (Array.isArray(stats.errors)) {
|
||||
stats.errors.forEach(error => {
|
||||
fancyLog.error(error);
|
||||
});
|
||||
}
|
||||
if (Array.isArray(stats.warnings)) {
|
||||
stats.warnings.forEach(warning => {
|
||||
fancyLog.warn(warning);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
if (isWatch) {
|
||||
webpack(webpackConfigs).watch({}, (err, stats) => {
|
||||
if (err) {
|
||||
reject();
|
||||
} else {
|
||||
reporter(stats.toJson());
|
||||
}
|
||||
});
|
||||
} else {
|
||||
webpack(webpackConfigs).run((err, stats) => {
|
||||
if (err) {
|
||||
fancyLog.error(err);
|
||||
reject();
|
||||
} else {
|
||||
reporter(stats.toJson());
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} taskName
|
||||
* @param {boolean} isWatch
|
||||
* @param {{ script: string, outputRoot?: string }}} scripts
|
||||
*/
|
||||
async function esbuildExtensions(taskName, isWatch, scripts) {
|
||||
function reporter(/** @type {string} */ stdError, /** @type {string} */script) {
|
||||
const matches = (stdError || '').match(/\> (.+): error: (.+)?/g);
|
||||
fancyLog(`Finished ${ansiColors.green(taskName)} ${script} with ${matches ? matches.length : 0} errors.`);
|
||||
for (const match of matches || []) {
|
||||
fancyLog.error(match);
|
||||
}
|
||||
}
|
||||
|
||||
const tasks = scripts.map(({ script, outputRoot }) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const args = [script];
|
||||
if (isWatch) {
|
||||
args.push('--watch');
|
||||
}
|
||||
if (outputRoot) {
|
||||
args.push('--outputRoot', outputRoot);
|
||||
}
|
||||
const proc = child_process.execFile(process.argv[0], args, {}, (error, _stdout, stderr) => {
|
||||
if (error) {
|
||||
return reject(error);
|
||||
}
|
||||
reporter(stderr, script);
|
||||
if (stderr) {
|
||||
return reject();
|
||||
}
|
||||
return resolve();
|
||||
});
|
||||
|
||||
proc.stdout.on('data', (data) => {
|
||||
fancyLog(`${ansiColors.green(taskName)}: ${data.toString('utf8')}`);
|
||||
});
|
||||
});
|
||||
});
|
||||
return Promise.all(tasks);
|
||||
return ext.webpackExtensions('packaging web extension', isWatch, webpackConfigLocations.map(configPath => ({ configPath })));
|
||||
}
|
||||
|
||||
@@ -283,7 +283,14 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
|
||||
.pipe(jsFilter)
|
||||
.pipe(util.rewriteSourceMappingURL(sourceMappingURLBase))
|
||||
.pipe(jsFilter.restore)
|
||||
.pipe(createAsar(path.join(process.cwd(), 'node_modules'), ['**/*.node', '**/vscode-ripgrep/bin/*', '**/node-pty/build/Release/*', '**/*.wasm'], 'node_modules.asar'));
|
||||
.pipe(createAsar(path.join(process.cwd(), 'node_modules'), [
|
||||
'**/*.node',
|
||||
'**/vscode-ripgrep/bin/*',
|
||||
'**/node-pty/build/Release/*',
|
||||
'**/node-pty/lib/worker/conoutSocketWorker.js',
|
||||
'**/node-pty/lib/shared/conout.js',
|
||||
'**/*.wasm'
|
||||
], 'node_modules.asar'));
|
||||
|
||||
let all = es.merge(
|
||||
packageJsonStream,
|
||||
@@ -439,8 +446,6 @@ BUILD_TARGETS.forEach(buildTarget => {
|
||||
}
|
||||
});
|
||||
|
||||
// Transifex Localizations
|
||||
|
||||
const innoSetupConfig = {
|
||||
'zh-cn': { codePage: 'CP936', defaultInfo: { name: 'Simplified Chinese', id: '$0804', } },
|
||||
'zh-tw': { codePage: 'CP950', defaultInfo: { name: 'Traditional Chinese', id: '$0404' } },
|
||||
@@ -456,6 +461,8 @@ const innoSetupConfig = {
|
||||
'tr': { codePage: 'CP1254' }
|
||||
};
|
||||
|
||||
// Transifex Localizations
|
||||
|
||||
const apiHostname = process.env.TRANSIFEX_API_URL;
|
||||
const apiName = process.env.TRANSIFEX_API_NAME;
|
||||
const apiToken = process.env.TRANSIFEX_API_TOKEN;
|
||||
@@ -491,7 +498,7 @@ const vscodeTranslationsExport = task.define(
|
||||
function () {
|
||||
const pathToMetadata = './out-vscode/nls.metadata.json';
|
||||
const pathToExtensions = '.build/extensions/*';
|
||||
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';
|
||||
const pathToSetup = 'build/win32/i18n/messages.en.isl';
|
||||
|
||||
return es.merge(
|
||||
gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()),
|
||||
|
||||
@@ -18,8 +18,8 @@ const ansiColors = require("ansi-colors");
|
||||
const mkdirp = require('mkdirp');
|
||||
const root = path.dirname(path.dirname(__dirname));
|
||||
const productjson = JSON.parse(fs.readFileSync(path.join(__dirname, '../../product.json'), 'utf8'));
|
||||
const builtInExtensions = productjson.builtInExtensions;
|
||||
const webBuiltInExtensions = productjson.webBuiltInExtensions;
|
||||
const builtInExtensions = productjson.builtInExtensions || [];
|
||||
const webBuiltInExtensions = productjson.webBuiltInExtensions || [];
|
||||
const controlFilePath = path.join(os.homedir(), '.vscode-oss-dev', 'extensions', 'control.json');
|
||||
const ENABLE_LOGGING = !process.env['VSCODE_BUILD_BUILTIN_EXTENSIONS_SILENCE_PLEASE'];
|
||||
function log(...messages) {
|
||||
|
||||
@@ -36,8 +36,8 @@ export interface IExtensionDefinition {
|
||||
|
||||
const root = path.dirname(path.dirname(__dirname));
|
||||
const productjson = JSON.parse(fs.readFileSync(path.join(__dirname, '../../product.json'), 'utf8'));
|
||||
const builtInExtensions = <IExtensionDefinition[]>productjson.builtInExtensions;
|
||||
const webBuiltInExtensions = <IExtensionDefinition[]>productjson.webBuiltInExtensions;
|
||||
const builtInExtensions = <IExtensionDefinition[]>productjson.builtInExtensions || [];
|
||||
const webBuiltInExtensions = <IExtensionDefinition[]>productjson.webBuiltInExtensions || [];
|
||||
const controlFilePath = path.join(os.homedir(), '.vscode-oss-dev', 'extensions', 'control.json');
|
||||
const ENABLE_LOGGING = !process.env['VSCODE_BUILD_BUILTIN_EXTENSIONS_SILENCE_PLEASE'];
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const got_1 = require("got");
|
||||
@@ -12,8 +12,8 @@ const ansiColors = require("ansi-colors");
|
||||
const root = path.dirname(path.dirname(__dirname));
|
||||
const rootCG = path.join(root, 'extensionsCG');
|
||||
const productjson = JSON.parse(fs.readFileSync(path.join(__dirname, '../../product.json'), 'utf8'));
|
||||
const builtInExtensions = productjson.builtInExtensions;
|
||||
const webBuiltInExtensions = productjson.webBuiltInExtensions;
|
||||
const builtInExtensions = productjson.builtInExtensions || [];
|
||||
const webBuiltInExtensions = productjson.webBuiltInExtensions || [];
|
||||
const token = process.env['VSCODE_MIXIN_PASSWORD'] || process.env['GITHUB_TOKEN'] || undefined;
|
||||
const contentBasePath = 'raw.githubusercontent.com';
|
||||
const contentFileNames = ['package.json', 'package-lock.json', 'yarn.lock'];
|
||||
@@ -25,7 +25,7 @@ async function downloadExtensionDetails(extension) {
|
||||
const promises = [];
|
||||
for (const fileName of contentFileNames) {
|
||||
promises.push(new Promise(resolve => {
|
||||
(0, got_1.default)(`${repositoryContentBaseUrl}/${fileName}`)
|
||||
got_1.default(`${repositoryContentBaseUrl}/${fileName}`)
|
||||
.then(response => {
|
||||
resolve({ fileName, body: response.rawBody });
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import got from 'got';
|
||||
@@ -13,8 +13,8 @@ import { IExtensionDefinition } from './builtInExtensions';
|
||||
const root = path.dirname(path.dirname(__dirname));
|
||||
const rootCG = path.join(root, 'extensionsCG');
|
||||
const productjson = JSON.parse(fs.readFileSync(path.join(__dirname, '../../product.json'), 'utf8'));
|
||||
const builtInExtensions = <IExtensionDefinition[]>productjson.builtInExtensions;
|
||||
const webBuiltInExtensions = <IExtensionDefinition[]>productjson.webBuiltInExtensions;
|
||||
const builtInExtensions = <IExtensionDefinition[]>productjson.builtInExtensions || [];
|
||||
const webBuiltInExtensions = <IExtensionDefinition[]>productjson.webBuiltInExtensions || [];
|
||||
const token = process.env['VSCODE_MIXIN_PASSWORD'] || process.env['GITHUB_TOKEN'] || undefined;
|
||||
|
||||
const contentBasePath = 'raw.githubusercontent.com';
|
||||
|
||||
@@ -9,7 +9,7 @@ const es = require("event-stream");
|
||||
const fs = require("fs");
|
||||
const gulp = require("gulp");
|
||||
const path = require("path");
|
||||
const monacodts = require("../monaco/api");
|
||||
const monacodts = require("./monaco-api");
|
||||
const nls = require("./nls");
|
||||
const reporter_1 = require("./reporter");
|
||||
const util = require("./util");
|
||||
@@ -17,7 +17,7 @@ const fancyLog = require("fancy-log");
|
||||
const ansiColors = require("ansi-colors");
|
||||
const os = require("os");
|
||||
const watch = require('./watch');
|
||||
const reporter = (0, reporter_1.createReporter)();
|
||||
const reporter = reporter_1.createReporter();
|
||||
function getTypeScriptCompilerOptions(src) {
|
||||
const rootDir = path.join(__dirname, `../../${src}`);
|
||||
let options = {};
|
||||
|
||||
@@ -9,7 +9,7 @@ import * as es from 'event-stream';
|
||||
import * as fs from 'fs';
|
||||
import * as gulp from 'gulp';
|
||||
import * as path from 'path';
|
||||
import * as monacodts from '../monaco/api';
|
||||
import * as monacodts from './monaco-api';
|
||||
import * as nls from './nls';
|
||||
import { createReporter } from './reporter';
|
||||
import * as util from './util';
|
||||
|
||||
@@ -21,7 +21,7 @@ module.exports = new class {
|
||||
const configs = context.options;
|
||||
for (const config of configs) {
|
||||
if (minimatch(context.getFilename(), config.target)) {
|
||||
return (0, utils_1.createImportRuleListener)((node, value) => this._checkImport(context, config, node, value));
|
||||
return utils_1.createImportRuleListener((node, value) => this._checkImport(context, config, node, value));
|
||||
}
|
||||
}
|
||||
return {};
|
||||
@@ -29,7 +29,7 @@ module.exports = new class {
|
||||
_checkImport(context, config, node, path) {
|
||||
// resolve relative paths
|
||||
if (path[0] === '.') {
|
||||
path = (0, path_1.join)(context.getFilename(), path);
|
||||
path = path_1.join(context.getFilename(), path);
|
||||
}
|
||||
let restrictions;
|
||||
if (typeof config.restrictions === 'string') {
|
||||
|
||||
@@ -17,7 +17,7 @@ module.exports = new class {
|
||||
};
|
||||
}
|
||||
create(context) {
|
||||
const fileDirname = (0, path_1.dirname)(context.getFilename());
|
||||
const fileDirname = path_1.dirname(context.getFilename());
|
||||
const parts = fileDirname.split(/\\|\//);
|
||||
const ruleArgs = context.options[0];
|
||||
let config;
|
||||
@@ -39,11 +39,11 @@ module.exports = new class {
|
||||
// nothing
|
||||
return {};
|
||||
}
|
||||
return (0, utils_1.createImportRuleListener)((node, path) => {
|
||||
return utils_1.createImportRuleListener((node, path) => {
|
||||
if (path[0] === '.') {
|
||||
path = (0, path_1.join)((0, path_1.dirname)(context.getFilename()), path);
|
||||
path = path_1.join(path_1.dirname(context.getFilename()), path);
|
||||
}
|
||||
const parts = (0, path_1.dirname)(path).split(/\\|\//);
|
||||
const parts = path_1.dirname(path).split(/\\|\//);
|
||||
for (let i = parts.length - 1; i >= 0; i--) {
|
||||
const part = parts[i];
|
||||
if (config.allowed.has(part)) {
|
||||
|
||||
@@ -20,10 +20,10 @@ module.exports = new class NoNlsInStandaloneEditorRule {
|
||||
|| /vs(\/|\\)editor(\/|\\)editor.api/.test(fileName)
|
||||
|| /vs(\/|\\)editor(\/|\\)editor.main/.test(fileName)
|
||||
|| /vs(\/|\\)editor(\/|\\)editor.worker/.test(fileName)) {
|
||||
return (0, utils_1.createImportRuleListener)((node, path) => {
|
||||
return utils_1.createImportRuleListener((node, path) => {
|
||||
// resolve relative paths
|
||||
if (path[0] === '.') {
|
||||
path = (0, path_1.join)(context.getFilename(), path);
|
||||
path = path_1.join(context.getFilename(), path);
|
||||
}
|
||||
if (/vs(\/|\\)nls/.test(path)) {
|
||||
context.report({
|
||||
|
||||
@@ -21,10 +21,10 @@ module.exports = new class NoNlsInStandaloneEditorRule {
|
||||
// the vs/editor folder is allowed to use the standalone editor
|
||||
return {};
|
||||
}
|
||||
return (0, utils_1.createImportRuleListener)((node, path) => {
|
||||
return utils_1.createImportRuleListener((node, path) => {
|
||||
// resolve relative paths
|
||||
if (path[0] === '.') {
|
||||
path = (0, path_1.join)(context.getFilename(), path);
|
||||
path = path_1.join(context.getFilename(), path);
|
||||
}
|
||||
if (/vs(\/|\\)editor(\/|\\)standalone(\/|\\)/.test(path)
|
||||
|| /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone(\/|\\)/.test(path)
|
||||
|
||||
@@ -2,144 +2,124 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
// FORKED FROM https://github.com/eslint/eslint/blob/b23ad0d789a909baf8d7c41a35bc53df932eaf30/lib/rules/no-unused-expressions.js
|
||||
// and added support for `OptionalCallExpression`, see https://github.com/facebook/create-react-app/issues/8107 and https://github.com/eslint/eslint/issues/12642
|
||||
|
||||
/**
|
||||
* @fileoverview Flag expressions in statement position that do not side effect
|
||||
* @author Michael Ficarra
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//------------------------------------------------------------------------------
|
||||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
module.exports = {
|
||||
meta: {
|
||||
type: 'suggestion',
|
||||
|
||||
docs: {
|
||||
description: 'disallow unused expressions',
|
||||
category: 'Best Practices',
|
||||
recommended: false,
|
||||
url: 'https://eslint.org/docs/rules/no-unused-expressions'
|
||||
},
|
||||
|
||||
schema: [
|
||||
{
|
||||
type: 'object',
|
||||
properties: {
|
||||
allowShortCircuit: {
|
||||
type: 'boolean',
|
||||
default: false
|
||||
},
|
||||
allowTernary: {
|
||||
type: 'boolean',
|
||||
default: false
|
||||
},
|
||||
allowTaggedTemplates: {
|
||||
type: 'boolean',
|
||||
default: false
|
||||
}
|
||||
},
|
||||
additionalProperties: false
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
create(context) {
|
||||
const config = context.options[0] || {},
|
||||
allowShortCircuit = config.allowShortCircuit || false,
|
||||
allowTernary = config.allowTernary || false,
|
||||
allowTaggedTemplates = config.allowTaggedTemplates || false;
|
||||
|
||||
// eslint-disable-next-line jsdoc/require-description
|
||||
meta: {
|
||||
type: 'suggestion',
|
||||
docs: {
|
||||
description: 'disallow unused expressions',
|
||||
category: 'Best Practices',
|
||||
recommended: false,
|
||||
url: 'https://eslint.org/docs/rules/no-unused-expressions'
|
||||
},
|
||||
schema: [
|
||||
{
|
||||
type: 'object',
|
||||
properties: {
|
||||
allowShortCircuit: {
|
||||
type: 'boolean',
|
||||
default: false
|
||||
},
|
||||
allowTernary: {
|
||||
type: 'boolean',
|
||||
default: false
|
||||
},
|
||||
allowTaggedTemplates: {
|
||||
type: 'boolean',
|
||||
default: false
|
||||
}
|
||||
},
|
||||
additionalProperties: false
|
||||
}
|
||||
]
|
||||
},
|
||||
create(context) {
|
||||
const config = context.options[0] || {},
|
||||
allowShortCircuit = config.allowShortCircuit || false,
|
||||
allowTernary = config.allowTernary || false,
|
||||
allowTaggedTemplates = config.allowTaggedTemplates || false;
|
||||
// eslint-disable-next-line jsdoc/require-description
|
||||
/**
|
||||
* @param {ASTNode} node any node
|
||||
* @returns {boolean} whether the given node structurally represents a directive
|
||||
* @param node any node
|
||||
* @returns whether the given node structurally represents a directive
|
||||
*/
|
||||
function looksLikeDirective(node) {
|
||||
return node.type === 'ExpressionStatement' &&
|
||||
node.expression.type === 'Literal' && typeof node.expression.value === 'string';
|
||||
}
|
||||
|
||||
// eslint-disable-next-line jsdoc/require-description
|
||||
function looksLikeDirective(node) {
|
||||
return node.type === 'ExpressionStatement' &&
|
||||
node.expression.type === 'Literal' && typeof node.expression.value === 'string';
|
||||
}
|
||||
// eslint-disable-next-line jsdoc/require-description
|
||||
/**
|
||||
* @param {Function} predicate ([a] -> Boolean) the function used to make the determination
|
||||
* @param {a[]} list the input list
|
||||
* @returns {a[]} the leading sequence of members in the given list that pass the given predicate
|
||||
* @param predicate ([a] -> Boolean) the function used to make the determination
|
||||
* @param list the input list
|
||||
* @returns the leading sequence of members in the given list that pass the given predicate
|
||||
*/
|
||||
function takeWhile(predicate, list) {
|
||||
for (let i = 0; i < list.length; ++i) {
|
||||
if (!predicate(list[i])) {
|
||||
return list.slice(0, i);
|
||||
}
|
||||
}
|
||||
return list.slice();
|
||||
}
|
||||
|
||||
// eslint-disable-next-line jsdoc/require-description
|
||||
function takeWhile(predicate, list) {
|
||||
for (let i = 0; i < list.length; ++i) {
|
||||
if (!predicate(list[i])) {
|
||||
return list.slice(0, i);
|
||||
}
|
||||
}
|
||||
return list.slice();
|
||||
}
|
||||
// eslint-disable-next-line jsdoc/require-description
|
||||
/**
|
||||
* @param {ASTNode} node a Program or BlockStatement node
|
||||
* @returns {ASTNode[]} the leading sequence of directive nodes in the given node's body
|
||||
* @param node a Program or BlockStatement node
|
||||
* @returns the leading sequence of directive nodes in the given node's body
|
||||
*/
|
||||
function directives(node) {
|
||||
return takeWhile(looksLikeDirective, node.body);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line jsdoc/require-description
|
||||
function directives(node) {
|
||||
return takeWhile(looksLikeDirective, node.body);
|
||||
}
|
||||
// eslint-disable-next-line jsdoc/require-description
|
||||
/**
|
||||
* @param {ASTNode} node any node
|
||||
* @param {ASTNode[]} ancestors the given node's ancestors
|
||||
* @returns {boolean} whether the given node is considered a directive in its current position
|
||||
* @param node any node
|
||||
* @param ancestors the given node's ancestors
|
||||
* @returns whether the given node is considered a directive in its current position
|
||||
*/
|
||||
function isDirective(node, ancestors) {
|
||||
const parent = ancestors[ancestors.length - 1],
|
||||
grandparent = ancestors[ancestors.length - 2];
|
||||
|
||||
return (parent.type === 'Program' || parent.type === 'BlockStatement' &&
|
||||
(/Function/u.test(grandparent.type))) &&
|
||||
directives(parent).indexOf(node) >= 0;
|
||||
}
|
||||
|
||||
function isDirective(node, ancestors) {
|
||||
const parent = ancestors[ancestors.length - 1], grandparent = ancestors[ancestors.length - 2];
|
||||
return (parent.type === 'Program' || parent.type === 'BlockStatement' &&
|
||||
(/Function/u.test(grandparent.type))) &&
|
||||
directives(parent).indexOf(node) >= 0;
|
||||
}
|
||||
/**
|
||||
* Determines whether or not a given node is a valid expression. Recurses on short circuit eval and ternary nodes if enabled by flags.
|
||||
* @param {ASTNode} node any node
|
||||
* @returns {boolean} whether the given node is a valid expression
|
||||
* @param node any node
|
||||
* @returns whether the given node is a valid expression
|
||||
*/
|
||||
function isValidExpression(node) {
|
||||
if (allowTernary) {
|
||||
|
||||
// Recursive check for ternary and logical expressions
|
||||
if (node.type === 'ConditionalExpression') {
|
||||
return isValidExpression(node.consequent) && isValidExpression(node.alternate);
|
||||
}
|
||||
}
|
||||
|
||||
if (allowShortCircuit) {
|
||||
if (node.type === 'LogicalExpression') {
|
||||
return isValidExpression(node.right);
|
||||
}
|
||||
}
|
||||
|
||||
if (allowTaggedTemplates && node.type === 'TaggedTemplateExpression') {
|
||||
return true;
|
||||
}
|
||||
|
||||
return /^(?:Assignment|OptionalCall|Call|New|Update|Yield|Await)Expression$/u.test(node.type) ||
|
||||
(node.type === 'UnaryExpression' && ['delete', 'void'].indexOf(node.operator) >= 0);
|
||||
}
|
||||
|
||||
return {
|
||||
ExpressionStatement(node) {
|
||||
if (!isValidExpression(node.expression) && !isDirective(node, context.getAncestors())) {
|
||||
context.report({ node, message: 'Expected an assignment or function call and instead saw an expression.' });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
function isValidExpression(node) {
|
||||
if (allowTernary) {
|
||||
// Recursive check for ternary and logical expressions
|
||||
if (node.type === 'ConditionalExpression') {
|
||||
return isValidExpression(node.consequent) && isValidExpression(node.alternate);
|
||||
}
|
||||
}
|
||||
if (allowShortCircuit) {
|
||||
if (node.type === 'LogicalExpression') {
|
||||
return isValidExpression(node.right);
|
||||
}
|
||||
}
|
||||
if (allowTaggedTemplates && node.type === 'TaggedTemplateExpression') {
|
||||
return true;
|
||||
}
|
||||
return /^(?:Assignment|OptionalCall|Call|New|Update|Yield|Await)Expression$/u.test(node.type) ||
|
||||
(node.type === 'UnaryExpression' && ['delete', 'void'].indexOf(node.operator) >= 0);
|
||||
}
|
||||
return {
|
||||
ExpressionStatement(node) {
|
||||
if (!isValidExpression(node.expression) && !isDirective(node, context.getAncestors())) {
|
||||
context.report({ node: node, message: 'Expected an assignment or function call and instead saw an expression.' });
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,7 +15,7 @@ module.exports = new (_a = class TranslationRemind {
|
||||
};
|
||||
}
|
||||
create(context) {
|
||||
return (0, utils_1.createImportRuleListener)((node, path) => this._checkImport(context, node, path));
|
||||
return utils_1.createImportRuleListener((node, path) => this._checkImport(context, node, path));
|
||||
}
|
||||
_checkImport(context, node, path) {
|
||||
if (path !== TranslationRemind.NLS_MODULE) {
|
||||
@@ -31,7 +31,7 @@ module.exports = new (_a = class TranslationRemind {
|
||||
let resourceDefined = false;
|
||||
let json;
|
||||
try {
|
||||
json = (0, fs_1.readFileSync)('./build/lib/i18n.resources.json', 'utf8');
|
||||
json = fs_1.readFileSync('./build/lib/i18n.resources.json', 'utf8');
|
||||
}
|
||||
catch (e) {
|
||||
console.error('[translation-remind rule]: File with resources to pull from Transifex was not found. Aborting translation resource check for newly defined workbench part/service.');
|
||||
|
||||
45
build/lib/eslint/vscode-dts-vscode-in-comments.js
Normal file
45
build/lib/eslint/vscode-dts-vscode-in-comments.js
Normal file
@@ -0,0 +1,45 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
module.exports = new class ApiVsCodeInComments {
|
||||
constructor() {
|
||||
this.meta = {
|
||||
messages: {
|
||||
comment: `Don't use the term 'vs code' in comments`
|
||||
}
|
||||
};
|
||||
}
|
||||
create(context) {
|
||||
const sourceCode = context.getSourceCode();
|
||||
return {
|
||||
['Program']: (_node) => {
|
||||
for (const comment of sourceCode.getAllComments()) {
|
||||
if (comment.type !== 'Block') {
|
||||
continue;
|
||||
}
|
||||
if (!comment.range) {
|
||||
continue;
|
||||
}
|
||||
const startIndex = comment.range[0] + '/*'.length;
|
||||
const re = /vs code/ig;
|
||||
let match;
|
||||
while ((match = re.exec(comment.value))) {
|
||||
// Allow using 'VS Code' in quotes
|
||||
if (comment.value[match.index - 1] === `'` && comment.value[match.index + match[0].length] === `'`) {
|
||||
continue;
|
||||
}
|
||||
// Types for eslint seem incorrect
|
||||
const start = sourceCode.getLocFromIndex(startIndex + match.index);
|
||||
const end = sourceCode.getLocFromIndex(startIndex + match.index + match[0].length);
|
||||
context.report({
|
||||
messageId: 'comment',
|
||||
loc: { start, end }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
53
build/lib/eslint/vscode-dts-vscode-in-comments.ts
Normal file
53
build/lib/eslint/vscode-dts-vscode-in-comments.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as eslint from 'eslint';
|
||||
import type * as estree from 'estree';
|
||||
|
||||
export = new class ApiVsCodeInComments implements eslint.Rule.RuleModule {
|
||||
|
||||
readonly meta: eslint.Rule.RuleMetaData = {
|
||||
messages: {
|
||||
comment: `Don't use the term 'vs code' in comments`
|
||||
}
|
||||
};
|
||||
|
||||
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
|
||||
|
||||
const sourceCode = context.getSourceCode();
|
||||
|
||||
return {
|
||||
['Program']: (_node: any) => {
|
||||
|
||||
for (const comment of sourceCode.getAllComments()) {
|
||||
if (comment.type !== 'Block') {
|
||||
continue;
|
||||
}
|
||||
if (!comment.range) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const startIndex = comment.range[0] + '/*'.length;
|
||||
const re = /vs code/ig;
|
||||
let match: RegExpExecArray | null;
|
||||
while ((match = re.exec(comment.value))) {
|
||||
// Allow using 'VS Code' in quotes
|
||||
if (comment.value[match.index - 1] === `'` && comment.value[match.index + match[0].length] === `'`) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Types for eslint seem incorrect
|
||||
const start = sourceCode.getLocFromIndex(startIndex + match.index) as any as estree.Position;
|
||||
const end = sourceCode.getLocFromIndex(startIndex + match.index + match[0].length) as any as estree.Position;
|
||||
context.report({
|
||||
messageId: 'comment',
|
||||
loc: { start, end }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
@@ -4,9 +4,10 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.translatePackageJSON = exports.packageRebuildExtensionsStream = exports.cleanRebuildExtensions = exports.packageExternalExtensionsStream = exports.scanBuiltinExtensions = exports.packageMarketplaceExtensionsStream = exports.packageLocalExtensionsStream = exports.vscodeExternalExtensions = exports.fromMarketplace = exports.fromLocalNormal = exports.fromLocal = void 0;
|
||||
exports.buildExtensionMedia = exports.webpackExtensions = exports.translatePackageJSON = exports.packageRebuildExtensionsStream = exports.cleanRebuildExtensions = exports.packageExternalExtensionsStream = exports.scanBuiltinExtensions = exports.packageMarketplaceExtensionsStream = exports.packageLocalExtensionsStream = exports.vscodeExternalExtensions = exports.fromMarketplace = exports.fromLocalNormal = exports.fromLocal = void 0;
|
||||
const es = require("event-stream");
|
||||
const fs = require("fs");
|
||||
const cp = require("child_process");
|
||||
const glob = require("glob");
|
||||
const gulp = require("gulp");
|
||||
const path = require("path");
|
||||
@@ -23,7 +24,7 @@ const jsoncParser = require("jsonc-parser");
|
||||
const util = require('./util');
|
||||
const root = path.dirname(path.dirname(__dirname));
|
||||
const commit = util.getVersion(root);
|
||||
const sourceMappingURLBase = `https://sqlopsbuilds.blob.core.windows.net/sourcemaps/${commit}`;
|
||||
const sourceMappingURLBase = `https://sqlopsbuilds.blob.core.windows.net/sourcemaps/${commit}`; // {{SQL CARBON EDIT}}
|
||||
function minifyExtensionResources(input) {
|
||||
const jsonFilter = filter(['**/*.json', '**/*.code-snippets'], { restore: true });
|
||||
return input
|
||||
@@ -144,7 +145,7 @@ function fromLocalWebpack(extensionPath, webpackConfigFileName) {
|
||||
console.error(packagedDependencies);
|
||||
result.emit('error', err);
|
||||
});
|
||||
return result.pipe((0, stats_1.createStatsStream)(path.basename(extensionPath)));
|
||||
return result.pipe(stats_1.createStatsStream(path.basename(extensionPath)));
|
||||
}
|
||||
function fromLocalNormal(extensionPath) {
|
||||
const result = es.through();
|
||||
@@ -162,7 +163,7 @@ function fromLocalNormal(extensionPath) {
|
||||
es.readArray(files).pipe(result);
|
||||
})
|
||||
.catch(err => result.emit('error', err));
|
||||
return result.pipe((0, stats_1.createStatsStream)(path.basename(extensionPath)));
|
||||
return result.pipe(stats_1.createStatsStream(path.basename(extensionPath)));
|
||||
}
|
||||
exports.fromLocalNormal = fromLocalNormal;
|
||||
const baseHeaders = {
|
||||
@@ -174,7 +175,7 @@ function fromMarketplace(extensionName, version, metadata) {
|
||||
const remote = require('gulp-remote-retry-src');
|
||||
const json = require('gulp-json-editor');
|
||||
const [, name] = extensionName.split('.');
|
||||
const url = `https://sqlopsextensions.blob.core.windows.net/extensions/${name}/${name}-${version}.vsix`;
|
||||
const url = `https://sqlopsextensions.blob.core.windows.net/extensions/${name}/${name}-${version}.vsix`; // {{SQL CARBON EDIT}}
|
||||
fancyLog('Downloading extension:', ansiColors.yellow(`${extensionName}@${version}`), '...');
|
||||
const options = {
|
||||
base: url,
|
||||
@@ -346,6 +347,7 @@ function scanBuiltinExtensions(extensionsRoot, exclude = []) {
|
||||
}
|
||||
}
|
||||
exports.scanBuiltinExtensions = scanBuiltinExtensions;
|
||||
// {{SQL CARBON EDIT}} start
|
||||
function packageExternalExtensionsStream() {
|
||||
const extenalExtensionDescriptions = glob.sync('extensions/*/package.json')
|
||||
.map(manifestPath => {
|
||||
@@ -361,7 +363,6 @@ function packageExternalExtensionsStream() {
|
||||
return es.merge(builtExtensions);
|
||||
}
|
||||
exports.packageExternalExtensionsStream = packageExternalExtensionsStream;
|
||||
// {{SQL CARBON EDIT}} start
|
||||
function cleanRebuildExtensions(root) {
|
||||
return Promise.all(rebuildExtensions.map(async (e) => {
|
||||
await util2.rimraf(path.join(root, e))();
|
||||
@@ -408,3 +409,132 @@ function translatePackageJSON(packageJSON, packageNLSPath) {
|
||||
return packageJSON;
|
||||
}
|
||||
exports.translatePackageJSON = translatePackageJSON;
|
||||
const extensionsPath = path.join(root, 'extensions');
|
||||
// Additional projects to webpack. These typically build code for webviews
|
||||
const webpackMediaConfigFiles = [
|
||||
'markdown-language-features/webpack.config.js',
|
||||
'simple-browser/webpack.config.js',
|
||||
];
|
||||
// Additional projects to run esbuild on. These typically build code for webviews
|
||||
const esbuildMediaScripts = [
|
||||
'markdown-language-features/esbuild.js',
|
||||
'markdown-math/esbuild.js',
|
||||
];
|
||||
async function webpackExtensions(taskName, isWatch, webpackConfigLocations) {
|
||||
const webpack = require('webpack');
|
||||
const webpackConfigs = [];
|
||||
for (const { configPath, outputRoot } of webpackConfigLocations) {
|
||||
const configOrFnOrArray = require(configPath);
|
||||
function addConfig(configOrFn) {
|
||||
let config;
|
||||
if (typeof configOrFn === 'function') {
|
||||
config = configOrFn({}, {});
|
||||
webpackConfigs.push(config);
|
||||
}
|
||||
else {
|
||||
config = configOrFn;
|
||||
}
|
||||
if (outputRoot) {
|
||||
config.output.path = path.join(outputRoot, path.relative(path.dirname(configPath), config.output.path));
|
||||
}
|
||||
webpackConfigs.push(configOrFn);
|
||||
}
|
||||
addConfig(configOrFnOrArray);
|
||||
}
|
||||
function reporter(fullStats) {
|
||||
if (Array.isArray(fullStats.children)) {
|
||||
for (const stats of fullStats.children) {
|
||||
const outputPath = stats.outputPath;
|
||||
if (outputPath) {
|
||||
const relativePath = path.relative(extensionsPath, outputPath).replace(/\\/g, '/');
|
||||
const match = relativePath.match(/[^\/]+(\/server|\/client)?/);
|
||||
fancyLog(`Finished ${ansiColors.green(taskName)} ${ansiColors.cyan(match[0])} with ${stats.errors.length} errors.`);
|
||||
}
|
||||
if (Array.isArray(stats.errors)) {
|
||||
stats.errors.forEach((error) => {
|
||||
fancyLog.error(error);
|
||||
});
|
||||
}
|
||||
if (Array.isArray(stats.warnings)) {
|
||||
stats.warnings.forEach((warning) => {
|
||||
fancyLog.warn(warning);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
if (isWatch) {
|
||||
webpack(webpackConfigs).watch({}, (err, stats) => {
|
||||
if (err) {
|
||||
reject();
|
||||
}
|
||||
else {
|
||||
reporter(stats.toJson());
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
webpack(webpackConfigs).run((err, stats) => {
|
||||
if (err) {
|
||||
fancyLog.error(err);
|
||||
reject();
|
||||
}
|
||||
else {
|
||||
reporter(stats.toJson());
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.webpackExtensions = webpackExtensions;
|
||||
async function esbuildExtensions(taskName, isWatch, scripts) {
|
||||
function reporter(stdError, script) {
|
||||
const matches = (stdError || '').match(/\> (.+): error: (.+)?/g);
|
||||
fancyLog(`Finished ${ansiColors.green(taskName)} ${script} with ${matches ? matches.length : 0} errors.`);
|
||||
for (const match of matches || []) {
|
||||
fancyLog.error(match);
|
||||
}
|
||||
}
|
||||
const tasks = scripts.map(({ script, outputRoot }) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const args = [script];
|
||||
if (isWatch) {
|
||||
args.push('--watch');
|
||||
}
|
||||
if (outputRoot) {
|
||||
args.push('--outputRoot', outputRoot);
|
||||
}
|
||||
const proc = cp.execFile(process.argv[0], args, {}, (error, _stdout, stderr) => {
|
||||
if (error) {
|
||||
return reject(error);
|
||||
}
|
||||
reporter(stderr, script);
|
||||
if (stderr) {
|
||||
return reject();
|
||||
}
|
||||
return resolve();
|
||||
});
|
||||
proc.stdout.on('data', (data) => {
|
||||
fancyLog(`${ansiColors.green(taskName)}: ${data.toString('utf8')}`);
|
||||
});
|
||||
});
|
||||
});
|
||||
return Promise.all(tasks);
|
||||
}
|
||||
async function buildExtensionMedia(isWatch, outputRoot) {
|
||||
return Promise.all([
|
||||
webpackExtensions('webpacking extension media', isWatch, webpackMediaConfigFiles.map(p => {
|
||||
return {
|
||||
configPath: path.join(extensionsPath, p),
|
||||
outputRoot: outputRoot ? path.join(root, outputRoot, path.dirname(p)) : undefined
|
||||
};
|
||||
})),
|
||||
esbuildExtensions('esbuilding extension media', isWatch, esbuildMediaScripts.map(p => ({
|
||||
script: path.join(extensionsPath, p),
|
||||
outputRoot: outputRoot ? path.join(root, outputRoot, path.dirname(p)) : undefined
|
||||
}))),
|
||||
]);
|
||||
}
|
||||
exports.buildExtensionMedia = buildExtensionMedia;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
import * as es from 'event-stream';
|
||||
import * as fs from 'fs';
|
||||
import * as cp from 'child_process';
|
||||
import * as glob from 'glob';
|
||||
import * as gulp from 'gulp';
|
||||
import * as path from 'path';
|
||||
@@ -19,10 +20,11 @@ import * as fancyLog from 'fancy-log';
|
||||
import * as ansiColors from 'ansi-colors';
|
||||
const buffer = require('gulp-buffer');
|
||||
import * as jsoncParser from 'jsonc-parser';
|
||||
import webpack = require('webpack');
|
||||
const util = require('./util');
|
||||
const root = path.dirname(path.dirname(__dirname));
|
||||
const commit = util.getVersion(root);
|
||||
const sourceMappingURLBase = `https://sqlopsbuilds.blob.core.windows.net/sourcemaps/${commit}`;
|
||||
const sourceMappingURLBase = `https://sqlopsbuilds.blob.core.windows.net/sourcemaps/${commit}`; // {{SQL CARBON EDIT}}
|
||||
|
||||
function minifyExtensionResources(input: Stream): Stream {
|
||||
const jsonFilter = filter(['**/*.json', '**/*.code-snippets'], { restore: true });
|
||||
@@ -205,7 +207,7 @@ export function fromMarketplace(extensionName: string, version: string, metadata
|
||||
const json = require('gulp-json-editor') as typeof import('gulp-json-editor');
|
||||
|
||||
const [, name] = extensionName.split('.');
|
||||
const url = `https://sqlopsextensions.blob.core.windows.net/extensions/${name}/${name}-${version}.vsix`;
|
||||
const url = `https://sqlopsextensions.blob.core.windows.net/extensions/${name}/${name}-${version}.vsix`; // {{SQL CARBON EDIT}}
|
||||
|
||||
fancyLog('Downloading extension:', ansiColors.yellow(`${extensionName}@${version}`), '...');
|
||||
|
||||
@@ -424,6 +426,7 @@ export function scanBuiltinExtensions(extensionsRoot: string, exclude: string[]
|
||||
}
|
||||
}
|
||||
|
||||
// {{SQL CARBON EDIT}} start
|
||||
export function packageExternalExtensionsStream(): NodeJS.ReadWriteStream {
|
||||
const extenalExtensionDescriptions = (<string[]>glob.sync('extensions/*/package.json'))
|
||||
.map(manifestPath => {
|
||||
@@ -441,7 +444,6 @@ export function packageExternalExtensionsStream(): NodeJS.ReadWriteStream {
|
||||
return es.merge(builtExtensions);
|
||||
}
|
||||
|
||||
// {{SQL CARBON EDIT}} start
|
||||
export function cleanRebuildExtensions(root: string): Promise<void> {
|
||||
return Promise.all(rebuildExtensions.map(async e => {
|
||||
await util2.rimraf(path.join(root, e))();
|
||||
@@ -487,3 +489,138 @@ export function translatePackageJSON(packageJSON: string, packageNLSPath: string
|
||||
translate(packageJSON);
|
||||
return packageJSON;
|
||||
}
|
||||
|
||||
const extensionsPath = path.join(root, 'extensions');
|
||||
|
||||
// Additional projects to webpack. These typically build code for webviews
|
||||
const webpackMediaConfigFiles = [
|
||||
'markdown-language-features/webpack.config.js',
|
||||
'simple-browser/webpack.config.js',
|
||||
];
|
||||
|
||||
// Additional projects to run esbuild on. These typically build code for webviews
|
||||
const esbuildMediaScripts = [
|
||||
'markdown-language-features/esbuild.js',
|
||||
'markdown-math/esbuild.js',
|
||||
];
|
||||
|
||||
export async function webpackExtensions(taskName: string, isWatch: boolean, webpackConfigLocations: { configPath: string, outputRoot?: string }[]) {
|
||||
const webpack = require('webpack') as typeof import('webpack');
|
||||
|
||||
const webpackConfigs: webpack.Configuration[] = [];
|
||||
|
||||
for (const { configPath, outputRoot } of webpackConfigLocations) {
|
||||
const configOrFnOrArray = require(configPath);
|
||||
function addConfig(configOrFn: webpack.Configuration | Function) {
|
||||
let config;
|
||||
if (typeof configOrFn === 'function') {
|
||||
config = configOrFn({}, {});
|
||||
webpackConfigs.push(config);
|
||||
} else {
|
||||
config = configOrFn;
|
||||
}
|
||||
|
||||
if (outputRoot) {
|
||||
config.output.path = path.join(outputRoot, path.relative(path.dirname(configPath), config.output.path));
|
||||
}
|
||||
|
||||
webpackConfigs.push(configOrFn);
|
||||
}
|
||||
addConfig(configOrFnOrArray);
|
||||
}
|
||||
function reporter(fullStats: any) {
|
||||
if (Array.isArray(fullStats.children)) {
|
||||
for (const stats of fullStats.children) {
|
||||
const outputPath = stats.outputPath;
|
||||
if (outputPath) {
|
||||
const relativePath = path.relative(extensionsPath, outputPath).replace(/\\/g, '/');
|
||||
const match = relativePath.match(/[^\/]+(\/server|\/client)?/);
|
||||
fancyLog(`Finished ${ansiColors.green(taskName)} ${ansiColors.cyan(match![0])} with ${stats.errors.length} errors.`);
|
||||
}
|
||||
if (Array.isArray(stats.errors)) {
|
||||
stats.errors.forEach((error: any) => {
|
||||
fancyLog.error(error);
|
||||
});
|
||||
}
|
||||
if (Array.isArray(stats.warnings)) {
|
||||
stats.warnings.forEach((warning: any) => {
|
||||
fancyLog.warn(warning);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
if (isWatch) {
|
||||
webpack(webpackConfigs).watch({}, (err, stats) => {
|
||||
if (err) {
|
||||
reject();
|
||||
} else {
|
||||
reporter(stats.toJson());
|
||||
}
|
||||
});
|
||||
} else {
|
||||
webpack(webpackConfigs).run((err, stats) => {
|
||||
if (err) {
|
||||
fancyLog.error(err);
|
||||
reject();
|
||||
} else {
|
||||
reporter(stats.toJson());
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function esbuildExtensions(taskName: string, isWatch: boolean, scripts: { script: string, outputRoot?: string }[]) {
|
||||
function reporter(stdError: string, script: string) {
|
||||
const matches = (stdError || '').match(/\> (.+): error: (.+)?/g);
|
||||
fancyLog(`Finished ${ansiColors.green(taskName)} ${script} with ${matches ? matches.length : 0} errors.`);
|
||||
for (const match of matches || []) {
|
||||
fancyLog.error(match);
|
||||
}
|
||||
}
|
||||
|
||||
const tasks = scripts.map(({ script, outputRoot }) => {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
const args = [script];
|
||||
if (isWatch) {
|
||||
args.push('--watch');
|
||||
}
|
||||
if (outputRoot) {
|
||||
args.push('--outputRoot', outputRoot);
|
||||
}
|
||||
const proc = cp.execFile(process.argv[0], args, {}, (error, _stdout, stderr) => {
|
||||
if (error) {
|
||||
return reject(error);
|
||||
}
|
||||
reporter(stderr, script);
|
||||
if (stderr) {
|
||||
return reject();
|
||||
}
|
||||
return resolve();
|
||||
});
|
||||
|
||||
proc.stdout!.on('data', (data) => {
|
||||
fancyLog(`${ansiColors.green(taskName)}: ${data.toString('utf8')}`);
|
||||
});
|
||||
});
|
||||
});
|
||||
return Promise.all(tasks);
|
||||
}
|
||||
|
||||
export async function buildExtensionMedia(isWatch: boolean, outputRoot?: string) {
|
||||
return Promise.all([
|
||||
webpackExtensions('webpacking extension media', isWatch, webpackMediaConfigFiles.map(p => {
|
||||
return {
|
||||
configPath: path.join(extensionsPath, p),
|
||||
outputRoot: outputRoot ? path.join(root, outputRoot, path.dirname(p)) : undefined
|
||||
};
|
||||
})),
|
||||
esbuildExtensions('esbuilding extension media', isWatch, esbuildMediaScripts.map(p => ({
|
||||
script: path.join(extensionsPath, p),
|
||||
outputRoot: outputRoot ? path.join(root, outputRoot, path.dirname(p)) : undefined
|
||||
}))),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -4,14 +4,13 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.prepareIslFiles = exports.prepareI18nPackFiles = exports.pullI18nPackFiles = exports.i18nPackVersion = exports.createI18nFile = exports.prepareI18nFiles = exports.pullSetupXlfFiles = exports.pullCoreAndExtensionsXlfFiles = exports.findObsoleteResources = exports.pushXlfFiles = exports.createXlfFilesForIsl = exports.createXlfFilesForExtensions = exports.createXlfFilesForCoreBundle = exports.getResource = exports.processNlsFiles = exports.Limiter = exports.XLF = exports.Line = exports.externalExtensionsWithTranslations = exports.extraLanguages = exports.defaultLanguages = void 0;
|
||||
exports.prepareIslFiles = exports.prepareI18nPackFiles = exports.i18nPackVersion = exports.createI18nFile = exports.prepareI18nFiles = exports.pullSetupXlfFiles = exports.findObsoleteResources = exports.pushXlfFiles = exports.createXlfFilesForIsl = exports.createXlfFilesForExtensions = exports.createXlfFilesForCoreBundle = exports.getResource = exports.processNlsFiles = exports.Limiter = exports.XLF = exports.Line = exports.externalExtensionsWithTranslations = exports.extraLanguages = exports.defaultLanguages = void 0;
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
const event_stream_1 = require("event-stream");
|
||||
const File = require("vinyl");
|
||||
const Is = require("is");
|
||||
const xml2js = require("xml2js");
|
||||
const glob = require("glob");
|
||||
const https = require("https");
|
||||
const gulp = require("gulp");
|
||||
const fancyLog = require("fancy-log");
|
||||
@@ -110,12 +109,16 @@ class XLF {
|
||||
}
|
||||
toString() {
|
||||
this.appendHeader();
|
||||
for (let file in this.files) {
|
||||
const files = Object.keys(this.files).sort();
|
||||
for (const file of files) {
|
||||
this.appendNewLine(`<file original="${file}" source-language="en" datatype="plaintext"><body>`, 2);
|
||||
for (let item of this.files[file]) {
|
||||
const items = this.files[file].sort((a, b) => {
|
||||
return a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
|
||||
});
|
||||
for (const item of items) {
|
||||
this.addStringItem(file, item);
|
||||
}
|
||||
this.appendNewLine('</body></file>', 2);
|
||||
this.appendNewLine('</body></file>');
|
||||
}
|
||||
this.appendFooter();
|
||||
return this.buffer.join('\r\n');
|
||||
@@ -463,7 +466,7 @@ function processCoreBundleFormat(fileHeader, languages, json, emitter) {
|
||||
});
|
||||
}
|
||||
function processNlsFiles(opts) {
|
||||
return (0, event_stream_1.through)(function (file) {
|
||||
return event_stream_1.through(function (file) {
|
||||
let fileName = path.basename(file.path);
|
||||
if (fileName === 'nls.metadata.json') {
|
||||
let json = null;
|
||||
@@ -521,7 +524,7 @@ function getResource(sourceFile) {
|
||||
}
|
||||
exports.getResource = getResource;
|
||||
function createXlfFilesForCoreBundle() {
|
||||
return (0, event_stream_1.through)(function (file) {
|
||||
return event_stream_1.through(function (file) {
|
||||
const basename = path.basename(file.path);
|
||||
if (basename === 'nls.metadata.json') {
|
||||
if (file.isBuffer()) {
|
||||
@@ -576,7 +579,7 @@ function createXlfFilesForExtensions() {
|
||||
let counter = 0;
|
||||
let folderStreamEnded = false;
|
||||
let folderStreamEndEmitted = false;
|
||||
return (0, event_stream_1.through)(function (extensionFolder) {
|
||||
return event_stream_1.through(function (extensionFolder) {
|
||||
const folderStream = this;
|
||||
const stat = fs.statSync(extensionFolder.path);
|
||||
if (!stat.isDirectory()) {
|
||||
@@ -594,7 +597,7 @@ function createXlfFilesForExtensions() {
|
||||
}
|
||||
return _xlf;
|
||||
}
|
||||
gulp.src([`.build/extensions/${extensionName}/package.nls.json`, `.build/extensions/${extensionName}/**/nls.metadata.json`], { allowEmpty: true }).pipe((0, event_stream_1.through)(function (file) {
|
||||
gulp.src([`.build/extensions/${extensionName}/package.nls.json`, `.build/extensions/${extensionName}/**/nls.metadata.json`], { allowEmpty: true }).pipe(event_stream_1.through(function (file) {
|
||||
if (file.isBuffer()) {
|
||||
const buffer = file.contents;
|
||||
const basename = path.basename(file.path);
|
||||
@@ -653,15 +656,14 @@ function createXlfFilesForExtensions() {
|
||||
}
|
||||
exports.createXlfFilesForExtensions = createXlfFilesForExtensions;
|
||||
function createXlfFilesForIsl() {
|
||||
return (0, event_stream_1.through)(function (file) {
|
||||
return event_stream_1.through(function (file) {
|
||||
let projectName, resourceFile;
|
||||
if (path.basename(file.path) === 'Default.isl') {
|
||||
if (path.basename(file.path) === 'messages.en.isl') {
|
||||
projectName = setupProject;
|
||||
resourceFile = 'setup_default.xlf';
|
||||
resourceFile = 'messages.xlf';
|
||||
}
|
||||
else {
|
||||
projectName = workbenchProject;
|
||||
resourceFile = 'setup_messages.xlf';
|
||||
throw new Error(`Unknown input file ${file.path}`);
|
||||
}
|
||||
let xlf = new XLF(projectName), keys = [], messages = [];
|
||||
let model = new TextModel(file.contents.toString());
|
||||
@@ -707,7 +709,7 @@ exports.createXlfFilesForIsl = createXlfFilesForIsl;
|
||||
function pushXlfFiles(apiHostname, username, password) {
|
||||
let tryGetPromises = [];
|
||||
let updateCreatePromises = [];
|
||||
return (0, event_stream_1.through)(function (file) {
|
||||
return event_stream_1.through(function (file) {
|
||||
const project = path.dirname(file.relative);
|
||||
const fileName = path.basename(file.path);
|
||||
const slug = fileName.substr(0, fileName.length - '.xlf'.length);
|
||||
@@ -769,7 +771,7 @@ function getAllResources(project, apiHostname, username, password) {
|
||||
function findObsoleteResources(apiHostname, username, password) {
|
||||
let resourcesByProject = Object.create(null);
|
||||
resourcesByProject[extensionsProject] = [].concat(exports.externalExtensionsWithTranslations); // clone
|
||||
return (0, event_stream_1.through)(function (file) {
|
||||
return event_stream_1.through(function (file) {
|
||||
const project = path.dirname(file.relative);
|
||||
const fileName = path.basename(file.path);
|
||||
const slug = fileName.substr(0, fileName.length - '.xlf'.length);
|
||||
@@ -909,31 +911,6 @@ function updateResource(project, slug, xlfFile, apiHostname, credentials) {
|
||||
request.end();
|
||||
});
|
||||
}
|
||||
// cache resources
|
||||
let _coreAndExtensionResources;
|
||||
function pullCoreAndExtensionsXlfFiles(apiHostname, username, password, language, externalExtensions) {
|
||||
if (!_coreAndExtensionResources) {
|
||||
_coreAndExtensionResources = [];
|
||||
// editor and workbench
|
||||
const json = JSON.parse(fs.readFileSync('./build/lib/i18n.resources.json', 'utf8'));
|
||||
_coreAndExtensionResources.push(...json.editor);
|
||||
_coreAndExtensionResources.push(...json.workbench);
|
||||
// extensions
|
||||
let extensionsToLocalize = Object.create(null);
|
||||
glob.sync('.build/extensions/**/*.nls.json').forEach(extension => extensionsToLocalize[extension.split('/')[2]] = true);
|
||||
glob.sync('.build/extensions/*/node_modules/vscode-nls').forEach(extension => extensionsToLocalize[extension.split('/')[2]] = true);
|
||||
Object.keys(extensionsToLocalize).forEach(extension => {
|
||||
_coreAndExtensionResources.push({ name: extension, project: extensionsProject });
|
||||
});
|
||||
if (externalExtensions) {
|
||||
for (let resourceName in externalExtensions) {
|
||||
_coreAndExtensionResources.push({ name: resourceName, project: extensionsProject });
|
||||
}
|
||||
}
|
||||
}
|
||||
return pullXlfFiles(apiHostname, username, password, language, _coreAndExtensionResources);
|
||||
}
|
||||
exports.pullCoreAndExtensionsXlfFiles = pullCoreAndExtensionsXlfFiles;
|
||||
function pullSetupXlfFiles(apiHostname, username, password, language, includeDefault) {
|
||||
let setupResources = [{ name: 'setup_messages', project: workbenchProject }];
|
||||
if (includeDefault) {
|
||||
@@ -946,7 +923,7 @@ function pullXlfFiles(apiHostname, username, password, language, resources) {
|
||||
const credentials = `${username}:${password}`;
|
||||
let expectedTranslationsCount = resources.length;
|
||||
let translationsRetrieved = 0, called = false;
|
||||
return (0, event_stream_1.readable)(function (_count, callback) {
|
||||
return event_stream_1.readable(function (_count, callback) {
|
||||
// Mark end of stream when all resources were retrieved
|
||||
if (translationsRetrieved === expectedTranslationsCount) {
|
||||
return this.emit('end');
|
||||
@@ -1004,7 +981,7 @@ function retrieveResource(language, resource, apiHostname, credentials) {
|
||||
}
|
||||
function prepareI18nFiles() {
|
||||
let parsePromises = [];
|
||||
return (0, event_stream_1.through)(function (xlf) {
|
||||
return event_stream_1.through(function (xlf) {
|
||||
let stream = this;
|
||||
let parsePromise = XLF.parse(xlf.contents.toString());
|
||||
parsePromises.push(parsePromise);
|
||||
@@ -1044,20 +1021,16 @@ function createI18nFile(originalFilePath, messages) {
|
||||
}
|
||||
exports.createI18nFile = createI18nFile;
|
||||
exports.i18nPackVersion = '1.0.0'; // {{SQL CARBON EDIT}} Needed in locfunc.
|
||||
function pullI18nPackFiles(apiHostname, username, password, language, resultingTranslationPaths) {
|
||||
return pullCoreAndExtensionsXlfFiles(apiHostname, username, password, language, exports.externalExtensionsWithTranslations)
|
||||
.pipe(prepareI18nPackFiles(exports.externalExtensionsWithTranslations, resultingTranslationPaths, language.id === 'ps'));
|
||||
}
|
||||
exports.pullI18nPackFiles = pullI18nPackFiles;
|
||||
function prepareI18nPackFiles(externalExtensions, resultingTranslationPaths, pseudo = false) {
|
||||
let parsePromises = [];
|
||||
let mainPack = { version: exports.i18nPackVersion, contents: {} };
|
||||
let extensionsPacks = {};
|
||||
let errors = [];
|
||||
return (0, event_stream_1.through)(function (xlf) {
|
||||
let project = path.basename(path.dirname(xlf.relative));
|
||||
return event_stream_1.through(function (xlf) {
|
||||
let project = path.basename(path.dirname(path.dirname(xlf.relative)));
|
||||
let resource = path.basename(xlf.relative, '.xlf');
|
||||
let contents = xlf.contents.toString();
|
||||
log(`Found ${project}: ${resource}`);
|
||||
let parsePromise = pseudo ? XLF.parsePseudo(contents) : XLF.parse(contents);
|
||||
parsePromises.push(parsePromise);
|
||||
parsePromise.then(resolvedFiles => {
|
||||
@@ -1115,15 +1088,12 @@ function prepareI18nPackFiles(externalExtensions, resultingTranslationPaths, pse
|
||||
exports.prepareI18nPackFiles = prepareI18nPackFiles;
|
||||
function prepareIslFiles(language, innoSetupConfig) {
|
||||
let parsePromises = [];
|
||||
return (0, event_stream_1.through)(function (xlf) {
|
||||
return event_stream_1.through(function (xlf) {
|
||||
let stream = this;
|
||||
let parsePromise = XLF.parse(xlf.contents.toString());
|
||||
parsePromises.push(parsePromise);
|
||||
parsePromise.then(resolvedFiles => {
|
||||
resolvedFiles.forEach(file => {
|
||||
if (path.basename(file.originalFilePath) === 'Default' && !innoSetupConfig.defaultInfo) {
|
||||
return;
|
||||
}
|
||||
let translatedFile = createIslFile(file.originalFilePath, file.messages, language, innoSetupConfig);
|
||||
stream.queue(translatedFile);
|
||||
});
|
||||
@@ -1159,20 +1129,9 @@ function createIslFile(originalFilePath, messages, language, innoSetup) {
|
||||
let key = sections[0];
|
||||
let translated = line;
|
||||
if (key) {
|
||||
if (key === 'LanguageName') {
|
||||
translated = `${key}=${innoSetup.defaultInfo.name}`;
|
||||
}
|
||||
else if (key === 'LanguageID') {
|
||||
translated = `${key}=${innoSetup.defaultInfo.id}`;
|
||||
}
|
||||
else if (key === 'LanguageCodePage') {
|
||||
translated = `${key}=${innoSetup.codePage.substr(2)}`;
|
||||
}
|
||||
else {
|
||||
let translatedMessage = messages[key];
|
||||
if (translatedMessage) {
|
||||
translated = `${key}=${translatedMessage}`;
|
||||
}
|
||||
let translatedMessage = messages[key];
|
||||
if (translatedMessage) {
|
||||
translated = `${key}=${translatedMessage}`;
|
||||
}
|
||||
}
|
||||
content.push(translated);
|
||||
|
||||
@@ -10,7 +10,6 @@ import { through, readable, ThroughStream } from 'event-stream';
|
||||
import * as File from 'vinyl';
|
||||
import * as Is from 'is';
|
||||
import * as xml2js from 'xml2js';
|
||||
import * as glob from 'glob';
|
||||
import * as https from 'https';
|
||||
import * as gulp from 'gulp';
|
||||
import * as fancyLog from 'fancy-log';
|
||||
@@ -31,10 +30,6 @@ export interface Language {
|
||||
|
||||
export interface InnoSetup {
|
||||
codePage: string; //code page for encoding (http://www.jrsoftware.org/ishelp/index.php?topic=langoptionssection)
|
||||
defaultInfo?: {
|
||||
name: string; // inno setup language name
|
||||
id: string; // locale identifier (https://msdn.microsoft.com/en-us/library/dd318693.aspx)
|
||||
};
|
||||
}
|
||||
|
||||
export const defaultLanguages: Language[] = [
|
||||
@@ -198,14 +193,17 @@ export class XLF {
|
||||
public toString(): string {
|
||||
this.appendHeader();
|
||||
|
||||
for (let file in this.files) {
|
||||
const files = Object.keys(this.files).sort();
|
||||
for (const file of files) {
|
||||
this.appendNewLine(`<file original="${file}" source-language="en" datatype="plaintext"><body>`, 2);
|
||||
for (let item of this.files[file]) {
|
||||
const items = this.files[file].sort((a: Item, b: Item) => {
|
||||
return a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
|
||||
});
|
||||
for (const item of items) {
|
||||
this.addStringItem(file, item);
|
||||
}
|
||||
this.appendNewLine('</body></file>', 2);
|
||||
this.appendNewLine('</body></file>');
|
||||
}
|
||||
|
||||
this.appendFooter();
|
||||
return this.buffer.join('\r\n');
|
||||
}
|
||||
@@ -775,12 +773,11 @@ export function createXlfFilesForIsl(): ThroughStream {
|
||||
return through(function (this: ThroughStream, file: File) {
|
||||
let projectName: string,
|
||||
resourceFile: string;
|
||||
if (path.basename(file.path) === 'Default.isl') {
|
||||
if (path.basename(file.path) === 'messages.en.isl') {
|
||||
projectName = setupProject;
|
||||
resourceFile = 'setup_default.xlf';
|
||||
resourceFile = 'messages.xlf';
|
||||
} else {
|
||||
projectName = workbenchProject;
|
||||
resourceFile = 'setup_messages.xlf';
|
||||
throw new Error(`Unknown input file ${file.path}`);
|
||||
}
|
||||
|
||||
let xlf = new XLF(projectName),
|
||||
@@ -1048,35 +1045,6 @@ function updateResource(project: string, slug: string, xlfFile: File, apiHostnam
|
||||
});
|
||||
}
|
||||
|
||||
// cache resources
|
||||
let _coreAndExtensionResources: Resource[];
|
||||
|
||||
export function pullCoreAndExtensionsXlfFiles(apiHostname: string, username: string, password: string, language: Language, externalExtensions?: Map<string>): NodeJS.ReadableStream {
|
||||
if (!_coreAndExtensionResources) {
|
||||
_coreAndExtensionResources = [];
|
||||
// editor and workbench
|
||||
const json = JSON.parse(fs.readFileSync('./build/lib/i18n.resources.json', 'utf8'));
|
||||
_coreAndExtensionResources.push(...json.editor);
|
||||
_coreAndExtensionResources.push(...json.workbench);
|
||||
|
||||
// extensions
|
||||
let extensionsToLocalize = Object.create(null);
|
||||
glob.sync('.build/extensions/**/*.nls.json').forEach(extension => extensionsToLocalize[extension.split('/')[2]] = true);
|
||||
glob.sync('.build/extensions/*/node_modules/vscode-nls').forEach(extension => extensionsToLocalize[extension.split('/')[2]] = true);
|
||||
|
||||
Object.keys(extensionsToLocalize).forEach(extension => {
|
||||
_coreAndExtensionResources.push({ name: extension, project: extensionsProject });
|
||||
});
|
||||
|
||||
if (externalExtensions) {
|
||||
for (let resourceName in externalExtensions) {
|
||||
_coreAndExtensionResources.push({ name: resourceName, project: extensionsProject });
|
||||
}
|
||||
}
|
||||
}
|
||||
return pullXlfFiles(apiHostname, username, password, language, _coreAndExtensionResources);
|
||||
}
|
||||
|
||||
export function pullSetupXlfFiles(apiHostname: string, username: string, password: string, language: Language, includeDefault: boolean): NodeJS.ReadableStream {
|
||||
let setupResources = [{ name: 'setup_messages', project: workbenchProject }];
|
||||
if (includeDefault) {
|
||||
@@ -1208,20 +1176,16 @@ export interface TranslationPath {
|
||||
resourceName: string;
|
||||
}
|
||||
|
||||
export function pullI18nPackFiles(apiHostname: string, username: string, password: string, language: Language, resultingTranslationPaths: TranslationPath[]): NodeJS.ReadableStream {
|
||||
return pullCoreAndExtensionsXlfFiles(apiHostname, username, password, language, externalExtensionsWithTranslations)
|
||||
.pipe(prepareI18nPackFiles(externalExtensionsWithTranslations, resultingTranslationPaths, language.id === 'ps'));
|
||||
}
|
||||
|
||||
export function prepareI18nPackFiles(externalExtensions: Map<string>, resultingTranslationPaths: TranslationPath[], pseudo = false): NodeJS.ReadWriteStream {
|
||||
let parsePromises: Promise<ParsedXLF[]>[] = [];
|
||||
let mainPack: I18nPack = { version: i18nPackVersion, contents: {} };
|
||||
let extensionsPacks: Map<I18nPack> = {};
|
||||
let errors: any[] = [];
|
||||
return through(function (this: ThroughStream, xlf: File) {
|
||||
let project = path.basename(path.dirname(xlf.relative));
|
||||
let project = path.basename(path.dirname(path.dirname(xlf.relative)));
|
||||
let resource = path.basename(xlf.relative, '.xlf');
|
||||
let contents = xlf.contents.toString();
|
||||
log(`Found ${project}: ${resource}`);
|
||||
let parsePromise = pseudo ? XLF.parsePseudo(contents) : XLF.parse(contents);
|
||||
parsePromises.push(parsePromise);
|
||||
parsePromise.then(
|
||||
@@ -1290,9 +1254,6 @@ export function prepareIslFiles(language: Language, innoSetupConfig: InnoSetup):
|
||||
parsePromise.then(
|
||||
resolvedFiles => {
|
||||
resolvedFiles.forEach(file => {
|
||||
if (path.basename(file.originalFilePath) === 'Default' && !innoSetupConfig.defaultInfo) {
|
||||
return;
|
||||
}
|
||||
let translatedFile = createIslFile(file.originalFilePath, file.messages, language, innoSetupConfig);
|
||||
stream.queue(translatedFile);
|
||||
});
|
||||
@@ -1327,17 +1288,9 @@ function createIslFile(originalFilePath: string, messages: Map<string>, language
|
||||
let key = sections[0];
|
||||
let translated = line;
|
||||
if (key) {
|
||||
if (key === 'LanguageName') {
|
||||
translated = `${key}=${innoSetup.defaultInfo!.name}`;
|
||||
} else if (key === 'LanguageID') {
|
||||
translated = `${key}=${innoSetup.defaultInfo!.id}`;
|
||||
} else if (key === 'LanguageCodePage') {
|
||||
translated = `${key}=${innoSetup.codePage.substr(2)}`;
|
||||
} else {
|
||||
let translatedMessage = messages[key];
|
||||
if (translatedMessage) {
|
||||
translated = `${key}=${translatedMessage}`;
|
||||
}
|
||||
let translatedMessage = messages[key];
|
||||
if (translatedMessage) {
|
||||
translated = `${key}=${translatedMessage}`;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -199,7 +199,7 @@ const RULES = [
|
||||
]
|
||||
}
|
||||
];
|
||||
const TS_CONFIG_PATH = (0, path_1.join)(__dirname, '../../', 'src', 'tsconfig.json');
|
||||
const TS_CONFIG_PATH = path_1.join(__dirname, '../../', 'src', 'tsconfig.json');
|
||||
let hasErrors = false;
|
||||
function checkFile(program, sourceFile, rule) {
|
||||
checkNode(sourceFile);
|
||||
@@ -250,8 +250,8 @@ function checkFile(program, sourceFile, rule) {
|
||||
}
|
||||
function createProgram(tsconfigPath) {
|
||||
const tsConfig = ts.readConfigFile(tsconfigPath, ts.sys.readFile);
|
||||
const configHostParser = { fileExists: fs_1.existsSync, readDirectory: ts.sys.readDirectory, readFile: file => (0, fs_1.readFileSync)(file, 'utf8'), useCaseSensitiveFileNames: process.platform === 'linux' };
|
||||
const tsConfigParsed = ts.parseJsonConfigFileContent(tsConfig.config, configHostParser, (0, path_1.resolve)((0, path_1.dirname)(tsconfigPath)), { noEmit: true });
|
||||
const configHostParser = { fileExists: fs_1.existsSync, readDirectory: ts.sys.readDirectory, readFile: file => fs_1.readFileSync(file, 'utf8'), useCaseSensitiveFileNames: process.platform === 'linux' };
|
||||
const tsConfigParsed = ts.parseJsonConfigFileContent(tsConfig.config, configHostParser, path_1.resolve(path_1.dirname(tsconfigPath)), { noEmit: true });
|
||||
const compilerHost = ts.createCompilerHost(tsConfigParsed.options, true);
|
||||
return ts.createProgram(tsConfigParsed.fileNames, tsConfigParsed.options, compilerHost);
|
||||
}
|
||||
@@ -261,7 +261,7 @@ function createProgram(tsconfigPath) {
|
||||
const program = createProgram(TS_CONFIG_PATH);
|
||||
for (const sourceFile of program.getSourceFiles()) {
|
||||
for (const rule of RULES) {
|
||||
if ((0, minimatch_1.match)([sourceFile.fileName], rule.target).length > 0) {
|
||||
if (minimatch_1.match([sourceFile.fileName], rule.target).length > 0) {
|
||||
if (!rule.skip) {
|
||||
checkFile(program, sourceFile, rule);
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ function modifyI18nPackFiles(existingTranslationFolder, resultingTranslationPath
|
||||
let mainPack = { version: i18n.i18nPackVersion, contents: {} };
|
||||
let extensionsPacks = {};
|
||||
let errors = [];
|
||||
return (0, event_stream_1.through)(function (xlf) {
|
||||
return event_stream_1.through(function (xlf) {
|
||||
let rawResource = path.basename(xlf.relative, '.xlf');
|
||||
let resource = rawResource.substring(0, rawResource.lastIndexOf('.'));
|
||||
let contents = xlf.contents.toString();
|
||||
|
||||
@@ -53,8 +53,8 @@ define([], [${wrap + lines.map(l => indent + l).join(',\n') + wrap}]);`;
|
||||
* Returns a stream containing the patched JavaScript and source maps.
|
||||
*/
|
||||
function nls() {
|
||||
const input = (0, event_stream_1.through)();
|
||||
const output = input.pipe((0, event_stream_1.through)(function (f) {
|
||||
const input = event_stream_1.through();
|
||||
const output = input.pipe(event_stream_1.through(function (f) {
|
||||
if (!f.sourceMap) {
|
||||
return this.emit('error', new Error(`File ${f.relative} does not have sourcemaps.`));
|
||||
}
|
||||
@@ -72,7 +72,7 @@ function nls() {
|
||||
}
|
||||
_nls.patchFiles(f, typescript).forEach(f => this.emit('data', f));
|
||||
}));
|
||||
return (0, event_stream_1.duplex)(input, output);
|
||||
return event_stream_1.duplex(input, output);
|
||||
}
|
||||
exports.nls = nls;
|
||||
function isImportNode(ts, node) {
|
||||
|
||||
@@ -98,7 +98,7 @@ function toConcatStream(src, bundledFileHeader, sources, dest, fileContentMapper
|
||||
return es.readArray(treatedSources)
|
||||
.pipe(useSourcemaps ? util.loadSourcemaps() : es.through())
|
||||
.pipe(concat(dest))
|
||||
.pipe((0, stats_1.createStatsStream)(dest));
|
||||
.pipe(stats_1.createStatsStream(dest));
|
||||
}
|
||||
function toBundleStream(src, bundledFileHeader, bundles, fileContentMapper) {
|
||||
return es.merge(bundles.map(function (bundle) {
|
||||
@@ -155,7 +155,7 @@ function optimizeTask(opts) {
|
||||
addComment: true,
|
||||
includeContent: true
|
||||
}))
|
||||
.pipe(opts.languages && opts.languages.length ? (0, i18n_1.processNlsFiles)({
|
||||
.pipe(opts.languages && opts.languages.length ? i18n_1.processNlsFiles({
|
||||
fileHeader: bundledFileHeader,
|
||||
languages: opts.languages
|
||||
}) : es.through())
|
||||
@@ -179,7 +179,7 @@ function minifyTask(src, sourceMapBaseUrl) {
|
||||
sourcemap: 'external',
|
||||
outdir: '.',
|
||||
platform: 'node',
|
||||
target: ['node12.18'],
|
||||
target: ['node14.16'],
|
||||
write: false
|
||||
}).then(res => {
|
||||
const jsFile = res.outputFiles.find(f => /\.js$/.test(f.path));
|
||||
|
||||
@@ -256,7 +256,7 @@ export function minifyTask(src: string, sourceMapBaseUrl?: string): (cb: any) =>
|
||||
sourcemap: 'external',
|
||||
outdir: '.',
|
||||
platform: 'node',
|
||||
target: ['node12.18'],
|
||||
target: ['node14.16'],
|
||||
write: false
|
||||
}).then(res => {
|
||||
const jsFile = res.outputFiles.find(f => /\.js$/.test(f.path))!;
|
||||
|
||||
@@ -12,7 +12,7 @@ const yarn = process.platform === 'win32' ? 'yarn.cmd' : 'yarn';
|
||||
const rootDir = path.resolve(__dirname, '..', '..');
|
||||
function runProcess(command, args = []) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const child = (0, child_process_1.spawn)(command, args, { cwd: rootDir, stdio: 'inherit', env: process.env });
|
||||
const child = child_process_1.spawn(command, args, { cwd: rootDir, stdio: 'inherit', env: process.env });
|
||||
child.on('exit', err => !err ? resolve() : process.exit(err !== null && err !== void 0 ? err : 1));
|
||||
child.on('error', reject);
|
||||
});
|
||||
|
||||
@@ -260,7 +260,7 @@ function transportCSS(module, enqueue, write) {
|
||||
}
|
||||
const filename = path.join(SRC_DIR, module);
|
||||
const fileContents = fs.readFileSync(filename).toString();
|
||||
const inlineResources = 'base64'; // see https://github.com/Microsoft/monaco-editor/issues/148
|
||||
const inlineResources = 'base64'; // see https://github.com/microsoft/monaco-editor/issues/148
|
||||
const newContents = _rewriteOrInlineUrls(fileContents, inlineResources === 'base64');
|
||||
write(module, newContents);
|
||||
return true;
|
||||
|
||||
@@ -302,7 +302,7 @@ function transportCSS(module: string, enqueue: (module: string) => void, write:
|
||||
|
||||
const filename = path.join(SRC_DIR, module);
|
||||
const fileContents = fs.readFileSync(filename).toString();
|
||||
const inlineResources = 'base64'; // see https://github.com/Microsoft/monaco-editor/issues/148
|
||||
const inlineResources = 'base64'; // see https://github.com/microsoft/monaco-editor/issues/148
|
||||
|
||||
const newContents = _rewriteOrInlineUrls(fileContents, inlineResources === 'base64');
|
||||
write(module, newContents);
|
||||
|
||||
@@ -241,6 +241,9 @@ function nodeOrChildIsBlack(node) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function isSymbolWithDeclarations(symbol) {
|
||||
return !!(symbol && symbol.declarations);
|
||||
}
|
||||
function markNodes(ts, languageService, options) {
|
||||
const program = languageService.getProgram();
|
||||
if (!program) {
|
||||
@@ -413,7 +416,7 @@ function markNodes(ts, languageService, options) {
|
||||
if (symbolImportNode) {
|
||||
setColor(symbolImportNode, 2 /* Black */);
|
||||
}
|
||||
if (symbol && !nodeIsInItsOwnDeclaration(nodeSourceFile, node, symbol)) {
|
||||
if (isSymbolWithDeclarations(symbol) && !nodeIsInItsOwnDeclaration(nodeSourceFile, node, symbol)) {
|
||||
for (let i = 0, len = symbol.declarations.length; i < len; i++) { // {{SQL CARBON EDIT}} Compile fixes
|
||||
const declaration = symbol.declarations[i]; // {{SQL CARBON EDIT}} Compile fixes
|
||||
if (ts.isSourceFile(declaration)) {
|
||||
@@ -686,7 +689,7 @@ function getRealNodeSymbol(ts, checker, node) {
|
||||
// get the aliased symbol instead. This allows for goto def on an import e.g.
|
||||
// import {A, B} from "mod";
|
||||
// to jump to the implementation directly.
|
||||
if (symbol && symbol.flags & ts.SymbolFlags.Alias && shouldSkipAlias(node, symbol.declarations[0])) { // {{SQL CARBON EDIT}} Compile fixes
|
||||
if (symbol && symbol.flags & ts.SymbolFlags.Alias && symbol.declarations && shouldSkipAlias(node, symbol.declarations[0])) { // {{SQL CARBON EDIT}} Compile fixes
|
||||
const aliased = checker.getAliasedSymbol(symbol);
|
||||
if (aliased.declarations) {
|
||||
// We should mark the import as visited
|
||||
|
||||
@@ -323,6 +323,10 @@ function nodeOrChildIsBlack(node: ts.Node): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
function isSymbolWithDeclarations(symbol: ts.Symbol | undefined | null): symbol is ts.Symbol & { declarations: ts.Declaration[] } {
|
||||
return !!(symbol && symbol.declarations);
|
||||
}
|
||||
|
||||
function markNodes(ts: typeof import('typescript'), languageService: ts.LanguageService, options: ITreeShakingOptions) {
|
||||
const program = languageService.getProgram();
|
||||
if (!program) {
|
||||
@@ -530,7 +534,7 @@ function markNodes(ts: typeof import('typescript'), languageService: ts.Language
|
||||
setColor(symbolImportNode, NodeColor.Black);
|
||||
}
|
||||
|
||||
if (symbol && !nodeIsInItsOwnDeclaration(nodeSourceFile, node, symbol)) {
|
||||
if (isSymbolWithDeclarations(symbol) && !nodeIsInItsOwnDeclaration(nodeSourceFile, node, symbol)) {
|
||||
for (let i = 0, len = symbol.declarations!.length; i < len; i++) { // {{SQL CARBON EDIT}} Compile fixes
|
||||
const declaration = symbol.declarations![i]; // {{SQL CARBON EDIT}} Compile fixes
|
||||
if (ts.isSourceFile(declaration)) {
|
||||
@@ -595,7 +599,7 @@ function markNodes(ts: typeof import('typescript'), languageService: ts.Language
|
||||
}
|
||||
}
|
||||
|
||||
function nodeIsInItsOwnDeclaration(nodeSourceFile: ts.SourceFile, node: ts.Node, symbol: ts.Symbol): boolean {
|
||||
function nodeIsInItsOwnDeclaration(nodeSourceFile: ts.SourceFile, node: ts.Node, symbol: ts.Symbol & { declarations: ts.Declaration[] }): boolean {
|
||||
for (let i = 0, len = symbol.declarations!.length; i < len; i++) { // {{SQL CARBON EDIT}} Compile fixes
|
||||
const declaration = symbol.declarations![i]; // {{SQL CARBON EDIT}} Compile fixes
|
||||
const declarationSourceFile = declaration.getSourceFile();
|
||||
@@ -838,7 +842,7 @@ function getRealNodeSymbol(ts: typeof import('typescript'), checker: ts.TypeChec
|
||||
// get the aliased symbol instead. This allows for goto def on an import e.g.
|
||||
// import {A, B} from "mod";
|
||||
// to jump to the implementation directly.
|
||||
if (symbol && symbol.flags & ts.SymbolFlags.Alias && shouldSkipAlias(node, symbol.declarations![0])) { // {{SQL CARBON EDIT}} Compile fixes
|
||||
if (symbol && symbol.flags & ts.SymbolFlags.Alias && symbol.declarations && shouldSkipAlias(node, symbol.declarations![0])) { // {{SQL CARBON EDIT}} Compile fixes
|
||||
const aliased = checker.getAliasedSymbol(symbol);
|
||||
if (aliased.declarations) {
|
||||
// We should mark the import as visited
|
||||
|
||||
2
build/lib/typings/gulp-bom.d.ts
vendored
2
build/lib/typings/gulp-bom.d.ts
vendored
@@ -4,7 +4,7 @@ declare module "gulp-bom" {
|
||||
|
||||
/**
|
||||
* This is required as per:
|
||||
* https://github.com/Microsoft/TypeScript/issues/5073
|
||||
* https://github.com/microsoft/TypeScript/issues/5073
|
||||
*/
|
||||
namespace f {}
|
||||
|
||||
|
||||
4
build/lib/typings/gulp-flatmap.d.ts
vendored
4
build/lib/typings/gulp-flatmap.d.ts
vendored
@@ -4,9 +4,9 @@ declare module 'gulp-flatmap' {
|
||||
|
||||
/**
|
||||
* This is required as per:
|
||||
* https://github.com/Microsoft/TypeScript/issues/5073
|
||||
* https://github.com/microsoft/TypeScript/issues/5073
|
||||
*/
|
||||
namespace f {}
|
||||
|
||||
export = f;
|
||||
}
|
||||
}
|
||||
|
||||
4
build/lib/typings/vinyl.d.ts
vendored
4
build/lib/typings/vinyl.d.ts
vendored
@@ -103,10 +103,10 @@ declare module "vinyl" {
|
||||
|
||||
/**
|
||||
* This is required as per:
|
||||
* https://github.com/Microsoft/TypeScript/issues/5073
|
||||
* https://github.com/microsoft/TypeScript/issues/5073
|
||||
*/
|
||||
namespace File {}
|
||||
|
||||
export = File;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
"module": "./esm/vs/editor/editor.main.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Microsoft/vscode"
|
||||
"url": "https://github.com/microsoft/vscode"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/Microsoft/vscode/issues"
|
||||
"url": "https://github.com/microsoft/vscode/issues"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,39 +9,52 @@ exports.dirs = [
|
||||
'build',
|
||||
'build/lib/watch',
|
||||
'extensions',
|
||||
// {{SQL CARBON EDIT}} Add ADS extensions and remove VSCode ones
|
||||
'extensions/admin-tool-ext-win',
|
||||
'extensions/agent',
|
||||
'extensions/arc',
|
||||
'extensions/azcli',
|
||||
'extensions/azurecore',
|
||||
'extensions/azurehybridtoolkit',
|
||||
'extensions/azuremonitor',
|
||||
'extensions/big-data-cluster',
|
||||
'extensions/cms',
|
||||
'extensions/configuration-editing',
|
||||
'extensions/css-language-features',
|
||||
'extensions/css-language-features/server',
|
||||
'extensions/debug-auto-launch',
|
||||
'extensions/debug-server-ready',
|
||||
'extensions/emmet',
|
||||
'extensions/dacpac',
|
||||
'extensions/data-workspace',
|
||||
'extensions/extension-editing',
|
||||
'extensions/git',
|
||||
'extensions/github',
|
||||
'extensions/github-authentication',
|
||||
'extensions/grunt',
|
||||
'extensions/gulp',
|
||||
'extensions/html-language-features',
|
||||
'extensions/html-language-features/server',
|
||||
'extensions/image-preview',
|
||||
'extensions/jake',
|
||||
'extensions/import',
|
||||
'extensions/integration-tests',
|
||||
'extensions/json-language-features',
|
||||
'extensions/json-language-features/server',
|
||||
'extensions/kusto',
|
||||
'extensions/liveshare',
|
||||
'extensions/machine-learning',
|
||||
'extensions/markdown-language-features',
|
||||
'extensions/markdown-math',
|
||||
'extensions/merge-conflict',
|
||||
'extensions/microsoft-authentication',
|
||||
'extensions/notebook-markdown-extensions',
|
||||
'extensions/npm',
|
||||
'extensions/php-language-features',
|
||||
'extensions/mssql',
|
||||
'extensions/notebook',
|
||||
'extensions/profiler',
|
||||
'extensions/python',
|
||||
'extensions/query-history',
|
||||
'extensions/resource-deployment',
|
||||
'extensions/schema-compare',
|
||||
'extensions/search-result',
|
||||
'extensions/server-report',
|
||||
'extensions/simple-browser',
|
||||
'extensions/sql-assessment',
|
||||
'extensions/sql-database-projects',
|
||||
'extensions/sql-migration',
|
||||
'extensions/testing-editor-contributions',
|
||||
'extensions/typescript-language-features',
|
||||
'extensions/vscode-api-tests',
|
||||
'extensions/vscode-colorize-tests',
|
||||
'extensions/vscode-custom-editor-tests',
|
||||
'extensions/vscode-notebook-tests',
|
||||
'extensions/vscode-test-resolver',
|
||||
'extensions/xml-language-features',
|
||||
// {{SQL CARBON EDIT}} - End
|
||||
'remote',
|
||||
'remote/web',
|
||||
'test/automation',
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
const cp = require('child_process');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const { dirs } = require('./dirs');
|
||||
const yarn = process.platform === 'win32' ? 'yarn.cmd' : 'yarn';
|
||||
|
||||
/**
|
||||
@@ -21,6 +22,10 @@ function yarnInstall(location, opts) {
|
||||
const argv = JSON.parse(raw);
|
||||
const original = argv.original || [];
|
||||
const args = original.filter(arg => arg === '--ignore-optional' || arg === '--frozen-lockfile');
|
||||
if (opts.ignoreEngines) {
|
||||
args.push('--ignore-engines');
|
||||
delete opts.ignoreEngines;
|
||||
}
|
||||
|
||||
console.log(`Installing dependencies in ${location}...`);
|
||||
console.log(`$ yarn ${args.join(' ')}`);
|
||||
@@ -31,24 +36,39 @@ function yarnInstall(location, opts) {
|
||||
}
|
||||
}
|
||||
|
||||
yarnInstall('extensions'); // node modules shared by all extensions
|
||||
for (let dir of dirs) {
|
||||
|
||||
if (!(process.platform === 'win32' && (process.arch === 'arm64' || process.env['npm_config_arch'] === 'arm64'))) {
|
||||
yarnInstall('remote'); // node modules used by vscode server
|
||||
yarnInstall('remote/web'); // node modules used by vscode web
|
||||
}
|
||||
|
||||
const allExtensionFolders = fs.readdirSync('extensions');
|
||||
const extensions = allExtensionFolders.filter(e => {
|
||||
try {
|
||||
let packageJSON = JSON.parse(fs.readFileSync(path.join('extensions', e, 'package.json')).toString());
|
||||
return packageJSON && (packageJSON.dependencies || packageJSON.devDependencies);
|
||||
} catch (e) {
|
||||
return false;
|
||||
if (dir === '') {
|
||||
// `yarn` already executed in root
|
||||
continue;
|
||||
}
|
||||
});
|
||||
|
||||
extensions.forEach(extension => yarnInstall(`extensions/${extension}`));
|
||||
if (/^remote/.test(dir) && process.platform === 'win32' && (process.arch === 'arm64' || process.env['npm_config_arch'] === 'arm64')) {
|
||||
// windows arm: do not execute `yarn` on remote folder
|
||||
continue;
|
||||
}
|
||||
|
||||
if (dir === 'build/lib/watch') {
|
||||
// node modules for watching, specific to host node version, not electron
|
||||
yarnInstallBuildDependencies();
|
||||
continue;
|
||||
}
|
||||
|
||||
let opts;
|
||||
|
||||
if (dir === 'remote') {
|
||||
// node modules used by vscode server
|
||||
const env = { ...process.env };
|
||||
if (process.env['VSCODE_REMOTE_CC']) { env['CC'] = process.env['VSCODE_REMOTE_CC']; }
|
||||
if (process.env['VSCODE_REMOTE_CXX']) { env['CXX'] = process.env['VSCODE_REMOTE_CXX']; }
|
||||
if (process.env['VSCODE_REMOTE_NODE_GYP']) { env['npm_config_node_gyp'] = process.env['VSCODE_REMOTE_NODE_GYP']; }
|
||||
opts = { env };
|
||||
} else if (/^extensions\//.test(dir)) {
|
||||
opts = { ignoreEngines: true };
|
||||
}
|
||||
|
||||
yarnInstall(dir, opts);
|
||||
}
|
||||
|
||||
function yarnInstallBuildDependencies() {
|
||||
// make sure we install the deps of build/lib/watch for the system installed
|
||||
@@ -68,10 +88,4 @@ runtime "${runtime}"`;
|
||||
yarnInstall(watchPath);
|
||||
}
|
||||
|
||||
yarnInstall(`build`); // node modules required for build
|
||||
yarnInstall('test/automation'); // node modules required for smoketest
|
||||
yarnInstall('test/smoke'); // node modules required for smoketest
|
||||
yarnInstall('test/integration/browser'); // node modules required for integration
|
||||
yarnInstallBuildDependencies(); // node modules for watching, specific to host node version, not electron
|
||||
|
||||
cp.execSync('git config pull.rebase true');
|
||||
|
||||
@@ -20,19 +20,12 @@ function update(options) {
|
||||
if (!idOrPath) {
|
||||
throw new Error('Argument must be the location of the localization extension.');
|
||||
}
|
||||
let transifex = options.transifex;
|
||||
let location = options.location;
|
||||
if (transifex === true && location !== undefined) {
|
||||
throw new Error('Either --transifex or --location can be specified, but not both.');
|
||||
}
|
||||
if (!transifex && !location) {
|
||||
transifex = true;
|
||||
}
|
||||
if (location !== undefined && !fs.existsSync(location)) {
|
||||
throw new Error(`${location} doesn't exist.`);
|
||||
}
|
||||
let locExtFolder = idOrPath;
|
||||
if (/^\w{2}(-\w+)?$/.test(idOrPath)) {
|
||||
if (/^\w{2,3}(-\w+)?$/.test(idOrPath)) {
|
||||
locExtFolder = path.join('..', 'vscode-loc', 'i18n', `vscode-language-pack-${idOrPath}`);
|
||||
}
|
||||
let locExtStat = fs.statSync(locExtFolder);
|
||||
@@ -53,79 +46,55 @@ function update(options) {
|
||||
if (!localization.languageId || !localization.languageName || !localization.localizedLanguageName) {
|
||||
throw new Error('Each localization contribution must define "languageId", "languageName" and "localizedLanguageName" properties.');
|
||||
}
|
||||
let server = localization.server || 'www.transifex.com';
|
||||
let userName = localization.userName || 'api';
|
||||
let apiToken = process.env.TRANSIFEX_API_TOKEN;
|
||||
let languageId = localization.transifexId || localization.languageId;
|
||||
let languageId = localization.languageId;
|
||||
let translationDataFolder = path.join(locExtFolder, 'translations');
|
||||
if (languageId === "zh-cn") {
|
||||
languageId = "zh-hans";
|
||||
}
|
||||
if (languageId === "zh-tw") {
|
||||
languageId = "zh-hant";
|
||||
|
||||
switch (languageId) {
|
||||
case 'zh-cn':
|
||||
languageId = 'zh-Hans';
|
||||
break;
|
||||
case 'zh-tw':
|
||||
languageId = 'zh-Hant';
|
||||
break;
|
||||
case 'pt-br':
|
||||
languageId = 'pt-BR';
|
||||
break;
|
||||
}
|
||||
|
||||
if (fs.existsSync(translationDataFolder) && fs.existsSync(path.join(translationDataFolder, 'main.i18n.json'))) {
|
||||
console.log('Clearing \'' + translationDataFolder + '\'...');
|
||||
rimraf.sync(translationDataFolder);
|
||||
}
|
||||
|
||||
if (transifex) {
|
||||
console.log(`Downloading translations for ${languageId} to '${translationDataFolder}' ...`);
|
||||
let translationPaths = [];
|
||||
i18n.pullI18nPackFiles(server, userName, apiToken, { id: languageId }, translationPaths)
|
||||
.on('error', (error) => {
|
||||
console.log(`Error occurred while importing translations:`);
|
||||
translationPaths = undefined;
|
||||
if (Array.isArray(error)) {
|
||||
error.forEach(console.log);
|
||||
} else if (error) {
|
||||
console.log(error);
|
||||
} else {
|
||||
console.log('Unknown error');
|
||||
console.log(`Importing translations for ${languageId} form '${location}' to '${translationDataFolder}' ...`);
|
||||
let translationPaths = [];
|
||||
gulp.src(path.join(location, '**', languageId, '*.xlf'), { silent: false })
|
||||
.pipe(i18n.prepareI18nPackFiles(i18n.externalExtensionsWithTranslations, translationPaths, languageId === 'ps'))
|
||||
.on('error', (error) => {
|
||||
console.log(`Error occurred while importing translations:`);
|
||||
translationPaths = undefined;
|
||||
if (Array.isArray(error)) {
|
||||
error.forEach(console.log);
|
||||
} else if (error) {
|
||||
console.log(error);
|
||||
} else {
|
||||
console.log('Unknown error');
|
||||
}
|
||||
})
|
||||
.pipe(vfs.dest(translationDataFolder))
|
||||
.on('end', function () {
|
||||
if (translationPaths !== undefined) {
|
||||
localization.translations = [];
|
||||
for (let tp of translationPaths) {
|
||||
localization.translations.push({ id: tp.id, path: `./translations/${tp.resourceName}` });
|
||||
}
|
||||
})
|
||||
.pipe(vfs.dest(translationDataFolder))
|
||||
.on('end', function () {
|
||||
if (translationPaths !== undefined) {
|
||||
localization.translations = [];
|
||||
for (let tp of translationPaths) {
|
||||
localization.translations.push({ id: tp.id, path: `./translations/${tp.resourceName}`});
|
||||
}
|
||||
fs.writeFileSync(path.join(locExtFolder, 'package.json'), JSON.stringify(packageJSON, null, '\t'));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.log(`Importing translations for ${languageId} form '${location}' to '${translationDataFolder}' ...`);
|
||||
let translationPaths = [];
|
||||
gulp.src(path.join(location, languageId, '**', '*.xlf'))
|
||||
.pipe(i18n.prepareI18nPackFiles(i18n.externalExtensionsWithTranslations, translationPaths, languageId === 'ps'))
|
||||
.on('error', (error) => {
|
||||
console.log(`Error occurred while importing translations:`);
|
||||
translationPaths = undefined;
|
||||
if (Array.isArray(error)) {
|
||||
error.forEach(console.log);
|
||||
} else if (error) {
|
||||
console.log(error);
|
||||
} else {
|
||||
console.log('Unknown error');
|
||||
}
|
||||
})
|
||||
.pipe(vfs.dest(translationDataFolder))
|
||||
.on('end', function () {
|
||||
if (translationPaths !== undefined) {
|
||||
localization.translations = [];
|
||||
for (let tp of translationPaths) {
|
||||
localization.translations.push({ id: tp.id, path: `./translations/${tp.resourceName}`});
|
||||
}
|
||||
fs.writeFileSync(path.join(locExtFolder, 'package.json'), JSON.stringify(packageJSON, null, '\t'));
|
||||
}
|
||||
});
|
||||
}
|
||||
fs.writeFileSync(path.join(locExtFolder, 'package.json'), JSON.stringify(packageJSON, null, '\t') + '\n');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
if (path.basename(process.argv[1]) === 'update-localization-extension.js') {
|
||||
var options = minimist(process.argv.slice(2), {
|
||||
boolean: 'transifex',
|
||||
string: 'location'
|
||||
});
|
||||
update(options);
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
"@types/minimist": "^1.2.1",
|
||||
"@types/mkdirp": "^1.0.1",
|
||||
"@types/mocha": "^8.2.0",
|
||||
"@types/node": "^14.14.37",
|
||||
"@types/node": "14.x",
|
||||
"@types/p-limit": "^2.2.0",
|
||||
"@types/plist": "^3.0.2",
|
||||
"@types/pump": "^1.0.1",
|
||||
@@ -42,7 +42,7 @@
|
||||
"byline": "^5.0.0",
|
||||
"colors": "^1.4.0",
|
||||
"electron-osx-sign": "^0.4.16",
|
||||
"esbuild": "^0.8.30",
|
||||
"esbuild": "^0.12.6",
|
||||
"fs-extra": "^9.1.0",
|
||||
"documentdb": "1.13.0",
|
||||
"got": "11.8.1",
|
||||
@@ -56,7 +56,7 @@
|
||||
"rollup-plugin-commonjs": "^10.1.0",
|
||||
"rollup-plugin-node-resolve": "^5.2.0",
|
||||
"source-map": "0.6.1",
|
||||
"typescript": "^4.3.0-dev.20210426",
|
||||
"typescript": "^4.4.0-dev.20210607",
|
||||
"vsce": "1.48.0",
|
||||
"vscode-universal": "deepak1556/universal#61454d96223b774c53cda10f72c2098c0ce02d58"
|
||||
},
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"strict": true,
|
||||
"strictOptionalProperties": false,
|
||||
"useUnknownInCatchVariables": false,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"newLine": "lf"
|
||||
@@ -22,6 +24,6 @@
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules/**",
|
||||
"actions/**"
|
||||
"actions/**" // {{SQL CARBON EDIT}}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -383,16 +383,16 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.51.tgz#b31d716fb8d58eeb95c068a039b9b6292817d5fb"
|
||||
integrity sha512-El3+WJk2D/ppWNd2X05aiP5l2k4EwF7KwheknQZls+I26eSICoWRhRIJ56jGgw2dqNGQ5LtNajmBU2ajS28EvQ==
|
||||
|
||||
"@types/node@14.x":
|
||||
version "14.14.43"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.43.tgz#26bcbb0595b305400e8ceaf9a127a7f905ae49c8"
|
||||
integrity sha512-3pwDJjp1PWacPTpH0LcfhgjvurQvrZFBrC6xxjaUEZ7ifUtT32jtjPxEMMblpqd2Mvx+k8haqQJLQxolyGN/cQ==
|
||||
|
||||
"@types/node@^14.14.21":
|
||||
version "14.14.31"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.31.tgz#72286bd33d137aa0d152d47ec7c1762563d34055"
|
||||
integrity sha512-vFHy/ezP5qI0rFgJ7aQnjDXwAMrG0KqqIH7tQG5PPv3BWBayOPIQNBjVc/P6hhdZfMx51REc6tfDNXHUio893g==
|
||||
|
||||
"@types/node@^14.14.37":
|
||||
version "14.14.37"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.37.tgz#a3dd8da4eb84a996c36e331df98d82abd76b516e"
|
||||
integrity sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw==
|
||||
|
||||
"@types/p-limit@^2.2.0":
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/p-limit/-/p-limit-2.2.0.tgz#94a608e9b258a6c6156a13d1a14fd720dba70b97"
|
||||
@@ -1038,10 +1038,10 @@ entities@~2.1.0:
|
||||
resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5"
|
||||
integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==
|
||||
|
||||
esbuild@^0.8.30:
|
||||
version "0.8.47"
|
||||
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.8.47.tgz#5d5c59b7dcb8a20dfadf65a985e5e5ca7b24eff2"
|
||||
integrity sha512-4C9pInguP36c9CRDMSb6W1KrMfXrLIQVtI02Vglc43RBV0Dw49ODEnP6985mrz5iqCdQ2Cxmb9i670J/s3DBPA==
|
||||
esbuild@^0.12.6:
|
||||
version "0.12.6"
|
||||
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.12.6.tgz#85bc755c7cf3005d4f34b4f10f98049ce0ee67ce"
|
||||
integrity sha512-RDvVLvAjsq/kIZJoneMiUOH7EE7t2QaW7T3Q7EdQij14+bZbDq5sndb0tTanmHIFSqZVMBMMyqzVHkS3dJobeA==
|
||||
|
||||
eslint-scope@^5.0.0:
|
||||
version "5.1.1"
|
||||
@@ -2001,10 +2001,10 @@ typescript@^4.1.3:
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.5.tgz#123a3b214aaff3be32926f0d8f1f6e704eb89a72"
|
||||
integrity sha512-6OSu9PTIzmn9TCDiovULTnET6BgXtDYL4Gg4szY+cGsc3JP1dQL8qvE8kShTRx1NIw4Q9IBHlwODjkjWEtMUyA==
|
||||
|
||||
typescript@^4.3.0-dev.20210426:
|
||||
version "4.3.0-dev.20210426"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.0-dev.20210426.tgz#00198cb8828f6a04b4e0ae32554a486bf7137a53"
|
||||
integrity sha512-8YTqlzf3w8O8XwnnRlwRV2rswu7V7WEPUnAnH1BPPMrr06thNByMjIadA5SDW3tUJc1MG8Uj3NgZYocU5fWTVg==
|
||||
typescript@^4.4.0-dev.20210607:
|
||||
version "4.4.0-dev.20210607"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.0-dev.20210607.tgz#ea802e420785ef3b6b9c2e12d1ff4b8d2e52ee19"
|
||||
integrity sha512-tKAp1IL4APSdxD7xHLDU6tIDOEN8yJOTUGG+cSdLunmysl3yOkGrdUbByDaFDmGjKywghGhQvcG8gOqbLUcDcg==
|
||||
|
||||
uc.micro@^1.0.1, uc.micro@^1.0.5:
|
||||
version "1.0.6"
|
||||
|
||||
Reference in New Issue
Block a user