aboutsummaryrefslogtreecommitdiffstats
path: root/packages/monorepo-scripts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-07-18 21:27:38 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-07-18 21:27:38 +0800
commitdad557164ea4ccc012243d43df013078a7c37eb6 (patch)
tree88e8477941dc0c98273fcb054086b2e89d034e19 /packages/monorepo-scripts
parentacff177c547dee049b97e4b051fe22e1efaf992c (diff)
parentf3241ff86a0d99f4291c5a5f4eaaa5ebe1736da0 (diff)
downloaddexon-sol-tools-dad557164ea4ccc012243d43df013078a7c37eb6.tar.gz
dexon-sol-tools-dad557164ea4ccc012243d43df013078a7c37eb6.tar.zst
dexon-sol-tools-dad557164ea4ccc012243d43df013078a7c37eb6.zip
Merge branch 'v2-prototype' into feature/order-watcher-v2
Diffstat (limited to 'packages/monorepo-scripts')
-rw-r--r--packages/monorepo-scripts/package.json2
-rw-r--r--packages/monorepo-scripts/src/postpublish_utils.ts21
-rw-r--r--packages/monorepo-scripts/src/utils/changelog_utils.ts8
-rw-r--r--packages/monorepo-scripts/src/utils/utils.ts6
4 files changed, 21 insertions, 16 deletions
diff --git a/packages/monorepo-scripts/package.json b/packages/monorepo-scripts/package.json
index 73c6e9c5f..f3a6aa793 100644
--- a/packages/monorepo-scripts/package.json
+++ b/packages/monorepo-scripts/package.json
@@ -39,7 +39,7 @@
"npm-run-all": "^4.1.2",
"shx": "^0.2.2",
"@types/semver": "5.5.0",
- "tslint": "5.10.0",
+ "tslint": "5.11.0",
"typescript": "2.7.1"
},
"dependencies": {
diff --git a/packages/monorepo-scripts/src/postpublish_utils.ts b/packages/monorepo-scripts/src/postpublish_utils.ts
index b55a88539..85b32ed83 100644
--- a/packages/monorepo-scripts/src/postpublish_utils.ts
+++ b/packages/monorepo-scripts/src/postpublish_utils.ts
@@ -51,8 +51,13 @@ export const postpublishUtils = {
return configs;
},
async runAsync(packageJSON: any, tsConfigJSON: any, cwd: string): Promise<void> {
- const configs = this.generateConfig(packageJSON, tsConfigJSON, cwd);
- await this.publishReleaseNotesAsync(configs.cwd, configs.packageName, configs.version, configs.assets);
+ const configs = postpublishUtils.generateConfig(packageJSON, tsConfigJSON, cwd);
+ await postpublishUtils.publishReleaseNotesAsync(
+ configs.cwd,
+ configs.packageName,
+ configs.version,
+ configs.assets,
+ );
if (
!_.isUndefined(configs.docPublishConfigs.s3BucketPath) ||
!_.isUndefined(configs.docPublishConfigs.s3StagingBucketPath)
@@ -69,7 +74,7 @@ export const postpublishUtils = {
}
},
async publishDocsToStagingAsync(packageJSON: any, tsConfigJSON: any, cwd: string): Promise<void> {
- const configs = this.generateConfig(packageJSON, tsConfigJSON, cwd);
+ const configs = postpublishUtils.generateConfig(packageJSON, tsConfigJSON, cwd);
if (_.isUndefined(configs.docPublishConfigs.s3StagingBucketPath)) {
utils.log('config.postpublish.docPublishConfigs.s3StagingBucketPath entry in package.json not found!');
return;
@@ -84,10 +89,10 @@ export const postpublishUtils = {
);
},
async publishReleaseNotesAsync(cwd: string, packageName: string, version: string, assets: string[]): Promise<void> {
- const notes = this.getReleaseNotes(packageName, version);
- const releaseName = this.getReleaseName(packageName, version);
- const tag = this.getTag(packageName, version);
- this.adjustAssetPaths(cwd, assets);
+ const notes = postpublishUtils.getReleaseNotes(packageName, version);
+ const releaseName = postpublishUtils.getReleaseName(packageName, version);
+ const tag = postpublishUtils.getTag(packageName, version);
+ postpublishUtils.adjustAssetPaths(cwd, assets);
utils.log('POSTPUBLISH: Releasing ', releaseName, '...');
await publishReleaseAsync({
token: constants.githubPersonalAccessToken,
@@ -165,7 +170,7 @@ export const postpublishUtils = {
version: string,
S3BucketPath: string,
): Promise<void> {
- const fileIncludesAdjusted = this.adjustFileIncludePaths(fileIncludes, cwd);
+ const fileIncludesAdjusted = postpublishUtils.adjustFileIncludePaths(fileIncludes, cwd);
const projectFiles = fileIncludesAdjusted.join(' ');
const jsonFilePath = `${cwd}/${generatedDocsDirectoryName}/index.json`;
const result = await execAsync(
diff --git a/packages/monorepo-scripts/src/utils/changelog_utils.ts b/packages/monorepo-scripts/src/utils/changelog_utils.ts
index dbafb6f16..4781b3b7d 100644
--- a/packages/monorepo-scripts/src/utils/changelog_utils.ts
+++ b/packages/monorepo-scripts/src/utils/changelog_utils.ts
@@ -10,7 +10,7 @@ import { Change, Changelog, VersionChangelog } from '../types';
const CHANGELOG_MD_HEADER = `
<!--
-This file is auto-generated using the monorepo-scripts package. Don't edit directly.
+changelogUtils.file is auto-generated using the monorepo-scripts package. Don't edit directly.
Edit the package's CHANGELOG.json file only.
-->
@@ -74,7 +74,7 @@ export const changelogUtils = {
},
getChangelogOrCreateIfMissing(packageName: string, packageLocation: string): Changelog {
const changelogJSONPath = path.join(packageLocation, 'CHANGELOG.json');
- let changelogJsonIfExists = this.getChangelogJSONIfExists(changelogJSONPath);
+ let changelogJsonIfExists = changelogUtils.getChangelogJSONIfExists(changelogJSONPath);
if (_.isUndefined(changelogJsonIfExists)) {
// If none exists, create new, empty one.
changelogJsonIfExists = '[]';
@@ -91,12 +91,12 @@ export const changelogUtils = {
async writeChangelogJsonFileAsync(packageLocation: string, changelog: Changelog): Promise<void> {
const changelogJSONPath = path.join(packageLocation, 'CHANGELOG.json');
fs.writeFileSync(changelogJSONPath, JSON.stringify(changelog, null, '\t'));
- await this.prettifyAsync(changelogJSONPath, constants.monorepoRootPath);
+ await changelogUtils.prettifyAsync(changelogJSONPath, constants.monorepoRootPath);
},
async writeChangelogMdFileAsync(packageLocation: string, changelogMdString: string): Promise<void> {
const changelogMarkdownPath = path.join(packageLocation, 'CHANGELOG.md');
fs.writeFileSync(changelogMarkdownPath, changelogMdString);
- await this.prettifyAsync(changelogMarkdownPath, constants.monorepoRootPath);
+ await changelogUtils.prettifyAsync(changelogMarkdownPath, constants.monorepoRootPath);
},
async prettifyAsync(filePath: string, cwd: string): Promise<void> {
await execAsync(`prettier --write ${filePath} --config .prettierrc`, {
diff --git a/packages/monorepo-scripts/src/utils/utils.ts b/packages/monorepo-scripts/src/utils/utils.ts
index f819ab6f1..be3ad950f 100644
--- a/packages/monorepo-scripts/src/utils/utils.ts
+++ b/packages/monorepo-scripts/src/utils/utils.ts
@@ -13,7 +13,7 @@ export const utils = {
console.log(...args); // tslint:disable-line:no-console
},
async getUpdatedLernaPackagesAsync(shouldIncludePrivate: boolean): Promise<LernaPackage[]> {
- const updatedPublicPackages = await this.getLernaUpdatedPackagesAsync(shouldIncludePrivate);
+ const updatedPublicPackages = await utils.getLernaUpdatedPackagesAsync(shouldIncludePrivate);
const updatedPackageNames = _.map(updatedPublicPackages, pkg => pkg.name);
const allLernaPackages = lernaGetPackages(constants.monorepoRootPath);
@@ -110,7 +110,7 @@ export const utils = {
} catch (err) {
throw new Error(`Failed to delete local git tag. Got err: ${err}`);
}
- this.log(`Removed local tag: ${tagName}`);
+ utils.log(`Removed local tag: ${tagName}`);
},
async removeRemoteTagAsync(tagName: string): Promise<void> {
try {
@@ -120,6 +120,6 @@ export const utils = {
} catch (err) {
throw new Error(`Failed to delete remote git tag. Got err: ${err}`);
}
- this.log(`Removed remote tag: ${tagName}`);
+ utils.log(`Removed remote tag: ${tagName}`);
},
};