cli-common: API report warnings cleanup

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2021-09-05 21:18:26 +02:00
parent 162b0dfa66
commit 5d27614a94
4 changed files with 14 additions and 13 deletions
+1 -1
View File
@@ -16,4 +16,4 @@
export { findPaths } from './paths';
export { isChildPath } from './isChildPath';
export type { Paths } from './paths';
export type { Paths, ResolveFunc } from './paths';
+2
View File
@@ -18,6 +18,8 @@ import { relative, isAbsolute } from 'path';
/**
* Checks if path is the same as or a child path of base.
*
* @public
*/
export function isChildPath(base: string, path: string): boolean {
const relativePath = relative(base, path);
+8 -2
View File
@@ -17,10 +17,15 @@
import fs from 'fs';
import { dirname, resolve as resolvePath } from 'path';
/** @public */
export type ResolveFunc = (...paths: string[]) => string;
// Common paths and resolve functions used by the cli.
// Currently assumes it is being executed within a monorepo.
/**
* Common paths and resolve functions used by the cli.
* Currently assumes it is being executed within a monorepo.
*
* @public
*/
export type Paths = {
// Root dir of the cli itself, containing package.json
ownDir: string;
@@ -100,6 +105,7 @@ export function findOwnRootDir(ownDir: string) {
/**
* Find paths related to a package and its execution context.
*
* @public
* @example
*
* const paths = findPaths(__dirname)