mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 05:19:39 +00:00
Adding some typings in npm scripts
This commit is contained in:
parent
63d0559cff
commit
a3fa7ad178
|
@ -2,7 +2,8 @@
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"target": "es2017",
|
"target": "es2017",
|
||||||
"jsx": "preserve"
|
"jsx": "preserve",
|
||||||
|
"checkJs": true
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"**/*.js"
|
"**/*.js"
|
||||||
|
|
|
@ -8,6 +8,10 @@ const path = require('path');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const yarn = process.platform === 'win32' ? 'yarn.cmd' : 'yarn';
|
const yarn = process.platform === 'win32' ? 'yarn.cmd' : 'yarn';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} location
|
||||||
|
* @param {*} [opts]
|
||||||
|
*/
|
||||||
function yarnInstall(location, opts) {
|
function yarnInstall(location, opts) {
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
opts.cwd = location;
|
opts.cwd = location;
|
||||||
|
|
|
@ -7,6 +7,9 @@ const cp = require('child_process');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} location
|
||||||
|
*/
|
||||||
function updateGrammar(location) {
|
function updateGrammar(location) {
|
||||||
const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm';
|
const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm';
|
||||||
const result = cp.spawnSync(npm, ['run', 'update-grammar'], {
|
const result = cp.spawnSync(npm, ['run', 'update-grammar'], {
|
||||||
|
|
|
@ -12,6 +12,9 @@ var cson = require('cson-parser');
|
||||||
var https = require('https');
|
var https = require('https');
|
||||||
var url = require('url');
|
var url = require('url');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} urlString
|
||||||
|
*/
|
||||||
function getOptions(urlString) {
|
function getOptions(urlString) {
|
||||||
var _url = url.parse(urlString);
|
var _url = url.parse(urlString);
|
||||||
var headers = {
|
var headers = {
|
||||||
|
@ -19,7 +22,7 @@ function getOptions(urlString) {
|
||||||
};
|
};
|
||||||
var token = process.env['GITHUB_TOKEN'];
|
var token = process.env['GITHUB_TOKEN'];
|
||||||
if (token) {
|
if (token) {
|
||||||
headers['Authorization'] = 'token ' + token
|
headers['Authorization'] = 'token ' + token;
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
protocol: _url.protocol,
|
protocol: _url.protocol,
|
||||||
|
@ -30,6 +33,10 @@ function getOptions(urlString) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} url
|
||||||
|
* @param {number} redirectCount
|
||||||
|
*/
|
||||||
function download(url, redirectCount) {
|
function download(url, redirectCount) {
|
||||||
return new Promise((c, e) => {
|
return new Promise((c, e) => {
|
||||||
var content = '';
|
var content = '';
|
||||||
|
|
Loading…
Reference in a new issue