From 791f55a34574f5e6531ed69f182ffd54b68e2450 Mon Sep 17 00:00:00 2001 From: Anton Golub Date: Fri, 15 May 2020 12:35:33 +0300 Subject: [PATCH] fix: publish updated deps closes #1 --- lib/createInlinePluginCreator.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/createInlinePluginCreator.js b/lib/createInlinePluginCreator.js index 821c6416..a1b530bd 100644 --- a/lib/createInlinePluginCreator.js +++ b/lib/createInlinePluginCreator.js @@ -32,13 +32,9 @@ function createInlinePluginCreator(packages, multiContext) { * @internal */ const updateManifestDeps = (pkg, path) => { - const dbg = console.log; - // Get and parse manifest file contents. const manifest = getManifest(path); - dbg("name=", manifest.name); - dbg("path=", path); // Loop through localDeps to update dependencies/devDependencies/peerDependencies in manifest. pkg._localDeps.forEach(d => { // Get version of dependency. @@ -52,8 +48,6 @@ function createInlinePluginCreator(packages, multiContext) { if (manifest.dependencies.hasOwnProperty(d.name)) manifest.dependencies[d.name] = release.version; if (manifest.devDependencies.hasOwnProperty(d.name)) manifest.devDependencies[d.name] = release.version; if (manifest.peerDependencies.hasOwnProperty(d.name)) manifest.peerDependencies[d.name] = release.version; - - dbg("dep.name=", d.name, "dep.version=", release.version); }); // Write package.json back out. @@ -151,6 +145,11 @@ function createInlinePluginCreator(packages, multiContext) { // Wait until all todo packages are ready to generate notes. await wait(() => todo().every(p => p.hasOwnProperty("_nextRelease"))); + // Update pkg deps. + updateManifestDeps(pkg, path); + pkg._depsUpdated = true; + await wait(() => todo().every(p => p.hasOwnProperty("_depsUpdated"))); + // Vars. const notes = []; @@ -189,9 +188,6 @@ function createInlinePluginCreator(packages, multiContext) { * @internal */ async function prepare(pluginOptions, context) { - // Update pkg deps. - updateManifestDeps(pkg, path); - // Call other plugins. await plugins.prepare(context);