@lumpcode/cli-utils 0.2.0 → 0.3.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.
Files changed (2) hide show
  1. package/dist/index.d.ts +42 -0
  2. package/package.json +3 -3
package/dist/index.d.ts CHANGED
@@ -61,6 +61,34 @@ type LumpJsConfigStep<V extends LumpVariables = LumpVariables, SV extends StepVa
61
61
  command?: CommandTag | FilePath | Step<V, SV>['commandFn'];
62
62
  }>;
63
63
 
64
+ /**
65
+ * How Lumpcode prepares the per-lump git workspace inside the preflight repo root.
66
+ *
67
+ * - `checkout`: switch the main worktree to a fresh lump branch (default).
68
+ * - `worktree`: add a linked worktree under `.lumpcode/worktrees/<branch>/`.
69
+ */
70
+ type WorkspaceStrategy = 'checkout' | 'worktree';
71
+
72
+ type PostSetupWorkspaceFnInput<V extends LumpVariables = LumpVariables> = {
73
+ baseBranch: string;
74
+ branchName: string;
75
+ contextList: ContextList;
76
+ /** Branch workspace. Already prepared on a real run. Read-only. */
77
+ workspacePath: string;
78
+ executionWorkspacePath: string;
79
+ workspaceStrategy: WorkspaceStrategy;
80
+ projectRoot: string;
81
+ lumpVariables: V;
82
+ };
83
+
84
+ type PostSetupWorkspaceFn<V extends LumpVariables = LumpVariables> = (input: PostSetupWorkspaceFnInput<V>) => MaybePromise<{
85
+ command?: string;
86
+ } | void>;
87
+
88
+ type PostTeardownWorkspaceFn<V extends LumpVariables = LumpVariables> = (input: PostSetupWorkspaceFnInput<V>) => MaybePromise<{
89
+ command?: string;
90
+ } | void>;
91
+
64
92
  type LumpJsConfigSoloStep<V extends LumpVariables = LumpVariables, SV extends StepVariables = StepVariables> = LumpJsConfigStep<V, SV> | LumpJsConfigStep<V, SV>['promptTemplate'] | LumpJsConfigStep<V, SV>['promptFn'];
65
93
  type LumpJsConfig<V extends LumpVariables = LumpVariables, SV extends StepVariables = StepVariables> = MergeObjs<Omit<{
66
94
  [K in keyof RunLumpInput<V, SV>]?: NonNullable<RunLumpInput<V, SV>[K]> extends Function ? (RunLumpInput<V, SV>[K] | FilePath) : RunLumpInput<V, SV>[K];
@@ -89,6 +117,20 @@ type LumpJsConfig<V extends LumpVariables = LumpVariables, SV extends StepVariab
89
117
  registerCommands?: string[];
90
118
  keepHistory?: boolean;
91
119
  verbose?: boolean;
120
+ /**
121
+ * After generated checkout/worktree setup. Mutually exclusive with
122
+ * `postSetupWorkspaceCommand`.
123
+ */
124
+ postSetupWorkspaceFn?: FilePath | PostSetupWorkspaceFn<V>;
125
+ /** Shell fragment in the branch workspace. Mutually exclusive with `postSetupWorkspaceFn`. */
126
+ postSetupWorkspaceCommand?: string;
127
+ /**
128
+ * Before generated workspace teardown. Mutually exclusive with
129
+ * `postTeardownWorkspaceCommand`.
130
+ */
131
+ postTeardownWorkspaceFn?: FilePath | PostTeardownWorkspaceFn<V>;
132
+ /** Shell fragment in the branch workspace. Mutually exclusive with `postTeardownWorkspaceFn`. */
133
+ postTeardownWorkspaceCommand?: string;
92
134
  }>;
93
135
 
94
136
  declare function getContextStatuses(input: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumpcode/cli-utils",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Types, defineX helpers, and runtime utilities for Lumpcode lump configs and recipes",
5
5
  "keywords": [
6
6
  "lumpcode",
@@ -43,8 +43,8 @@
43
43
  "test": "vitest run"
44
44
  },
45
45
  "dependencies": {
46
- "@lumpcode/cli-types": "^0.2.0",
47
- "@lumpcode/core": "^0.2.0",
46
+ "@lumpcode/cli-types": "^0.3.0",
47
+ "@lumpcode/core": "^0.3.0",
48
48
  "js-yaml": "^5.0.0"
49
49
  },
50
50
  "devDependencies": {