@thanaen/worktree-cleanup 0.2.0 → 0.2.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/dist/main.mjs CHANGED
@@ -4,11 +4,11 @@ import { Console, Effect, Layer } from "effect";
4
4
  import { Command, Flag } from "effect/unstable/cli";
5
5
  import { NodeRuntime, NodeServices } from "@effect/platform-node";
6
6
  //#region package.json
7
- var version = "0.2.0";
7
+ var version = "0.2.1";
8
8
  //#endregion
9
9
  //#region src/cli.ts
10
10
  const directory = Flag.string("dir").pipe(Flag.withDescription("Inspect exactly this worktree root and ignore smart defaults"), Flag.optional);
11
- const yes = Flag.boolean("yes").pipe(Flag.withAlias("y"), Flag.withDescription("Approve the displayed cleanup plan without prompting"));
11
+ const yes = Flag.boolean("yes").pipe(Flag.withAlias("y"), Flag.withDescription("Approve the displayed cleanup plan without prompting"), Flag.withDefault(false));
12
12
  const handleError = (error) => {
13
13
  const candidate = error;
14
14
  const message = typeof candidate.message === "string" ? candidate.message : String(error);
package/dist/main.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.mjs","names":["packageJson.version"],"sources":["../package.json","../src/cli.ts","../src/main.ts"],"sourcesContent":["","import { Console, Effect } from \"effect\"\nimport { Command, Flag } from \"effect/unstable/cli\"\n\nimport packageJson from \"../package.json\" with { type: \"json\" }\nimport { runCleanup } from \"./cleanup.js\"\n\nconst directory = Flag.string(\"dir\").pipe(\n Flag.withDescription(\"Inspect exactly this worktree root and ignore smart defaults\"),\n Flag.optional\n)\n\nconst yes = Flag.boolean(\"yes\").pipe(\n Flag.withAlias(\"y\"),\n Flag.withDescription(\"Approve the displayed cleanup plan without prompting\")\n)\n\nconst handleError = (error: unknown) => {\n const candidate = error as { readonly message?: unknown; readonly exitCode?: unknown }\n const message = typeof candidate.message === \"string\" ? candidate.message : String(error)\n const exitCode = typeof candidate.exitCode === \"number\" ? candidate.exitCode : 1\n return Console.error(`Error: ${message}`).pipe(\n Effect.andThen(\n Effect.sync(() => {\n process.exitCode = exitCode\n })\n )\n )\n}\n\nexport const command = Command.make(\n \"worktree-cleanup\",\n { directory, yes },\n Effect.fn(\"worktree-cleanup\")(function* ({ directory, yes }) {\n yield* runCleanup({\n cwd: process.cwd(),\n directory,\n yes,\n interactive: process.stdin.isTTY === true\n }).pipe(Effect.catch(handleError))\n })\n).pipe(\n Command.withAlias(\"worktree-clean\"),\n Command.withDescription(\n \"Safely remove clean Git worktrees already integrated into the base branch\"\n ),\n Command.withExamples([\n {\n command: \"worktree-cleanup\",\n description: \"Inspect smart-default worktree roots and ask before deletion\"\n },\n {\n command: \"worktree-cleanup --dir ../worktrees --yes\",\n description: \"Clean one explicit root non-interactively\"\n }\n ])\n)\n\nexport const program = command.pipe(Command.run({ version: packageJson.version }))\n","import { NodeRuntime, NodeServices } from \"@effect/platform-node\"\nimport { Effect, Layer } from \"effect\"\n\nimport { program } from \"./cli.js\"\nimport { Git } from \"./git.js\"\n\nconst MainLayer = Git.layer.pipe(Layer.provideMerge(NodeServices.layer))\n\nprogram.pipe(Effect.provide(MainLayer), NodeRuntime.runMain)\n"],"mappings":";;;;;;;;;ACMA,MAAM,YAAY,KAAK,OAAO,KAAK,CAAC,CAAC,KACnC,KAAK,gBAAgB,8DAA8D,GACnF,KAAK,QACP;AAEA,MAAM,MAAM,KAAK,QAAQ,KAAK,CAAC,CAAC,KAC9B,KAAK,UAAU,GAAG,GAClB,KAAK,gBAAgB,sDAAsD,CAC7E;AAEA,MAAM,eAAe,UAAmB;CACtC,MAAM,YAAY;CAClB,MAAM,UAAU,OAAO,UAAU,YAAY,WAAW,UAAU,UAAU,OAAO,KAAK;CACxF,MAAM,WAAW,OAAO,UAAU,aAAa,WAAW,UAAU,WAAW;CAC/E,OAAO,QAAQ,MAAM,UAAU,SAAS,CAAC,CAAC,KACxC,OAAO,QACL,OAAO,WAAW;EAChB,QAAQ,WAAW;CACrB,CAAC,CACH,CACF;AACF;AA8BA,MAAa,UA5BU,QAAQ,KAC7B,oBACA;CAAE;CAAW;AAAI,GACjB,OAAO,GAAG,kBAAkB,CAAC,CAAC,WAAW,EAAE,WAAW,OAAO;CAC3D,OAAO,WAAW;EAChB,KAAK,QAAQ,IAAI;EACjB;EACA;EACA,aAAa,QAAQ,MAAM,UAAU;CACvC,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,WAAW,CAAC;AACnC,CAAC,CACH,CAAC,CAAC,KACA,QAAQ,UAAU,gBAAgB,GAClC,QAAQ,gBACN,2EACF,GACA,QAAQ,aAAa,CACnB;CACE,SAAS;CACT,aAAa;AACf,GACA;CACE,SAAS;CACT,aAAa;AACf,CACF,CAAC,CAGoB,CAAA,CAAQ,KAAK,QAAQ,IAAI,EAAWA,QAAoB,CAAC,CAAC;;;ACnDjF,MAAM,YAAY,IAAI,MAAM,KAAK,MAAM,aAAa,aAAa,KAAK,CAAC;AAEvE,QAAQ,KAAK,OAAO,QAAQ,SAAS,GAAG,YAAY,OAAO"}
1
+ {"version":3,"file":"main.mjs","names":["packageJson.version"],"sources":["../package.json","../src/cli.ts","../src/main.ts"],"sourcesContent":["","import { Console, Effect } from \"effect\"\nimport { Command, Flag } from \"effect/unstable/cli\"\n\nimport packageJson from \"../package.json\" with { type: \"json\" }\nimport { runCleanup } from \"./cleanup.js\"\n\nconst directory = Flag.string(\"dir\").pipe(\n Flag.withDescription(\"Inspect exactly this worktree root and ignore smart defaults\"),\n Flag.optional\n)\n\nconst yes = Flag.boolean(\"yes\").pipe(\n Flag.withAlias(\"y\"),\n Flag.withDescription(\"Approve the displayed cleanup plan without prompting\"),\n Flag.withDefault(false)\n)\n\nconst handleError = (error: unknown) => {\n const candidate = error as { readonly message?: unknown; readonly exitCode?: unknown }\n const message = typeof candidate.message === \"string\" ? candidate.message : String(error)\n const exitCode = typeof candidate.exitCode === \"number\" ? candidate.exitCode : 1\n return Console.error(`Error: ${message}`).pipe(\n Effect.andThen(\n Effect.sync(() => {\n process.exitCode = exitCode\n })\n )\n )\n}\n\nexport const command = Command.make(\n \"worktree-cleanup\",\n { directory, yes },\n Effect.fn(\"worktree-cleanup\")(function* ({ directory, yes }) {\n yield* runCleanup({\n cwd: process.cwd(),\n directory,\n yes,\n interactive: process.stdin.isTTY === true\n }).pipe(Effect.catch(handleError))\n })\n).pipe(\n Command.withAlias(\"worktree-clean\"),\n Command.withDescription(\n \"Safely remove clean Git worktrees already integrated into the base branch\"\n ),\n Command.withExamples([\n {\n command: \"worktree-cleanup\",\n description: \"Inspect smart-default worktree roots and ask before deletion\"\n },\n {\n command: \"worktree-cleanup --dir ../worktrees --yes\",\n description: \"Clean one explicit root non-interactively\"\n }\n ])\n)\n\nexport const program = command.pipe(Command.run({ version: packageJson.version }))\n","import { NodeRuntime, NodeServices } from \"@effect/platform-node\"\nimport { Effect, Layer } from \"effect\"\n\nimport { program } from \"./cli.js\"\nimport { Git } from \"./git.js\"\n\nconst MainLayer = Git.layer.pipe(Layer.provideMerge(NodeServices.layer))\n\nprogram.pipe(Effect.provide(MainLayer), NodeRuntime.runMain)\n"],"mappings":";;;;;;;;;ACMA,MAAM,YAAY,KAAK,OAAO,KAAK,CAAC,CAAC,KACnC,KAAK,gBAAgB,8DAA8D,GACnF,KAAK,QACP;AAEA,MAAM,MAAM,KAAK,QAAQ,KAAK,CAAC,CAAC,KAC9B,KAAK,UAAU,GAAG,GAClB,KAAK,gBAAgB,sDAAsD,GAC3E,KAAK,YAAY,KAAK,CACxB;AAEA,MAAM,eAAe,UAAmB;CACtC,MAAM,YAAY;CAClB,MAAM,UAAU,OAAO,UAAU,YAAY,WAAW,UAAU,UAAU,OAAO,KAAK;CACxF,MAAM,WAAW,OAAO,UAAU,aAAa,WAAW,UAAU,WAAW;CAC/E,OAAO,QAAQ,MAAM,UAAU,SAAS,CAAC,CAAC,KACxC,OAAO,QACL,OAAO,WAAW;EAChB,QAAQ,WAAW;CACrB,CAAC,CACH,CACF;AACF;AA8BA,MAAa,UA5BU,QAAQ,KAC7B,oBACA;CAAE;CAAW;AAAI,GACjB,OAAO,GAAG,kBAAkB,CAAC,CAAC,WAAW,EAAE,WAAW,OAAO;CAC3D,OAAO,WAAW;EAChB,KAAK,QAAQ,IAAI;EACjB;EACA;EACA,aAAa,QAAQ,MAAM,UAAU;CACvC,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,WAAW,CAAC;AACnC,CAAC,CACH,CAAC,CAAC,KACA,QAAQ,UAAU,gBAAgB,GAClC,QAAQ,gBACN,2EACF,GACA,QAAQ,aAAa,CACnB;CACE,SAAS;CACT,aAAa;AACf,GACA;CACE,SAAS;CACT,aAAa;AACf,CACF,CAAC,CAGoB,CAAA,CAAQ,KAAK,QAAQ,IAAI,EAAWA,QAAoB,CAAC,CAAC;;;ACpDjF,MAAM,YAAY,IAAI,MAAM,KAAK,MAAM,aAAa,aAAa,KAAK,CAAC;AAEvE,QAAQ,KAAK,OAAO,QAAQ,SAAS,GAAG,YAAY,OAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thanaen/worktree-cleanup",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Safely discover and remove stale Git worktrees.",
5
5
  "keywords": [
6
6
  "cleanup",
@@ -50,20 +50,20 @@
50
50
  "prepare": "effect-tsgo patch --typescript --no-oxlint"
51
51
  },
52
52
  "dependencies": {
53
- "@effect/platform-node": "4.0.0-rc.108",
54
- "effect": "4.0.0-rc.108"
53
+ "@effect/platform-node": "4.0.0-rc.112",
54
+ "effect": "4.0.0-rc.112"
55
55
  },
56
56
  "devDependencies": {
57
- "@effect/tsgo": "0.36.4",
58
- "@effect/vitest": "4.0.0-rc.108",
57
+ "@effect/tsgo": "0.39.0",
58
+ "@effect/vitest": "4.0.0-rc.112",
59
59
  "@types/node": "26.2.0",
60
60
  "oxfmt": "0.63.0",
61
61
  "tsdown": "0.22.14",
62
62
  "typescript": "7.0.2",
63
- "vitest": "4.1.10"
63
+ "vitest": "4.1.11"
64
64
  },
65
65
  "engines": {
66
66
  "node": ">=22"
67
67
  },
68
- "packageManager": "pnpm@10.17.1"
68
+ "packageManager": "pnpm@12.3.3"
69
69
  }