Converting some require imports to import from imports

This ensures we pick up the correct typings for these imports
This commit is contained in:
Matt Bierner
2018-10-03 11:00:38 -07:00
parent 293c9cb5a6
commit 38fbec9568
7 changed files with 21 additions and 20 deletions
+3 -3
View File
@@ -3,9 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import fs = require('fs');
import path = require('path');
import vm = require('vm');
import * as fs from 'fs';
import * as path from 'path';
import * as vm from 'vm';
interface IPosition {
line: number;
+3 -3
View File
@@ -13,8 +13,8 @@ var xml2js = require("xml2js");
var glob = require("glob");
var https = require("https");
var gulp = require("gulp");
var util = require('gulp-util');
var iconv = require('iconv-lite');
var util = require("gulp-util");
var iconv = require("iconv-lite");
var NUMBER_OF_CONCURRENT_DOWNLOADS = 4;
function log(message) {
var rest = [];
@@ -1192,7 +1192,7 @@ function createIslFile(originalFilePath, messages, language, innoSetup) {
var filePath = basename + "." + language.id + ".isl";
return new File({
path: filePath,
contents: iconv.encode(Buffer.from(content.join('\r\n'), 'utf8'), innoSetup.codePage)
contents: iconv.encode(Buffer.from(content.join('\r\n'), 'utf8').toString(), innoSetup.codePage)
});
}
function encodeEntities(value) {
+4 -4
View File
@@ -7,15 +7,15 @@ import * as path from 'path';
import * as fs from 'fs';
import { through, readable, ThroughStream } from 'event-stream';
import File = require('vinyl');
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';
var util = require('gulp-util');
var iconv = require('iconv-lite');
import * as util from 'gulp-util';
import * as iconv from 'iconv-lite';
const NUMBER_OF_CONCURRENT_DOWNLOADS = 4;
@@ -1331,7 +1331,7 @@ function createIslFile(originalFilePath: string, messages: Map<string>, language
return new File({
path: filePath,
contents: iconv.encode(Buffer.from(content.join('\r\n'), 'utf8'), innoSetup.codePage)
contents: iconv.encode(Buffer.from(content.join('\r\n'), 'utf8').toString(), innoSetup.codePage)
});
}
+2 -2
View File
@@ -6,10 +6,10 @@
import * as ts from 'typescript';
import * as lazy from 'lazy.js';
import { duplex, through } from 'event-stream';
import File = require('vinyl');
import * as File from 'vinyl';
import * as sm from 'source-map';
import assign = require('object-assign');
import path = require('path');
import * as path from 'path';
declare class FileSourceMap extends File {
public sourceMap: sm.RawSourceMap;
+1 -1
View File
@@ -7,8 +7,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
var fs = require("fs");
var ts = require("typescript");
var path = require("path");
var util = require("gulp-util");
var tsfmt = require('../../tsfmt.json');
var util = require('gulp-util');
function log(message) {
var rest = [];
for (var _i = 1; _i < arguments.length; _i++) {
+5 -4
View File
@@ -3,12 +3,13 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import fs = require('fs');
import ts = require('typescript');
import path = require('path');
import * as fs from 'fs';
import * as ts from 'typescript';
import * as path from 'path';
import * as util from 'gulp-util';
const tsfmt = require('../../tsfmt.json');
var util = require('gulp-util');
function log(message: any, ...rest: any[]): void {
util.log(util.colors.cyan('[monaco.d.ts]'), message, ...rest);
}
+3 -3
View File
@@ -3,10 +3,10 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
const cp = require('child_process');
import * as cp from 'child_process';
function yarnInstall(package: string): void {
cp.execSync(`yarn add --no-lockfile ${package}`);
function yarnInstall(packageName: string): void {
cp.execSync(`yarn add --no-lockfile ${packageName}`);
}
const product = require('../../../product.json');