@ibgib/vcs-gib 0.0.30 → 0.0.32
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/dist/AUTO-GENERATED-version.d.mts +1 -1
- package/dist/AUTO-GENERATED-version.mjs +1 -1
- package/dist/bootstrap/node-bootstrap.mjs +1 -1
- package/dist/bootstrap/node-bootstrap.mjs.map +1 -1
- package/dist/cli/commands/add-cmd.d.mts +2 -3
- package/dist/cli/commands/add-cmd.d.mts.map +1 -1
- package/dist/cli/commands/add-cmd.mjs +30 -283
- package/dist/cli/commands/add-cmd.mjs.map +1 -1
- package/dist/cli/commands/branch-cmd.d.mts +8 -8
- package/dist/cli/commands/branch-cmd.d.mts.map +1 -1
- package/dist/cli/commands/branch-cmd.mjs +45 -176
- package/dist/cli/commands/branch-cmd.mjs.map +1 -1
- package/dist/cli/commands/checkout-cmd.d.mts +2 -4
- package/dist/cli/commands/checkout-cmd.d.mts.map +1 -1
- package/dist/cli/commands/checkout-cmd.mjs +31 -110
- package/dist/cli/commands/checkout-cmd.mjs.map +1 -1
- package/dist/cli/commands/commit-cmd.d.mts +7 -8
- package/dist/cli/commands/commit-cmd.d.mts.map +1 -1
- package/dist/cli/commands/commit-cmd.mjs +40 -390
- package/dist/cli/commands/commit-cmd.mjs.map +1 -1
- package/dist/cli/commands/generate-comment-cmd.d.mts.map +1 -1
- package/dist/cli/commands/generate-comment-cmd.mjs +5 -2
- package/dist/cli/commands/generate-comment-cmd.mjs.map +1 -1
- package/dist/cli/commands/init-cmd.d.mts +2 -2
- package/dist/cli/commands/init-cmd.d.mts.map +1 -1
- package/dist/cli/commands/init-cmd.mjs +20 -70
- package/dist/cli/commands/init-cmd.mjs.map +1 -1
- package/dist/cli/commands/log-cmd.d.mts +2 -3
- package/dist/cli/commands/log-cmd.d.mts.map +1 -1
- package/dist/cli/commands/log-cmd.mjs +42 -271
- package/dist/cli/commands/log-cmd.mjs.map +1 -1
- package/dist/cli/commands/merge-cmd.d.mts +3 -17
- package/dist/cli/commands/merge-cmd.d.mts.map +1 -1
- package/dist/cli/commands/merge-cmd.mjs +32 -218
- package/dist/cli/commands/merge-cmd.mjs.map +1 -1
- package/dist/cli/commands/reset-cmd.d.mts +1 -1
- package/dist/cli/commands/reset-cmd.d.mts.map +1 -1
- package/dist/cli/commands/reset-cmd.mjs +17 -19
- package/dist/cli/commands/reset-cmd.mjs.map +1 -1
- package/dist/cli/commands/restore-cmd.d.mts +8 -7
- package/dist/cli/commands/restore-cmd.d.mts.map +1 -1
- package/dist/cli/commands/restore-cmd.mjs +44 -62
- package/dist/cli/commands/restore-cmd.mjs.map +1 -1
- package/dist/cli/commands/status-cmd.d.mts +2 -2
- package/dist/cli/commands/status-cmd.d.mts.map +1 -1
- package/dist/cli/commands/status-cmd.mjs +63 -62
- package/dist/cli/commands/status-cmd.mjs.map +1 -1
- package/dist/cli/vcs-projection-helper.d.mts +23 -0
- package/dist/cli/vcs-projection-helper.d.mts.map +1 -0
- package/dist/cli/vcs-projection-helper.mjs +91 -0
- package/dist/cli/vcs-projection-helper.mjs.map +1 -0
- package/dist/test/test-helpers.d.mts +2 -2
- package/dist/test/test-helpers.d.mts.map +1 -1
- package/package.json +3 -3
- package/src/AUTO-GENERATED-version.mts +1 -1
- package/src/bootstrap/node-bootstrap.mts +1 -1
- package/src/cli/cli-e2e.respec.mts +4 -4
- package/src/cli/commands/add-cmd.mts +32 -347
- package/src/cli/commands/branch-cmd.mts +56 -225
- package/src/cli/commands/checkout-cmd.mts +34 -138
- package/src/cli/commands/commit-cmd.mts +46 -473
- package/src/cli/commands/commit-log-cmd.respec.mts +11 -7
- package/src/cli/commands/generate-comment-cmd.mts +6 -2
- package/src/cli/commands/init-cmd.mts +20 -73
- package/src/cli/commands/log-cmd.mts +41 -331
- package/src/cli/commands/merge-cmd.mts +32 -252
- package/src/cli/commands/reset-cmd.mts +17 -19
- package/src/cli/commands/restore-cmd.mts +52 -72
- package/src/cli/commands/status-add-cmd.respec.mts +3 -3
- package/src/cli/commands/status-cmd.mts +68 -63
- package/src/cli/vcs-projection-helper.mts +112 -0
- package/src/engine/branch/branch-space.respec.mts +5 -5
- package/src/engine/merge/b2tfs-sync-comments.respec.mts +4 -4
- package/src/test/test-helpers.mts +2 -2
- package/src/vcs-gib.respec.mts +11 -8
- package/tsconfig.test.tsbuildinfo +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/engine/branch/branch-graph-helper.d.mts +0 -28
- package/dist/engine/branch/branch-graph-helper.d.mts.map +0 -1
- package/dist/engine/branch/branch-graph-helper.mjs +0 -81
- package/dist/engine/branch/branch-graph-helper.mjs.map +0 -1
- package/dist/engine/branch/branch-helper.d.mts +0 -40
- package/dist/engine/branch/branch-helper.d.mts.map +0 -1
- package/dist/engine/branch/branch-helper.mjs +0 -78
- package/dist/engine/branch/branch-helper.mjs.map +0 -1
- package/dist/engine/branch/branch-space-helper.d.mts +0 -23
- package/dist/engine/branch/branch-space-helper.d.mts.map +0 -1
- package/dist/engine/branch/branch-space-helper.mjs +0 -78
- package/dist/engine/branch/branch-space-helper.mjs.map +0 -1
- package/dist/engine/branch/branch-types.d.mts +0 -26
- package/dist/engine/branch/branch-types.d.mts.map +0 -1
- package/dist/engine/branch/branch-types.mjs +0 -7
- package/dist/engine/branch/branch-types.mjs.map +0 -1
- package/dist/engine/diff/line-diff-helper.d.mts +0 -76
- package/dist/engine/diff/line-diff-helper.d.mts.map +0 -1
- package/dist/engine/diff/line-diff-helper.mjs +0 -144
- package/dist/engine/diff/line-diff-helper.mjs.map +0 -1
- package/dist/engine/filter/glob-helper.d.mts +0 -51
- package/dist/engine/filter/glob-helper.d.mts.map +0 -1
- package/dist/engine/filter/glob-helper.mjs +0 -132
- package/dist/engine/filter/glob-helper.mjs.map +0 -1
- package/dist/engine/index/index-helper.d.mts +0 -113
- package/dist/engine/index/index-helper.d.mts.map +0 -1
- package/dist/engine/index/index-helper.mjs +0 -533
- package/dist/engine/index/index-helper.mjs.map +0 -1
- package/dist/engine/index/index-types.d.mts +0 -63
- package/dist/engine/index/index-types.d.mts.map +0 -1
- package/dist/engine/index/index-types.mjs +0 -7
- package/dist/engine/index/index-types.mjs.map +0 -1
- package/dist/engine/item/item-atom-helper.d.mts +0 -20
- package/dist/engine/item/item-atom-helper.d.mts.map +0 -1
- package/dist/engine/item/item-atom-helper.mjs +0 -30
- package/dist/engine/item/item-atom-helper.mjs.map +0 -1
- package/dist/engine/item/item-helper.d.mts +0 -94
- package/dist/engine/item/item-helper.d.mts.map +0 -1
- package/dist/engine/item/item-helper.mjs +0 -424
- package/dist/engine/item/item-helper.mjs.map +0 -1
- package/dist/engine/item/item-types.d.mts +0 -128
- package/dist/engine/item/item-types.d.mts.map +0 -1
- package/dist/engine/item/item-types.mjs +0 -16
- package/dist/engine/item/item-types.mjs.map +0 -1
- package/dist/engine/merge/b2tfs-3way-graft-strategy.d.mts +0 -74
- package/dist/engine/merge/b2tfs-3way-graft-strategy.d.mts.map +0 -1
- package/dist/engine/merge/b2tfs-3way-graft-strategy.mjs +0 -570
- package/dist/engine/merge/b2tfs-3way-graft-strategy.mjs.map +0 -1
- package/dist/engine/merge/b2tfs-3way-graft-types.d.mts +0 -34
- package/dist/engine/merge/b2tfs-3way-graft-types.d.mts.map +0 -1
- package/dist/engine/merge/b2tfs-3way-graft-types.mjs +0 -2
- package/dist/engine/merge/b2tfs-3way-graft-types.mjs.map +0 -1
- package/dist/engine/status/status-helper.d.mts +0 -90
- package/dist/engine/status/status-helper.d.mts.map +0 -1
- package/dist/engine/status/status-helper.mjs +0 -286
- package/dist/engine/status/status-helper.mjs.map +0 -1
- package/src/engine/branch/branch-graph-helper.mts +0 -117
- package/src/engine/branch/branch-helper.mts +0 -112
- package/src/engine/branch/branch-space-helper.mts +0 -110
- package/src/engine/branch/branch-types.mts +0 -29
- package/src/engine/diff/line-diff-helper.mts +0 -210
- package/src/engine/diff/line-diff-helper.respec.mts +0 -84
- package/src/engine/filter/glob-helper.mts +0 -165
- package/src/engine/filter/glob-helper.respec.mts +0 -94
- package/src/engine/index/index-helper.mts +0 -705
- package/src/engine/index/index-types.mts +0 -66
- package/src/engine/item/item-atom-helper.mts +0 -30
- package/src/engine/item/item-helper.mts +0 -544
- package/src/engine/item/item-types.mts +0 -137
- package/src/engine/item/item.respec.mts +0 -92
- package/src/engine/merge/b2tfs-3way-graft-strategy.mts +0 -630
- package/src/engine/merge/b2tfs-3way-graft-strategy.respec.mts +0 -346
- package/src/engine/merge/b2tfs-3way-graft-types.mts +0 -34
- package/src/engine/status/status-helper.mts +0 -383
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module status-cmd
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* CLI command handler for `vcs status`.
|
|
5
5
|
* Compares physical workspace state against active branch snapshot tip and in-band index staging area.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -9,9 +9,15 @@ import path from 'node:path';
|
|
|
9
9
|
import fs from 'node:fs/promises';
|
|
10
10
|
|
|
11
11
|
import { extractErrorMsg } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs';
|
|
12
|
+
import { executeVcsStatus } from '@ibgib/core-gib/dist/vcs/commands/status-cmd.mjs';
|
|
13
|
+
import { VcsStatusItem, PendingCommentInfo } from '@ibgib/core-gib/dist/vcs/status/status-helper.mjs';
|
|
14
|
+
import { resolveContextualBranchName } from '@ibgib/core-gib/dist/vcs/branch/branch-helper.mjs';
|
|
15
|
+
|
|
12
16
|
import { bootstrapVcsMetaspace } from '../../bootstrap/node-bootstrap.mjs';
|
|
17
|
+
import { getOrCreateBranchSpace } from '@ibgib/node-gib/dist/vcs/branch-space-helper.mjs';
|
|
18
|
+
import { getOrCreateWorkspaceProjectionSpace } from '@ibgib/node-gib/dist/vcs/workspace-space-helper.mjs';
|
|
19
|
+
import { readVcsIndexProjectionFromDisk } from '../vcs-projection-helper.mjs';
|
|
13
20
|
import { GLOBAL_LOG_A_LOT } from '../../vcs-gib-constants.mjs';
|
|
14
|
-
import { getRepoStatus, VcsStatusItem, PendingCommentInfo } from '../../engine/status/status-helper.mjs';
|
|
15
21
|
|
|
16
22
|
const lcFile = `[status-cmd]`;
|
|
17
23
|
const logalot = GLOBAL_LOG_A_LOT;
|
|
@@ -61,16 +67,35 @@ export async function executeStatusCmd({
|
|
|
61
67
|
throw new Error(`Not an ibgib repository (directory ${vcsPath} does not exist) (E: 4d5e6f7a8b9c10d11e12f13a14b15c6d)`);
|
|
62
68
|
}
|
|
63
69
|
|
|
64
|
-
const
|
|
70
|
+
const indexIbGib = await readVcsIndexProjectionFromDisk({ vcsPath, space: localSpace });
|
|
71
|
+
const branchName = resolveContextualBranchName({ targetDir: absTargetDir, repoRoot, indexIbGib });
|
|
72
|
+
const activeWorktreeDir = branchName === 'main' ? repoRoot : path.join(repoRoot, 'b', branchName);
|
|
73
|
+
|
|
74
|
+
const { space: activeBranchSpace } = await getOrCreateBranchSpace({
|
|
65
75
|
metaspace,
|
|
66
|
-
localSpace,
|
|
67
76
|
vcsPath,
|
|
77
|
+
branchName,
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
const { space: workspaceSpace } = await getOrCreateWorkspaceProjectionSpace({
|
|
81
|
+
metaspace,
|
|
82
|
+
workspaceRoot: activeWorktreeDir,
|
|
83
|
+
vcsFolderName,
|
|
84
|
+
backingSpace: activeBranchSpace,
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
const statusRes = await executeVcsStatus({
|
|
88
|
+
metaspace,
|
|
89
|
+
localSpace,
|
|
90
|
+
activeBranchSpace,
|
|
91
|
+
workspaceSpace,
|
|
92
|
+
indexIbGib,
|
|
68
93
|
repoRoot,
|
|
69
94
|
targetDir: absTargetDir,
|
|
70
95
|
vcsFolderName,
|
|
71
96
|
});
|
|
72
97
|
|
|
73
|
-
const {
|
|
98
|
+
const { staged, modified, deleted, untracked, pendingComments } = statusRes;
|
|
74
99
|
|
|
75
100
|
const commentsByTarget = new Map<string, PendingCommentInfo[]>();
|
|
76
101
|
for (const c of pendingComments) {
|
|
@@ -80,77 +105,57 @@ export async function executeStatusCmd({
|
|
|
80
105
|
}
|
|
81
106
|
|
|
82
107
|
if (!quiet) {
|
|
83
|
-
console.log(`On branch ${branchName} (I:
|
|
84
|
-
|
|
85
|
-
if (staged.length
|
|
86
|
-
console.log('
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
console.log(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
console.log(` [comment: ${comm.commentRelPath}]`);
|
|
95
|
-
const lines = comm.content.trim().split('\n');
|
|
96
|
-
for (const line of lines) {
|
|
97
|
-
console.log(` ${line}`);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
108
|
+
console.log(`On branch ${statusRes.branchName} (I: 5e6f7a8b9c10d11e12f13a14b15c16d1)`);
|
|
109
|
+
|
|
110
|
+
if (staged.length === 0 && modified.length === 0 && deleted.length === 0 && untracked.length === 0 && pendingComments.length === 0) {
|
|
111
|
+
console.log('nothing to commit, working tree clean');
|
|
112
|
+
} else {
|
|
113
|
+
if (staged.length > 0) {
|
|
114
|
+
console.log('\nChanges to be committed:');
|
|
115
|
+
console.log(' (use "vcs reset <file>..." to unstage)');
|
|
116
|
+
for (const item of staged) {
|
|
117
|
+
const typePrefix = item.fsType === 'folder' ? 'directory: ' : '';
|
|
118
|
+
console.log(`\tnew file: ${typePrefix}${item.path}`);
|
|
100
119
|
}
|
|
101
120
|
}
|
|
102
|
-
}
|
|
103
121
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
for (const line of lines) {
|
|
114
|
-
console.log(` ${line}`);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
122
|
+
if (modified.length > 0 || deleted.length > 0) {
|
|
123
|
+
console.log('\nChanges not staged for commit:');
|
|
124
|
+
console.log(' (use "vcs add <file>..." to update what will be committed)');
|
|
125
|
+
console.log(' (use "vcs restore <file>..." to discard changes in working directory)');
|
|
126
|
+
for (const item of modified) {
|
|
127
|
+
console.log(`\tmodified: ${item.path}`);
|
|
128
|
+
}
|
|
129
|
+
for (const item of deleted) {
|
|
130
|
+
console.log(`\tdeleted: ${item.path}`);
|
|
117
131
|
}
|
|
118
132
|
}
|
|
119
|
-
for (const item of deleted) {
|
|
120
|
-
console.log(` deleted: ${item.path}`);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
133
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
134
|
+
if (untracked.length > 0) {
|
|
135
|
+
console.log('\nUntracked files:');
|
|
136
|
+
console.log(' (use "vcs add <file>..." to include in what will be committed)');
|
|
137
|
+
for (const item of untracked) {
|
|
138
|
+
const suffix = item.fsType === 'folder' ? '/' : '';
|
|
139
|
+
console.log(`\t${item.path}${suffix}`);
|
|
140
|
+
}
|
|
128
141
|
}
|
|
129
|
-
}
|
|
130
142
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
const lines = fc.content.trim().split('\n');
|
|
140
|
-
for (const line of lines) {
|
|
141
|
-
console.log(` ${line}`);
|
|
143
|
+
if (pendingComments.length > 0) {
|
|
144
|
+
console.log('\nPending companion comments:');
|
|
145
|
+
console.log(' (will be attached to items upon "vcs commit")');
|
|
146
|
+
for (const comment of pendingComments) {
|
|
147
|
+
const targetLabel = comment.targetRelPath ? comment.targetRelPath : '(root)';
|
|
148
|
+
console.log(`\tcomment on [${targetLabel}]: ${comment.commentRelPath}`);
|
|
149
|
+
if (comments) {
|
|
150
|
+
console.log(`\t Preview: ${comment.content.slice(0, 80).replace(/\n/g, ' ')}...`);
|
|
142
151
|
}
|
|
143
152
|
}
|
|
144
153
|
}
|
|
145
154
|
}
|
|
146
|
-
|
|
147
|
-
if (staged.length === 0 && modified.length === 0 && deleted.length === 0 && untracked.length === 0) {
|
|
148
|
-
console.log('nothing to commit, working tree clean');
|
|
149
|
-
}
|
|
150
155
|
}
|
|
151
156
|
|
|
152
157
|
return {
|
|
153
|
-
branchName,
|
|
158
|
+
branchName: statusRes.branchName,
|
|
154
159
|
staged,
|
|
155
160
|
modified,
|
|
156
161
|
deleted,
|
|
@@ -158,11 +163,11 @@ export async function executeStatusCmd({
|
|
|
158
163
|
pendingComments,
|
|
159
164
|
};
|
|
160
165
|
} catch (error) {
|
|
161
|
-
console.error(`${lc} ${extractErrorMsg(error)} (E:
|
|
166
|
+
console.error(`${lc} ${extractErrorMsg(error)} (E: 6f7a8b9c10d11e12f13a14b15c16d17e)`);
|
|
162
167
|
throw error;
|
|
163
168
|
} finally {
|
|
164
169
|
if (logalot) {
|
|
165
|
-
console.log(`${lc} complete. (I:
|
|
170
|
+
console.log(`${lc} complete. (I: 8a9b10c11d12e13f14a15b16c17d18e1)`);
|
|
166
171
|
}
|
|
167
172
|
}
|
|
168
173
|
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module vcs-projection-helper
|
|
3
|
+
*
|
|
4
|
+
* CLI-specific filesystem projection helpers for reading and writing `.vcsgib/vcs_index_projection.json`.
|
|
5
|
+
* Strictly housed in `apps/vcs-gib` CLI layer to maintain pure isolation from `core-gib`.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import path from 'node:path';
|
|
9
|
+
import fs from 'node:fs/promises';
|
|
10
|
+
|
|
11
|
+
import { extractErrorMsg } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs';
|
|
12
|
+
import { getIbGibAddr } from '@ibgib/ts-gib/dist/helper.mjs';
|
|
13
|
+
import { IbGibSpaceAny } from '@ibgib/core-gib/dist/witness/space/space-base-v1.mjs';
|
|
14
|
+
import { getIbGibsFromCache_fallbackToSpaces } from '@ibgib/core-gib/dist/common/other/ibgib-helper.mjs';
|
|
15
|
+
import { B2tFSIndexIbGib_V1 } from '@ibgib/core-gib/dist/vcs/index/index-types.mjs';
|
|
16
|
+
import { GLOBAL_LOG_A_LOT } from '../vcs-gib-constants.mjs';
|
|
17
|
+
|
|
18
|
+
const lcFile = `[vcs-projection-helper]`;
|
|
19
|
+
const logalot = GLOBAL_LOG_A_LOT;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Retrieves authoritative B2tFSIndexIbGib_V1 from space by reading the `.vcsgib/vcs_index_projection.json` pointer on disk.
|
|
23
|
+
*/
|
|
24
|
+
export async function readVcsIndexProjectionFromDisk({
|
|
25
|
+
vcsPath,
|
|
26
|
+
space,
|
|
27
|
+
}: {
|
|
28
|
+
vcsPath: string;
|
|
29
|
+
space: IbGibSpaceAny;
|
|
30
|
+
}): Promise<B2tFSIndexIbGib_V1 | undefined> {
|
|
31
|
+
const lc = `${lcFile}[${readVcsIndexProjectionFromDisk.name}]`;
|
|
32
|
+
try {
|
|
33
|
+
if (logalot) {
|
|
34
|
+
console.log(`${lc} starting... (I: 7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b)`);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (!vcsPath) {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const projPath = path.join(vcsPath, 'vcs_index_projection.json');
|
|
42
|
+
let indexAddr: string | undefined;
|
|
43
|
+
try {
|
|
44
|
+
const raw = await fs.readFile(projPath, 'utf8');
|
|
45
|
+
const parsed = JSON.parse(raw);
|
|
46
|
+
indexAddr = parsed.indexAddr;
|
|
47
|
+
} catch {
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (!indexAddr) {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const ibgibs = await getIbGibsFromCache_fallbackToSpaces({
|
|
56
|
+
addrs: [indexAddr],
|
|
57
|
+
space,
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const indexIbGib = ibgibs?.at(0) as B2tFSIndexIbGib_V1;
|
|
61
|
+
return indexIbGib;
|
|
62
|
+
} catch (error) {
|
|
63
|
+
console.error(`${lc} ${extractErrorMsg(error)} (E: 8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c)`);
|
|
64
|
+
throw error;
|
|
65
|
+
} finally {
|
|
66
|
+
if (logalot) {
|
|
67
|
+
console.log(`${lc} complete. (I: 9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d)`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Writes read-only JSON projection cache of repository index to disk.
|
|
74
|
+
*/
|
|
75
|
+
export async function writeVcsIndexProjectionToDisk({
|
|
76
|
+
vcsPath,
|
|
77
|
+
indexIbGib,
|
|
78
|
+
}: {
|
|
79
|
+
vcsPath: string;
|
|
80
|
+
indexIbGib: B2tFSIndexIbGib_V1;
|
|
81
|
+
}): Promise<void> {
|
|
82
|
+
const lc = `${lcFile}[${writeVcsIndexProjectionToDisk.name}]`;
|
|
83
|
+
try {
|
|
84
|
+
if (logalot) {
|
|
85
|
+
console.log(`${lc} starting... (I: 3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b)`);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
await fs.mkdir(vcsPath, { recursive: true });
|
|
89
|
+
|
|
90
|
+
const indexAddr = getIbGibAddr({ ibGib: indexIbGib });
|
|
91
|
+
const projectionObj = {
|
|
92
|
+
_isReadOnlyProjection: true,
|
|
93
|
+
_comment: 'STRICTLY READ-ONLY PROJECTION GENERATED FROM B2TFSINDEXIBGIB_V1 IN LOCALSPACE',
|
|
94
|
+
indexAddr,
|
|
95
|
+
spaceId: indexIbGib.data?.mySpaceId,
|
|
96
|
+
activeBranch: indexIbGib.data?.activeBranch || 'main',
|
|
97
|
+
stagedCount: (indexIbGib.data?.staged_item || []).length,
|
|
98
|
+
stagedPaths: indexIbGib.data?.stagedPaths || {},
|
|
99
|
+
updatedAt: new Date().toISOString(),
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const projFile = path.join(vcsPath, 'vcs_index_projection.json');
|
|
103
|
+
await fs.writeFile(projFile, JSON.stringify(projectionObj, null, 2), 'utf8');
|
|
104
|
+
} catch (error) {
|
|
105
|
+
console.error(`${lc} ${extractErrorMsg(error)} (E: 4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c)`);
|
|
106
|
+
throw error;
|
|
107
|
+
} finally {
|
|
108
|
+
if (logalot) {
|
|
109
|
+
console.log(`${lc} complete. (I: 5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d)`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
@@ -17,11 +17,11 @@ import { getIbGibAddr } from '@ibgib/ts-gib/dist/helper.mjs';
|
|
|
17
17
|
import { getFromSpace, persistTransformResult } from '@ibgib/core-gib/dist/witness/space/space-helper.mjs';
|
|
18
18
|
|
|
19
19
|
import { bootstrapVcsMetaspace } from '../../bootstrap/node-bootstrap.mjs';
|
|
20
|
-
import { getB2tFSItemIb } from '
|
|
21
|
-
import { getOrCreateBranchSpace } from '
|
|
22
|
-
import { populateBranchSpaceFromGraph } from '
|
|
23
|
-
import { getSpaceQualifiedIbGibAddr, parseSpaceQualifiedIbGibAddr } from '
|
|
24
|
-
import { B2tFSItemIbGib_V1 } from '
|
|
20
|
+
import { getB2tFSItemIb } from '@ibgib/core-gib/dist/vcs/item/item-atom-helper.mjs';
|
|
21
|
+
import { getOrCreateBranchSpace } from '@ibgib/node-gib/dist/vcs/branch-space-helper.mjs';
|
|
22
|
+
import { populateBranchSpaceFromGraph } from '@ibgib/core-gib/dist/vcs/branch/branch-graph-helper.mjs';
|
|
23
|
+
import { getSpaceQualifiedIbGibAddr, parseSpaceQualifiedIbGibAddr } from '@ibgib/core-gib/dist/vcs/index/index-helper.mjs';
|
|
24
|
+
import { B2tFSItemIbGib_V1 } from '@ibgib/core-gib/dist/vcs/item/item-types.mjs';
|
|
25
25
|
|
|
26
26
|
const lc = `[apps/vcs-gib/src/engine/branch/branch-space.respec.node.mts]`;
|
|
27
27
|
|
|
@@ -27,10 +27,10 @@ import { BinIbGib_V1 } from '@ibgib/core-gib/dist/common/bin/bin-types.mjs';
|
|
|
27
27
|
import { putInSpace, persistTransformResult, registerNewIbGib, getFromSpace, getLatestAddrs } from '@ibgib/core-gib/dist/witness/space/space-helper.mjs';
|
|
28
28
|
|
|
29
29
|
import { bootstrapVcsMetaspace } from '../../bootstrap/node-bootstrap.mjs';
|
|
30
|
-
import { getOrCreateBranchSpace } from '
|
|
31
|
-
import { createB2tFSItemIbGib, evolveB2tFSItemIbGib } from '
|
|
32
|
-
import { B2tFSItemIbGib_V1, BINARY_REL8N_NAME } from '
|
|
33
|
-
import { B2tFS3WayGraftStrategy } from '
|
|
30
|
+
import { getOrCreateBranchSpace } from '@ibgib/node-gib/dist/vcs/branch-space-helper.mjs';
|
|
31
|
+
import { createB2tFSItemIbGib, evolveB2tFSItemIbGib } from '@ibgib/core-gib/dist/vcs/item/item-helper.mjs';
|
|
32
|
+
import { B2tFSItemIbGib_V1, BINARY_REL8N_NAME } from '@ibgib/core-gib/dist/vcs/item/item-types.mjs';
|
|
33
|
+
import { B2tFS3WayGraftStrategy } from '@ibgib/core-gib/dist/vcs/merge/b2tfs-3way-graft-strategy.mjs';
|
|
34
34
|
|
|
35
35
|
const lc = `[apps/vcs-gib/src/engine/merge/b2tfs-sync-comments.respec.node.mts]`;
|
|
36
36
|
const graftStrategySvc = GraftStrategyService.instance;
|
|
@@ -20,8 +20,8 @@ import { IbGibAddr } from '@ibgib/ts-gib/dist/types.mjs';
|
|
|
20
20
|
import { getLatestAddrs } from '@ibgib/core-gib/dist/witness/space/space-helper.mjs';
|
|
21
21
|
import { IbGibSpaceAny } from '@ibgib/core-gib/dist/witness/space/space-base-v1.mjs';
|
|
22
22
|
|
|
23
|
-
import { B2tFSBranchIbGib_V1 } from '
|
|
24
|
-
import { B2tFSItemIbGib_V1 } from '
|
|
23
|
+
import { B2tFSBranchIbGib_V1 } from '@ibgib/core-gib/dist/vcs/branch/branch-types.mjs';
|
|
24
|
+
import { B2tFSItemIbGib_V1 } from '@ibgib/core-gib/dist/vcs/item/item-types.mjs';
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
// ─────────────────────────────────────────────────────────────────────────────
|
package/src/vcs-gib.respec.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module vcs-gib.respec.node
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Full Engine Cycle Integration Tests for @ibgib/vcs-gib.
|
|
5
5
|
* Tests Metaspace bootstrap, canonical ib atoms, item creation, branch spaces, and index tracking.
|
|
6
6
|
*/
|
|
@@ -8,17 +8,20 @@
|
|
|
8
8
|
import path from 'node:path';
|
|
9
9
|
import fs from 'node:fs/promises';
|
|
10
10
|
|
|
11
|
-
import {
|
|
12
|
-
respecfully, ifWe, iReckon
|
|
13
|
-
} from '@ibgib/helper-gib/dist/respec-gib/respec-gib.mjs';
|
|
11
|
+
import { respecfully, ifWe, iReckon } from '@ibgib/helper-gib/dist/respec-gib/respec-gib.mjs';
|
|
14
12
|
import { ROOT } from '@ibgib/ts-gib/dist/V1/constants.mjs';
|
|
15
13
|
import { Factory_V1 } from '@ibgib/ts-gib/dist/V1/factory.mjs';
|
|
14
|
+
import { getB2tFSItemIb } from '@ibgib/core-gib/dist/vcs/item/item-atom-helper.mjs';
|
|
15
|
+
import {
|
|
16
|
+
createB2tFSBranchIbGib, getB2tFSBranchSpaceName
|
|
17
|
+
} from '@ibgib/core-gib/dist/vcs/branch/branch-helper.mjs';
|
|
18
|
+
import {
|
|
19
|
+
createB2tFSIndexIbGib, getSpaceQualifiedIbGibAddr,
|
|
20
|
+
parseSpaceQualifiedIbGibAddr
|
|
21
|
+
} from '@ibgib/core-gib/dist/vcs/index/index-helper.mjs';
|
|
22
|
+
import { B2tFSItemIbGib_V1 } from '@ibgib/core-gib/dist/vcs/item/item-types.mjs';
|
|
16
23
|
|
|
17
24
|
import { bootstrapVcsMetaspace } from './bootstrap/node-bootstrap.mjs';
|
|
18
|
-
import { getB2tFSItemIb } from './engine/item/item-atom-helper.mjs';
|
|
19
|
-
import { createB2tFSBranchIbGib, getB2tFSBranchSpaceName } from './engine/branch/branch-helper.mjs';
|
|
20
|
-
import { createB2tFSIndexIbGib, getSpaceQualifiedIbGibAddr, parseSpaceQualifiedIbGibAddr } from './engine/index/index-helper.mjs';
|
|
21
|
-
import { B2tFSItemIbGib_V1 } from './engine/item/item-types.mjs';
|
|
22
25
|
|
|
23
26
|
const lc = `[apps/vcs-gib/src/vcs-gib.respec.node.mts]`;
|
|
24
27
|
|