Skip to content

Commit 26a87d7

Browse files
committed
fix: allow any todo package to run the generateNotes queue
closes #9
1 parent 82530ba commit 26a87d7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/createInlinePluginCreator.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const { writeFileSync } = require("fs");
2+
const { once } = require("lodash");
23
const { identity } = require("lodash");
34
const EventEmitter = require("promise-events");
45
const getCommitsFiltered = require("./getCommitsFiltered");
@@ -28,6 +29,9 @@ function createInlinePluginCreator(packages, multiContext) {
2829
// Announcement of readiness for release.
2930
todo().forEach((p) => (p._readyForRelease = ee.once(p.name)));
3031

32+
// The first lucky package to be released is marked as `readyForRelease`
33+
const ignition = once((name) => ee.emit(name));
34+
3135
// Status sync point.
3236
const waitFor = (prop, filter = identity) => {
3337
const promise = ee.once(prop);
@@ -181,9 +185,9 @@ function createInlinePluginCreator(packages, multiContext) {
181185
// Wait until all todo packages are ready to generate notes.
182186
await waitFor("_nextRelease", (p) => p._nextType);
183187

184-
if (todo()[0] !== pkg) {
185-
await pkg._readyForRelease;
186-
}
188+
// Wait until the current pkg is ready to generate notes
189+
ignition(pkg.name);
190+
await pkg._readyForRelease;
187191

188192
// Update pkg deps.
189193
updateManifestDeps(pkg, path);

0 commit comments

Comments
 (0)