@solaqua/gji 0.11.0 → 0.12.1
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 +82 -496
- package/dist/bootstrap-output.js +0 -1
- package/dist/clean.js +2 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.js +40 -4
- package/dist/context-card.d.ts +1 -0
- package/dist/context-card.js +25 -0
- package/dist/dependency-bootstrap.d.ts +10 -17
- package/dist/dependency-bootstrap.js +343 -108
- package/dist/dir-clone.d.ts +1 -2
- package/dist/dir-clone.js +303 -167
- package/dist/doctor.js +21 -0
- package/dist/done.js +2 -0
- package/dist/gji-bundle.mjs +1854 -1032
- package/dist/go.d.ts +1 -0
- package/dist/go.js +8 -0
- package/dist/hooks.d.ts +1 -0
- package/dist/hooks.js +7 -1
- package/dist/hub.d.ts +31 -0
- package/dist/hub.js +299 -0
- package/dist/ls.js +9 -1
- package/dist/new.d.ts +1 -0
- package/dist/new.js +9 -0
- package/dist/pr-open.js +2 -10
- package/dist/pull-requests.d.ts +1 -0
- package/dist/pull-requests.js +32 -3
- package/dist/remove.js +2 -0
- package/dist/repo.d.ts +1 -0
- package/dist/repo.js +4 -0
- package/dist/run-hook.js +2 -0
- package/dist/safe-destination.js +10 -0
- package/dist/shell-completion.js +11 -3
- package/dist/slots.d.ts +8 -0
- package/dist/slots.js +61 -0
- package/dist/status.d.ts +2 -0
- package/dist/status.js +9 -1
- package/dist/sync-directories.d.ts +0 -4
- package/dist/sync-directories.js +6 -26
- package/dist/task-command.d.ts +9 -0
- package/dist/task-command.js +29 -0
- package/dist/task.d.ts +9 -0
- package/dist/task.js +37 -0
- package/dist/terminal-text.d.ts +4 -0
- package/dist/terminal-text.js +72 -0
- package/dist/worktree-bootstrap.js +3 -2
- package/dist/worktree-info.d.ts +6 -1
- package/dist/worktree-info.js +14 -4
- package/dist/worktree-picker.d.ts +3 -3
- package/dist/worktree-picker.js +84 -82
- package/dist/worktree-sources.d.ts +1 -0
- package/dist/worktree-sources.js +57 -11
- package/man/man1/gji-back.1 +1 -1
- package/man/man1/gji-clean.1 +1 -1
- package/man/man1/gji-completion.1 +1 -1
- package/man/man1/gji-config.1 +1 -1
- package/man/man1/gji-doctor.1 +1 -1
- package/man/man1/gji-done.1 +1 -1
- package/man/man1/gji-go.1 +4 -1
- package/man/man1/gji-history.1 +1 -1
- package/man/man1/gji-init.1 +1 -1
- package/man/man1/gji-ls.1 +1 -1
- package/man/man1/gji-new.1 +4 -1
- package/man/man1/gji-open.1 +1 -1
- package/man/man1/gji-pr.1 +1 -1
- package/man/man1/gji-remove.1 +1 -1
- package/man/man1/gji-root.1 +1 -1
- package/man/man1/gji-run-hook.1 +1 -1
- package/man/man1/gji-status.1 +1 -1
- package/man/man1/gji-sync-files.1 +1 -1
- package/man/man1/gji-sync.1 +1 -1
- package/man/man1/gji-task.1 +16 -0
- package/man/man1/gji-undo.1 +1 -1
- package/man/man1/gji-warp.1 +1 -1
- package/man/man1/gji.1 +5 -1
- package/package.json +1 -1
- package/dist/clone-failure-store.d.ts +0 -18
- package/dist/clone-failure-store.js +0 -230
package/dist/doctor.js
CHANGED
|
@@ -12,6 +12,7 @@ import { detectRepository } from "./repo.js";
|
|
|
12
12
|
import { loadRegistry, REGISTRY_FILE_PATH, removeMissingRegistryEntries, } from "./repo-registry.js";
|
|
13
13
|
import { resolveSupportedShell } from "./shell.js";
|
|
14
14
|
import { executableExists, hasShellIntegration, resolveCompletionPath, resolveShellConfigPath, } from "./shell-setup.js";
|
|
15
|
+
import { loadSlots } from "./slots.js";
|
|
15
16
|
const execFileAsync = promisify(execFile);
|
|
16
17
|
const MINIMUM_GIT_VERSION = { major: 2, minor: 17 };
|
|
17
18
|
export async function runDoctorCommand(options) {
|
|
@@ -82,10 +83,30 @@ async function collectDoctorInspection(cwd, home, shell) {
|
|
|
82
83
|
await checkWorktreeBase(repository, effectiveConfig, home),
|
|
83
84
|
registry.check,
|
|
84
85
|
await checkEditor(effectiveConfig),
|
|
86
|
+
await checkOrphanSlots(home),
|
|
85
87
|
],
|
|
86
88
|
missingRegistryPaths: registry.missingPaths,
|
|
87
89
|
};
|
|
88
90
|
}
|
|
91
|
+
async function checkOrphanSlots(home) {
|
|
92
|
+
const slots = await loadSlots(home);
|
|
93
|
+
const missing = (await Promise.all(Object.keys(slots).map(async (path) => {
|
|
94
|
+
try {
|
|
95
|
+
await access(path);
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
}))).filter(Boolean).length;
|
|
102
|
+
return {
|
|
103
|
+
id: "slots",
|
|
104
|
+
message: missing === 0
|
|
105
|
+
? "worktree slots healthy"
|
|
106
|
+
: `${missing} orphaned worktree slot${missing === 1 ? "" : "s"}`,
|
|
107
|
+
status: "ok",
|
|
108
|
+
};
|
|
109
|
+
}
|
|
89
110
|
function buildDoctorFixes(missingRegistryPaths) {
|
|
90
111
|
if (missingRegistryPaths.length === 0)
|
|
91
112
|
return [];
|
package/dist/done.js
CHANGED
|
@@ -7,6 +7,7 @@ import { loadHistory } from "./history.js";
|
|
|
7
7
|
import { extractHooks, runHook } from "./hooks.js";
|
|
8
8
|
import { detectRepository, listWorktrees } from "./repo.js";
|
|
9
9
|
import { writeShellOutput } from "./shell-handoff.js";
|
|
10
|
+
import { releaseWorktreeSlot } from "./slots.js";
|
|
10
11
|
import { finalizeUndoOperation, recordUndoOperation } from "./undo.js";
|
|
11
12
|
import { deleteBranch, forceDeleteBranch, forceRemoveWorktree, isBranchUnmergedError, isWorktreeForceRemovalError, removeWorktree, } from "./worktree-management.js";
|
|
12
13
|
const DONE_OUTPUT_FILE_ENV = "GJI_DONE_OUTPUT_FILE";
|
|
@@ -122,6 +123,7 @@ export async function runDoneCommand(options) {
|
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
125
|
await finalizeUndoOperation(journal, [target]);
|
|
126
|
+
await releaseWorktreeSlot(target.path);
|
|
125
127
|
await runGit(repository.repoRoot, ["worktree", "prune"]).catch(() => undefined);
|
|
126
128
|
const shouldMove = options.branch === undefined || target.path === repository.currentRoot;
|
|
127
129
|
const movedTo = shouldMove
|