From d0905eda496864096f5a64b1e2c1c05b575be904 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 14 May 2018 21:48:46 +0200 Subject: Fix TSLint issues --- packages/monorepo-scripts/src/postpublish_utils.ts | 10 +++++----- packages/monorepo-scripts/src/publish.ts | 8 ++++---- packages/monorepo-scripts/src/utils.ts | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'packages/monorepo-scripts') diff --git a/packages/monorepo-scripts/src/postpublish_utils.ts b/packages/monorepo-scripts/src/postpublish_utils.ts index df2bcb128..5fbff938e 100644 --- a/packages/monorepo-scripts/src/postpublish_utils.ts +++ b/packages/monorepo-scripts/src/postpublish_utils.ts @@ -74,7 +74,7 @@ export const postpublishUtils = { utils.log(`POSTPUBLISH: No S3Bucket config found for ${packageJSON.name}. Skipping doc JSON generation.`); } }, - async publishDocsToStagingAsync(packageJSON: any, tsConfigJSON: any, cwd: string) { + async publishDocsToStagingAsync(packageJSON: any, tsConfigJSON: any, cwd: string): Promise { const configs = this.generateConfig(packageJSON, tsConfigJSON, cwd); if (_.isUndefined(configs.docPublishConfigs.s3StagingBucketPath)) { utils.log('config.postpublish.docPublishConfigs.s3StagingBucketPath entry in package.json not found!'); @@ -109,7 +109,7 @@ export const postpublishUtils = { assets, }); }, - getReleaseNotes(packageName: string, version: string) { + getReleaseNotes(packageName: string, version: string): string { const packageNameWithNamespace = packageName.replace('@0xproject/', ''); const changelogJSONPath = path.join( constants.monorepoRootPath, @@ -135,14 +135,14 @@ export const postpublishUtils = { }); return notes; }, - getTag(packageName: string, version: string) { + getTag(packageName: string, version: string): string { return `${packageName}@${version}`; }, getReleaseName(subPackageName: string, version: string): string { const releaseName = `${subPackageName} v${version}`; return releaseName; }, - adjustAssetPaths(cwd: string, assets: string[]) { + adjustAssetPaths(cwd: string, assets: string[]): string[] { const finalAssets: string[] = []; _.each(assets, (asset: string) => { finalAssets.push(`${cwd}/${asset}`); @@ -164,7 +164,7 @@ export const postpublishUtils = { }); return fileIncludesAdjusted; }, - async generateAndUploadDocsAsync(cwd: string, fileIncludes: string[], version: string, S3BucketPath: string) { + async generateAndUploadDocsAsync(cwd: string, fileIncludes: string[], version: string, S3BucketPath: string): Promise { const fileIncludesAdjusted = this.adjustFileIncludePaths(fileIncludes, cwd); const projectFiles = fileIncludesAdjusted.join(' '); const jsonFilePath = `${cwd}/${generatedDocsDirectoryName}/index.json`; diff --git a/packages/monorepo-scripts/src/publish.ts b/packages/monorepo-scripts/src/publish.ts index 31c85e3cc..5c26475c9 100644 --- a/packages/monorepo-scripts/src/publish.ts +++ b/packages/monorepo-scripts/src/publish.ts @@ -72,7 +72,7 @@ const packageNameToWebsitePath: { [name: string]: string } = { process.exit(1); }); -async function confirmDocPagesRenderAsync(packages: LernaPackage[]) { +async function confirmDocPagesRenderAsync(packages: LernaPackage[]): Promise { // push docs to staging utils.log("Upload all docJson's to S3 staging..."); await execAsync(`yarn stage_docs`, { cwd: constants.monorepoRootPath }); @@ -162,7 +162,7 @@ async function checkPublishRequiredSetupAsync(): Promise { return true; } -async function pushChangelogsToGithubAsync() { +async function pushChangelogsToGithubAsync(): Promise { await execAsync(`git add . --all`, { cwd: constants.monorepoRootPath }); await execAsync(`git commit -m "Updated CHANGELOGS"`, { cwd: constants.monorepoRootPath }); await execAsync(`git push`, { cwd: constants.monorepoRootPath }); @@ -228,7 +228,7 @@ async function updateChangeLogsAsync(updatedPublicLernaPackages: LernaPackage[]) return packageToVersionChange; } -async function lernaPublishAsync(packageToVersionChange: { [name: string]: string }) { +async function lernaPublishAsync(packageToVersionChange: { [name: string]: string }): Promise { // HACK: Lerna publish does not provide a way to specify multiple package versions via // flags so instead we need to interact with their interactive prompt interface. const child = spawn('lerna', ['publish', '--registry=https://registry.npmjs.org/'], { @@ -269,7 +269,7 @@ async function lernaPublishAsync(packageToVersionChange: { [name: string]: strin }); } -function updateVersionNumberIfNeeded(currentVersion: string, proposedNextVersion: string) { +function updateVersionNumberIfNeeded(currentVersion: string, proposedNextVersion: string): string { if (proposedNextVersion === currentVersion) { return utils.getNextPatchVersion(currentVersion); } diff --git a/packages/monorepo-scripts/src/utils.ts b/packages/monorepo-scripts/src/utils.ts index 4412f753a..480788ad8 100644 --- a/packages/monorepo-scripts/src/utils.ts +++ b/packages/monorepo-scripts/src/utils.ts @@ -17,7 +17,7 @@ export const utils = { const newPatchVersion = `${versionSegments[0]}.${versionSegments[1]}.${newPatch}`; return newPatchVersion; }, - async prettifyAsync(filePath: string, cwd: string) { + async prettifyAsync(filePath: string, cwd: string): Promise { await execAsync(`prettier --write ${filePath} --config .prettierrc`, { cwd, }); @@ -43,7 +43,7 @@ export const utils = { } return updatedPackages; }, - getChangelogJSONIfExists(changelogPath: string) { + getChangelogJSONIfExists(changelogPath: string): string|undefined { try { const changelogJSON = fs.readFileSync(changelogPath, 'utf-8'); return changelogJSON; -- cgit v1.2.3