repo_ops.ts

Declarations
#

Generic repository operations for scripts that work across repos.

Provides lightweight utilities for: - Getting repo paths from gitops config (without full git sync) - Walking files in repos with sensible exclusions - Common exclusion patterns for node/svelte projects

For full git sync/clone functionality, use get_gitops_ready() from gitops_task_helpers.

8 declarations

view source

collect_repo_files
#

repo_ops.ts view source

(dir: string, options?: WalkOptions | undefined): Promise<string[]>

Collect all files from walk_repo_files into an array. Convenience function for when you need all paths upfront.

dir

type string

options?

type WalkOptions | undefined
optional

returns

Promise<string[]>

DEFAULT_EXCLUDE_DIRS
#

repo_ops.ts view source

readonly ["node_modules", ".git", ".gro", ".svelte-kit", ".deno", ".vscode", ".idea", "dist", "build", "coverage", ".cache", ".turbo"]

Default directories to exclude from file walking

DEFAULT_EXCLUDE_EXTENSIONS
#

repo_ops.ts view source

readonly [".png", ".jpg", ".jpeg", ".gif", ".svg", ".ico", ".webp", ".woff", ".woff2", ".ttf", ".eot", ".mp4", ".webm", ".mp3", ".wav", ".ogg", ".zip", ".tar", ".gz", ".lock", ".pdf"]

Default binary/non-text extensions to exclude from content processing

get_repo_paths
#

repo_ops.ts view source

(config_path?: string | undefined): Promise<RepoPath[]>

Get repo paths from gitops config without full git sync. Lighter weight than get_gitops_ready() - just resolves paths.

config_path?

Path to gitops.config.ts (defaults to ./gitops.config.ts)

type string | undefined
optional

returns

Promise<RepoPath[]>

Array of repo info with name, path, and url

RepoPath
#

should_exclude_path
#

repo_ops.ts view source

(file_path: string, options?: WalkOptions | undefined): boolean

Check if a path should be excluded based on options.

file_path

type string

options?

type WalkOptions | undefined
optional

returns

boolean

walk_repo_files
#

repo_ops.ts view source

(dir: string, options?: WalkOptions | undefined): AsyncGenerator<string, void, undefined>

Walk files in a directory, respecting common exclusions. Yields absolute paths to files (and optionally directories).

dir

Directory to walk

type string

options?

Walk options for exclusions and filtering

type WalkOptions | undefined
optional

returns

AsyncGenerator<string, void, undefined>

WalkOptions
#

repo_ops.ts view source

WalkOptions

exclude_dirs

Additional directories to exclude (merged with defaults)

type Array<string>

exclude_extensions

Additional extensions to exclude (merged with defaults)

type Array<string>

max_file_size

Maximum file size in bytes (default: 10MB)

type number

include_dirs

Include directories in output (default: false)

type boolean

no_defaults

Use only provided exclusions, ignoring defaults

type boolean

Depends on
#