aboutsummaryrefslogtreecommitdiffstats
path: root/packages/monorepo-scripts/src
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-07-24 02:44:47 +0800
committerFabio Berger <me@fabioberger.com>2018-07-24 02:44:47 +0800
commitdf00d93b9c3c9167700165500ff2dcc6c5681ac2 (patch)
tree31d4e289864e6edbdda3eddca5e360831c89323c /packages/monorepo-scripts/src
parent15bbbb37623845f5bb425e5ae3dbd0e02154cb0c (diff)
downloaddexon-0x-contracts-df00d93b9c3c9167700165500ff2dcc6c5681ac2.tar.gz
dexon-0x-contracts-df00d93b9c3c9167700165500ff2dcc6c5681ac2.tar.zst
dexon-0x-contracts-df00d93b9c3c9167700165500ff2dcc6c5681ac2.zip
Also add private package new versions to packageToNextVersion
Diffstat (limited to 'packages/monorepo-scripts/src')
-rw-r--r--packages/monorepo-scripts/src/publish.ts25
1 files changed, 14 insertions, 11 deletions
diff --git a/packages/monorepo-scripts/src/publish.ts b/packages/monorepo-scripts/src/publish.ts
index 9268de796..e86036d57 100644
--- a/packages/monorepo-scripts/src/publish.ts
+++ b/packages/monorepo-scripts/src/publish.ts
@@ -34,16 +34,27 @@ const packageNameToWebsitePath: { [name: string]: string } = {
(async () => {
// Fetch public, updated Lerna packages
- const shouldIncludePrivate = false;
- const updatedPublicPackages = await utils.getUpdatedPackagesAsync(shouldIncludePrivate);
+ const shouldIncludePrivate = true;
+ const allUpdatedPackages = await utils.getUpdatedPackagesAsync(shouldIncludePrivate);
// await confirmDocPagesRenderAsync(updatedPublicPackages);
// Update CHANGELOGs
+ const updatedPublicPackages = _.filter(allUpdatedPackages, pkg => !pkg.packageJson.private);
const updatedPublicPackageNames = _.map(updatedPublicPackages, pkg => pkg.packageJson.name);
utils.log(`Will update CHANGELOGs and publish: \n${updatedPublicPackageNames.join('\n')}\n`);
const packageToNextVersion = await updateChangeLogsAsync(updatedPublicPackages);
+ const updatedPrivatePackages = _.filter(allUpdatedPackages, pkg => pkg.packageJson.private);
+ _.each(updatedPrivatePackages, pkg => {
+ const nextPatchVersionIfValid = semver.inc(pkg.packageJson.version, 'patch');
+ if (!_.isNull(nextPatchVersionIfValid)) {
+ packageToNextVersion[pkg.packageJson.name] = nextPatchVersionIfValid;
+ } else {
+ throw new Error(`Encountered invalid semver version: ${currentVersion} for package: ${packageName}`);
+ }
+ });
+
// Push changelog changes to Github
if (!IS_DRY_RUN) {
// await pushChangelogsToGithubAsync();
@@ -122,14 +133,6 @@ async function updateChangeLogsAsync(updatedPublicPackages: Package[]): Promise<
currentVersion,
changelog,
);
- if (pkg.packageJson.private) {
- const nextPatchVersionIfValid = semver.inc(currentVersion, 'patch');
- if (!_.isNull(nextPatchVersionIfValid)) {
- packageToNextVersion[packageName] = nextPatchVersionIfValid;
- } else {
- throw new Error(`Encountered invalid semver version: ${currentVersion} for package: ${packageName}`);
- }
- }
if (shouldAddNewEntry) {
// Create a new entry for a patch version with generic changelog entry.
const nextPatchVersionIfValid = semver.inc(currentVersion, 'patch');
@@ -196,7 +199,7 @@ async function lernaPublishAsync(packageToNextVersion: { [name: string]: string
if (isCustomVersionPrompt) {
const versionChange = packageToNextVersion[packageName];
if (_.isUndefined(versionChange)) {
- console.log('packageName', packageName, 'versionChange', versionChange, ' UNDEFINED!');
+ throw new Error(`Must have a nextVersion for each packageName. Didn't find one for ${packageName}`);
}
child.stdin.write(`${versionChange}\n`);
return;