Enable strict on scripts, fix problems

This commit is contained in:
Dan Schulte 2018-09-05 13:46:47 -07:00
Родитель 9cd19888a4
Коммит 3cdc7ae9dc
3 изменённых файлов: 16 добавлений и 4 удалений

Просмотреть файл

@ -266,7 +266,7 @@ function writePackageJson(packageJson: any, packageJsonFilePath: string): void {
fs.writeFileSync(packageJsonFilePath, JSON.stringify(packageJson, undefined, " ") + "\n");
}
export function updateLocalDependencies(packageFolders: PackageFolder[], localDependencyNPMScript: string, getNewDependencyVersion: (dependencyName: string) => string): void {
export function updateLocalDependencies(packageFolders: PackageFolder[], localDependencyNPMScript: string, getNewDependencyVersion: (dependencyName: string) => string | undefined): void {
const forceRefresh: boolean = shouldForceRefresh(process.argv);
for (const packageFolder of packageFolders) {
@ -309,8 +309,8 @@ export function updateLocalDependencies(packageFolders: PackageFolder[], localDe
}
}
function updateLocalDependency(packageFolder: PackageFolder, dependencyName: string, getNewDependencyVersion: (dependencyName: string) => string): boolean {
const newDependencyVersion: string = getNewDependencyVersion(dependencyName);
function updateLocalDependency(packageFolder: PackageFolder, dependencyName: string, getNewDependencyVersion: (dependencyName: string) => string | undefined): boolean {
const newDependencyVersion: string = getNewDependencyVersion(dependencyName) || "";
const packageFolderPath: string = packageFolder.folderPath;

11
.scripts/tsconfig.json Normal file
Просмотреть файл

@ -0,0 +1,11 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"noEmit": true,
"strict": true
},
"include": [
"*.ts",
"*.js"
]
}

Просмотреть файл

@ -84,7 +84,8 @@
"url": "http://github.com/Azure/ms-rest-js/issues"
},
"scripts": {
"build": "run-p build:node build:es build:browser",
"build": "run-p build:scripts build:node build:es build:browser",
"build:scripts": "tsc -p ./.scripts/",
"build:node": "tsc",
"build:es": "tsc -p tsconfig.es.json",
"build:browser": "webpack && node node_modules/uglify-es/bin/uglifyjs --source-map -c -m -o msRestBundle.min.js msRestBundle.js",