Skip to content

Commit

Permalink
feat: rename progressData.ongoingMap into progressData.ongoing
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
progressData.ongoingMap was renamed to progressData.ongoing
  • Loading branch information
medikoo committed Nov 14, 2018
1 parent 7a3fde4 commit a795dfd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/private/create-progress-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

const ee = require("event-emitter");

module.exports = () => ee({ done: new Set(), ongoingMap: new Map(), externalsMap: new Map() });
module.exports = () => ee({ done: new Set(), ongoing: new Map(), externalsMap: new Map() });
10 changes: 5 additions & 5 deletions lib/private/install-package/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ const { resolve } = require("path")
, removeNonDirectDependencies = require("../remove-non-direct-dependencies");

const finalize = async ({ name }, progressData) => {
const { done, ongoingMap } = progressData;
const { done, ongoing } = progressData;
log.debug("mark %s as done", name);
done.add(name);

const pendingJobs = ongoingMap.get(name);
const pendingJobs = ongoing.get(name);
log.debug("remove %s from ongoing", name);
ongoingMap.delete(name);
ongoing.delete(name);

// Run pending jobs
if (pendingJobs.length) {
Expand All @@ -29,7 +29,7 @@ const finalize = async ({ name }, progressData) => {
module.exports = async (packageContext, userConfiguration, inputOptions, progressData) => {
const { name } = packageContext;
const { hooks, packagesPath, packagesMeta } = userConfiguration;
const { ongoingMap } = progressData;
const { ongoing } = progressData;
if (!packagesMeta[name]) {
throw new NpmCrossLinkError(
`Cannot install package. "${ name }" is not recognized as a dev package`
Expand All @@ -42,7 +42,7 @@ module.exports = async (packageContext, userConfiguration, inputOptions, progres

const pendingJobs = (packageContext.pendingJobs = []);
log.debug("mark %s as ongoing", name);
ongoingMap.set(name, pendingJobs);
ongoing.set(name, pendingJobs);

// Ensure repository is up to date
await setupRepository(path, meta.repoUrl, inputOptions);
Expand Down
6 changes: 3 additions & 3 deletions lib/private/setup-dependencies/setup-dependency/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ const npmLinkDependency = require("./npm-link-dependency");

module.exports = async (dependencyContext, userConfiguration, inputOptions, progressData) => {
const { name, isExternal } = dependencyContext;
const { done, ongoingMap } = progressData;
const { done, ongoing } = progressData;
if (!isExternal) {
if (ongoingMap.has(name)) {
ongoingMap.get(name).push(() => npmLinkDependency(dependencyContext, progressData));
if (ongoing.has(name)) {
ongoing.get(name).push(() => npmLinkDependency(dependencyContext, progressData));
return;
}
if (!done.has(name)) {
Expand Down

0 comments on commit a795dfd

Please sign in to comment.