aboutsummaryrefslogtreecommitdiffstats
path: root/packages/monorepo-scripts/src/publish.ts
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-07-21 07:15:04 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-07-21 07:15:04 +0800
commit6ffa907f0ef3c94d3ea7d79d99a24939f62e0eb8 (patch)
tree7b6a6eb86d6a0463221a502fb886bae6ff5a243c /packages/monorepo-scripts/src/publish.ts
parent938aabde3db0044c658e86765e1bbdbdce4e4a17 (diff)
parente54501522dcf93521c8ff7dfe5b216cffeaa1b29 (diff)
downloaddexon-sol-tools-6ffa907f0ef3c94d3ea7d79d99a24939f62e0eb8.tar
dexon-sol-tools-6ffa907f0ef3c94d3ea7d79d99a24939f62e0eb8.tar.gz
dexon-sol-tools-6ffa907f0ef3c94d3ea7d79d99a24939f62e0eb8.tar.bz2
dexon-sol-tools-6ffa907f0ef3c94d3ea7d79d99a24939f62e0eb8.tar.lz
dexon-sol-tools-6ffa907f0ef3c94d3ea7d79d99a24939f62e0eb8.tar.xz
dexon-sol-tools-6ffa907f0ef3c94d3ea7d79d99a24939f62e0eb8.tar.zst
dexon-sol-tools-6ffa907f0ef3c94d3ea7d79d99a24939f62e0eb8.zip
Merge branch 'v2-prototype' into feature/website/jobs-page-part2
* v2-prototype: (103 commits) Add changelog entry for @0xproject/utils Add AbortController polyfill to fetchAsync in utils Increase node heap size for webpack command Add missing timestamp to CHANGELOG entries Upgrade some @0xproject packages to 1.0.0 in website Hard code fillOrder selector into abiEncodeFillOrder Returns byte array instead of memory range for encoding fillOrder calldata Created LibAbiEncoder with `fillOrderNoThrow` Add missing dep in migrations Fix the abi-gen entry point Fix linter error Remove the postinstall hook Update website package.json with original imports @0xproject/sra-report@1.0.0 Change all package to depend on the new @0xproject/connect@1.0.0 @0xproject/connect@1.0.0 Use old assert version in @0xproject/connect FIx a typo Remove rc versions from unmigrated packages 0x.js@1.0.0-rc.2 ...
Diffstat (limited to 'packages/monorepo-scripts/src/publish.ts')
-rw-r--r--packages/monorepo-scripts/src/publish.ts35
1 files changed, 18 insertions, 17 deletions
diff --git a/packages/monorepo-scripts/src/publish.ts b/packages/monorepo-scripts/src/publish.ts
index 72c6c0a71..c44e1f85e 100644
--- a/packages/monorepo-scripts/src/publish.ts
+++ b/packages/monorepo-scripts/src/publish.ts
@@ -11,7 +11,7 @@ import semverDiff = require('semver-diff');
import semverSort = require('semver-sort');
import { constants } from './constants';
-import { PackageToVersionChange, SemVerIndex, VersionChangelog } from './types';
+import { Package, PackageToVersionChange, SemVerIndex, VersionChangelog } from './types';
import { changelogUtils } from './utils/changelog_utils';
import { utils } from './utils/utils';
@@ -34,19 +34,20 @@ const packageNameToWebsitePath: { [name: string]: string } = {
'sol-cov': 'sol-cov',
subproviders: 'subproviders',
'order-utils': 'order-utils',
+ 'ethereum-types': 'ethereum-types',
};
(async () => {
// Fetch public, updated Lerna packages
const shouldIncludePrivate = false;
- const updatedPublicLernaPackages = await utils.getUpdatedLernaPackagesAsync(shouldIncludePrivate);
+ const updatedPublicPackages = await utils.getUpdatedPackagesAsync(shouldIncludePrivate);
- await confirmDocPagesRenderAsync(updatedPublicLernaPackages);
+ await confirmDocPagesRenderAsync(updatedPublicPackages);
// Update CHANGELOGs
- const updatedPublicLernaPackageNames = _.map(updatedPublicLernaPackages, pkg => pkg.package.name);
- utils.log(`Will update CHANGELOGs and publish: \n${updatedPublicLernaPackageNames.join('\n')}\n`);
- const packageToVersionChange = await updateChangeLogsAsync(updatedPublicLernaPackages);
+ const updatedPublicPackageNames = _.map(updatedPublicPackages, pkg => pkg.packageJson.name);
+ utils.log(`Will update CHANGELOGs and publish: \n${updatedPublicPackageNames.join('\n')}\n`);
+ const packageToVersionChange = await updateChangeLogsAsync(updatedPublicPackages);
// Push changelog changes to Github
if (!IS_DRY_RUN) {
@@ -65,7 +66,7 @@ const packageNameToWebsitePath: { [name: string]: string } = {
process.exit(1);
});
-async function confirmDocPagesRenderAsync(packages: LernaPackage[]): Promise<void> {
+async function confirmDocPagesRenderAsync(packages: Package[]): Promise<void> {
// push docs to staging
utils.log("Upload all docJson's to S3 staging...");
await execAsync(`yarn stage_docs`, { cwd: constants.monorepoRootPath });
@@ -76,14 +77,14 @@ async function confirmDocPagesRenderAsync(packages: LernaPackage[]): Promise<voi
await execAsync(`yarn deploy_staging`, { cwd: pathToWebsite });
const packagesWithDocs = _.filter(packages, pkg => {
- const scriptsIfExists = pkg.package.scripts;
+ const scriptsIfExists = pkg.packageJson.scripts;
if (_.isUndefined(scriptsIfExists)) {
throw new Error('Found a public package without any scripts in package.json');
}
return !_.isUndefined(scriptsIfExists[DOC_GEN_COMMAND]);
});
_.each(packagesWithDocs, pkg => {
- const name = pkg.package.name;
+ const name = pkg.packageJson.name;
const nameWithoutPrefix = _.startsWith(name, NPM_NAMESPACE) ? name.split('@0xproject/')[1] : name;
const docSegmentIfExists = packageNameToWebsitePath[nameWithoutPrefix];
if (_.isUndefined(docSegmentIfExists)) {
@@ -114,15 +115,15 @@ async function pushChangelogsToGithubAsync(): Promise<void> {
utils.log(`Pushed CHANGELOG updates to Github`);
}
-async function updateChangeLogsAsync(updatedPublicLernaPackages: LernaPackage[]): Promise<PackageToVersionChange> {
+async function updateChangeLogsAsync(updatedPublicPackages: Package[]): Promise<PackageToVersionChange> {
const packageToVersionChange: PackageToVersionChange = {};
- for (const lernaPackage of updatedPublicLernaPackages) {
- const packageName = lernaPackage.package.name;
- let changelog = changelogUtils.getChangelogOrCreateIfMissing(packageName, lernaPackage.location);
+ for (const pkg of updatedPublicPackages) {
+ const packageName = pkg.packageJson.name;
+ let changelog = changelogUtils.getChangelogOrCreateIfMissing(packageName, pkg.location);
- const currentVersion = lernaPackage.package.version;
+ const currentVersion = pkg.packageJson.version;
const shouldAddNewEntry = changelogUtils.shouldAddNewChangelogEntry(
- lernaPackage.package.name,
+ pkg.packageJson.name,
currentVersion,
changelog,
);
@@ -157,11 +158,11 @@ async function updateChangeLogsAsync(updatedPublicLernaPackages: LernaPackage[])
}
// Save updated CHANGELOG.json
- await changelogUtils.writeChangelogJsonFileAsync(lernaPackage.location, changelog);
+ await changelogUtils.writeChangelogJsonFileAsync(pkg.location, changelog);
utils.log(`${packageName}: Updated CHANGELOG.json`);
// Generate updated CHANGELOG.md
const changelogMd = changelogUtils.generateChangelogMd(changelog);
- await changelogUtils.writeChangelogMdFileAsync(lernaPackage.location, changelogMd);
+ await changelogUtils.writeChangelogMdFileAsync(pkg.location, changelogMd);
utils.log(`${packageName}: Updated CHANGELOG.md`);
}