hologit 0.41.13 → 0.43.0
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/package.json +6 -6
- package/types/index.d.ts +331 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hologit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.43.0",
|
|
4
4
|
"description": "Hologit automates the projection of layered composite file trees based on flat, declarative plans",
|
|
5
5
|
"repository": "https://github.com/EmergencePlatform/hologit",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -10,23 +10,23 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@iarna/toml": "^2.2.5",
|
|
12
12
|
"async-exit-hook": "^2.0.1",
|
|
13
|
-
"axios": "^1.
|
|
13
|
+
"axios": "^1.7.7",
|
|
14
14
|
"chokidar": "^3.5.3",
|
|
15
|
-
"debounce": "^
|
|
15
|
+
"debounce": "^2.2.0",
|
|
16
16
|
"dockerode": "^4.0.2",
|
|
17
17
|
"fb-watchman": "^2.0.1",
|
|
18
18
|
"git-client": "^1.8.3",
|
|
19
19
|
"hab-client": "^1.1.3",
|
|
20
20
|
"handlebars": "^4.7.6",
|
|
21
|
-
"minimatch": "^
|
|
21
|
+
"minimatch": "^10.0.1",
|
|
22
22
|
"mz": "^2.4.0",
|
|
23
23
|
"mz-modules": "^2.1.0",
|
|
24
24
|
"object-squish": "^1.1.0",
|
|
25
|
-
"parse-url": "^
|
|
25
|
+
"parse-url": "^9.2.0",
|
|
26
26
|
"shell-quote-word": "^1.0.1",
|
|
27
27
|
"sort-keys": "^4.2.0",
|
|
28
28
|
"toposort": "^2.0.2",
|
|
29
|
-
"winston": "^3.
|
|
29
|
+
"winston": "^3.17.0",
|
|
30
30
|
"yargs": "^17.5.1"
|
|
31
31
|
},
|
|
32
32
|
"bin": {
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
declare module 'hologit' {
|
|
2
|
+
import { Git as GitClient } from 'git-client';
|
|
3
|
+
import { Docker } from 'dockerode';
|
|
4
|
+
|
|
5
|
+
export interface GitOptions {
|
|
6
|
+
gitDir: string;
|
|
7
|
+
workTree?: string | null;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface RepoOptions {
|
|
11
|
+
gitDir: string;
|
|
12
|
+
ref?: string;
|
|
13
|
+
workTree?: string | null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface WorkspaceOptions {
|
|
17
|
+
root: TreeObject;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface BranchOptions {
|
|
21
|
+
workspace: Workspace;
|
|
22
|
+
name: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface SourceOptions {
|
|
26
|
+
workspace: Workspace;
|
|
27
|
+
name: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface LensOptions {
|
|
31
|
+
workspace: Workspace;
|
|
32
|
+
name: string;
|
|
33
|
+
path?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface ConfigurableOptions {
|
|
37
|
+
phantom?: any;
|
|
38
|
+
workspace?: Workspace;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface GitObjectOptions {
|
|
42
|
+
hash: string;
|
|
43
|
+
mode?: string | null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface MergeOptions {
|
|
47
|
+
files?: string[] | null;
|
|
48
|
+
mode?: 'overlay' | 'replace' | 'underlay';
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface ProjectionOptions {
|
|
52
|
+
debug?: boolean;
|
|
53
|
+
lens?: boolean | null;
|
|
54
|
+
commitTo?: string | null;
|
|
55
|
+
commitMessage?: string | null;
|
|
56
|
+
parentCommit?: string | null;
|
|
57
|
+
fetch?: boolean | string[];
|
|
58
|
+
cacheFrom?: string | null;
|
|
59
|
+
cacheTo?: string | null;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export class Git {
|
|
63
|
+
static async get(): Promise<typeof GitClient>;
|
|
64
|
+
constructor(options: GitOptions);
|
|
65
|
+
gitDir: string;
|
|
66
|
+
workTree?: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export class BlobObject {
|
|
70
|
+
static async write(repo: Repo, content: string): Promise<BlobObject>;
|
|
71
|
+
static async writeFromFile(repo: Repo, filePath: string): Promise<BlobObject>;
|
|
72
|
+
|
|
73
|
+
constructor(repo: Repo, options: GitObjectOptions);
|
|
74
|
+
|
|
75
|
+
repo: Repo;
|
|
76
|
+
hash: string;
|
|
77
|
+
mode: string;
|
|
78
|
+
isBlob: boolean;
|
|
79
|
+
type: 'blob';
|
|
80
|
+
|
|
81
|
+
async read(): Promise<string>;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export class TreeObject {
|
|
85
|
+
static getEmptyTreeHash(): string;
|
|
86
|
+
static async createFromRef(repo: Repo, ref: string): Promise<TreeObject>;
|
|
87
|
+
|
|
88
|
+
constructor(repo: Repo, options?: { hash?: string; parent?: TreeObject | null });
|
|
89
|
+
|
|
90
|
+
repo: Repo;
|
|
91
|
+
dirty: boolean;
|
|
92
|
+
hash: string;
|
|
93
|
+
parent: TreeObject | null;
|
|
94
|
+
isTree: boolean;
|
|
95
|
+
type: 'tree';
|
|
96
|
+
mode: '040000';
|
|
97
|
+
|
|
98
|
+
async getHash(): Promise<string>;
|
|
99
|
+
getWrittenHash(): string | null;
|
|
100
|
+
markDirty(): void;
|
|
101
|
+
async getChild(childPath: string): Promise<TreeObject | BlobObject | CommitObject | null>;
|
|
102
|
+
async writeChild(childPath: string, content: string | BlobObject): Promise<BlobObject>;
|
|
103
|
+
async getChildren(): Promise<{ [key: string]: TreeObject | BlobObject | CommitObject }>;
|
|
104
|
+
async getBlobMap(): Promise<{ [key: string]: BlobObject }>;
|
|
105
|
+
async deleteChild(childPath: string): Promise<void>;
|
|
106
|
+
async getSubtree(subtreePath: string, create?: boolean): Promise<TreeObject | null>;
|
|
107
|
+
async getSubtreeStack(subtreePath: string, create?: boolean): Promise<TreeObject[] | null>;
|
|
108
|
+
async write(): Promise<string>;
|
|
109
|
+
async merge(input: TreeObject, options?: MergeOptions, basePath?: string, preloadChildren?: boolean): Promise<void>;
|
|
110
|
+
async clone(): Promise<TreeObject>;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export class CommitObject {
|
|
114
|
+
constructor(repo: Repo, options: GitObjectOptions);
|
|
115
|
+
|
|
116
|
+
repo: Repo;
|
|
117
|
+
hash: string;
|
|
118
|
+
mode: string;
|
|
119
|
+
isCommit: boolean;
|
|
120
|
+
type: 'commit';
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export class Configurable {
|
|
124
|
+
constructor(options: ConfigurableOptions);
|
|
125
|
+
|
|
126
|
+
phantom?: any;
|
|
127
|
+
workspace?: Workspace;
|
|
128
|
+
|
|
129
|
+
getWorkspace(): Workspace;
|
|
130
|
+
getRepo(): Repo;
|
|
131
|
+
async readConfig(): Promise<any>;
|
|
132
|
+
async writeConfig(config?: any): Promise<void>;
|
|
133
|
+
async getConfig(): Promise<any>;
|
|
134
|
+
async getCachedConfig(): Promise<any>;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export class Branch extends Configurable {
|
|
138
|
+
constructor(options: BranchOptions);
|
|
139
|
+
|
|
140
|
+
name: string;
|
|
141
|
+
|
|
142
|
+
getKind(): 'holobranch';
|
|
143
|
+
getConfigPath(): string;
|
|
144
|
+
async isDefined(): Promise<boolean>;
|
|
145
|
+
getMapping(key: string): Mapping;
|
|
146
|
+
async getMappings(): Promise<Map<string, Mapping>>;
|
|
147
|
+
async composite(options: {
|
|
148
|
+
outputTree?: TreeObject;
|
|
149
|
+
fetch?: boolean | string[];
|
|
150
|
+
cacheFrom?: string | null;
|
|
151
|
+
cacheTo?: string | null;
|
|
152
|
+
}): Promise<TreeObject>;
|
|
153
|
+
getLens(name: string): Lens;
|
|
154
|
+
async getLenses(): Promise<Map<string, Lens>>;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export class Source extends Configurable {
|
|
158
|
+
constructor(options: SourceOptions);
|
|
159
|
+
|
|
160
|
+
name: string;
|
|
161
|
+
holosourceName: string;
|
|
162
|
+
holobranchName: string | null;
|
|
163
|
+
|
|
164
|
+
getKind(): 'holosource';
|
|
165
|
+
getConfigPath(): string;
|
|
166
|
+
async getSpec(): Promise<{ hash: string; ref: string; data: any }>;
|
|
167
|
+
async getCachedSpec(): Promise<{ hash: string; ref: string; data: any }>;
|
|
168
|
+
async queryRef(): Promise<{ hash: string; ref: string } | null>;
|
|
169
|
+
async hashWorkTree(): Promise<string | null>;
|
|
170
|
+
async getOutputTree(options?: {
|
|
171
|
+
working?: boolean | null;
|
|
172
|
+
fetch?: boolean | string[];
|
|
173
|
+
cacheFrom?: string | null;
|
|
174
|
+
cacheTo?: string | null;
|
|
175
|
+
}): Promise<string>;
|
|
176
|
+
async getHead(options?: { required?: boolean; working?: boolean | null }): Promise<string | null>;
|
|
177
|
+
async getCachedHead(): Promise<string | null>;
|
|
178
|
+
async getBranch(): Promise<string | null>;
|
|
179
|
+
async fetch(options?: { depth?: number; unshallow?: boolean | null }, ...refs: string[]): Promise<{ refs: string[] }>;
|
|
180
|
+
async checkout(options?: { submodule?: boolean }): Promise<{
|
|
181
|
+
path: string;
|
|
182
|
+
head: string;
|
|
183
|
+
branch: string | null;
|
|
184
|
+
url: string;
|
|
185
|
+
ref: string;
|
|
186
|
+
submodule: boolean;
|
|
187
|
+
}>;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export class Lens extends Configurable {
|
|
191
|
+
constructor(options: LensOptions);
|
|
192
|
+
|
|
193
|
+
name: string;
|
|
194
|
+
path: string;
|
|
195
|
+
|
|
196
|
+
getKind(): 'hololens';
|
|
197
|
+
getConfigPath(): string;
|
|
198
|
+
async buildInputTree(inputRoot?: TreeObject): Promise<TreeObject>;
|
|
199
|
+
async buildSpec(inputTree: TreeObject): Promise<{
|
|
200
|
+
hash: string;
|
|
201
|
+
ref: string;
|
|
202
|
+
data: any;
|
|
203
|
+
}>;
|
|
204
|
+
async executeSpec(specHash: string, options: {
|
|
205
|
+
refresh?: boolean;
|
|
206
|
+
save?: boolean;
|
|
207
|
+
repo?: Repo | null;
|
|
208
|
+
cacheFrom?: string | null;
|
|
209
|
+
cacheTo?: string | null;
|
|
210
|
+
}): Promise<string>;
|
|
211
|
+
|
|
212
|
+
static async executeSpec(specHash: string, options: {
|
|
213
|
+
refresh?: boolean;
|
|
214
|
+
save?: boolean;
|
|
215
|
+
repo?: Repo | null;
|
|
216
|
+
cacheFrom?: string | null;
|
|
217
|
+
cacheTo?: string | null;
|
|
218
|
+
}): Promise<string>;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export class Workspace extends Configurable {
|
|
222
|
+
constructor(options: WorkspaceOptions);
|
|
223
|
+
|
|
224
|
+
root: TreeObject;
|
|
225
|
+
|
|
226
|
+
getWorkspace(): Workspace;
|
|
227
|
+
getKind(): 'holospace';
|
|
228
|
+
getConfigPath(): string;
|
|
229
|
+
async writeWorkingChanges(): Promise<void>;
|
|
230
|
+
getBranch(name: string): Branch;
|
|
231
|
+
async getBranches(): Promise<Map<string, Branch>>;
|
|
232
|
+
getSource(name: string): Source;
|
|
233
|
+
async getSources(): Promise<Map<string, Source>>;
|
|
234
|
+
async getLayers(): Promise<Map<string, Map<string, Mapping>>>;
|
|
235
|
+
getLens(name: string): Lens;
|
|
236
|
+
async getLenses(): Promise<Map<string, Lens>>;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export class Repo {
|
|
240
|
+
static async getFromEnvironment(options?: { ref?: string; working?: boolean }): Promise<Repo>;
|
|
241
|
+
|
|
242
|
+
constructor(options: RepoOptions);
|
|
243
|
+
|
|
244
|
+
gitDir: string;
|
|
245
|
+
ref: string;
|
|
246
|
+
workTree: string | null;
|
|
247
|
+
|
|
248
|
+
async getWorkspace(): Promise<Workspace>;
|
|
249
|
+
async createWorkspaceFromRef(ref: string): Promise<Workspace>;
|
|
250
|
+
async createWorkspaceFromTreeHash(hash: string): Promise<Workspace>;
|
|
251
|
+
async getGit(): Promise<GitClient>;
|
|
252
|
+
async resolveRef(ref?: string | null): Promise<string | null>;
|
|
253
|
+
createBlob(options: GitObjectOptions): BlobObject;
|
|
254
|
+
async writeBlob(content: string): Promise<BlobObject>;
|
|
255
|
+
async writeBlobFromFile(filePath: string): Promise<BlobObject>;
|
|
256
|
+
createTree(options?: { hash?: string; parent?: TreeObject | null }): TreeObject;
|
|
257
|
+
async createTreeFromRef(ref: string): Promise<TreeObject>;
|
|
258
|
+
createCommit(options: GitObjectOptions): CommitObject;
|
|
259
|
+
async hasCommit(commit: string): Promise<boolean>;
|
|
260
|
+
async hashWorkTree(): Promise<string>;
|
|
261
|
+
async watch(options: { callback: (treeHash: string, commitHash?: string) => void }): Promise<{
|
|
262
|
+
watching: Promise<void>;
|
|
263
|
+
cancel: () => void;
|
|
264
|
+
}>;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export class Projection {
|
|
268
|
+
static async projectBranch(branch: Branch, options?: ProjectionOptions): Promise<string>;
|
|
269
|
+
|
|
270
|
+
constructor(options: { branch: Branch });
|
|
271
|
+
|
|
272
|
+
branch: Branch;
|
|
273
|
+
workspace: Workspace;
|
|
274
|
+
output: Workspace;
|
|
275
|
+
|
|
276
|
+
async composite(options: {
|
|
277
|
+
fetch?: boolean | string[];
|
|
278
|
+
cacheFrom?: string | null;
|
|
279
|
+
cacheTo?: string | null;
|
|
280
|
+
}): Promise<void>;
|
|
281
|
+
async lens(options: {
|
|
282
|
+
cacheFrom?: string | null;
|
|
283
|
+
cacheTo?: string | null;
|
|
284
|
+
}): Promise<void>;
|
|
285
|
+
async commit(ref: string, options?: {
|
|
286
|
+
parentCommit?: string | null;
|
|
287
|
+
commitMessage?: string | null;
|
|
288
|
+
}): Promise<string>;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export class Studio {
|
|
292
|
+
static async cleanup(): Promise<void>;
|
|
293
|
+
static async getHab(): Promise<any>;
|
|
294
|
+
static async getDocker(): Promise<Docker>;
|
|
295
|
+
static async isEnvironmentStudio(): Promise<boolean>;
|
|
296
|
+
static async get(gitDir: string): Promise<Studio>;
|
|
297
|
+
|
|
298
|
+
constructor(options: { gitDir: string; container: any });
|
|
299
|
+
|
|
300
|
+
container: any;
|
|
301
|
+
gitDir: string;
|
|
302
|
+
|
|
303
|
+
isLocal(): boolean;
|
|
304
|
+
async habExec(...command: any[]): Promise<string>;
|
|
305
|
+
async habPkgExec(pkg: string, bin: string, ...args: any[]): Promise<string>;
|
|
306
|
+
async holoExec(...command: any[]): Promise<string>;
|
|
307
|
+
async holoLensExec(spec: string): Promise<string>;
|
|
308
|
+
async getPackage(query: string, options?: { install?: boolean }): Promise<string | null>;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
export class Mapping extends Configurable {
|
|
312
|
+
constructor(options: { branch: Branch; key: string });
|
|
313
|
+
|
|
314
|
+
branch: Branch;
|
|
315
|
+
key: string;
|
|
316
|
+
|
|
317
|
+
getWorkspace(): Workspace;
|
|
318
|
+
getKind(): 'holomapping';
|
|
319
|
+
getConfigPath(): string;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
export class SpecObject extends BlobObject {
|
|
323
|
+
static async write(repo: Repo, kind: string, data: any): Promise<{
|
|
324
|
+
hash: string;
|
|
325
|
+
ref: string;
|
|
326
|
+
}>;
|
|
327
|
+
static buildRef(kind: string, hash: string): string;
|
|
328
|
+
|
|
329
|
+
isSpec: boolean;
|
|
330
|
+
}
|
|
331
|
+
}
|