aboutsummaryrefslogtreecommitdiffstats
path: root/packages/monorepo-scripts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/monorepo-scripts')
-rw-r--r--packages/monorepo-scripts/src/prepublish_checks.ts3
-rw-r--r--packages/monorepo-scripts/src/publish.ts6
-rw-r--r--packages/monorepo-scripts/src/utils/changelog_utils.ts5
3 files changed, 4 insertions, 10 deletions
diff --git a/packages/monorepo-scripts/src/prepublish_checks.ts b/packages/monorepo-scripts/src/prepublish_checks.ts
index 5848cea8d..1c4ee1fc6 100644
--- a/packages/monorepo-scripts/src/prepublish_checks.ts
+++ b/packages/monorepo-scripts/src/prepublish_checks.ts
@@ -1,12 +1,9 @@
-import * as fs from 'fs';
import * as _ from 'lodash';
-import * as path from 'path';
import { exec as execAsync } from 'promisify-child-process';
import semver = require('semver');
import semverSort = require('semver-sort');
import { constants } from './constants';
-import { Changelog, PackageRegistryJson } from './types';
import { changelogUtils } from './utils/changelog_utils';
import { npmUtils } from './utils/npm_utils';
import { utils } from './utils/utils';
diff --git a/packages/monorepo-scripts/src/publish.ts b/packages/monorepo-scripts/src/publish.ts
index 5f4c67e04..72c6c0a71 100644
--- a/packages/monorepo-scripts/src/publish.ts
+++ b/packages/monorepo-scripts/src/publish.ts
@@ -1,11 +1,9 @@
#!/usr/bin/env node
import * as promisify from 'es6-promisify';
-import * as fs from 'fs';
import * as _ from 'lodash';
import * as moment from 'moment';
import opn = require('opn');
-import * as path from 'path';
import { exec as execAsync, spawn } from 'promisify-child-process';
import * as prompt from 'prompt';
import semver = require('semver');
@@ -13,7 +11,7 @@ import semverDiff = require('semver-diff');
import semverSort = require('semver-sort');
import { constants } from './constants';
-import { Changelog, PackageToVersionChange, SemVerIndex, VersionChangelog } from './types';
+import { PackageToVersionChange, SemVerIndex, VersionChangelog } from './types';
import { changelogUtils } from './utils/changelog_utils';
import { utils } from './utils/utils';
@@ -163,7 +161,7 @@ async function updateChangeLogsAsync(updatedPublicLernaPackages: LernaPackage[])
utils.log(`${packageName}: Updated CHANGELOG.json`);
// Generate updated CHANGELOG.md
const changelogMd = changelogUtils.generateChangelogMd(changelog);
- await changelogUtils.writeChangelogMdFileAsync(lernaPackage.location, changelog);
+ await changelogUtils.writeChangelogMdFileAsync(lernaPackage.location, changelogMd);
utils.log(`${packageName}: Updated CHANGELOG.md`);
}
diff --git a/packages/monorepo-scripts/src/utils/changelog_utils.ts b/packages/monorepo-scripts/src/utils/changelog_utils.ts
index a589fe985..dbafb6f16 100644
--- a/packages/monorepo-scripts/src/utils/changelog_utils.ts
+++ b/packages/monorepo-scripts/src/utils/changelog_utils.ts
@@ -4,7 +4,6 @@ import * as moment from 'moment';
import * as path from 'path';
import { exec as execAsync } from 'promisify-child-process';
import semver = require('semver');
-import semverSort = require('semver-sort');
import { constants } from '../constants';
import { Change, Changelog, VersionChangelog } from '../types';
@@ -94,9 +93,9 @@ export const changelogUtils = {
fs.writeFileSync(changelogJSONPath, JSON.stringify(changelog, null, '\t'));
await this.prettifyAsync(changelogJSONPath, constants.monorepoRootPath);
},
- async writeChangelogMdFileAsync(packageLocation: string, changelog: Changelog): Promise<void> {
+ async writeChangelogMdFileAsync(packageLocation: string, changelogMdString: string): Promise<void> {
const changelogMarkdownPath = path.join(packageLocation, 'CHANGELOG.md');
- fs.writeFileSync(changelogMarkdownPath, JSON.stringify(changelog, null, '\t'));
+ fs.writeFileSync(changelogMarkdownPath, changelogMdString);
await this.prettifyAsync(changelogMarkdownPath, constants.monorepoRootPath);
},
async prettifyAsync(filePath: string, cwd: string): Promise<void> {