fix: replace TS parameter properties with explicit fields for Node strip-types compatibility
MergeConflictError used `public readonly` constructor parameter properties, which are not supported by Node's --experimental-strip-types mode (type stripping only, no TS-to-JS transforms). This crashed 19 test files on import. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
b287457250
commit
33e5ec6d37
1 changed files with 13 additions and 4 deletions
|
|
@ -50,17 +50,26 @@ export interface MergeSliceResult {
|
|||
* caller can dispatch a fix-merge session to resolve it.
|
||||
*/
|
||||
export class MergeConflictError extends Error {
|
||||
readonly conflictedFiles: string[];
|
||||
readonly strategy: "squash" | "merge";
|
||||
readonly branch: string;
|
||||
readonly mainBranch: string;
|
||||
|
||||
constructor(
|
||||
public readonly conflictedFiles: string[],
|
||||
public readonly strategy: "squash" | "merge",
|
||||
public readonly branch: string,
|
||||
public readonly mainBranch: string,
|
||||
conflictedFiles: string[],
|
||||
strategy: "squash" | "merge",
|
||||
branch: string,
|
||||
mainBranch: string,
|
||||
) {
|
||||
super(
|
||||
`${strategy === "merge" ? "Merge" : "Squash-merge"} of "${branch}" into "${mainBranch}" ` +
|
||||
`failed with conflicts in ${conflictedFiles.length} non-.gsd file(s): ${conflictedFiles.join(", ")}`,
|
||||
);
|
||||
this.name = "MergeConflictError";
|
||||
this.conflictedFiles = conflictedFiles;
|
||||
this.strategy = strategy;
|
||||
this.branch = branch;
|
||||
this.mainBranch = mainBranch;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue