@lumpcode/cli-utils 0.2.0 → 0.3.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.
Files changed (2) hide show
  1. package/dist/index.d.ts +47 -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];
@@ -86,9 +114,28 @@ type LumpJsConfig<V extends LumpVariables = LumpVariables, SV extends StepVariab
86
114
  maximumNumberOfConcurrentBranches?: number;
87
115
  prompt?: LumpJsConfigSoloStep<V, SV>;
88
116
  steps?: LumpJsConfigSteps<V, SV> | LumpJsConfigStepsItem<V, SV>;
117
+ /**
118
+ * Extra command tags to pre-load before composed setup/teardown.
119
+ * A tag top-level `command` is pre-registered automatically; list other
120
+ * tags that appear only in dynamic/recursive returns.
121
+ */
89
122
  registerCommands?: string[];
90
123
  keepHistory?: boolean;
91
124
  verbose?: boolean;
125
+ /**
126
+ * After generated checkout/worktree setup. Mutually exclusive with
127
+ * `postSetupWorkspaceCommand`.
128
+ */
129
+ postSetupWorkspaceFn?: FilePath | PostSetupWorkspaceFn<V>;
130
+ /** Shell fragment in the branch workspace. Mutually exclusive with `postSetupWorkspaceFn`. */
131
+ postSetupWorkspaceCommand?: string;
132
+ /**
133
+ * Before generated workspace teardown. Mutually exclusive with
134
+ * `postTeardownWorkspaceCommand`.
135
+ */
136
+ postTeardownWorkspaceFn?: FilePath | PostTeardownWorkspaceFn<V>;
137
+ /** Shell fragment in the branch workspace. Mutually exclusive with `postTeardownWorkspaceFn`. */
138
+ postTeardownWorkspaceCommand?: string;
92
139
  }>;
93
140
 
94
141
  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.1",
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.1",
47
+ "@lumpcode/core": "^0.3.1",
48
48
  "js-yaml": "^5.0.0"
49
49
  },
50
50
  "devDependencies": {