@lumpcode/core 0.0.13 → 0.0.14

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 (38) hide show
  1. package/README.md +2 -2
  2. package/dist/helpers/executeStepsForContextList/main.d.ts +3 -3
  3. package/dist/helpers/executeStepsForContextList/main.d.ts.map +1 -1
  4. package/dist/helpers/getContextStatus/main.d.ts +3 -3
  5. package/dist/helpers/getContextStatus/main.d.ts.map +1 -1
  6. package/dist/helpers/getToDoContextList/main.d.ts +4 -4
  7. package/dist/helpers/getToDoContextList/main.d.ts.map +1 -1
  8. package/dist/index.cjs +8 -6
  9. package/dist/index.cjs.map +1 -1
  10. package/dist/index.js +9 -6
  11. package/dist/index.js.map +1 -1
  12. package/dist/types/BranchFn.d.ts +2 -2
  13. package/dist/types/BranchFn.d.ts.map +1 -1
  14. package/dist/types/CommandFn.d.ts +3 -3
  15. package/dist/types/CommandFn.d.ts.map +1 -1
  16. package/dist/types/ContextStatus.d.ts +1 -7
  17. package/dist/types/ContextStatus.d.ts.map +1 -1
  18. package/dist/types/GetContextListFn.d.ts +3 -3
  19. package/dist/types/GetContextListFn.d.ts.map +1 -1
  20. package/dist/types/GitCommitMessageFn.d.ts +3 -3
  21. package/dist/types/GitCommitMessageFn.d.ts.map +1 -1
  22. package/dist/types/HistoryEntry.d.ts +3 -3
  23. package/dist/types/HistoryEntry.d.ts.map +1 -1
  24. package/dist/types/PostCommandExecFn.d.ts +5 -4
  25. package/dist/types/PostCommandExecFn.d.ts.map +1 -1
  26. package/dist/types/PromptFn.d.ts +4 -4
  27. package/dist/types/PromptFn.d.ts.map +1 -1
  28. package/dist/types/SetupFn.d.ts +2 -2
  29. package/dist/types/SetupFn.d.ts.map +1 -1
  30. package/dist/types/Step.d.ts +6 -5
  31. package/dist/types/Step.d.ts.map +1 -1
  32. package/dist/types/Steps.d.ts +3 -1
  33. package/dist/types/Steps.d.ts.map +1 -1
  34. package/dist/types/TeardownFn.d.ts +2 -2
  35. package/dist/types/TeardownFn.d.ts.map +1 -1
  36. package/dist/usages/runLump/main.d.ts +9 -9
  37. package/dist/usages/runLump/main.d.ts.map +1 -1
  38. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6,7 +6,6 @@ import { extname, dirname } from 'node:path';
6
6
  import * as fs$1 from 'node:fs/promises';
7
7
  import { readFile, mkdir, writeFile } from 'node:fs/promises';
8
8
  import ignore from 'ignore';
9
- import z from 'zod';
10
9
 
11
10
  function set(object, path, value) {
12
11
  const keys = Array.isArray(path) ? path : [path];
@@ -3704,7 +3703,10 @@ async function executeStepsForContextList({ baseBranch, branchFn, lumpVariables,
3704
3703
  }
3705
3704
  }
3706
3705
  if (postCommandExecFn) {
3707
- await postCommandExecFn(postCommandExecFnInput);
3706
+ const returnedSteps = await postCommandExecFn(postCommandExecFnInput);
3707
+ if (returnedSteps != null && returnedSteps.length > 0) {
3708
+ await walkAndExecuteSteps(returnedSteps, nextCallHeadIndex);
3709
+ }
3708
3710
  }
3709
3711
  }
3710
3712
  }
@@ -3843,7 +3845,8 @@ async function scanDirectory({ dirPath, allPaths, gitignoresMap, projectRoot, lo
3843
3845
  }
3844
3846
 
3845
3847
  async function getContextStatus(params) {
3846
- const { contextName, gitCommitMessageFn, projectRoot, baseBranch, lumpVariables = {}, contextVariables = {}, remoteName = "origin", logger, } = params;
3848
+ const { contextName, gitCommitMessageFn, projectRoot, baseBranch, lumpVariables: lumpVariablesInput, contextVariables = {}, remoteName = "origin", logger, } = params;
3849
+ const lumpVariables = (lumpVariablesInput ?? {});
3847
3850
  const commitMessage = gitCommitMessageFn({
3848
3851
  context: { name: contextName, variables: contextVariables },
3849
3852
  lumpVariables,
@@ -3963,7 +3966,6 @@ async function getToDoContextList(params) {
3963
3966
  }
3964
3967
 
3965
3968
  const contextStatus = ['toDo', 'branchPushed', 'finished'];
3966
- const contextStatusSchema = z.enum(contextStatus);
3967
3969
 
3968
3970
  const defaultGitCommitMessageFn = ({ context }) => {
3969
3971
  return `LUMP:${context.name}`;
@@ -4013,7 +4015,8 @@ const defaultSetupWorkspaceFnWithWorktree = async (input) => {
4013
4015
  };
4014
4016
 
4015
4017
  async function runLump(input) {
4016
- const { baseBranch, branchFn, lumpVariables = {}, getContextListFn, gitAddCommandFn = defaultGitAddCommandFn, gitCommitCommandFn = defaultGitCommitCommandFn, gitCommitMessageFn = defaultGitCommitMessageFn, gitPushCommandFn = defaultGitPushCommandFn, numberOfContextsPerBranch = 1, projectRoot, steps, setupFn = () => ({ contextRunState: {} }), setupWorkspaceFn = defaultSetupWorkspaceFn, teardownFn = () => undefined, teardownWorkspaceFn = defaultTeardownWorkspaceFn, getKeepHistoryFilePathFn = () => undefined, logger: loggerInput, } = input;
4018
+ const { baseBranch, branchFn, lumpVariables: lumpVariablesInput, getContextListFn, gitAddCommandFn = defaultGitAddCommandFn, gitCommitCommandFn = defaultGitCommitCommandFn, gitCommitMessageFn = defaultGitCommitMessageFn, gitPushCommandFn = defaultGitPushCommandFn, numberOfContextsPerBranch = 1, projectRoot, steps, setupFn = () => ({ contextRunState: {} }), setupWorkspaceFn = defaultSetupWorkspaceFn, teardownFn = () => undefined, teardownWorkspaceFn = defaultTeardownWorkspaceFn, getKeepHistoryFilePathFn = () => undefined, logger: loggerInput, } = input;
4019
+ const lumpVariables = (lumpVariablesInput ?? {});
4017
4020
  const logger = loggerInput ?? createConsoleLogger({});
4018
4021
  const contextListToDoResult = await getToDoContextList({
4019
4022
  getContextListFn,
@@ -4067,5 +4070,5 @@ async function runLump(input) {
4067
4070
  });
4068
4071
  }
4069
4072
 
4070
- export { appendHistoryEntry, collectStepsForContext, contextStatus, contextStatusSchema, createConsoleLogger, defaultGitAddCommandFn, defaultGitCommitCommandFn, defaultGitCommitMessageFn, defaultGitPushCommandFn, defaultSetupWorkspaceFn, defaultSetupWorkspaceFnWithWorktree, defaultTeardownWorkspaceFn, defaultTeardownWorkspaceFnWithWorktree, execAsync, execBinary, executeStepsForContextList, failure, formatExecFailureMessage, getCodeBasePaths, getContextStatus, getToDoContextList, historyFormatFromPath, parseGitLogHashSubjectLines, pathExists, readHistoryFile, resolveSpawnExecutable, runLump, set, shellSingleQuote, success, validateContextListNames, windowsNpmCmdShimBody, writeHistoryFile };
4073
+ export { appendHistoryEntry, collectStepsForContext, contextStatus, createConsoleLogger, defaultGitAddCommandFn, defaultGitCommitCommandFn, defaultGitCommitMessageFn, defaultGitPushCommandFn, defaultSetupWorkspaceFn, defaultSetupWorkspaceFnWithWorktree, defaultTeardownWorkspaceFn, defaultTeardownWorkspaceFnWithWorktree, execAsync, execBinary, executeStepsForContextList, failure, formatExecFailureMessage, getCodeBasePaths, getContextStatus, getToDoContextList, historyFormatFromPath, parseGitLogHashSubjectLines, pathExists, readHistoryFile, resolveSpawnExecutable, runLump, set, shellSingleQuote, success, validateContextListNames, windowsNpmCmdShimBody, writeHistoryFile };
4071
4074
  //# sourceMappingURL=index.js.map