mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
It's better because it doesn't suffer from npm link's habit of bringing in node_modules of link target, which breaks peer dependencies. Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
14 lines
506 B
TypeScript
14 lines
506 B
TypeScript
import type { Exists } from "./lens-link";
|
|
import { pipeline } from "@ogre-tools/fp";
|
|
import { map, filter } from "lodash/fp";
|
|
import { awaitAll } from "./await-all";
|
|
|
|
export const getMissingPackageJsonsFor = (exists: Exists) => async (packageJsonPaths: string[]) =>
|
|
pipeline(
|
|
packageJsonPaths,
|
|
map(async (packageJsonPath) => ({ packageJsonPath, exists: await exists(packageJsonPath) })),
|
|
awaitAll,
|
|
filter(({ exists }) => !exists),
|
|
map(({ packageJsonPath }) => packageJsonPath),
|
|
);
|