Skip to content

Commit

Permalink
fix: publish updated deps
Browse files Browse the repository at this point in the history
closes #1
  • Loading branch information
antongolub committed May 20, 2020
1 parent 84804e0 commit 791f55a
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions lib/createInlinePluginCreator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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 = [];

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 791f55a

Please sign in to comment.