IF Commons GitHub

physical/files

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0003-estate-iac-importers FR-008

Reading files for the importers: a path that is a file is read and must be one an importer reads; a path that is a folder is walked, and a JSON or YAML file in it that no importer reads is skipped without a word (a folder holds much besides infrastructure), except that folders of tools (node_modules, .git, .terraform) are not entered. The files are read as text and nothing is run. Two assets of one identity in two files are one problem and the first is kept.

import { importPaths } from "./files.ts";
// await importPaths(["infra/plan.json", "deploy/"]) // { assets, links, problems, files }

Source: commons/estate-iac/src/physical/files.ts

1 of 4 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

physical.ImportedPathstypeno test imports it
type ImportedPaths = { readonly assets: readonly Imported[]; readonly links: readonly ImportedLink[]; readonly problems: readonly string[]; readonly files: readonly { readonly source: string; readonly tool: Tool; readonly assets: number }[] };

What reading several paths gave.

physical.importPathsfunctionno test imports it
function importPaths(paths: readonly string[], prefer?: "opentofu" | "terraform"): Promise<ImportedPaths>

The assets and links of the files and folders at the paths. prefer says which of OpenTofu and Terraform wrote a show -json.

ImportedPathstypeno test imports it
type ImportedPaths = { readonly assets: readonly Imported[]; readonly links: readonly ImportedLink[]; readonly problems: readonly string[]; readonly files: readonly { readonly source: string; readonly tool: Tool; readonly assets: number }[] };

What reading several paths gave.

importPathsfunction
function importPaths(paths: readonly string[], prefer?: "opentofu" | "terraform"): Promise<ImportedPaths>

The assets and links of the files and folders at the paths. prefer says which of OpenTofu and Terraform wrote a show -json.

Imported by 7 tests of the run (7 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.