Skip to content

Commit

Permalink
fix: apply deps update before npm's plugin prepare
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Nov 23, 2020
1 parent 19865ac commit 77b6ee2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
13 changes: 7 additions & 6 deletions lib/createInlinePluginCreator.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,25 +182,26 @@ function createInlinePluginCreator(packages, multiContext, synchronizer, flags)
getLucky("_readyForTagging", pkg);
await waitFor("_readyForTagging", pkg);

const res = await plugins.prepare(context);
pkg._prepared = true;

updateManifestDeps(pkg);
pkg._depsUpdated = true;

const res = await plugins.prepare(context);
pkg._prepared = true;

debug("prepared: %s", pkg.name);

return res;
};

const publish = async (pluginOptions, context) => {
const res = await plugins.publish(context);
const resPromise = plugins.publish(context);
next();

const res = await resPromise;
pkg._published = true;

debug("published: %s", pkg.name);

next();

// istanbul ignore next
return res.length ? res[0] : {};
};
Expand Down
4 changes: 0 additions & 4 deletions lib/updateDeps.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const { writeFileSync } = require("fs");
const recognizeFormat = require("./recognizeFormat");
const semver = require("semver");
const getManifest = require("./getManifest");

/**
* Resolve next package version.
Expand Down Expand Up @@ -152,9 +151,6 @@ const updateManifestDeps = (pkg) => {
const { manifest, path } = pkg;
const { indent, trailingWhitespace } = recognizeFormat(manifest.__contents__);

// NOTE npm plugin updates pkg version, so we have to sync.
manifest.version = getManifest(path).version;

// Loop through localDeps to verify release consistency.
pkg.localDeps.forEach((d) => {
// Get version of dependency.
Expand Down

0 comments on commit 77b6ee2

Please sign in to comment.