@lumpcode/core 0.0.16 → 0.1.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/helpers/executeStepsForContextList/main.d.ts.map +1 -1
- package/dist/helpers/getContextStatus/main.d.ts +5 -0
- package/dist/helpers/getContextStatus/main.d.ts.map +1 -1
- package/dist/helpers/getToDoContextList/main.d.ts +6 -0
- package/dist/helpers/getToDoContextList/main.d.ts.map +1 -1
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/refreshRemoteTrackingRefs/index.d.ts +2 -0
- package/dist/helpers/refreshRemoteTrackingRefs/index.d.ts.map +1 -0
- package/dist/helpers/refreshRemoteTrackingRefs/main.d.ts +11 -0
- package/dist/helpers/refreshRemoteTrackingRefs/main.d.ts.map +1 -0
- package/dist/index.cjs +83 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +83 -38
- package/dist/index.js.map +1 -1
- package/dist/types/ExecShellFn.d.ts +16 -0
- package/dist/types/ExecShellFn.d.ts.map +1 -0
- package/dist/types/GitAddCommandFn.d.ts +7 -1
- package/dist/types/GitAddCommandFn.d.ts.map +1 -1
- package/dist/types/GitCommitCommandFn.d.ts +7 -1
- package/dist/types/GitCommitCommandFn.d.ts.map +1 -1
- package/dist/types/GitPushCommandFn.d.ts +7 -1
- package/dist/types/GitPushCommandFn.d.ts.map +1 -1
- package/dist/usages/runLump/main.d.ts +6 -1
- package/dist/usages/runLump/main.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/helpers/executeStepsForContextList/main.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,WAAW,EACX,eAAe,EACf,uBAAuB,EACvB,OAAO,EACP,MAAM,EACN,aAAa,
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/helpers/executeStepsForContextList/main.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,WAAW,EACX,eAAe,EACf,uBAAuB,EACvB,OAAO,EACP,MAAM,EACN,aAAa,EAMb,aAAa,EAChB,MAAM,aAAa,CAAC;AASrB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AA4BjD,MAAM,MAAM,gCAAgC,CACxC,CAAC,SAAS,aAAa,GAAG,aAAa,EACvC,EAAE,SAAS,aAAa,GAAG,aAAa,IACxC,QAAQ,CAAC,IAAI,CACb,YAAY,CAAC,CAAC,EAAE,EAAE,CAAC,EACjB,YAAY,GACZ,UAAU,GACV,eAAe,GACf,OAAO,GACP,SAAS,GACT,YAAY,GACZ,iBAAiB,GACjB,oBAAoB,GACpB,kBAAkB,GAClB,oBAAoB,GACpB,aAAa,GACb,kBAAkB,GAClB,qBAAqB,GACrB,0BAA0B,CAC/B,CAAC,GAAG;IACD,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qGAAqG;IACrG,MAAM,CAAC,EAAE,WAAW,CAAC;CACxB,CAAA;AAED,wBAAsB,0BAA0B,CAC5C,CAAC,SAAS,aAAa,GAAG,aAAa,EACvC,EAAE,SAAS,aAAa,GAAG,aAAa,EAC1C,EACE,UAAU,EACV,QAAQ,EACR,aAAa,EACb,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,EACX,KAAK,EACL,OAAO,EACP,gBAAgB,EAChB,UAAU,EACV,mBAAmB,EACnB,wBAAwB,EACxB,MAAM,EAAE,WAAW,EACnB,MAAM,GACT,EAAE,gCAAgC,CAAC,CAAC,EAAE,EAAE,CAAC;;;;;;;;;;;IAuUzC;AAED,MAAM,MAAM,gCAAgC,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC,CAAC"}
|
|
@@ -9,5 +9,10 @@ export declare function getContextStatus<V extends LumpVariables = LumpVariables
|
|
|
9
9
|
contextVariables?: Record<string, string>;
|
|
10
10
|
remoteName?: string;
|
|
11
11
|
logger?: Logger;
|
|
12
|
+
/**
|
|
13
|
+
* When true, skip network fetch and read existing remote-tracking refs only.
|
|
14
|
+
* Callers that batch status must refresh once first (e.g. `refreshRemoteTrackingRefs`).
|
|
15
|
+
*/
|
|
16
|
+
skipFetch?: boolean;
|
|
12
17
|
}): Promise<ContextStatus>;
|
|
13
18
|
//# sourceMappingURL=main.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/helpers/getContextStatus/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/helpers/getContextStatus/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAKpE,wBAAsB,gBAAgB,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,EAAE,MAAM,EAAE;IACpF,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,CAAC,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB,GAAG,OAAO,CAAC,aAAa,CAAC,CAwEzB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GetContextListFn, Logger, LumpVariables } from "../../types";
|
|
2
2
|
import { GitCommitMessageFn } from "../../types/GitCommitMessageFn";
|
|
3
|
+
import { type RefreshRemoteTrackingRefsFn } from "../refreshRemoteTrackingRefs";
|
|
3
4
|
export declare function getToDoContextList<V extends LumpVariables = LumpVariables>(params: {
|
|
4
5
|
getContextListFn: GetContextListFn<V>;
|
|
5
6
|
lumpVariables: V;
|
|
@@ -7,6 +8,11 @@ export declare function getToDoContextList<V extends LumpVariables = LumpVariabl
|
|
|
7
8
|
projectRoot: string;
|
|
8
9
|
baseBranch: string;
|
|
9
10
|
logger?: Logger;
|
|
11
|
+
/**
|
|
12
|
+
* One refresh before status reads. Defaults to unlocked core refresh.
|
|
13
|
+
* CLI injects a git-common-dir-locked wrapper.
|
|
14
|
+
*/
|
|
15
|
+
refreshRemoteTrackingRefsFn?: RefreshRemoteTrackingRefsFn;
|
|
10
16
|
}): Promise<import("../..").Failure<{
|
|
11
17
|
message: string;
|
|
12
18
|
}> | import("../..").Success<import("../..").Context<Record<string, string | number | boolean>>[]>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/helpers/getToDoContextList/main.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/helpers/getToDoContextList/main.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,gBAAgB,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EAEH,KAAK,2BAA2B,EACnC,MAAM,8BAA8B,CAAC;AAEtC,wBAAsB,kBAAkB,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,EAAE,MAAM,EAAE;IACtF,gBAAgB,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IACtC,aAAa,EAAE,CAAC,CAAC;IACjB,kBAAkB,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,2BAA2B,CAAC,EAAE,2BAA2B,CAAC;CAC7D;;oGAkFA"}
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -5,5 +5,6 @@ export * from './executeStepsForContextList';
|
|
|
5
5
|
export * from './getCodeBasePaths';
|
|
6
6
|
export * from './getContextStatus';
|
|
7
7
|
export * from './getToDoContextList';
|
|
8
|
+
export * from './refreshRemoteTrackingRefs';
|
|
8
9
|
export * from './validateContextListNames';
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/refreshRemoteTrackingRefs/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Failure, Success } from '../../types';
|
|
2
|
+
export type RefreshRemoteTrackingRefsFn = (input: {
|
|
3
|
+
projectRoot: string;
|
|
4
|
+
remoteName?: string;
|
|
5
|
+
}) => Promise<Success<void> | Failure<string>>;
|
|
6
|
+
/**
|
|
7
|
+
* Refreshes remote-tracking refs for status / planning (one network fetch).
|
|
8
|
+
* Uses `--no-write-fetch-head` so concurrent preflight/pull paths are safer.
|
|
9
|
+
*/
|
|
10
|
+
export declare const refreshRemoteTrackingRefs: RefreshRemoteTrackingRefsFn;
|
|
11
|
+
//# sourceMappingURL=main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/helpers/refreshRemoteTrackingRefs/main.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAIpD,MAAM,MAAM,2BAA2B,GAAG,CAAC,KAAK,EAAE;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,KAAK,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;AAE/C;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,2BAUvC,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -3766,6 +3766,27 @@ async function collectStepsForContext(params) {
|
|
|
3766
3766
|
return collectedSteps;
|
|
3767
3767
|
}
|
|
3768
3768
|
|
|
3769
|
+
async function runOptionalGitCommand(input) {
|
|
3770
|
+
const { label, getCommand, cwd, logger } = input;
|
|
3771
|
+
try {
|
|
3772
|
+
const command = await getCommand();
|
|
3773
|
+
if (command == null || command === '') {
|
|
3774
|
+
return 'ok';
|
|
3775
|
+
}
|
|
3776
|
+
const result = await execAsync(command, { cwd });
|
|
3777
|
+
logger.verbose(`${label} ${JSON.stringify(result)}`);
|
|
3778
|
+
if (!result.success) {
|
|
3779
|
+
logger.error(formatExecFailureMessage({ label, failure: result }));
|
|
3780
|
+
return 'failed';
|
|
3781
|
+
}
|
|
3782
|
+
return 'ok';
|
|
3783
|
+
}
|
|
3784
|
+
catch (error) {
|
|
3785
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
3786
|
+
logger.error(`Failed to run ${label}: ${message}`);
|
|
3787
|
+
return 'failed';
|
|
3788
|
+
}
|
|
3789
|
+
}
|
|
3769
3790
|
async function executeStepsForContextList({ baseBranch, branchFn, lumpVariables, contextList, gitAddCommandFn, gitCommitCommandFn, gitPushCommandFn, gitCommitMessageFn, projectRoot, steps, setupFn, setupWorkspaceFn, teardownFn, teardownWorkspaceFn, getKeepHistoryFilePathFn, logger: loggerInput, signal, }) {
|
|
3770
3791
|
const logger = loggerInput ?? createConsoleLogger({});
|
|
3771
3792
|
const contextNames = contextList.map(context => context.name);
|
|
@@ -3964,39 +3985,39 @@ async function executeStepsForContextList({ baseBranch, branchFn, lumpVariables,
|
|
|
3964
3985
|
...injectedGitAndWorkspaceFnsInput,
|
|
3965
3986
|
context,
|
|
3966
3987
|
};
|
|
3967
|
-
const
|
|
3968
|
-
|
|
3969
|
-
|
|
3988
|
+
const addOutcome = await runOptionalGitCommand({
|
|
3989
|
+
label: `git add for context ${context.name}`,
|
|
3990
|
+
getCommand: () => gitAddCommandFn(perContextInput),
|
|
3991
|
+
cwd: workspacePath,
|
|
3992
|
+
logger,
|
|
3993
|
+
});
|
|
3994
|
+
if (addOutcome === 'failed') {
|
|
3970
3995
|
runFailure = {
|
|
3971
3996
|
success: false,
|
|
3972
3997
|
data: {
|
|
3973
|
-
message: `Failed to add the changes for context ${context.name}
|
|
3998
|
+
message: `Failed to add the changes for context ${context.name}`,
|
|
3974
3999
|
},
|
|
3975
4000
|
};
|
|
3976
4001
|
break;
|
|
3977
4002
|
}
|
|
3978
4003
|
const commitMessage = gitCommitMessageFn({ context, lumpVariables, baseBranch });
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
}));
|
|
3989
|
-
}
|
|
4004
|
+
await runOptionalGitCommand({
|
|
4005
|
+
label: `git commit for context ${context.name}`,
|
|
4006
|
+
getCommand: () => gitCommitCommandFn({
|
|
4007
|
+
...perContextInput,
|
|
4008
|
+
commitMessage,
|
|
4009
|
+
}),
|
|
4010
|
+
cwd: workspacePath,
|
|
4011
|
+
logger,
|
|
4012
|
+
});
|
|
3990
4013
|
}
|
|
3991
4014
|
if (!runFailure) {
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
}));
|
|
3999
|
-
}
|
|
4015
|
+
await runOptionalGitCommand({
|
|
4016
|
+
label: `git push on branch ${branchName}`,
|
|
4017
|
+
getCommand: () => gitPushCommandFn(injectedGitAndWorkspaceFnsInput),
|
|
4018
|
+
cwd: workspacePath,
|
|
4019
|
+
logger,
|
|
4020
|
+
});
|
|
4000
4021
|
}
|
|
4001
4022
|
}
|
|
4002
4023
|
finally {
|
|
@@ -4112,17 +4133,32 @@ async function scanDirectory({ dirPath, allPaths, gitignoresMap, projectRoot, lo
|
|
|
4112
4133
|
}
|
|
4113
4134
|
}
|
|
4114
4135
|
|
|
4136
|
+
/**
|
|
4137
|
+
* Refreshes remote-tracking refs for status / planning (one network fetch).
|
|
4138
|
+
* Uses `--no-write-fetch-head` so concurrent preflight/pull paths are safer.
|
|
4139
|
+
*/
|
|
4140
|
+
const refreshRemoteTrackingRefs = async (input) => {
|
|
4141
|
+
const { projectRoot, remoteName = 'origin' } = input;
|
|
4142
|
+
const result = await execAsync(`git fetch --prune --no-write-fetch-head ${remoteName}`, { cwd: projectRoot });
|
|
4143
|
+
if (!result.success) {
|
|
4144
|
+
return failure(result.data.message);
|
|
4145
|
+
}
|
|
4146
|
+
return success(undefined);
|
|
4147
|
+
};
|
|
4148
|
+
|
|
4115
4149
|
async function getContextStatus(params) {
|
|
4116
|
-
const { contextName, gitCommitMessageFn, projectRoot, baseBranch, lumpVariables: lumpVariablesInput, contextVariables = {}, remoteName = "origin", logger, } = params;
|
|
4150
|
+
const { contextName, gitCommitMessageFn, projectRoot, baseBranch, lumpVariables: lumpVariablesInput, contextVariables = {}, remoteName = "origin", logger, skipFetch = false, } = params;
|
|
4117
4151
|
const lumpVariables = (lumpVariablesInput ?? {});
|
|
4118
4152
|
const commitMessage = gitCommitMessageFn({
|
|
4119
4153
|
context: { name: contextName, variables: contextVariables },
|
|
4120
4154
|
lumpVariables,
|
|
4121
4155
|
baseBranch,
|
|
4122
4156
|
});
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4157
|
+
if (!skipFetch) {
|
|
4158
|
+
const fetchResult = await refreshRemoteTrackingRefs({ projectRoot, remoteName });
|
|
4159
|
+
if (!fetchResult.success)
|
|
4160
|
+
return 'toDo';
|
|
4161
|
+
}
|
|
4126
4162
|
const logResult = await execAsync(`git log --remotes=${remoteName} -F --grep=${shellSingleQuote(commitMessage)} --format=${shellSingleQuote('%H %s')}`, { cwd: projectRoot });
|
|
4127
4163
|
if (!logResult.success)
|
|
4128
4164
|
return 'toDo';
|
|
@@ -4131,6 +4167,7 @@ async function getContextStatus(params) {
|
|
|
4131
4167
|
const matchingHashes = parseGitLogHashSubjectLines(logResultOutput)
|
|
4132
4168
|
.filter((entry) => entry.subject === commitMessage)
|
|
4133
4169
|
.map((entry) => entry.hash);
|
|
4170
|
+
logger?.verbose(`contextName ${contextName}`);
|
|
4134
4171
|
logger?.verbose(`remoteName ${remoteName}`);
|
|
4135
4172
|
logger?.verbose(`baseBranch ${baseBranch}`);
|
|
4136
4173
|
logger?.verbose(`commitMessage ${commitMessage}`);
|
|
@@ -4185,7 +4222,7 @@ function validateContextListNames(contextList) {
|
|
|
4185
4222
|
}
|
|
4186
4223
|
|
|
4187
4224
|
async function getToDoContextList(params) {
|
|
4188
|
-
const { getContextListFn, lumpVariables, gitCommitMessageFn, projectRoot, baseBranch, logger } = params;
|
|
4225
|
+
const { getContextListFn, lumpVariables, gitCommitMessageFn, projectRoot, baseBranch, logger, refreshRemoteTrackingRefsFn = refreshRemoteTrackingRefs, } = params;
|
|
4189
4226
|
const codeBasePathsResult = await getCodeBasePaths({ cwd: projectRoot, logger });
|
|
4190
4227
|
if (!codeBasePathsResult.success) {
|
|
4191
4228
|
return failure({
|
|
@@ -4203,21 +4240,28 @@ async function getToDoContextList(params) {
|
|
|
4203
4240
|
const allCtxNames = contextList.flatMap(context => [context.name, ...(context.options?.dependsOnContexts ?? [])]);
|
|
4204
4241
|
const allCtxNamesSet = new Set(allCtxNames);
|
|
4205
4242
|
const allCtxNamesList = Array.from(allCtxNamesSet);
|
|
4206
|
-
const
|
|
4207
|
-
|
|
4208
|
-
|
|
4243
|
+
const refreshResult = await refreshRemoteTrackingRefsFn({ projectRoot });
|
|
4244
|
+
let contextStatusMap;
|
|
4245
|
+
if (!refreshResult.success) {
|
|
4246
|
+
logger?.warn(`Failed to refresh remote-tracking refs for context status; treating contexts as toDo: ${refreshResult.data}`);
|
|
4247
|
+
contextStatusMap = new Map(allCtxNamesList.map((name) => [name, 'toDo']));
|
|
4248
|
+
}
|
|
4249
|
+
else {
|
|
4250
|
+
const contextStatusList = await Promise.all(allCtxNamesList.map((contextName) => getContextStatus({
|
|
4251
|
+
contextName,
|
|
4209
4252
|
contextVariables: {}, // TODO: Remove contextVariables from getContextStatus, really not needed
|
|
4210
4253
|
gitCommitMessageFn,
|
|
4211
4254
|
lumpVariables,
|
|
4212
4255
|
projectRoot,
|
|
4213
4256
|
baseBranch,
|
|
4214
4257
|
logger,
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4258
|
+
skipFetch: true,
|
|
4259
|
+
})));
|
|
4260
|
+
contextStatusMap = new Map(allCtxNamesList.map((contextName, i) => [contextName, contextStatusList[i]]));
|
|
4261
|
+
}
|
|
4218
4262
|
const contextListToDo = contextList
|
|
4219
|
-
.filter((context
|
|
4220
|
-
const contextStatus =
|
|
4263
|
+
.filter((context) => {
|
|
4264
|
+
const contextStatus = contextStatusMap.get(context.name);
|
|
4221
4265
|
if (contextStatus && contextStatus !== 'toDo')
|
|
4222
4266
|
return false;
|
|
4223
4267
|
const deps = context.options?.dependsOnContexts;
|
|
@@ -4283,7 +4327,7 @@ const defaultSetupWorkspaceFnWithWorktree = async (input) => {
|
|
|
4283
4327
|
};
|
|
4284
4328
|
|
|
4285
4329
|
async function runLump(input) {
|
|
4286
|
-
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, signal, } = input;
|
|
4330
|
+
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, signal, refreshRemoteTrackingRefsFn, } = input;
|
|
4287
4331
|
const lumpVariables = (lumpVariablesInput ?? {});
|
|
4288
4332
|
const logger = loggerInput ?? createConsoleLogger({});
|
|
4289
4333
|
const contextListToDoResult = await getToDoContextList({
|
|
@@ -4293,6 +4337,7 @@ async function runLump(input) {
|
|
|
4293
4337
|
baseBranch,
|
|
4294
4338
|
gitCommitMessageFn,
|
|
4295
4339
|
logger,
|
|
4340
|
+
refreshRemoteTrackingRefsFn,
|
|
4296
4341
|
});
|
|
4297
4342
|
if (!contextListToDoResult.success) {
|
|
4298
4343
|
return set(contextListToDoResult, ['data', 'message'], "Error in runLump: Failed to get to do context list. Original Error: " + contextListToDoResult.data.message);
|
|
@@ -4366,6 +4411,7 @@ exports.nodeErrnoCode = nodeErrnoCode;
|
|
|
4366
4411
|
exports.parseGitLogHashSubjectLines = parseGitLogHashSubjectLines;
|
|
4367
4412
|
exports.pathExists = pathExists;
|
|
4368
4413
|
exports.readHistoryFile = readHistoryFile;
|
|
4414
|
+
exports.refreshRemoteTrackingRefs = refreshRemoteTrackingRefs;
|
|
4369
4415
|
exports.resolveSpawnExecutable = resolveSpawnExecutable;
|
|
4370
4416
|
exports.runLump = runLump;
|
|
4371
4417
|
exports.set = set;
|