2020-09-17 03:39:25 -04:00
|
|
|
|
2020-09-21 01:14:06 -04:00
|
|
|
import { dirs, isEthers } from "../path";
|
|
|
|
import { getDependencies, updateJson } from "../local";
|
2020-09-22 22:54:48 -04:00
|
|
|
import { colorify } from "../log";
|
2020-09-17 03:39:25 -04:00
|
|
|
|
|
|
|
(async function() {
|
2020-09-21 01:14:06 -04:00
|
|
|
const dependencies = getDependencies(null, (name: string) => {
|
|
|
|
return !isEthers(name);
|
|
|
|
});
|
2020-09-22 22:54:48 -04:00
|
|
|
|
2020-09-23 00:23:02 -04:00
|
|
|
console.log(colorify.bold(`Hoisting ${ Object.keys(dependencies).length } dependencies into root package...`));
|
2020-09-22 22:54:48 -04:00
|
|
|
|
2020-09-17 03:39:25 -04:00
|
|
|
updateJson(dirs.rootPackageJsonPath, { dependencies });
|
2020-09-21 01:14:06 -04:00
|
|
|
})().catch((error) => {
|
|
|
|
console.log(`Error running ${ process.argv[0] }: ${ error.message }`);
|
|
|
|
process.exit(1);
|
|
|
|
});
|