Skip to content

Commit

Permalink
fix: allow any todo package to run the generateNotes queue
Browse files Browse the repository at this point in the history
closes #9
  • Loading branch information
antongolub committed Jun 16, 2020
1 parent 82530ba commit 26a87d7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/createInlinePluginCreator.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { writeFileSync } = require("fs");
const { once } = require("lodash");
const { identity } = require("lodash");
const EventEmitter = require("promise-events");
const getCommitsFiltered = require("./getCommitsFiltered");
Expand Down Expand Up @@ -28,6 +29,9 @@ function createInlinePluginCreator(packages, multiContext) {
// Announcement of readiness for release.
todo().forEach((p) => (p._readyForRelease = ee.once(p.name)));

// The first lucky package to be released is marked as `readyForRelease`
const ignition = once((name) => ee.emit(name));

// Status sync point.
const waitFor = (prop, filter = identity) => {
const promise = ee.once(prop);
Expand Down Expand Up @@ -181,9 +185,9 @@ function createInlinePluginCreator(packages, multiContext) {
// Wait until all todo packages are ready to generate notes.
await waitFor("_nextRelease", (p) => p._nextType);

if (todo()[0] !== pkg) {
await pkg._readyForRelease;
}
// Wait until the current pkg is ready to generate notes
ignition(pkg.name);
await pkg._readyForRelease;

// Update pkg deps.
updateManifestDeps(pkg, path);
Expand Down

0 comments on commit 26a87d7

Please sign in to comment.