(file: GenFile): Promise<AnalyzedGenResult> import {analyze_gen_result} from '@fuzdev/gro/gen.js'; file
returns
Promise<AnalyzedGenResult>
38 declarations
(file: GenFile): Promise<AnalyzedGenResult> import {analyze_gen_result} from '@fuzdev/gro/gen.js'; filePromise<AnalyzedGenResult>
(gen_results: GenResults): Promise<AnalyzedGenResult[]> import {analyze_gen_results} from '@fuzdev/gro/gen.js'; gen_resultsPromise<AnalyzedGenResult[]>
AnalyzedGenResult type { file: GenFile; existing_content: string; is_new: false; has_changed: boolean; } | { file: GenFile; existing_content: null; is_new: true; has_changed: true; }
import type {AnalyzedGenResult} from '@fuzdev/gro/gen.js'; (base: GenContextBase, origin_id: PathId, changed_file_id?: PathId | undefined): GenContext import {create_gen_context} from '@fuzdev/gro/gen.js'; Builds a GenContext for one genfile, so generating and resolving dependencies
see the same context - notably the lazy svelte_config, which is a getter
rather than a value so a genfile that ignores it never resolves it.
baseorigin_idPathIdchanged_file_id?PathIdGenContext (input_paths: InputPath[], root_dirs: PathId[], config: GroConfig, timings?: Timings | undefined): Promise<FindGenfilesResult> import {find_genfiles} from '@fuzdev/gro/gen.js'; Finds modules from input paths. (see input_path.ts for more)
input_pathsInputPath[]root_dirsPathId[]configtimings?TimingsPromise<FindGenfilesResult>
FindGenfilesFailure type { type: "unmapped_input_paths"; unmapped_input_paths: InputPath[]; resolved_input_paths: ResolvedInputPath[]; reasons: string[]; } | { type: "input_directories_with_no_files"; input_directories_with_no_files: InputPath[]; resolved_input_files: ResolvedInputFile[]; resolved_input_files_by_root_dir: Map<PathId, ResolvedInputFile[]>; resolved_input_paths: ResolvedInputPath[]; reasons: string[]; }
import type {FindGenfilesFailure} from '@fuzdev/gro/gen.js'; FindGenfilesResult type ({ ok: true; } & { value: FoundGenfiles; }) | (({ ok: false; } & { type: "unmapped_input_paths"; unmapped_input_paths: InputPath[]; resolved_input_paths: ResolvedInputPath[]; reasons: string[]; }) | ({ ok: false; } & { type: "input_directories_with_no_files"; input_directories_with_no_files: InputPath[]; resolved_input_files: ResolvedInputFile[]; resolved_input_files_by_root_dir: Map<PathId, ResolvedInputFile[]>; resolved_input_paths: ResolvedInputPath[]; reasons: string[]; }))
import type {FindGenfilesResult} from '@fuzdev/gro/gen.js'; FoundGenfiles import type {FoundGenfiles} from '@fuzdev/gro/gen.js'; resolved_input_filestype ResolvedInputFile[]
resolved_input_files_by_root_dirtype Map<PathId, ResolvedInputFile[]>
resolved_input_pathstype ResolvedInputPath[]
Gen type (GenFunction) | GenConfig
import type {Gen} from '@fuzdev/gro/gen.js'; string import {GEN_FILE_PATTERN} from '@fuzdev/gro/gen.js'; "gen" import {GEN_FILE_PATTERN_TEXT} from '@fuzdev/gro/gen.js'; GenConfig import type {GenConfig} from '@fuzdev/gro/gen.js'; generatetype (ctx: GenContext): RawGenResult | Promise<RawGenResult>
ctxRawGenResult | Promise<RawGenResult>dependencies?type GenDependencies
GenContext import type {GenContext} from '@fuzdev/gro/gen.js'; configtype GroConfig
svelte_configResolved on first access, so genfiles that don't touch it never pay to read the SvelteKit config.
type Promise<ParsedSvelteConfig>
filertype Filer
logtype Logger
timingstype Timings
invoke_tasktype <TName extends string>(task_name: InvokeTaskName<TName>, ...rest: InvokeTaskRest<TName>): Promise<void>
task_nameInvokeTaskName<TName>restInvokeTaskRest<TName>Promise<void>origin_idSame as import.meta.url but in path form.
type PathId
origin_pathThe origin_id relative to the root dir.
type string
changed_file_idThe file that triggered dependency checking.
Only available when resolving dependencies dynamically.
undefined during actual generation.
type PathId | undefined
GenContextBase import type {GenContextBase} from '@fuzdev/gro/gen.js'; The GenContext values that are the same for every genfile in a run, as opposed to the per-genfile ones create_gen_context derives.
configtype GroConfig
filertype Filer
logtype Logger
timingstype Timings
invoke_tasktype <TName extends string>(task_name: InvokeTaskName<TName>, ...rest: InvokeTaskRest<TName>): Promise<void>
task_nameInvokeTaskName<TName>restInvokeTaskRest<TName>Promise<void>GenDependencies type "all" | GenDependenciesConfig | (GenDependenciesResolver)
import type {GenDependencies} from '@fuzdev/gro/gen.js'; GenDependenciesConfig import type {GenDependenciesConfig} from '@fuzdev/gro/gen.js'; patterns?type RegExp[]
files?type PathId[]
GenDependenciesResolver import type {GenDependenciesResolver} from '@fuzdev/gro/gen.js'; (call)type (ctx: GenContext): "all" | GenDependenciesConfig | Promise<"all" | GenDependenciesConfig | null> | null
ctx"all" | GenDependenciesConfig | Promise<"all" | GenDependenciesConfig | null> | nullGenFile import type {GenFile} from '@fuzdev/gro/gen.js'; idtype PathId
contenttype string
origin_idtype PathId
formattype boolean
GenfileModule import type {GenfileModule} from '@fuzdev/gro/gen.js'; gentype Gen
GenfileModuleMeta type ModuleMeta<GenfileModule>
import type {GenfileModuleMeta} from '@fuzdev/gro/gen.js'; idtype PathId
modtype GenfileModule
GenfileModuleResult type GenfileModuleResultSuccess | GenfileModuleResultFailure
import type {GenfileModuleResult} from '@fuzdev/gro/gen.js'; GenfileModuleResultFailure import type {GenfileModuleResultFailure} from '@fuzdev/gro/gen.js'; oktype false
idtype PathId
reasontype string
errortype Error
elapsedtype number
GenfileModuleResultSuccess import type {GenfileModuleResultSuccess} from '@fuzdev/gro/gen.js'; oktype true
idtype PathId
filestype GenFile[]
elapsedtype number
GenFunction import type {GenFunction} from '@fuzdev/gro/gen.js'; (call)type (ctx: GenContext): RawGenResult | Promise<RawGenResult>
ctxRawGenResult | Promise<RawGenResult>GenResult import type {GenResult} from '@fuzdev/gro/gen.js'; origin_idtype PathId
filestype GenFile[]
GenResults import type {GenResults} from '@fuzdev/gro/gen.js'; resultstype GenfileModuleResult[]
successestype GenfileModuleResultSuccess[]
failurestype GenfileModuleResultFailure[]
input_counttype number
output_counttype number
elapsedtype number
(path: string): boolean import {is_gen_path} from '@fuzdev/gro/gen.js'; pathstringboolean (found_genfiles: FoundGenfiles, timings?: Timings | undefined): Promise<LoadGenfilesResult> import {load_genfiles} from '@fuzdev/gro/gen.js'; found_genfilestimings?TimingsPromise<LoadGenfilesResult>
LoadedGenfiles import type {LoadedGenfiles} from '@fuzdev/gro/gen.js'; modulestype GenfileModuleMeta[]
found_genfilestype FoundGenfiles
LoadGenfilesFailure type LoadModulesFailure<GenfileModuleMeta>
import type {LoadGenfilesFailure} from '@fuzdev/gro/gen.js'; typetype "load_module_failures"
load_module_failurestype LoadModuleFailure[]
reasonstype string[]
modulestype GenfileModuleMeta[]
LoadGenfilesResult type ({ ok: true; } & { value: LoadedGenfiles; }) | ({ ok: false; } & LoadGenfilesFailure)
import type {LoadGenfilesResult} from '@fuzdev/gro/gen.js'; (gen: Gen): GenConfig import {normalize_gen_config} from '@fuzdev/gro/gen.js'; genGenConfig RawGenFile import type {RawGenFile} from '@fuzdev/gro/gen.js'; contenttype string
filename?type string
format?type boolean
RawGenResult type string | RawGenFile | RawGenResult[] | null
import type {RawGenResult} from '@fuzdev/gro/gen.js'; (origin_id: PathId, raw_result: RawGenResult): GenResult import {to_gen_result} from '@fuzdev/gro/gen.js'; origin_idPathIdraw_resultGenResult (filename: string): string import {to_output_file_name} from '@fuzdev/gro/gen.js'; filenamestringstring (mod: Record<string, any>): mod is GenfileModule import {validate_gen_module} from '@fuzdev/gro/gen.js'; modRecord<string, any>boolean (gen_results: GenResults, analyzed_gen_results: AnalyzedGenResult[], log: Logger): Promise<void> import {write_gen_results} from '@fuzdev/gro/gen.js'; gen_resultsanalyzed_gen_resultsAnalyzedGenResult[]logLoggerPromise<void>