bareloop 0.35.0 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/bareloop.context.md +36 -8
- package/package.json +1 -1
- package/src/authorrun.js +3 -2
- package/src/bundlerun.js +4 -8
- package/src/draftspend.js +116 -1
- package/src/index.js +3 -3
- package/src/legs.js +1 -1
- package/src/movefile.js +22 -0
- package/src/npminstall.js +55 -0
- package/src/panel/authorsession.js +87 -17
- package/src/panel/index.html +137 -43
- package/src/panel/server.js +130 -14
- package/src/panel/settingsroutes.js +52 -2
- package/src/ralph.js +1 -1
- package/src/source.js +43 -4
- package/src/u-patient.js +3 -2
- package/src/userrun.js +56 -10
- package/src/worktree.js +120 -0
- package/types/draftspend.d.ts +88 -0
- package/types/legs.d.ts +1 -1
- package/types/movefile.d.ts +9 -0
- package/types/npminstall.d.ts +30 -0
- package/types/panel/authorsession.d.ts +2 -1
- package/types/panel/server.d.ts +13 -2
- package/types/panel/settingsroutes.d.ts +6 -1
- package/types/ralph.d.ts +19 -0
- package/types/source.d.ts +13 -5
- package/types/userrun.d.ts +10 -0
- package/types/worktree.d.ts +48 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** where a run's worktree lives in the person's repo @param {string} repo @param {string} id */
|
|
2
|
+
export function worktreePath(repo: string, id: string): string;
|
|
3
|
+
/**
|
|
4
|
+
* `git worktree add --detach <dir> HEAD` in `repo` (none of the person's hooks run), creating `dir`'s parent first. Throws
|
|
5
|
+
* `Error('git worktree add failed: …')` — a caller decides whether that is a stop or a refusal.
|
|
6
|
+
* @param {string} repo @param {string} dir
|
|
7
|
+
*/
|
|
8
|
+
export function addWorktree(repo: string, dir: string): void;
|
|
9
|
+
/**
|
|
10
|
+
* How many paths `git status --porcelain` lists in `repo` (tracked edits AND untracked files); 0 for a clean
|
|
11
|
+
* tree. A repo git cannot read counts as 0 — this feeds a notice, never a refusal.
|
|
12
|
+
* @param {string} repo @returns {number}
|
|
13
|
+
*/
|
|
14
|
+
export function uncommittedCount(repo: string): number;
|
|
15
|
+
/** the short sha of `repo`'s HEAD, or null @param {string} repo @returns {string|null} */
|
|
16
|
+
export function shortHead(repo: string): string | null;
|
|
17
|
+
/**
|
|
18
|
+
* Hide `.bareloop/` and `node_modules/` (packages installed in a worktree must not read as worker writes) from the person's own `git status` through the repo's PRIVATE exclude file
|
|
19
|
+
* (`<common-git-dir>/info/exclude`), never their tracked `.gitignore`. The common dir, not `.git`: in a linked
|
|
20
|
+
* worktree `.git` is a file and the shared `info/exclude` lives in the main repository's git dir. Idempotent —
|
|
21
|
+
* each line is checked separately and never written twice.
|
|
22
|
+
* @param {string} repo
|
|
23
|
+
* @returns {boolean} true when the line was added now
|
|
24
|
+
*/
|
|
25
|
+
export function hideBareloopDir(repo: string): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Remove a run's worktree folder from `repo` (`git worktree remove --force`: the folder may hold untracked
|
|
28
|
+
* scratch — a `.litectx/` index, the gate-audit file — and what matters is on the branch by now). Never throws.
|
|
29
|
+
* @param {string} repo @param {string} dir
|
|
30
|
+
* @returns {boolean} true when the folder is gone afterwards
|
|
31
|
+
*/
|
|
32
|
+
export function removeWorktree(repo: string, dir: string): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* The run's final commit, on whatever branch the worktree stands on: everything the run changed except the
|
|
35
|
+
* arbiter's books and `node_modules`. Nothing changed = no commit (a green with nothing to commit is still a green).
|
|
36
|
+
* Throws on a git failure — the caller must not remove a worktree whose work is not safely on the branch.
|
|
37
|
+
* @param {string} dir the worktree
|
|
38
|
+
* @param {string} message
|
|
39
|
+
* @returns {{committed: boolean, sha: string}}
|
|
40
|
+
*/
|
|
41
|
+
export function commitWork(dir: string, message: string): {
|
|
42
|
+
committed: boolean;
|
|
43
|
+
sha: string;
|
|
44
|
+
};
|
|
45
|
+
/** the line that hides bareloop's own folder from the person's `git status` (anchored at the repo root) */
|
|
46
|
+
export const EXCLUDE_LINE: "/.bareloop/";
|
|
47
|
+
/** the line that hides installed packages at any depth */
|
|
48
|
+
export const NODE_MODULES_LINE: "node_modules/";
|