@ibgib/vcs-gib 0.0.6
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 +94 -0
- package/VCS_CLI_USER_GUIDE.md +198 -0
- package/dist/AUTO-GENERATED-version.d.mts +6 -0
- package/dist/AUTO-GENERATED-version.d.mts.map +1 -0
- package/dist/AUTO-GENERATED-version.mjs +6 -0
- package/dist/AUTO-GENERATED-version.mjs.map +1 -0
- package/dist/assumptions.respec.d.mts +2 -0
- package/dist/assumptions.respec.d.mts.map +1 -0
- package/dist/assumptions.respec.mjs +41 -0
- package/dist/assumptions.respec.mjs.map +1 -0
- package/dist/bootstrap/node-bootstrap.d.mts +35 -0
- package/dist/bootstrap/node-bootstrap.d.mts.map +1 -0
- package/dist/bootstrap/node-bootstrap.mjs +165 -0
- package/dist/bootstrap/node-bootstrap.mjs.map +1 -0
- package/dist/bootstrap/node-bootstrap.respec.node.d.mts +7 -0
- package/dist/bootstrap/node-bootstrap.respec.node.d.mts.map +1 -0
- package/dist/bootstrap/node-bootstrap.respec.node.mjs +28 -0
- package/dist/bootstrap/node-bootstrap.respec.node.mjs.map +1 -0
- package/dist/cli/cli-arg-parser.d.mts +27 -0
- package/dist/cli/cli-arg-parser.d.mts.map +1 -0
- package/dist/cli/cli-arg-parser.mjs +96 -0
- package/dist/cli/cli-arg-parser.mjs.map +1 -0
- package/dist/cli/cli-arg-parser.respec.node.d.mts +7 -0
- package/dist/cli/cli-arg-parser.respec.node.d.mts.map +1 -0
- package/dist/cli/cli-arg-parser.respec.node.mjs +35 -0
- package/dist/cli/cli-arg-parser.respec.node.mjs.map +1 -0
- package/dist/cli/cli-constants.d.mts +26 -0
- package/dist/cli/cli-constants.d.mts.map +1 -0
- package/dist/cli/cli-constants.mjs +67 -0
- package/dist/cli/cli-constants.mjs.map +1 -0
- package/dist/cli/cli-e2e.respec.node.d.mts +8 -0
- package/dist/cli/cli-e2e.respec.node.d.mts.map +1 -0
- package/dist/cli/cli-e2e.respec.node.mjs +263 -0
- package/dist/cli/cli-e2e.respec.node.mjs.map +1 -0
- package/dist/cli/commands/add-cmd.d.mts +20 -0
- package/dist/cli/commands/add-cmd.d.mts.map +1 -0
- package/dist/cli/commands/add-cmd.mjs +333 -0
- package/dist/cli/commands/add-cmd.mjs.map +1 -0
- package/dist/cli/commands/branch-checkout-cmd.respec.node.d.mts +7 -0
- package/dist/cli/commands/branch-checkout-cmd.respec.node.d.mts.map +1 -0
- package/dist/cli/commands/branch-checkout-cmd.respec.node.mjs +288 -0
- package/dist/cli/commands/branch-checkout-cmd.respec.node.mjs.map +1 -0
- package/dist/cli/commands/branch-cmd.d.mts +25 -0
- package/dist/cli/commands/branch-cmd.d.mts.map +1 -0
- package/dist/cli/commands/branch-cmd.mjs +187 -0
- package/dist/cli/commands/branch-cmd.mjs.map +1 -0
- package/dist/cli/commands/checkout-cmd.d.mts +21 -0
- package/dist/cli/commands/checkout-cmd.d.mts.map +1 -0
- package/dist/cli/commands/checkout-cmd.mjs +154 -0
- package/dist/cli/commands/checkout-cmd.mjs.map +1 -0
- package/dist/cli/commands/commit-cmd.d.mts +23 -0
- package/dist/cli/commands/commit-cmd.d.mts.map +1 -0
- package/dist/cli/commands/commit-cmd.mjs +326 -0
- package/dist/cli/commands/commit-cmd.mjs.map +1 -0
- package/dist/cli/commands/commit-log-cmd.respec.node.d.mts +7 -0
- package/dist/cli/commands/commit-log-cmd.respec.node.d.mts.map +1 -0
- package/dist/cli/commands/commit-log-cmd.respec.node.mjs +251 -0
- package/dist/cli/commands/commit-log-cmd.respec.node.mjs.map +1 -0
- package/dist/cli/commands/init-cmd.d.mts +20 -0
- package/dist/cli/commands/init-cmd.d.mts.map +1 -0
- package/dist/cli/commands/init-cmd.mjs +119 -0
- package/dist/cli/commands/init-cmd.mjs.map +1 -0
- package/dist/cli/commands/init-cmd.respec.node.d.mts +7 -0
- package/dist/cli/commands/init-cmd.respec.node.d.mts.map +1 -0
- package/dist/cli/commands/init-cmd.respec.node.mjs +40 -0
- package/dist/cli/commands/init-cmd.respec.node.mjs.map +1 -0
- package/dist/cli/commands/log-cmd.d.mts +27 -0
- package/dist/cli/commands/log-cmd.d.mts.map +1 -0
- package/dist/cli/commands/log-cmd.mjs +146 -0
- package/dist/cli/commands/log-cmd.mjs.map +1 -0
- package/dist/cli/commands/status-add-cmd.respec.node.d.mts +7 -0
- package/dist/cli/commands/status-add-cmd.respec.node.d.mts.map +1 -0
- package/dist/cli/commands/status-add-cmd.respec.node.mjs +215 -0
- package/dist/cli/commands/status-add-cmd.respec.node.mjs.map +1 -0
- package/dist/cli/commands/status-cmd.d.mts +25 -0
- package/dist/cli/commands/status-cmd.d.mts.map +1 -0
- package/dist/cli/commands/status-cmd.mjs +286 -0
- package/dist/cli/commands/status-cmd.mjs.map +1 -0
- package/dist/cli/vcs-cli-main.d.mts +14 -0
- package/dist/cli/vcs-cli-main.d.mts.map +1 -0
- package/dist/cli/vcs-cli-main.mjs +136 -0
- package/dist/cli/vcs-cli-main.mjs.map +1 -0
- package/dist/engine/branch/branch-graph-helper.d.mts +19 -0
- package/dist/engine/branch/branch-graph-helper.d.mts.map +1 -0
- package/dist/engine/branch/branch-graph-helper.mjs +49 -0
- package/dist/engine/branch/branch-graph-helper.mjs.map +1 -0
- package/dist/engine/branch/branch-helper.d.mts +26 -0
- package/dist/engine/branch/branch-helper.d.mts.map +1 -0
- package/dist/engine/branch/branch-helper.mjs +57 -0
- package/dist/engine/branch/branch-helper.mjs.map +1 -0
- package/dist/engine/branch/branch-space-helper.d.mts +22 -0
- package/dist/engine/branch/branch-space-helper.d.mts.map +1 -0
- package/dist/engine/branch/branch-space-helper.mjs +77 -0
- package/dist/engine/branch/branch-space-helper.mjs.map +1 -0
- package/dist/engine/branch/branch-space.respec.node.d.mts +8 -0
- package/dist/engine/branch/branch-space.respec.node.d.mts.map +1 -0
- package/dist/engine/branch/branch-space.respec.node.mjs +138 -0
- package/dist/engine/branch/branch-space.respec.node.mjs.map +1 -0
- package/dist/engine/branch/branch-types.d.mts +26 -0
- package/dist/engine/branch/branch-types.d.mts.map +1 -0
- package/dist/engine/branch/branch-types.mjs +7 -0
- package/dist/engine/branch/branch-types.mjs.map +1 -0
- package/dist/engine/diff/line-diff-helper.d.mts +76 -0
- package/dist/engine/diff/line-diff-helper.d.mts.map +1 -0
- package/dist/engine/diff/line-diff-helper.mjs +144 -0
- package/dist/engine/diff/line-diff-helper.mjs.map +1 -0
- package/dist/engine/diff/line-diff-helper.respec.node.d.mts +7 -0
- package/dist/engine/diff/line-diff-helper.respec.node.d.mts.map +1 -0
- package/dist/engine/diff/line-diff-helper.respec.node.mjs +66 -0
- package/dist/engine/diff/line-diff-helper.respec.node.mjs.map +1 -0
- package/dist/engine/filter/glob-helper.d.mts +51 -0
- package/dist/engine/filter/glob-helper.d.mts.map +1 -0
- package/dist/engine/filter/glob-helper.mjs +132 -0
- package/dist/engine/filter/glob-helper.mjs.map +1 -0
- package/dist/engine/filter/glob-helper.respec.node.d.mts +7 -0
- package/dist/engine/filter/glob-helper.respec.node.d.mts.map +1 -0
- package/dist/engine/filter/glob-helper.respec.node.mjs +78 -0
- package/dist/engine/filter/glob-helper.respec.node.mjs.map +1 -0
- package/dist/engine/index/index-helper.d.mts +78 -0
- package/dist/engine/index/index-helper.d.mts.map +1 -0
- package/dist/engine/index/index-helper.mjs +289 -0
- package/dist/engine/index/index-helper.mjs.map +1 -0
- package/dist/engine/index/index-types.d.mts +63 -0
- package/dist/engine/index/index-types.d.mts.map +1 -0
- package/dist/engine/index/index-types.mjs +7 -0
- package/dist/engine/index/index-types.mjs.map +1 -0
- package/dist/engine/item/item-atom-helper.d.mts +20 -0
- package/dist/engine/item/item-atom-helper.d.mts.map +1 -0
- package/dist/engine/item/item-atom-helper.mjs +30 -0
- package/dist/engine/item/item-atom-helper.mjs.map +1 -0
- package/dist/engine/item/item-helper.d.mts +37 -0
- package/dist/engine/item/item-helper.d.mts.map +1 -0
- package/dist/engine/item/item-helper.mjs +194 -0
- package/dist/engine/item/item-helper.mjs.map +1 -0
- package/dist/engine/item/item-types.d.mts +127 -0
- package/dist/engine/item/item-types.d.mts.map +1 -0
- package/dist/engine/item/item-types.mjs +16 -0
- package/dist/engine/item/item-types.mjs.map +1 -0
- package/dist/index.d.mts +7 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +7 -0
- package/dist/index.mjs.map +1 -0
- package/dist/respec-gib.node.d.mts +7 -0
- package/dist/respec-gib.node.d.mts.map +1 -0
- package/dist/respec-gib.node.mjs +11 -0
- package/dist/respec-gib.node.mjs.map +1 -0
- package/dist/vcs-gib-constants.d.mts +7 -0
- package/dist/vcs-gib-constants.d.mts.map +1 -0
- package/dist/vcs-gib-constants.mjs +7 -0
- package/dist/vcs-gib-constants.mjs.map +1 -0
- package/dist/vcs-gib.respec.node.d.mts +8 -0
- package/dist/vcs-gib.respec.node.d.mts.map +1 -0
- package/dist/vcs-gib.respec.node.mjs +82 -0
- package/dist/vcs-gib.respec.node.mjs.map +1 -0
- package/generate-version-file.js +20 -0
- package/package.json +28 -0
- package/src/AUTO-GENERATED-version.mts +5 -0
- package/src/assumptions.respec.mts +50 -0
- package/src/bootstrap/node-bootstrap.mts +198 -0
- package/src/bootstrap/node-bootstrap.respec.node.mts +35 -0
- package/src/cli/cli-arg-parser.mts +119 -0
- package/src/cli/cli-arg-parser.respec.node.mts +45 -0
- package/src/cli/cli-constants.mts +77 -0
- package/src/cli/cli-e2e.respec.node.mts +318 -0
- package/src/cli/commands/add-cmd.mts +415 -0
- package/src/cli/commands/branch-checkout-cmd.respec.node.mts +322 -0
- package/src/cli/commands/branch-cmd.mts +243 -0
- package/src/cli/commands/checkout-cmd.mts +202 -0
- package/src/cli/commands/commit-cmd.mts +421 -0
- package/src/cli/commands/commit-log-cmd.respec.node.mts +276 -0
- package/src/cli/commands/init-cmd.mts +152 -0
- package/src/cli/commands/init-cmd.respec.node.mts +49 -0
- package/src/cli/commands/log-cmd.mts +197 -0
- package/src/cli/commands/status-add-cmd.respec.node.mts +246 -0
- package/src/cli/commands/status-cmd.mts +366 -0
- package/src/cli/vcs-cli-main.mts +153 -0
- package/src/engine/branch/branch-graph-helper.mts +69 -0
- package/src/engine/branch/branch-helper.mts +79 -0
- package/src/engine/branch/branch-space-helper.mts +104 -0
- package/src/engine/branch/branch-space.respec.node.mts +158 -0
- package/src/engine/branch/branch-types.mts +29 -0
- package/src/engine/diff/line-diff-helper.mts +210 -0
- package/src/engine/diff/line-diff-helper.respec.node.mts +84 -0
- package/src/engine/filter/glob-helper.mts +165 -0
- package/src/engine/filter/glob-helper.respec.node.mts +94 -0
- package/src/engine/index/index-helper.mts +378 -0
- package/src/engine/index/index-types.mts +66 -0
- package/src/engine/item/item-atom-helper.mts +30 -0
- package/src/engine/item/item-helper.mts +239 -0
- package/src/engine/item/item-types.mts +136 -0
- package/src/index.mts +7 -0
- package/src/respec-gib.node.mts +12 -0
- package/src/vcs-gib-constants.mts +7 -0
- package/src/vcs-gib.respec.node.mts +96 -0
- package/test_runs/001-hello-node/20260728_090100_0001-flow-core-main.md +39 -0
- package/test_runs/001-hello-node/20260728_090200_0003-flow-branching-worktree.md +54 -0
- package/test_runs/001-hello-node/20260728_090300_0002-flow-selective-add.md +45 -0
- package/test_runs/001-hello-node/20260728_142100_0007-flow-edge-cases.md +44 -0
- package/test_runs/001-hello-node/20260728_142400_0005-flow-hardcoded-ignores.md +36 -0
- package/tools/pack-for-test.mjs +73 -0
- package/tsconfig.json +18 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* @module vcs-cli-main
|
|
4
|
+
*
|
|
5
|
+
* Executable CLI entry point for the `vcs` command line interface.
|
|
6
|
+
* Parses command line arguments and dispatches execution to subcommand handlers.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { extractErrorMsg } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs';
|
|
10
|
+
|
|
11
|
+
import { parseVcsArgs } from './cli-arg-parser.mjs';
|
|
12
|
+
import { VCS_SUBCOMMANDS } from './cli-constants.mjs';
|
|
13
|
+
import { executeInitCmd } from './commands/init-cmd.mjs';
|
|
14
|
+
import { executeStatusCmd } from './commands/status-cmd.mjs';
|
|
15
|
+
import { executeAddCmd } from './commands/add-cmd.mjs';
|
|
16
|
+
import { executeCommitCmd } from './commands/commit-cmd.mjs';
|
|
17
|
+
import { executeLogCmd } from './commands/log-cmd.mjs';
|
|
18
|
+
import { executeBranchCmd } from './commands/branch-cmd.mjs';
|
|
19
|
+
import { executeCheckoutCmd } from './commands/checkout-cmd.mjs';
|
|
20
|
+
import { AUTO_GENERATED_VERSION } from '../AUTO-GENERATED-version.mjs';
|
|
21
|
+
import { GLOBAL_LOG_A_LOT } from '../vcs-gib-constants.mjs';
|
|
22
|
+
|
|
23
|
+
const lcFile = `[vcs-cli-main]`;
|
|
24
|
+
const logalot = GLOBAL_LOG_A_LOT;
|
|
25
|
+
|
|
26
|
+
export interface MainOptions {
|
|
27
|
+
argv?: string[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function showHelp(): void {
|
|
31
|
+
const helpText = `
|
|
32
|
+
vcs - Decentralized Version Control System (ibgib)
|
|
33
|
+
|
|
34
|
+
Usage:
|
|
35
|
+
vcs <command> [options] [arguments]
|
|
36
|
+
|
|
37
|
+
Commands:
|
|
38
|
+
init [dir] Initialize a new ibgib repository
|
|
39
|
+
status Show repository working tree status
|
|
40
|
+
add <path...> Stage file/folder changes (-a, --all to stage all)
|
|
41
|
+
commit -m "message" Record snapshot changes to the repository
|
|
42
|
+
log Show commit logs
|
|
43
|
+
branch [name] List or create branches
|
|
44
|
+
checkout <branch> Switch to a specified branch and project worktree
|
|
45
|
+
|
|
46
|
+
Flags:
|
|
47
|
+
-h, --help Show help information
|
|
48
|
+
-v, --version Show version information
|
|
49
|
+
-m <message> Commit message
|
|
50
|
+
-b <branch> Target branch name
|
|
51
|
+
-a, --all Stage all tracked/untracked files (for add)
|
|
52
|
+
-f, --force Force operation execution
|
|
53
|
+
`;
|
|
54
|
+
console.log(helpText.trim());
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function showVersion(): void {
|
|
58
|
+
console.log(`@ibgib/vcs-gib v${AUTO_GENERATED_VERSION}`);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export async function main({
|
|
62
|
+
argv = process.argv.slice(2),
|
|
63
|
+
}: MainOptions = {}): Promise<number> {
|
|
64
|
+
const lc = `${lcFile}[${main.name}]`;
|
|
65
|
+
try {
|
|
66
|
+
if (logalot) {
|
|
67
|
+
console.log(`${lc} starting... (I: 4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d)`);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const parsed = parseVcsArgs(argv);
|
|
71
|
+
|
|
72
|
+
if (parsed.flags.help) {
|
|
73
|
+
showHelp();
|
|
74
|
+
return 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
switch (parsed.command) {
|
|
78
|
+
case VCS_SUBCOMMANDS.INIT: {
|
|
79
|
+
const targetDir = parsed.positionals[0] || process.cwd();
|
|
80
|
+
await executeInitCmd({ targetDir });
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
case VCS_SUBCOMMANDS.STATUS: {
|
|
84
|
+
const targetDir = parsed.positionals[0] || process.cwd();
|
|
85
|
+
await executeStatusCmd({ targetDir });
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
case VCS_SUBCOMMANDS.ADD: {
|
|
89
|
+
await executeAddCmd({
|
|
90
|
+
paths: parsed.positionals,
|
|
91
|
+
all: parsed.flags.all,
|
|
92
|
+
});
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
case VCS_SUBCOMMANDS.COMMIT: {
|
|
96
|
+
await executeCommitCmd({
|
|
97
|
+
message: parsed.flags.message,
|
|
98
|
+
});
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
case VCS_SUBCOMMANDS.LOG: {
|
|
102
|
+
const targetDir = parsed.positionals[0] || process.cwd();
|
|
103
|
+
await executeLogCmd({ targetDir });
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
case VCS_SUBCOMMANDS.BRANCH: {
|
|
107
|
+
const branchName = parsed.positionals[0] || parsed.flags.branchName;
|
|
108
|
+
await executeBranchCmd({ branchName });
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
case VCS_SUBCOMMANDS.CHECKOUT: {
|
|
112
|
+
const branchName = parsed.positionals[0] || parsed.flags.branchName;
|
|
113
|
+
await executeCheckoutCmd({ branchName });
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
case VCS_SUBCOMMANDS.VERSION: {
|
|
117
|
+
showVersion();
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
case VCS_SUBCOMMANDS.HELP:
|
|
121
|
+
default: {
|
|
122
|
+
showHelp();
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return 0;
|
|
128
|
+
} catch (error) {
|
|
129
|
+
console.error(`Error: ${extractErrorMsg(error)} (E: 8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c)`);
|
|
130
|
+
return 1;
|
|
131
|
+
} finally {
|
|
132
|
+
if (logalot) {
|
|
133
|
+
console.log(`${lc} complete. (I: 9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c)`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Auto-run if executed directly as entry script
|
|
139
|
+
const isMainScript = process.argv[1] && (
|
|
140
|
+
process.argv[1].endsWith('vcs-cli-main.mjs') ||
|
|
141
|
+
process.argv[1].endsWith('vcs-cli-main.mts') ||
|
|
142
|
+
process.argv[1].endsWith('vcs')
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
if (isMainScript) {
|
|
146
|
+
main().then((code) => {
|
|
147
|
+
if (code !== 0) {
|
|
148
|
+
process.exit(code);
|
|
149
|
+
}
|
|
150
|
+
}).catch(() => {
|
|
151
|
+
process.exit(1);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module branch-graph-helper
|
|
3
|
+
*
|
|
4
|
+
* Helper for extracting dependency graphs and populating branch spaces.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { extractErrorMsg } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs';
|
|
8
|
+
import { IbGib_V1 } from '@ibgib/ts-gib/dist/V1/types.mjs';
|
|
9
|
+
import { getDependencyGraph } from '@ibgib/core-gib/dist/common/other/graph-helper.mjs';
|
|
10
|
+
import { IbGibSpaceAny } from '@ibgib/core-gib/dist/witness/space/space-base-v1.mjs';
|
|
11
|
+
import { putInSpace } from '@ibgib/core-gib/dist/witness/space/space-helper.mjs';
|
|
12
|
+
import { MetaspaceService } from '@ibgib/core-gib/dist/witness/space/metaspace/metaspace-types.mjs';
|
|
13
|
+
|
|
14
|
+
import { GLOBAL_LOG_A_LOT } from '../../vcs-gib-constants.mjs';
|
|
15
|
+
|
|
16
|
+
const lcFile = `[branch-graph-helper]`;
|
|
17
|
+
const logalot = GLOBAL_LOG_A_LOT;
|
|
18
|
+
|
|
19
|
+
export interface PopulateBranchSpaceFromGraphOpts {
|
|
20
|
+
sourceSpace: IbGibSpaceAny;
|
|
21
|
+
targetBranchSpace: IbGibSpaceAny;
|
|
22
|
+
rootItemIbGib: IbGib_V1;
|
|
23
|
+
metaspace?: MetaspaceService;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Extracts the live dependency graph of rootItemIbGib from sourceSpace and persists all ibgibs into targetBranchSpace.
|
|
28
|
+
*/
|
|
29
|
+
export async function populateBranchSpaceFromGraph({
|
|
30
|
+
sourceSpace,
|
|
31
|
+
targetBranchSpace,
|
|
32
|
+
rootItemIbGib,
|
|
33
|
+
metaspace,
|
|
34
|
+
}: PopulateBranchSpaceFromGraphOpts): Promise<void> {
|
|
35
|
+
const lc = `${lcFile}[${populateBranchSpaceFromGraph.name}]`;
|
|
36
|
+
try {
|
|
37
|
+
if (logalot) {
|
|
38
|
+
console.log(`${lc} starting... (I: 1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d)`);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (!sourceSpace || !targetBranchSpace || !rootItemIbGib) {
|
|
42
|
+
throw new Error(`sourceSpace, targetBranchSpace, and rootItemIbGib are required (E: 2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e)`);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const graph = await getDependencyGraph({
|
|
46
|
+
ibGib: rootItemIbGib,
|
|
47
|
+
space: sourceSpace,
|
|
48
|
+
live: true,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
for (const [addr, ibGib] of Object.entries(graph)) {
|
|
52
|
+
await putInSpace({ space: targetBranchSpace, ibGib });
|
|
53
|
+
if (metaspace) {
|
|
54
|
+
await metaspace.registerNewIbGib({ ibGib, space: targetBranchSpace });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (logalot) {
|
|
59
|
+
console.log(`${lc} Populated target branch space with ${Object.keys(graph).length} ibgibs (I: 3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f)`);
|
|
60
|
+
}
|
|
61
|
+
} catch (error) {
|
|
62
|
+
console.error(`${lc} ${extractErrorMsg(error)} (E: 4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a)`);
|
|
63
|
+
throw error;
|
|
64
|
+
} finally {
|
|
65
|
+
if (logalot) {
|
|
66
|
+
console.log(`${lc} complete. (I: 5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b)`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module branch-helper
|
|
3
|
+
*
|
|
4
|
+
* B2tFS Branch Helper functions: dedicated branch spaces (`b2s_...`), branch creation,
|
|
5
|
+
* and branch timeline tracking.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { getUUID } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs';
|
|
9
|
+
import { ROOT } from '@ibgib/ts-gib/dist/V1/constants.mjs';
|
|
10
|
+
import { getIbGibAddr } from '@ibgib/ts-gib/dist/helper.mjs';
|
|
11
|
+
import { Factory_V1 } from '@ibgib/ts-gib/dist/V1/factory.mjs';
|
|
12
|
+
import { MetaspaceService } from '@ibgib/core-gib/dist/witness/space/metaspace/metaspace-types.mjs';
|
|
13
|
+
import { IbGibSpaceAny } from '@ibgib/core-gib/dist/witness/space/space-base-v1.mjs';
|
|
14
|
+
import { putInSpace, persistTransformResult } from '@ibgib/core-gib/dist/witness/space/space-helper.mjs';
|
|
15
|
+
|
|
16
|
+
import { GLOBAL_LOG_A_LOT } from '../../vcs-gib-constants.mjs';
|
|
17
|
+
import { B2tFSBranchIbGib_V1, B2tFSBranchData_V1, B2tFSBranchRel8ns_V1 } from './branch-types.mjs';
|
|
18
|
+
import { B2tFSItemIbGib_V1 } from '../item/item-types.mjs';
|
|
19
|
+
|
|
20
|
+
const lcFile = `[branch-helper]`;
|
|
21
|
+
const logalot = GLOBAL_LOG_A_LOT;
|
|
22
|
+
|
|
23
|
+
export const B2TFS_BRANCH_SPACE_PREFIX = 'b2s_';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Generates a dedicated branch space name.
|
|
27
|
+
* Example: 'main' -> 'b2s_main'
|
|
28
|
+
*/
|
|
29
|
+
export function getB2tFSBranchSpaceName(branchName: string): string {
|
|
30
|
+
const safeName = branchName.replace(/[^a-zA-Z0-9_\-]/g, '_');
|
|
31
|
+
return `${B2TFS_BRANCH_SPACE_PREFIX}${safeName}`;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Creates a new B2tFSBranchIbGib pointing to a root folder item.
|
|
36
|
+
*/
|
|
37
|
+
export async function createB2tFSBranchIbGib(opts: {
|
|
38
|
+
branchName: string;
|
|
39
|
+
rootItem: B2tFSItemIbGib_V1;
|
|
40
|
+
space: IbGibSpaceAny;
|
|
41
|
+
metaspace: MetaspaceService;
|
|
42
|
+
}): Promise<B2tFSBranchIbGib_V1> {
|
|
43
|
+
const lc = `${lcFile}[${createB2tFSBranchIbGib.name}]`;
|
|
44
|
+
const { branchName, rootItem, space, metaspace } = opts;
|
|
45
|
+
|
|
46
|
+
if (!branchName || !rootItem) {
|
|
47
|
+
throw new Error(`branchName and rootItem required (E: 9012a472c9104b2d)`);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const uuid = await getUUID();
|
|
51
|
+
const rootAddr = getIbGibAddr({ ibGib: rootItem });
|
|
52
|
+
|
|
53
|
+
const data: B2tFSBranchData_V1 = {
|
|
54
|
+
name: branchName,
|
|
55
|
+
uuid,
|
|
56
|
+
classname: 'B2tFSBranchIbGib_V1',
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const rel8ns: B2tFSBranchRel8ns_V1 = {
|
|
60
|
+
b2tfs_item: [rootAddr],
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const res = await Factory_V1.firstGen({
|
|
64
|
+
parentIbGib: ROOT,
|
|
65
|
+
ib: `b2tfs_branch ${branchName} v1 ${uuid}`,
|
|
66
|
+
data,
|
|
67
|
+
rel8ns,
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const branchIbGib = res.newIbGib as B2tFSBranchIbGib_V1;
|
|
71
|
+
await persistTransformResult({ resTransform: res, space });
|
|
72
|
+
await metaspace.registerNewIbGib({ ibGib: branchIbGib });
|
|
73
|
+
|
|
74
|
+
if (logalot) {
|
|
75
|
+
console.log(`${lc} Created branch IbGib: ${branchIbGib.ib}`);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return branchIbGib;
|
|
79
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module branch-space-helper
|
|
3
|
+
*
|
|
4
|
+
* Helper for managing dedicated branch spaces (`b2s_...`) in metaspace.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { clone, extractErrorMsg, getUUID } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs';
|
|
8
|
+
import { getGib } from '@ibgib/ts-gib/dist/V1/transforms/transform-helper.mjs';
|
|
9
|
+
import { Metaspace_Nodespace } from '@ibgib/node-gib/dist/witness/space/metaspace/metaspace-nodespace/metaspace-nodespace.mjs';
|
|
10
|
+
import { NodeFilesystemSpace_V1 } from '@ibgib/node-gib/dist/witness/space/node-filesystem-space/node-filesystem-space-v1.mjs';
|
|
11
|
+
import { DEFAULT_NODE_FILESYSTEM_SPACE_DATA_V1 } from '@ibgib/node-gib/dist/witness/space/node-filesystem-space/node-filesystem-space-types.mjs';
|
|
12
|
+
import { putInSpace } from '@ibgib/core-gib/dist/witness/space/space-helper.mjs';
|
|
13
|
+
|
|
14
|
+
import { GLOBAL_LOG_A_LOT } from '../../vcs-gib-constants.mjs';
|
|
15
|
+
import { getB2tFSBranchSpaceName } from './branch-helper.mjs';
|
|
16
|
+
|
|
17
|
+
const lcFile = `[branch-space-helper]`;
|
|
18
|
+
const logalot = GLOBAL_LOG_A_LOT;
|
|
19
|
+
|
|
20
|
+
export interface GetOrCreateBranchSpaceOpts {
|
|
21
|
+
metaspace: Metaspace_Nodespace;
|
|
22
|
+
vcsPath: string;
|
|
23
|
+
branchName: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface GetOrCreateBranchSpaceResult {
|
|
27
|
+
space: NodeFilesystemSpace_V1;
|
|
28
|
+
spaceId: string;
|
|
29
|
+
spaceName: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Gets an existing branch space or creates and registers a new dedicated NodeFilesystemSpace_V1 in metaspace.
|
|
34
|
+
*/
|
|
35
|
+
export async function getOrCreateBranchSpace({
|
|
36
|
+
metaspace,
|
|
37
|
+
vcsPath,
|
|
38
|
+
branchName,
|
|
39
|
+
}: GetOrCreateBranchSpaceOpts): Promise<GetOrCreateBranchSpaceResult> {
|
|
40
|
+
const lc = `${lcFile}[${getOrCreateBranchSpace.name}]`;
|
|
41
|
+
try {
|
|
42
|
+
if (logalot) {
|
|
43
|
+
console.log(`${lc} starting... (I: a1b2c3d4e5f60718293a4b5c6d7e8f9a)`);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (!metaspace || !vcsPath || !branchName) {
|
|
47
|
+
throw new Error(`metaspace, vcsPath, and branchName are required (E: b2c3d4e5f60718293a4b5c6d7e8f9a0b)`);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const spaceName = getB2tFSBranchSpaceName(branchName);
|
|
51
|
+
|
|
52
|
+
const localSpaces = await metaspace.getLocalUserSpaces({ lock: false });
|
|
53
|
+
const existingSpace = localSpaces.find(s => s.data?.name === spaceName || s.ib === spaceName);
|
|
54
|
+
|
|
55
|
+
if (existingSpace) {
|
|
56
|
+
const spaceId = existingSpace.data?.uuid || existingSpace.data?.spaceId || spaceName;
|
|
57
|
+
if (logalot) {
|
|
58
|
+
console.log(`${lc} Found existing branch space ${spaceName} (spaceId: ${spaceId}) (I: c3d4e5f60718293a4b5c6d7e8f9a0b1c)`);
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
space: existingSpace as NodeFilesystemSpace_V1,
|
|
62
|
+
spaceId,
|
|
63
|
+
spaceName,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const spaceUuid = await getUUID();
|
|
68
|
+
const spaceData = {
|
|
69
|
+
...clone(DEFAULT_NODE_FILESYSTEM_SPACE_DATA_V1),
|
|
70
|
+
uuid: spaceUuid,
|
|
71
|
+
isTjp: true,
|
|
72
|
+
name: spaceName,
|
|
73
|
+
baseDir: vcsPath,
|
|
74
|
+
spaceSubPath: spaceName,
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const space = new NodeFilesystemSpace_V1(spaceData);
|
|
78
|
+
space.gib = await getGib({ ibGib: space, hasTjp: true });
|
|
79
|
+
await space.initialized;
|
|
80
|
+
|
|
81
|
+
await putInSpace({ space: metaspace.zeroSpace, ibGib: space });
|
|
82
|
+
await metaspace.registerNewIbGib({ ibGib: space });
|
|
83
|
+
if (metaspace.fnUpdateBootstrap) {
|
|
84
|
+
await metaspace.fnUpdateBootstrap(space);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (logalot) {
|
|
88
|
+
console.log(`${lc} Created new branch space ${spaceName} (spaceId: ${spaceUuid}) (I: d4e5f60718293a4b5c6d7e8f9a0b1c2d)`);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return {
|
|
92
|
+
space,
|
|
93
|
+
spaceId: spaceUuid,
|
|
94
|
+
spaceName,
|
|
95
|
+
};
|
|
96
|
+
} catch (error) {
|
|
97
|
+
console.error(`${lc} ${extractErrorMsg(error)} (E: e5f60718293a4b5c6d7e8f9a0b1c2d3e)`);
|
|
98
|
+
throw error;
|
|
99
|
+
} finally {
|
|
100
|
+
if (logalot) {
|
|
101
|
+
console.log(`${lc} complete. (I: f60718293a4b5c6d7e8f9a0b1c2d3e4f)`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module branch-space.respec.node
|
|
3
|
+
*
|
|
4
|
+
* Unit tests for branch space helper, space-qualified address formatting/parsing,
|
|
5
|
+
* and graph population into branch spaces.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import path from 'node:path';
|
|
9
|
+
import fs from 'node:fs/promises';
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
respecfully, ifWe, iReckon
|
|
13
|
+
} from '@ibgib/helper-gib/dist/respec-gib/respec-gib.mjs';
|
|
14
|
+
import { ROOT } from '@ibgib/ts-gib/dist/V1/constants.mjs';
|
|
15
|
+
import { Factory_V1 } from '@ibgib/ts-gib/dist/V1/factory.mjs';
|
|
16
|
+
import { getIbGibAddr } from '@ibgib/ts-gib/dist/helper.mjs';
|
|
17
|
+
import { getFromSpace, persistTransformResult } from '@ibgib/core-gib/dist/witness/space/space-helper.mjs';
|
|
18
|
+
|
|
19
|
+
import { bootstrapVcsMetaspace } from '../../bootstrap/node-bootstrap.mjs';
|
|
20
|
+
import { getB2tFSItemIb } from '../item/item-atom-helper.mjs';
|
|
21
|
+
import { getOrCreateBranchSpace } from './branch-space-helper.mjs';
|
|
22
|
+
import { populateBranchSpaceFromGraph } from './branch-graph-helper.mjs';
|
|
23
|
+
import { getSpaceQualifiedIbGibAddr, parseSpaceQualifiedIbGibAddr } from '../index/index-helper.mjs';
|
|
24
|
+
import { B2tFSItemIbGib_V1 } from '../item/item-types.mjs';
|
|
25
|
+
|
|
26
|
+
const lc = `[apps/vcs-gib/src/engine/branch/branch-space.respec.node.mts]`;
|
|
27
|
+
|
|
28
|
+
await respecfully(lc, `Branch Space & Graph Helper Respecs`, async () => {
|
|
29
|
+
|
|
30
|
+
await respecfully(lc, `Space-Qualified Address Parsing & Formatting`, async () => {
|
|
31
|
+
await ifWe(lc, `formats space-qualified address using options object`, async () => {
|
|
32
|
+
const sq = getSpaceQualifiedIbGibAddr({ spaceId: 'sp_alpha', ibGibAddr: 'item_a^gib123' });
|
|
33
|
+
iReckon(lc, sq).willEqual('v:1^spaceId:sp_alpha^item_a^gib123');
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
await ifWe(lc, `parses space-qualified address using options object`, async () => {
|
|
37
|
+
const parsed = parseSpaceQualifiedIbGibAddr({ spaceQualifiedAddr: 'v:1^spaceId:sp_alpha^item_a^gib123' });
|
|
38
|
+
iReckon(lc, parsed).isGonnaBeTruthy();
|
|
39
|
+
iReckon(lc, parsed!.version).willEqual(1);
|
|
40
|
+
iReckon(lc, parsed!.spaceId).willEqual('sp_alpha');
|
|
41
|
+
iReckon(lc, parsed!.ibGibAddr).willEqual('item_a^gib123');
|
|
42
|
+
iReckon(lc, parsed!.ib).willEqual('item_a');
|
|
43
|
+
iReckon(lc, parsed!.gib).willEqual('gib123');
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
await ifWe(lc, `returns null for invalid space-qualified address string`, async () => {
|
|
47
|
+
const parsed = parseSpaceQualifiedIbGibAddr({ spaceQualifiedAddr: 'invalid_address_string' });
|
|
48
|
+
iReckon(lc, parsed).isGonnaBeFalsy();
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
await respecfully(lc, `Branch Space Lifecycle (getOrCreateBranchSpace)`, async () => {
|
|
53
|
+
await ifWe(lc, `creates a new dedicated branch space and retrieves existing space on second call`, async () => {
|
|
54
|
+
const testDir = path.join(process.cwd(), '.test_branch_space_repo');
|
|
55
|
+
try {
|
|
56
|
+
const { metaspace, vcsPath } = await bootstrapVcsMetaspace({
|
|
57
|
+
repoPath: testDir,
|
|
58
|
+
vcsFolderName: '.vcsgib_branch_test',
|
|
59
|
+
defaultSpaceName: 'test_space',
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const branchName = 'feature_alpha';
|
|
63
|
+
const result1 = await getOrCreateBranchSpace({
|
|
64
|
+
metaspace,
|
|
65
|
+
vcsPath,
|
|
66
|
+
branchName,
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
iReckon(lc, result1.spaceName).willEqual('b2s_feature_alpha');
|
|
70
|
+
iReckon(lc, result1.spaceId).isGonnaBeTruthy();
|
|
71
|
+
iReckon(lc, result1.space).isGonnaBeTruthy();
|
|
72
|
+
|
|
73
|
+
const result2 = await getOrCreateBranchSpace({
|
|
74
|
+
metaspace,
|
|
75
|
+
vcsPath,
|
|
76
|
+
branchName,
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
iReckon(lc, result2.spaceName).willEqual('b2s_feature_alpha');
|
|
80
|
+
iReckon(lc, result2.spaceId).willEqual(result1.spaceId);
|
|
81
|
+
} finally {
|
|
82
|
+
await fs.rm(testDir, { recursive: true, force: true });
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
await respecfully(lc, `Graph Population (populateBranchSpaceFromGraph)`, async () => {
|
|
88
|
+
await ifWe(lc, `populates target branch space with full dependency graph of root item`, async () => {
|
|
89
|
+
const testDir = path.join(process.cwd(), '.test_populate_graph_repo');
|
|
90
|
+
try {
|
|
91
|
+
const { metaspace, localSpace, vcsPath } = await bootstrapVcsMetaspace({
|
|
92
|
+
repoPath: testDir,
|
|
93
|
+
vcsFolderName: '.vcsgib_populate_test',
|
|
94
|
+
defaultSpaceName: 'test_space',
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
// Create child file item
|
|
98
|
+
const childRes = await Factory_V1.firstGen({
|
|
99
|
+
parentIbGib: ROOT,
|
|
100
|
+
ib: getB2tFSItemIb('file', 'file.txt', 'file_hash'),
|
|
101
|
+
data: {
|
|
102
|
+
name: 'file.txt',
|
|
103
|
+
nameHash: 'file_hash',
|
|
104
|
+
fsType: 'file',
|
|
105
|
+
diffTransactionId: 'tx_child',
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
const childItem = childRes.newIbGib as B2tFSItemIbGib_V1;
|
|
109
|
+
const childAddr = getIbGibAddr({ ibGib: childItem });
|
|
110
|
+
await persistTransformResult({ resTransform: childRes, space: localSpace });
|
|
111
|
+
await metaspace.registerNewIbGib({ ibGib: childItem });
|
|
112
|
+
|
|
113
|
+
// Create root folder item referencing child
|
|
114
|
+
const rootRes = await Factory_V1.firstGen({
|
|
115
|
+
parentIbGib: ROOT,
|
|
116
|
+
ib: getB2tFSItemIb('folder', 'root', 'root_hash'),
|
|
117
|
+
data: {
|
|
118
|
+
name: 'root',
|
|
119
|
+
nameHash: 'root_hash',
|
|
120
|
+
fsType: 'folder',
|
|
121
|
+
diffTransactionId: 'tx_root',
|
|
122
|
+
},
|
|
123
|
+
rel8ns: {
|
|
124
|
+
b2tfs_item: [childAddr],
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
const rootItem = rootRes.newIbGib as B2tFSItemIbGib_V1;
|
|
128
|
+
const rootAddr = getIbGibAddr({ ibGib: rootItem });
|
|
129
|
+
await persistTransformResult({ resTransform: rootRes, space: localSpace });
|
|
130
|
+
await metaspace.registerNewIbGib({ ibGib: rootItem });
|
|
131
|
+
|
|
132
|
+
// Create target branch space
|
|
133
|
+
const { space: targetBranchSpace } = await getOrCreateBranchSpace({
|
|
134
|
+
metaspace,
|
|
135
|
+
vcsPath,
|
|
136
|
+
branchName: 'main',
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
// Populate target branch space from source localSpace graph
|
|
140
|
+
await populateBranchSpaceFromGraph({
|
|
141
|
+
sourceSpace: localSpace,
|
|
142
|
+
targetBranchSpace,
|
|
143
|
+
rootItemIbGib: rootItem,
|
|
144
|
+
metaspace,
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
// Verify items exist in targetBranchSpace
|
|
148
|
+
const rootGet = await getFromSpace({ space: targetBranchSpace, addr: rootAddr });
|
|
149
|
+
iReckon(lc, rootGet).isGonnaBeTruthy();
|
|
150
|
+
|
|
151
|
+
const childGet = await getFromSpace({ space: targetBranchSpace, addr: childAddr });
|
|
152
|
+
iReckon(lc, childGet).isGonnaBeTruthy();
|
|
153
|
+
} finally {
|
|
154
|
+
await fs.rm(testDir, { recursive: true, force: true });
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module branch-types
|
|
3
|
+
*
|
|
4
|
+
* B2tFS Branch type definitions.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { IbGibAddr } from '@ibgib/ts-gib/dist/types.mjs';
|
|
8
|
+
import { IbGibData_V1, IbGibRel8ns_V1, IbGib_V1 } from '@ibgib/ts-gib/dist/V1/types.mjs';
|
|
9
|
+
|
|
10
|
+
export interface B2tFSBranchData_V1 extends IbGibData_V1 {
|
|
11
|
+
/**
|
|
12
|
+
* Branch name (e.g. 'main', 'feature/login')
|
|
13
|
+
*/
|
|
14
|
+
name: string;
|
|
15
|
+
/**
|
|
16
|
+
* Relative path from repository root to working directory
|
|
17
|
+
*/
|
|
18
|
+
relativePathFromMetaspaceToFSPath?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface B2tFSBranchRel8ns_V1 extends IbGibRel8ns_V1 {
|
|
22
|
+
/**
|
|
23
|
+
* Link pointing to the root folder B2tFSItemIbGib_V1
|
|
24
|
+
*/
|
|
25
|
+
b2tfs_item?: IbGibAddr[];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface B2tFSBranchIbGib_V1 extends IbGib_V1<B2tFSBranchData_V1, B2tFSBranchRel8ns_V1> {
|
|
29
|
+
}
|