Skip to content

Commit

Permalink
Merge pull request #84 from filipre/fix-percentage-calculation
Browse files Browse the repository at this point in the history
Fix progress indicator of `npm run which`
  • Loading branch information
thepassle authored Aug 4, 2024
2 parents c9e4ba2 + a518964 commit d98052f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions scripts/which.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,18 @@ filteredModuleReplacements.forEach((replacement) => {
console.log(`https://npmjs.com/package/${replacement.moduleName}`);
});

const implementedCodemods = Object.keys(codemods).length; // Number of implemented codemods
const implementedCodemodsPercentage = (implementedCodemods / all.length) * 100;
const implementedCodemodsNumber = Object.keys(codemods).length;
const implementedFilteredCodemodsNumber =
all.length - filteredModuleReplacements.length || 0;
const implementedCodemodsPercentage =
(implementedFilteredCodemodsNumber / all.length) * 100;

console.log(
`\nNumber of implemented codemods: ${Object.keys(codemods).length}`,
`\nNumber of all implemented codemods: ${implementedCodemodsNumber}`,
);
console.log(
`Total number of native and micro-utils module replacements: ${all.length}`,
);
console.log(`Total number of module replacements: ${all.length}`);
console.log(
`Number of module replacements left to implement codemods for: ${filteredModuleReplacements.length}`,
);
Expand Down

0 comments on commit d98052f

Please sign in to comment.