From 6ede8f13626afea6083d581aace4be563791c147 Mon Sep 17 00:00:00 2001 From: Dan Schulte Date: Tue, 18 Sep 2018 13:31:08 -0700 Subject: [PATCH 1/2] Remove extra logging from codegen gulp task --- gulpfile.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gulpfile.ts b/gulpfile.ts index e0f9da05029..3313e97b474 100644 --- a/gulpfile.ts +++ b/gulpfile.ts @@ -18,16 +18,16 @@ const use: string = argv['use']; const whatif: boolean = argv['whatif']; function findReadmeTypeScriptMdFilePaths(azureRestAPISpecsRoot: string): string[] { - console.log(`Looking for "readme.typescript.md" files in "${azureRestAPISpecsRoot}"...`); + // console.log(`Looking for "readme.typescript.md" files in "${azureRestAPISpecsRoot}"...`); const specificationFolderPath: string = path.resolve(azureRestAPISpecsRoot, 'specification'); const readmeTypeScriptMdFilePaths: string[] = glob.sync('**/readme.typescript.md', { absolute: true, cwd: specificationFolderPath }); if (readmeTypeScriptMdFilePaths) { for (let i = 0; i < readmeTypeScriptMdFilePaths.length; ++i) { const readmeTypeScriptMdFilePath: string = readmeTypeScriptMdFilePaths[i]; - console.log(` Found "${readmeTypeScriptMdFilePath}".`); + // console.log(` Found "${readmeTypeScriptMdFilePath}".`); if (readmeTypeScriptMdFilePath && !startsWith(readmeTypeScriptMdFilePath, specificationFolderPath)) { const resolvedReadmeTypeScriptMdFilePath: string = path.resolve(specificationFolderPath, readmeTypeScriptMdFilePath); - console.log(` Updating to "${resolvedReadmeTypeScriptMdFilePath}".`); + // console.log(` Updating to "${resolvedReadmeTypeScriptMdFilePath}".`); readmeTypeScriptMdFilePaths[i] = resolvedReadmeTypeScriptMdFilePath; } } @@ -58,7 +58,7 @@ function startsWith(value: string, prefix: string): boolean { } function endsWith(value: string, suffix: string): boolean { - return value && suffix && value.lastIndexOf(suffix) === value.length - suffix.length; + return value && suffix && value.length >= suffix.length && value.lastIndexOf(suffix) === value.length - suffix.length; } gulp.task('default', () => { @@ -110,7 +110,7 @@ gulp.task("install", () => { } }); -//This task is used to generate libraries based on the mappings specified above. +// This task is used to generate libraries based on the mappings specified above. gulp.task('codegen', () => { const typeScriptReadmeFilePaths: string[] = findReadmeTypeScriptMdFilePaths(azureRestAPISpecsRoot); @@ -119,7 +119,7 @@ gulp.task('codegen', () => { const typeScriptReadmeFileContents: string = fs.readFileSync(typeScriptReadmeFilePath, 'utf8'); const packageName: string = getPackageNameFromReadmeTypeScriptMdFileContents(typeScriptReadmeFileContents); - console.log(`In "${typeScriptReadmeFilePath}", found package name "${packageName}".`); + // console.log(`In "${typeScriptReadmeFilePath}", found package name "${packageName}".`); if (!packageArg || packageArg === packageName || endsWith(packageName, `-${packageArg}`)) { console.log(`>>>>>>>>>>>>>>>>>>> Start: "${packageName}" >>>>>>>>>>>>>>>>>>>>>>>>>`); From dc40a8b02bacb6026aff9d18c1743872a5a99383 Mon Sep 17 00:00:00 2001 From: Dan Schulte Date: Tue, 18 Sep 2018 13:42:19 -0700 Subject: [PATCH 2/2] Ignore cjs and esm folders --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e16b357eec6..6d610592210 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,8 @@ TestResults/* # Node # **/node_modules/ +**/cjs/ +**/esm/ npm-debug.log.* azure_error checkstyle-result.xml @@ -52,4 +54,4 @@ test/tmp/* # Coverage report coverage -.nyc_output \ No newline at end of file +.nyc_output