gitops_config.ts

The gitops config: which repos a project's gitops tasks work over, as a flat list of repos.toml registry keys.

Every other fact about a repo — its dir, URL, branch, visibility, ci, and archived — comes from the registry, through repos status --json, so the config declares nothing that could drift from it.

view source

Declarations
#

7 declarations

CreateGitopsConfig
#

gitops_config.ts view source

CreateGitopsConfig import type {CreateGitopsConfig} from '@fuzdev/fuz_repos/gitops_config.js';

A config module's default export in function form.

(call)

type (): { repos: string[]; } | Promise<{ repos: string[]; }>

returns GitopsConfig | Promise<GitopsConfig>

gitops_config_leaked_private_repos
#

gitops_config.ts view source

(entries: readonly { key: string; kind: "repo" | "reference"; dir: string; url: string; writable: boolean; archived: boolean; visibility: "public" | "private" | null; ci: boolean; branch: string | null; pinned: boolean; ... 13 more ...; visibility_check: { ...; } | ... 2 more ... | null; }[], host_is_private: boolean): { ...; }[] import {gitops_config_leaked_private_repos} from '@fuzdev/fuz_repos/gitops_config.js';

The private repos a public host package must not publish. gitops_sync writes every configured repo's GitHub metadata into the host project's generated repos.json — a public site's data when the host package is public — so a private repo in that config would leak. Empty when the host is private.

entries

the configured repos' registry entries

type readonly ReposEntryStatus[]

host_is_private

whether the host package.json sets private: true

type boolean

returns

ReposEntryStatus[]

GitopsConfig
#

gitops_config.ts view source

value + type

{ repos: string[]; } import {GitopsConfig} from '@fuzdev/fuz_repos/gitops_config.js';

A project's gitops config.

repos

type string[]

GitopsConfigModule
#

load_gitops_config
#

gitops_config.ts view source

(config_path: string): Promise<{ repos: string[]; } | null> import {load_gitops_config} from '@fuzdev/fuz_repos/gitops_config.js';

Loads a gitops config module and validates it.

config_path

type string

returns

Promise<GitopsConfig | null>

the config, or null when no file exists at config_path

throws

  • Error - if the module's default export isn't a valid config

parse_gitops_config
#

gitops_config.ts view source

(raw: unknown, config_path: string): { repos: string[]; } import {parse_gitops_config} from '@fuzdev/fuz_repos/gitops_config.js';

Validates a loaded config value: registry keys, each listed once.

raw

type unknown

config_path

type string

returns

GitopsConfig

throws

  • Error - naming the config and what's wrong with it

validate_gitops_config_module
#

gitops_config.ts view source

(config_module: any, config_path: string): asserts config_module is GitopsConfigModule import {validate_gitops_config_module} from '@fuzdev/fuz_repos/gitops_config.js';

config_module

type any

config_path

type string

returns

void

Depends on
#

Imported by
#