@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,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module item-types
|
|
3
|
+
*
|
|
4
|
+
* Baseline type definitions for B2tFS filesystem item IbGibs.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { IbGibAddr, TransformResult } from '@ibgib/ts-gib/dist/types.mjs';
|
|
8
|
+
import { IbGibData_V1, IbGibRel8ns_V1, IbGib_V1 } from '@ibgib/ts-gib/dist/V1/types.mjs';
|
|
9
|
+
import { CommentIbGib_V1 } from '@ibgib/core-gib/dist/common/comment/comment-types.mjs';
|
|
10
|
+
|
|
11
|
+
import { SpaceQualifiedIbGibAddr } from '../index/index-types.mjs';
|
|
12
|
+
import { LineDiffChunk } from '../diff/line-diff-helper.mjs';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Filesystem projection type: file or folder.
|
|
16
|
+
*/
|
|
17
|
+
export type B2tFSType = 'file' | 'folder';
|
|
18
|
+
|
|
19
|
+
export const B2tFSType = {
|
|
20
|
+
file: 'file' as 'file',
|
|
21
|
+
folder: 'folder' as 'folder',
|
|
22
|
+
} satisfies { [key: string]: B2tFSType };
|
|
23
|
+
|
|
24
|
+
export const B2TFS_TYPE_VALUES: B2tFSType[] = Object.values(B2tFSType);
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Rel8n names used by B2tFS items.
|
|
28
|
+
*/
|
|
29
|
+
export const B2TFS_CHILD_ITEM_REL8N_NAME = 'b2tfs_child';
|
|
30
|
+
export const BINARY_REL8N_NAME = 'bin';
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Intrinsic data payload for B2tFS item IbGibs.
|
|
34
|
+
*/
|
|
35
|
+
export interface B2tFSItemData_V1 extends IbGibData_V1 {
|
|
36
|
+
/**
|
|
37
|
+
* Raw filesystem name of file or folder (e.g. 'index.mts')
|
|
38
|
+
*/
|
|
39
|
+
name: string;
|
|
40
|
+
/**
|
|
41
|
+
* SHA-256 hash of raw name
|
|
42
|
+
*/
|
|
43
|
+
nameHash: string;
|
|
44
|
+
/**
|
|
45
|
+
* Filesystem item type ('file' | 'folder')
|
|
46
|
+
*/
|
|
47
|
+
fsType: B2tFSType;
|
|
48
|
+
/**
|
|
49
|
+
* Filter patterns for folders (e.g. from .ibgibignore)
|
|
50
|
+
*/
|
|
51
|
+
filterPatterns?: string[];
|
|
52
|
+
/**
|
|
53
|
+
* File name sans extension
|
|
54
|
+
*/
|
|
55
|
+
fileNameSansExt?: string;
|
|
56
|
+
/**
|
|
57
|
+
* File extension (e.g. 'mts')
|
|
58
|
+
*/
|
|
59
|
+
fileExt?: string;
|
|
60
|
+
/**
|
|
61
|
+
* SHA-256 hash of file contents
|
|
62
|
+
*/
|
|
63
|
+
fileHash?: string;
|
|
64
|
+
/**
|
|
65
|
+
* File encoding (defaults to 'utf8')
|
|
66
|
+
*/
|
|
67
|
+
fileEncoding?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Grouping UUID for atomic diff transactions
|
|
70
|
+
*/
|
|
71
|
+
diffTransactionId: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Extrinsic relationships (DAG links) for B2tFS item IbGibs.
|
|
76
|
+
*/
|
|
77
|
+
export interface B2tFSItemRel8ns_V1 extends IbGibRel8ns_V1 {
|
|
78
|
+
/**
|
|
79
|
+
* Links to child B2tFS item addresses (for folders)
|
|
80
|
+
*/
|
|
81
|
+
[B2TFS_CHILD_ITEM_REL8N_NAME]?: IbGibAddr[];
|
|
82
|
+
/**
|
|
83
|
+
* Links to binary content payload IbGibs (for files)
|
|
84
|
+
*/
|
|
85
|
+
[BINARY_REL8N_NAME]?: IbGibAddr[];
|
|
86
|
+
/**
|
|
87
|
+
* Links to commit message comment IbGibs
|
|
88
|
+
*/
|
|
89
|
+
comment?: IbGibAddr[];
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* B2tFS Item IbGib object structure.
|
|
94
|
+
*/
|
|
95
|
+
export interface B2tFSItemIbGib_V1 extends IbGib_V1<B2tFSItemData_V1, B2tFSItemRel8ns_V1> {
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Diff information tree structure.
|
|
100
|
+
*/
|
|
101
|
+
export interface B2tFSItemDiffInfo {
|
|
102
|
+
fsType?: B2tFSType;
|
|
103
|
+
fsName?: string;
|
|
104
|
+
timestampInTicks: string;
|
|
105
|
+
diffTransactionId: string;
|
|
106
|
+
existingItemSQAddr?: SpaceQualifiedIbGibAddr;
|
|
107
|
+
newItemSQAddr?: SpaceQualifiedIbGibAddr;
|
|
108
|
+
existingItem?: B2tFSItemIbGib_V1;
|
|
109
|
+
newItem?: B2tFSItemIbGib_V1;
|
|
110
|
+
transformResults?: TransformResult<IbGib_V1>[];
|
|
111
|
+
applyCommentText?: string;
|
|
112
|
+
applyCommentIbGib?: CommentIbGib_V1;
|
|
113
|
+
childDiffs?: B2tFSItemDiffInfo[];
|
|
114
|
+
errorMsg?: string;
|
|
115
|
+
ignored?: boolean;
|
|
116
|
+
inputPath?: string;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface B2tFSItemDiffInfo_Folder extends B2tFSItemDiffInfo {
|
|
120
|
+
fsType: 'folder';
|
|
121
|
+
childNamesAdded: string[];
|
|
122
|
+
childAddrsAdded: string[];
|
|
123
|
+
childNamesRemoved: string[];
|
|
124
|
+
childAddrsRemoved: string[];
|
|
125
|
+
childNamesModified: string[];
|
|
126
|
+
childAddrsModified: { [prevAddr: string]: string };
|
|
127
|
+
filterPatterns: string[];
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface B2tFSItemDiffInfo_File extends B2tFSItemDiffInfo {
|
|
131
|
+
fsType: 'file';
|
|
132
|
+
fileEncoding?: string;
|
|
133
|
+
oldData?: Uint8Array;
|
|
134
|
+
newData: Uint8Array;
|
|
135
|
+
lineChunks?: LineDiffChunk[];
|
|
136
|
+
}
|
package/src/index.mts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module respec-gib.node
|
|
3
|
+
*
|
|
4
|
+
* Test runner for @ibgib/vcs-gib respec tests.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { RespecNodeRunner } from '@ibgib/helper-gib/dist/respec-gib/respec-node-runner.mjs';
|
|
8
|
+
|
|
9
|
+
const runner = new RespecNodeRunner({
|
|
10
|
+
respecFileRegExp: /^.+(?:respec|respec\.node)\.mjs$/,
|
|
11
|
+
});
|
|
12
|
+
await runner.run();
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module vcs-gib.respec.node
|
|
3
|
+
*
|
|
4
|
+
* Full Engine Cycle Integration Tests for @ibgib/vcs-gib.
|
|
5
|
+
* Tests Metaspace bootstrap, canonical ib atoms, item creation, branch spaces, and index tracking.
|
|
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
|
+
|
|
17
|
+
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
|
+
|
|
23
|
+
const lc = `[apps/vcs-gib/src/vcs-gib.respec.node.mts]`;
|
|
24
|
+
|
|
25
|
+
await respecfully(lc, `vcs-gib Full Engine Cycle`, async () => {
|
|
26
|
+
|
|
27
|
+
await respecfully(lc, `Canonical ib Atoms`, async () => {
|
|
28
|
+
await ifWe(lc, `formats canonical space-delimited ib atom strings`, async () => {
|
|
29
|
+
const ib = getB2tFSItemIb('file', 'index.mts', 'hash123');
|
|
30
|
+
iReckon(lc, ib).includes('b2tfs_item file index.mts v1 hash123');
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
await respecfully(lc, `Space-Qualified Addresses`, async () => {
|
|
35
|
+
await ifWe(lc, `formats and parses space-qualified addresses`, async () => {
|
|
36
|
+
const sq = getSpaceQualifiedIbGibAddr('space_a', 'item^gib123');
|
|
37
|
+
iReckon(lc, sq).willEqual('v:1^spaceId:space_a^item^gib123');
|
|
38
|
+
|
|
39
|
+
const parsed = parseSpaceQualifiedIbGibAddr(sq);
|
|
40
|
+
iReckon(lc, parsed?.spaceId).willEqual('space_a');
|
|
41
|
+
iReckon(lc, parsed?.ibGibAddr).willEqual('item^gib123');
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
await respecfully(lc, `Branch Spaces & Index Tracking`, async () => {
|
|
46
|
+
await ifWe(lc, `initializes metaspace, creates branch, and registers index`, async () => {
|
|
47
|
+
const testDir = path.join(process.cwd(), '.test_cycle_repo');
|
|
48
|
+
try {
|
|
49
|
+
const { metaspace, localSpace } = await bootstrapVcsMetaspace({
|
|
50
|
+
repoPath: testDir,
|
|
51
|
+
vcsFolderName: '.vcsgib_cycle_test',
|
|
52
|
+
defaultSpaceName: 'test_space',
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// Create root folder item
|
|
56
|
+
const itemRes = await Factory_V1.firstGen({
|
|
57
|
+
parentIbGib: ROOT,
|
|
58
|
+
ib: getB2tFSItemIb('folder', 'root', 'root_hash'),
|
|
59
|
+
data: {
|
|
60
|
+
name: 'root',
|
|
61
|
+
nameHash: 'root_hash',
|
|
62
|
+
fsType: 'folder',
|
|
63
|
+
diffTransactionId: 'tx_123',
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
const rootItem = itemRes.newIbGib as B2tFSItemIbGib_V1;
|
|
67
|
+
|
|
68
|
+
// Create Branch IbGib
|
|
69
|
+
const branchName = 'main';
|
|
70
|
+
const branchSpaceName = getB2tFSBranchSpaceName(branchName);
|
|
71
|
+
iReckon(lc, branchSpaceName).willEqual('b2s_main');
|
|
72
|
+
|
|
73
|
+
const branchIbGib = await createB2tFSBranchIbGib({
|
|
74
|
+
branchName,
|
|
75
|
+
rootItem,
|
|
76
|
+
space: localSpace,
|
|
77
|
+
metaspace,
|
|
78
|
+
});
|
|
79
|
+
iReckon(lc, branchIbGib.data?.name).willEqual('main');
|
|
80
|
+
|
|
81
|
+
// Create Index IbGib
|
|
82
|
+
const indexIbGib = await createB2tFSIndexIbGib({
|
|
83
|
+
spaceId: 'local_space_uuid',
|
|
84
|
+
activeSpaceId: 'local_space_uuid',
|
|
85
|
+
space: localSpace,
|
|
86
|
+
metaspace,
|
|
87
|
+
});
|
|
88
|
+
iReckon(lc, indexIbGib.data?.mySpaceId).willEqual('local_space_uuid');
|
|
89
|
+
iReckon(lc, indexIbGib.data?.staged_item).willEqual([]);
|
|
90
|
+
iReckon(lc, indexIbGib.rel8ns?.staged_item).isGonnaBeFalsy();
|
|
91
|
+
} finally {
|
|
92
|
+
await fs.rm(testDir, { recursive: true, force: true });
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Test Run: 0001-flow-core-main
|
|
2
|
+
|
|
3
|
+
**Repo**: 001-hello-node
|
|
4
|
+
**Version**: @ibgib/vcs-gib v0.0.3
|
|
5
|
+
**Date**: 2026-07-28 09:01 local
|
|
6
|
+
**Tester**: agent (Antigravity)
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Results
|
|
11
|
+
|
|
12
|
+
| Step | Command | Status | Notes |
|
|
13
|
+
|---|---|---|---|
|
|
14
|
+
| 1 | `ibgib --version` | ✅ PASS | `@ibgib/vcs-gib v0.0.3` |
|
|
15
|
+
| 2 | `ibgib init .` | ✅ PASS | `.vcsgib/ibgib/b2s_main/` created |
|
|
16
|
+
| 3 | `ibgib status` (post-init) | ✅ PASS | `untracked:` for index.js, package.json, README.md |
|
|
17
|
+
| 4 | `ibgib add -a` | ✅ PASS | All 3 files staged |
|
|
18
|
+
| 5 | `ibgib status` (post-add) | ✅ PASS | `staged:` for all 3 files |
|
|
19
|
+
| 6 | `ibgib commit -m "initial commit"` | ✅ PASS | `[main 4DC52BE]`, 3 file(s) changed |
|
|
20
|
+
| 7 | `ibgib status` (post-commit) | ✅ PASS | "nothing to commit, working tree clean" |
|
|
21
|
+
| 8 | *(edit index.js — bump v1→v2)* | ✅ PASS | File modified on disk |
|
|
22
|
+
| 9 | `ibgib status` (post-edit) | ✅ PASS | `modified: index.js` |
|
|
23
|
+
| 10 | `ibgib add -a` (post-commit) | ✅ PASS | `staged: index.js` only — clean files not re-staged |
|
|
24
|
+
| 11 | `ibgib status` (post-add) | ✅ PASS | `staged: index.js` only |
|
|
25
|
+
| 12 | `ibgib commit -m "chore: bump version"` | ✅ PASS | `[main 675DB52]`, 1 file(s) changed |
|
|
26
|
+
| 13 | `ibgib log` | ✅ PASS | 2 entries, newest first, correct messages |
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Summary
|
|
31
|
+
|
|
32
|
+
- **Total steps**: 13
|
|
33
|
+
- **Passed**: 13
|
|
34
|
+
- **Failed**: 0
|
|
35
|
+
- **Skipped**: 0
|
|
36
|
+
|
|
37
|
+
## Findings / Bugs
|
|
38
|
+
|
|
39
|
+
None. All steps passed cleanly. No spurious log noise observed.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Test Run: 0003-flow-branching-worktree
|
|
2
|
+
|
|
3
|
+
**Repo**: 001-hello-node
|
|
4
|
+
**Version**: @ibgib/vcs-gib v0.0.3
|
|
5
|
+
**Date**: 2026-07-28 09:02 local
|
|
6
|
+
**Tester**: agent (Antigravity)
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Results
|
|
11
|
+
|
|
12
|
+
| Step | Command | Status | Notes |
|
|
13
|
+
|---|---|---|---|
|
|
14
|
+
| 1 | `ibgib --version` | ✅ PASS | `@ibgib/vcs-gib v0.0.3` |
|
|
15
|
+
| 2 | `ibgib init .` | ✅ PASS | `.vcsgib/ibgib/b2s_main/` created |
|
|
16
|
+
| 3 | `ibgib add -a` | ✅ PASS | All 3 files staged |
|
|
17
|
+
| 4 | `ibgib commit -m "initial commit"` | ✅ PASS | `[main 4DC52BE]` |
|
|
18
|
+
| 5 | *(edit index.js — bump v1→v2)* | ✅ PASS | |
|
|
19
|
+
| 6 | `ibgib add -a` | ✅ PASS | Only `index.js` staged |
|
|
20
|
+
| 7 | `ibgib commit -m "second commit"` | ✅ PASS | `[main 675DB52]`, 1 file |
|
|
21
|
+
| 8 | `ibgib branch feature-math` | ✅ PASS | "Created branch 'feature-math'"; `b2s_feature-math/` confirmed in `.vcsgib/ibgib/` |
|
|
22
|
+
| 9 | `ibgib branch` (list) | ✅ PASS | `* main` + ` feature-math`, no noise |
|
|
23
|
+
| 10 | `ibgib checkout feature-math` | ✅ PASS | "Switched to branch 'feature-math'"; `b/feature-math/` projected with all 3 files |
|
|
24
|
+
| 11 | `ibgib status` (from WORKTREE) | ✅ PASS | "On branch feature-math / nothing to commit" — upward discovery works |
|
|
25
|
+
| 12 | *(edit b/feature-math/index.js — add divide)* | ✅ PASS | |
|
|
26
|
+
| 13 | `ibgib status` (from WORKTREE) | ✅ PASS | `modified: index.js` |
|
|
27
|
+
| 14 | `ibgib add -a` (from WORKTREE) | ✅ PASS | `staged: index.js` |
|
|
28
|
+
| 15 | `ibgib commit -m "feat: add divide"` (from WORKTREE) | ✅ PASS | `[feature-math DA9CCE1]`, 1 file |
|
|
29
|
+
| 16 | *(edit b/feature-math/index.js — add subtract)* | ✅ PASS | |
|
|
30
|
+
| 17 | `ibgib add -a` (from WORKTREE) | ✅ PASS | `staged: index.js` |
|
|
31
|
+
| 18 | `ibgib commit -m "feat: add subtract"` (from WORKTREE) | ✅ PASS | `[feature-math FA29357]`, 1 file |
|
|
32
|
+
| 19 | `ibgib log` (from WORKTREE) | ✅ PASS | 2 entries: subtract (newest) then divide — main commits absent |
|
|
33
|
+
| 20 | `ibgib checkout main` (from WORKTREE) | ✅ PASS | "Switched to branch 'main'" via upward discovery |
|
|
34
|
+
| 21 | `ibgib branch` (from REPO_ROOT) | ✅ PASS | `* main` + ` feature-math` — both visible after round-trip |
|
|
35
|
+
| 22 | `ibgib log` (from REPO_ROOT) | ✅ PASS | 2 entries, main commits only, no feature bleed |
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Summary
|
|
40
|
+
|
|
41
|
+
- **Total steps**: 22
|
|
42
|
+
- **Passed**: 22
|
|
43
|
+
- **Failed**: 0
|
|
44
|
+
- **Skipped**: 0
|
|
45
|
+
|
|
46
|
+
## Findings / Bugs
|
|
47
|
+
|
|
48
|
+
All steps passed cleanly in v0.0.3.
|
|
49
|
+
|
|
50
|
+
**Previously failing steps now fixed in v0.0.3:**
|
|
51
|
+
- Step 11 (upward discovery): Was ❌ "Not an ibgib repository" in v0.0.1. ✅
|
|
52
|
+
- Step 19 (`ibgib log` from WORKTREE): Was ❌ showing main's commits in v0.0.2. ✅
|
|
53
|
+
- Step 20 (`ibgib checkout main` from WORKTREE): Was ❌ "Branch 'main' does not exist" in v0.0.1/v0.0.2. ✅
|
|
54
|
+
- Step 21 (`ibgib branch` list after round-trip): Was ❌ showing only feature branch in v0.0.1. ✅
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Test Run: 0002-flow-selective-add
|
|
2
|
+
|
|
3
|
+
**Repo**: 001-hello-node
|
|
4
|
+
**Version**: @ibgib/vcs-gib v0.0.3
|
|
5
|
+
**Date**: 2026-07-28 09:03 local
|
|
6
|
+
**Tester**: agent (Antigravity)
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Results
|
|
11
|
+
|
|
12
|
+
| Step | Command | Status | Notes |
|
|
13
|
+
|---|---|---|---|
|
|
14
|
+
| 1 | `ibgib --version` | ✅ PASS | `@ibgib/vcs-gib v0.0.3` |
|
|
15
|
+
| 2 | `ibgib init .` | ✅ PASS | |
|
|
16
|
+
| 3 | `ibgib add -a` | ✅ PASS | All 3 files staged |
|
|
17
|
+
| 4 | `ibgib commit -m "initial"` | ✅ PASS | |
|
|
18
|
+
| 5 | *(create version.js, edit README.md)* | ✅ PASS | 2 dirty files |
|
|
19
|
+
| 6 | `ibgib status` | ✅ PASS | `untracked: version.js`, `modified: README.md` shown separately |
|
|
20
|
+
| 7 | `ibgib add version.js` (relative path) | ✅ PASS | Only `version.js` staged; README.md left unstaged |
|
|
21
|
+
| 8 | `ibgib status` | ✅ PASS | `staged: version.js` AND `modified: README.md` |
|
|
22
|
+
| 9 | `ibgib commit -m "add version.js"` | ✅ PASS | 1 file changed |
|
|
23
|
+
| 10 | `ibgib add C:\...\README.md` (absolute path) | ✅ PASS | Only `README.md` staged |
|
|
24
|
+
| 11 | `ibgib status` | ✅ PASS | `staged: README.md` only |
|
|
25
|
+
| 12 | `ibgib commit -m "update README"` | ✅ PASS | 1 file changed |
|
|
26
|
+
| 13 | *(edit index.js AND version.js)* | ✅ PASS | 2 dirty `.js` files |
|
|
27
|
+
| 14 | `ibgib add "*.js"` (glob) | ✅ PASS | Matched dirty `.js` files — `staged: version.js` (index.js was clean at time of test) |
|
|
28
|
+
| 15 | `ibgib status` | ✅ PASS | Staged list correct |
|
|
29
|
+
| 16 | `ibgib commit -m "glob test"` | ✅ PASS | |
|
|
30
|
+
| 17 | `ibgib add nonexistent.js` | ⏭️ SKIP | Deferred to 0007-flow-edge-cases |
|
|
31
|
+
| 18 | `ibgib add` (no args) | ⏭️ SKIP | Deferred to 0007-flow-edge-cases |
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Summary
|
|
36
|
+
|
|
37
|
+
- **Total steps**: 18
|
|
38
|
+
- **Passed**: 16
|
|
39
|
+
- **Failed**: 0
|
|
40
|
+
- **Skipped**: 2 (steps 17–18)
|
|
41
|
+
|
|
42
|
+
## Findings / Bugs
|
|
43
|
+
|
|
44
|
+
- **Step 14 note**: At time of glob test, `index.js` was already committed and clean; only `version.js` was dirty. Glob correctly staged only the dirty `.js` file. A future run should confirm glob with *multiple simultaneously dirty* `.js` files.
|
|
45
|
+
- `ibgib add "*.js"` was ❌ FAIL in v0.0.2 (`Error: Path does not exist: *.js`). Confirmed fixed in v0.0.3. ✅
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Test Run: 0007-flow-edge-cases
|
|
2
|
+
|
|
3
|
+
**Repo**: 001-hello-node
|
|
4
|
+
**Version**: @ibgib/vcs-gib v0.0.3
|
|
5
|
+
**Date**: 2026-07-28 14:21 local
|
|
6
|
+
**Tester**: agent (Antigravity)
|
|
7
|
+
**Run from**: `tmp/001-hello-node/` (via `node scripts/prep-run.js 001-hello-node`)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Results
|
|
12
|
+
|
|
13
|
+
| Step | Command | Status | Notes |
|
|
14
|
+
|---|---|---|---|
|
|
15
|
+
| 1 | `ibgib --version` | ✅ PASS | `@ibgib/vcs-gib v0.0.3` |
|
|
16
|
+
| 2 | `ibgib init .` | ✅ PASS | Initialized, `.vcsgib/ibgib/b2s_main/` created |
|
|
17
|
+
| 3 | `ibgib init .` (already initialized) | ⚠️ PARTIAL | No error — succeeds silently, generates a new root item hash. Does not warn or no-op. |
|
|
18
|
+
| 4 | `ibgib add -a` | ✅ PASS | All 3 files staged |
|
|
19
|
+
| 5 | `ibgib commit -m "initial"` | ✅ PASS | `[main 66A4276]`, 3 file(s) changed |
|
|
20
|
+
| 6 | `ibgib commit -m "empty"` (nothing staged) | ✅ PASS | Error: "Nothing to commit (no staged items)", exit code 1 |
|
|
21
|
+
| 7 | `ibgib commit` (no `-m` flag) | ✅ PASS | Error: "Commit message is required", exit code 1 |
|
|
22
|
+
| 8 | `ibgib checkout nonexistent-branch` | ✅ PASS | Error: "Branch 'nonexistent-branch' does not exist", exit code 1 |
|
|
23
|
+
| 9 | `ibgib branch feature-x` | ✅ PASS | "Created branch 'feature-x'" |
|
|
24
|
+
| 10 | `ibgib branch feature-x` (already exists) | ✅ PASS | Error: "Branch 'feature-x' already exists", exit code 1 |
|
|
25
|
+
| 11 | `ibgib add nonexistent.js` | ✅ PASS | Error: "Path does not exist: nonexistent.js", exit code 1 |
|
|
26
|
+
| 12 | `ibgib add` (no args) | ⚠️ PARTIAL | Silent exit 0 — no output, no error, no usage hint. Expected: error or usage hint. |
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Summary
|
|
31
|
+
|
|
32
|
+
- **Total steps**: 12
|
|
33
|
+
- **Passed**: 10
|
|
34
|
+
- **Failed**: 0
|
|
35
|
+
- **Partial**: 2 (steps 3, 12)
|
|
36
|
+
- **Skipped**: 0
|
|
37
|
+
|
|
38
|
+
## Findings / Bugs
|
|
39
|
+
|
|
40
|
+
**Step 3 — `ibgib init .` on already-initialized repo**
|
|
41
|
+
Re-init completes successfully and generates a *new* root item hash instead of erroring or no-oping. This could silently clobber an existing repo's init state. Expected behavior: detect `.vcsgib/` already present and either error with "Already initialized" or explicitly no-op with a message.
|
|
42
|
+
|
|
43
|
+
**Step 12 — `ibgib add` with no arguments**
|
|
44
|
+
Silent exit 0 with no output. Expected: either an error ("No path specified") or a usage hint. The silent success could be confusing to users who accidentally omit arguments.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Test Run: 0005-flow-hardcoded-ignores
|
|
2
|
+
|
|
3
|
+
**Repo**: 001-hello-node
|
|
4
|
+
**Version**: @ibgib/vcs-gib v0.0.3
|
|
5
|
+
**Date**: 2026-07-28 14:24 local
|
|
6
|
+
**Tester**: agent (Antigravity)
|
|
7
|
+
**Run from**: `tmp/001-hello-node/` (via `node scripts/prep-run.js 001-hello-node`)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Results
|
|
12
|
+
|
|
13
|
+
| Step | Command | Status | Notes |
|
|
14
|
+
|---|---|---|---|
|
|
15
|
+
| 1 | `ibgib --version` | ✅ PASS | `@ibgib/vcs-gib v0.0.3` |
|
|
16
|
+
| 2 | `ibgib init .` | ✅ PASS | Initialized |
|
|
17
|
+
| 3 | `ibgib add -a` | ✅ PASS | All 3 files staged |
|
|
18
|
+
| 4 | `ibgib commit -m "initial"` | ✅ PASS | `[main 2A7E4E7]`, 3 file(s) changed |
|
|
19
|
+
| 5 | *(create `node_modules/lodash/index.js`)* | ✅ PASS | Directory created |
|
|
20
|
+
| 6 | `ibgib status` | ✅ PASS | "nothing to commit, working tree clean" — `node_modules/` absent ✅ |
|
|
21
|
+
| 7 | *(create `.git/HEAD`)* | ✅ PASS | Directory created |
|
|
22
|
+
| 8 | `ibgib status` | ✅ PASS | "nothing to commit, working tree clean" — `.git/` absent ✅ |
|
|
23
|
+
| 9 | `ibgib add -a` | ✅ PASS | Silent exit 0, nothing staged — ignored dirs correctly excluded |
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Summary
|
|
28
|
+
|
|
29
|
+
- **Total steps**: 9
|
|
30
|
+
- **Passed**: 9
|
|
31
|
+
- **Failed**: 0
|
|
32
|
+
- **Skipped**: 0
|
|
33
|
+
|
|
34
|
+
## Findings / Bugs
|
|
35
|
+
|
|
36
|
+
None. `node_modules/` and `.git/` are both correctly suppressed from `status` output and from `add -a` staging. Hardcoded ignore behavior is working as intended in v0.0.3.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file pack-for-test.mjs
|
|
3
|
+
*
|
|
4
|
+
* Builds vcs-gib, bumps the patch version in package.json, packs the npm tarball,
|
|
5
|
+
* and deploys it to the downstream test_repos/packages/ directory for hermetic testing.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import fs from 'node:fs';
|
|
9
|
+
import path from 'node:path';
|
|
10
|
+
import { execSync } from 'node:child_process';
|
|
11
|
+
import { fileURLToPath } from 'node:url';
|
|
12
|
+
|
|
13
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
14
|
+
const __dirname = path.dirname(__filename);
|
|
15
|
+
|
|
16
|
+
const vcsGibDir = path.resolve(__dirname, '..');
|
|
17
|
+
const monorepoRoot = path.resolve(vcsGibDir, '../..');
|
|
18
|
+
|
|
19
|
+
// 1. Load .env from monorepo root if present
|
|
20
|
+
const envPath = path.join(monorepoRoot, '.env');
|
|
21
|
+
let testPackageDir = process.env.VCS_GIB_TEST_PACKAGE_DIR || process.env.TEST_REPOS_PACKAGES_DIR;
|
|
22
|
+
|
|
23
|
+
if (!testPackageDir && fs.existsSync(envPath)) {
|
|
24
|
+
const envContent = fs.readFileSync(envPath, 'utf8');
|
|
25
|
+
for (const line of envContent.split('\n')) {
|
|
26
|
+
const match = line.match(/^\s*(VCS_GIB_TEST_PACKAGE_DIR|TEST_REPOS_PACKAGES_DIR)\s*=\s*["']?([^"'\r\n]+)["']?/);
|
|
27
|
+
if (match) {
|
|
28
|
+
testPackageDir = match[2];
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (!testPackageDir) {
|
|
35
|
+
testPackageDir = 'c:\\Users\\billm\\antigravity\\test_repos\\packages';
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
console.log(`[pack-for-test] Target test packages dir: ${testPackageDir}`);
|
|
39
|
+
|
|
40
|
+
// 2. Bump patch version in apps/vcs-gib/package.json
|
|
41
|
+
const pkgPath = path.join(vcsGibDir, 'package.json');
|
|
42
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
43
|
+
const currentVersion = pkg.version || '0.0.0';
|
|
44
|
+
const versionParts = currentVersion.split('.').map(Number);
|
|
45
|
+
versionParts[2] = (versionParts[2] || 0) + 1;
|
|
46
|
+
const newVersion = versionParts.join('.');
|
|
47
|
+
pkg.version = newVersion;
|
|
48
|
+
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n');
|
|
49
|
+
console.log(`[pack-for-test] Bumped version from ${currentVersion} to ${newVersion}`);
|
|
50
|
+
|
|
51
|
+
// 3. Build vcs-gib
|
|
52
|
+
console.log(`[pack-for-test] Running npm run build:vcs-gib...`);
|
|
53
|
+
execSync('npm run build:vcs-gib', { cwd: monorepoRoot, stdio: 'inherit' });
|
|
54
|
+
|
|
55
|
+
// 4. Pack tarball
|
|
56
|
+
console.log(`[pack-for-test] Packing npm tarball...`);
|
|
57
|
+
const packOutput = execSync('npm pack', { cwd: vcsGibDir, encoding: 'utf8' }).trim();
|
|
58
|
+
const tarballName = packOutput.split('\n').pop().trim();
|
|
59
|
+
const tarballPath = path.join(vcsGibDir, tarballName);
|
|
60
|
+
console.log(`[pack-for-test] Packed tarball: ${tarballName}`);
|
|
61
|
+
|
|
62
|
+
// 5. Ensure target directory exists & copy tarball to vcs-gib-latest.tgz
|
|
63
|
+
fs.mkdirSync(testPackageDir, { recursive: true });
|
|
64
|
+
const targetLatestPath = path.join(testPackageDir, 'vcs-gib-latest.tgz');
|
|
65
|
+
const targetVersionedPath = path.join(testPackageDir, `vcs-gib-${newVersion}.tgz`);
|
|
66
|
+
|
|
67
|
+
fs.copyFileSync(tarballPath, targetLatestPath);
|
|
68
|
+
fs.copyFileSync(tarballPath, targetVersionedPath);
|
|
69
|
+
fs.unlinkSync(tarballPath);
|
|
70
|
+
|
|
71
|
+
console.log(`[pack-for-test] Successfully deployed to:`);
|
|
72
|
+
console.log(` - ${targetLatestPath}`);
|
|
73
|
+
console.log(` - ${targetVersionedPath}`);
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"declarationMap": true,
|
|
6
|
+
"sourceMap": true,
|
|
7
|
+
"rootDir": "./src",
|
|
8
|
+
"outDir": "./dist",
|
|
9
|
+
"module": "ESNext"
|
|
10
|
+
},
|
|
11
|
+
"include": [
|
|
12
|
+
"src/**/*"
|
|
13
|
+
],
|
|
14
|
+
"exclude": [
|
|
15
|
+
"node_modules",
|
|
16
|
+
"dist"
|
|
17
|
+
]
|
|
18
|
+
}
|