@lumpcode/recipes 0.0.13 → 0.0.15
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/README.md +35 -12
- package/dist/index.cjs +263 -133
- package/dist/index.d.ts +47 -43
- package/dist/index.js +261 -133
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -71,25 +71,14 @@ declare function projectRootFromConfigUrl(configUrl: string | URL): string;
|
|
|
71
71
|
/** Fails the context when the artifact referenced by a context variable was not created. */
|
|
72
72
|
declare function requireArtifactStep(artifactPathVarName: string): Step;
|
|
73
73
|
|
|
74
|
-
type BacklogPaths
|
|
74
|
+
type BacklogPaths = {
|
|
75
75
|
lumpPath: string;
|
|
76
76
|
lumpName: string;
|
|
77
|
-
|
|
78
|
-
doneFilePath: string;
|
|
77
|
+
backlogItemsDir: string;
|
|
79
78
|
};
|
|
80
79
|
declare function resolveBacklogPaths(configUrl: string | URL, overrides?: {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}): BacklogPaths$1;
|
|
84
|
-
|
|
85
|
-
/** Moves a finished backlog item from BACKLOG.yml to DONE.yml after the context completes. */
|
|
86
|
-
declare const setTaskDoneStep: (input: {
|
|
87
|
-
backlogVarName: string;
|
|
88
|
-
doneVarName: string;
|
|
89
|
-
}) => Step;
|
|
90
|
-
|
|
91
|
-
type ImplValidateCommand = string | CommandDescriptor | ValidationCommandFn;
|
|
92
|
-
declare function resolveImplValidateCommand(implValidateCommand: ImplValidateCommand): ValidationCommandFn;
|
|
80
|
+
backlogItemsDir?: string;
|
|
81
|
+
}): BacklogPaths;
|
|
93
82
|
|
|
94
83
|
type Recipe<Options, V extends LumpVariables = LumpVariables> = (options: Options) => LumpJsConfig<V>;
|
|
95
84
|
declare function defineRecipe<Options, V extends LumpVariables = LumpVariables>(recipe: Recipe<Options, V>): Recipe<Options, V>;
|
|
@@ -104,6 +93,31 @@ type DoneBacklogItem<T extends BaseBacklogItem = BaseBacklogItem> = T & {
|
|
|
104
93
|
completedAt: string;
|
|
105
94
|
};
|
|
106
95
|
|
|
96
|
+
type FolderBacklogContextsOptions<Item extends BaseBacklogItem = BaseBacklogItem> = {
|
|
97
|
+
backlogItemsDir: string;
|
|
98
|
+
parseItem?: (item: BaseBacklogItem, folderName: string, raw: unknown) => Item;
|
|
99
|
+
parseContext?: (item: Item, folderName: string) => MaybePromise$1<{
|
|
100
|
+
parsed?: Partial<Context>;
|
|
101
|
+
ignored?: boolean;
|
|
102
|
+
}>;
|
|
103
|
+
};
|
|
104
|
+
declare function folderBacklogContexts<Item extends BaseBacklogItem = BaseBacklogItem>({ backlogItemsDir, parseItem, parseContext, }: FolderBacklogContextsOptions<Item>): GetContextListFn;
|
|
105
|
+
|
|
106
|
+
/** Moves a finished backlog item folder from todo/ to completed/ after the context completes. */
|
|
107
|
+
declare const folderSetTaskDoneStep: (input: {
|
|
108
|
+
itemsDirVarName: string;
|
|
109
|
+
nameVarName?: string;
|
|
110
|
+
}) => Step;
|
|
111
|
+
|
|
112
|
+
/** Moves a finished backlog item from BACKLOG.yml to DONE.yml after the context completes. */
|
|
113
|
+
declare const setTaskDoneStep: (input: {
|
|
114
|
+
backlogVarName: string;
|
|
115
|
+
doneVarName: string;
|
|
116
|
+
}) => Step;
|
|
117
|
+
|
|
118
|
+
type ImplValidateCommand = string | CommandDescriptor | ValidationCommandFn;
|
|
119
|
+
declare function resolveImplValidateCommand(implValidateCommand: ImplValidateCommand): ValidationCommandFn;
|
|
120
|
+
|
|
107
121
|
type YmlBacklogContextsOptions<Item extends BaseBacklogItem = BaseBacklogItem> = {
|
|
108
122
|
backlogFilePath: string;
|
|
109
123
|
parseItem?: (item: BaseBacklogItem, index: number, raw: unknown) => Item;
|
|
@@ -114,11 +128,11 @@ type YmlBacklogContextsOptions<Item extends BaseBacklogItem = BaseBacklogItem> =
|
|
|
114
128
|
};
|
|
115
129
|
declare function ymlBacklogContexts<Item extends BaseBacklogItem = BaseBacklogItem>({ backlogFilePath, parseItem, parseContext, }: YmlBacklogContextsOptions<Item>): GetContextListFn;
|
|
116
130
|
|
|
117
|
-
/** Validates and normalizes one
|
|
118
|
-
declare function validateBaseBacklogItem(raw: unknown,
|
|
131
|
+
/** Validates and normalizes one backlog item; throws on invalid input. */
|
|
132
|
+
declare function validateBaseBacklogItem(raw: unknown, location: string): BaseBacklogItem;
|
|
119
133
|
|
|
120
134
|
type AbstractionBacklogOptions = {
|
|
121
|
-
implValidateCommand
|
|
135
|
+
implValidateCommand?: ValidationCommandFn | string;
|
|
122
136
|
/** Lump config module URL — pass `import.meta.url` from `config.ts`. */
|
|
123
137
|
configUrl: string | URL;
|
|
124
138
|
implSteps?: LumpJsConfig['steps'];
|
|
@@ -129,9 +143,7 @@ type AbstractionFinderOptions = {
|
|
|
129
143
|
scanDirectories?: string[];
|
|
130
144
|
customPrompt?(): string;
|
|
131
145
|
maxPendingAbstractions?: number;
|
|
132
|
-
|
|
133
|
-
doneFilePath?: string;
|
|
134
|
-
prdDirPath?: string;
|
|
146
|
+
backlogItemsDir: string;
|
|
135
147
|
} & LumpJsConfig;
|
|
136
148
|
declare const abstractionFinder: Recipe<AbstractionFinderOptions>;
|
|
137
149
|
|
|
@@ -139,12 +151,6 @@ type BacklogStageDefinition = {
|
|
|
139
151
|
steps: NonNullable<LumpJsConfig['steps']>;
|
|
140
152
|
completion: 'keepPending' | 'moveToDone';
|
|
141
153
|
};
|
|
142
|
-
type BacklogPaths = {
|
|
143
|
-
lumpPath: string;
|
|
144
|
-
lumpName: string;
|
|
145
|
-
backlogFilePath: string;
|
|
146
|
-
doneFilePath: string;
|
|
147
|
-
};
|
|
148
154
|
type BacklogItemResolution<StageName extends string> = {
|
|
149
155
|
ignored: true;
|
|
150
156
|
} | {
|
|
@@ -155,10 +161,9 @@ type BacklogItemResolution<StageName extends string> = {
|
|
|
155
161
|
};
|
|
156
162
|
type BacklogOptions<Item extends BaseBacklogItem, Stages extends Record<string, BacklogStageDefinition>> = {
|
|
157
163
|
configUrl: string | URL;
|
|
158
|
-
|
|
159
|
-
doneFilePath?: string;
|
|
164
|
+
backlogItemsDir?: string;
|
|
160
165
|
stages: Stages;
|
|
161
|
-
parseItem?: (item: BaseBacklogItem,
|
|
166
|
+
parseItem?: (item: BaseBacklogItem, folderName: string, raw: unknown) => Item;
|
|
162
167
|
resolveItem(input: {
|
|
163
168
|
item: Item;
|
|
164
169
|
paths: BacklogPaths;
|
|
@@ -167,34 +172,33 @@ type BacklogOptions<Item extends BaseBacklogItem, Stages extends Record<string,
|
|
|
167
172
|
declare const BACKLOG_STAGE_VAR = "BACKLOG_STAGE";
|
|
168
173
|
declare const BACKLOG_TASK_NAME_VAR = "TASK_NAME";
|
|
169
174
|
declare const BACKLOG_TASK_VAR = "TASK";
|
|
170
|
-
declare const
|
|
171
|
-
declare const
|
|
175
|
+
declare const BACKLOG_ITEMS_DIR_VAR = "BACKLOG_ITEMS_DIR";
|
|
176
|
+
declare const BACKLOG_ITEM_DIR_VAR = "BACKLOG_ITEM_DIR";
|
|
172
177
|
|
|
173
178
|
declare function backlog<Item extends BaseBacklogItem, Stages extends Record<string, BacklogStageDefinition>>(options: BacklogOptions<Item, Stages>): LumpJsConfig;
|
|
174
179
|
declare const backlogRecipe: Recipe<BacklogOptions<BaseBacklogItem, Record<string, BacklogStageDefinition>>>;
|
|
175
180
|
|
|
176
181
|
type FeatureBacklogItem = BaseBacklogItem & {
|
|
177
|
-
|
|
182
|
+
manualReq?: boolean;
|
|
178
183
|
};
|
|
179
|
-
type FeatureBacklogStage = '
|
|
184
|
+
type FeatureBacklogStage = 'makeReq' | 'makeTestPlan' | 'testImpl' | 'implementation';
|
|
180
185
|
type FeatureBacklogContextVariables = {
|
|
181
186
|
TASK_NAME: string;
|
|
182
187
|
TASK: string;
|
|
183
|
-
|
|
184
|
-
|
|
188
|
+
BACKLOG_ITEMS_DIR: string;
|
|
189
|
+
BACKLOG_ITEM_DIR: string;
|
|
185
190
|
BACKLOG_STAGE: FeatureBacklogStage;
|
|
186
|
-
|
|
191
|
+
REQ_FILE?: string;
|
|
187
192
|
TEST_PLAN_FILE?: string;
|
|
188
193
|
};
|
|
189
194
|
type FeatureBacklogOptions = {
|
|
190
195
|
configUrl: string | URL;
|
|
191
196
|
baseBranch: string;
|
|
192
|
-
implValidateCommand
|
|
193
|
-
|
|
194
|
-
doneFilePath?: string;
|
|
197
|
+
implValidateCommand?: ValidationCommandFn | string;
|
|
198
|
+
backlogItemsDir?: string;
|
|
195
199
|
} & Omit<LumpJsConfig, 'contextListJson' | 'contextMatchFn' | 'getContextListFn' | 'prompt' | 'steps' | 'baseBranch'>;
|
|
196
|
-
declare function resolveFeatureBacklogItem(item: FeatureBacklogItem, paths: BacklogPaths
|
|
200
|
+
declare function resolveFeatureBacklogItem(item: FeatureBacklogItem, paths: BacklogPaths, projectRoot: string, lumpName: string, baseBranch: string): Promise<BacklogItemResolution<FeatureBacklogStage>>;
|
|
197
201
|
declare const featureBacklog: Recipe<FeatureBacklogOptions>;
|
|
198
202
|
|
|
199
|
-
export {
|
|
200
|
-
export type { AbstractionBacklogOptions, AbstractionFinderOptions, BacklogItemResolution, BacklogOptions, BacklogPaths
|
|
203
|
+
export { BACKLOG_ITEMS_DIR_VAR, BACKLOG_ITEM_DIR_VAR, BACKLOG_STAGE_VAR, BACKLOG_TASK_NAME_VAR, BACKLOG_TASK_VAR, abstractionBacklog, abstractionFinder, backlog, backlogRecipe, defineRecipe, ephemeralContextListFn, featureBacklog, folderBacklogContexts, folderSetTaskDoneStep, getRecursiveSteps, lumpPathAndName, normalizeMaybePromGetter, projectRootFromConfigUrl, requireArtifactStep, resolveBacklogPaths, resolveFeatureBacklogItem, resolveImplValidateCommand, retryUntilGreen, setTaskDoneStep, shellCommand, validateBaseBacklogItem, ymlBacklogContexts };
|
|
204
|
+
export type { AbstractionBacklogOptions, AbstractionFinderOptions, BacklogItemResolution, BacklogOptions, BacklogPaths, BacklogStageDefinition, BaseBacklogItem, DoneBacklogItem, EphemeralContextListFnOptions, FeatureBacklogContextVariables, FeatureBacklogItem, FeatureBacklogOptions, FeatureBacklogStage, FolderBacklogContextsOptions, GetFirstStepsInput, GetRecursiveStepsOptions, ImplValidateCommand, IsValidationCommandResultOkInput, MaybePromGetter, Recipe, RetryUntilGreenInput, StepIndex, ValidationCommandFn, ValidationCommandFnInput, YmlBacklogContextsOptions };
|