@lumpcode/recipes 0.0.19 → 0.1.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/index.cjs CHANGED
@@ -265,6 +265,7 @@ function validateBaseBacklogItem(raw, location) {
265
265
  dependsOn = raw.dependsOn;
266
266
  }
267
267
  return {
268
+ ...raw,
268
269
  name: raw.name,
269
270
  task: raw.task,
270
271
  priority: raw.priority,
@@ -515,39 +516,46 @@ function backlog(options) {
515
516
  const projectRoot = projectRootFromConfigUrl(configUrl);
516
517
  const absoluteBacklogItemsDir = path$1.join(projectRoot, paths.backlogItemsDir);
517
518
  return cliUtils.defineConfig({
518
- getContextListFn: folderBacklogContexts({
519
- backlogItemsDir: absoluteBacklogItemsDir,
520
- parseItem,
521
- async parseContext(item, folderName) {
522
- const resolution = await resolveItem({ item, paths });
523
- if (isIgnoredResolution(resolution)) {
524
- return { ignored: true };
525
- }
526
- const { stage, contextName, variables, additionalDependsOnContexts, } = resolution;
527
- const dependsOnContexts = [
528
- ...(item.dependsOn ?? []),
529
- ...(additionalDependsOnContexts ?? []),
530
- ];
531
- const backlogItemDir = path$1.join(paths.backlogItemsDir, 'todo', folderName);
532
- return {
533
- parsed: {
534
- name: contextName ?? item.name,
535
- variables: {
536
- [BACKLOG_TASK_NAME_VAR]: item.name,
537
- [BACKLOG_TASK_VAR]: item.task,
538
- [BACKLOG_ITEMS_DIR_VAR]: paths.backlogItemsDir,
539
- [BACKLOG_ITEM_DIR_VAR]: backlogItemDir,
540
- [BACKLOG_STAGE_VAR]: stage,
541
- ...variables,
542
- },
543
- options: {
544
- priority: item.priority,
545
- dependsOnContexts: dependsOnContexts.length > 0 ? dependsOnContexts : undefined,
519
+ getContextListFn: async (input) => {
520
+ const listFn = folderBacklogContexts({
521
+ backlogItemsDir: absoluteBacklogItemsDir,
522
+ parseItem,
523
+ async parseContext(item, folderName) {
524
+ const resolution = await resolveItem({
525
+ item,
526
+ paths,
527
+ discoveryBranch: input.discoveryBranch,
528
+ });
529
+ if (isIgnoredResolution(resolution)) {
530
+ return { ignored: true };
531
+ }
532
+ const { stage, contextName, variables, additionalDependsOnContexts, } = resolution;
533
+ const dependsOnContexts = [
534
+ ...(item.dependsOn ?? []),
535
+ ...(additionalDependsOnContexts ?? []),
536
+ ];
537
+ const backlogItemDir = path$1.join(paths.backlogItemsDir, 'todo', folderName);
538
+ return {
539
+ parsed: {
540
+ name: contextName ?? item.name,
541
+ variables: {
542
+ [BACKLOG_TASK_NAME_VAR]: item.name,
543
+ [BACKLOG_TASK_VAR]: item.task,
544
+ [BACKLOG_ITEMS_DIR_VAR]: paths.backlogItemsDir,
545
+ [BACKLOG_ITEM_DIR_VAR]: backlogItemDir,
546
+ [BACKLOG_STAGE_VAR]: stage,
547
+ ...variables,
548
+ },
549
+ options: {
550
+ priority: item.priority,
551
+ dependsOnContexts: dependsOnContexts.length > 0 ? dependsOnContexts : undefined,
552
+ },
546
553
  },
547
- },
548
- };
549
- },
550
- }),
554
+ };
555
+ },
556
+ });
557
+ return listFn(input);
558
+ },
551
559
  steps: [
552
560
  ({ context }) => {
553
561
  const ctx = context;
package/dist/index.d.ts CHANGED
@@ -165,6 +165,8 @@ type BacklogOptions<Item extends BaseBacklogItem, V extends LumpVariables = Lump
165
165
  resolveItem(input: {
166
166
  item: Item;
167
167
  paths: BacklogPaths;
168
+ /** Concrete scan/discovery branch for this context-list invocation. */
169
+ discoveryBranch: string;
168
170
  }): MaybePromise<BacklogItemResolution<Extract<keyof Stages, string>>>;
169
171
  } & Omit<LumpJsConfig<V, SV>, 'contextListJson' | 'contextMatchFn' | 'getContextListFn' | 'prompt' | 'steps'>;
170
172
  declare const BACKLOG_STAGE_VAR = "BACKLOG_STAGE";
package/dist/index.js CHANGED
@@ -263,6 +263,7 @@ function validateBaseBacklogItem(raw, location) {
263
263
  dependsOn = raw.dependsOn;
264
264
  }
265
265
  return {
266
+ ...raw,
266
267
  name: raw.name,
267
268
  task: raw.task,
268
269
  priority: raw.priority,
@@ -513,39 +514,46 @@ function backlog(options) {
513
514
  const projectRoot = projectRootFromConfigUrl(configUrl);
514
515
  const absoluteBacklogItemsDir = path$1.join(projectRoot, paths.backlogItemsDir);
515
516
  return defineConfig({
516
- getContextListFn: folderBacklogContexts({
517
- backlogItemsDir: absoluteBacklogItemsDir,
518
- parseItem,
519
- async parseContext(item, folderName) {
520
- const resolution = await resolveItem({ item, paths });
521
- if (isIgnoredResolution(resolution)) {
522
- return { ignored: true };
523
- }
524
- const { stage, contextName, variables, additionalDependsOnContexts, } = resolution;
525
- const dependsOnContexts = [
526
- ...(item.dependsOn ?? []),
527
- ...(additionalDependsOnContexts ?? []),
528
- ];
529
- const backlogItemDir = path$1.join(paths.backlogItemsDir, 'todo', folderName);
530
- return {
531
- parsed: {
532
- name: contextName ?? item.name,
533
- variables: {
534
- [BACKLOG_TASK_NAME_VAR]: item.name,
535
- [BACKLOG_TASK_VAR]: item.task,
536
- [BACKLOG_ITEMS_DIR_VAR]: paths.backlogItemsDir,
537
- [BACKLOG_ITEM_DIR_VAR]: backlogItemDir,
538
- [BACKLOG_STAGE_VAR]: stage,
539
- ...variables,
540
- },
541
- options: {
542
- priority: item.priority,
543
- dependsOnContexts: dependsOnContexts.length > 0 ? dependsOnContexts : undefined,
517
+ getContextListFn: async (input) => {
518
+ const listFn = folderBacklogContexts({
519
+ backlogItemsDir: absoluteBacklogItemsDir,
520
+ parseItem,
521
+ async parseContext(item, folderName) {
522
+ const resolution = await resolveItem({
523
+ item,
524
+ paths,
525
+ discoveryBranch: input.discoveryBranch,
526
+ });
527
+ if (isIgnoredResolution(resolution)) {
528
+ return { ignored: true };
529
+ }
530
+ const { stage, contextName, variables, additionalDependsOnContexts, } = resolution;
531
+ const dependsOnContexts = [
532
+ ...(item.dependsOn ?? []),
533
+ ...(additionalDependsOnContexts ?? []),
534
+ ];
535
+ const backlogItemDir = path$1.join(paths.backlogItemsDir, 'todo', folderName);
536
+ return {
537
+ parsed: {
538
+ name: contextName ?? item.name,
539
+ variables: {
540
+ [BACKLOG_TASK_NAME_VAR]: item.name,
541
+ [BACKLOG_TASK_VAR]: item.task,
542
+ [BACKLOG_ITEMS_DIR_VAR]: paths.backlogItemsDir,
543
+ [BACKLOG_ITEM_DIR_VAR]: backlogItemDir,
544
+ [BACKLOG_STAGE_VAR]: stage,
545
+ ...variables,
546
+ },
547
+ options: {
548
+ priority: item.priority,
549
+ dependsOnContexts: dependsOnContexts.length > 0 ? dependsOnContexts : undefined,
550
+ },
544
551
  },
545
- },
546
- };
547
- },
548
- }),
552
+ };
553
+ },
554
+ });
555
+ return listFn(input);
556
+ },
549
557
  steps: [
550
558
  ({ context }) => {
551
559
  const ctx = context;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumpcode/recipes",
3
- "version": "0.0.19",
3
+ "version": "0.1.1",
4
4
  "description": "Lumpcode lump recipes and kit helpers",
5
5
  "keywords": [
6
6
  "lumpcode",
@@ -44,8 +44,8 @@
44
44
  "test:watch": "vitest watch"
45
45
  },
46
46
  "dependencies": {
47
- "@lumpcode/cli-utils": "^0.0.16",
48
- "@lumpcode/core": "^0.0.16",
47
+ "@lumpcode/cli-utils": "^0.1.1",
48
+ "@lumpcode/core": "^0.1.1",
49
49
  "js-yaml": "^5.0.0"
50
50
  },
51
51
  "devDependencies": {