Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: devScripts update #510

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
},
"dependencies": {
"@oclif/core": "^3.10.8",
"@salesforce/core": "^6.1.3",
"@salesforce/core": "^6.2.0",
"@salesforce/kit": "^3.0.15",
"@salesforce/source-deploy-retrieve": "^10.0.0",
"@salesforce/source-deploy-retrieve": "^10.0.2",
"@salesforce/ts-types": "^2.0.9",
"fast-xml-parser": "^4.2.5",
"graceful-fs": "^4.2.11",
Expand All @@ -56,9 +56,9 @@
},
"devDependencies": {
"@salesforce/cli-plugins-testkit": "^5.0.2",
"@salesforce/dev-scripts": "^6.0.4",
"@salesforce/dev-scripts": "^7.1.1",
"@types/graceful-fs": "^4.1.8",
"eslint-plugin-sf-plugin": "^1.16.14",
"eslint-plugin-sf-plugin": "^1.16.15",
"shx": "^0.3.4",
"ts-node": "^10.9.1",
"ts-patch": "^3.0.2",
Expand Down
4 changes: 1 addition & 3 deletions src/shared/conflicts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ import { populateTypesAndNames } from './populateTypesAndNames';

export const throwIfConflicts = (conflicts: ConflictResponse[]): void => {
if (conflicts.length > 0) {
const conflictError = new SourceConflictError(`${conflicts.length} conflicts detected`, 'SourceConflictError');
conflictError.setData(conflicts);
throw conflictError;
throw new SourceConflictError(`${conflicts.length} conflicts detected`, conflicts);
}
};

Expand Down
15 changes: 12 additions & 3 deletions src/shared/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,20 @@ export interface ConflictResponse {
filePath: string;
}

export interface SourceConflictError extends SfError {
// this and the related class are not enforced but a convention of this library.
// This helps the consumers get correct typing--if the error name matches SourceConflictError,
// there will be a data property of type ConflictResponse[]
export interface SourceConflictErrorType extends SfError<ConflictResponse[]> {
name: 'SourceConflictError';
data: ConflictResponse[];
}

export class SourceConflictError extends SfError implements SourceConflictError {}
export class SourceConflictError extends SfError<ConflictResponse[]> implements SourceConflictErrorType {
public readonly name: SourceConflictErrorType['name'];
public constructor(message: string, data: ConflictResponse[]) {
super(message);
this.name = 'SourceConflictError';
this.data = data;
}
}

export type ChangeOptionType = ChangeResult | SourceComponent | string;
Loading
Loading