cli-common: API report warnings cleanup
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -16,4 +16,4 @@
|
||||
|
||||
export { findPaths } from './paths';
|
||||
export { isChildPath } from './isChildPath';
|
||||
export type { Paths } from './paths';
|
||||
export type { Paths, ResolveFunc } from './paths';
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user