@omercnet/paseo-fresh-worktrees 3.1.1 → 3.1.2-next.462.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/OVERVIEW.md +1 -1
- package/README.md +1 -1
- package/index.server.ts +6 -2
- package/package.json +3 -3
- package/paseo-plugin.json +1 -1
- package/server/fresh-worktrees.ts +6 -4
package/OVERVIEW.md
CHANGED
|
@@ -4,4 +4,4 @@ Before the worktree is created, the plugin runs `git fetch --prune` against the
|
|
|
4
4
|
|
|
5
5
|
It also shows `Behind · N` in the workspace header when a worktree is behind its source branch's remote. On phones and narrow windows, Paseo 0.13 lists it as a row of the compact workspace menu, worded as "Worktree is N commits behind its source branch"; Paseo 0.12 does not render plugin header buttons in the compact workspace header, so the indicator is not shown there. A sidebar footer lists behind workspaces and offers **Refresh all**, which fast-forwards each clean source checkout and skips dirty or diverged ones. It never modifies worktree branches.
|
|
6
6
|
|
|
7
|
-
Setup: `git` on the daemon host. The plugin runs `git` there with the daemon's environment and contacts the repository's remote on each fetch. Requires Paseo ^0.11.0 || ^0.12.0 || ^0.13.0 || ^0.14.0 || ^0.15.0.
|
|
7
|
+
Setup: `git` on the daemon host. The plugin runs `git` there with the daemon's environment and contacts the repository's remote on each fetch. Requires Paseo ^0.11.0 || ^0.12.0 || ^0.13.0 || ^0.14.0 || ^0.15.0 || ^0.16.0.
|
package/README.md
CHANGED
|
@@ -63,7 +63,7 @@ host.
|
|
|
63
63
|
paseo plugin install npm:@omercnet/paseo-fresh-worktrees
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
The plugin requires Paseo `^0.11.0 || ^0.12.0 || ^0.13.0 || ^0.14.0 || ^0.15.0`.
|
|
66
|
+
The plugin requires Paseo `^0.11.0 || ^0.12.0 || ^0.13.0 || ^0.14.0 || ^0.15.0 || ^0.16.0`.
|
|
67
67
|
|
|
68
68
|
## Develop
|
|
69
69
|
|
package/index.server.ts
CHANGED
|
@@ -9,19 +9,23 @@ import {
|
|
|
9
9
|
workspaceFreshness,
|
|
10
10
|
} from "./shared/workspace-freshness";
|
|
11
11
|
|
|
12
|
+
// Polls share one never-aborted signal so concurrent ones still dedupe;
|
|
13
|
+
// only a cancellable workspace.create signal runs a separate refresh.
|
|
14
|
+
const pollSignal = new AbortController().signal;
|
|
15
|
+
|
|
12
16
|
export default function contribute(server: PluginServerContext) {
|
|
13
17
|
const refreshRepository = createRepositoryRefreshCoordinator();
|
|
14
18
|
|
|
15
19
|
server.handle(workspaceFreshness, ({ projectRootPath, workspaceDirectory }) =>
|
|
16
20
|
inspectWorkspaceFreshness(projectRootPath, workspaceDirectory, {
|
|
17
|
-
signal:
|
|
21
|
+
signal: pollSignal,
|
|
18
22
|
refreshRepository,
|
|
19
23
|
}),
|
|
20
24
|
);
|
|
21
25
|
|
|
22
26
|
server.handle(refreshSourceBranchContract, ({ projectRootPath }) =>
|
|
23
27
|
refreshSourceBranch(projectRootPath, {
|
|
24
|
-
signal:
|
|
28
|
+
signal: pollSignal,
|
|
25
29
|
refreshRepository,
|
|
26
30
|
}),
|
|
27
31
|
);
|
package/package.json
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"icon.png",
|
|
35
35
|
"OVERVIEW.md"
|
|
36
36
|
],
|
|
37
|
-
"version": "3.1.1",
|
|
37
|
+
"version": "3.1.2-next.462.1",
|
|
38
38
|
"type": "module",
|
|
39
39
|
"packageManager": "bun@1.4.4",
|
|
40
40
|
"engines": {
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@biomejs/biome": "^2.5.10",
|
|
51
|
-
"@getpaseo/client": "0.
|
|
52
|
-
"@getpaseo/plugin": "0.
|
|
51
|
+
"@getpaseo/client": "0.16.0-beta.1",
|
|
52
|
+
"@getpaseo/plugin": "0.16.0-beta.1",
|
|
53
53
|
"@types/node": "^24.10.1",
|
|
54
54
|
"@types/react": "^19.2.18",
|
|
55
55
|
"react": "19.1.0",
|
package/paseo-plugin.json
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
"id": "fresh-worktrees",
|
|
3
3
|
"description": "Fast-forwards clean local base branches before Paseo creates branch-off worktrees.",
|
|
4
4
|
"icon": "icon.png",
|
|
5
|
-
"requirements": { "paseo": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^0.14.0 || ^0.15.0" }
|
|
5
|
+
"requirements": { "paseo": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^0.14.0 || ^0.15.0 || ^0.16.0" }
|
|
6
6
|
}
|
|
@@ -69,12 +69,14 @@ export async function executeGit(
|
|
|
69
69
|
export function createRepositoryRefreshCoordinator(
|
|
70
70
|
runGit: GitRunner = executeGit,
|
|
71
71
|
): RepositoryRefresh {
|
|
72
|
-
const inFlight = new Map<string, Promise<RepositoryRefreshResult
|
|
72
|
+
const inFlight = new WeakMap<AbortSignal, Map<string, Promise<RepositoryRefreshResult>>>();
|
|
73
73
|
const repositoryTails = new Map<string, Promise<void>>();
|
|
74
74
|
|
|
75
75
|
return async (cwd, remote, localBranch, upstream, signal) => {
|
|
76
76
|
const targetKey = `${cwd}\0${remote}\0${localBranch ?? ""}\0${upstream ?? ""}`;
|
|
77
|
-
const
|
|
77
|
+
const signalRefreshes = inFlight.get(signal) ?? new Map();
|
|
78
|
+
inFlight.set(signal, signalRefreshes);
|
|
79
|
+
const existingRefresh = signalRefreshes.get(targetKey);
|
|
78
80
|
if (existingRefresh) return existingRefresh;
|
|
79
81
|
|
|
80
82
|
const previousRefresh = repositoryTails.get(cwd) ?? Promise.resolve();
|
|
@@ -119,13 +121,13 @@ export function createRepositoryRefreshCoordinator(
|
|
|
119
121
|
() => {},
|
|
120
122
|
() => {},
|
|
121
123
|
);
|
|
122
|
-
|
|
124
|
+
signalRefreshes.set(targetKey, refresh);
|
|
123
125
|
repositoryTails.set(cwd, tail);
|
|
124
126
|
|
|
125
127
|
try {
|
|
126
128
|
return await refresh;
|
|
127
129
|
} finally {
|
|
128
|
-
if (
|
|
130
|
+
if (signalRefreshes.get(targetKey) === refresh) signalRefreshes.delete(targetKey);
|
|
129
131
|
if (repositoryTails.get(cwd) === tail) repositoryTails.delete(cwd);
|
|
130
132
|
}
|
|
131
133
|
};
|