@ovrdev/cli 0.1.0-alpha.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +111 -0
- package/dist/cli/index.js +6153 -0
- package/dist/core/config.d.ts +138 -0
- package/dist/core/core.d.ts +748 -0
- package/dist/core/core.js +58 -0
- package/dist/engine/localbin.d.ts +2 -0
- package/dist/env/dotenv-plugin.d.ts +6 -0
- package/dist/index-34kn28k6.js +358 -0
- package/dist/index-3kvnzs8b.js +340 -0
- package/dist/index-4m3gj5te.js +638 -0
- package/dist/index-83n937pv.js +174 -0
- package/dist/index-85xjm9cd.js +349 -0
- package/dist/index-9wb3pkgv.js +384 -0
- package/dist/index-as2kwj3d.js +174 -0
- package/dist/index-bj59btcy.js +181 -0
- package/dist/index-dfy2jqk5.js +179 -0
- package/dist/index-grafpw62.js +340 -0
- package/dist/index-gxamezdw.js +341 -0
- package/dist/index-kdse4p7d.js +387 -0
- package/dist/index-mcgazrah.js +439 -0
- package/dist/index-pchhjv88.js +637 -0
- package/dist/index-rh33sm1y.js +370 -0
- package/dist/index-sqkwnp9b.js +618 -0
- package/dist/index-w64536he.js +431 -0
- package/dist/index-x4hj4et6.js +393 -0
- package/dist/plugins/shell.d.ts +57 -0
- package/dist/plugins/shell.js +8 -0
- package/dist/plugins/supabase.d.ts +79 -0
- package/dist/plugins/supabase.js +356 -0
- package/dist/util/dotenv.d.ts +2 -0
- package/dist/util/random.d.ts +11 -0
- package/dist/util/ready.d.ts +18 -0
- package/package.json +45 -0
- package/scripts/postinstall.mjs +59 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where an env's secrets come from. All fields optional so it can be split across a
|
|
3
|
+
* top-level default (usually `projectId`) and per-workspace overrides (usually `env`).
|
|
4
|
+
*/
|
|
5
|
+
export type InfisicalSource = {
|
|
6
|
+
env?: string;
|
|
7
|
+
projectId?: string;
|
|
8
|
+
path?: string;
|
|
9
|
+
cwd?: string;
|
|
10
|
+
};
|
|
11
|
+
export type CloneMethod = "ssh" | "https";
|
|
12
|
+
/**
|
|
13
|
+
* A declared repo. `remote` is normally an "org/repo" slug (host defaults to GitHub),
|
|
14
|
+
* expanded to ssh/https at clone time per the machine's cloneMethod. A full URL
|
|
15
|
+
* (git@… or https://…) is also accepted and used verbatim.
|
|
16
|
+
*/
|
|
17
|
+
export type RepoDecl = {
|
|
18
|
+
remote: string;
|
|
19
|
+
branch?: string;
|
|
20
|
+
/**
|
|
21
|
+
* An existing local checkout used IN PLACE (no clone, no worktree) — the norm for base
|
|
22
|
+
* repos: the folder the user already has. When set, this repo lives here regardless of the
|
|
23
|
+
* root. Only forks (which lack a path) materialize worktrees under the root.
|
|
24
|
+
*/
|
|
25
|
+
path?: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* A workspace = an environment-scoped stack. Forks mirror their base and store only
|
|
29
|
+
* overrides. Repos declared here are inherited through the fork chain.
|
|
30
|
+
*/
|
|
31
|
+
export type Workspace = {
|
|
32
|
+
base?: string;
|
|
33
|
+
branch?: string;
|
|
34
|
+
infisical?: InfisicalSource;
|
|
35
|
+
repos?: Record<string, RepoDecl>;
|
|
36
|
+
protected?: boolean;
|
|
37
|
+
overrides?: Record<string, unknown>;
|
|
38
|
+
};
|
|
39
|
+
/** Personal display preferences for the `ovr run` TUI (machine-local, never in the team slice). */
|
|
40
|
+
export type TuiConfig = {
|
|
41
|
+
wrap?: boolean;
|
|
42
|
+
timestamps?: boolean;
|
|
43
|
+
tabWidth?: number;
|
|
44
|
+
pager?: string;
|
|
45
|
+
bufferLines?: number;
|
|
46
|
+
historyLines?: number;
|
|
47
|
+
throttleMs?: number;
|
|
48
|
+
layout?: "tabs" | "sidebar";
|
|
49
|
+
mouse?: boolean;
|
|
50
|
+
keys?: Record<string, string>;
|
|
51
|
+
};
|
|
52
|
+
export type GlobalConfig = {
|
|
53
|
+
root?: string;
|
|
54
|
+
active?: string;
|
|
55
|
+
defaultOrg?: string;
|
|
56
|
+
cloneMethod?: CloneMethod;
|
|
57
|
+
inferFromCwd?: boolean;
|
|
58
|
+
teamConfig?: string;
|
|
59
|
+
infisical?: InfisicalSource;
|
|
60
|
+
tui?: TuiConfig;
|
|
61
|
+
workspaces: Record<string, Workspace>;
|
|
62
|
+
};
|
|
63
|
+
/** The shareable slice of config: workspace/repo definitions + shared infisical default. */
|
|
64
|
+
export type TeamConfig = {
|
|
65
|
+
infisical?: InfisicalSource;
|
|
66
|
+
workspaces?: Record<string, Workspace>;
|
|
67
|
+
};
|
|
68
|
+
export declare const CONFIG_DIR: string;
|
|
69
|
+
export declare const CONFIG_PATH: string;
|
|
70
|
+
/** Empty by default — nothing exists until you add it. */
|
|
71
|
+
export declare const DEFAULT_CONFIG: GlobalConfig;
|
|
72
|
+
export declare function loadConfig(): GlobalConfig;
|
|
73
|
+
export declare function saveConfig(cfg: GlobalConfig): void;
|
|
74
|
+
/** Serialize the shareable team slice (kebab-case) for `config export`. */
|
|
75
|
+
export declare function serializeTeam(cfg: GlobalConfig): string;
|
|
76
|
+
/** Parse a shared team config (kebab-case on disk) into camelCase. */
|
|
77
|
+
export declare function parseTeam(text: string): TeamConfig;
|
|
78
|
+
export type RepoConflict = {
|
|
79
|
+
workspace: string;
|
|
80
|
+
repo: string;
|
|
81
|
+
local: RepoDecl;
|
|
82
|
+
incoming: RepoDecl;
|
|
83
|
+
};
|
|
84
|
+
export type MergeResult = {
|
|
85
|
+
added: string[];
|
|
86
|
+
updated: string[];
|
|
87
|
+
conflicts: RepoConflict[];
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Deep-merge a team slice into the local config: new workspaces added; existing ones keep
|
|
91
|
+
* their local-only repos, gain the incoming's new repos, and take incoming scalar fields.
|
|
92
|
+
* A repo declared on both sides with differing values is returned as a conflict (left as
|
|
93
|
+
* the local value) for the caller to resolve.
|
|
94
|
+
*/
|
|
95
|
+
export declare function mergeTeam(cfg: GlobalConfig, team: TeamConfig): MergeResult;
|
|
96
|
+
export declare function getWorkspace(cfg: GlobalConfig, name: string): Workspace;
|
|
97
|
+
export declare const activeName: (cfg: GlobalConfig, override?: string) => string | undefined;
|
|
98
|
+
export declare const DEFAULT_BRANCH = "main";
|
|
99
|
+
export declare const DEFAULT_HOST = "github.com";
|
|
100
|
+
export declare const DEFAULT_CLONE_METHOD: CloneMethod;
|
|
101
|
+
/**
|
|
102
|
+
* Normalize a repo remote for storage. A bare name (no org, no URL) gets `defaultOrg`
|
|
103
|
+
* prepended when one is configured; with no default org it's kept as-is (the user should
|
|
104
|
+
* pass `org/repo`). Full slugs and URLs pass through untouched.
|
|
105
|
+
*/
|
|
106
|
+
export declare function normalizeRemote(remote: string, defaultOrg?: string): string;
|
|
107
|
+
/** Expand a repo `remote` (slug or full URL) into a clone URL for the given method. */
|
|
108
|
+
export declare function repoUrl(remote: string, method?: CloneMethod): string;
|
|
109
|
+
/** Resolve a repo's in-place `path` to an absolute path (expands a leading `~`, else CWD-relative). */
|
|
110
|
+
export declare function resolveRepoPath(p: string): string;
|
|
111
|
+
/** The fork chain for a workspace, base-first (…grandparent, parent, self). Cycle-guarded. */
|
|
112
|
+
export declare function forkChain(cfg: GlobalConfig, name: string): string[];
|
|
113
|
+
/** The comparator used across workspace listings: protected first, then alphabetical. */
|
|
114
|
+
export declare const workspaceOrder: (cfg: GlobalConfig) => (a: string, b: string) => number;
|
|
115
|
+
/**
|
|
116
|
+
* Workspace names in fork-tree order: each root, then its descendants depth-first, every level
|
|
117
|
+
* ordered protected-first + alphabetical (cycle-guarded). The single source of truth for listing
|
|
118
|
+
* order, so `ovr ws ls` (tree) and `ovr ls --all` (blocks) never interleave differently.
|
|
119
|
+
*/
|
|
120
|
+
export declare function forkTreeOrder(cfg: GlobalConfig): string[];
|
|
121
|
+
/** Effective repos for a workspace: inherited through the fork chain, child overrides. */
|
|
122
|
+
export declare function resolveRepos(cfg: GlobalConfig, name: string): Record<string, RepoDecl>;
|
|
123
|
+
/** A workspace's branch: its own, else inherited through forks, else "main". */
|
|
124
|
+
export declare const resolveBranch: (cfg: GlobalConfig, name: string) => string;
|
|
125
|
+
/** Effective infisical source: top-level defaults ← per-workspace, merged up the fork chain. */
|
|
126
|
+
export declare function resolveInfisical(cfg: GlobalConfig, name: string): InfisicalSource;
|
|
127
|
+
/** A workspace's env slug, from the merged infisical source. */
|
|
128
|
+
export declare const resolveEnvSlug: (cfg: GlobalConfig, name: string) => string | undefined;
|
|
129
|
+
/** A repo's effective branch: its own override, else the workspace's branch. */
|
|
130
|
+
export declare const repoBranch: (cfg: GlobalConfig, workspace: string, decl: RepoDecl) => string;
|
|
131
|
+
/**
|
|
132
|
+
* Infer the workspace + repo from the current directory, when it sits inside
|
|
133
|
+
* root/<workspace>/<repo>(/…). workspace must be a known workspace. Returns {} otherwise.
|
|
134
|
+
*/
|
|
135
|
+
export declare function inferContext(cfg: GlobalConfig, cwd?: string): {
|
|
136
|
+
workspace?: string;
|
|
137
|
+
repo?: string;
|
|
138
|
+
};
|