worktree-flow 0.0.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.
@@ -0,0 +1,22 @@
1
+ import { CreateBranchWorkspaceUseCase } from './createBranchWorkspace.js';
2
+ import { CheckoutWorkspaceUseCase } from './checkoutWorkspace.js';
3
+ import { RemoveWorkspaceUseCase } from './removeWorkspace.js';
4
+ import { PushWorkspaceUseCase } from './pushWorkspace.js';
5
+ import { PullWorkspaceUseCase } from './pullWorkspace.js';
6
+ import { CheckWorkspaceStatusUseCase } from './checkWorkspaceStatus.js';
7
+ import { DiscoverPrunableWorkspacesUseCase } from './discoverPrunableWorkspaces.js';
8
+ /**
9
+ * Factory function for creating all use cases with their service dependencies.
10
+ * Use cases orchestrate workflows by coordinating multiple services.
11
+ */
12
+ export function createUseCases(services) {
13
+ return {
14
+ createBranchWorkspace: new CreateBranchWorkspaceUseCase(services.workspaceDir, services.worktree, services.repos, services.fetch, services.parallel, services.tmux, services.postCheckout),
15
+ checkoutWorkspace: new CheckoutWorkspaceUseCase(services.workspaceDir, services.worktree, services.repos, services.fetch, services.parallel, services.tmux, services.postCheckout),
16
+ removeWorkspace: new RemoveWorkspaceUseCase(services.workspaceDir, services.worktree, services.repos, services.fetch, services.status, services.tmux),
17
+ pushWorkspace: new PushWorkspaceUseCase(services.workspaceDir, services.git, services.parallel),
18
+ pullWorkspace: new PullWorkspaceUseCase(services.workspaceDir, services.git, services.parallel),
19
+ checkWorkspaceStatus: new CheckWorkspaceStatusUseCase(services.workspaceDir, services.fetch, services.status),
20
+ discoverPrunableWorkspaces: new DiscoverPrunableWorkspacesUseCase(services.workspaceDir, services.fetch, services.status, services.git),
21
+ };
22
+ }
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "worktree-flow",
3
+ "version": "0.0.1",
4
+ "description": "Manage git worktrees across a poly-repo environment",
5
+ "type": "module",
6
+ "bin": {
7
+ "flow": "dist/cli.js"
8
+ },
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "scripts": {
13
+ "build": "tsc -p tsconfig.build.json",
14
+ "type-check": "tsc --noEmit",
15
+ "test": "vitest",
16
+ "test:ui": "vitest --ui",
17
+ "test:coverage": "vitest --coverage",
18
+ "validate": "npm run type-check && npm run test"
19
+ },
20
+ "keywords": [
21
+ "git",
22
+ "worktree",
23
+ "monorepo",
24
+ "polyrepo",
25
+ "cli"
26
+ ],
27
+ "license": "MIT",
28
+ "dependencies": {
29
+ "@inquirer/checkbox": "^5.0.4",
30
+ "@inquirer/confirm": "^6.0.4",
31
+ "@inquirer/input": "^5.0.4",
32
+ "chalk": "^5.6.2",
33
+ "commander": "^14.0.3",
34
+ "zod": "^4.3.6"
35
+ },
36
+ "devDependencies": {
37
+ "@types/node": "^25.2.0",
38
+ "@types/sinon": "^21.0.0",
39
+ "@vitest/coverage-v8": "^4.0.18",
40
+ "@vitest/ui": "^4.0.18",
41
+ "memfs": "^4.56.10",
42
+ "sinon": "^21.0.1",
43
+ "typescript": "^5.9.3",
44
+ "vitest": "^4.0.18"
45
+ }
46
+ }