input_path.ts

Declarations
#

12 declarations

view source

get_possible_paths
#

input_path.ts view source

(input_path: InputPath, root_dirs: PathId[], extensions: string[]): Promise<PossiblePath[]>

Gets a list of possible source ids for each input path with extensions, duplicating each under root_dirs, without checking the filesystem.

input_path

root_dirs

type PathId[]

extensions

type string[]

returns

Promise<PossiblePath[]>

InputPath
#

PossiblePath
#

RawInputPath
#

resolve_input_files
#

input_path.ts view source

(resolved_input_paths: ResolvedInputPath[], search?: (dir: string) => Promise<ResolvedPath[]>): Promise<ResolvedInputFiles>

Finds all of the matching files for the given input paths. De-dupes source ids.

resolved_input_paths

type ResolvedInputPath[]

search

type (dir: string) => Promise<ResolvedPath[]>
default fs_search

returns

Promise<ResolvedInputFiles>

resolve_input_paths
#

input_path.ts view source

(input_paths: InputPath[], root_dirs: PathId[], extensions: string[]): Promise<ResolvedInputPaths>

Gets the path data for each input path, checking the filesystem for the possibilities and stopping at the first existing file or falling back to the first existing directory. If none is found for an input path, it's added to unmapped_input_paths.

input_paths

type InputPath[]

root_dirs

type PathId[]

extensions

type string[]

returns

Promise<ResolvedInputPaths>

ResolvedInputFile
#

ResolvedInputFiles
#

input_path.ts view source

ResolvedInputFiles

resolved_input_files

type Array<ResolvedInputFile>

resolved_input_files_by_root_dir

type Map<PathId, Array<ResolvedInputFile>>

input_directories_with_no_files

type Array<InputPath>

ResolvedInputPath
#

ResolvedInputPaths
#

input_path.ts view source

ResolvedInputPaths

resolved_input_paths

type Array<ResolvedInputPath>

possible_paths_by_input_path

type Map<InputPath, Array<PossiblePath>>

unmapped_input_paths

type Array<InputPath>

to_input_path
#

input_path.ts view source

(raw_input_path: RawInputPath, root_path?: string): InputPath

Raw input paths are paths that users provide to Gro to reference files for tasks and gen.

A raw input path can be to a file or directory in the following forms:

- an absolute path, preserved - an explicit relative path, e.g. ./src/foo, resolved to root_path which defaults to the cwd - an implicit relative path, e.g. src/foo, preserved - an implicit relative path prefixed with gro/, transformed to absolute in the Gro directory

Thus, input paths are either absolute or implicitly relative.

raw_input_path

root_path

type string
default process.cwd()

returns

InputPath

to_input_paths
#

input_path.ts view source

(raw_input_paths: RawInputPath[], root_path?: string | undefined): InputPath[]

raw_input_paths

type RawInputPath[]

root_path?

type string | undefined
optional

returns

InputPath[]

Depends on
#

Imported by
#