aboutsummaryrefslogtreecommitdiffstats
path: root/packages/monorepo-scripts/src
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-08-23 01:52:17 +0800
committerFabio Berger <me@fabioberger.com>2018-08-23 01:52:17 +0800
commitb7c119b2aaaa2f3579ca4aeef198eca7f38f1216 (patch)
tree16956eb295a2b0a21fcab07b4e2377c2cd59d3c9 /packages/monorepo-scripts/src
parent3c2af2067f768bd3ffe233d9a7c2d0232db6868e (diff)
downloaddexon-0x-contracts-b7c119b2aaaa2f3579ca4aeef198eca7f38f1216.tar
dexon-0x-contracts-b7c119b2aaaa2f3579ca4aeef198eca7f38f1216.tar.gz
dexon-0x-contracts-b7c119b2aaaa2f3579ca4aeef198eca7f38f1216.tar.bz2
dexon-0x-contracts-b7c119b2aaaa2f3579ca4aeef198eca7f38f1216.tar.lz
dexon-0x-contracts-b7c119b2aaaa2f3579ca4aeef198eca7f38f1216.tar.xz
dexon-0x-contracts-b7c119b2aaaa2f3579ca4aeef198eca7f38f1216.tar.zst
dexon-0x-contracts-b7c119b2aaaa2f3579ca4aeef198eca7f38f1216.zip
Fix many linter errors that showed up upon upgrading tsutil
Diffstat (limited to 'packages/monorepo-scripts/src')
-rw-r--r--packages/monorepo-scripts/src/doc_generate_and_upload.ts3
-rw-r--r--packages/monorepo-scripts/src/publish_release_notes.ts6
-rw-r--r--packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts20
-rw-r--r--packages/monorepo-scripts/src/utils/github_release_utils.ts18
4 files changed, 24 insertions, 23 deletions
diff --git a/packages/monorepo-scripts/src/doc_generate_and_upload.ts b/packages/monorepo-scripts/src/doc_generate_and_upload.ts
index c70ea5ba7..4c4a72701 100644
--- a/packages/monorepo-scripts/src/doc_generate_and_upload.ts
+++ b/packages/monorepo-scripts/src/doc_generate_and_upload.ts
@@ -1,6 +1,7 @@
import * as yargs from 'yargs';
import { DocGenerateAndUploadUtils } from './utils/doc_generate_and_upload_utils';
+import { utils } from './utils/utils';
const args = yargs
.option('package', {
@@ -31,6 +32,6 @@ const args = yargs
process.exit(0);
})().catch(err => {
- console.log(err);
+ utils.log(err);
process.exit(1);
});
diff --git a/packages/monorepo-scripts/src/publish_release_notes.ts b/packages/monorepo-scripts/src/publish_release_notes.ts
index 964f5b0bb..5afcc8775 100644
--- a/packages/monorepo-scripts/src/publish_release_notes.ts
+++ b/packages/monorepo-scripts/src/publish_release_notes.ts
@@ -1,9 +1,7 @@
-import * as promisify from 'es6-promisify';
-import * as publishRelease from 'publish-release';
-
-import { utils } from './utils/utils';
import { publishReleaseNotesAsync } from './utils/github_release_utils';
+import { utils } from './utils/utils';
+// tslint:disable-next-line:no-floating-promises
(async () => {
const shouldIncludePrivate = false;
const allUpdatedPackages = await utils.getUpdatedPackagesAsync(shouldIncludePrivate);
diff --git a/packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts b/packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts
index bbc763a6b..1645ba0d6 100644
--- a/packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts
+++ b/packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts
@@ -11,15 +11,15 @@ import { ExportInfo, ExportNameToTypedocNames, ExportPathToExportedItems, Packag
import { utils } from './utils';
export class DocGenerateAndUploadUtils {
- private _isStaging: boolean;
- private _shouldUploadDocs: boolean;
- private _packageName: string;
- private _omitExports: string[];
- private _packagePath: string;
- private _exportPathToExportedItems: ExportPathToExportedItems;
- private _exportPathOrder: string[];
- private _monoRepoPkgNameToPath: { [name: string]: string };
- private _packageJson: PackageJSON;
+ private readonly _isStaging: boolean;
+ private readonly _shouldUploadDocs: boolean;
+ private readonly _packageName: string;
+ private readonly _omitExports: string[];
+ private readonly _packagePath: string;
+ private readonly _exportPathToExportedItems: ExportPathToExportedItems;
+ private readonly _exportPathOrder: string[];
+ private readonly _monoRepoPkgNameToPath: { [name: string]: string };
+ private readonly _packageJson: PackageJSON;
/**
* Recursively iterate over the TypeDoc JSON object and find all type names
*/
@@ -278,7 +278,7 @@ export class DocGenerateAndUploadUtils {
}
utils.log(`GENERATE_UPLOAD_DOCS: Doc generation done for ${this._packageName}`);
}
- private async _uploadDocsAsync(jsonFilePath: string, cwd: string) {
+ private async _uploadDocsAsync(jsonFilePath: string, cwd: string): Promise<void> {
const fileName = `v${this._packageJson.version}.json`;
utils.log(`GENERATE_UPLOAD_DOCS: Doc generation successful, uploading docs... as ${fileName}`);
diff --git a/packages/monorepo-scripts/src/utils/github_release_utils.ts b/packages/monorepo-scripts/src/utils/github_release_utils.ts
index 1f4c4f1e9..28dce70ac 100644
--- a/packages/monorepo-scripts/src/utils/github_release_utils.ts
+++ b/packages/monorepo-scripts/src/utils/github_release_utils.ts
@@ -1,27 +1,29 @@
-import * as _ from 'lodash';
import * as promisify from 'es6-promisify';
+import { readFileSync } from 'fs';
+import * as _ from 'lodash';
+import * as path from 'path';
+import { exec as execAsync } from 'promisify-child-process';
import * as publishRelease from 'publish-release';
import { constants } from '../constants';
import { Package } from '../types';
-import { utils } from './utils';
-import { readFileSync } from 'fs';
-import * as path from 'path';
-import { exec as execAsync } from 'promisify-child-process';
+import { utils } from './utils';
const publishReleaseAsync = promisify(publishRelease);
+// tslint:disable-next-line:completed-docs
export async function publishReleaseNotesAsync(updatedPublishPackages: Package[]): Promise<void> {
// Git push a tag representing this publish (publish-{commit-hash}) (truncate hash)
const result = await execAsync('git log -n 1 --pretty=format:"%H"', { cwd: constants.monorepoRootPath });
const latestGitCommit = result.stdout;
- const shortenedGitCommit = latestGitCommit.slice(0, 7);
+ const prefixLength = 7;
+ const shortenedGitCommit = latestGitCommit.slice(0, prefixLength);
const tagName = `monorepo@${shortenedGitCommit}`;
await execAsync(`git rev-parse ${tagName}`);
- await execAsync('git tag ${tagName}');
+ await execAsync(`git tag ${tagName}`);
- await execAsync('git push origin ${tagName}');
+ await execAsync(`git push origin ${tagName}`);
const releaseName = `0x monorepo - ${shortenedGitCommit}`;
let assets: string[] = [];