Merge pull request #217 from Azure/daschult/scripts

Enable strict on scripts, fix problems
This commit is contained in:
Dan Schulte 2018-09-05 14:05:58 -07:00 коммит произвёл GitHub
Родитель 9cd19888a4 3cdc7ae9dc
Коммит afb8a5980a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
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",