@lumpcode/cli-types 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.
- package/dist/index.d.ts +46 -3
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -72,6 +72,34 @@ type GetContextListFnInput<V extends LumpVariables = LumpVariables> = {
|
|
|
72
72
|
};
|
|
73
73
|
type GetContextListFn<V extends LumpVariables = LumpVariables> = (params: GetContextListFnInput<V>) => GetContextListFnOutput;
|
|
74
74
|
|
|
75
|
+
/**
|
|
76
|
+
* How Lumpcode prepares the per-lump git workspace inside the preflight repo root.
|
|
77
|
+
*
|
|
78
|
+
* - `checkout`: switch the main worktree to a fresh lump branch (default).
|
|
79
|
+
* - `worktree`: add a linked worktree under `.lumpcode/worktrees/<branch>/`.
|
|
80
|
+
*/
|
|
81
|
+
type WorkspaceStrategy = 'checkout' | 'worktree';
|
|
82
|
+
|
|
83
|
+
type PostSetupWorkspaceFnInput<V extends LumpVariables = LumpVariables> = {
|
|
84
|
+
baseBranch: string;
|
|
85
|
+
branchName: string;
|
|
86
|
+
contextList: ContextList;
|
|
87
|
+
/** Branch workspace. Already prepared on a real run. Read-only. */
|
|
88
|
+
workspacePath: string;
|
|
89
|
+
executionWorkspacePath: string;
|
|
90
|
+
workspaceStrategy: WorkspaceStrategy;
|
|
91
|
+
projectRoot: string;
|
|
92
|
+
lumpVariables: V;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
type PostSetupWorkspaceFn<V extends LumpVariables = LumpVariables> = (input: PostSetupWorkspaceFnInput<V>) => MaybePromise<{
|
|
96
|
+
command?: string;
|
|
97
|
+
} | void>;
|
|
98
|
+
|
|
99
|
+
type PostTeardownWorkspaceFn<V extends LumpVariables = LumpVariables> = (input: PostSetupWorkspaceFnInput<V>) => MaybePromise<{
|
|
100
|
+
command?: string;
|
|
101
|
+
} | void>;
|
|
102
|
+
|
|
75
103
|
type LumpJsConfigSoloStep<V extends LumpVariables = LumpVariables, SV extends StepVariables = StepVariables> = LumpJsConfigStep<V, SV> | LumpJsConfigStep<V, SV>['promptTemplate'] | LumpJsConfigStep<V, SV>['promptFn'];
|
|
76
104
|
type LumpJsConfig<V extends LumpVariables = LumpVariables, SV extends StepVariables = StepVariables> = MergeObjs<Omit<{
|
|
77
105
|
[K in keyof RunLumpInput<V, SV>]?: NonNullable<RunLumpInput<V, SV>[K]> extends Function ? (RunLumpInput<V, SV>[K] | FilePath) : RunLumpInput<V, SV>[K];
|
|
@@ -100,6 +128,20 @@ type LumpJsConfig<V extends LumpVariables = LumpVariables, SV extends StepVariab
|
|
|
100
128
|
registerCommands?: string[];
|
|
101
129
|
keepHistory?: boolean;
|
|
102
130
|
verbose?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* After generated checkout/worktree setup. Mutually exclusive with
|
|
133
|
+
* `postSetupWorkspaceCommand`.
|
|
134
|
+
*/
|
|
135
|
+
postSetupWorkspaceFn?: FilePath | PostSetupWorkspaceFn<V>;
|
|
136
|
+
/** Shell fragment in the branch workspace. Mutually exclusive with `postSetupWorkspaceFn`. */
|
|
137
|
+
postSetupWorkspaceCommand?: string;
|
|
138
|
+
/**
|
|
139
|
+
* Before generated workspace teardown. Mutually exclusive with
|
|
140
|
+
* `postTeardownWorkspaceCommand`.
|
|
141
|
+
*/
|
|
142
|
+
postTeardownWorkspaceFn?: FilePath | PostTeardownWorkspaceFn<V>;
|
|
143
|
+
/** Shell fragment in the branch workspace. Mutually exclusive with `postTeardownWorkspaceFn`. */
|
|
144
|
+
postTeardownWorkspaceCommand?: string;
|
|
103
145
|
}>;
|
|
104
146
|
|
|
105
147
|
declare function defineConfig<V extends LumpVariables = LumpVariables, SV extends StepVariables = StepVariables>(config: NoInfer<LumpJsConfig<V, SV>>): LumpJsConfig<V, SV>;
|
|
@@ -142,6 +184,7 @@ type LumpJsonConfig<V extends LumpVariables = LumpVariables, SV extends StepVari
|
|
|
142
184
|
|
|
143
185
|
declare const resolvedProjectLocalConfigSchema: z.ZodObject<{
|
|
144
186
|
verbose: z.ZodOptional<z.ZodBoolean>;
|
|
187
|
+
refreshCommand: z.ZodOptional<z.ZodString>;
|
|
145
188
|
command: z.ZodOptional<z.ZodString>;
|
|
146
189
|
maximumNumberOfConcurrentBranches: z.ZodOptional<z.ZodNumber>;
|
|
147
190
|
keepHistory: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -166,7 +209,7 @@ type ResolvedProjectLocalConfig = z.infer<typeof resolvedProjectLocalConfigSchem
|
|
|
166
209
|
* Shape of `.lumpcode/local.json` — Pick from resolved config.
|
|
167
210
|
* `mode` is required on the file schema; other keys optional.
|
|
168
211
|
*/
|
|
169
|
-
type LocalJsonConfig = Pick<ResolvedProjectLocalConfig, 'mode' | 'workspaceStrategy' | 'disabled' | 'maxParallelRun' | 'primaryBranch' | 'primaryBranches' | 'projectBaseBranch' | 'command' | 'maximumNumberOfConcurrentBranches' | 'keepHistory' | 'verbose'>;
|
|
212
|
+
type LocalJsonConfig = Pick<ResolvedProjectLocalConfig, 'mode' | 'workspaceStrategy' | 'disabled' | 'maxParallelRun' | 'primaryBranch' | 'primaryBranches' | 'projectBaseBranch' | 'command' | 'maximumNumberOfConcurrentBranches' | 'keepHistory' | 'verbose' | 'refreshCommand'>;
|
|
170
213
|
|
|
171
214
|
/**
|
|
172
215
|
* Shape of `.lumpcode/local.json` — alias of {@link LocalJsonConfig}.
|
|
@@ -188,7 +231,7 @@ type Mode = 'shared' | 'dedicated';
|
|
|
188
231
|
* Shape of `.lumpcode/project.json` — Pick from resolved config.
|
|
189
232
|
* `projectName` is required on the file schema; other keys optional.
|
|
190
233
|
*/
|
|
191
|
-
type ProjectJsonConfig = Pick<ResolvedProjectLocalConfig, 'projectName' | 'primaryBranch' | 'primaryBranches' | 'projectBaseBranch' | 'command' | 'maximumNumberOfConcurrentBranches' | 'keepHistory'>;
|
|
234
|
+
type ProjectJsonConfig = Pick<ResolvedProjectLocalConfig, 'projectName' | 'primaryBranch' | 'primaryBranches' | 'projectBaseBranch' | 'command' | 'maximumNumberOfConcurrentBranches' | 'keepHistory' | 'refreshCommand'>;
|
|
192
235
|
|
|
193
236
|
/**
|
|
194
237
|
* Shape of `.lumpcode/project.json` — alias of {@link ProjectJsonConfig}.
|
|
@@ -196,4 +239,4 @@ type ProjectJsonConfig = Pick<ResolvedProjectLocalConfig, 'projectName' | 'prima
|
|
|
196
239
|
type ProjectConfig = ProjectJsonConfig;
|
|
197
240
|
|
|
198
241
|
export { defineBranchFn, defineCommand, defineCommandModule, defineCommandSetup, defineCommandTeardown, defineConfig, defineContextMatchFn, defineContextOptionsFn, defineGetContextListFn, defineGitAddCommitFn, defineGitCommitMessageFn, defineGitPushFn, definePostCommandExecFn, definePromptFn, defineSetupFn, defineStep, defineTeardownFn };
|
|
199
|
-
export type { BaseBranchFn, BaseBranchFnInput, CommandModule, CommandTag, ContextMatchFn, ContextOptionsFn, FilePath, FilePathOrString, GetContextListFn, GetContextListFnInput, LocalConfig, LumpJsConfig, LumpJsConfigPostCommandExecFn, LumpJsConfigStep, LumpJsConfigSteps, LumpJsConfigStepsFn, LumpJsConfigStepsItem, LumpJsonConfig, LumpJsonConfigStep, MergeObjs, Mode, ProjectConfig, StepFn };
|
|
242
|
+
export type { BaseBranchFn, BaseBranchFnInput, CommandModule, CommandTag, ContextMatchFn, ContextOptionsFn, FilePath, FilePathOrString, GetContextListFn, GetContextListFnInput, LocalConfig, LumpJsConfig, LumpJsConfigPostCommandExecFn, LumpJsConfigStep, LumpJsConfigSteps, LumpJsConfigStepsFn, LumpJsConfigStepsItem, LumpJsonConfig, LumpJsonConfigStep, MergeObjs, Mode, PostSetupWorkspaceFn, PostSetupWorkspaceFnInput, PostTeardownWorkspaceFn, ProjectConfig, StepFn };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lumpcode/cli-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Types and defineX helpers for Lumpcode CLI lump config and command modules",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lumpcode",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"build": "rollup -c"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@lumpcode/core": "^0.
|
|
40
|
+
"@lumpcode/core": "^0.3.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@rollup/plugin-commonjs": "^28.0.1",
|