es-tooling / ecosystem-cleanup

A place to keep track of ongoing efforts to clean up the JS ecosystem
396 stars 2 forks source link

migrate npm-run-all2 to read-package-json-fast #19

Closed 43081j closed 9 months ago

43081j commented 9 months ago

npm-run-all2 is a fork of npm-run-all: https://github.com/bcomnes/npm-run-all2

it was created since npm-run-all isn't actively maintained anymore

it depends on read-pkg which is fairly bloated. We can switch to npm's own read-package-json-fast: https://github.com/npm/read-package-json-fast

Both are only for reading the package.json in the current working directory, they do not traverse up the directory tree.

So we should be able to replace with:

const data = await readPackageJsonFast('./package.json');

// or

const packagePath = path.join(cwd, './package.json'); // `cwd` is passed in for npm-run-all at least
const data = await readPackageJsonFast(packagePath);

It is probably also worth moving people from npm-run-all to npm-run-all2 if we ever bump into that in other repos.

43081j commented 9 months ago

opened bcomnes/npm-run-all2#130 to tackle this

43081j commented 9 months ago

Fixed by bcomnes/npm-run-all2#130 🥳