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

feat: migrate from @salesforce/core v6 -> v7 #5556

Merged
merged 24 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a4bb665
chore: @salesforce/core v6.7.4 -> v7.2.0
daphne-sfdc Apr 15, 2024
1744f03
chore: @salesforce/source-deploy-retrieve v10.3.3 -> v11.0.1
daphne-sfdc Apr 15, 2024
3eda513
chore: @salesforce/source-tracking v5.1.11 -> v6.0.2
daphne-sfdc Apr 15, 2024
ff75cb9
chore: @salesforce/apex-node v4.0.5 -> v5.0.0-beta.0
daphne-sfdc Apr 15, 2024
11ec6b4
chore: jsforce v2.0.0-beta.29 -> @jsforce/jsforce-node v3.1.0
daphne-sfdc Apr 15, 2024
c9cc1e5
chore: replace @salesforce/core/lib/testSetup with @salesforce/core/t…
daphne-sfdc Apr 15, 2024
4f9f6c4
chore: @salesforce/templates v60.1.0 -> v60.1.2
daphne-sfdc Apr 18, 2024
3e8f684
chore: change all interfaces to types to match new standard
daphne-sfdc Apr 18, 2024
3722e1a
Merge branch 'develop' into daphne/core-v6-v7
daphne-sfdc Apr 18, 2024
6ba952b
chore: change all imports of jsforce to @jsforce/jsforce-node
daphne-sfdc Apr 18, 2024
6076933
Merge remote-tracking branch 'origin/develop' into daphne/core-v6-v7
daphne-sfdc Apr 25, 2024
ef5b9f5
chore: @salesforce/apex-node v5.0.0-beta.0 -> v6.0.0
daphne-sfdc Apr 25, 2024
2bddf2d
revert: undo explicitly setting extensionName to salesforcedx-vscode-…
daphne-sfdc Apr 25, 2024
45c561a
chore: update all salesforce dependencies to latest version
daphne-sfdc Apr 26, 2024
bd84d3a
Merge branch 'develop' into daphne/core-v6-v7
daphne-sfdc Apr 26, 2024
38a92f9
test: mock Logger, Messages, and SfError in @salesforce/core for work…
daphne-sfdc Apr 27, 2024
076a422
test: mock StateAggregator in @salesforce/core for workspaceContextUt…
daphne-sfdc Apr 28, 2024
81f6370
test: mock AuthInfo and Connection in @salesforce/core for workspaceC…
daphne-sfdc Apr 28, 2024
8f94ab5
test: utilize Jest mock function
daphne-sfdc Apr 28, 2024
bc9e2b5
chore: fix missing semicolon reported by lerna lint
daphne-sfdc Apr 28, 2024
10aea10
Merge branch 'develop' into daphne/core-v6-v7
daphne-sfdc Apr 29, 2024
c6052ee
Merge branch 'develop' into daphne/core-v6-v7
peternhale Apr 29, 2024
dea9de6
chore: remove JsonMap from export type TelemetryModelJson
daphne-sfdc Apr 30, 2024
3b4a2eb
Merge branch 'develop' into daphne/core-v6-v7
mingxuanzhangsfdx Apr 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
714 changes: 177 additions & 537 deletions package-lock.json

Large diffs are not rendered by default.

26 changes: 16 additions & 10 deletions packages/salesforcedx-apex-debugger/src/adapter/apexDebug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ export type TraceCategory =
| 'breakpoints'
| 'streaming';

export interface LaunchRequestArguments
extends DebugProtocol.LaunchRequestArguments {
export type LaunchRequestArguments = DebugProtocol.LaunchRequestArguments & {
// comma separated list of trace selectors (see TraceCategory)
trace?: boolean | string;
userIdFilter?: string[];
Expand All @@ -117,11 +116,11 @@ export interface LaunchRequestArguments
connectType?: string;
workspaceSettings: WorkspaceSettings;
lineBreakpointInfo?: LineBreakpointInfo[];
}
};

export interface SetExceptionBreakpointsArguments {
export type SetExceptionBreakpointsArguments = {
exceptionInfo: ExceptionBreakpointInfo;
}
};

export class ApexDebugStackFrameInfo {
public readonly requestId: string;
Expand Down Expand Up @@ -245,7 +244,7 @@ export class ApexVariable extends Variable {

export type FilterType = 'named' | 'indexed' | 'all';

export interface VariableContainer {
export type VariableContainer = {
expand(
session: ApexDebug,
filter: FilterType,
Expand All @@ -254,7 +253,7 @@ export interface VariableContainer {
): Promise<ApexVariable[]>;

getNumberOfChildren(): number | undefined;
}
};

export type ScopeType = 'local' | 'static' | 'global';

Expand Down Expand Up @@ -744,7 +743,9 @@ export class ApexDebug extends LoggingDebugSession {
else {
this.sendEvent(
new Event(SEND_METRIC_EVENT, {
subject: nls.localize('interactive_debugger_launched_successfully'),
subject: nls.localize(
'interactive_debugger_launched_successfully'
),
type: 'startInteractiveDebuggerSuccess'
})
);
Expand All @@ -762,13 +763,18 @@ export class ApexDebug extends LoggingDebugSession {
if (error === undefined) {
this.sendEvent(
new Event(SEND_METRIC_EVENT, {
subject: nls.localize('isv_debugger_session_authentication_invalid'),
subject: nls.localize(
'isv_debugger_session_authentication_invalid'
),
type: 'startIsvDebuggerAuthenticationInvalid'
})
);
}
// telemetry for invalid org-isv-debugger-url
else if (String(error) === "TypeError: Cannot read properties of undefined (reading 'pathname')") {
else if (
String(error) ===
"TypeError: Cannot read properties of undefined (reading 'pathname')"
) {
this.sendEvent(
new Event(SEND_METRIC_EVENT, {
subject: nls.localize('org_isv_debugger_url_invalid'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/

export interface ExceptionBreakpointInfo {
export type ExceptionBreakpointInfo = {
label: string;
typeref: string;
breakMode: string;
uri?: string;
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/

export interface LineBreakpointInfo {
export type LineBreakpointInfo = {
uri: string;
typeref: string;
lines: number[];
}
};

export interface LineBreakpointsInTyperef {
export type LineBreakpointsInTyperef = {
typeref: string;
lines: number[];
}
};

export interface ApexBreakpointLocation {
export type ApexBreakpointLocation = {
line: number;
breakpointId: string;
}
};
82 changes: 42 additions & 40 deletions packages/salesforcedx-apex-debugger/src/commands/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,32 @@
* 2. Input those responses into {@link http://json2ts.com/} to generate Typescript interfaces.
* 3. Remove duplicate interfaces that are used in more than one response object.
* 4. Fixed bogus generated interface ReferenceEnum
*
* NOTE: These interfaces were converted to types during the Core v6 -> v7 upgrade to conform to new standards.
*/
export interface DebuggerResponse {
export type DebuggerResponse = {
referencesResponse: ReferencesResponse;
frameResponse: FrameResponse;
stateResponse: StateResponse;
}
};

export interface ReferencesResponse {
export type ReferencesResponse = {
references: References;
}
};

export interface FrameResponse {
export type FrameResponse = {
frame: Frame;
}
};

export interface StateResponse {
export type StateResponse = {
state: State;
}
};

export interface References {
export type References = {
references: Reference[];
}
};

export interface Reference {
export type Reference = {
type: string;
id: number;
typeRef: string;
Expand All @@ -44,79 +46,79 @@ export interface Reference {
offset?: number;
value?: Value[];
tuple?: Tuple[];
}
};

export interface Value {
export type Value = {
name: string;
declaredTypeRef: string;
nameForMessages: string;
ref?: number;
value?: string;
}
};

export interface Field extends Value {
export type Field = Value & {
index: number;
}
};

export interface Tuple {
export type Tuple = {
key: Value;
value: Value;
}
};

export interface Frame {
export type Frame = {
locals: Locals;
statics: Statics;
globals: Globals;
stackFrame: StackFrame;
references?: References;
}
};

export interface Locals {
export type Locals = {
frameNumber: number;
local: LocalValue[];
}
};

export interface LocalValue extends Value {
export type LocalValue = Value & {
slot: number;
}
};

export interface Statics {
export type Statics = {
typeRef: string;
static: Value[];
}
};

export interface Globals {
export type Globals = {
global: Value[];
}
};

export interface StackFrame {
export type StackFrame = {
typeRef: string;
fullName: string;
lineNumber: number;
frameNumber: number;
}
};

export interface State {
export type State = {
locals: Locals;
statics: Statics;
globals: Globals;
stack: Stack;
references?: References;
}
};

export interface Stack {
export type Stack = {
stackFrame: StackFrame[];
}
};

export interface DebuggerRequest {
export type DebuggerRequest = {
getReferencesRequest: GetReferenceRequest;
}
};

export interface GetReferenceRequest {
export type GetReferenceRequest = {
reference: ReferenceRequest[];
}
};

export interface ReferenceRequest {
export type ReferenceRequest = {
reference: number;
offset?: number;
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ export enum ApexDebuggerEventType {
SystemWarning
}

export interface StreamingEvent {
export type StreamingEvent = {
createdDate: string;
replayId: number;
type: string;
}
};

export interface ApexDebuggerEvent {
export type ApexDebuggerEvent = {
SessionId: string;
RequestId?: string;
BreakpointId?: string;
Expand All @@ -43,12 +43,12 @@ export interface ApexDebuggerEvent {
FileName?: string;
Line?: number;
Stacktrace?: string;
}
};

export interface DebuggerMessage {
export type DebuggerMessage = {
event: StreamingEvent;
sobject: ApexDebuggerEvent;
}
};

export class StreamingClientInfo {
public readonly channel: string;
Expand Down
12 changes: 6 additions & 6 deletions packages/salesforcedx-apex-debugger/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ export enum VscodeDebuggerMessageType {
Error
}

export interface VscodeDebuggerMessage {
export type VscodeDebuggerMessage = {
type: VscodeDebuggerMessageType;
message: string;
}
};

export interface WorkspaceSettings {
export type WorkspaceSettings = {
proxyUrl: string;
proxyStrictSSL: boolean;
proxyAuth: string;
connectionTimeoutMs: number;
setBreakpointTimeoutMs: number;
}
};

// Define Metric object to be used for sending attributes to AppInsights telemetry
// NOTE: Refer to attribute names 'message' and 'eventName' defined in sendTelemetryEvent() in telemetryReporter.d.ts, which match the names in AppInsights telemetry
export interface Metric {
export type Metric = {
message: string; // match 'subject' attribute in Event from messages.d.ts
eventName: string; // match 'type' attribute in Event from messages.d.ts
}
};

// Type guard to check if the object conforms to Metric
export const isMetric = (input: unknown): input is Metric =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,13 @@ export enum Step {
Run
}

export interface LaunchRequestArguments
extends DebugProtocol.LaunchRequestArguments {
export type LaunchRequestArguments = DebugProtocol.LaunchRequestArguments & {
logFile: string;
stopOnEntry?: boolean | true;
trace?: boolean | string;
lineBreakpointInfo?: LineBreakpointInfo[];
projectPath: string | undefined;
}
};

export class ApexVariable extends Variable {
public readonly type: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/

export interface LineBreakpointInfo {
export type LineBreakpointInfo = {
uri: string;
typeref: string;
lines: number[];
}
};

export { BreakpointUtil } from './breakpointUtil';
import { BreakpointUtil } from './breakpointUtil';
export const breakpointUtil = BreakpointUtil.getInstance();