diff --git a/.github/actions/check-feature-request/lib/src/index.js b/.github/actions/check-feature-request/lib/src/index.js index 7d1d5db286..fb1524d324 100644 --- a/.github/actions/check-feature-request/lib/src/index.js +++ b/.github/actions/check-feature-request/lib/src/index.js @@ -1,91 +1,83 @@ -"use strict"; +'use strict'; /* * Copyright (c) 2024, salesforce.com, inc. * All rights reserved. * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -Object.defineProperty(exports, "__esModule", { value: true }); -const core_1 = require("@actions/core"); -const github_1 = require("@actions/github"); +Object.defineProperty(exports, '__esModule', { value: true }); +const core_1 = require('@actions/core'); +const github_1 = require('@actions/github'); async function run() { - try { - const issue = github_1.context.payload.issue; - if (!issue) { - (0, core_1.setFailed)("github.context.payload.issue does not exist"); - return; - } - // Temporary check to prevent this action from running on old issues - // This will prevent noise on tickets already being investigated - // This can be removed once the action has been running for a while - const creationDate = new Date(issue.created_at); - const cutoffDate = new Date("2023-06-14T00:00:00Z"); - if (creationDate < cutoffDate) { - console.log("Issue was created before 6/14/2023, skipping"); - return; - } - // Create a GitHub client - const token = (0, core_1.getInput)("repo-token"); - const octokit = (0, github_1.getOctokit)(token); - // Get owner and repo from context - const owner = github_1.context.repo.owner; - const repo = github_1.context.repo.repo; - const issue_number = issue.number; - console.log("Issue URL:", issue.html_url); - const { body } = issue; - const { login: author } = issue.user; - const { data: comments } = await getAllComments(); - // For version checks, we only care about comments from the author - const authorComments = comments.filter((comment) => comment?.user?.login === author); - // Build an array of the issue body and all of the comment bodies - const bodies = [ - body, - ...authorComments.map((comment) => comment.body), - ].filter((body) => body !== undefined); - console.log('bodies = ' + JSON.stringify(bodies)); - console.log('bodies.length = ' + bodies.length); - const core = require('@actions/core'); - if (bodies[0] === null) { - core.setOutput("is_feature_request", "false"); - } - else { - const featureRequestRegex = /(feature\s*request)/ig; - // Search all bodies and get an array of all versions found (first capture group) - const featureRequests = bodies - .map((body) => [...body.matchAll(featureRequestRegex)].map((match) => match[1])) - .flat(); - if (featureRequests.length > 0) { - console.log('This issue is a feature request!'); - addLabel("type:enhancements"); - core.setOutput("is_feature_request", "true"); - } - else { - core.setOutput("is_feature_request", "false"); - } - } - // --------- - // FUNCTIONS - // --------- - async function getAllComments() { - return await octokit.rest.issues.listComments({ - owner, - repo, - issue_number, - }); - } - async function addLabel(label) { - await octokit.rest.issues.addLabels({ - owner, - repo, - issue_number, - labels: [label], - }); - } + try { + const issue = github_1.context.payload.issue; + if (!issue) { + (0, core_1.setFailed)('github.context.payload.issue does not exist'); + return; } - catch (err) { - const error = err; - (0, core_1.setFailed)(error.message); + // Temporary check to prevent this action from running on old issues + // This will prevent noise on tickets already being investigated + // This can be removed once the action has been running for a while + const creationDate = new Date(issue.created_at); + const cutoffDate = new Date('2023-06-14T00:00:00Z'); + if (creationDate < cutoffDate) { + console.log('Issue was created before 6/14/2023, skipping'); + return; } + // Create a GitHub client + const token = (0, core_1.getInput)('repo-token'); + const octokit = (0, github_1.getOctokit)(token); + // Get owner and repo from context + const owner = github_1.context.repo.owner; + const repo = github_1.context.repo.repo; + const issue_number = issue.number; + console.log('Issue URL:', issue.html_url); + const { body } = issue; + const { login: author } = issue.user; + const { data: comments } = await getAllComments(); + // For version checks, we only care about comments from the author + const authorComments = comments.filter(comment => comment?.user?.login === author); + // Build an array of the issue body and all of the comment bodies + const bodies = [body, ...authorComments.map(comment => comment.body)].filter(body => body !== undefined); + console.log('bodies = ' + JSON.stringify(bodies)); + console.log('bodies.length = ' + bodies.length); + const core = require('@actions/core'); + if (bodies[0] === null) { + core.setOutput('is_feature_request', 'false'); + } else { + const featureRequestRegex = /(feature\s*request)/gi; + // Search all bodies and get an array of all versions found (first capture group) + const featureRequests = bodies.map(body => [...body.matchAll(featureRequestRegex)].map(match => match[1])).flat(); + if (featureRequests.length > 0) { + console.log('This issue is a feature request!'); + addLabel('type:enhancements'); + core.setOutput('is_feature_request', 'true'); + } else { + core.setOutput('is_feature_request', 'false'); + } + } + // --------- + // FUNCTIONS + // --------- + async function getAllComments() { + return await octokit.rest.issues.listComments({ + owner, + repo, + issue_number + }); + } + async function addLabel(label) { + await octokit.rest.issues.addLabels({ + owner, + repo, + issue_number, + labels: [label] + }); + } + } catch (err) { + const error = err; + (0, core_1.setFailed)(error.message); + } } run(); -//# sourceMappingURL=index.js.map \ No newline at end of file +//# sourceMappingURL=index.js.map diff --git a/.github/actions/new-issue/lib/src/index.js b/.github/actions/new-issue/lib/src/index.js index 6e2c55bfb0..05cc998a32 100644 --- a/.github/actions/new-issue/lib/src/index.js +++ b/.github/actions/new-issue/lib/src/index.js @@ -1,66 +1,65 @@ -"use strict"; +'use strict'; /* * Copyright (c) 2024, salesforce.com, inc. * All rights reserved. * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -Object.defineProperty(exports, "__esModule", { value: true }); -const core_1 = require("@actions/core"); -const github_1 = require("@actions/github"); +Object.defineProperty(exports, '__esModule', { value: true }); +const core_1 = require('@actions/core'); +const github_1 = require('@actions/github'); async function run() { - try { - // The issue request exists on payload when an issue is created - // Sets action status to failed when issue does not exist on payload. - const issue = github_1.context.payload.issue; - if (!issue) { - (0, core_1.setFailed)("github.context.payload.issue does not exist"); - return; - } - // Get input parameters. - const token = (0, core_1.getInput)("repo-token"); - const message = (0, core_1.getInput)("message"); - const label = (0, core_1.getInput)("label"); - console.log("message: ", message); - console.log("label: ", label); - // Create a GitHub client. - const octokit = (0, github_1.getOctokit)(token); - // Get owner and repo from context - const owner = github_1.context.repo.owner; - const repo = github_1.context.repo.repo; - // Create a comment on Issue - // https://octokit.github.io/rest.js/#octokit-routes-issues-create-comment - console.log("owner: " + owner); - console.log("repo: " + repo); - console.log("issue number: " + issue.number); - const issueLabels = issue.labels; - console.log("issue labels: ", issueLabels); - const { data: comments } = await octokit.rest.issues.listComments({ - owner, - repo, - issue_number: issue.number, - }); - // If we have comments check out that this comment has not been previously commented - if (comments.length) { - if (comments.some((comment) => comment.body === message)) { - console.log("Already commented"); - return; - } - } - const response = await octokit.rest.issues.createComment({ - owner, - repo, - // eslint-disable-next-line @typescript-eslint/camelcase - issue_number: issue.number, - body: message, - }); - console.log("created comment URL: " + response.data.html_url); - (0, core_1.setOutput)("comment-url", response.data.html_url); + try { + // The issue request exists on payload when an issue is created + // Sets action status to failed when issue does not exist on payload. + const issue = github_1.context.payload.issue; + if (!issue) { + (0, core_1.setFailed)('github.context.payload.issue does not exist'); + return; } - catch (err) { - const error = err; - (0, core_1.setFailed)(error.message); + // Get input parameters. + const token = (0, core_1.getInput)('repo-token'); + const message = (0, core_1.getInput)('message'); + const label = (0, core_1.getInput)('label'); + console.log('message: ', message); + console.log('label: ', label); + // Create a GitHub client. + const octokit = (0, github_1.getOctokit)(token); + // Get owner and repo from context + const owner = github_1.context.repo.owner; + const repo = github_1.context.repo.repo; + // Create a comment on Issue + // https://octokit.github.io/rest.js/#octokit-routes-issues-create-comment + console.log('owner: ' + owner); + console.log('repo: ' + repo); + console.log('issue number: ' + issue.number); + const issueLabels = issue.labels; + console.log('issue labels: ', issueLabels); + const { data: comments } = await octokit.rest.issues.listComments({ + owner, + repo, + issue_number: issue.number + }); + // If we have comments check out that this comment has not been previously commented + if (comments.length) { + if (comments.some(comment => comment.body === message)) { + console.log('Already commented'); + return; + } } + const response = await octokit.rest.issues.createComment({ + owner, + repo, + // eslint-disable-next-line @typescript-eslint/camelcase + issue_number: issue.number, + body: message + }); + console.log('created comment URL: ' + response.data.html_url); + (0, core_1.setOutput)('comment-url', response.data.html_url); + } catch (err) { + const error = err; + (0, core_1.setFailed)(error.message); + } } run(); -//# sourceMappingURL=index.js.map \ No newline at end of file +//# sourceMappingURL=index.js.map diff --git a/.github/actions/validate-issue/lib/src/index.js b/.github/actions/validate-issue/lib/src/index.js index 61f9c73f67..5a530661fe 100644 --- a/.github/actions/validate-issue/lib/src/index.js +++ b/.github/actions/validate-issue/lib/src/index.js @@ -1,354 +1,338 @@ -"use strict"; +'use strict'; /* * Copyright (c) 2024, salesforce.com, inc. * All rights reserved. * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -Object.defineProperty(exports, "__esModule", { value: true }); -const core_1 = require("@actions/core"); -const github_1 = require("@actions/github"); -const child_process_1 = require("child_process"); -const semver = require("semver"); -const fs_1 = require("fs"); -const path = require("path"); -const nodeVersions_1 = require("./nodeVersions"); +Object.defineProperty(exports, '__esModule', { value: true }); +const core_1 = require('@actions/core'); +const github_1 = require('@actions/github'); +const child_process_1 = require('child_process'); +const semver = require('semver'); +const fs_1 = require('fs'); +const path = require('path'); +const nodeVersions_1 = require('./nodeVersions'); async function run() { - try { - const issue = github_1.context.payload.issue; - if (!issue) { - (0, core_1.setFailed)("github.context.payload.issue does not exist"); - return; + try { + const issue = github_1.context.payload.issue; + if (!issue) { + (0, core_1.setFailed)('github.context.payload.issue does not exist'); + return; + } + // Temporary check to prevent this action from running on old issues + // This will prevent noise on tickets already being investigated + // This can be removed once the action has been running for a while + const creationDate = new Date(issue.created_at); + const cutoffDate = new Date('2023-06-14T00:00:00Z'); + if (creationDate < cutoffDate) { + console.log('Issue was created before 6/14/2023, skipping'); + return; + } + // Create a GitHub client + const token = (0, core_1.getInput)('repo-token'); + const octokit = (0, github_1.getOctokit)(token); + // Get owner and repo from context + const owner = github_1.context.repo.owner; + const repo = github_1.context.repo.repo; + const issue_number = issue.number; + console.log('Issue URL:', issue.html_url); + const { body } = issue; + const { login: author } = issue.user; + const { data: comments } = await getAllComments(); + // For version checks, we only care about comments from the author + const authorComments = comments.filter(comment => comment?.user?.login === author); + // Build an array of the issue body and all of the comment bodies + const bodies = [body, ...authorComments.map(comment => comment.body)].filter(body => body !== undefined); + console.log('bodies = ' + JSON.stringify(bodies)); + console.log('bodies.length = ' + bodies.length); + if (bodies[0] === null) { + console.log('No content provided in issue body'); + const message = getFile('../../messages/provide-version.md', { + THE_AUTHOR: issue.user.login + }); + postComment(message); + addLabel('missing required information'); + } else { + let extensionsValid = true; + let vscodeValid = true; + let osVersionValid = true; + let cliValid = true; + let lastWorkingVersionValid = true; + let provideVersionAlreadyRequested = false; + // Checking Salesforce Extension Pack version + // The text "Salesforce Extension Version in VS Code" can be either bolded or unbolded + const extensionsVersionRegex = + /(?:\*{2}Salesforce Extension Version in VS Code\*{2}:\s*v?(\d{2}\.\d{1,2}\.\d))|(?:Salesforce Extension Version in VS Code:\s*v?(\d{2}\.\d{1,2}\.\d))/g; + // Search all bodies and get an array of all versions found (first or second capture group) + const extensionsVersions = bodies + .map(body => [...body.matchAll(extensionsVersionRegex)].map(match => match[1] || match[2])) + .flat(); + console.log('extensionsVersions', extensionsVersions); + if (extensionsVersions.length > 0) { + const extensionsLatest = getLatestExtensionsVersion(); + console.log('extensionsLatest', extensionsLatest); + const oneSatisfies = extensionsVersions.some(version => semver.gte(version, extensionsLatest)); + if (!oneSatisfies) { + const oldExtensions = getFile('../../messages/old-extensions.md', { + THE_AUTHOR: author, + USER_VERSION: extensionsVersions.join('`, `'), + LATEST_VERSION: extensionsLatest + }); + postComment(oldExtensions); } - // Temporary check to prevent this action from running on old issues - // This will prevent noise on tickets already being investigated - // This can be removed once the action has been running for a while - const creationDate = new Date(issue.created_at); - const cutoffDate = new Date("2023-06-14T00:00:00Z"); - if (creationDate < cutoffDate) { - console.log("Issue was created before 6/14/2023, skipping"); - return; + if (extensionsValid) { + console.log('A valid extensions version is provided!'); + } else { + console.log('The extensions version provided is NOT valid'); + addLabel('missing required information'); } - // Create a GitHub client - const token = (0, core_1.getInput)("repo-token"); - const octokit = (0, github_1.getOctokit)(token); - // Get owner and repo from context - const owner = github_1.context.repo.owner; - const repo = github_1.context.repo.repo; - const issue_number = issue.number; - console.log("Issue URL:", issue.html_url); - const { body } = issue; - const { login: author } = issue.user; - const { data: comments } = await getAllComments(); - // For version checks, we only care about comments from the author - const authorComments = comments.filter((comment) => comment?.user?.login === author); - // Build an array of the issue body and all of the comment bodies - const bodies = [ - body, - ...authorComments.map((comment) => comment.body), - ].filter((body) => body !== undefined); - console.log('bodies = ' + JSON.stringify(bodies)); - console.log('bodies.length = ' + bodies.length); - if (bodies[0] === null) { - console.log('No content provided in issue body'); - const message = getFile("../../messages/provide-version.md", { - THE_AUTHOR: issue.user.login, - }); - postComment(message); - addLabel("missing required information"); + } else { + console.log('Extensions version is NOT provided'); + if (!provideVersionAlreadyRequested) { + const message = getFile('../../messages/provide-version.md', { + THE_AUTHOR: issue.user.login + }); + postComment(message); + provideVersionAlreadyRequested = true; + addLabel('missing required information'); } - else { - let extensionsValid = true; - let vscodeValid = true; - let osVersionValid = true; - let cliValid = true; - let lastWorkingVersionValid = true; - let provideVersionAlreadyRequested = false; - // Checking Salesforce Extension Pack version - // The text "Salesforce Extension Version in VS Code" can be either bolded or unbolded - const extensionsVersionRegex = /(?:\*{2}Salesforce Extension Version in VS Code\*{2}:\s*v?(\d{2}\.\d{1,2}\.\d))|(?:Salesforce Extension Version in VS Code:\s*v?(\d{2}\.\d{1,2}\.\d))/g; - // Search all bodies and get an array of all versions found (first or second capture group) - const extensionsVersions = bodies - .map((body) => [...body.matchAll(extensionsVersionRegex)].map((match) => match[1] || match[2])) - .flat(); - console.log('extensionsVersions', extensionsVersions); - if (extensionsVersions.length > 0) { - const extensionsLatest = getLatestExtensionsVersion(); - console.log('extensionsLatest', extensionsLatest); - const oneSatisfies = extensionsVersions.some((version) => semver.gte(version, extensionsLatest)); - if (!oneSatisfies) { - const oldExtensions = getFile("../../messages/old-extensions.md", { - THE_AUTHOR: author, - USER_VERSION: extensionsVersions.join("`, `"), - LATEST_VERSION: extensionsLatest - }); - postComment(oldExtensions); - } - if (extensionsValid) { - console.log("A valid extensions version is provided!"); - } - else { - console.log("The extensions version provided is NOT valid"); - addLabel("missing required information"); - } - } - else { - console.log("Extensions version is NOT provided"); - if (!provideVersionAlreadyRequested) { - const message = getFile("../../messages/provide-version.md", { - THE_AUTHOR: issue.user.login, - }); - postComment(message); - provideVersionAlreadyRequested = true; - addLabel("missing required information"); - } - extensionsValid = false; - } - // Checking VSCode version - const vscodeVersionRegex = /(?:\*{2}VS Code version\*{2}:\s*(?:Version:\s*)?v?(1\.\d{2}\.\d))|(?:VS Code version:\s*(?:Version:\s*)?v?(1\.\d{2}\.\d))/g; - // Search all bodies and get an array of all versions found (first or second capture group) - const vscodeVersions = bodies - .map((body) => [...body.matchAll(vscodeVersionRegex)].map((match) => match[1] || match[2])) - .flat(); - console.log('vscodeVersions', vscodeVersions); - if (vscodeVersions.length > 0) { - const vscodeMinVersion = getMinimumVSCodeVersion(); - console.log('vscodeMinVersion', vscodeMinVersion); - const oneSatisfies = vscodeVersions.some((version) => semver.gte(version, vscodeMinVersion)); - if (!oneSatisfies) { - const oldVSCode = getFile("../../messages/unsupported-vscode.md", { - THE_AUTHOR: author, - USER_VERSION: vscodeVersions.join("`, `"), - MIN_VERSION: vscodeMinVersion - }); - postComment(oldVSCode); - vscodeValid = false; - } - if (vscodeValid) { - console.log("A valid VSCode version is provided!"); - } - else { - console.log("The VSCode version provided is NOT valid"); - addLabel("missing required information"); - } - } - else { - console.log("VSCode version is NOT provided"); - if (!provideVersionAlreadyRequested) { - const message = getFile("../../messages/provide-version.md", { - THE_AUTHOR: issue.user.login, - }); - postComment(message); - provideVersionAlreadyRequested = true; - addLabel("missing required information"); - } - vscodeValid = false; - } - // Checking presence of OS and version - // NOTE: negative lookahead used in this regex due to false match when OS and version is blank - const osVersionRegex = /(?:\*{2}OS and version\*{2}:\s*(?!\*\*VS|VS)\S.*?)(?=\r?\n|$)|(?:OS and version:\s*(?!\*\*VS|VS)\S.*?)(?=\r?\n|$)/g; - // Search all bodies and get an array of all versions found (first or second capture group) - const osVersions = bodies - .map((body) => [...body.matchAll(osVersionRegex)].map((match) => match[1] || match[2])) - .flat(); - if (osVersions.length > 0) { - console.log("OS and version is provided!"); - } - else { - console.log("OS and version is NOT provided"); - if (!provideVersionAlreadyRequested) { - const message = getFile("../../messages/provide-version.md", { - THE_AUTHOR: issue.user.login, - }); - postComment(message); - provideVersionAlreadyRequested = true; - addLabel("missing required information"); - } - osVersionValid = false; - } - // Checking presence of last working extensions version - const lastWorkingVersionRegex = /(\*{2}Most recent version of the extensions where this was working\*{2}:\s*\S.*\r\n)|(Most recent version of the extensions where this was working:\s*\S.*\r\n)|(\*{2}Most recent version of the extensions where this was working\*{2}:\s*\S.*$)|(Most recent version of the extensions where this was working:\s*\S.*$)/g; - // Search all bodies and get an array of all versions found (first or second capture group) - const lastWorkingVersions = bodies - .map((body) => [...body.matchAll(lastWorkingVersionRegex)].map((match) => match[1] || match[2])) - .flat(); - if (lastWorkingVersions.length > 0) { - console.log("Last working version is provided!"); - } - else { - console.log("Last working version is NOT provided"); - if (!provideVersionAlreadyRequested) { - const message = getFile("../../messages/provide-version.md", { - THE_AUTHOR: issue.user.login, - }); - postComment(message); - provideVersionAlreadyRequested = true; - addLabel("missing required information"); - } - lastWorkingVersionValid = false; - } - // *** The below is the check for CLI version, code reused from CLI Team's repo *** - const sfVersionRegex = /(?:Salesforce CLI Version|(?:\*{2}Salesforce CLI Version\*{2})):\s*(?:@salesforce\/cli\/)?(\d+\.\d+\.\d+)/g; - const sfdxVersionRegex = /(?:Salesforce CLI Version|(?:\*{2}Salesforce CLI Version\*{2})):\s*(?:sfdx-cli\/)?(\d+\.\d+\.\d+)/g; - const nodeVersionRegex = /node-v(\d{2})\.\d+\.\d+/g; - // Search all bodies and get an array of all versions found (first capture group) - const sfVersions = bodies - .map((body) => [...body.matchAll(sfVersionRegex)].map((match) => match[1])) - .flat(); - const sfdxVersions = bodies - .map((body) => [...body.matchAll(sfdxVersionRegex)].map((match) => match[1])) - .flat(); - const nodeVersions = bodies - .map((body) => [...body.matchAll(nodeVersionRegex)].map((match) => match[1])) - .flat(); - console.log("sfVersions", sfVersions); - console.log("sfdxVersions", sfdxVersions); - console.log("nodeVersions", nodeVersions); - if ((sfVersions.length > 0 || sfdxVersions.length > 0)) { - if (sfVersions.length > 0) { - const oneSatisfies = sfVersions.some((version) => semver.gte(version, '2.0.0')); - if (!oneSatisfies) { - // If not, share deprecation information - const sfV1 = getFile("../../messages/deprecated-cli.md", { - THE_AUTHOR: author, - OLD_CLI: "`sf` (v1)", - }); - postComment(sfV1); - cliValid = false; - } - } - if (sfdxVersions.find((v) => v.startsWith("7.")) && - !sfVersions.find((v) => v.startsWith("2."))) { - const noOldSfdx = getFile("../../messages/deprecated-cli.md", { - THE_AUTHOR: author, - OLD_CLI: "`sfdx` (v7)", - }); - postComment(noOldSfdx); - cliValid = false; - } - if (nodeVersions.length > 0) { - if (!(await (0, nodeVersions_1.isAnyVersionValid)(new Date())(nodeVersions))) { - const nodeVersionMessage = getFile("../../messages/unsupported-node.md", { - THE_AUTHOR: author, - NODE_VERSION: nodeVersions.join("`, `"), - }); - postComment(nodeVersionMessage); - closeIssue(); - cliValid = false; - } - } - if (cliValid) { - console.log("A valid CLI version is provided!"); - } - else { - console.log("Information provided is NOT valid"); - addLabel("missing required information"); - } - } - else { - console.log("Full version information was not provided"); - if (!provideVersionAlreadyRequested) { - const message = getFile("../../messages/provide-version.md", { - THE_AUTHOR: issue.user.login, - }); - postComment(message); - provideVersionAlreadyRequested = true; - addLabel("missing required information"); - } - cliValid = false; - } - if (extensionsValid && vscodeValid && osVersionValid && cliValid && lastWorkingVersionValid) { - addLabel("validated"); - removeLabel("missing required information"); - } - else { - console.log("You have one or more missing/invalid versions."); - addLabel("missing required information"); - } + extensionsValid = false; + } + // Checking VSCode version + const vscodeVersionRegex = + /(?:\*{2}VS Code version\*{2}:\s*(?:Version:\s*)?v?(1\.\d{2}\.\d))|(?:VS Code version:\s*(?:Version:\s*)?v?(1\.\d{2}\.\d))/g; + // Search all bodies and get an array of all versions found (first or second capture group) + const vscodeVersions = bodies + .map(body => [...body.matchAll(vscodeVersionRegex)].map(match => match[1] || match[2])) + .flat(); + console.log('vscodeVersions', vscodeVersions); + if (vscodeVersions.length > 0) { + const vscodeMinVersion = getMinimumVSCodeVersion(); + console.log('vscodeMinVersion', vscodeMinVersion); + const oneSatisfies = vscodeVersions.some(version => semver.gte(version, vscodeMinVersion)); + if (!oneSatisfies) { + const oldVSCode = getFile('../../messages/unsupported-vscode.md', { + THE_AUTHOR: author, + USER_VERSION: vscodeVersions.join('`, `'), + MIN_VERSION: vscodeMinVersion + }); + postComment(oldVSCode); + vscodeValid = false; } - // --------- - // FUNCTIONS - // --------- - async function closeIssue() { - return await octokit.rest.issues.update({ - owner, - repo, - issue_number, - state: "closed", - }); + if (vscodeValid) { + console.log('A valid VSCode version is provided!'); + } else { + console.log('The VSCode version provided is NOT valid'); + addLabel('missing required information'); } - async function getAllComments() { - return await octokit.rest.issues.listComments({ - owner, - repo, - issue_number, - }); + } else { + console.log('VSCode version is NOT provided'); + if (!provideVersionAlreadyRequested) { + const message = getFile('../../messages/provide-version.md', { + THE_AUTHOR: issue.user.login + }); + postComment(message); + provideVersionAlreadyRequested = true; + addLabel('missing required information'); } - async function postComment(body) { - // Check that this comment has not been previously commented - if (comments.length) { - if (comments.some((comment) => comment.body === body)) { - console.log("Already commented"); - return; - } - } - return await octokit.rest.issues.createComment({ - owner, - repo, - issue_number, - body, - }); + vscodeValid = false; + } + // Checking presence of OS and version + // NOTE: negative lookahead used in this regex due to false match when OS and version is blank + const osVersionRegex = + /(?:\*{2}OS and version\*{2}:\s*(?!\*\*VS|VS)\S.*?)(?=\r?\n|$)|(?:OS and version:\s*(?!\*\*VS|VS)\S.*?)(?=\r?\n|$)/g; + // Search all bodies and get an array of all versions found (first or second capture group) + const osVersions = bodies + .map(body => [...body.matchAll(osVersionRegex)].map(match => match[1] || match[2])) + .flat(); + if (osVersions.length > 0) { + console.log('OS and version is provided!'); + } else { + console.log('OS and version is NOT provided'); + if (!provideVersionAlreadyRequested) { + const message = getFile('../../messages/provide-version.md', { + THE_AUTHOR: issue.user.login + }); + postComment(message); + provideVersionAlreadyRequested = true; + addLabel('missing required information'); + } + osVersionValid = false; + } + // Checking presence of last working extensions version + const lastWorkingVersionRegex = + /(\*{2}Most recent version of the extensions where this was working\*{2}:\s*\S.*\r\n)|(Most recent version of the extensions where this was working:\s*\S.*\r\n)|(\*{2}Most recent version of the extensions where this was working\*{2}:\s*\S.*$)|(Most recent version of the extensions where this was working:\s*\S.*$)/g; + // Search all bodies and get an array of all versions found (first or second capture group) + const lastWorkingVersions = bodies + .map(body => [...body.matchAll(lastWorkingVersionRegex)].map(match => match[1] || match[2])) + .flat(); + if (lastWorkingVersions.length > 0) { + console.log('Last working version is provided!'); + } else { + console.log('Last working version is NOT provided'); + if (!provideVersionAlreadyRequested) { + const message = getFile('../../messages/provide-version.md', { + THE_AUTHOR: issue.user.login + }); + postComment(message); + provideVersionAlreadyRequested = true; + addLabel('missing required information'); } - async function addLabel(label) { - await octokit.rest.issues.addLabels({ - owner, - repo, - issue_number, - labels: [label], + lastWorkingVersionValid = false; + } + // *** The below is the check for CLI version, code reused from CLI Team's repo *** + const sfVersionRegex = + /(?:Salesforce CLI Version|(?:\*{2}Salesforce CLI Version\*{2})):\s*(?:@salesforce\/cli\/)?(\d+\.\d+\.\d+)/g; + const sfdxVersionRegex = + /(?:Salesforce CLI Version|(?:\*{2}Salesforce CLI Version\*{2})):\s*(?:sfdx-cli\/)?(\d+\.\d+\.\d+)/g; + const nodeVersionRegex = /node-v(\d{2})\.\d+\.\d+/g; + // Search all bodies and get an array of all versions found (first capture group) + const sfVersions = bodies.map(body => [...body.matchAll(sfVersionRegex)].map(match => match[1])).flat(); + const sfdxVersions = bodies.map(body => [...body.matchAll(sfdxVersionRegex)].map(match => match[1])).flat(); + const nodeVersions = bodies.map(body => [...body.matchAll(nodeVersionRegex)].map(match => match[1])).flat(); + console.log('sfVersions', sfVersions); + console.log('sfdxVersions', sfdxVersions); + console.log('nodeVersions', nodeVersions); + if (sfVersions.length > 0 || sfdxVersions.length > 0) { + if (sfVersions.length > 0) { + const oneSatisfies = sfVersions.some(version => semver.gte(version, '2.0.0')); + if (!oneSatisfies) { + // If not, share deprecation information + const sfV1 = getFile('../../messages/deprecated-cli.md', { + THE_AUTHOR: author, + OLD_CLI: '`sf` (v1)' }); + postComment(sfV1); + cliValid = false; + } } - async function removeLabel(label) { - try { - await octokit.rest.issues.removeLabel({ - owner, - repo, - issue_number, - name: label, - }); - } - catch (err) { - const error = err; - if (error.status === 404) { - console.log(`Cannot remove label '${label}' since it was not applied`); - return; - } - throw error; - } + if (sfdxVersions.find(v => v.startsWith('7.')) && !sfVersions.find(v => v.startsWith('2.'))) { + const noOldSfdx = getFile('../../messages/deprecated-cli.md', { + THE_AUTHOR: author, + OLD_CLI: '`sfdx` (v7)' + }); + postComment(noOldSfdx); + cliValid = false; } - function getLatestExtensionsVersion() { - const result = (0, child_process_1.execSync)(`npx vsce show salesforce.salesforcedx-vscode --json`).toString(); - return JSON.parse(result).versions[0].version; + if (nodeVersions.length > 0) { + if (!(await (0, nodeVersions_1.isAnyVersionValid)(new Date())(nodeVersions))) { + const nodeVersionMessage = getFile('../../messages/unsupported-node.md', { + THE_AUTHOR: author, + NODE_VERSION: nodeVersions.join('`, `') + }); + postComment(nodeVersionMessage); + closeIssue(); + cliValid = false; + } } - function getMinimumVSCodeVersion() { - const currentDirectory = (0, child_process_1.execSync)(`pwd`).toString(); - // currentDirectory contains a newline at the end - const packageJsonDirectory = currentDirectory.slice(0, -1) + "/packages/salesforcedx-vscode-core/package.json"; - const packageJsonContent = (0, fs_1.readFileSync)(packageJsonDirectory, 'utf8'); - // The VSCode version has a carat in front that needs to be removed - return JSON.parse(packageJsonContent).engines.vscode.substring(1); + if (cliValid) { + console.log('A valid CLI version is provided!'); + } else { + console.log('Information provided is NOT valid'); + addLabel('missing required information'); } - function getFile(filename, replacements) { - let contents = (0, fs_1.readFileSync)(path.join(__dirname, filename), "utf8"); - Object.entries(replacements || {}).map(([key, value]) => { - contents = contents.replaceAll(key, value); - }); - return contents; + } else { + console.log('Full version information was not provided'); + if (!provideVersionAlreadyRequested) { + const message = getFile('../../messages/provide-version.md', { + THE_AUTHOR: issue.user.login + }); + postComment(message); + provideVersionAlreadyRequested = true; + addLabel('missing required information'); } + cliValid = false; + } + if (extensionsValid && vscodeValid && osVersionValid && cliValid && lastWorkingVersionValid) { + addLabel('validated'); + removeLabel('missing required information'); + } else { + console.log('You have one or more missing/invalid versions.'); + addLabel('missing required information'); + } } - catch (err) { + // --------- + // FUNCTIONS + // --------- + async function closeIssue() { + return await octokit.rest.issues.update({ + owner, + repo, + issue_number, + state: 'closed' + }); + } + async function getAllComments() { + return await octokit.rest.issues.listComments({ + owner, + repo, + issue_number + }); + } + async function postComment(body) { + // Check that this comment has not been previously commented + if (comments.length) { + if (comments.some(comment => comment.body === body)) { + console.log('Already commented'); + return; + } + } + return await octokit.rest.issues.createComment({ + owner, + repo, + issue_number, + body + }); + } + async function addLabel(label) { + await octokit.rest.issues.addLabels({ + owner, + repo, + issue_number, + labels: [label] + }); + } + async function removeLabel(label) { + try { + await octokit.rest.issues.removeLabel({ + owner, + repo, + issue_number, + name: label + }); + } catch (err) { const error = err; - (0, core_1.setFailed)(error.message); + if (error.status === 404) { + console.log(`Cannot remove label '${label}' since it was not applied`); + return; + } + throw error; + } + } + function getLatestExtensionsVersion() { + const result = (0, child_process_1.execSync)(`npx vsce show salesforce.salesforcedx-vscode --json`).toString(); + return JSON.parse(result).versions[0].version; + } + function getMinimumVSCodeVersion() { + const currentDirectory = (0, child_process_1.execSync)(`pwd`).toString(); + // currentDirectory contains a newline at the end + const packageJsonDirectory = currentDirectory.slice(0, -1) + '/packages/salesforcedx-vscode-core/package.json'; + const packageJsonContent = (0, fs_1.readFileSync)(packageJsonDirectory, 'utf8'); + // The VSCode version has a carat in front that needs to be removed + return JSON.parse(packageJsonContent).engines.vscode.substring(1); + } + function getFile(filename, replacements) { + let contents = (0, fs_1.readFileSync)(path.join(__dirname, filename), 'utf8'); + Object.entries(replacements || {}).map(([key, value]) => { + contents = contents.replaceAll(key, value); + }); + return contents; } + } catch (err) { + const error = err; + (0, core_1.setFailed)(error.message); + } } run(); -//# sourceMappingURL=index.js.map \ No newline at end of file +//# sourceMappingURL=index.js.map diff --git a/.github/actions/validate-issue/lib/src/nodeVersions.js b/.github/actions/validate-issue/lib/src/nodeVersions.js index ee201e7226..dacd3c2c58 100644 --- a/.github/actions/validate-issue/lib/src/nodeVersions.js +++ b/.github/actions/validate-issue/lib/src/nodeVersions.js @@ -1,13 +1,16 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); exports.isAnyVersionValid = void 0; -const isAnyVersionValid = (currentDate) => async (versions) => { - const resp = (await (await fetch("https://raw.githubusercontent.com/nodejs/Release/main/schedule.json")).json()); - return versions - .map((version) => `v${version}`) - .some((formattedVersion) => formattedVersion in resp && +const isAnyVersionValid = currentDate => async versions => { + const resp = await (await fetch('https://raw.githubusercontent.com/nodejs/Release/main/schedule.json')).json(); + return versions + .map(version => `v${version}`) + .some( + formattedVersion => + formattedVersion in resp && currentDate >= new Date(resp[formattedVersion].start) && - currentDate <= new Date(resp[formattedVersion].end)); + currentDate <= new Date(resp[formattedVersion].end) + ); }; exports.isAnyVersionValid = isAnyVersionValid; -//# sourceMappingURL=nodeVersions.js.map \ No newline at end of file +//# sourceMappingURL=nodeVersions.js.map diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 4e964280bb..c29872292b 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -46,5 +46,5 @@ jobs: secrets: inherit with: automationBranch: 'main' - vscodeVersion: '1.86.0' + vscodeVersion: '1.90.0' runId: ${{ github.event.workflow_run.id }} diff --git a/.github/workflows/e2eRedHat.yml b/.github/workflows/e2eRedHat.yml index f67d2edca0..f8c9bea850 100644 --- a/.github/workflows/e2eRedHat.yml +++ b/.github/workflows/e2eRedHat.yml @@ -116,7 +116,7 @@ jobs: secrets: inherit with: automationBranch: 'main' - vscodeVersion: '1.86.0' + vscodeVersion: '1.90.0' runId: ${{ github.event.workflow_run.id }} Core_min_vscode_version: @@ -125,7 +125,7 @@ jobs: secrets: inherit with: automationBranch: 'main' - vscodeVersion: '1.86.0' + vscodeVersion: '1.90.0' runId: ${{ github.event.workflow_run.id }} DeployAndRetrieve_min_vscode_version: @@ -134,7 +134,7 @@ jobs: secrets: inherit with: automationBranch: 'main' - vscodeVersion: '1.86.0' + vscodeVersion: '1.90.0' runId: ${{ github.event.workflow_run.id }} LSP_min_vscode_version: @@ -143,7 +143,7 @@ jobs: secrets: inherit with: automationBranch: 'main' - vscodeVersion: '1.86.0' + vscodeVersion: '1.90.0' runId: ${{ github.event.workflow_run.id }} LWC_min_vscode_version: @@ -152,7 +152,7 @@ jobs: secrets: inherit with: automationBranch: 'main' - vscodeVersion: '1.86.0' + vscodeVersion: '1.90.0' runId: ${{ github.event.workflow_run.id }} SOQL_min_vscode_version: @@ -161,5 +161,5 @@ jobs: secrets: inherit with: automationBranch: 'main' - vscodeVersion: '1.86.0' + vscodeVersion: '1.90.0' runId: ${{ github.event.workflow_run.id }} diff --git a/.github/workflows/runE2ETest.yml b/.github/workflows/runE2ETest.yml index 55cb76ac7d..d68a903304 100644 --- a/.github/workflows/runE2ETest.yml +++ b/.github/workflows/runE2ETest.yml @@ -38,7 +38,7 @@ jobs: matrix: os: ${{ fromJson(inputs.os) }} nodeVersion: - - 18.18.2 + - 20.9.0 vscodeVersion: - ${{ inputs.vscodeVersion }} steps: diff --git a/.nvmrc b/.nvmrc index bb52a169c1..805b5a4e00 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v18.18.2 +v20.9.0 diff --git a/config/base-eslintrc.json b/config/base-eslintrc.json deleted file mode 100644 index 3ccb269e0e..0000000000 --- a/config/base-eslintrc.json +++ /dev/null @@ -1,265 +0,0 @@ -{ - "env": { - "browser": true - }, - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:@typescript-eslint/recommended-requiring-type-checking", - "prettier" - ], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint", - "eslint-plugin-header", - "eslint-plugin-import", - "eslint-plugin-jsdoc", - "eslint-plugin-jest-formatting", - "eslint-plugin-prefer-arrow" - ], - "ignorePatterns": [ - "out", - "dist", - "**/packages/**/coverage", - "**/*.d.ts", - "**/jest.config.js", - "jest.integration.config.js" - ], - "rules": { - "header/header": [ - "error", - "block", - [ - "", - { - "pattern": " \\* Copyright \\(c\\) \\d{4}, salesforce\\.com, inc\\.", - "template": " * Copyright (c) 2024, salesforce.com, inc." - }, - " * All rights reserved.", - " * Licensed under the BSD 3-Clause license.", - " * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause", - " " - ] - ], - "@typescript-eslint/adjacent-overload-signatures": "error", - "@typescript-eslint/array-type": [ - "error", - { - "default": "array" - } - ], - "@typescript-eslint/ban-types": [ - "warn", - { - "types": { - "Object": { - "message": "Avoid using the `Object` type. Did you mean `object`?" - }, - "Function": { - "message": "Avoid using the `Function` type. Prefer a specific function type, like `() => void`." - }, - "Boolean": { - "message": "Avoid using the `Boolean` type. Did you mean `boolean`?" - }, - "Number": { - "message": "Avoid using the `Number` type. Did you mean `number`?" - }, - "String": { - "message": "Avoid using the `String` type. Did you mean `string`?" - }, - "Symbol": { - "message": "Avoid using the `Symbol` type. Did you mean `symbol`?" - } - } - } - ], - "@typescript-eslint/consistent-type-assertions": "error", - "@typescript-eslint/consistent-type-definitions": "off", - "@typescript-eslint/dot-notation": "off", - "@typescript-eslint/explicit-function-return-type": "off", - "@typescript-eslint/explicit-module-boundary-types": "off", - "@typescript-eslint/member-delimiter-style": [ - "error", - { - "multiline": { - "delimiter": "semi", - "requireLast": true - }, - "singleline": { - "delimiter": "semi", - "requireLast": false - } - } - ], - "@typescript-eslint/member-ordering": "off", - "@typescript-eslint/naming-convention": [ - "off", - { - "selector": "variable", - "format": ["camelCase", "UPPER_CASE"], - "leadingUnderscore": "forbid", - "trailingUnderscore": "forbid" - } - ], - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/no-empty-interface": "error", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-floating-promises": "error", - "@typescript-eslint/no-misused-new": "error", - "@typescript-eslint/no-namespace": "off", - "@typescript-eslint/no-parameter-properties": "off", - "@typescript-eslint/no-shadow": [ - "error", - { - "hoist": "all" - } - ], - "@typescript-eslint/no-unused-expressions": "error", - "@typescript-eslint/no-use-before-define": "off", - "@typescript-eslint/no-var-requires": "error", - "@typescript-eslint/prefer-for-of": "error", - "@typescript-eslint/prefer-function-type": "error", - "@typescript-eslint/prefer-namespace-keyword": "error", - "@typescript-eslint/quotes": [ - "error", - "single", - { - "avoidEscape": true - } - ], - "@typescript-eslint/semi": ["error", "always"], - "@typescript-eslint/triple-slash-reference": [ - "error", - { - "path": "always", - "types": "prefer-import", - "lib": "always" - } - ], - "@typescript-eslint/typedef": "off", - "@typescript-eslint/no-redundant-type-constituents": "warn", - "@typescript-eslint/unified-signatures": "error", - "@typescript-eslint/restrict-template-expressions": [ - "warn", - { - "allowNumber": true, - "allowBoolean": true, - "allowAny": false, - "allowNullish": true - } - ], - "arrow-parens": ["error", "as-needed"], - "comma-dangle": "error", - "complexity": "off", - "constructor-super": "error", - "curly": ["error", "multi-line"], - "dot-notation": "off", - "eqeqeq": ["error", "smart"], - "guard-for-in": "error", - "id-denylist": "error", - "id-match": "error", - "import/order": [ - "error", - { - "alphabetize": { - "caseInsensitive": true, - "order": "asc" - }, - "newlines-between": "ignore", - "groups": [ - ["builtin", "external", "internal", "unknown", "object", "type"], - "parent", - ["sibling", "index"] - ], - "distinctGroup": false, - "pathGroupsExcludedImportTypes": [], - "pathGroups": [ - { - "pattern": "./", - "patternOptions": { - "nocomment": true, - "dot": true - }, - "group": "sibling", - "position": "before" - }, - { - "pattern": ".", - "patternOptions": { - "nocomment": true, - "dot": true - }, - "group": "sibling", - "position": "before" - }, - { - "pattern": "..", - "patternOptions": { - "nocomment": true, - "dot": true - }, - "group": "parent", - "position": "before" - }, - { - "pattern": "../", - "patternOptions": { - "nocomment": true, - "dot": true - }, - "group": "parent", - "position": "before" - } - ] - } - ], - "jsdoc/check-alignment": "error", - "jsdoc/check-indentation": "error", - "jsdoc/newline-after-description": "off", - "max-classes-per-file": "off", - "max-len": "off", - "new-parens": "error", - "no-bitwise": "off", - "no-caller": "error", - "no-cond-assign": "error", - "no-console": "off", - "no-debugger": "error", - "no-empty": "off", - "no-empty-function": "off", - "no-eval": "error", - "no-fallthrough": "off", - "no-invalid-this": "off", - "no-new-wrappers": "error", - "no-shadow": "off", - "no-throw-literal": "error", - "no-trailing-spaces": "error", - "no-undef-init": "error", - "no-underscore-dangle": "off", - "no-unsafe-finally": "error", - "no-unused-expressions": "off", - "no-unused-labels": "error", - "no-use-before-define": "off", - "no-var": "error", - "object-shorthand": "error", - "one-var": ["error", "never"], - "prefer-arrow/prefer-arrow-functions": ["warn", {}], - "prefer-const": "error", - "quote-props": ["error", "as-needed"], - "quotes": "off", - "radix": "error", - "semi": "off", - "spaced-comment": [ - "off", - "always", - { - "markers": ["/"] - } - ], - "use-isnan": "error", - "valid-typeof": "off" - } -} diff --git a/config/common-test-lint-rules.json b/config/common-test-lint-rules.json deleted file mode 100644 index 66f4c31557..0000000000 --- a/config/common-test-lint-rules.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "rules": { - "@typescript-eslint/no-unsafe-argument": "off", - "@typescript-eslint/no-unsafe-member-access": "off", - "@typescript-eslint/no-unsafe-call": "off", - "@typescript-eslint/no-unused-vars": "warn", - "@typescript-eslint/no-unsafe-assignment": "warn", - "@typescript-eslint/no-unused-expressions": "warn", - "@typescript-eslint/no-unsafe-return": "warn", - "@typescript-eslint/restrict-template-expressions": "warn" - }, - "overrides": [ - { - "files": ["jest/**"], - "plugins": ["jest"], - "rules": { - "@typescript-eslint/unbound-method": "off", - "jest/unbound-method": "error" - } - } - ] -} diff --git a/config/jest.base.config.js b/config/jest.base.config.js index 08029b28d7..3004379acb 100644 --- a/config/jest.base.config.js +++ b/config/jest.base.config.js @@ -4,10 +4,7 @@ module.exports = { testEnvironment: 'node', testMatch: ['**/(unit|jest)/**/?(*.)+(spec|test).[t]s?(x)'], setupFilesAfterEnv: ['../../scripts/setup-jest.ts'], - reporters: [ - 'default', - ['jest-junit', { outputName: 'junit-custom-unitTests.xml' }] - ], + reporters: ['default', ['jest-junit', { outputName: 'junit-custom-unitTests.xml' }]], coverageReporters: ['lcov', 'text', 'json'], resetMocks: true // This collectCoverageFrom will show coverage for all files in a projects, but slows down calculating coverage results. diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000000..4d7a4c10bd --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,326 @@ +/** + * * Copyright (c) 2024, salesforce.com, inc. + * All rights reserved. + * Licensed under the BSD 3-Clause license. + * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause + **/ + +import typescriptEslint from '@typescript-eslint/eslint-plugin'; +import stylistic from '@stylistic/eslint-plugin-ts'; +import tsParser from '@typescript-eslint/parser'; +import globals from 'globals'; +import header from '@tony.ganchev/eslint-plugin-header'; +import eslintPluginImport, { __esModule } from 'eslint-plugin-import'; +import eslintPluginJsdoc from 'eslint-plugin-jsdoc'; +import eslintPluginJestFormatting from 'eslint-plugin-jest-formatting'; +import eslintPluginPreferArrow from 'eslint-plugin-prefer-arrow'; +import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'; +import eslintPluginJest from 'eslint-plugin-jest'; + +export default [ + { + ignores: [ + '**/out/**', + '**/dist/**', + '**/packages/**/coverage', + '**/*.d.ts', + '**/jest.config.js', + '**/jest.integration.config.js', + 'packages/salesforcedx-visualforce-markup-language-server/src/**', + 'packages/salesforcedx-apex-replay-debugger/src/**', + 'packages/system-tests/assets/**', + 'packages/system-tests/scenarios/**', + 'packages/system-tests/src/**', + 'packages/salesforcedx-sobjects-faux-generator/scripts/**', + 'packages/salesforcedx-sobjects-faux-generator/coverage/**', + 'packages/salesforcedx-vscode-soql/test/vscode-integration', + 'packages/salesforcedx-vscode-soql/test/ui-test/resources/.mocharc-debug.ts', + 'packages/salesforcedx-vscode-lwc/test/vscode-integration', + 'packages/salesforcedx-vscode-core/test/vscode-integration/**', + 'packages/salesforcedx-test-utils-vscode/src/testrunner.ts' + ] + }, + eslintPluginPrettierRecommended, + { + files: ['**/*.ts'], + languageOptions: { + parser: tsParser, + parserOptions: { + project: './tsconfig.json', + sourceType: 'module', + ecmaVersion: 2020, + globals: { + ...globals.browser + } + } + }, + plugins: { + '@typescript-eslint': typescriptEslint, + header: header, + import: eslintPluginImport, + jsdoc: eslintPluginJsdoc, + 'jest-formatting': eslintPluginJestFormatting, + 'prefer-arrow': eslintPluginPreferArrow, + '@stylistic/eslint-plugin-ts': stylistic + }, + rules: { + 'header/header': [ + 'error', + 'block', + [ + '', + { + pattern: ' \\* Copyright \\(c\\) \\d{4}, salesforce\\.com, inc\\.', + template: ' * Copyright (c) 2024, salesforce.com, inc.' + }, + ' * All rights reserved.', + ' * Licensed under the BSD 3-Clause license.', + ' * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause', + ' ' + ] + ], + '@typescript-eslint/adjacent-overload-signatures': 'error', + '@typescript-eslint/array-type': ['error', { default: 'array' }], + '@typescript-eslint/no-restricted-types': [ + 'warn', + { + types: { + Object: { message: 'Avoid using the `Object` type. Did you mean `object`?' }, + Function: { + message: 'Avoid using the `Function` type. Prefer a specific function type, like `() => void`.' + }, + Boolean: { message: 'Avoid using the `Boolean` type. Did you mean `boolean`?' }, + Number: { message: 'Avoid using the `Number` type. Did you mean `number`?' }, + String: { message: 'Avoid using the `String` type. Did you mean `string`?' }, + Symbol: { message: 'Avoid using the `Symbol` type. Did you mean `symbol`?' } + } + } + ], + '@typescript-eslint/no-floating-promises': 'warn', + '@typescript-eslint/no-misused-promises': 'warn', + '@typescript-eslint/no-unsafe-argument': 'warn', + '@typescript-eslint/no-unsafe-assignment': 'warn', + '@typescript-eslint/no-unsafe-call': 'warn', + '@typescript-eslint/no-unsafe-member-access': 'warn', + '@typescript-eslint/no-unsafe-return': 'warn', + '@typescript-eslint/require-await': 'warn', + '@typescript-eslint/prefer-for-of': 'warn', + '@typescript-eslint/unbound-method': 'warn', + 'prefer-arrow/prefer-arrow-functions': ['error', {}], + '@typescript-eslint/consistent-type-assertions': 'error', + '@typescript-eslint/consistent-type-definitions': 'off', + '@typescript-eslint/dot-notation': 'off', + '@typescript-eslint/explicit-function-return-type': 'off', + '@typescript-eslint/explicit-module-boundary-types': 'off', + '@stylistic/eslint-plugin-ts/member-delimiter-style': [ + 'error', + { + multiline: { + delimiter: 'semi', + requireLast: true + }, + singleline: { + delimiter: 'semi', + requireLast: false + } + } + ], + '@typescript-eslint/member-ordering': 'off', + '@typescript-eslint/naming-convention': [ + 'off', + { + selector: 'variable', + format: ['camelCase', 'UPPER_CASE'], + leadingUnderscore: 'forbid', + trailingUnderscore: 'forbid' + } + ], + '@typescript-eslint/no-empty-function': 'off', + '@typescript-eslint/no-empty-interface': 'error', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-misused-new': 'error', + '@typescript-eslint/no-namespace': 'off', + '@typescript-eslint/no-parameter-properties': 'off', + '@typescript-eslint/no-shadow': [ + 'error', + { + hoist: 'all' + } + ], + '@typescript-eslint/no-unused-expressions': 'warn', + '@typescript-eslint/no-use-before-define': 'off', + '@typescript-eslint/no-var-requires': 'error', + '@typescript-eslint/prefer-function-type': 'error', + '@typescript-eslint/prefer-namespace-keyword': 'error', + '@stylistic/eslint-plugin-ts/quotes': [ + 'error', + 'single', + { + avoidEscape: true + } + ], + '@stylistic/eslint-plugin-ts/semi': ['error', 'always'], + '@typescript-eslint/triple-slash-reference': [ + 'error', + { + path: 'always', + types: 'prefer-import', + lib: 'always' + } + ], + '@typescript-eslint/typedef': 'off', + '@typescript-eslint/no-redundant-type-constituents': 'warn', + '@typescript-eslint/unified-signatures': 'error', + '@typescript-eslint/restrict-template-expressions': [ + 'warn', + { + allowNumber: true, + allowBoolean: true, + allowAny: false, + allowNullish: true + } + ], + 'arrow-parens': ['error', 'as-needed'], + 'comma-dangle': 'error', + complexity: 'off', + 'constructor-super': 'error', + curly: ['error', 'multi-line'], + 'dot-notation': 'off', + eqeqeq: ['error', 'smart'], + 'guard-for-in': 'error', + 'id-denylist': 'error', + 'id-match': 'error', + 'import/order': [ + 'error', + { + alphabetize: { + caseInsensitive: true, + order: 'asc' + }, + 'newlines-between': 'ignore', + groups: [['builtin', 'external', 'internal', 'unknown', 'object', 'type'], 'parent', ['sibling', 'index']], + distinctGroup: false, + pathGroupsExcludedImportTypes: [], + pathGroups: [ + { + pattern: './', + patternOptions: { + nocomment: true, + dot: true + }, + group: 'sibling', + position: 'before' + }, + { + pattern: '.', + patternOptions: { + nocomment: true, + dot: true + }, + group: 'sibling', + position: 'before' + }, + { + pattern: '..', + patternOptions: { + nocomment: true, + dot: true + }, + group: 'parent', + position: 'before' + }, + { + pattern: '../', + patternOptions: { + nocomment: true, + dot: true + }, + group: 'parent', + position: 'before' + } + ] + } + ], + 'jsdoc/check-alignment': 'error', + 'jsdoc/check-indentation': 'error', + 'jsdoc/newline-after-description': 'off', + 'max-classes-per-file': 'off', + 'max-len': 'off', + 'new-parens': 'error', + 'no-bitwise': 'off', + 'no-caller': 'error', + 'no-cond-assign': 'error', + 'no-console': 'off', + 'no-debugger': 'error', + 'no-empty': 'off', + 'no-empty-function': 'off', + 'no-eval': 'error', + 'no-fallthrough': 'off', + 'no-invalid-this': 'off', + 'no-new-wrappers': 'error', + 'no-shadow': 'off', + 'no-throw-literal': 'error', + 'no-trailing-spaces': 'error', + 'no-undef-init': 'error', + 'no-underscore-dangle': 'off', + 'no-unsafe-finally': 'error', + 'no-unused-expressions': 'off', + 'no-unused-labels': 'error', + 'no-use-before-define': 'off', + 'no-var': 'error', + 'object-shorthand': 'error', + 'one-var': ['error', 'never'], + 'prefer-arrow/prefer-arrow-functions': ['warn', {}], + 'prefer-const': 'error', + 'quote-props': ['error', 'as-needed'], + quotes: 'off', + radix: 'error', + semi: 'off', + 'spaced-comment': [ + 'off', + 'always', + { + markers: ['/'] + } + ], + 'use-isnan': 'error', + 'valid-typeof': 'off' + } + }, + { + rules: { + 'guard-for-in': 'warn', + 'no-prototype-builtins': 'warn', + 'no-useless-escape': 'warn' + } + }, + { + files: ['packages/salesforcedx**/test/jest/**/*'], + plugins: { + '@typescript-eslint': typescriptEslint, + jest: eslintPluginJest + }, + rules: { + '@typescript-eslint/no-unsafe-argument': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unused-vars': 'warn', + '@typescript-eslint/no-unsafe-assignment': 'warn', + '@typescript-eslint/no-unused-expressions': 'warn', + '@typescript-eslint/no-unsafe-return': 'warn', + '@typescript-eslint/restrict-template-expressions': 'warn', + '@typescript-eslint/unbound-method': 'off', + 'jest/unbound-method': 'error' + } + }, + { + // Override header rules + files: [ + 'packages/salesforcedx-visualforce-markup-language-server/**/*.ts', + 'packages/salesforcedx-visualforce-language-server/**/*.ts' + ], + rules: { + 'header/header': 'off' + } + } +]; diff --git a/package-lock.json b/package-lock.json index 9e97be17b7..48fa1681ef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,12 +11,12 @@ "packages/*" ], "dependencies": { - "@actions/core": "^1.10.0", + "@actions/core": "^1.11.0", "@actions/github": "^5.1.1", - "node": "^18.11.0", - "npm": "^9", - "semver": "^7.5.2", - "ts-node": "10.9.1" + "node": "^20.9.0", + "npm": "^10", + "semver": "^7.5.4", + "ts-node": "10.9.2" }, "devDependencies": { "@commitlint/cli": "^17.1.2", @@ -25,12 +25,15 @@ "@octokit/core": "4.2.4", "@octokit/webhooks-definitions": "^3.67.3", "@salesforce/dev-config": "^3.1.0", - "@tsconfig/node18": "18.2.2", + "@stylistic/eslint-plugin-ts": "2.10.1", + "@tony.ganchev/eslint-plugin-header": "3.1.2", + "@tsconfig/node20": "20.1.4", "@types/cross-spawn": "6.0.2", "@types/jest": "^29.5.5", + "@types/semver": "7.5.8", "@types/shelljs": "0.8.11", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", + "@typescript-eslint/eslint-plugin": "8.13.0", + "@typescript-eslint/parser": "8.13.0", "@vscode/test-electron": "2.3.0", "@vscode/vsce": "2.21.1", "acorn": "8.8.2", @@ -40,13 +43,13 @@ "cz-conventional-changelog": "3.3.0", "depcheck": "1.4.3", "esbuild": "0.15.10", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", + "eslint": "9.13.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-import": "2.31.0", "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", + "eslint-plugin-jsdoc": "50.4.3", "eslint-plugin-prefer-arrow": "1.2.3", + "eslint-plugin-prettier": "5.2.1", "husky": "1.3.1", "jest": "^29.7.0", "jest-junit": "14.0.1", @@ -57,42 +60,43 @@ "ncp": "^2.0.0", "nyc": "15.1.0", "ovsx": "0.8.0", - "prettier": "3.0.3", + "prettier": "3.3.3", "shelljs": "0.8.5", "shx": "0.3.4", "snyk": "^1.1017.0", "ts-jest": "^29.1.1", "ts-loader": "^9.3.0", - "ts-node": "10.9.1", - "typescript": "^5.2.2" + "ts-node": "10.9.2", + "typescript": "^5.6.2" }, "engines": { - "node": ">=18.11.0" + "node": ">=20.9.0" } }, "node_modules/@aashutoshrathi/word-wrap": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/@actions/core": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.1.tgz", - "integrity": "sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz", + "integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==", "dependencies": { - "@actions/http-client": "^2.0.1", - "uuid": "^8.3.2" + "@actions/exec": "^1.1.1", + "@actions/http-client": "^2.0.1" } }, - "node_modules/@actions/core/node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "bin": { - "uuid": "dist/bin/uuid" + "node_modules/@actions/exec": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz", + "integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==", + "dependencies": { + "@actions/io": "^1.0.1" } }, "node_modules/@actions/github": { @@ -216,6 +220,11 @@ "undici": "^5.25.4" } }, + "node_modules/@actions/io": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz", + "integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==" + }, "node_modules/@ampproject/remapping": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", @@ -334,31 +343,6 @@ "semver": "bin/semver.js" } }, - "node_modules/@babel/eslint-parser": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.24.8.tgz", - "integrity": "sha512-nYAikI4XTGokU2QX7Jx+v4rxZKhKivaQaREZjuW3mrJrbdWJ5yUfohnoUULge+zEEaKjPYNxhoRgUKktjXtbwA==", - "dependencies": { - "@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1", - "eslint-visitor-keys": "^2.1.0", - "semver": "^6.3.1" - }, - "engines": { - "node": "^10.13.0 || ^12.13.0 || >=14.0.0" - }, - "peerDependencies": { - "@babel/core": "^7.11.0", - "eslint": "^7.5.0 || ^8.0.0 || ^9.0.0" - } - }, - "node_modules/@babel/eslint-parser/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/@babel/generator": { "version": "7.25.0", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.0.tgz", @@ -928,7 +912,7 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz", "integrity": "sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==", - "devOptional": true, + "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" }, @@ -1151,7 +1135,7 @@ "version": "0.2.3", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", - "devOptional": true + "dev": true }, "node_modules/@commitlint/cli": { "version": "17.6.7", @@ -1722,23 +1706,23 @@ } }, "node_modules/@es-joy/jsdoccomment": { - "version": "0.40.1", - "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.40.1.tgz", - "integrity": "sha512-YORCdZSusAlBrFpZ77pJjc5r1bQs5caPWtAu+WWmiSo+8XaUzseapVrfAtiRFbQWnrBxxLLEwF6f6ZG/UgCQCg==", + "version": "0.49.0", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.49.0.tgz", + "integrity": "sha512-xjZTSFgECpb9Ohuk5yMX5RhUEbfeQcuOp8IF60e+wyzWEF0M5xeSgqsfLtvPEX8BIyOX9saZqzuGPmZ8oWc+5Q==", "dev": true, "dependencies": { - "comment-parser": "1.4.0", - "esquery": "^1.5.0", - "jsdoc-type-pratt-parser": "~4.0.0" + "comment-parser": "1.4.1", + "esquery": "^1.6.0", + "jsdoc-type-pratt-parser": "~4.1.0" }, "engines": { "node": ">=16" } }, "node_modules/@es-joy/jsdoccomment/node_modules/comment-parser": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.0.tgz", - "integrity": "sha512-QLyTNiZ2KDOibvFPlZ6ZngVsZ/0gYnE6uTXi5aoDg8ed3AkJAz4sEje3Y8a29hQ1s6A99MZXe47fLAXQ1rTqaw==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", + "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==", "dev": true, "engines": { "node": ">= 12.0.0" @@ -2116,6 +2100,7 @@ "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, "dependencies": { "eslint-visitor-keys": "^3.3.0" }, @@ -2130,6 +2115,7 @@ "version": "3.4.2", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.2.tgz", "integrity": "sha512-8drBzUEyZ2llkpCA67iYrgEssKDUu68V8ChqqOfFupIaG/LCVPUT+CoGJpT77zJprs4T/W7p07LP7zAIMuweVw==", + "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -2138,91 +2124,65 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.6.2.tgz", - "integrity": "sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, - "node_modules/@eslint/eslintrc": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", - "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==", + "node_modules/@eslint/config-array": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.18.0.tgz", + "integrity": "sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==", "dev": true, "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.4.0", - "globals": "^13.19.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" + "@eslint/object-schema": "^2.1.4", + "debug": "^4.3.1", + "minimatch": "^3.1.2" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "node_modules/@eslint/core": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.7.0.tgz", + "integrity": "sha512-xp5Jirz5DyPYlPiKat8jaq0EmYvDXKKpzTbxXMpT9eqlRJkRKIz9AGMdlvYjih+im+QlhWrpvVjl8IPC/lHlUw==", "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", + "node_modules/@eslint/js": { + "version": "9.13.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.13.0.tgz", + "integrity": "sha512-IFLyoY4d72Z5y/6o/BazFBezupzI/taV8sGumxTAVw3lXG9A6md1Dc34T9s1FoD/an9pJH8RHbAxsaEbBed9lA==", "dev": true, - "dependencies": { - "type-fest": "^0.20.2" - }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@eslint/eslintrc/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "node_modules/@eslint/object-schema": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz", + "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, "engines": { - "node": "*" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@eslint/eslintrc/node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "node_modules/@eslint/plugin-kit": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.2.tgz", + "integrity": "sha512-CXtq5nR4Su+2I47WPOlWud98Y5Lv8Kyxp2ukhgFx/eW6Blm18VXJO5WuQylPugRo8nbluoi6GvvxBLqHcvqUUw==", "dev": true, - "engines": { - "node": ">=10" + "dependencies": { + "levn": "^0.4.1" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@eslint/js": { - "version": "8.52.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.52.0.tgz", - "integrity": "sha512-mjZVbpaeMZludF2fsWLD0Z9gCref1Tk4i9+wddjRvpUNqqcndPkBD09N/Mapey0b3jaXbLm2kICwFv2E64QinA==", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@fastify/busboy": { @@ -2239,56 +2199,33 @@ "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", "dev": true }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.10.7", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.10.7.tgz", - "integrity": "sha512-MDl6D6sBsaV452/QSdX+4CXIjZhIcI0PELsxUjk4U828yd58vk3bTIvk/6w5FY+4hIy9sLW0sfrV7K7Kc++j/w==", + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", "dev": true, - "dependencies": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.4" - }, "engines": { - "node": ">=10.10.0" + "node": ">=18.18.0" } }, - "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "node_modules/@humanfs/node": { + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", "dev": true, "dependencies": { - "brace-expansion": "^1.1.7" + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.3.0" }, "engines": { - "node": "*" - } - }, - "node_modules/@humanwhocodes/gitignore-to-minimatch": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz", - "integrity": "sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA==", - "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" + "node": ">=18.18.0" } }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, "engines": { "node": ">=12.22" }, @@ -2297,11 +2234,18 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true + "node_modules/@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "dev": true, + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } }, "node_modules/@hutson/parse-repository-url": { "version": "3.0.2", @@ -2530,7 +2474,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", - "devOptional": true, + "dev": true, "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", @@ -2547,7 +2491,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "devOptional": true, + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -2562,7 +2506,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "devOptional": true, + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -2578,7 +2522,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "devOptional": true, + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -2590,13 +2534,13 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "devOptional": true + "dev": true }, "node_modules/@jest/console/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" } @@ -2605,7 +2549,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "devOptional": true, + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -2617,7 +2561,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", - "devOptional": true, + "dev": true, "dependencies": { "@jest/console": "^29.7.0", "@jest/reporters": "^29.7.0", @@ -2664,7 +2608,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "devOptional": true, + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -2679,7 +2623,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "devOptional": true, + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -2695,7 +2639,7 @@ "version": "3.9.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", - "devOptional": true, + "dev": true, "funding": [ { "type": "github", @@ -2710,7 +2654,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "devOptional": true, + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -2722,13 +2666,13 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "devOptional": true + "dev": true }, "node_modules/@jest/core/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" } @@ -2737,7 +2681,7 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", - "devOptional": true, + "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } @@ -2746,7 +2690,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "devOptional": true, + "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -2758,7 +2702,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "devOptional": true, + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -2770,7 +2714,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", - "devOptional": true, + "dev": true, "dependencies": { "@jest/fake-timers": "^29.7.0", "@jest/types": "^29.6.3", @@ -2785,7 +2729,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", - "devOptional": true, + "dev": true, "dependencies": { "expect": "^29.7.0", "jest-snapshot": "^29.7.0" @@ -2798,7 +2742,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", - "devOptional": true, + "dev": true, "dependencies": { "jest-get-type": "^29.6.3" }, @@ -2810,7 +2754,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", - "devOptional": true, + "dev": true, "dependencies": { "@jest/types": "^29.6.3", "@sinonjs/fake-timers": "^10.0.2", @@ -2827,7 +2771,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", - "devOptional": true, + "dev": true, "dependencies": { "type-detect": "4.0.8" } @@ -2836,7 +2780,7 @@ "version": "10.3.0", "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", - "devOptional": true, + "dev": true, "dependencies": { "@sinonjs/commons": "^3.0.0" } @@ -2845,7 +2789,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", - "devOptional": true, + "dev": true, "dependencies": { "@jest/environment": "^29.7.0", "@jest/expect": "^29.7.0", @@ -2860,7 +2804,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", - "devOptional": true, + "dev": true, "dependencies": { "@bcoe/v8-coverage": "^0.2.3", "@jest/console": "^29.7.0", @@ -2903,7 +2847,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "devOptional": true, + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -2914,21 +2858,11 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/@jest/reporters/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "devOptional": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/@jest/reporters/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "devOptional": true, + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -2944,7 +2878,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "devOptional": true, + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -2956,13 +2890,13 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "devOptional": true + "dev": true }, "node_modules/@jest/reporters/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "devOptional": true, + "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -2982,7 +2916,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" } @@ -2991,7 +2925,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.1.tgz", "integrity": "sha512-EAMEJBsYuyyztxMxW3g7ugGPkrZsV57v0Hmv3mm1uQsmB+QnZuepg731CRaIgeUVSdmsTngOkSnauNF8p7FIhA==", - "devOptional": true, + "dev": true, "dependencies": { "@babel/core": "^7.12.3", "@babel/parser": "^7.14.7", @@ -3003,23 +2937,11 @@ "node": ">=10" } }, - "node_modules/@jest/reporters/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "devOptional": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/@jest/reporters/node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "devOptional": true, + "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -3031,7 +2953,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "devOptional": true, + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -3043,7 +2965,7 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", - "devOptional": true, + "dev": true, "dependencies": { "@sinclair/typebox": "^0.27.8" }, @@ -3055,7 +2977,7 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", - "devOptional": true, + "dev": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.18", "callsites": "^3.0.0", @@ -3069,7 +2991,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", - "devOptional": true, + "dev": true, "dependencies": { "@jest/console": "^29.7.0", "@jest/types": "^29.6.3", @@ -3084,7 +3006,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", - "devOptional": true, + "dev": true, "dependencies": { "@jest/test-result": "^29.7.0", "graceful-fs": "^4.2.9", @@ -3099,7 +3021,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", - "devOptional": true, + "dev": true, "dependencies": { "@babel/core": "^7.11.6", "@jest/types": "^29.6.3", @@ -3125,7 +3047,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "devOptional": true, + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -3140,7 +3062,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "devOptional": true, + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -3156,7 +3078,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "devOptional": true, + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -3168,19 +3090,19 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "devOptional": true + "dev": true }, "node_modules/@jest/transform/node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "devOptional": true + "dev": true }, "node_modules/@jest/transform/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" } @@ -3189,7 +3111,7 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", - "devOptional": true, + "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } @@ -3198,7 +3120,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "devOptional": true, + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -3210,7 +3132,7 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "devOptional": true, + "dev": true, "dependencies": { "@jest/schemas": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", @@ -3227,7 +3149,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "devOptional": true, + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -3242,7 +3164,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "devOptional": true, + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -3258,7 +3180,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "devOptional": true, + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -3270,13 +3192,13 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "devOptional": true + "dev": true }, "node_modules/@jest/types/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" } @@ -3285,7 +3207,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "devOptional": true, + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -3323,14 +3245,14 @@ } }, "node_modules/@jridgewell/source-map": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", - "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", + "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", "dev": true, "peer": true, "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" } }, "node_modules/@jridgewell/sourcemap-codec": { @@ -3727,28 +3649,6 @@ "node": "^14.15.0 || >=16.0.0" } }, - "node_modules/@lerna/collect-updates/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/@lerna/collect-updates/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/@lerna/command": { "version": "5.5.4", "resolved": "https://registry.npmjs.org/@lerna/command/-/command-5.5.4.tgz", @@ -5273,16 +5173,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/@lerna/version/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/@lerna/version/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -5326,18 +5216,6 @@ "node": ">=8" } }, - "node_modules/@lerna/version/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/@lerna/version/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -5465,50 +5343,6 @@ "resolved": "https://registry.npmjs.org/@lwc/errors/-/errors-2.50.0.tgz", "integrity": "sha512-hGn9SUrq3/GI/1t2yLhEZsUKPwCBBnk/PhyJmStzZs5TMB5PxVUvDHvPCSwJAVpYY1IHNScMaRSyK+qEv9KVNg==" }, - "node_modules/@lwc/eslint-plugin-lwc": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/@lwc/eslint-plugin-lwc/-/eslint-plugin-lwc-1.6.3.tgz", - "integrity": "sha512-CpZDkdxdbw8s+qyTib4keFN9lPlMO6UFSVtVem44xB2k+YvGGc1r4E3ihnkbutcuMqLws3gNGCEpUeRUqX28Ig==", - "peer": true, - "dependencies": { - "globals": "^13.20.0", - "minimatch": "^6.2.0" - }, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "@babel/eslint-parser": "^7", - "eslint": "^7 || ^8" - } - }, - "node_modules/@lwc/eslint-plugin-lwc/node_modules/globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "peer": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@lwc/eslint-plugin-lwc/node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/@lwc/metadata": { "version": "2.50.0-0", "resolved": "https://registry.npmjs.org/@lwc/metadata/-/metadata-2.50.0-0.tgz", @@ -5597,14 +5431,6 @@ "workspaces-to-typescript-project-references": "bin/cmd.js" } }, - "node_modules/@nicolo-ribaudo/eslint-scope-5-internals": { - "version": "5.1.1-v1", - "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz", - "integrity": "sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==", - "dependencies": { - "eslint-scope": "5.1.1" - } - }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -6546,6 +6372,24 @@ "node": ">=14" } }, + "node_modules/@pkgr/core": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", + "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/@rtsao/scc": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", + "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", + "dev": true + }, "node_modules/@salesforce/apex": { "version": "0.0.12", "resolved": "https://registry.npmjs.org/@salesforce/apex/-/apex-0.0.12.tgz", @@ -6675,15 +6519,6 @@ "node": ">=0.4.0" } }, - "node_modules/@salesforce/aura-language-server/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/@salesforce/aura-language-server/node_modules/fs-extra": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-5.0.0.tgz", @@ -6694,17 +6529,6 @@ "universalify": "^0.1.0" } }, - "node_modules/@salesforce/aura-language-server/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/@salesforce/aura-language-server/node_modules/vscode-nls": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-4.1.2.tgz", @@ -6933,36 +6757,6 @@ "integrity": "sha512-cPph7ibj3DeSzWDFLcLtxOh5fmUlDUY2Ezq43n0V6auVP+l8orxRHjCExHS86SB3QKVgXkC8yYhryXiS8KF7Zw==", "dev": true }, - "node_modules/@salesforce/eslint-config-lwc": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/@salesforce/eslint-config-lwc/-/eslint-config-lwc-3.6.0.tgz", - "integrity": "sha512-k6F3LFKl6wvAmK31B/jn8aHtqo+kwl5q96DzhIcmL1qnCZj+AzH5gw9034j+c8279d8u8dC5QIUDU1iE3aCNCg==", - "dependencies": { - "@babel/core": "~7.24.7", - "@babel/eslint-parser": "~7.24.7", - "eslint-restricted-globals": "~0.2.0", - "semver": "^7.6.2" - }, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "@lwc/eslint-plugin-lwc": "^1.0.0", - "@salesforce/eslint-plugin-lightning": "^1.0.0", - "eslint": "^7 || ^8", - "eslint-plugin-import": "*", - "eslint-plugin-jest": "*" - } - }, - "node_modules/@salesforce/eslint-plugin-lightning": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@salesforce/eslint-plugin-lightning/-/eslint-plugin-lightning-1.0.0.tgz", - "integrity": "sha512-zk0PKXAcHKHepAG2EOSWlkOTxQM0Aw1CT6+MUxJcM42fCDwH/yPPpGkG3CWtRfmVViODGOwU9ywU2wlkAYcvUQ==", - "peer": true, - "peerDependencies": { - "eslint": "^7 || ^8" - } - }, "node_modules/@salesforce/kit": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/@salesforce/kit/-/kit-3.2.3.tgz", @@ -7003,15 +6797,6 @@ "vscode-uri": "^2.1.2" } }, - "node_modules/@salesforce/lightning-lsp-common/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/@salesforce/lightning-lsp-common/node_modules/fs-extra": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-5.0.0.tgz", @@ -7042,17 +6827,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@salesforce/lightning-lsp-common/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/@salesforce/lightning-lsp-common/node_modules/vscode-nls": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-4.1.2.tgz", @@ -7700,7 +7474,7 @@ "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", - "devOptional": true + "dev": true }, "node_modules/@sindresorhus/is": { "version": "4.6.0", @@ -7757,6 +7531,64 @@ "integrity": "sha512-sXXKG+uL9IrKqViTtao2Ws6dy0znu9sOaP1di/jKGW1M6VssO8vlpXCQcpZ+jisQ1tTFAC5Jo/EOzFbggBagFQ==", "dev": true }, + "node_modules/@stylistic/eslint-plugin-ts": { + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-ts/-/eslint-plugin-ts-2.10.1.tgz", + "integrity": "sha512-XmXcixLPYfW0Z4Nf2ChnQ7CnfALNy/5gwNh22POiy64xreVYtiag4+yxN2SBEalEfoOAwDnqwDKam7e7XeoKTA==", + "dev": true, + "dependencies": { + "@typescript-eslint/utils": "^8.12.2", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "peerDependencies": { + "eslint": ">=8.40.0" + } + }, + "node_modules/@stylistic/eslint-plugin-ts/node_modules/acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/@stylistic/eslint-plugin-ts/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@stylistic/eslint-plugin-ts/node_modules/espree": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", + "dev": true, + "dependencies": { + "acorn": "^8.14.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/@szmarczak/http-timer": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", @@ -7768,6 +7600,15 @@ "node": ">=10" } }, + "node_modules/@tony.ganchev/eslint-plugin-header": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@tony.ganchev/eslint-plugin-header/-/eslint-plugin-header-3.1.2.tgz", + "integrity": "sha512-u9sJvwqAw26+2MlUfVMTbVAygcNpp+wQA3YbJ5qtkltEBzEJN8I+VKJxRKC2MSG/26uxHk9LA/rXz8iaYLmu5A==", + "dev": true, + "peerDependencies": { + "eslint": ">=7.7.0" + } + }, "node_modules/@tootallnate/once": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", @@ -7806,10 +7647,10 @@ "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", "dev": true }, - "node_modules/@tsconfig/node18": { - "version": "18.2.2", - "resolved": "https://registry.npmjs.org/@tsconfig/node18/-/node18-18.2.2.tgz", - "integrity": "sha512-d6McJeGsuoRlwWZmVIeE8CUA27lu6jLjvv1JzqmpsytOYYbVi1tHZEnwCNVOXnj4pyLvneZlFlpXUK+X9wBWyw==", + "node_modules/@tsconfig/node20": { + "version": "20.1.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node20/-/node20-20.1.4.tgz", + "integrity": "sha512-sqgsT69YFeLWf5NtJ4Xq/xAF8p4ZQHlmGW74Nu2tD4+g5fAsposc4ZfaaPixVu4y01BEiDCWLRDCvDM5JOsRxg==", "dev": true }, "node_modules/@types/adm-zip": { @@ -7831,7 +7672,7 @@ "version": "7.20.3", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.3.tgz", "integrity": "sha512-54fjTSeSHwfan8AyHWrKbfBWiEUrNTZsUwPTDSNaaP1QDQIZbeNUg3a59E9D+375MzUw/x1vx2/0F5LBz+AeYA==", - "devOptional": true, + "dev": true, "dependencies": { "@babel/parser": "^7.20.7", "@babel/types": "^7.20.7", @@ -7844,7 +7685,7 @@ "version": "7.6.6", "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.6.tgz", "integrity": "sha512-66BXMKb/sUWbMdBNdMvajU7i/44RkrA3z/Yt1c7R5xejt8qh84iU54yUWCtm0QwGJlDcf/gg4zd/x4mpLAlb/w==", - "devOptional": true, + "dev": true, "dependencies": { "@babel/types": "^7.0.0" } @@ -7853,7 +7694,7 @@ "version": "7.4.3", "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.3.tgz", "integrity": "sha512-ciwyCLeuRfxboZ4isgdNZi/tkt06m8Tw6uGbBSBgWrnnZGNXiEyM27xc/PjXGQLqlZ6ylbgHMnm7ccF9tCkOeQ==", - "devOptional": true, + "dev": true, "dependencies": { "@babel/parser": "^7.1.0", "@babel/types": "^7.0.0" @@ -7900,9 +7741,9 @@ "dev": true }, "node_modules/@types/eslint": { - "version": "8.44.1", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.1.tgz", - "integrity": "sha512-XpNDc4Z5Tb4x+SW1MriMVeIsMoONHCkWFMkR/aPJbzEsxqHy+4Glu/BqTdPrApfDeMaXbtNh6bseNgl5KaWrSg==", + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", + "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==", "dev": true, "peer": true, "dependencies": { @@ -7911,9 +7752,9 @@ } }, "node_modules/@types/eslint-scope": { - "version": "3.7.4", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.4.tgz", - "integrity": "sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==", + "version": "3.7.7", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", + "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", "dev": true, "peer": true, "dependencies": { @@ -7922,11 +7763,10 @@ } }, "node_modules/@types/estree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz", - "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==", - "dev": true, - "peer": true + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "dev": true }, "node_modules/@types/fs-extra": { "version": "8.1.5", @@ -7992,14 +7832,16 @@ } }, "node_modules/@types/json-schema": { - "version": "7.0.12", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz", - "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==" + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==" + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true }, "node_modules/@types/keyv": { "version": "3.1.4", @@ -8028,9 +7870,12 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.4.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.6.tgz", - "integrity": "sha512-q0RkvNgMweWWIvSMDiXhflGUKMdIxBo2M2tYM/0kEGDueQByFzK4KZAgu5YHGFNxziTlppNpTIBcqHQAxlfHdA==" + "version": "20.17.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.6.tgz", + "integrity": "sha512-VEI7OdvK2wP7XHnsuXbAJnEpEkF6NjSN45QJlL4VGqZSXsnicpesdTWsg9RISeSdYd3yeRj/y3k5KGjUXYnFwQ==", + "dependencies": { + "undici-types": "~6.19.2" + } }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", @@ -8094,7 +7939,8 @@ "node_modules/@types/semver": { "version": "7.5.8", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", - "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==" + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", + "dev": true }, "node_modules/@types/shelljs": { "version": "0.8.11", @@ -8173,7 +8019,7 @@ "version": "17.0.29", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.29.tgz", "integrity": "sha512-nacjqA3ee9zRF/++a3FUY1suHTFKZeHba2n8WeDw9cCVdmzmHpIxyzOJBcpHvvEmS8E9KqWlSnWHUkOrkhWcvA==", - "devOptional": true, + "dev": true, "dependencies": { "@types/yargs-parser": "*" } @@ -8190,33 +8036,31 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.9.0.tgz", - "integrity": "sha512-lgX7F0azQwRPB7t7WAyeHWVfW1YJ9NIgd9mvGhfQpRY56X6AVf8mwM8Wol+0z4liE7XX3QOt8MN1rUKCfSjRIA==", - "devOptional": true, - "dependencies": { - "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.9.0", - "@typescript-eslint/type-utils": "6.9.0", - "@typescript-eslint/utils": "6.9.0", - "@typescript-eslint/visitor-keys": "6.9.0", - "debug": "^4.3.4", + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.13.0.tgz", + "integrity": "sha512-nQtBLiZYMUPkclSeC3id+x4uVd1SGtHuElTxL++SfP47jR0zfkZBJHc+gL4qPsgTuypz0k8Y2GheaDYn6Gy3rg==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.13.0", + "@typescript-eslint/type-utils": "8.13.0", + "@typescript-eslint/utils": "8.13.0", + "@typescript-eslint/visitor-keys": "8.13.0", "graphemer": "^1.4.0", - "ignore": "^5.2.4", + "ignore": "^5.3.1", "natural-compare": "^1.4.0", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", - "eslint": "^7.0.0 || ^8.0.0" + "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "eslint": "^8.57.0 || ^9.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -8225,16 +8069,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.9.0.tgz", - "integrity": "sha512-1R8A9Mc39n4pCCz9o79qRO31HGNDvC7UhPhv26TovDsWPBDx+Sg3rOZdCELIA3ZmNoWAuxaMOT7aWtGRSYkQxw==", - "devOptional": true, + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.13.0.tgz", + "integrity": "sha512-XsGWww0odcUT0gJoBZ1DeulY1+jkaHUciUq4jKNv4cpInbvvrtDoyBH9rE/n2V29wQJPk8iCH1wipra9BhmiMA==", + "dev": true, "dependencies": { - "@typescript-eslint/types": "6.9.0", - "@typescript-eslint/visitor-keys": "6.9.0" + "@typescript-eslint/types": "8.13.0", + "@typescript-eslint/visitor-keys": "8.13.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -8242,81 +8086,29 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.9.0.tgz", - "integrity": "sha512-+KB0lbkpxBkBSiVCuQvduqMJy+I1FyDbdwSpM3IoBS7APl4Bu15lStPjgBIdykdRqQNYqYNMa8Kuidax6phaEw==", - "devOptional": true, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/typescript-estree": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.9.0.tgz", - "integrity": "sha512-NJM2BnJFZBEAbCfBP00zONKXvMqihZCrmwCaik0UhLr0vAgb6oguXxLX1k00oQyD+vZZ+CJn3kocvv2yxm4awQ==", - "devOptional": true, - "dependencies": { - "@typescript-eslint/types": "6.9.0", - "@typescript-eslint/visitor-keys": "6.9.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.9.0.tgz", - "integrity": "sha512-5Wf+Jsqya7WcCO8me504FBigeQKVLAMPmUzYgDbWchINNh1KJbxCgVya3EQ2MjvJMVeXl3pofRmprqX6mfQkjQ==", - "devOptional": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@types/json-schema": "^7.0.12", - "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.9.0", - "@typescript-eslint/types": "6.9.0", - "@typescript-eslint/typescript-estree": "6.9.0", - "semver": "^7.5.4" - }, + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.13.0.tgz", + "integrity": "sha512-4cyFErJetFLckcThRUFdReWJjVsPCqyBlJTi6IDEpc1GWCIIZRFxVppjWLIMcQhNGhdWJJRYFHpHoDWvMlDzng==", + "dev": true, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.9.0.tgz", - "integrity": "sha512-dGtAfqjV6RFOtIP8I0B4ZTBRrlTT8NHHlZZSchQx3qReaoDeXhYM++M4So2AgFK9ZB0emRPA6JI1HkafzA2Ibg==", - "devOptional": true, + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.13.0.tgz", + "integrity": "sha512-7N/+lztJqH4Mrf0lb10R/CbI1EaAMMGyF5y0oJvFoAhafwgiRA7TXyd8TFn8FC8k5y2dTsYogg238qavRGNnlw==", + "dev": true, "dependencies": { - "@typescript-eslint/types": "6.9.0", - "eslint-visitor-keys": "^3.4.1" + "@typescript-eslint/types": "8.13.0", + "eslint-visitor-keys": "^3.4.3" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -8327,7 +8119,7 @@ "version": "3.4.3", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", - "devOptional": true, + "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -8336,26 +8128,26 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.9.0.tgz", - "integrity": "sha512-GZmjMh4AJ/5gaH4XF2eXA8tMnHWP+Pm1mjQR2QN4Iz+j/zO04b9TOvJYOX2sCNIQHtRStKTxRY1FX7LhpJT4Gw==", - "devOptional": true, - "dependencies": { - "@typescript-eslint/scope-manager": "6.9.0", - "@typescript-eslint/types": "6.9.0", - "@typescript-eslint/typescript-estree": "6.9.0", - "@typescript-eslint/visitor-keys": "6.9.0", + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.13.0.tgz", + "integrity": "sha512-w0xp+xGg8u/nONcGw1UXAr6cjCPU1w0XVyBs6Zqaj5eLmxkKQAByTdV/uGgNN5tVvN/kKpoQlP2cL7R+ajZZIQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "8.13.0", + "@typescript-eslint/types": "8.13.0", + "@typescript-eslint/typescript-estree": "8.13.0", + "@typescript-eslint/visitor-keys": "8.13.0", "debug": "^4.3.4" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.57.0 || ^9.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -8364,16 +8156,16 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.9.0.tgz", - "integrity": "sha512-1R8A9Mc39n4pCCz9o79qRO31HGNDvC7UhPhv26TovDsWPBDx+Sg3rOZdCELIA3ZmNoWAuxaMOT7aWtGRSYkQxw==", - "devOptional": true, + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.13.0.tgz", + "integrity": "sha512-XsGWww0odcUT0gJoBZ1DeulY1+jkaHUciUq4jKNv4cpInbvvrtDoyBH9rE/n2V29wQJPk8iCH1wipra9BhmiMA==", + "dev": true, "dependencies": { - "@typescript-eslint/types": "6.9.0", - "@typescript-eslint/visitor-keys": "6.9.0" + "@typescript-eslint/types": "8.13.0", + "@typescript-eslint/visitor-keys": "8.13.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -8381,12 +8173,12 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.9.0.tgz", - "integrity": "sha512-+KB0lbkpxBkBSiVCuQvduqMJy+I1FyDbdwSpM3IoBS7APl4Bu15lStPjgBIdykdRqQNYqYNMa8Kuidax6phaEw==", - "devOptional": true, + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.13.0.tgz", + "integrity": "sha512-4cyFErJetFLckcThRUFdReWJjVsPCqyBlJTi6IDEpc1GWCIIZRFxVppjWLIMcQhNGhdWJJRYFHpHoDWvMlDzng==", + "dev": true, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -8394,21 +8186,22 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.9.0.tgz", - "integrity": "sha512-NJM2BnJFZBEAbCfBP00zONKXvMqihZCrmwCaik0UhLr0vAgb6oguXxLX1k00oQyD+vZZ+CJn3kocvv2yxm4awQ==", - "devOptional": true, + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.13.0.tgz", + "integrity": "sha512-v7SCIGmVsRK2Cy/LTLGN22uea6SaUIlpBcO/gnMGT/7zPtxp90bphcGf4fyrCQl3ZtiBKqVTG32hb668oIYy1g==", + "dev": true, "dependencies": { - "@typescript-eslint/types": "6.9.0", - "@typescript-eslint/visitor-keys": "6.9.0", + "@typescript-eslint/types": "8.13.0", + "@typescript-eslint/visitor-keys": "8.13.0", "debug": "^4.3.4", - "globby": "^11.1.0", + "fast-glob": "^3.3.2", "is-glob": "^4.0.3", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -8421,16 +8214,16 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.9.0.tgz", - "integrity": "sha512-dGtAfqjV6RFOtIP8I0B4ZTBRrlTT8NHHlZZSchQx3qReaoDeXhYM++M4So2AgFK9ZB0emRPA6JI1HkafzA2Ibg==", - "devOptional": true, + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.13.0.tgz", + "integrity": "sha512-7N/+lztJqH4Mrf0lb10R/CbI1EaAMMGyF5y0oJvFoAhafwgiRA7TXyd8TFn8FC8k5y2dTsYogg238qavRGNnlw==", + "dev": true, "dependencies": { - "@typescript-eslint/types": "6.9.0", - "eslint-visitor-keys": "^3.4.1" + "@typescript-eslint/types": "8.13.0", + "eslint-visitor-keys": "^3.4.3" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -8441,7 +8234,7 @@ "version": "3.4.3", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", - "devOptional": true, + "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -8449,73 +8242,52 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.56.0.tgz", - "integrity": "sha512-jGYKyt+iBakD0SA5Ww8vFqGpoV2asSjwt60Gl6YcO8ksQ8s2HlUEyHBMSa38bdLopYqGf7EYQMUIGdT/Luw+sw==", + "node_modules/@typescript-eslint/parser/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, "dependencies": { - "@typescript-eslint/types": "5.56.0", - "@typescript-eslint/visitor-keys": "5.56.0" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">=16 || 14 >=14.17" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.9.0.tgz", - "integrity": "sha512-XXeahmfbpuhVbhSOROIzJ+b13krFmgtc4GlEuu1WBT+RpyGPIA4Y/eGnXzjbDj5gZLzpAXO/sj+IF/x2GtTMjQ==", - "devOptional": true, + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.13.0.tgz", + "integrity": "sha512-Rqnn6xXTR316fP4D2pohZenJnp+NwQ1mo7/JM+J1LWZENSLkJI8ID8QNtlvFeb0HnFSK94D6q0cnMX6SbE5/vA==", + "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.9.0", - "@typescript-eslint/utils": "6.9.0", + "@typescript-eslint/typescript-estree": "8.13.0", + "@typescript-eslint/utils": "8.13.0", "debug": "^4.3.4", - "ts-api-utils": "^1.0.1" + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" - }, "peerDependenciesMeta": { "typescript": { "optional": true } } }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/scope-manager": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.9.0.tgz", - "integrity": "sha512-1R8A9Mc39n4pCCz9o79qRO31HGNDvC7UhPhv26TovDsWPBDx+Sg3rOZdCELIA3ZmNoWAuxaMOT7aWtGRSYkQxw==", - "devOptional": true, - "dependencies": { - "@typescript-eslint/types": "6.9.0", - "@typescript-eslint/visitor-keys": "6.9.0" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.9.0.tgz", - "integrity": "sha512-+KB0lbkpxBkBSiVCuQvduqMJy+I1FyDbdwSpM3IoBS7APl4Bu15lStPjgBIdykdRqQNYqYNMa8Kuidax6phaEw==", - "devOptional": true, + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.13.0.tgz", + "integrity": "sha512-4cyFErJetFLckcThRUFdReWJjVsPCqyBlJTi6IDEpc1GWCIIZRFxVppjWLIMcQhNGhdWJJRYFHpHoDWvMlDzng==", + "dev": true, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -8523,21 +8295,22 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.9.0.tgz", - "integrity": "sha512-NJM2BnJFZBEAbCfBP00zONKXvMqihZCrmwCaik0UhLr0vAgb6oguXxLX1k00oQyD+vZZ+CJn3kocvv2yxm4awQ==", - "devOptional": true, + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.13.0.tgz", + "integrity": "sha512-v7SCIGmVsRK2Cy/LTLGN22uea6SaUIlpBcO/gnMGT/7zPtxp90bphcGf4fyrCQl3ZtiBKqVTG32hb668oIYy1g==", + "dev": true, "dependencies": { - "@typescript-eslint/types": "6.9.0", - "@typescript-eslint/visitor-keys": "6.9.0", + "@typescript-eslint/types": "8.13.0", + "@typescript-eslint/visitor-keys": "8.13.0", "debug": "^4.3.4", - "globby": "^11.1.0", + "fast-glob": "^3.3.2", "is-glob": "^4.0.3", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -8549,87 +8322,119 @@ } } }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/utils": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.9.0.tgz", - "integrity": "sha512-5Wf+Jsqya7WcCO8me504FBigeQKVLAMPmUzYgDbWchINNh1KJbxCgVya3EQ2MjvJMVeXl3pofRmprqX6mfQkjQ==", - "devOptional": true, + "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys": { + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.13.0.tgz", + "integrity": "sha512-7N/+lztJqH4Mrf0lb10R/CbI1EaAMMGyF5y0oJvFoAhafwgiRA7TXyd8TFn8FC8k5y2dTsYogg238qavRGNnlw==", + "dev": true, "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@types/json-schema": "^7.0.12", - "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.9.0", - "@typescript-eslint/types": "6.9.0", - "@typescript-eslint/typescript-estree": "6.9.0", - "semver": "^7.5.4" + "@typescript-eslint/types": "8.13.0", + "eslint-visitor-keys": "^3.4.3" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, - "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.9.0.tgz", - "integrity": "sha512-dGtAfqjV6RFOtIP8I0B4ZTBRrlTT8NHHlZZSchQx3qReaoDeXhYM++M4So2AgFK9ZB0emRPA6JI1HkafzA2Ibg==", - "devOptional": true, + "node_modules/@typescript-eslint/type-utils/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.13.0.tgz", + "integrity": "sha512-A1EeYOND6Uv250nybnLZapeXpYMl8tkzYUxqmoKAWnI4sei3ihf2XdZVd+vVOmHGcp3t+P7yRrNsyyiXTvShFQ==", + "dev": true, "dependencies": { - "@typescript-eslint/types": "6.9.0", - "eslint-visitor-keys": "^3.4.1" + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.13.0", + "@typescript-eslint/types": "8.13.0", + "@typescript-eslint/typescript-estree": "8.13.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0" } }, - "node_modules/@typescript-eslint/type-utils/node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", - "devOptional": true, + "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/scope-manager": { + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.13.0.tgz", + "integrity": "sha512-XsGWww0odcUT0gJoBZ1DeulY1+jkaHUciUq4jKNv4cpInbvvrtDoyBH9rE/n2V29wQJPk8iCH1wipra9BhmiMA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "8.13.0", + "@typescript-eslint/visitor-keys": "8.13.0" + }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/eslint" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/types": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.56.0.tgz", - "integrity": "sha512-JyAzbTJcIyhuUhogmiu+t79AkdnqgPUEsxMTMc/dCZczGMJQh1MK2wgrju++yMN6AWroVAy2jxyPcPr3SWCq5w==", + "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/types": { + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.13.0.tgz", + "integrity": "sha512-4cyFErJetFLckcThRUFdReWJjVsPCqyBlJTi6IDEpc1GWCIIZRFxVppjWLIMcQhNGhdWJJRYFHpHoDWvMlDzng==", + "dev": true, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.56.0.tgz", - "integrity": "sha512-41CH/GncsLXOJi0jb74SnC7jVPWeVJ0pxQj8bOjH1h2O26jXN3YHKDT1ejkVz5YeTEQPeLCCRY0U2r68tfNOcg==", + "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": { + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.13.0.tgz", + "integrity": "sha512-v7SCIGmVsRK2Cy/LTLGN22uea6SaUIlpBcO/gnMGT/7zPtxp90bphcGf4fyrCQl3ZtiBKqVTG32hb668oIYy1g==", + "dev": true, "dependencies": { - "@typescript-eslint/types": "5.56.0", - "@typescript-eslint/visitor-keys": "5.56.0", + "@typescript-eslint/types": "8.13.0", + "@typescript-eslint/visitor-keys": "8.13.0", "debug": "^4.3.4", - "globby": "^11.1.0", + "fast-glob": "^3.3.2", "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -8641,90 +8446,77 @@ } } }, - "node_modules/@typescript-eslint/utils": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.56.0.tgz", - "integrity": "sha512-XhZDVdLnUJNtbzaJeDSCIYaM+Tgr59gZGbFuELgF7m0IY03PlciidS7UQNKLE0+WpUTn1GlycEr6Ivb/afjbhA==", + "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/visitor-keys": { + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.13.0.tgz", + "integrity": "sha512-7N/+lztJqH4Mrf0lb10R/CbI1EaAMMGyF5y0oJvFoAhafwgiRA7TXyd8TFn8FC8k5y2dTsYogg238qavRGNnlw==", + "dev": true, "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.56.0", - "@typescript-eslint/types": "5.56.0", - "@typescript-eslint/typescript-estree": "5.56.0", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" + "@typescript-eslint/types": "8.13.0", + "eslint-visitor-keys": "^3.4.3" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.56.0.tgz", - "integrity": "sha512-1mFdED7u5bZpX6Xxf5N9U2c18sb+8EvU3tyOIj6LQZ5OOvnmj8BVeNNP603OFPm5KkS1a7IvCIcwrdHXaEMG/Q==", - "dependencies": { - "@typescript-eslint/types": "5.56.0", - "eslint-visitor-keys": "^3.3.0" - }, + "node_modules/@typescript-eslint/utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "url": "https://opencollective.com/eslint" } }, - "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.2.tgz", - "integrity": "sha512-8drBzUEyZ2llkpCA67iYrgEssKDUu68V8ChqqOfFupIaG/LCVPUT+CoGJpT77zJprs4T/W7p07LP7zAIMuweVw==", + "node_modules/@typescript-eslint/utils/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">=16 || 14 >=14.17" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@ungap/structured-clone": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", - "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==" - }, "node_modules/@vscode/debugadapter": { - "version": "1.65.0", - "resolved": "https://registry.npmjs.org/@vscode/debugadapter/-/debugadapter-1.65.0.tgz", - "integrity": "sha512-l9jdX0GFoFVAc7O4O8iVnCjO0pgxbx+wJJXCaYSuglGtYwMNcJdc7xm96cuVx4LWzSqneIjvjzbuzZtoVZhZzQ==", + "version": "1.68.0", + "resolved": "https://registry.npmjs.org/@vscode/debugadapter/-/debugadapter-1.68.0.tgz", + "integrity": "sha512-D6gk5Fw2y4FV8oYmltoXpj+VAZexxJFopN/mcZ6YcgzQE9dgq2L45Aj3GLxScJOD6GeLILcxJIaA8l3v11esGg==", "dependencies": { - "@vscode/debugprotocol": "1.65.0" + "@vscode/debugprotocol": "1.68.0" }, "engines": { "node": ">=14" } }, "node_modules/@vscode/debugadapter-testsupport": { - "version": "1.65.0", - "resolved": "https://registry.npmjs.org/@vscode/debugadapter-testsupport/-/debugadapter-testsupport-1.65.0.tgz", - "integrity": "sha512-VwXzZKhBBK2rBemzQbw7rKsaNl0rZbcWm6oMxipz152Ki9LhrTy9QDl6zZlcdvJx23r9WtNxt7qHNt02PPMisg==", + "version": "1.68.0", + "resolved": "https://registry.npmjs.org/@vscode/debugadapter-testsupport/-/debugadapter-testsupport-1.68.0.tgz", + "integrity": "sha512-UpbaPsCGMKyjIvJFtqFKDD1MVvME50xuOtRBPrqY1WdhAOLjWQN7FcKEoHv3X85twfNL21jW2M54FYwEdEQv4Q==", "dev": true, "dependencies": { - "@vscode/debugprotocol": "1.65.0" + "@vscode/debugprotocol": "1.68.0" }, "engines": { "node": ">=14" } }, "node_modules/@vscode/debugprotocol": { - "version": "1.65.0", - "resolved": "https://registry.npmjs.org/@vscode/debugprotocol/-/debugprotocol-1.65.0.tgz", - "integrity": "sha512-ejerrPMBXzYms6Ks+Gb7cdXtdncmT0xwIKNsc0c/SxhEa0HVY5jdvLUegYE91p7CQJpCnXOD/r2CvViN8txLLA==" + "version": "1.68.0", + "resolved": "https://registry.npmjs.org/@vscode/debugprotocol/-/debugprotocol-1.68.0.tgz", + "integrity": "sha512-2J27dysaXmvnfuhFGhfeuxfHRXunqNPxtBoR3koiTOA9rdxWNDTa1zIFLCFMSHJ9MPTPKFcBeblsyaCJCIlQxg==" }, "node_modules/@vscode/test-electron": { "version": "2.3.0", @@ -8778,16 +8570,6 @@ "keytar": "^7.7.0" } }, - "node_modules/@vscode/vsce/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/@vscode/vsce/node_modules/commander": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", @@ -8835,18 +8617,6 @@ "node": ">=4" } }, - "node_modules/@vscode/vsce/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/@vscode/vsce/node_modules/tmp": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", @@ -8942,73 +8712,73 @@ "dev": true }, "node_modules/@webassemblyjs/ast": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz", - "integrity": "sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz", + "integrity": "sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==", "dev": true, "peer": true, "dependencies": { - "@webassemblyjs/helper-numbers": "1.11.6", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6" + "@webassemblyjs/helper-numbers": "1.13.2", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2" } }, "node_modules/@webassemblyjs/floating-point-hex-parser": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz", - "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz", + "integrity": "sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA==", "dev": true, "peer": true }, "node_modules/@webassemblyjs/helper-api-error": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz", - "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz", + "integrity": "sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ==", "dev": true, "peer": true }, "node_modules/@webassemblyjs/helper-buffer": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.6.tgz", - "integrity": "sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz", + "integrity": "sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA==", "dev": true, "peer": true }, "node_modules/@webassemblyjs/helper-numbers": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz", - "integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz", + "integrity": "sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA==", "dev": true, "peer": true, "dependencies": { - "@webassemblyjs/floating-point-hex-parser": "1.11.6", - "@webassemblyjs/helper-api-error": "1.11.6", + "@webassemblyjs/floating-point-hex-parser": "1.13.2", + "@webassemblyjs/helper-api-error": "1.13.2", "@xtuc/long": "4.2.2" } }, "node_modules/@webassemblyjs/helper-wasm-bytecode": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz", - "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz", + "integrity": "sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA==", "dev": true, "peer": true }, "node_modules/@webassemblyjs/helper-wasm-section": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.6.tgz", - "integrity": "sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz", + "integrity": "sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw==", "dev": true, "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6" + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/wasm-gen": "1.14.1" } }, "node_modules/@webassemblyjs/ieee754": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz", - "integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz", + "integrity": "sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw==", "dev": true, "peer": true, "dependencies": { @@ -9016,9 +8786,9 @@ } }, "node_modules/@webassemblyjs/leb128": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.6.tgz", - "integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.13.2.tgz", + "integrity": "sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw==", "dev": true, "peer": true, "dependencies": { @@ -9026,79 +8796,79 @@ } }, "node_modules/@webassemblyjs/utf8": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.6.tgz", - "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.13.2.tgz", + "integrity": "sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ==", "dev": true, "peer": true }, "node_modules/@webassemblyjs/wasm-edit": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.6.tgz", - "integrity": "sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz", + "integrity": "sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==", "dev": true, "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/helper-wasm-section": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6", - "@webassemblyjs/wasm-opt": "1.11.6", - "@webassemblyjs/wasm-parser": "1.11.6", - "@webassemblyjs/wast-printer": "1.11.6" + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/helper-wasm-section": "1.14.1", + "@webassemblyjs/wasm-gen": "1.14.1", + "@webassemblyjs/wasm-opt": "1.14.1", + "@webassemblyjs/wasm-parser": "1.14.1", + "@webassemblyjs/wast-printer": "1.14.1" } }, "node_modules/@webassemblyjs/wasm-gen": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.6.tgz", - "integrity": "sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz", + "integrity": "sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg==", "dev": true, "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/ieee754": "1.11.6", - "@webassemblyjs/leb128": "1.11.6", - "@webassemblyjs/utf8": "1.11.6" + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/ieee754": "1.13.2", + "@webassemblyjs/leb128": "1.13.2", + "@webassemblyjs/utf8": "1.13.2" } }, "node_modules/@webassemblyjs/wasm-opt": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.6.tgz", - "integrity": "sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz", + "integrity": "sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw==", "dev": true, "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-buffer": "1.11.6", - "@webassemblyjs/wasm-gen": "1.11.6", - "@webassemblyjs/wasm-parser": "1.11.6" + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/wasm-gen": "1.14.1", + "@webassemblyjs/wasm-parser": "1.14.1" } }, "node_modules/@webassemblyjs/wasm-parser": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz", - "integrity": "sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz", + "integrity": "sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==", "dev": true, "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", - "@webassemblyjs/helper-api-error": "1.11.6", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/ieee754": "1.11.6", - "@webassemblyjs/leb128": "1.11.6", - "@webassemblyjs/utf8": "1.11.6" + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-api-error": "1.13.2", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/ieee754": "1.13.2", + "@webassemblyjs/leb128": "1.13.2", + "@webassemblyjs/utf8": "1.13.2" } }, "node_modules/@webassemblyjs/wast-printer": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.6.tgz", - "integrity": "sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz", + "integrity": "sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==", "dev": true, "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/ast": "1.14.1", "@xtuc/long": "4.2.2" } }, @@ -9243,20 +9013,11 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-import-assertions": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", - "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", - "dev": true, - "peer": true, - "peerDependencies": { - "acorn": "^8" - } - }, "node_modules/acorn-jsx": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -9518,15 +9279,19 @@ "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true }, "node_modules/array-buffer-byte-length": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", - "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", "dependencies": { - "call-bind": "^1.0.2", - "is-array-buffer": "^3.0.1" + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -9554,14 +9319,16 @@ "dev": true }, "node_modules/array-includes": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.7.tgz", - "integrity": "sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", + "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", + "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "get-intrinsic": "^1.2.1", + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", "is-string": "^1.0.7" }, "engines": { @@ -9580,15 +9347,17 @@ } }, "node_modules/array.prototype.findlastindex": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.3.tgz", - "integrity": "sha512-LzLoiOMAxvy+Gd3BAq3B7VeIgPdo+Q8hthvKtXybMvRV0jrXfJM/t8mw7nNlpEcVlVUnCnM2KSX4XU5HmpodOA==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", + "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", + "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "es-shim-unscopables": "^1.0.0", - "get-intrinsic": "^1.2.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -9601,6 +9370,7 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -9618,6 +9388,7 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -9632,15 +9403,17 @@ } }, "node_modules/arraybuffer.prototype.slice": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.1.tgz", - "integrity": "sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw==", - "dependencies": { - "array-buffer-byte-length": "^1.0.0", - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "get-intrinsic": "^1.2.1", - "is-array-buffer": "^3.0.2", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", "is-shared-array-buffer": "^1.0.2" }, "engines": { @@ -9761,9 +9534,12 @@ } }, "node_modules/available-typed-arrays": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", - "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, "engines": { "node": ">= 0.4" }, @@ -9793,7 +9569,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", - "devOptional": true, + "dev": true, "dependencies": { "@jest/transform": "^29.7.0", "@types/babel__core": "^7.1.14", @@ -9814,7 +9590,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "devOptional": true, + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -9829,7 +9605,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "devOptional": true, + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -9845,7 +9621,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "devOptional": true, + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -9857,13 +9633,13 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "devOptional": true + "dev": true }, "node_modules/babel-jest/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" } @@ -9872,7 +9648,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "devOptional": true, + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -9899,7 +9675,7 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", - "devOptional": true, + "dev": true, "dependencies": { "@babel/template": "^7.3.3", "@babel/types": "^7.3.3", @@ -9936,7 +9712,7 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", - "devOptional": true, + "dev": true, "dependencies": { "babel-plugin-jest-hoist": "^29.6.3", "babel-preset-current-node-syntax": "^1.0.0" @@ -10131,9 +9907,9 @@ "dev": true }, "node_modules/browserslist": { - "version": "4.23.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.3.tgz", - "integrity": "sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==", + "version": "4.24.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz", + "integrity": "sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg==", "funding": [ { "type": "opencollective", @@ -10149,10 +9925,10 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001646", - "electron-to-chromium": "^1.5.4", + "caniuse-lite": "^1.0.30001669", + "electron-to-chromium": "^1.5.41", "node-releases": "^2.0.18", - "update-browserslist-db": "^1.1.0" + "update-browserslist-db": "^1.1.1" }, "bin": { "browserslist": "cli.js" @@ -10245,7 +10021,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "devOptional": true + "dev": true }, "node_modules/buffer-indexof-polyfill": { "version": "1.0.2", @@ -10265,18 +10041,6 @@ "node": ">=0.2.0" } }, - "node_modules/builtin-modules": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", - "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", - "dev": true, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/builtins": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", @@ -10477,12 +10241,18 @@ } }, "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -10534,6 +10304,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, "engines": { "node": ">=6" } @@ -10594,9 +10365,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001651", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001651.tgz", - "integrity": "sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg==", + "version": "1.0.30001677", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001677.tgz", + "integrity": "sha512-fmfjsOlJUpMWu+mAAtZZZHz7UEwsUxIIvu1TJfO1HqFQvB/B+ii0xr9B5HpbZY/mC4XZ8SvjHJqtAY6pDPQEog==", "funding": [ { "type": "opencollective", @@ -10724,7 +10495,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", - "devOptional": true, + "dev": true, "engines": { "node": ">=10" } @@ -10877,9 +10648,9 @@ } }, "node_modules/chrome-trace-event": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", - "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz", + "integrity": "sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==", "dev": true, "peer": true, "engines": { @@ -10896,7 +10667,7 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", - "devOptional": true + "dev": true }, "node_modules/clean-git-ref": { "version": "2.0.1", @@ -11068,7 +10839,7 @@ "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", - "devOptional": true, + "dev": true, "engines": { "iojs": ">= 1.0.0", "node": ">= 0.12.0" @@ -11078,7 +10849,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", - "devOptional": true + "dev": true }, "node_modules/color-convert": { "version": "1.9.3", @@ -11144,14 +10915,11 @@ } }, "node_modules/commander": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-12.0.0.tgz", - "integrity": "sha512-MwVNWlYjDTtOjX5PiD7o5pK0UrFU/OYgcJfjjK4RaHZETNtjJqrZa9Y9ds88+A+f+d5lv+561eZ+yCKoS3gbAA==", + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - } + "peer": true }, "node_modules/comment-json": { "version": "3.0.3", @@ -11206,16 +10974,6 @@ "node": ">= 12" } }, - "node_modules/commitizen/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/commitizen/node_modules/fs-extra": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", @@ -11263,18 +11021,6 @@ "graceful-fs": "^4.1.6" } }, - "node_modules/commitizen/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/commitizen/node_modules/minimist": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", @@ -12230,7 +11976,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", - "devOptional": true, + "dev": true, "dependencies": { "@jest/types": "^29.6.3", "chalk": "^4.0.0", @@ -12251,7 +11997,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "devOptional": true, + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -12266,7 +12012,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "devOptional": true, + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -12282,7 +12028,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "devOptional": true, + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -12294,13 +12040,13 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "devOptional": true + "dev": true }, "node_modules/create-jest/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" } @@ -12309,7 +12055,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "devOptional": true, + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -12566,6 +12312,54 @@ "node": ">=10" } }, + "node_modules/data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/dateformat": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", @@ -12744,7 +12538,7 @@ "version": "4.3.1", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", - "devOptional": true, + "dev": true, "engines": { "node": ">=0.10.0" } @@ -12793,11 +12587,28 @@ "node": ">=10" } }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/define-properties": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", - "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "dependencies": { + "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" }, @@ -12893,16 +12704,6 @@ "sprintf-js": "~1.0.2" } }, - "node_modules/depcheck/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/depcheck/node_modules/cosmiconfig": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", @@ -12932,18 +12733,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/depcheck/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/depcheck/node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -13029,7 +12818,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" } @@ -13087,7 +12876,7 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", - "devOptional": true, + "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } @@ -13108,17 +12897,6 @@ "node": ">=8" } }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/dom-serializer": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", @@ -13298,9 +13076,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.7", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.7.tgz", - "integrity": "sha512-6FTNWIWMxMy/ZY6799nBlPtF1DFDQ6VQJ7yyDP27SJNt5lwtQ5ufqVvHylb3fdQefvRcgA3fKcFMJi9OLwBRNw==" + "version": "1.5.52", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.52.tgz", + "integrity": "sha512-xtoijJTZ+qeucLBDNztDOuQBE1ksqjvNjvqFoST3nGC7fSpqJ+X6BdTBaY5BHG+IhWWmpc6b/KfpeuEDupEPOQ==" }, "node_modules/emitter-listener": { "version": "1.1.2", @@ -13314,7 +13092,7 @@ "version": "0.13.1", "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", - "devOptional": true, + "dev": true, "engines": { "node": ">=12" }, @@ -13424,55 +13202,62 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "devOptional": true, + "dev": true, "dependencies": { "is-arrayish": "^0.2.1" } }, "node_modules/es-abstract": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.1.tgz", - "integrity": "sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw==", - "dependencies": { - "array-buffer-byte-length": "^1.0.0", - "arraybuffer.prototype.slice": "^1.0.1", - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "es-set-tostringtag": "^2.0.1", + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", "es-to-primitive": "^1.2.1", - "function.prototype.name": "^1.1.5", - "get-intrinsic": "^1.2.1", - "get-symbol-description": "^1.0.0", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", "globalthis": "^1.0.3", "gopd": "^1.0.1", - "has": "^1.0.3", - "has-property-descriptors": "^1.0.0", - "has-proto": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", "has-symbols": "^1.0.3", - "internal-slot": "^1.0.5", - "is-array-buffer": "^3.0.2", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", "is-callable": "^1.2.7", - "is-negative-zero": "^2.0.2", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", + "is-shared-array-buffer": "^1.0.3", "is-string": "^1.0.7", - "is-typed-array": "^1.1.10", + "is-typed-array": "^1.1.13", "is-weakref": "^1.0.2", - "object-inspect": "^1.12.3", + "object-inspect": "^1.13.1", "object-keys": "^1.1.1", - "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.5.0", - "safe-array-concat": "^1.0.0", - "safe-regex-test": "^1.0.0", - "string.prototype.trim": "^1.2.7", - "string.prototype.trimend": "^1.0.6", - "string.prototype.trimstart": "^1.0.6", - "typed-array-buffer": "^1.0.0", - "typed-array-byte-length": "^1.0.0", - "typed-array-byte-offset": "^1.0.0", - "typed-array-length": "^1.0.4", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.6", "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.10" + "which-typed-array": "^1.1.15" }, "engines": { "node": ">= 0.4" @@ -13481,21 +13266,50 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/es-module-lexer": { + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.3.0.tgz", - "integrity": "sha512-vZK7T0N2CBmBOixhmjdqx2gWVbFZ4DXZ/NyRMZVlJXPa7CyFS+/a4QQsDGDQy9ZfEzxFuNEsMLeQJnKP2p5/JA==", - "dev": true, - "peer": true + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-module-lexer": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", + "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==", + "dev": true + }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } }, "node_modules/es-set-tostringtag": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", - "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", "dependencies": { - "get-intrinsic": "^1.1.3", - "has": "^1.0.3", - "has-tostringtag": "^1.0.0" + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" }, "engines": { "node": ">= 0.4" @@ -13505,6 +13319,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", + "dev": true, "dependencies": { "hasown": "^2.0.0" } @@ -13889,9 +13704,9 @@ } }, "node_modules/escalade": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", - "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "engines": { "node": ">=6" } @@ -13933,63 +13748,69 @@ } }, "node_modules/eslint": { - "version": "8.52.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.52.0.tgz", - "integrity": "sha512-zh/JHnaixqHZsolRB/w9/02akBk9EPrOs9JwcTP2ek7yL5bVvXuRariiaAjjoJ5DvuwQ1WAE/HsMz+w17YgBCg==", + "version": "9.13.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.13.0.tgz", + "integrity": "sha512-EYZK6SX6zjFHST/HRytOdA/zE72Cq/bfw45LSyuwrdvcclb/gqV8RRQxywOBEWO2+WDpva6UZa4CcDeJKzUCFA==", + "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "8.52.0", - "@humanwhocodes/config-array": "^0.11.13", + "@eslint-community/regexpp": "^4.11.0", + "@eslint/config-array": "^0.18.0", + "@eslint/core": "^0.7.0", + "@eslint/eslintrc": "^3.1.0", + "@eslint/js": "9.13.0", + "@eslint/plugin-kit": "^0.2.0", + "@humanfs/node": "^0.16.5", "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "@ungap/structured-clone": "^1.2.0", + "@humanwhocodes/retry": "^0.3.1", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", - "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", + "eslint-scope": "^8.1.0", + "eslint-visitor-keys": "^4.1.0", + "espree": "^10.2.0", + "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", + "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", "text-table": "^0.2.0" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } } }, "node_modules/eslint-config-prettier": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz", - "integrity": "sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", "dev": true, "bin": { "eslint-config-prettier": "bin/cli.js" @@ -14002,6 +13823,7 @@ "version": "0.3.9", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", + "dev": true, "dependencies": { "debug": "^3.2.7", "is-core-module": "^2.13.0", @@ -14012,14 +13834,16 @@ "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, "dependencies": { "ms": "^2.1.1" } }, "node_modules/eslint-module-utils": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", - "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.0.tgz", + "integrity": "sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg==", + "dev": true, "dependencies": { "debug": "^3.2.7" }, @@ -14036,62 +13860,49 @@ "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, "dependencies": { "ms": "^2.1.1" } }, - "node_modules/eslint-plugin-header": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-header/-/eslint-plugin-header-3.1.1.tgz", - "integrity": "sha512-9vlKxuJ4qf793CmeeSrZUvVClw6amtpghq3CuWcB5cUNnWHQhgcqy5eF8oVKFk1G3Y/CbchGfEaw3wiIJaNmVg==", - "dev": true, - "peerDependencies": { - "eslint": ">=7.7.0" - } - }, "node_modules/eslint-plugin-import": { - "version": "2.29.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.0.tgz", - "integrity": "sha512-QPOO5NO6Odv5lpoTkddtutccQjysJuFxoPS7fAHO+9m9udNHvTCPSAMW9zGAYj8lAIdr40I8yPCdUYrncXtrwg==", + "version": "2.31.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz", + "integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==", + "dev": true, "dependencies": { - "array-includes": "^3.1.7", - "array.prototype.findlastindex": "^1.2.3", + "@rtsao/scc": "^1.1.0", + "array-includes": "^3.1.8", + "array.prototype.findlastindex": "^1.2.5", "array.prototype.flat": "^1.3.2", "array.prototype.flatmap": "^1.3.2", "debug": "^3.2.7", "doctrine": "^2.1.0", "eslint-import-resolver-node": "^0.3.9", - "eslint-module-utils": "^2.8.0", - "hasown": "^2.0.0", - "is-core-module": "^2.13.1", + "eslint-module-utils": "^2.12.0", + "hasown": "^2.0.2", + "is-core-module": "^2.15.1", "is-glob": "^4.0.3", "minimatch": "^3.1.2", - "object.fromentries": "^2.0.7", - "object.groupby": "^1.0.1", - "object.values": "^1.1.7", + "object.fromentries": "^2.0.8", + "object.groupby": "^1.0.3", + "object.values": "^1.2.0", "semver": "^6.3.1", - "tsconfig-paths": "^3.14.2" + "string.prototype.trimend": "^1.0.8", + "tsconfig-paths": "^3.15.0" }, "engines": { "node": ">=4" }, "peerDependencies": { - "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" - } - }, - "node_modules/eslint-plugin-import/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9" } }, "node_modules/eslint-plugin-import/node_modules/debug": { "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, "dependencies": { "ms": "^2.1.1" } @@ -14100,6 +13911,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, "dependencies": { "esutils": "^2.0.2" }, @@ -14107,38 +13919,29 @@ "node": ">=0.10.0" } }, - "node_modules/eslint-plugin-import/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/eslint-plugin-import/node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, "bin": { "semver": "bin/semver.js" } }, "node_modules/eslint-plugin-jest": { - "version": "27.5.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.5.0.tgz", - "integrity": "sha512-ed+254pKIJa0vHUxzHODwwrdrxnRxkViFq1FaRR7A4PTn1hMFRrk+IEe08UzkqzO6jhXUxsWIsClR1bBNtsc5w==", + "version": "28.9.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-28.9.0.tgz", + "integrity": "sha512-rLu1s1Wf96TgUUxSw6loVIkNtUjq1Re7A9QdCCHSohnvXEBAjuL420h0T/fMmkQlNsQP2GhQzEUpYHPfxBkvYQ==", + "dev": true, "dependencies": { - "@typescript-eslint/utils": "^5.10.0" + "@typescript-eslint/utils": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^16.10.0 || ^18.12.0 || >=20.0.0" }, "peerDependencies": { - "@typescript-eslint/eslint-plugin": "^5.0.0 || ^6.0.0", - "eslint": "^7.0.0 || ^8.0.0", + "@typescript-eslint/eslint-plugin": "^6.0.0 || ^7.0.0 || ^8.0.0", + "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0", "jest": "*" }, "peerDependenciesMeta": { @@ -14163,37 +13966,68 @@ } }, "node_modules/eslint-plugin-jsdoc": { - "version": "46.8.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-46.8.2.tgz", - "integrity": "sha512-5TSnD018f3tUJNne4s4gDWQflbsgOycIKEUBoCLn6XtBMgNHxQFmV8vVxUtiPxAQq8lrX85OaSG/2gnctxw9uQ==", + "version": "50.4.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-50.4.3.tgz", + "integrity": "sha512-uWtwFxGRv6B8sU63HZM5dAGDhgsatb+LONwmILZJhdRALLOkCX2HFZhdL/Kw2ls8SQMAVEfK+LmnEfxInRN8HA==", "dev": true, "dependencies": { - "@es-joy/jsdoccomment": "~0.40.1", + "@es-joy/jsdoccomment": "~0.49.0", "are-docs-informative": "^0.0.2", - "comment-parser": "1.4.0", - "debug": "^4.3.4", + "comment-parser": "1.4.1", + "debug": "^4.3.6", "escape-string-regexp": "^4.0.0", - "esquery": "^1.5.0", - "is-builtin-module": "^3.2.1", - "semver": "^7.5.4", - "spdx-expression-parse": "^3.0.1" + "espree": "^10.1.0", + "esquery": "^1.6.0", + "parse-imports": "^2.1.1", + "semver": "^7.6.3", + "spdx-expression-parse": "^4.0.0", + "synckit": "^0.9.1" }, "engines": { - "node": ">=16" + "node": ">=18" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" + } + }, + "node_modules/eslint-plugin-jsdoc/node_modules/acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" } }, "node_modules/eslint-plugin-jsdoc/node_modules/comment-parser": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.0.tgz", - "integrity": "sha512-QLyTNiZ2KDOibvFPlZ6ZngVsZ/0gYnE6uTXi5aoDg8ed3AkJAz4sEje3Y8a29hQ1s6A99MZXe47fLAXQ1rTqaw==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", + "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==", "dev": true, "engines": { "node": ">= 12.0.0" } }, + "node_modules/eslint-plugin-jsdoc/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, "node_modules/eslint-plugin-jsdoc/node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -14206,6 +14040,51 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/eslint-plugin-jsdoc/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-plugin-jsdoc/node_modules/espree": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", + "dev": true, + "dependencies": { + "acorn": "^8.14.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-plugin-jsdoc/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/eslint-plugin-jsdoc/node_modules/spdx-expression-parse": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz", + "integrity": "sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, "node_modules/eslint-plugin-prefer-arrow": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/eslint-plugin-prefer-arrow/-/eslint-plugin-prefer-arrow-1.2.3.tgz", @@ -14216,35 +14095,41 @@ } }, "node_modules/eslint-plugin-prettier": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.1.tgz", - "integrity": "sha512-htg25EUYUeIhKHXjOinK4BgCcDwtLHjqaxCDsMy5nbnUMkKFvIhMVCp+5GFUXQ4Nr8lBsPqtGAqBenbpFqAA2g==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.1.tgz", + "integrity": "sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==", "dev": true, "dependencies": { - "prettier-linter-helpers": "^1.0.0" + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.9.1" }, "engines": { - "node": ">=6.0.0" + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-plugin-prettier" }, "peerDependencies": { - "eslint": ">=5.0.0", - "prettier": ">=1.13.0" + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "eslint-config-prettier": "*", + "prettier": ">=3.0.0" }, "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, "eslint-config-prettier": { "optional": true } } }, - "node_modules/eslint-restricted-globals": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eslint-restricted-globals/-/eslint-restricted-globals-0.2.0.tgz", - "integrity": "sha512-kwYJALm5KS2QW3Mc1PgObO4V+pTR6RQtRT65L1GQILlEnAhabUQqGAX7/qUjoQR4KZJKehWpBtyDEiDecwmY9A==" - }, "node_modules/eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "peer": true, "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^4.1.1" @@ -14253,41 +14138,16 @@ "node": ">=8.0.0" } }, - "node_modules/eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^2.0.0" - }, - "engines": { - "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - }, - "peerDependencies": { - "eslint": ">=5" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "engines": { - "node": ">=10" - } - }, "node_modules/eslint/node_modules/@eslint/eslintrc": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", - "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", + "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", + "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", + "espree": "^10.0.1", + "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -14295,34 +14155,29 @@ "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/@humanwhocodes/config-array": { - "version": "0.11.13", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", - "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==", - "dependencies": { - "@humanwhocodes/object-schema": "^2.0.1", - "debug": "^4.1.1", - "minimatch": "^3.0.5" + "node_modules/eslint/node_modules/acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true, + "bin": { + "acorn": "bin/acorn" }, "engines": { - "node": ">=10.10.0" + "node": ">=0.4.0" } }, - "node_modules/eslint/node_modules/@humanwhocodes/object-schema": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz", - "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==" - }, "node_modules/eslint/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -14333,19 +14188,11 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/eslint/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/eslint/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -14361,6 +14208,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -14371,12 +14219,14 @@ "node_modules/eslint/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "node_modules/eslint/node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, "engines": { "node": ">=10" }, @@ -14385,26 +14235,45 @@ } }, "node_modules/eslint/node_modules/eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", + "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", + "dev": true, "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/eslint/node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/espree": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", + "dev": true, + "dependencies": { + "acorn": "^8.14.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -14414,14 +14283,41 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, "engines": { "node": ">=4.0" } }, + "node_modules/eslint/node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/eslint/node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/eslint/node_modules/glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, "dependencies": { "is-glob": "^4.0.3" }, @@ -14430,14 +14326,12 @@ } }, "node_modules/eslint/node_modules/globals": { - "version": "13.23.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", - "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", - "dependencies": { - "type-fest": "^0.20.2" - }, + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, "engines": { - "node": ">=8" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -14447,28 +14341,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/eslint/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/eslint/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, + "dev": true, "engines": { "node": ">=8" } @@ -14477,6 +14350,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -14484,55 +14358,6 @@ "node": ">=8" } }, - "node_modules/eslint/node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", - "dependencies": { - "acorn": "^8.9.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/espree/node_modules/acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, "node_modules/esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", @@ -14546,9 +14371,10 @@ } }, "node_modules/esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "dev": true, "dependencies": { "estraverse": "^5.1.0" }, @@ -14560,6 +14386,7 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, "engines": { "node": ">=4.0" } @@ -14568,6 +14395,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, "dependencies": { "estraverse": "^5.2.0" }, @@ -14579,6 +14407,7 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, "engines": { "node": ">=4.0" } @@ -14630,7 +14459,7 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", - "devOptional": true, + "dev": true, "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.0", @@ -14653,7 +14482,7 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", - "devOptional": true, + "dev": true, "engines": { "node": ">= 0.8.0" } @@ -14689,7 +14518,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", - "devOptional": true, + "dev": true, "dependencies": { "@jest/expect-utils": "^29.7.0", "jest-get-type": "^29.6.3", @@ -14877,17 +14706,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dependencies": { - "flat-cache": "^3.0.4" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, "node_modules/filelist": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", @@ -15082,6 +14900,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -15097,6 +14916,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, "engines": { "node": ">=8" } @@ -15125,23 +14945,11 @@ "flat": "cli.js" } }, - "node_modules/flat-cache": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.1.tgz", - "integrity": "sha512-/qM2b3LUIaIgviBQovTLvijfyOQXPtSRnRK26ksj2J7rzPIecePUIpJsZ4T02Qg+xiAEKIs5K8dsHEd+VaKa/Q==", - "dependencies": { - "flatted": "^3.2.9", - "keyv": "^4.5.3", - "rimraf": "^3.0.2" - }, - "engines": { - "node": ">=12.0.0" - } - }, "node_modules/flatted": { "version": "3.2.9", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz", - "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==" + "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==", + "dev": true }, "node_modules/follow-redirects": { "version": "1.15.2", @@ -15289,16 +15097,6 @@ "node": ">=0.6" } }, - "node_modules/fstream/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/fstream/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -15319,18 +15117,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/fstream/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/fstream/node_modules/rimraf": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", @@ -15352,14 +15138,14 @@ } }, "node_modules/function.prototype.name": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", - "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.0", - "functions-have-names": "^1.2.2" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" }, "engines": { "node": ">= 0.4" @@ -15368,12 +15154,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true - }, "node_modules/functions-have-names": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", @@ -15425,7 +15205,7 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "devOptional": true, + "dev": true, "engines": { "node": "6.* || 8.* || >= 10.*" } @@ -15440,14 +15220,18 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", - "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", "has-proto": "^1.0.1", - "has-symbols": "^1.0.3" + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -15562,7 +15346,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "devOptional": true, + "dev": true, "engines": { "node": ">=10" }, @@ -15571,12 +15355,13 @@ } }, "node_modules/get-symbol-description": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", - "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" }, "engines": { "node": ">= 0.4" @@ -16280,16 +16065,11 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, - "node_modules/grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", - "dev": true - }, "node_modules/graphemer": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==" + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true }, "node_modules/handlebars": { "version": "4.7.8", @@ -16321,17 +16101,6 @@ "node": ">=6" } }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/has-bigints": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", @@ -16358,20 +16127,20 @@ } }, "node_modules/has-property-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", - "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "dependencies": { - "get-intrinsic": "^1.1.1" + "es-define-property": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", "engines": { "node": ">= 0.4" }, @@ -16391,11 +16160,11 @@ } }, "node_modules/has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dependencies": { - "has-symbols": "^1.0.2" + "has-symbols": "^1.0.3" }, "engines": { "node": ">= 0.4" @@ -16436,9 +16205,9 @@ } }, "node_modules/hasown": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", - "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dependencies": { "function-bind": "^1.1.2" }, @@ -16623,7 +16392,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", - "devOptional": true, + "dev": true, "engines": { "node": ">=10.17.0" } @@ -16985,6 +16754,7 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -17000,6 +16770,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, "engines": { "node": ">=4" } @@ -17008,7 +16779,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", - "devOptional": true, + "dev": true, "dependencies": { "pkg-dir": "^4.2.0", "resolve-cwd": "^3.0.0" @@ -17027,7 +16798,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "devOptional": true, + "dev": true, "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -17040,7 +16811,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "devOptional": true, + "dev": true, "dependencies": { "p-locate": "^4.1.0" }, @@ -17052,7 +16823,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "devOptional": true, + "dev": true, "dependencies": { "p-try": "^2.0.0" }, @@ -17067,7 +16838,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "devOptional": true, + "dev": true, "dependencies": { "p-limit": "^2.2.0" }, @@ -17079,7 +16850,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" } @@ -17088,7 +16859,7 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "devOptional": true, + "dev": true, "dependencies": { "find-up": "^4.0.0" }, @@ -17316,12 +17087,12 @@ "dev": true }, "node_modules/internal-slot": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", - "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", "dependencies": { - "get-intrinsic": "^1.2.0", - "has": "^1.0.3", + "es-errors": "^1.3.0", + "hasown": "^2.0.0", "side-channel": "^1.0.4" }, "engines": { @@ -17378,13 +17149,15 @@ } }, "node_modules/is-array-buffer": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", - "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", "dependencies": { "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.0", - "is-typed-array": "^1.1.10" + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -17394,7 +17167,7 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "devOptional": true + "dev": true }, "node_modules/is-bigint": { "version": "1.0.4", @@ -17440,21 +17213,6 @@ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, - "node_modules/is-builtin-module": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz", - "integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==", - "dev": true, - "dependencies": { - "builtin-modules": "^3.3.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", @@ -17479,11 +17237,28 @@ } }, "node_modules/is-core-module": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", - "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", + "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", "dependencies": { - "hasown": "^2.0.0" + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "dependencies": { + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -17547,7 +17322,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", - "devOptional": true, + "dev": true, "engines": { "node": ">=6" } @@ -17618,9 +17393,9 @@ } }, "node_modules/is-negative-zero": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", - "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", "engines": { "node": ">= 0.4" }, @@ -17668,14 +17443,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "engines": { - "node": ">=8" - } - }, "node_modules/is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", @@ -17730,11 +17497,14 @@ } }, "node_modules/is-shared-array-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", - "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", "dependencies": { - "call-bind": "^1.0.2" + "call-bind": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -17753,7 +17523,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" }, @@ -17802,11 +17572,11 @@ } }, "node_modules/is-typed-array": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", - "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", "dependencies": { - "which-typed-array": "^1.1.11" + "which-typed-array": "^1.1.14" }, "engines": { "node": ">= 0.4" @@ -18068,7 +17838,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", - "devOptional": true, + "dev": true, "dependencies": { "debug": "^4.1.1", "istanbul-lib-coverage": "^3.0.0", @@ -18136,15 +17906,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jake/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/jake/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -18184,17 +17945,6 @@ "node": ">=8" } }, - "node_modules/jake/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/jake/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -18210,7 +17960,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", - "devOptional": true, + "dev": true, "dependencies": { "@jest/core": "^29.7.0", "@jest/types": "^29.6.3", @@ -18236,7 +17986,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", - "devOptional": true, + "dev": true, "dependencies": { "execa": "^5.0.0", "jest-util": "^29.7.0", @@ -18250,7 +18000,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", - "devOptional": true, + "dev": true, "dependencies": { "@jest/environment": "^29.7.0", "@jest/expect": "^29.7.0", @@ -18281,7 +18031,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "devOptional": true, + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -18296,7 +18046,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "devOptional": true, + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -18312,7 +18062,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "devOptional": true, + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -18324,13 +18074,13 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "devOptional": true + "dev": true }, "node_modules/jest-circus/node_modules/dedent": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", "integrity": "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==", - "devOptional": true, + "dev": true, "peerDependencies": { "babel-plugin-macros": "^3.1.0" }, @@ -18344,7 +18094,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" } @@ -18353,7 +18103,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "devOptional": true, + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -18365,7 +18115,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", - "devOptional": true, + "dev": true, "dependencies": { "@jest/core": "^29.7.0", "@jest/test-result": "^29.7.0", @@ -18398,7 +18148,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "devOptional": true, + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -18413,7 +18163,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "devOptional": true, + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -18429,7 +18179,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "devOptional": true, + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -18441,13 +18191,13 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "devOptional": true + "dev": true }, "node_modules/jest-cli/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" } @@ -18456,7 +18206,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "devOptional": true, + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -18468,7 +18218,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", - "devOptional": true, + "dev": true, "dependencies": { "@babel/core": "^7.11.6", "@jest/test-sequencer": "^29.7.0", @@ -18513,7 +18263,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "devOptional": true, + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -18524,21 +18274,11 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-config/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "devOptional": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/jest-config/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "devOptional": true, + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -18554,7 +18294,7 @@ "version": "3.9.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", - "devOptional": true, + "dev": true, "funding": [ { "type": "github", @@ -18569,7 +18309,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "devOptional": true, + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -18581,13 +18321,13 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "devOptional": true + "dev": true }, "node_modules/jest-config/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "devOptional": true, + "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -18607,7 +18347,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" } @@ -18616,28 +18356,16 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", - "devOptional": true, + "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-config/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "devOptional": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/jest-config/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "devOptional": true, + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -18649,7 +18377,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", - "devOptional": true, + "dev": true, "dependencies": { "chalk": "^4.0.0", "diff-sequences": "^29.6.3", @@ -18664,7 +18392,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "devOptional": true, + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -18679,7 +18407,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "devOptional": true, + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -18695,7 +18423,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "devOptional": true, + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -18707,13 +18435,13 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "devOptional": true + "dev": true }, "node_modules/jest-diff/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" } @@ -18722,7 +18450,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "devOptional": true, + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -18734,7 +18462,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", - "devOptional": true, + "dev": true, "dependencies": { "detect-newline": "^3.0.0" }, @@ -18746,7 +18474,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", - "devOptional": true, + "dev": true, "dependencies": { "@jest/types": "^29.6.3", "chalk": "^4.0.0", @@ -18762,7 +18490,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "devOptional": true, + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -18777,7 +18505,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "devOptional": true, + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -18793,7 +18521,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "devOptional": true, + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -18805,13 +18533,13 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "devOptional": true + "dev": true }, "node_modules/jest-each/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" } @@ -18820,7 +18548,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "devOptional": true, + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -18832,7 +18560,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", - "devOptional": true, + "dev": true, "dependencies": { "@jest/environment": "^29.7.0", "@jest/fake-timers": "^29.7.0", @@ -18849,7 +18577,7 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", - "devOptional": true, + "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } @@ -18858,7 +18586,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", - "devOptional": true, + "dev": true, "dependencies": { "@jest/types": "^29.6.3", "@types/graceful-fs": "^4.1.3", @@ -18883,7 +18611,7 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", - "devOptional": true, + "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } @@ -18940,7 +18668,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", - "devOptional": true, + "dev": true, "dependencies": { "jest-get-type": "^29.6.3", "pretty-format": "^29.7.0" @@ -18953,7 +18681,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", - "devOptional": true, + "dev": true, "dependencies": { "chalk": "^4.0.0", "jest-diff": "^29.7.0", @@ -18968,7 +18696,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "devOptional": true, + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -18983,7 +18711,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "devOptional": true, + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -18999,7 +18727,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "devOptional": true, + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -19011,13 +18739,13 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "devOptional": true + "dev": true }, "node_modules/jest-matcher-utils/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" } @@ -19026,7 +18754,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "devOptional": true, + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -19038,7 +18766,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", - "devOptional": true, + "dev": true, "dependencies": { "@babel/code-frame": "^7.12.13", "@jest/types": "^29.6.3", @@ -19058,7 +18786,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "devOptional": true, + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -19073,7 +18801,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "devOptional": true, + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -19089,7 +18817,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "devOptional": true, + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -19101,13 +18829,13 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "devOptional": true + "dev": true }, "node_modules/jest-message-util/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" } @@ -19116,7 +18844,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "devOptional": true, + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -19128,7 +18856,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", - "devOptional": true, + "dev": true, "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", @@ -19142,7 +18870,7 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", - "devOptional": true, + "dev": true, "engines": { "node": ">=6" }, @@ -19167,7 +18895,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", - "devOptional": true, + "dev": true, "dependencies": { "chalk": "^4.0.0", "graceful-fs": "^4.2.9", @@ -19187,7 +18915,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", - "devOptional": true, + "dev": true, "dependencies": { "jest-regex-util": "^29.6.3", "jest-snapshot": "^29.7.0" @@ -19200,7 +18928,7 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", - "devOptional": true, + "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } @@ -19209,7 +18937,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "devOptional": true, + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -19224,7 +18952,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "devOptional": true, + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -19240,7 +18968,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "devOptional": true, + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -19252,13 +18980,13 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "devOptional": true + "dev": true }, "node_modules/jest-resolve/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" } @@ -19267,7 +18995,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "devOptional": true, + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -19279,7 +19007,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", - "devOptional": true, + "dev": true, "dependencies": { "@jest/console": "^29.7.0", "@jest/environment": "^29.7.0", @@ -19311,7 +19039,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "devOptional": true, + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -19326,7 +19054,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "devOptional": true, + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -19342,7 +19070,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "devOptional": true, + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -19354,13 +19082,13 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "devOptional": true + "dev": true }, "node_modules/jest-runner/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" } @@ -19369,7 +19097,7 @@ "version": "0.5.13", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", - "devOptional": true, + "dev": true, "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -19379,7 +19107,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "devOptional": true, + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -19391,7 +19119,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", - "devOptional": true, + "dev": true, "dependencies": { "@jest/environment": "^29.7.0", "@jest/fake-timers": "^29.7.0", @@ -19424,7 +19152,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "devOptional": true, + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -19435,21 +19163,11 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-runtime/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "devOptional": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/jest-runtime/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "devOptional": true, + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -19465,7 +19183,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "devOptional": true, + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -19477,13 +19195,13 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "devOptional": true + "dev": true }, "node_modules/jest-runtime/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "devOptional": true, + "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -19503,7 +19221,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" } @@ -19512,28 +19230,16 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", - "devOptional": true, + "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-runtime/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "devOptional": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/jest-runtime/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "devOptional": true, + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -19557,7 +19263,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", - "devOptional": true, + "dev": true, "dependencies": { "@babel/core": "^7.11.6", "@babel/generator": "^7.7.2", @@ -19588,7 +19294,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "devOptional": true, + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -19603,7 +19309,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "devOptional": true, + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -19619,7 +19325,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "devOptional": true, + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -19631,13 +19337,13 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "devOptional": true + "dev": true }, "node_modules/jest-snapshot/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" } @@ -19646,7 +19352,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "devOptional": true, + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -19658,7 +19364,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", - "devOptional": true, + "dev": true, "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", @@ -19675,7 +19381,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "devOptional": true, + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -19690,7 +19396,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "devOptional": true, + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -19706,7 +19412,7 @@ "version": "3.9.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", - "devOptional": true, + "dev": true, "funding": [ { "type": "github", @@ -19721,7 +19427,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "devOptional": true, + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -19733,13 +19439,13 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "devOptional": true + "dev": true }, "node_modules/jest-util/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" } @@ -19748,7 +19454,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "devOptional": true, + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -19760,7 +19466,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", - "devOptional": true, + "dev": true, "dependencies": { "@jest/types": "^29.6.3", "camelcase": "^6.2.0", @@ -19777,7 +19483,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "devOptional": true, + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -19792,7 +19498,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "devOptional": true, + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -19808,7 +19514,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "devOptional": true, + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -19820,13 +19526,13 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "devOptional": true + "dev": true }, "node_modules/jest-validate/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" } @@ -19835,7 +19541,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "devOptional": true, + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -19847,7 +19553,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", - "devOptional": true, + "dev": true, "dependencies": { "@jest/test-result": "^29.7.0", "@jest/types": "^29.6.3", @@ -19866,7 +19572,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "devOptional": true, + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -19881,7 +19587,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "devOptional": true, + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -19897,7 +19603,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "devOptional": true, + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -19909,13 +19615,13 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "devOptional": true + "dev": true }, "node_modules/jest-watcher/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" } @@ -19924,7 +19630,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "devOptional": true, + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -19936,7 +19642,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", - "devOptional": true, + "dev": true, "dependencies": { "@types/node": "*", "jest-util": "^29.7.0", @@ -19951,7 +19657,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" } @@ -19960,7 +19666,7 @@ "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "devOptional": true, + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -19988,6 +19694,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, "dependencies": { "argparse": "^2.0.1" }, @@ -20004,9 +19711,9 @@ } }, "node_modules/jsdoc-type-pratt-parser": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz", - "integrity": "sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.1.0.tgz", + "integrity": "sha512-Hicd6JK5Njt2QB6XYFS7ok9e37O8AYk3jTcppG4YVQnYjOemymvTcmc7OWsmq/Qqj5TdRFO5/x/tIPmBeRtGHg==", "dev": true, "engines": { "node": ">=12.0.0" @@ -20098,7 +19805,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "devOptional": true + "dev": true }, "node_modules/json-schema-traverse": { "version": "0.4.1", @@ -20108,7 +19815,8 @@ "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==" + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true }, "node_modules/json-stringify-nice": { "version": "1.1.4", @@ -20279,6 +19987,15 @@ "node": ">=18" } }, + "node_modules/junit-report-merger/node_modules/commander": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.0.0.tgz", + "integrity": "sha512-MwVNWlYjDTtOjX5PiD7o5pK0UrFU/OYgcJfjjK4RaHZETNtjJqrZa9Y9ds88+A+f+d5lv+561eZ+yCKoS3gbAA==", + "dev": true, + "engines": { + "node": ">=18" + } + }, "node_modules/just-diff": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/just-diff/-/just-diff-5.2.0.tgz", @@ -20336,9 +20053,9 @@ "optional": true }, "node_modules/keyv": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz", - "integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==", + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dependencies": { "json-buffer": "3.0.1" } @@ -20356,7 +20073,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", - "devOptional": true, + "dev": true, "engines": { "node": ">=6" } @@ -20412,7 +20129,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", - "devOptional": true, + "dev": true, "engines": { "node": ">=6" } @@ -20421,6 +20138,7 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" @@ -20655,6 +20373,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, "dependencies": { "p-locate": "^5.0.0" }, @@ -20757,7 +20476,8 @@ "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true }, "node_modules/lodash.mergewith": { "version": "4.6.2", @@ -21616,7 +21336,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "devOptional": true, + "dev": true, "engines": { "node": ">=6" } @@ -21639,18 +21359,23 @@ } }, "node_modules/minimatch": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-6.2.0.tgz", - "integrity": "sha512-sauLxniAmvnhhRjFwPNnJKaPFYyddAgbYdeUpHULtCT/GhzdCx/MDNy+Y40lBxTQUrMzDE8e0S43Z5uqfO0REg==", - "peer": true, + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dependencies": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": "*" + } + }, + "node_modules/minimatch/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, "node_modules/minimist": { @@ -22198,28 +21923,6 @@ "node": ">=8" } }, - "node_modules/multimatch/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/multimatch/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/multistream": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/multistream/-/multistream-3.1.0.tgz", @@ -22259,12 +21962,6 @@ "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==" }, - "node_modules/natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "dev": true - }, "node_modules/ncp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", @@ -22390,10 +22087,11 @@ } }, "node_modules/node": { - "version": "18.18.2", - "resolved": "https://registry.npmjs.org/node/-/node-18.18.2.tgz", - "integrity": "sha512-PzYRrHnY79DWyjkV2HtE2xl2gTaMGU/Taupl751nnC4NBSzSR3mvsGUAm2MYhYDeVloQuFhyyAcO5SXlcYNQyw==", + "version": "20.18.0", + "resolved": "https://registry.npmjs.org/node/-/node-20.18.0.tgz", + "integrity": "sha512-h+KoNd+g/04xj9baLfNTFo5okLQn/s4z31oioKsXTPvoWmZdBbvKlA5PiWV4fZzVHQqdk8xBBQ8R3R0531fUIA==", "hasInstallScript": true, + "license": "ISC", "dependencies": { "node-bin-setup": "^1.0.0" }, @@ -22502,16 +22200,6 @@ "node-gyp-build-test": "build-test.js" } }, - "node_modules/node-gyp/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/node-gyp/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -22532,18 +22220,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/node-gyp/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/node-gyp/node_modules/nopt": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/nopt/-/nopt-6.0.0.tgz", @@ -22646,9 +22322,9 @@ } }, "node_modules/npm": { - "version": "9.9.3", - "resolved": "https://registry.npmjs.org/npm/-/npm-9.9.3.tgz", - "integrity": "sha512-Z1l+rcQ5kYb17F3hHtO601arEpvdRYnCLtg8xo3AGtyj3IthwaraEOexI9903uANkifFbqHC8hT53KIrozWg8A==", + "version": "10.9.0", + "resolved": "https://registry.npmjs.org/npm/-/npm-10.9.0.tgz", + "integrity": "sha512-ZanDioFylI9helNhl2LNd+ErmVD+H5I53ry41ixlLyCBgkuYb+58CvbAp99hW+zr5L9W4X7CchSoeqKdngOLSw==", "bundleDependencies": [ "@isaacs/string-locale-compare", "@npmcli/arborist", @@ -22657,15 +22333,15 @@ "@npmcli/map-workspaces", "@npmcli/package-json", "@npmcli/promise-spawn", + "@npmcli/redact", "@npmcli/run-script", + "@sigstore/tuf", "abbrev", "archy", "cacache", "chalk", "ci-info", "cli-columns", - "cli-table3", - "columnify", "fastest-levenshtein", "fs-minipass", "glob", @@ -22701,7 +22377,6 @@ "npm-profile", "npm-registry-fetch", "npm-user-validate", - "npmlog", "p-map", "pacote", "parse-conflict-json", @@ -22709,7 +22384,6 @@ "qrcode-terminal", "read", "semver", - "sigstore", "spdx-expression-parse", "ssri", "supports-color", @@ -22731,82 +22405,80 @@ ], "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", - "@npmcli/arborist": "^6.5.0", - "@npmcli/config": "^6.4.0", - "@npmcli/fs": "^3.1.0", - "@npmcli/map-workspaces": "^3.0.4", - "@npmcli/package-json": "^4.0.1", - "@npmcli/promise-spawn": "^6.0.2", - "@npmcli/run-script": "^6.0.2", - "abbrev": "^2.0.0", + "@npmcli/arborist": "^8.0.0", + "@npmcli/config": "^9.0.0", + "@npmcli/fs": "^4.0.0", + "@npmcli/map-workspaces": "^4.0.1", + "@npmcli/package-json": "^6.0.1", + "@npmcli/promise-spawn": "^8.0.1", + "@npmcli/redact": "^3.0.0", + "@npmcli/run-script": "^9.0.1", + "@sigstore/tuf": "^2.3.4", + "abbrev": "^3.0.0", "archy": "~1.0.0", - "cacache": "^17.1.4", + "cacache": "^19.0.1", "chalk": "^5.3.0", "ci-info": "^4.0.0", "cli-columns": "^4.0.0", - "cli-table3": "^0.6.3", - "columnify": "^1.6.0", "fastest-levenshtein": "^1.0.16", "fs-minipass": "^3.0.3", - "glob": "^10.3.10", + "glob": "^10.4.5", "graceful-fs": "^4.2.11", - "hosted-git-info": "^6.1.1", - "ini": "^4.1.1", - "init-package-json": "^5.0.0", - "is-cidr": "^4.0.2", - "json-parse-even-better-errors": "^3.0.1", - "libnpmaccess": "^7.0.2", - "libnpmdiff": "^5.0.20", - "libnpmexec": "^6.0.4", - "libnpmfund": "^4.2.1", - "libnpmhook": "^9.0.3", - "libnpmorg": "^5.0.4", - "libnpmpack": "^5.0.20", - "libnpmpublish": "^7.5.1", - "libnpmsearch": "^6.0.2", - "libnpmteam": "^5.0.3", - "libnpmversion": "^4.0.2", - "make-fetch-happen": "^11.1.1", - "minimatch": "^9.0.3", - "minipass": "^7.0.4", + "hosted-git-info": "^8.0.0", + "ini": "^5.0.0", + "init-package-json": "^7.0.1", + "is-cidr": "^5.1.0", + "json-parse-even-better-errors": "^4.0.0", + "libnpmaccess": "^9.0.0", + "libnpmdiff": "^7.0.0", + "libnpmexec": "^9.0.0", + "libnpmfund": "^6.0.0", + "libnpmhook": "^11.0.0", + "libnpmorg": "^7.0.0", + "libnpmpack": "^8.0.0", + "libnpmpublish": "^10.0.0", + "libnpmsearch": "^8.0.0", + "libnpmteam": "^7.0.0", + "libnpmversion": "^7.0.0", + "make-fetch-happen": "^14.0.1", + "minimatch": "^9.0.5", + "minipass": "^7.1.1", "minipass-pipeline": "^1.2.4", "ms": "^2.1.2", - "node-gyp": "^9.4.1", - "nopt": "^7.2.0", - "normalize-package-data": "^5.0.0", - "npm-audit-report": "^5.0.0", - "npm-install-checks": "^6.3.0", - "npm-package-arg": "^10.1.0", - "npm-pick-manifest": "^8.0.2", - "npm-profile": "^7.0.1", - "npm-registry-fetch": "^14.0.5", - "npm-user-validate": "^2.0.0", - "npmlog": "^7.0.1", + "node-gyp": "^10.2.0", + "nopt": "^8.0.0", + "normalize-package-data": "^7.0.0", + "npm-audit-report": "^6.0.0", + "npm-install-checks": "^7.1.0", + "npm-package-arg": "^12.0.0", + "npm-pick-manifest": "^10.0.0", + "npm-profile": "^11.0.1", + "npm-registry-fetch": "^18.0.1", + "npm-user-validate": "^3.0.0", "p-map": "^4.0.0", - "pacote": "^15.2.0", - "parse-conflict-json": "^3.0.1", - "proc-log": "^3.0.0", + "pacote": "^19.0.0", + "parse-conflict-json": "^4.0.0", + "proc-log": "^5.0.0", "qrcode-terminal": "^0.12.0", - "read": "^2.1.0", - "semver": "^7.6.0", - "sigstore": "^1.9.0", - "spdx-expression-parse": "^3.0.1", - "ssri": "^10.0.5", + "read": "^4.0.0", + "semver": "^7.6.3", + "spdx-expression-parse": "^4.0.0", + "ssri": "^12.0.0", "supports-color": "^9.4.0", - "tar": "^6.2.0", + "tar": "^6.2.1", "text-table": "~0.2.0", "tiny-relative-date": "^1.3.0", "treeverse": "^3.0.0", - "validate-npm-package-name": "^5.0.0", - "which": "^3.0.1", - "write-file-atomic": "^5.0.1" + "validate-npm-package-name": "^6.0.0", + "which": "^5.0.0", + "write-file-atomic": "^6.0.0" }, "bin": { "npm": "bin/npm-cli.js", "npx": "bin/npx-cli.js" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm-bundled": { @@ -23151,7 +22823,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "devOptional": true, + "dev": true, "dependencies": { "path-key": "^3.0.0" }, @@ -23159,20 +22831,6 @@ "node": ">=8" } }, - "node_modules/npm/node_modules/@colors/colors": { - "version": "1.5.0", - "inBundle": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.1.90" - } - }, - "node_modules/npm/node_modules/@gar/promisify": { - "version": "1.1.3", - "inBundle": true, - "license": "MIT" - }, "node_modules/npm/node_modules/@isaacs/cliui": { "version": "8.0.2", "inBundle": true, @@ -23235,47 +22893,75 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, + "node_modules/npm/node_modules/@isaacs/fs-minipass": { + "version": "4.0.1", + "inBundle": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.4" + }, + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/npm/node_modules/@isaacs/string-locale-compare": { "version": "1.1.0", "inBundle": true, "license": "ISC" }, + "node_modules/npm/node_modules/@npmcli/agent": { + "version": "3.0.0", + "inBundle": true, + "license": "ISC", + "dependencies": { + "agent-base": "^7.1.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.1", + "lru-cache": "^10.0.1", + "socks-proxy-agent": "^8.0.3" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, "node_modules/npm/node_modules/@npmcli/arborist": { - "version": "6.5.1", + "version": "8.0.0", "inBundle": true, "license": "ISC", "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", - "@npmcli/fs": "^3.1.0", - "@npmcli/installed-package-contents": "^2.0.2", - "@npmcli/map-workspaces": "^3.0.2", - "@npmcli/metavuln-calculator": "^5.0.0", - "@npmcli/name-from-folder": "^2.0.0", - "@npmcli/node-gyp": "^3.0.0", - "@npmcli/package-json": "^4.0.0", - "@npmcli/query": "^3.1.0", - "@npmcli/run-script": "^6.0.0", - "bin-links": "^4.0.1", - "cacache": "^17.0.4", + "@npmcli/fs": "^4.0.0", + "@npmcli/installed-package-contents": "^3.0.0", + "@npmcli/map-workspaces": "^4.0.1", + "@npmcli/metavuln-calculator": "^8.0.0", + "@npmcli/name-from-folder": "^3.0.0", + "@npmcli/node-gyp": "^4.0.0", + "@npmcli/package-json": "^6.0.1", + "@npmcli/query": "^4.0.0", + "@npmcli/redact": "^3.0.0", + "@npmcli/run-script": "^9.0.1", + "bin-links": "^5.0.0", + "cacache": "^19.0.1", "common-ancestor-path": "^1.0.1", - "hosted-git-info": "^6.1.1", - "json-parse-even-better-errors": "^3.0.0", + "hosted-git-info": "^8.0.0", + "json-parse-even-better-errors": "^4.0.0", "json-stringify-nice": "^1.1.4", - "minimatch": "^9.0.0", - "nopt": "^7.0.0", - "npm-install-checks": "^6.2.0", - "npm-package-arg": "^10.1.0", - "npm-pick-manifest": "^8.0.1", - "npm-registry-fetch": "^14.0.3", - "npmlog": "^7.0.1", - "pacote": "^15.0.8", - "parse-conflict-json": "^3.0.0", - "proc-log": "^3.0.0", + "lru-cache": "^10.2.2", + "minimatch": "^9.0.4", + "nopt": "^8.0.0", + "npm-install-checks": "^7.1.0", + "npm-package-arg": "^12.0.0", + "npm-pick-manifest": "^10.0.0", + "npm-registry-fetch": "^18.0.1", + "pacote": "^19.0.0", + "parse-conflict-json": "^4.0.0", + "proc-log": "^5.0.0", + "proggy": "^3.0.0", "promise-all-reject-late": "^1.0.0", - "promise-call-limit": "^1.0.2", - "read-package-json-fast": "^3.0.2", + "promise-call-limit": "^3.0.1", + "read-package-json-fast": "^4.0.0", "semver": "^7.3.7", - "ssri": "^10.0.1", + "ssri": "^12.0.0", "treeverse": "^3.0.0", "walk-up-path": "^3.0.1" }, @@ -23283,190 +22969,178 @@ "arborist": "bin/index.js" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/@npmcli/config": { - "version": "6.4.1", + "version": "9.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "@npmcli/map-workspaces": "^3.0.2", + "@npmcli/map-workspaces": "^4.0.1", + "@npmcli/package-json": "^6.0.1", "ci-info": "^4.0.0", - "ini": "^4.1.0", - "nopt": "^7.0.0", - "proc-log": "^3.0.0", - "read-package-json-fast": "^3.0.2", + "ini": "^5.0.0", + "nopt": "^8.0.0", + "proc-log": "^5.0.0", "semver": "^7.3.5", "walk-up-path": "^3.0.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/@npmcli/disparity-colors": { - "version": "3.0.0", - "inBundle": true, - "license": "ISC", - "dependencies": { - "ansi-styles": "^4.3.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/@npmcli/fs": { - "version": "3.1.0", + "version": "4.0.0", "inBundle": true, "license": "ISC", "dependencies": { "semver": "^7.3.5" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/@npmcli/git": { - "version": "4.1.0", + "version": "6.0.1", "inBundle": true, "license": "ISC", "dependencies": { - "@npmcli/promise-spawn": "^6.0.0", - "lru-cache": "^7.4.4", - "npm-pick-manifest": "^8.0.0", - "proc-log": "^3.0.0", + "@npmcli/promise-spawn": "^8.0.0", + "ini": "^5.0.0", + "lru-cache": "^10.0.1", + "npm-pick-manifest": "^10.0.0", + "proc-log": "^5.0.0", "promise-inflight": "^1.0.1", "promise-retry": "^2.0.1", "semver": "^7.3.5", - "which": "^3.0.0" + "which": "^5.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/@npmcli/installed-package-contents": { - "version": "2.0.2", + "version": "3.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "npm-bundled": "^3.0.0", - "npm-normalize-package-bin": "^3.0.0" + "npm-bundled": "^4.0.0", + "npm-normalize-package-bin": "^4.0.0" }, "bin": { - "installed-package-contents": "lib/index.js" + "installed-package-contents": "bin/index.js" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/@npmcli/map-workspaces": { - "version": "3.0.4", + "version": "4.0.1", "inBundle": true, "license": "ISC", "dependencies": { - "@npmcli/name-from-folder": "^2.0.0", + "@npmcli/name-from-folder": "^3.0.0", + "@npmcli/package-json": "^6.0.0", "glob": "^10.2.2", - "minimatch": "^9.0.0", - "read-package-json-fast": "^3.0.0" + "minimatch": "^9.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/@npmcli/metavuln-calculator": { - "version": "5.0.1", + "version": "8.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "cacache": "^17.0.0", - "json-parse-even-better-errors": "^3.0.0", - "pacote": "^15.0.0", + "cacache": "^19.0.0", + "json-parse-even-better-errors": "^4.0.0", + "pacote": "^19.0.0", + "proc-log": "^5.0.0", "semver": "^7.3.5" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/@npmcli/move-file": { - "version": "2.0.1", - "inBundle": true, - "license": "MIT", - "dependencies": { - "mkdirp": "^1.0.4", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/@npmcli/name-from-folder": { - "version": "2.0.0", + "version": "3.0.0", "inBundle": true, "license": "ISC", "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/@npmcli/node-gyp": { - "version": "3.0.0", + "version": "4.0.0", "inBundle": true, "license": "ISC", "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/@npmcli/package-json": { - "version": "4.0.1", + "version": "6.0.1", "inBundle": true, "license": "ISC", "dependencies": { - "@npmcli/git": "^4.1.0", + "@npmcli/git": "^6.0.0", "glob": "^10.2.2", - "hosted-git-info": "^6.1.1", - "json-parse-even-better-errors": "^3.0.0", - "normalize-package-data": "^5.0.0", - "proc-log": "^3.0.0", + "hosted-git-info": "^8.0.0", + "json-parse-even-better-errors": "^4.0.0", + "normalize-package-data": "^7.0.0", + "proc-log": "^5.0.0", "semver": "^7.5.3" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/@npmcli/promise-spawn": { - "version": "6.0.2", + "version": "8.0.1", "inBundle": true, "license": "ISC", "dependencies": { - "which": "^3.0.0" + "which": "^5.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/@npmcli/query": { - "version": "3.1.0", + "version": "4.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "postcss-selector-parser": "^6.0.10" + "postcss-selector-parser": "^6.1.2" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/npm/node_modules/@npmcli/redact": { + "version": "3.0.0", + "inBundle": true, + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/@npmcli/run-script": { - "version": "6.0.2", + "version": "9.0.1", "inBundle": true, "license": "ISC", "dependencies": { - "@npmcli/node-gyp": "^3.0.0", - "@npmcli/promise-spawn": "^6.0.0", - "node-gyp": "^9.0.0", - "read-package-json-fast": "^3.0.0", - "which": "^3.0.0" + "@npmcli/node-gyp": "^4.0.0", + "@npmcli/package-json": "^6.0.0", + "@npmcli/promise-spawn": "^8.0.0", + "node-gyp": "^10.0.0", + "proc-log": "^5.0.0", + "which": "^5.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/@pkgjs/parseargs": { @@ -23479,105 +23153,237 @@ } }, "node_modules/npm/node_modules/@sigstore/bundle": { - "version": "1.1.0", + "version": "2.3.2", "inBundle": true, "license": "Apache-2.0", "dependencies": { - "@sigstore/protobuf-specs": "^0.2.0" + "@sigstore/protobuf-specs": "^0.3.2" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@sigstore/core": { + "version": "1.1.0", + "inBundle": true, + "license": "Apache-2.0", + "engines": { + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/@sigstore/protobuf-specs": { - "version": "0.2.1", + "version": "0.3.2", "inBundle": true, "license": "Apache-2.0", "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/@sigstore/sign": { - "version": "1.0.0", + "version": "2.3.2", "inBundle": true, "license": "Apache-2.0", "dependencies": { - "@sigstore/bundle": "^1.1.0", - "@sigstore/protobuf-specs": "^0.2.0", - "make-fetch-happen": "^11.0.1" + "@sigstore/bundle": "^2.3.2", + "@sigstore/core": "^1.0.0", + "@sigstore/protobuf-specs": "^0.3.2", + "make-fetch-happen": "^13.0.1", + "proc-log": "^4.2.0", + "promise-retry": "^2.0.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/@sigstore/tuf": { - "version": "1.0.3", + "node_modules/npm/node_modules/@sigstore/sign/node_modules/@npmcli/agent": { + "version": "2.2.2", "inBundle": true, - "license": "Apache-2.0", + "license": "ISC", "dependencies": { - "@sigstore/protobuf-specs": "^0.2.0", - "tuf-js": "^1.1.7" + "agent-base": "^7.1.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.1", + "lru-cache": "^10.0.1", + "socks-proxy-agent": "^8.0.3" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@sigstore/sign/node_modules/@npmcli/fs": { + "version": "3.1.1", + "inBundle": true, + "license": "ISC", + "dependencies": { + "semver": "^7.3.5" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/@tootallnate/once": { - "version": "2.0.0", + "node_modules/npm/node_modules/@sigstore/sign/node_modules/cacache": { + "version": "18.0.4", "inBundle": true, - "license": "MIT", + "license": "ISC", + "dependencies": { + "@npmcli/fs": "^3.1.0", + "fs-minipass": "^3.0.0", + "glob": "^10.2.2", + "lru-cache": "^10.0.1", + "minipass": "^7.0.3", + "minipass-collect": "^2.0.1", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^4.0.0", + "ssri": "^10.0.0", + "tar": "^6.1.11", + "unique-filename": "^3.0.0" + }, "engines": { - "node": ">= 10" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/@tufjs/canonical-json": { - "version": "1.0.0", + "node_modules/npm/node_modules/@sigstore/sign/node_modules/make-fetch-happen": { + "version": "13.0.1", + "inBundle": true, + "license": "ISC", + "dependencies": { + "@npmcli/agent": "^2.0.0", + "cacache": "^18.0.0", + "http-cache-semantics": "^4.1.1", + "is-lambda": "^1.0.1", + "minipass": "^7.0.2", + "minipass-fetch": "^3.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.3", + "proc-log": "^4.2.0", + "promise-retry": "^2.0.1", + "ssri": "^10.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@sigstore/sign/node_modules/minipass-fetch": { + "version": "3.0.5", "inBundle": true, "license": "MIT", + "dependencies": { + "minipass": "^7.0.3", + "minipass-sized": "^1.0.3", + "minizlib": "^2.1.2" + }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + }, + "optionalDependencies": { + "encoding": "^0.1.13" } }, - "node_modules/npm/node_modules/@tufjs/models": { - "version": "1.0.4", + "node_modules/npm/node_modules/@sigstore/sign/node_modules/proc-log": { + "version": "4.2.0", "inBundle": true, - "license": "MIT", + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@sigstore/sign/node_modules/ssri": { + "version": "10.0.6", + "inBundle": true, + "license": "ISC", "dependencies": { - "@tufjs/canonical-json": "1.0.0", - "minimatch": "^9.0.0" + "minipass": "^7.0.3" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/abbrev": { - "version": "2.0.0", + "node_modules/npm/node_modules/@sigstore/sign/node_modules/unique-filename": { + "version": "3.0.0", "inBundle": true, "license": "ISC", + "dependencies": { + "unique-slug": "^4.0.0" + }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/agent-base": { - "version": "6.0.2", + "node_modules/npm/node_modules/@sigstore/sign/node_modules/unique-slug": { + "version": "4.0.0", + "inBundle": true, + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@sigstore/tuf": { + "version": "2.3.4", + "inBundle": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/protobuf-specs": "^0.3.2", + "tuf-js": "^2.2.1" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@sigstore/verify": { + "version": "1.2.1", + "inBundle": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/bundle": "^2.3.2", + "@sigstore/core": "^1.1.0", + "@sigstore/protobuf-specs": "^0.3.2" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@tufjs/canonical-json": { + "version": "2.0.0", + "inBundle": true, + "license": "MIT", + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/@tufjs/models": { + "version": "2.0.1", "inBundle": true, "license": "MIT", "dependencies": { - "debug": "4" + "@tufjs/canonical-json": "2.0.0", + "minimatch": "^9.0.4" }, "engines": { - "node": ">= 6.0.0" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/agentkeepalive": { - "version": "4.5.0", + "node_modules/npm/node_modules/abbrev": { + "version": "3.0.0", + "inBundle": true, + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/npm/node_modules/agent-base": { + "version": "7.1.1", "inBundle": true, "license": "MIT", "dependencies": { - "humanize-ms": "^1.2.1" + "debug": "^4.3.4" }, "engines": { - "node": ">= 8.0.0" + "node": ">= 14" } }, "node_modules/npm/node_modules/aggregate-error": { @@ -23601,14 +23407,11 @@ } }, "node_modules/npm/node_modules/ansi-styles": { - "version": "4.3.0", + "version": "6.2.1", "inBundle": true, "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, "engines": { - "node": ">=8" + "node": ">=12" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" @@ -23624,39 +23427,35 @@ "inBundle": true, "license": "MIT" }, - "node_modules/npm/node_modules/are-we-there-yet": { - "version": "4.0.2", - "inBundle": true, - "license": "ISC", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/npm/node_modules/balanced-match": { "version": "1.0.2", "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/bin-links": { - "version": "4.0.3", + "version": "5.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "cmd-shim": "^6.0.0", - "npm-normalize-package-bin": "^3.0.0", - "read-cmd-shim": "^4.0.0", - "write-file-atomic": "^5.0.0" + "cmd-shim": "^7.0.0", + "npm-normalize-package-bin": "^4.0.0", + "proc-log": "^5.0.0", + "read-cmd-shim": "^5.0.0", + "write-file-atomic": "^6.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/binary-extensions": { - "version": "2.2.0", + "version": "2.3.0", "inBundle": true, "license": "MIT", "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/npm/node_modules/brace-expansion": { @@ -23667,34 +23466,95 @@ "balanced-match": "^1.0.0" } }, - "node_modules/npm/node_modules/builtins": { - "version": "5.0.1", - "inBundle": true, - "license": "MIT", - "dependencies": { - "semver": "^7.0.0" - } - }, "node_modules/npm/node_modules/cacache": { - "version": "17.1.4", + "version": "19.0.1", "inBundle": true, "license": "ISC", "dependencies": { - "@npmcli/fs": "^3.1.0", + "@npmcli/fs": "^4.0.0", "fs-minipass": "^3.0.0", "glob": "^10.2.2", - "lru-cache": "^7.7.1", + "lru-cache": "^10.0.1", "minipass": "^7.0.3", - "minipass-collect": "^1.0.2", + "minipass-collect": "^2.0.1", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", - "p-map": "^4.0.0", - "ssri": "^10.0.0", - "tar": "^6.1.11", - "unique-filename": "^3.0.0" + "p-map": "^7.0.2", + "ssri": "^12.0.0", + "tar": "^7.4.3", + "unique-filename": "^4.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/npm/node_modules/cacache/node_modules/chownr": { + "version": "3.0.0", + "inBundle": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/npm/node_modules/cacache/node_modules/minizlib": { + "version": "3.0.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "minipass": "^7.0.4", + "rimraf": "^5.0.5" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/npm/node_modules/cacache/node_modules/mkdirp": { + "version": "3.0.1", + "inBundle": true, + "license": "MIT", + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/npm/node_modules/cacache/node_modules/p-map": { + "version": "7.0.2", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm/node_modules/cacache/node_modules/tar": { + "version": "7.4.3", + "inBundle": true, + "license": "ISC", + "dependencies": { + "@isaacs/fs-minipass": "^4.0.0", + "chownr": "^3.0.0", + "minipass": "^7.1.2", + "minizlib": "^3.0.1", + "mkdirp": "^3.0.1", + "yallist": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/npm/node_modules/cacache/node_modules/yallist": { + "version": "5.0.0", + "inBundle": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" } }, "node_modules/npm/node_modules/chalk": { @@ -23731,14 +23591,14 @@ } }, "node_modules/npm/node_modules/cidr-regex": { - "version": "3.1.1", + "version": "4.1.1", "inBundle": true, "license": "BSD-2-Clause", "dependencies": { - "ip-regex": "^4.1.0" + "ip-regex": "^5.0.0" }, "engines": { - "node": ">=10" + "node": ">=14" } }, "node_modules/npm/node_modules/clean-stack": { @@ -23761,34 +23621,12 @@ "node": ">= 10" } }, - "node_modules/npm/node_modules/cli-table3": { - "version": "0.6.3", - "inBundle": true, - "license": "MIT", - "dependencies": { - "string-width": "^4.2.0" - }, - "engines": { - "node": "10.* || >= 12.*" - }, - "optionalDependencies": { - "@colors/colors": "1.5.0" - } - }, - "node_modules/npm/node_modules/clone": { - "version": "1.0.4", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=0.8" - } - }, "node_modules/npm/node_modules/cmd-shim": { - "version": "6.0.2", + "version": "7.0.0", "inBundle": true, "license": "ISC", "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/color-convert": { @@ -23807,41 +23645,11 @@ "inBundle": true, "license": "MIT" }, - "node_modules/npm/node_modules/color-support": { - "version": "1.1.3", - "inBundle": true, - "license": "ISC", - "bin": { - "color-support": "bin.js" - } - }, - "node_modules/npm/node_modules/columnify": { - "version": "1.6.0", - "inBundle": true, - "license": "MIT", - "dependencies": { - "strip-ansi": "^6.0.1", - "wcwidth": "^1.0.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/npm/node_modules/common-ancestor-path": { "version": "1.0.1", "inBundle": true, "license": "ISC" }, - "node_modules/npm/node_modules/concat-map": { - "version": "0.0.1", - "inBundle": true, - "license": "MIT" - }, - "node_modules/npm/node_modules/console-control-strings": { - "version": "1.1.0", - "inBundle": true, - "license": "ISC" - }, "node_modules/npm/node_modules/cross-spawn": { "version": "7.0.3", "inBundle": true, @@ -23881,7 +23689,7 @@ } }, "node_modules/npm/node_modules/debug": { - "version": "4.3.4", + "version": "4.3.6", "inBundle": true, "license": "MIT", "dependencies": { @@ -23901,22 +23709,6 @@ "inBundle": true, "license": "MIT" }, - "node_modules/npm/node_modules/defaults": { - "version": "1.0.4", - "inBundle": true, - "license": "MIT", - "dependencies": { - "clone": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/npm/node_modules/delegates": { - "version": "1.0.0", - "inBundle": true, - "license": "MIT" - }, "node_modules/npm/node_modules/diff": { "version": "5.2.0", "inBundle": true, @@ -23971,7 +23763,7 @@ } }, "node_modules/npm/node_modules/foreground-child": { - "version": "3.1.1", + "version": "3.3.0", "inBundle": true, "license": "ISC", "dependencies": { @@ -23996,54 +23788,21 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/fs.realpath": { - "version": "1.0.0", - "inBundle": true, - "license": "ISC" - }, - "node_modules/npm/node_modules/function-bind": { - "version": "1.1.2", - "inBundle": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/npm/node_modules/gauge": { - "version": "5.0.1", - "inBundle": true, - "license": "ISC", - "dependencies": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.3", - "console-control-strings": "^1.1.0", - "has-unicode": "^2.0.1", - "signal-exit": "^4.0.1", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.5" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/npm/node_modules/glob": { - "version": "10.3.10", + "version": "10.4.5", "inBundle": true, "license": "ISC", "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^2.3.5", - "minimatch": "^9.0.1", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", - "path-scurry": "^1.10.1" + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, "funding": { "url": "https://github.com/sponsors/isaacs" } @@ -24053,31 +23812,15 @@ "inBundle": true, "license": "ISC" }, - "node_modules/npm/node_modules/has-unicode": { - "version": "2.0.1", - "inBundle": true, - "license": "ISC" - }, - "node_modules/npm/node_modules/hasown": { - "version": "2.0.1", - "inBundle": true, - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/npm/node_modules/hosted-git-info": { - "version": "6.1.1", + "version": "8.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "lru-cache": "^7.5.1" + "lru-cache": "^10.0.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/http-cache-semantics": { @@ -24086,36 +23829,27 @@ "license": "BSD-2-Clause" }, "node_modules/npm/node_modules/http-proxy-agent": { - "version": "5.0.0", + "version": "7.0.2", "inBundle": true, "license": "MIT", "dependencies": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" + "agent-base": "^7.1.0", + "debug": "^4.3.4" }, "engines": { - "node": ">= 6" + "node": ">= 14" } }, "node_modules/npm/node_modules/https-proxy-agent": { - "version": "5.0.1", + "version": "7.0.5", "inBundle": true, "license": "MIT", "dependencies": { - "agent-base": "6", + "agent-base": "^7.0.2", "debug": "4" }, "engines": { - "node": ">= 6" - } - }, - "node_modules/npm/node_modules/humanize-ms": { - "version": "1.2.1", - "inBundle": true, - "license": "MIT", - "dependencies": { - "ms": "^2.0.0" + "node": ">= 14" } }, "node_modules/npm/node_modules/iconv-lite": { @@ -24131,14 +23865,14 @@ } }, "node_modules/npm/node_modules/ignore-walk": { - "version": "6.0.4", + "version": "7.0.0", "inBundle": true, "license": "ISC", "dependencies": { "minimatch": "^9.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/imurmurhash": { @@ -24157,48 +23891,29 @@ "node": ">=8" } }, - "node_modules/npm/node_modules/infer-owner": { - "version": "1.0.4", - "inBundle": true, - "license": "ISC" - }, - "node_modules/npm/node_modules/inflight": { - "version": "1.0.6", - "inBundle": true, - "license": "ISC", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/npm/node_modules/inherits": { - "version": "2.0.4", - "inBundle": true, - "license": "ISC" - }, "node_modules/npm/node_modules/ini": { - "version": "4.1.1", + "version": "5.0.0", "inBundle": true, "license": "ISC", "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/init-package-json": { - "version": "5.0.0", + "version": "7.0.1", "inBundle": true, "license": "ISC", "dependencies": { - "npm-package-arg": "^10.0.0", - "promzard": "^1.0.0", - "read": "^2.0.0", - "read-package-json": "^6.0.0", + "@npmcli/package-json": "^6.0.0", + "npm-package-arg": "^12.0.0", + "promzard": "^2.0.0", + "read": "^4.0.0", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4", - "validate-npm-package-name": "^5.0.0" + "validate-npm-package-name": "^6.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/ip-address": { @@ -24213,39 +23928,26 @@ "node": ">= 12" } }, - "node_modules/npm/node_modules/ip-address/node_modules/sprintf-js": { - "version": "1.1.3", - "inBundle": true, - "license": "BSD-3-Clause" - }, "node_modules/npm/node_modules/ip-regex": { - "version": "4.3.0", + "version": "5.0.0", "inBundle": true, "license": "MIT", "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/npm/node_modules/is-cidr": { - "version": "4.0.2", + "version": "5.1.0", "inBundle": true, "license": "BSD-2-Clause", "dependencies": { - "cidr-regex": "^3.1.1" + "cidr-regex": "^4.1.1" }, "engines": { - "node": ">=10" - } - }, - "node_modules/npm/node_modules/is-core-module": { - "version": "2.13.1", - "inBundle": true, - "license": "MIT", - "dependencies": { - "hasown": "^2.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=14" } }, "node_modules/npm/node_modules/is-fullwidth-code-point": { @@ -24267,15 +23969,12 @@ "license": "ISC" }, "node_modules/npm/node_modules/jackspeak": { - "version": "2.3.6", + "version": "3.4.3", "inBundle": true, "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" }, - "engines": { - "node": ">=14" - }, "funding": { "url": "https://github.com/sponsors/isaacs" }, @@ -24289,11 +23988,11 @@ "license": "MIT" }, "node_modules/npm/node_modules/json-parse-even-better-errors": { - "version": "3.0.1", + "version": "4.0.0", "inBundle": true, "license": "MIT", "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/json-stringify-nice": { @@ -24323,205 +24022,188 @@ "license": "MIT" }, "node_modules/npm/node_modules/libnpmaccess": { - "version": "7.0.3", + "version": "9.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "npm-package-arg": "^10.1.0", - "npm-registry-fetch": "^14.0.3" + "npm-package-arg": "^12.0.0", + "npm-registry-fetch": "^18.0.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/libnpmdiff": { - "version": "5.0.21", + "version": "7.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "@npmcli/arborist": "^6.5.0", - "@npmcli/disparity-colors": "^3.0.0", - "@npmcli/installed-package-contents": "^2.0.2", - "binary-extensions": "^2.2.0", + "@npmcli/arborist": "^8.0.0", + "@npmcli/installed-package-contents": "^3.0.0", + "binary-extensions": "^2.3.0", "diff": "^5.1.0", - "minimatch": "^9.0.0", - "npm-package-arg": "^10.1.0", - "pacote": "^15.0.8", - "tar": "^6.1.13" + "minimatch": "^9.0.4", + "npm-package-arg": "^12.0.0", + "pacote": "^19.0.0", + "tar": "^6.2.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/libnpmexec": { - "version": "6.0.5", + "version": "9.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "@npmcli/arborist": "^6.5.0", - "@npmcli/run-script": "^6.0.0", + "@npmcli/arborist": "^8.0.0", + "@npmcli/run-script": "^9.0.1", "ci-info": "^4.0.0", - "npm-package-arg": "^10.1.0", - "npmlog": "^7.0.1", - "pacote": "^15.0.8", - "proc-log": "^3.0.0", - "read": "^2.0.0", - "read-package-json-fast": "^3.0.2", + "npm-package-arg": "^12.0.0", + "pacote": "^19.0.0", + "proc-log": "^5.0.0", + "read": "^4.0.0", + "read-package-json-fast": "^4.0.0", "semver": "^7.3.7", "walk-up-path": "^3.0.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/libnpmfund": { - "version": "4.2.2", + "version": "6.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "@npmcli/arborist": "^6.5.0" + "@npmcli/arborist": "^8.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/libnpmhook": { - "version": "9.0.4", + "version": "11.0.0", "inBundle": true, "license": "ISC", "dependencies": { "aproba": "^2.0.0", - "npm-registry-fetch": "^14.0.3" + "npm-registry-fetch": "^18.0.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/libnpmorg": { - "version": "5.0.5", + "version": "7.0.0", "inBundle": true, "license": "ISC", "dependencies": { "aproba": "^2.0.0", - "npm-registry-fetch": "^14.0.3" + "npm-registry-fetch": "^18.0.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/libnpmpack": { - "version": "5.0.21", + "version": "8.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "@npmcli/arborist": "^6.5.0", - "@npmcli/run-script": "^6.0.0", - "npm-package-arg": "^10.1.0", - "pacote": "^15.0.8" + "@npmcli/arborist": "^8.0.0", + "@npmcli/run-script": "^9.0.1", + "npm-package-arg": "^12.0.0", + "pacote": "^19.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/libnpmpublish": { - "version": "7.5.2", + "version": "10.0.0", "inBundle": true, "license": "ISC", "dependencies": { "ci-info": "^4.0.0", - "normalize-package-data": "^5.0.0", - "npm-package-arg": "^10.1.0", - "npm-registry-fetch": "^14.0.3", - "proc-log": "^3.0.0", + "normalize-package-data": "^7.0.0", + "npm-package-arg": "^12.0.0", + "npm-registry-fetch": "^18.0.1", + "proc-log": "^5.0.0", "semver": "^7.3.7", - "sigstore": "^1.4.0", - "ssri": "^10.0.1" + "sigstore": "^2.2.0", + "ssri": "^12.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/libnpmsearch": { - "version": "6.0.3", + "version": "8.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "npm-registry-fetch": "^14.0.3" + "npm-registry-fetch": "^18.0.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/libnpmteam": { - "version": "5.0.4", + "version": "7.0.0", "inBundle": true, "license": "ISC", "dependencies": { "aproba": "^2.0.0", - "npm-registry-fetch": "^14.0.3" + "npm-registry-fetch": "^18.0.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/libnpmversion": { - "version": "4.0.3", + "version": "7.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "@npmcli/git": "^4.0.1", - "@npmcli/run-script": "^6.0.0", - "json-parse-even-better-errors": "^3.0.0", - "proc-log": "^3.0.0", + "@npmcli/git": "^6.0.1", + "@npmcli/run-script": "^9.0.1", + "json-parse-even-better-errors": "^4.0.0", + "proc-log": "^5.0.0", "semver": "^7.3.7" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/lru-cache": { - "version": "7.18.3", + "version": "10.4.3", "inBundle": true, - "license": "ISC", - "engines": { - "node": ">=12" - } + "license": "ISC" }, "node_modules/npm/node_modules/make-fetch-happen": { - "version": "11.1.1", + "version": "14.0.1", "inBundle": true, "license": "ISC", "dependencies": { - "agentkeepalive": "^4.2.1", - "cacache": "^17.0.0", + "@npmcli/agent": "^3.0.0", + "cacache": "^19.0.1", "http-cache-semantics": "^4.1.1", - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.0", - "is-lambda": "^1.0.1", - "lru-cache": "^7.7.1", - "minipass": "^5.0.0", - "minipass-fetch": "^3.0.0", + "minipass": "^7.0.2", + "minipass-fetch": "^4.0.0", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", "negotiator": "^0.6.3", + "proc-log": "^5.0.0", "promise-retry": "^2.0.1", - "socks-proxy-agent": "^7.0.0", - "ssri": "^10.0.0" + "ssri": "^12.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/make-fetch-happen/node_modules/minipass": { - "version": "5.0.0", - "inBundle": true, - "license": "ISC", - "engines": { - "node": ">=8" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/minimatch": { - "version": "9.0.3", + "version": "9.0.5", "inBundle": true, "license": "ISC", "dependencies": { @@ -24535,7 +24217,7 @@ } }, "node_modules/npm/node_modules/minipass": { - "version": "7.0.4", + "version": "7.1.2", "inBundle": true, "license": "ISC", "engines": { @@ -24543,43 +24225,44 @@ } }, "node_modules/npm/node_modules/minipass-collect": { - "version": "1.0.2", - "inBundle": true, - "license": "ISC", - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/npm/node_modules/minipass-collect/node_modules/minipass": { - "version": "3.3.6", + "version": "2.0.1", "inBundle": true, "license": "ISC", "dependencies": { - "yallist": "^4.0.0" + "minipass": "^7.0.3" }, "engines": { - "node": ">=8" + "node": ">=16 || 14 >=14.17" } }, "node_modules/npm/node_modules/minipass-fetch": { - "version": "3.0.4", + "version": "4.0.0", "inBundle": true, "license": "MIT", "dependencies": { "minipass": "^7.0.3", "minipass-sized": "^1.0.3", - "minizlib": "^2.1.2" + "minizlib": "^3.0.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" }, "optionalDependencies": { "encoding": "^0.1.13" } }, + "node_modules/npm/node_modules/minipass-fetch/node_modules/minizlib": { + "version": "3.0.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "minipass": "^7.0.4", + "rimraf": "^5.0.5" + }, + "engines": { + "node": ">= 18" + } + }, "node_modules/npm/node_modules/minipass-flush": { "version": "1.0.5", "inBundle": true, @@ -24602,26 +24285,6 @@ "node": ">=8" } }, - "node_modules/npm/node_modules/minipass-json-stream": { - "version": "1.0.1", - "inBundle": true, - "license": "MIT", - "dependencies": { - "jsonparse": "^1.3.1", - "minipass": "^3.0.0" - } - }, - "node_modules/npm/node_modules/minipass-json-stream/node_modules/minipass": { - "version": "3.3.6", - "inBundle": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/npm/node_modules/minipass-pipeline": { "version": "1.2.4", "inBundle": true, @@ -24706,11 +24369,11 @@ "license": "MIT" }, "node_modules/npm/node_modules/mute-stream": { - "version": "1.0.0", + "version": "2.0.0", "inBundle": true, "license": "ISC", "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/negotiator": { @@ -24722,326 +24385,201 @@ } }, "node_modules/npm/node_modules/node-gyp": { - "version": "9.4.1", + "version": "10.2.0", "inBundle": true, "license": "MIT", "dependencies": { "env-paths": "^2.2.0", "exponential-backoff": "^3.1.1", - "glob": "^7.1.4", + "glob": "^10.3.10", "graceful-fs": "^4.2.6", - "make-fetch-happen": "^10.0.3", - "nopt": "^6.0.0", - "npmlog": "^6.0.0", - "rimraf": "^3.0.2", + "make-fetch-happen": "^13.0.0", + "nopt": "^7.0.0", + "proc-log": "^4.1.0", "semver": "^7.3.5", - "tar": "^6.1.2", - "which": "^2.0.2" + "tar": "^6.2.1", + "which": "^4.0.0" }, "bin": { "node-gyp": "bin/node-gyp.js" }, "engines": { - "node": "^12.13 || ^14.13 || >=16" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/node-gyp/node_modules/@npmcli/fs": { - "version": "2.1.2", + "node_modules/npm/node_modules/node-gyp/node_modules/@npmcli/agent": { + "version": "2.2.2", "inBundle": true, "license": "ISC", "dependencies": { - "@gar/promisify": "^1.1.3", - "semver": "^7.3.5" + "agent-base": "^7.1.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.1", + "lru-cache": "^10.0.1", + "socks-proxy-agent": "^8.0.3" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/node-gyp/node_modules/abbrev": { - "version": "1.1.1", - "inBundle": true, - "license": "ISC" - }, - "node_modules/npm/node_modules/node-gyp/node_modules/are-we-there-yet": { - "version": "3.0.1", + "node_modules/npm/node_modules/node-gyp/node_modules/@npmcli/fs": { + "version": "3.1.1", "inBundle": true, "license": "ISC", "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" + "semver": "^7.3.5" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/node-gyp/node_modules/brace-expansion": { - "version": "1.1.11", + "node_modules/npm/node_modules/node-gyp/node_modules/abbrev": { + "version": "2.0.0", "inBundle": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/npm/node_modules/node-gyp/node_modules/cacache": { - "version": "16.1.3", + "version": "18.0.4", "inBundle": true, "license": "ISC", "dependencies": { - "@npmcli/fs": "^2.1.0", - "@npmcli/move-file": "^2.0.0", - "chownr": "^2.0.0", - "fs-minipass": "^2.1.0", - "glob": "^8.0.1", - "infer-owner": "^1.0.4", - "lru-cache": "^7.7.1", - "minipass": "^3.1.6", - "minipass-collect": "^1.0.2", + "@npmcli/fs": "^3.1.0", + "fs-minipass": "^3.0.0", + "glob": "^10.2.2", + "lru-cache": "^10.0.1", + "minipass": "^7.0.3", + "minipass-collect": "^2.0.1", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", - "mkdirp": "^1.0.4", "p-map": "^4.0.0", - "promise-inflight": "^1.0.1", - "rimraf": "^3.0.2", - "ssri": "^9.0.0", + "ssri": "^10.0.0", "tar": "^6.1.11", - "unique-filename": "^2.0.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/npm/node_modules/node-gyp/node_modules/cacache/node_modules/brace-expansion": { - "version": "2.0.1", - "inBundle": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/npm/node_modules/node-gyp/node_modules/cacache/node_modules/glob": { - "version": "8.1.0", - "inBundle": true, - "license": "ISC", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/npm/node_modules/node-gyp/node_modules/cacache/node_modules/minimatch": { - "version": "5.1.6", - "inBundle": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/npm/node_modules/node-gyp/node_modules/fs-minipass": { - "version": "2.1.0", - "inBundle": true, - "license": "ISC", - "dependencies": { - "minipass": "^3.0.0" + "unique-filename": "^3.0.0" }, "engines": { - "node": ">= 8" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/node-gyp/node_modules/gauge": { - "version": "4.0.4", + "node_modules/npm/node_modules/node-gyp/node_modules/isexe": { + "version": "3.1.1", "inBundle": true, "license": "ISC", - "dependencies": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.3", - "console-control-strings": "^1.1.0", - "has-unicode": "^2.0.1", - "signal-exit": "^3.0.7", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.5" - }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/npm/node_modules/node-gyp/node_modules/glob": { - "version": "7.2.3", - "inBundle": true, - "license": "ISC", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">=16" } }, "node_modules/npm/node_modules/node-gyp/node_modules/make-fetch-happen": { - "version": "10.2.1", + "version": "13.0.1", "inBundle": true, "license": "ISC", "dependencies": { - "agentkeepalive": "^4.2.1", - "cacache": "^16.1.0", - "http-cache-semantics": "^4.1.0", - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.0", + "@npmcli/agent": "^2.0.0", + "cacache": "^18.0.0", + "http-cache-semantics": "^4.1.1", "is-lambda": "^1.0.1", - "lru-cache": "^7.7.1", - "minipass": "^3.1.6", - "minipass-collect": "^1.0.2", - "minipass-fetch": "^2.0.3", + "minipass": "^7.0.2", + "minipass-fetch": "^3.0.0", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", "negotiator": "^0.6.3", + "proc-log": "^4.2.0", "promise-retry": "^2.0.1", - "socks-proxy-agent": "^7.0.0", - "ssri": "^9.0.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/npm/node_modules/node-gyp/node_modules/minimatch": { - "version": "3.1.2", - "inBundle": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/npm/node_modules/node-gyp/node_modules/minipass": { - "version": "3.3.6", - "inBundle": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" + "ssri": "^10.0.0" }, "engines": { - "node": ">=8" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/node-gyp/node_modules/minipass-fetch": { - "version": "2.1.2", + "version": "3.0.5", "inBundle": true, "license": "MIT", "dependencies": { - "minipass": "^3.1.6", + "minipass": "^7.0.3", "minipass-sized": "^1.0.3", "minizlib": "^2.1.2" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" }, "optionalDependencies": { "encoding": "^0.1.13" } }, "node_modules/npm/node_modules/node-gyp/node_modules/nopt": { - "version": "6.0.0", + "version": "7.2.1", "inBundle": true, "license": "ISC", "dependencies": { - "abbrev": "^1.0.0" + "abbrev": "^2.0.0" }, "bin": { "nopt": "bin/nopt.js" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/node-gyp/node_modules/npmlog": { - "version": "6.0.2", + "node_modules/npm/node_modules/node-gyp/node_modules/proc-log": { + "version": "4.2.0", "inBundle": true, "license": "ISC", - "dependencies": { - "are-we-there-yet": "^3.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^4.0.3", - "set-blocking": "^2.0.0" - }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/node-gyp/node_modules/signal-exit": { - "version": "3.0.7", - "inBundle": true, - "license": "ISC" - }, "node_modules/npm/node_modules/node-gyp/node_modules/ssri": { - "version": "9.0.1", + "version": "10.0.6", "inBundle": true, "license": "ISC", "dependencies": { - "minipass": "^3.1.1" + "minipass": "^7.0.3" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/npm/node_modules/node-gyp/node_modules/unique-filename": { - "version": "2.0.1", + "version": "3.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "unique-slug": "^3.0.0" + "unique-slug": "^4.0.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/npm/node_modules/node-gyp/node_modules/unique-slug": { - "version": "3.0.0", + "version": "4.0.0", "inBundle": true, "license": "ISC", "dependencies": { "imurmurhash": "^0.1.4" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/npm/node_modules/node-gyp/node_modules/which": { - "version": "2.0.2", + "version": "4.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "isexe": "^2.0.0" + "isexe": "^3.1.1" }, "bin": { - "node-which": "bin/node-which" + "node-which": "bin/which.js" }, "engines": { - "node": ">= 8" + "node": "^16.13.0 || >=18.0.0" } }, "node_modules/npm/node_modules/nopt": { - "version": "7.2.0", + "version": "8.0.0", "inBundle": true, "license": "ISC", "dependencies": { @@ -25050,166 +24588,156 @@ "bin": { "nopt": "bin/nopt.js" }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/npm/node_modules/nopt/node_modules/abbrev": { + "version": "2.0.0", + "inBundle": true, + "license": "ISC", "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/npm/node_modules/normalize-package-data": { - "version": "5.0.0", + "version": "7.0.0", "inBundle": true, "license": "BSD-2-Clause", "dependencies": { - "hosted-git-info": "^6.0.0", - "is-core-module": "^2.8.1", + "hosted-git-info": "^8.0.0", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/npm-audit-report": { - "version": "5.0.0", + "version": "6.0.0", "inBundle": true, "license": "ISC", "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/npm-bundled": { - "version": "3.0.0", + "version": "4.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "npm-normalize-package-bin": "^3.0.0" + "npm-normalize-package-bin": "^4.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/npm-install-checks": { - "version": "6.3.0", + "version": "7.1.0", "inBundle": true, "license": "BSD-2-Clause", "dependencies": { "semver": "^7.1.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/npm-normalize-package-bin": { - "version": "3.0.1", + "version": "4.0.0", "inBundle": true, "license": "ISC", "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/npm-package-arg": { - "version": "10.1.0", + "version": "12.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "hosted-git-info": "^6.0.0", - "proc-log": "^3.0.0", + "hosted-git-info": "^8.0.0", + "proc-log": "^5.0.0", "semver": "^7.3.5", - "validate-npm-package-name": "^5.0.0" + "validate-npm-package-name": "^6.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/npm-packlist": { - "version": "7.0.4", + "version": "9.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "ignore-walk": "^6.0.0" + "ignore-walk": "^7.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/npm-pick-manifest": { - "version": "8.0.2", + "version": "10.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "npm-install-checks": "^6.0.0", - "npm-normalize-package-bin": "^3.0.0", - "npm-package-arg": "^10.0.0", + "npm-install-checks": "^7.1.0", + "npm-normalize-package-bin": "^4.0.0", + "npm-package-arg": "^12.0.0", "semver": "^7.3.5" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/npm-profile": { - "version": "7.0.1", + "version": "11.0.1", "inBundle": true, "license": "ISC", "dependencies": { - "npm-registry-fetch": "^14.0.0", - "proc-log": "^3.0.0" + "npm-registry-fetch": "^18.0.0", + "proc-log": "^5.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/npm-registry-fetch": { - "version": "14.0.5", + "version": "18.0.1", "inBundle": true, "license": "ISC", "dependencies": { - "make-fetch-happen": "^11.0.0", - "minipass": "^5.0.0", - "minipass-fetch": "^3.0.0", - "minipass-json-stream": "^1.0.1", - "minizlib": "^2.1.2", - "npm-package-arg": "^10.0.0", - "proc-log": "^3.0.0" + "@npmcli/redact": "^3.0.0", + "jsonparse": "^1.3.1", + "make-fetch-happen": "^14.0.0", + "minipass": "^7.0.2", + "minipass-fetch": "^4.0.0", + "minizlib": "^3.0.1", + "npm-package-arg": "^12.0.0", + "proc-log": "^5.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, - "node_modules/npm/node_modules/npm-registry-fetch/node_modules/minipass": { - "version": "5.0.0", + "node_modules/npm/node_modules/npm-registry-fetch/node_modules/minizlib": { + "version": "3.0.1", "inBundle": true, - "license": "ISC", + "license": "MIT", + "dependencies": { + "minipass": "^7.0.4", + "rimraf": "^5.0.5" + }, "engines": { - "node": ">=8" + "node": ">= 18" } }, "node_modules/npm/node_modules/npm-user-validate": { - "version": "2.0.0", + "version": "3.0.0", "inBundle": true, "license": "BSD-2-Clause", "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/npmlog": { - "version": "7.0.1", - "inBundle": true, - "license": "ISC", - "dependencies": { - "are-we-there-yet": "^4.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^5.0.0", - "set-blocking": "^2.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/once": { - "version": "1.4.0", - "inBundle": true, - "license": "ISC", - "dependencies": { - "wrappy": "1" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/p-map": { @@ -25226,64 +24754,52 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/npm/node_modules/package-json-from-dist": { + "version": "1.0.0", + "inBundle": true, + "license": "BlueOak-1.0.0" + }, "node_modules/npm/node_modules/pacote": { - "version": "15.2.0", + "version": "19.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "@npmcli/git": "^4.0.0", - "@npmcli/installed-package-contents": "^2.0.1", - "@npmcli/promise-spawn": "^6.0.1", - "@npmcli/run-script": "^6.0.0", - "cacache": "^17.0.0", + "@npmcli/git": "^6.0.0", + "@npmcli/installed-package-contents": "^3.0.0", + "@npmcli/package-json": "^6.0.0", + "@npmcli/promise-spawn": "^8.0.0", + "@npmcli/run-script": "^9.0.0", + "cacache": "^19.0.0", "fs-minipass": "^3.0.0", - "minipass": "^5.0.0", - "npm-package-arg": "^10.0.0", - "npm-packlist": "^7.0.0", - "npm-pick-manifest": "^8.0.0", - "npm-registry-fetch": "^14.0.0", - "proc-log": "^3.0.0", + "minipass": "^7.0.2", + "npm-package-arg": "^12.0.0", + "npm-packlist": "^9.0.0", + "npm-pick-manifest": "^10.0.0", + "npm-registry-fetch": "^18.0.0", + "proc-log": "^5.0.0", "promise-retry": "^2.0.1", - "read-package-json": "^6.0.0", - "read-package-json-fast": "^3.0.0", - "sigstore": "^1.3.0", - "ssri": "^10.0.0", + "sigstore": "^2.2.0", + "ssri": "^12.0.0", "tar": "^6.1.11" }, "bin": { - "pacote": "lib/bin.js" + "pacote": "bin/index.js" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/pacote/node_modules/minipass": { - "version": "5.0.0", - "inBundle": true, - "license": "ISC", - "engines": { - "node": ">=8" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/parse-conflict-json": { - "version": "3.0.1", + "version": "4.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "json-parse-even-better-errors": "^3.0.0", + "json-parse-even-better-errors": "^4.0.0", "just-diff": "^6.0.0", "just-diff-apply": "^5.2.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/path-is-absolute": { - "version": "1.0.1", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/path-key": { @@ -25295,30 +24811,22 @@ } }, "node_modules/npm/node_modules/path-scurry": { - "version": "1.10.1", + "version": "1.11.1", "inBundle": true, "license": "BlueOak-1.0.0", "dependencies": { - "lru-cache": "^9.1.1 || ^10.0.0", + "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">=16 || 14 >=14.18" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/npm/node_modules/path-scurry/node_modules/lru-cache": { - "version": "10.2.0", - "inBundle": true, - "license": "ISC", - "engines": { - "node": "14 || >=16.14" - } - }, "node_modules/npm/node_modules/postcss-selector-parser": { - "version": "6.0.15", + "version": "6.1.2", "inBundle": true, "license": "MIT", "dependencies": { @@ -25330,11 +24838,19 @@ } }, "node_modules/npm/node_modules/proc-log": { + "version": "5.0.0", + "inBundle": true, + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/npm/node_modules/proggy": { "version": "3.0.0", "inBundle": true, "license": "ISC", "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/promise-all-reject-late": { @@ -25346,7 +24862,7 @@ } }, "node_modules/npm/node_modules/promise-call-limit": { - "version": "1.0.2", + "version": "3.0.1", "inBundle": true, "license": "ISC", "funding": { @@ -25371,14 +24887,14 @@ } }, "node_modules/npm/node_modules/promzard": { - "version": "1.0.0", + "version": "2.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "read": "^2.0.0" + "read": "^4.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/qrcode-terminal": { @@ -25389,61 +24905,34 @@ } }, "node_modules/npm/node_modules/read": { - "version": "2.1.0", + "version": "4.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "mute-stream": "~1.0.0" + "mute-stream": "^2.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/read-cmd-shim": { - "version": "4.0.0", + "version": "5.0.0", "inBundle": true, "license": "ISC", "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/read-package-json": { - "version": "6.0.4", - "inBundle": true, - "license": "ISC", - "dependencies": { - "glob": "^10.2.2", - "json-parse-even-better-errors": "^3.0.0", - "normalize-package-data": "^5.0.0", - "npm-normalize-package-bin": "^3.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/read-package-json-fast": { - "version": "3.0.2", + "version": "4.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "json-parse-even-better-errors": "^3.0.0", - "npm-normalize-package-bin": "^3.0.0" + "json-parse-even-better-errors": "^4.0.0", + "npm-normalize-package-bin": "^4.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/readable-stream": { - "version": "3.6.2", - "inBundle": true, - "license": "MIT", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/retry": { @@ -25455,77 +24944,19 @@ } }, "node_modules/npm/node_modules/rimraf": { - "version": "3.0.2", + "version": "5.0.10", "inBundle": true, "license": "ISC", "dependencies": { - "glob": "^7.1.3" + "glob": "^10.3.7" }, "bin": { - "rimraf": "bin.js" + "rimraf": "dist/esm/bin.mjs" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/npm/node_modules/rimraf/node_modules/brace-expansion": { - "version": "1.1.11", - "inBundle": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/npm/node_modules/rimraf/node_modules/glob": { - "version": "7.2.3", - "inBundle": true, - "license": "ISC", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/npm/node_modules/rimraf/node_modules/minimatch": { - "version": "3.1.2", - "inBundle": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/npm/node_modules/safe-buffer": { - "version": "5.2.1", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "inBundle": true, - "license": "MIT" - }, "node_modules/npm/node_modules/safer-buffer": { "version": "2.1.2", "inBundle": true, @@ -25533,12 +24964,9 @@ "optional": true }, "node_modules/npm/node_modules/semver": { - "version": "7.6.0", + "version": "7.6.3", "inBundle": true, "license": "ISC", - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { "semver": "bin/semver.js" }, @@ -25546,22 +24974,6 @@ "node": ">=10" } }, - "node_modules/npm/node_modules/semver/node_modules/lru-cache": { - "version": "6.0.0", - "inBundle": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/npm/node_modules/set-blocking": { - "version": "2.0.0", - "inBundle": true, - "license": "ISC" - }, "node_modules/npm/node_modules/shebang-command": { "version": "2.0.0", "inBundle": true, @@ -25593,21 +25005,19 @@ } }, "node_modules/npm/node_modules/sigstore": { - "version": "1.9.0", + "version": "2.3.1", "inBundle": true, "license": "Apache-2.0", "dependencies": { - "@sigstore/bundle": "^1.1.0", - "@sigstore/protobuf-specs": "^0.2.0", - "@sigstore/sign": "^1.0.0", - "@sigstore/tuf": "^1.0.3", - "make-fetch-happen": "^11.0.1" - }, - "bin": { - "sigstore": "bin/sigstore.js" + "@sigstore/bundle": "^2.3.2", + "@sigstore/core": "^1.0.0", + "@sigstore/protobuf-specs": "^0.3.2", + "@sigstore/sign": "^2.3.2", + "@sigstore/tuf": "^2.3.4", + "@sigstore/verify": "^1.2.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/smart-buffer": { @@ -25620,7 +25030,7 @@ } }, "node_modules/npm/node_modules/socks": { - "version": "2.8.1", + "version": "2.8.3", "inBundle": true, "license": "MIT", "dependencies": { @@ -25633,16 +25043,16 @@ } }, "node_modules/npm/node_modules/socks-proxy-agent": { - "version": "7.0.0", + "version": "8.0.4", "inBundle": true, "license": "MIT", "dependencies": { - "agent-base": "^6.0.2", - "debug": "^4.3.3", - "socks": "^2.6.2" + "agent-base": "^7.1.1", + "debug": "^4.3.4", + "socks": "^2.8.3" }, "engines": { - "node": ">= 10" + "node": ">= 14" } }, "node_modules/npm/node_modules/spdx-correct": { @@ -25654,13 +25064,22 @@ "spdx-license-ids": "^3.0.0" } }, + "node_modules/npm/node_modules/spdx-correct/node_modules/spdx-expression-parse": { + "version": "3.0.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, "node_modules/npm/node_modules/spdx-exceptions": { "version": "2.5.0", "inBundle": true, "license": "CC-BY-3.0" }, "node_modules/npm/node_modules/spdx-expression-parse": { - "version": "3.0.1", + "version": "4.0.0", "inBundle": true, "license": "MIT", "dependencies": { @@ -25669,27 +25088,24 @@ } }, "node_modules/npm/node_modules/spdx-license-ids": { - "version": "3.0.17", + "version": "3.0.18", "inBundle": true, "license": "CC0-1.0" }, + "node_modules/npm/node_modules/sprintf-js": { + "version": "1.1.3", + "inBundle": true, + "license": "BSD-3-Clause" + }, "node_modules/npm/node_modules/ssri": { - "version": "10.0.5", + "version": "12.0.0", "inBundle": true, "license": "ISC", "dependencies": { "minipass": "^7.0.3" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/string_decoder": { - "version": "1.3.0", - "inBundle": true, - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.2.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/string-width": { @@ -25754,7 +25170,7 @@ } }, "node_modules/npm/node_modules/tar": { - "version": "6.2.0", + "version": "6.2.1", "inBundle": true, "license": "ISC", "dependencies": { @@ -25818,19 +25234,124 @@ } }, "node_modules/npm/node_modules/tuf-js": { - "version": "1.1.7", + "version": "2.2.1", "inBundle": true, "license": "MIT", "dependencies": { - "@tufjs/models": "1.0.4", + "@tufjs/models": "2.0.1", "debug": "^4.3.4", - "make-fetch-happen": "^11.1.1" + "make-fetch-happen": "^13.0.1" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/tuf-js/node_modules/@npmcli/agent": { + "version": "2.2.2", + "inBundle": true, + "license": "ISC", + "dependencies": { + "agent-base": "^7.1.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.1", + "lru-cache": "^10.0.1", + "socks-proxy-agent": "^8.0.3" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/tuf-js/node_modules/@npmcli/fs": { + "version": "3.1.1", + "inBundle": true, + "license": "ISC", + "dependencies": { + "semver": "^7.3.5" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/unique-filename": { + "node_modules/npm/node_modules/tuf-js/node_modules/cacache": { + "version": "18.0.4", + "inBundle": true, + "license": "ISC", + "dependencies": { + "@npmcli/fs": "^3.1.0", + "fs-minipass": "^3.0.0", + "glob": "^10.2.2", + "lru-cache": "^10.0.1", + "minipass": "^7.0.3", + "minipass-collect": "^2.0.1", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^4.0.0", + "ssri": "^10.0.0", + "tar": "^6.1.11", + "unique-filename": "^3.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/tuf-js/node_modules/make-fetch-happen": { + "version": "13.0.1", + "inBundle": true, + "license": "ISC", + "dependencies": { + "@npmcli/agent": "^2.0.0", + "cacache": "^18.0.0", + "http-cache-semantics": "^4.1.1", + "is-lambda": "^1.0.1", + "minipass": "^7.0.2", + "minipass-fetch": "^3.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.3", + "proc-log": "^4.2.0", + "promise-retry": "^2.0.1", + "ssri": "^10.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/tuf-js/node_modules/minipass-fetch": { + "version": "3.0.5", + "inBundle": true, + "license": "MIT", + "dependencies": { + "minipass": "^7.0.3", + "minipass-sized": "^1.0.3", + "minizlib": "^2.1.2" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + }, + "optionalDependencies": { + "encoding": "^0.1.13" + } + }, + "node_modules/npm/node_modules/tuf-js/node_modules/proc-log": { + "version": "4.2.0", + "inBundle": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/tuf-js/node_modules/ssri": { + "version": "10.0.6", + "inBundle": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/tuf-js/node_modules/unique-filename": { "version": "3.0.0", "inBundle": true, "license": "ISC", @@ -25841,7 +25362,7 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/unique-slug": { + "node_modules/npm/node_modules/tuf-js/node_modules/unique-slug": { "version": "4.0.0", "inBundle": true, "license": "ISC", @@ -25852,6 +25373,28 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/npm/node_modules/unique-filename": { + "version": "4.0.0", + "inBundle": true, + "license": "ISC", + "dependencies": { + "unique-slug": "^5.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/npm/node_modules/unique-slug": { + "version": "5.0.0", + "inBundle": true, + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, "node_modules/npm/node_modules/util-deprecate": { "version": "1.0.2", "inBundle": true, @@ -25866,15 +25409,21 @@ "spdx-expression-parse": "^3.0.0" } }, + "node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse": { + "version": "3.0.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, "node_modules/npm/node_modules/validate-npm-package-name": { - "version": "5.0.0", + "version": "6.0.0", "inBundle": true, "license": "ISC", - "dependencies": { - "builtins": "^5.0.0" - }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/walk-up-path": { @@ -25882,34 +25431,26 @@ "inBundle": true, "license": "ISC" }, - "node_modules/npm/node_modules/wcwidth": { - "version": "1.0.1", - "inBundle": true, - "license": "MIT", - "dependencies": { - "defaults": "^1.0.3" - } - }, "node_modules/npm/node_modules/which": { - "version": "3.0.1", + "version": "5.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "isexe": "^2.0.0" + "isexe": "^3.1.1" }, "bin": { "node-which": "bin/which.js" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, - "node_modules/npm/node_modules/wide-align": { - "version": "1.1.5", + "node_modules/npm/node_modules/which/node_modules/isexe": { + "version": "3.1.1", "inBundle": true, "license": "ISC", - "dependencies": { - "string-width": "^1.0.2 || 2 || 3 || 4" + "engines": { + "node": ">=16" } }, "node_modules/npm/node_modules/wrap-ansi": { @@ -25945,26 +25486,29 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/npm/node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "6.0.1", + "node_modules/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", "inBundle": true, "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, "engines": { - "node": ">=12" + "node": ">=8" }, "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/npm/node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "6.2.1", + "node_modules/npm/node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "6.0.1", "inBundle": true, "license": "MIT", "engines": { "node": ">=12" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, "node_modules/npm/node_modules/wrap-ansi/node_modules/emoji-regex": { @@ -26002,13 +25546,8 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "node_modules/npm/node_modules/wrappy": { - "version": "1.0.2", - "inBundle": true, - "license": "ISC" - }, "node_modules/npm/node_modules/write-file-atomic": { - "version": "5.0.1", + "version": "6.0.0", "inBundle": true, "license": "ISC", "dependencies": { @@ -26016,7 +25555,7 @@ "signal-exit": "^4.0.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/npm/node_modules/yallist": { @@ -26482,16 +26021,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/nyc/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/nyc/node_modules/camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", @@ -26614,18 +26143,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/nyc/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/nyc/node_modules/p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", @@ -26759,9 +26276,12 @@ } }, "node_modules/object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -26790,12 +26310,12 @@ } }, "node_modules/object.assign": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", - "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", "has-symbols": "^1.0.3", "object-keys": "^1.1.1" }, @@ -26807,13 +26327,15 @@ } }, "node_modules/object.fromentries": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.7.tgz", - "integrity": "sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", + "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -26823,24 +26345,28 @@ } }, "node_modules/object.groupby": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.1.tgz", - "integrity": "sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", + "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "get-intrinsic": "^1.2.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2" + }, + "engines": { + "node": ">= 0.4" } }, "node_modules/object.values": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.7.tgz", - "integrity": "sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz", + "integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==", + "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -26869,7 +26395,7 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "devOptional": true, + "dev": true, "dependencies": { "mimic-fn": "^2.1.0" }, @@ -26884,6 +26410,7 @@ "version": "0.9.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "dev": true, "dependencies": { "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", @@ -26899,7 +26426,8 @@ "node_modules/optionator/node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true }, "node_modules/ora": { "version": "5.4.1", @@ -27077,6 +26605,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, "dependencies": { "yocto-queue": "^0.1.0" }, @@ -27091,6 +26620,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, "dependencies": { "p-limit": "^3.0.2" }, @@ -27403,6 +26933,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, "dependencies": { "callsites": "^3.0.0" }, @@ -27424,11 +26955,24 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/parse-imports": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/parse-imports/-/parse-imports-2.2.1.tgz", + "integrity": "sha512-OL/zLggRp8mFhKL0rNORUTR4yBYujK/uU+xZL+/0Rgm2QE4nLO9v8PzEweSJEbMGKmDRjJE4R3IMJlL2di4JeQ==", + "dev": true, + "dependencies": { + "es-module-lexer": "^1.5.3", + "slashes": "^3.0.12" + }, + "engines": { + "node": ">= 18" + } + }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "devOptional": true, + "dev": true, "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", @@ -27446,7 +26990,7 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "devOptional": true + "dev": true }, "node_modules/parse-passwd": { "version": "1.0.0", @@ -27643,9 +27187,9 @@ "dev": true }, "node_modules/picocolors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", - "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==" }, "node_modules/picomatch": { "version": "2.3.1", @@ -27898,6 +27442,14 @@ "semver-compare": "^1.0.0" } }, + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/postcss": { "version": "8.4.27", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.27.tgz", @@ -27990,14 +27542,15 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, "engines": { "node": ">= 0.8.0" } }, "node_modules/prettier": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", - "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -28025,7 +27578,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "devOptional": true, + "dev": true, "dependencies": { "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", @@ -28039,7 +27592,7 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "devOptional": true, + "dev": true, "engines": { "node": ">=10" }, @@ -28136,7 +27689,7 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", - "devOptional": true, + "dev": true, "dependencies": { "kleur": "^3.0.3", "sisteransi": "^1.0.5" @@ -28305,7 +27858,7 @@ "version": "6.0.4", "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.4.tgz", "integrity": "sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==", - "devOptional": true, + "dev": true, "funding": [ { "type": "individual", @@ -28431,7 +27984,7 @@ "version": "18.2.0", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", - "devOptional": true + "dev": true }, "node_modules/read": { "version": "1.0.7", @@ -28868,13 +28421,14 @@ "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" }, "node_modules/regexp.prototype.flags": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", - "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.3.tgz", + "integrity": "sha512-vqlC04+RQoFalODCbCumG2xIOvapzVMHwsyIGM/SIE8fRhFFsXeH8/QQ+s0T0kDAhKc4k30s73/0ydkHQz6HlQ==", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "functions-have-names": "^1.2.3" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.2" }, "engines": { "node": ">= 0.4" @@ -28883,18 +28437,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, "node_modules/release-zalgo": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", @@ -28925,7 +28467,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "devOptional": true, + "dev": true, "engines": { "node": ">=0.10.0" } @@ -28980,7 +28522,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", - "devOptional": true, + "dev": true, "dependencies": { "resolve-from": "^5.0.0" }, @@ -29025,7 +28567,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", - "devOptional": true, + "dev": true, "engines": { "node": ">=10" } @@ -29075,6 +28617,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, "dependencies": { "glob": "^7.1.3" }, @@ -29085,19 +28628,11 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/rimraf/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/rimraf/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -29113,17 +28648,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/rimraf/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/roarr": { "version": "2.15.4", "resolved": "https://registry.npmjs.org/roarr/-/roarr-2.15.4.tgz", @@ -29196,12 +28720,12 @@ } }, "node_modules/safe-array-concat": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.0.tgz", - "integrity": "sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.0", + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", "has-symbols": "^1.0.3", "isarray": "^2.0.5" }, @@ -29237,14 +28761,17 @@ ] }, "node_modules/safe-regex-test": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", - "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.3", + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", "is-regex": "^1.1.4" }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -29530,6 +29057,36 @@ "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", "dev": true }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", @@ -29594,15 +29151,6 @@ "node": ">=4" } }, - "node_modules/shelljs/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/shelljs/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -29622,17 +29170,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/shelljs/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/shimmer": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/shimmer/-/shimmer-1.2.1.tgz", @@ -29768,7 +29305,7 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", - "devOptional": true + "dev": true }, "node_modules/slash": { "version": "3.0.0", @@ -29778,6 +29315,12 @@ "node": ">=8" } }, + "node_modules/slashes": { + "version": "3.0.12", + "resolved": "https://registry.npmjs.org/slashes/-/slashes-3.0.12.tgz", + "integrity": "sha512-Q9VME8WyGkc7pJf6QEkj3wE+2CnvZMI+XJhwdTPR8Z/kWQRXi7boAWLDibRPyHRTUTPx5FaU7MsyrjI3yLB4HA==", + "dev": true + }, "node_modules/smart-buffer": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", @@ -30154,7 +29697,7 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", - "devOptional": true, + "dev": true, "dependencies": { "char-regex": "^1.0.2", "strip-ansi": "^6.0.0" @@ -30167,7 +29710,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "devOptional": true, + "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -30245,13 +29788,14 @@ } }, "node_modules/string.prototype.trim": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", - "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==", + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -30261,26 +29805,29 @@ } }, "node_modules/string.prototype.trimend": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", - "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimstart": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz", - "integrity": "sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -30322,7 +29869,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" } @@ -30340,7 +29887,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "devOptional": true, + "dev": true, "engines": { "node": ">=6" } @@ -30435,6 +29982,28 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, + "node_modules/synckit": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.2.tgz", + "integrity": "sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==", + "dev": true, + "dependencies": { + "@pkgr/core": "^0.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/synckit/node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true + }, "node_modules/system-tests": { "resolved": "packages/system-tests", "link": true @@ -30628,9 +30197,9 @@ } }, "node_modules/terser": { - "version": "5.19.2", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.19.2.tgz", - "integrity": "sha512-qC5+dmecKJA4cpYxRa5aVkKehYsQKc+AHeKl0Oe62aYjBL8ZA33tTljktDHJSaxxMnbI5ZYw+o/S2DxxLu8OfA==", + "version": "5.36.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.36.0.tgz", + "integrity": "sha512-IYV9eNMuFAV4THUspIRXkLakHnV6XO7FEdtKjf/mDyrnqUg9LnlOn6/RwRvM9SZjR4GUq8Nk8zj67FzVARr74w==", "dev": true, "peer": true, "dependencies": { @@ -30647,17 +30216,17 @@ } }, "node_modules/terser-webpack-plugin": { - "version": "5.3.9", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.9.tgz", - "integrity": "sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==", + "version": "5.3.10", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz", + "integrity": "sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==", "dev": true, "peer": true, "dependencies": { - "@jridgewell/trace-mapping": "^0.3.17", + "@jridgewell/trace-mapping": "^0.3.20", "jest-worker": "^27.4.5", "schema-utils": "^3.1.1", "serialize-javascript": "^6.0.1", - "terser": "^5.16.8" + "terser": "^5.26.0" }, "engines": { "node": ">= 10.13.0" @@ -30707,9 +30276,9 @@ } }, "node_modules/terser-webpack-plugin/node_modules/serialize-javascript": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", - "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", "dev": true, "peer": true, "dependencies": { @@ -30732,13 +30301,6 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/terser/node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true, - "peer": true - }, "node_modules/terser/node_modules/source-map-support": { "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", @@ -30763,15 +30325,6 @@ "node": ">=8" } }, - "node_modules/test-exclude/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/test-exclude/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -30791,17 +30344,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/test-exclude/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/text-extensions": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz", @@ -30814,7 +30356,8 @@ "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==" + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true }, "node_modules/thread-stream": { "version": "3.1.0", @@ -30973,12 +30516,12 @@ "integrity": "sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==" }, "node_modules/ts-api-utils": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz", - "integrity": "sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==", - "devOptional": true, + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.0.tgz", + "integrity": "sha512-032cPxaEKwM+GT3vA5JXNzIaizx388rhsSW79vGRNGXfRRAdEAn2mvk36PvK5HnOchyWZ7afLEXqYCvPCrzuzQ==", + "dev": true, "engines": { - "node": ">=16.13.0" + "node": ">=16" }, "peerDependencies": { "typescript": ">=4.2.0" @@ -31157,9 +30700,9 @@ } }, "node_modules/ts-node": { - "version": "10.9.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", - "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", "dev": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", @@ -31334,9 +30877,10 @@ } }, "node_modules/tsconfig-paths": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz", - "integrity": "sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==", + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", + "dev": true, "dependencies": { "@types/json5": "^0.0.29", "json5": "^1.0.2", @@ -31348,6 +30892,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, "dependencies": { "minimist": "^1.2.0" }, @@ -31359,6 +30904,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, "engines": { "node": ">=4" } @@ -31366,21 +30912,8 @@ "node_modules/tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true }, "node_modules/tunnel": { "version": "0.0.6", @@ -31405,6 +30938,7 @@ "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, "dependencies": { "prelude-ls": "^1.2.1" }, @@ -31416,7 +30950,7 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "devOptional": true, + "dev": true, "engines": { "node": ">=4" } @@ -31433,27 +30967,28 @@ } }, "node_modules/typed-array-buffer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz", - "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1", - "is-typed-array": "^1.1.10" + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" }, "engines": { "node": ">= 0.4" } }, "node_modules/typed-array-byte-length": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz", - "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", "dependencies": { - "call-bind": "^1.0.2", + "call-bind": "^1.0.7", "for-each": "^0.3.3", - "has-proto": "^1.0.1", - "is-typed-array": "^1.1.10" + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" }, "engines": { "node": ">= 0.4" @@ -31463,15 +30998,16 @@ } }, "node_modules/typed-array-byte-offset": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", - "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", "for-each": "^0.3.3", - "has-proto": "^1.0.1", - "is-typed-array": "^1.1.10" + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" }, "engines": { "node": ">= 0.4" @@ -31481,13 +31017,19 @@ } }, "node_modules/typed-array-length": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", - "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", "dependencies": { - "call-bind": "^1.0.2", + "call-bind": "^1.0.7", "for-each": "^0.3.3", - "is-typed-array": "^1.1.9" + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -31519,9 +31061,9 @@ } }, "node_modules/typescript": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", - "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", + "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -31580,6 +31122,11 @@ "node": ">=14.0" } }, + "node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==" + }, "node_modules/unique-filename": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-2.0.1.tgz", @@ -31676,9 +31223,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz", - "integrity": "sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz", + "integrity": "sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==", "funding": [ { "type": "opencollective", @@ -31694,8 +31241,8 @@ } ], "dependencies": { - "escalade": "^3.1.2", - "picocolors": "^1.0.1" + "escalade": "^3.2.0", + "picocolors": "^1.1.0" }, "bin": { "update-browserslist-db": "cli.js" @@ -31775,7 +31322,7 @@ "version": "9.1.3", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.3.tgz", "integrity": "sha512-9lDD+EVI2fjFsMWXc6dy5JJzBsVTcQ2fVkfBvncZ6xJWG9wtBhOldG+mHkSL0+V1K/xgZz0JDO5UT5hFwHUghg==", - "devOptional": true, + "dev": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.12", "@types/istanbul-lib-coverage": "^2.0.1", @@ -31789,7 +31336,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "devOptional": true + "dev": true }, "node_modules/validate-npm-package-license": { "version": "3.0.4", @@ -32226,9 +31773,9 @@ } }, "node_modules/watchpack": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", - "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz", + "integrity": "sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==", "dev": true, "peer": true, "dependencies": { @@ -32258,35 +31805,34 @@ } }, "node_modules/webpack": { - "version": "5.88.2", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.88.2.tgz", - "integrity": "sha512-JmcgNZ1iKj+aiR0OvTYtWQqJwq37Pf683dY9bVORwVbUrDhLhdn/PlO2sHsFHPkj7sHNQF3JwaAkp49V+Sq1tQ==", + "version": "5.96.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.96.1.tgz", + "integrity": "sha512-l2LlBSvVZGhL4ZrPwyr8+37AunkcYj5qh8o6u2/2rzoPc8gxFJkLj1WxNgooi9pnoc06jh0BjuXnamM4qlujZA==", "dev": true, "peer": true, "dependencies": { - "@types/eslint-scope": "^3.7.3", - "@types/estree": "^1.0.0", - "@webassemblyjs/ast": "^1.11.5", - "@webassemblyjs/wasm-edit": "^1.11.5", - "@webassemblyjs/wasm-parser": "^1.11.5", - "acorn": "^8.7.1", - "acorn-import-assertions": "^1.9.0", - "browserslist": "^4.14.5", + "@types/eslint-scope": "^3.7.7", + "@types/estree": "^1.0.6", + "@webassemblyjs/ast": "^1.12.1", + "@webassemblyjs/wasm-edit": "^1.12.1", + "@webassemblyjs/wasm-parser": "^1.12.1", + "acorn": "^8.14.0", + "browserslist": "^4.24.0", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.15.0", + "enhanced-resolve": "^5.17.1", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.9", + "graceful-fs": "^4.2.11", "json-parse-even-better-errors": "^2.3.1", "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", "schema-utils": "^3.2.0", "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.3.7", - "watchpack": "^2.4.0", + "terser-webpack-plugin": "^5.3.10", + "watchpack": "^2.4.1", "webpack-sources": "^3.2.3" }, "bin": { @@ -32315,10 +31861,23 @@ "node": ">=10.13.0" } }, + "node_modules/webpack/node_modules/acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true, + "peer": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/webpack/node_modules/enhanced-resolve": { - "version": "5.15.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz", - "integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", "dev": true, "peer": true, "dependencies": { @@ -32423,15 +31982,15 @@ "dev": true }, "node_modules/which-typed-array": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", - "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0" + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -32613,7 +32172,7 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", - "devOptional": true, + "dev": true, "dependencies": { "imurmurhash": "^0.1.4", "signal-exit": "^3.0.7" @@ -32910,7 +32469,7 @@ "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "devOptional": true, + "dev": true, "engines": { "node": ">=10" } @@ -32933,7 +32492,7 @@ "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "devOptional": true, + "dev": true, "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", @@ -32996,7 +32555,7 @@ "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "devOptional": true, + "dev": true, "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", @@ -33010,7 +32569,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "devOptional": true, + "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -33022,7 +32581,7 @@ "version": "21.1.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "devOptional": true, + "dev": true, "engines": { "node": ">=12" } @@ -33068,6 +32627,7 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, "engines": { "node": ">=10" }, @@ -33086,8 +32646,8 @@ "license": "BSD-3-Clause", "dependencies": { "@salesforce/salesforcedx-utils": "62.5.0", - "@vscode/debugadapter": "1.65.0", - "@vscode/debugprotocol": "1.65.0", + "@vscode/debugadapter": "1.68.0", + "@vscode/debugprotocol": "1.68.0", "async-lock": "1.0.0", "faye": "1.1.2", "request-light": "^0.7.0" @@ -33098,22 +32658,13 @@ "@types/chai": "4.3.3", "@types/jest": "^29.5.5", "@types/mocha": "^5", - "@types/node": "^18.11.9", + "@types/node": "^20.0.0", "@types/rimraf": "^3.0.2", "@types/sinon": "^2.3.7", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", - "@vscode/debugadapter-testsupport": "1.65.0", + "@vscode/debugadapter-testsupport": "1.68.0", "chai": "^4.0.2", "cross-env": "5.2.0", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest": "27.5.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", + "eslint-plugin-jest": "28.9.0", "jest": "^29.7.0", "jest-junit": "14.0.1", "mocha": "^10", @@ -33121,73 +32672,51 @@ "mocha-multi-reporters": "^1.1.7", "mock-spawn": "0.2.6", "nyc": "^15", - "prettier": "3.0.3", + "prettier": "3.3.3", "rimraf": "3.0.2", "sinon": "^13.0.1", "ts-jest": "^29.1.1", - "typescript": "^5.2.2", + "typescript": "^5.6.2", "vscode-uri": "1.0.1" }, "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" } }, - "packages/salesforcedx-apex-debugger/node_modules/@types/node": { - "version": "18.18.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.6.tgz", - "integrity": "sha512-wf3Vz+jCmOQ2HV1YUJuCWdL64adYxumkrxtc+H1VUQlnQI04+5HtH+qZCOE21lBE7gIrt+CwX2Wv8Acrw5Ak6w==", - "dev": true - }, "packages/salesforcedx-apex-replay-debugger": { "name": "@salesforce/salesforcedx-apex-replay-debugger", "version": "62.5.0", "license": "BSD-3-Clause", "dependencies": { "@salesforce/salesforcedx-utils": "62.5.0", - "@vscode/debugadapter": "1.65.0", - "@vscode/debugprotocol": "1.65.0", + "@vscode/debugadapter": "1.68.0", + "@vscode/debugprotocol": "1.68.0", "vscode-uri": "1.0.1" }, "devDependencies": { "@types/chai": "4.3.3", "@types/jest": "^29.5.5", "@types/mocha": "^5", - "@types/node": "^18.11.9", + "@types/node": "^20.0.0", "@types/sinon": "^2.3.7", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", - "@vscode/debugadapter-testsupport": "1.65.0", + "@vscode/debugadapter-testsupport": "1.68.0", "chai": "^4.0.2", "cross-env": "5.2.0", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest": "27.5.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", "jest": "^29.7.0", "mocha": "^10", "mocha-junit-reporter": "^1.23.3", "mocha-multi-reporters": "^1.1.7", "nyc": "^15", - "prettier": "3.0.3", + "prettier": "3.3.3", "request-light": "^0.7.0", "sinon": "^13.0.1", "ts-jest": "^29.1.1", - "typescript": "^5.2.2" + "typescript": "^5.6.2" }, "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" } }, - "packages/salesforcedx-apex-replay-debugger/node_modules/@types/node": { - "version": "18.18.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.6.tgz", - "integrity": "sha512-wf3Vz+jCmOQ2HV1YUJuCWdL64adYxumkrxtc+H1VUQlnQI04+5HtH+qZCOE21lBE7gIrt+CwX2Wv8Acrw5Ak6w==", - "dev": true - }, "packages/salesforcedx-sobjects-faux-generator": { "name": "@salesforce/salesforcedx-sobjects-faux-generator", "version": "62.5.0", @@ -33202,43 +32731,27 @@ "@types/chai": "4.3.3", "@types/jest": "^29.5.5", "@types/mocha": "^5", - "@types/node": "^18.11.9", + "@types/node": "^20.0.0", "@types/rimraf": "^3.0.2", "@types/shelljs": "0.7.4", "@types/sinon": "^2.3.7", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", "chai": "^4.0.2", "cross-env": "5.2.0", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest": "27.5.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", "jest": "^29.7.0", "jest-junit": "14.0.1", "mocha": "^10", "mocha-junit-reporter": "^1.23.3", "mocha-multi-reporters": "^1.1.7", - "prettier": "3.0.3", + "prettier": "3.3.3", "sinon": "^13.0.1", "ts-jest": "^29.1.1", "ts-node": "^10.9.1", - "typescript": "^5.2.2" + "typescript": "^5.6.2" }, "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" } }, - "packages/salesforcedx-sobjects-faux-generator/node_modules/@types/node": { - "version": "18.18.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.6.tgz", - "integrity": "sha512-wf3Vz+jCmOQ2HV1YUJuCWdL64adYxumkrxtc+H1VUQlnQI04+5HtH+qZCOE21lBE7gIrt+CwX2Wv8Acrw5Ak6w==", - "dev": true - }, "packages/salesforcedx-sobjects-faux-generator/node_modules/@types/shelljs": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.7.4.tgz", @@ -33261,35 +32774,25 @@ "@types/chai": "4.3.3", "@types/glob": "^7.2.0", "@types/mocha": "^2.2.38", - "@types/node": "^18.11.9", + "@types/node": "^20.0.0", "@types/shelljs": "0.7.9", "@types/sinon": "^2.3.7", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", "chai": "^4.0.2", "decache": "^4.1.0", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest": "27.5.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", "glob": "^8.0.3", "mocha": "^10", "mocha-junit-reporter": "^1.23.3", "mocha-multi-reporters": "^1.1.7", "mock-spawn": "0.2.6", "nyc": "^15.1.0", - "prettier": "3.0.3", + "prettier": "3.3.3", "request-light": "^0.7.0", "sinon": "^13.0.1", "source-map-support": "^0.4.15", - "typescript": "^5.2.2" + "typescript": "^5.6.2" }, "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" } }, "packages/salesforcedx-test-utils-vscode/node_modules/@types/mocha": { @@ -33298,12 +32801,6 @@ "integrity": "sha512-nlK/iyETgafGli8Zh9zJVCTicvU3iajSkRwOh3Hhiva598CMqNJ4NcVCGMTGKpGpTYj/9R8RLzS9NAykSSCqGw==", "dev": true }, - "packages/salesforcedx-test-utils-vscode/node_modules/@types/node": { - "version": "18.18.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.6.tgz", - "integrity": "sha512-wf3Vz+jCmOQ2HV1YUJuCWdL64adYxumkrxtc+H1VUQlnQI04+5HtH+qZCOE21lBE7gIrt+CwX2Wv8Acrw5Ak6w==", - "dev": true - }, "packages/salesforcedx-test-utils-vscode/node_modules/@types/shelljs": { "version": "0.7.9", "resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.7.9.tgz", @@ -33359,21 +32856,12 @@ }, "devDependencies": { "@types/jest": "^29.5.5", - "@types/node": "^18.11.9", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest": "27.5.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", + "@types/node": "^20.0.0", + "eslint-plugin-jest": "28.9.0", "jest": "^29.7.0", - "prettier": "3.0.3", + "prettier": "3.3.3", "ts-jest": "^29.1.1", - "typescript": "^5.2.2" + "typescript": "^5.6.2" } }, "packages/salesforcedx-utils-vscode": { @@ -33393,27 +32881,18 @@ "devDependencies": { "@types/cross-spawn": "6.0.0", "@types/jest": "^29.5.5", - "@types/node": "^18.11.9", + "@types/node": "^20.0.0", "@types/shelljs": "0.7.9", - "@types/vscode": "^1.86.0", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest": "27.5.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", + "@types/vscode": "^1.90.0", + "eslint-plugin-jest": "28.9.0", "jest": "^29.7.0", - "prettier": "3.0.3", + "prettier": "3.3.3", "shelljs": "0.8.5", "ts-jest": "^29.1.1", - "typescript": "^5.2.2" + "typescript": "^5.6.2" }, "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" } }, "packages/salesforcedx-utils-vscode/node_modules/@types/cross-spawn": { @@ -33425,12 +32904,6 @@ "@types/node": "*" } }, - "packages/salesforcedx-utils-vscode/node_modules/@types/node": { - "version": "18.18.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.6.tgz", - "integrity": "sha512-wf3Vz+jCmOQ2HV1YUJuCWdL64adYxumkrxtc+H1VUQlnQI04+5HtH+qZCOE21lBE7gIrt+CwX2Wv8Acrw5Ak6w==", - "dev": true - }, "packages/salesforcedx-utils-vscode/node_modules/@types/shelljs": { "version": "0.7.9", "resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.7.9.tgz", @@ -33476,19 +32949,13 @@ "semver": "bin/semver" } }, - "packages/salesforcedx-utils/node_modules/@types/node": { - "version": "18.18.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.6.tgz", - "integrity": "sha512-wf3Vz+jCmOQ2HV1YUJuCWdL64adYxumkrxtc+H1VUQlnQI04+5HtH+qZCOE21lBE7gIrt+CwX2Wv8Acrw5Ak6w==", - "dev": true - }, "packages/salesforcedx-visualforce-language-server": { "name": "@salesforce/salesforcedx-visualforce-language-server", "version": "62.5.0", "license": "BSD-3-Clause", "dependencies": { "@salesforce/salesforcedx-visualforce-markup-language-server": "62.5.0", - "typescript": "^5.2.2", + "typescript": "^5.6.2", "vscode-css-languageservice": "2.1.9", "vscode-languageserver": "5.2.1", "vscode-languageserver-protocol": "3.14.1", @@ -33497,29 +32964,14 @@ "vscode-uri": "1.0.1" }, "devDependencies": { - "@types/node": "^18.11.9", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", - "prettier": "3.0.3", + "@types/node": "^20.0.0", + "prettier": "3.3.3", "shx": "0.3.4" }, "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" } }, - "packages/salesforcedx-visualforce-language-server/node_modules/@types/node": { - "version": "18.18.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.6.tgz", - "integrity": "sha512-wf3Vz+jCmOQ2HV1YUJuCWdL64adYxumkrxtc+H1VUQlnQI04+5HtH+qZCOE21lBE7gIrt+CwX2Wv8Acrw5Ak6w==", - "dev": true - }, "packages/salesforcedx-visualforce-markup-language-server": { "name": "@salesforce/salesforcedx-visualforce-markup-language-server", "version": "62.5.0", @@ -33532,27 +32984,18 @@ "devDependencies": { "@types/chai": "4.3.3", "@types/mocha": "^2.2.38", - "@types/node": "^18.11.9", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", + "@types/node": "^20.0.0", "chai": "^4.0.2", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest": "27.5.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", + "eslint-plugin-jest": "28.9.0", "mocha": "^10", "mocha-junit-reporter": "^1.23.3", "mocha-multi-reporters": "^1.1.7", - "prettier": "3.0.3", + "prettier": "3.3.3", "shx": "0.3.4", - "typescript": "^5.2.2" + "typescript": "^5.6.2" }, "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" } }, "packages/salesforcedx-visualforce-markup-language-server/node_modules/@types/mocha": { @@ -33561,12 +33004,6 @@ "integrity": "sha512-nlK/iyETgafGli8Zh9zJVCTicvU3iajSkRwOh3Hhiva598CMqNJ4NcVCGMTGKpGpTYj/9R8RLzS9NAykSSCqGw==", "dev": true }, - "packages/salesforcedx-visualforce-markup-language-server/node_modules/@types/node": { - "version": "18.18.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.6.tgz", - "integrity": "sha512-wf3Vz+jCmOQ2HV1YUJuCWdL64adYxumkrxtc+H1VUQlnQI04+5HtH+qZCOE21lBE7gIrt+CwX2Wv8Acrw5Ak6w==", - "dev": true - }, "packages/salesforcedx-visualforce-markup-language-server/node_modules/vscode-languageserver-types": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.4.0.tgz", @@ -33576,7 +33013,7 @@ "version": "62.5.0", "license": "BSD-3-Clause", "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" } }, "packages/salesforcedx-vscode-apex": { @@ -33599,32 +33036,22 @@ "@salesforce/ts-sinon": "1.4.0", "@types/chai": "4.3.3", "@types/mocha": "^5", - "@types/node": "^18.11.9", + "@types/node": "^20.0.0", "@types/shelljs": "^0.7.8", "@types/sinon": "^2.3.7", - "@types/vscode": "^1.86.0", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", + "@types/vscode": "^1.90.0", "chai": "^4.0.2", "cross-env": "5.2.0", "esbuild": "^0.19.5", "esbuild-plugin-pino": "^2.1.0", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest": "27.5.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", "mocha": "^10", - "prettier": "3.0.3", + "prettier": "3.3.3", "sinon": "^13.0.1", - "typescript": "^5.2.2", + "typescript": "^5.6.2", "vscode-extension-telemetry": "0.0.17" }, "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" } }, "packages/salesforcedx-vscode-apex-debugger": { @@ -33633,36 +33060,26 @@ "dependencies": { "@salesforce/salesforcedx-apex-debugger": "62.5.0", "@salesforce/salesforcedx-utils-vscode": "62.5.0", - "@vscode/debugprotocol": "1.65.0", + "@vscode/debugprotocol": "1.68.0", "vscode-extension-telemetry": "0.0.17" }, "devDependencies": { "@salesforce/salesforcedx-test-utils-vscode": "62.5.0", "@types/chai": "4.3.3", "@types/mocha": "^5", - "@types/node": "^18.11.9", + "@types/node": "^20.0.0", "@types/sinon": "^2.3.7", - "@types/vscode": "^1.86.0", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", + "@types/vscode": "^1.90.0", "chai": "^4.0.2", "cross-env": "5.2.0", "esbuild": "^0.19.5", "esbuild-plugin-pino": "^2.1.0", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest": "27.5.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", "mocha": "^10", - "prettier": "3.0.3", + "prettier": "3.3.3", "sinon": "^13.0.1" }, "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" } }, "packages/salesforcedx-vscode-apex-debugger/node_modules/@esbuild/android-arm": { @@ -33697,12 +33114,6 @@ "node": ">=12" } }, - "packages/salesforcedx-vscode-apex-debugger/node_modules/@types/node": { - "version": "18.18.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.6.tgz", - "integrity": "sha512-wf3Vz+jCmOQ2HV1YUJuCWdL64adYxumkrxtc+H1VUQlnQI04+5HtH+qZCOE21lBE7gIrt+CwX2Wv8Acrw5Ak6w==", - "dev": true - }, "packages/salesforcedx-vscode-apex-debugger/node_modules/esbuild": { "version": "0.19.12", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", @@ -33769,29 +33180,19 @@ "@types/async-lock": "0.0.20", "@types/chai": "4.3.3", "@types/mocha": "^5", - "@types/node": "^18.11.9", + "@types/node": "^20.0.0", "@types/sinon": "^2.3.7", - "@types/vscode": "^1.86.0", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", + "@types/vscode": "^1.90.0", "chai": "^4.0.2", "cross-env": "5.2.0", "esbuild": "^0.19.5", "esbuild-plugin-pino": "^2.1.0", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest": "27.5.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", "mocha": "^10", - "prettier": "3.0.3", + "prettier": "3.3.3", "sinon": "^13.0.1" }, "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" } }, "packages/salesforcedx-vscode-apex-replay-debugger/node_modules/@esbuild/android-arm": { @@ -33826,12 +33227,6 @@ "node": ">=12" } }, - "packages/salesforcedx-vscode-apex-replay-debugger/node_modules/@types/node": { - "version": "18.18.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.6.tgz", - "integrity": "sha512-wf3Vz+jCmOQ2HV1YUJuCWdL64adYxumkrxtc+H1VUQlnQI04+5HtH+qZCOE21lBE7gIrt+CwX2Wv8Acrw5Ak6w==", - "dev": true - }, "packages/salesforcedx-vscode-apex-replay-debugger/node_modules/esbuild": { "version": "0.19.12", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", @@ -33911,12 +33306,6 @@ "node": ">=12" } }, - "packages/salesforcedx-vscode-apex/node_modules/@types/node": { - "version": "18.18.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.6.tgz", - "integrity": "sha512-wf3Vz+jCmOQ2HV1YUJuCWdL64adYxumkrxtc+H1VUQlnQI04+5HtH+qZCOE21lBE7gIrt+CwX2Wv8Acrw5Ak6w==", - "dev": true - }, "packages/salesforcedx-vscode-apex/node_modules/@types/shelljs": { "version": "0.7.9", "resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.7.9.tgz", @@ -34048,26 +33437,16 @@ "@types/glob": "^7.2.0", "@types/jest": "^29.5.5", "@types/mocha": "^5", - "@types/node": "^18.11.9", + "@types/node": "^20.0.0", "@types/proxyquire": "1.3.28", "@types/shelljs": "^0.7.8", "@types/sinon": "^2.3.7", - "@types/vscode": "^1.86.0", + "@types/vscode": "^1.90.0", "@types/yeoman-assert": "^3.1.1", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", "chai": "^4.0.2", "cross-env": "5.2.0", "esbuild": "^0.19.5", "esbuild-plugin-pino": "^2.1.0", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest": "27.5.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", "jest": "^29.7.0", "jest-junit": "14.0.1", "mocha": "^10", @@ -34075,15 +33454,15 @@ "mocha-multi-reporters": "^1.1.7", "mock-spawn": "0.2.6", "nyc": "^15", - "prettier": "3.0.3", + "prettier": "3.3.3", "proxyquire": "2.1.3", "sinon": "^13.0.1", "ts-jest": "^29.1.1", - "typescript": "^5.2.2", + "typescript": "^5.6.2", "yeoman-assert": "^3.1.1" }, "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" } }, "packages/salesforcedx-vscode-core/node_modules/@esbuild/android-arm": { @@ -34126,12 +33505,6 @@ "node": ">=18.0.0" } }, - "packages/salesforcedx-vscode-core/node_modules/@types/node": { - "version": "18.18.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.6.tgz", - "integrity": "sha512-wf3Vz+jCmOQ2HV1YUJuCWdL64adYxumkrxtc+H1VUQlnQI04+5HtH+qZCOE21lBE7gIrt+CwX2Wv8Acrw5Ak6w==", - "dev": true - }, "packages/salesforcedx-vscode-core/node_modules/@types/shelljs": { "version": "0.7.9", "resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.7.9.tgz", @@ -34153,15 +33526,6 @@ "diagnostic-channel-publishers": "0.4.4" } }, - "packages/salesforcedx-vscode-core/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "packages/salesforcedx-vscode-core/node_modules/diagnostic-channel": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/diagnostic-channel/-/diagnostic-channel-0.3.1.tgz", @@ -34244,17 +33608,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "packages/salesforcedx-vscode-core/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "packages/salesforcedx-vscode-core/node_modules/semver": { "version": "5.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", @@ -34267,7 +33620,7 @@ "version": "62.5.0", "license": "BSD-3-Clause", "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" } }, "packages/salesforcedx-vscode-lightning": { @@ -34286,34 +33639,24 @@ "@salesforce/salesforcedx-test-utils-vscode": "62.5.0", "@types/chai": "4.3.3", "@types/mocha": "^5", - "@types/node": "^18.11.9", + "@types/node": "^20.0.0", "@types/sinon": "^7.5.2", - "@types/vscode": "^1.86.0", + "@types/vscode": "^1.90.0", "@types/which": "^1.3.1", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", "chai": "^4.0.2", "cross-env": "5.2.0", "esbuild": "^0.19.5", "esbuild-plugin-pino": "^2.1.0", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest": "27.5.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", "mocha": "^10", "mocha-junit-reporter": "^1.23.3", "mocha-multi-reporters": "^1.1.7", - "prettier": "3.0.3", + "prettier": "3.3.3", "sinon": "^13.0.1", - "typescript": "^5.2.2", + "typescript": "^5.6.2", "vscode-uri": "1.0.1" }, "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" } }, "packages/salesforcedx-vscode-lightning/node_modules/@esbuild/android-arm": { @@ -34348,12 +33691,6 @@ "node": ">=12" } }, - "packages/salesforcedx-vscode-lightning/node_modules/@types/node": { - "version": "18.18.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.6.tgz", - "integrity": "sha512-wf3Vz+jCmOQ2HV1YUJuCWdL64adYxumkrxtc+H1VUQlnQI04+5HtH+qZCOE21lBE7gIrt+CwX2Wv8Acrw5Ak6w==", - "dev": true - }, "packages/salesforcedx-vscode-lightning/node_modules/@types/sinon": { "version": "7.5.2", "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-7.5.2.tgz", @@ -34459,7 +33796,6 @@ "license": "BSD-3-Clause", "dependencies": { "@salesforce/core-bundle": "8.6.1", - "@salesforce/eslint-config-lwc": "3.6.0", "@salesforce/lightning-lsp-common": "4.12.2", "@salesforce/lwc-language-server": "4.12.2", "@salesforce/salesforcedx-utils-vscode": "62.5.0", @@ -34477,39 +33813,29 @@ "@salesforce/salesforcedx-test-utils-vscode": "62.5.0", "@types/chai": "4.3.3", "@types/mocha": "^5", - "@types/node": "^18.11.9", + "@types/node": "^20.0.0", "@types/sinon": "^7.5.2", "@types/uuid": "^3.4.8", - "@types/vscode": "^1.86.0", + "@types/vscode": "^1.90.0", "@types/which": "^1.3.1", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", "chai": "^4.0.2", "cross-env": "5.2.0", "esbuild": "^0.19.5", "esbuild-plugin-pino": "^2.1.0", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest": "27.5.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", "mocha": "^10", "mocha-junit-reporter": "^1.23.3", "mocha-multi-reporters": "^1.1.7", "nyc": "^15", - "prettier": "3.0.3", + "prettier": "3.3.3", "sinon": "^13.0.1", "sinon-chai": "^3.7.0", "ts-sinon": "^1.0.25", - "typescript": "^5.2.2", + "typescript": "^5.6.2", "vscode-uri": "^1.0.8", "which": "1.3.1" }, "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" } }, "packages/salesforcedx-vscode-lwc/node_modules/@esbuild/android-arm": { @@ -34592,11 +33918,6 @@ "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" } }, - "packages/salesforcedx-vscode-lwc/node_modules/@types/node": { - "version": "18.18.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.6.tgz", - "integrity": "sha512-wf3Vz+jCmOQ2HV1YUJuCWdL64adYxumkrxtc+H1VUQlnQI04+5HtH+qZCOE21lBE7gIrt+CwX2Wv8Acrw5Ak6w==" - }, "packages/salesforcedx-vscode-lwc/node_modules/@types/sinon": { "version": "7.5.2", "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-7.5.2.tgz", @@ -35062,38 +34383,28 @@ "@types/debounce": "^1.2.0", "@types/fs-extra": "^8.1.0", "@types/mocha": "^5", - "@types/node": "^18.11.9", + "@types/node": "^20.0.0", "@types/papaparse": "^5.2.3", "@types/sinon": "7.5.2", - "@types/vscode": "^1.86.0", - "@typescript-eslint/eslint-plugin": "5.62.0", - "@typescript-eslint/parser": "5.62.0", + "@types/vscode": "^1.90.0", "applicationinsights": "1.0.7", "chai": "^4.0.2", "cross-env": "5.2.0", "debounce": "^1.2.0", "esbuild": "^0.19.5", "esbuild-plugin-pino": "^2.1.0", - "eslint": "8.23.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest": "27.5.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", "eslint-plugin-prettier": "^3.1.4", "fs-extra": "^8.1.0", "mocha": "^10", "papaparse": "^5.3.0", - "prettier": "3.0.3", + "prettier": "3.3.3", "sinon": "13.0.1", - "typescript": "^5.2.2", + "typescript": "^5.6.2", "vscode-extension-tester": "^5.0.0", "vscode-languageclient": "6.1.3" }, "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" } }, "packages/salesforcedx-vscode-soql/node_modules/@esbuild/android-arm": { @@ -35145,243 +34456,12 @@ "node": ">=18.0.0" } }, - "packages/salesforcedx-vscode-soql/node_modules/@types/node": { - "version": "18.18.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.6.tgz", - "integrity": "sha512-wf3Vz+jCmOQ2HV1YUJuCWdL64adYxumkrxtc+H1VUQlnQI04+5HtH+qZCOE21lBE7gIrt+CwX2Wv8Acrw5Ak6w==", - "dev": true - }, "packages/salesforcedx-vscode-soql/node_modules/@types/sinon": { "version": "7.5.2", "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-7.5.2.tgz", "integrity": "sha512-T+m89VdXj/eidZyejvmoP9jivXgBDdkOSBVQjU9kF349NEx10QdPNGxHeZUaj1IlJ32/ewdyXJjnJxyxJroYwg==", "dev": true }, - "packages/salesforcedx-vscode-soql/node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", - "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", - "dev": true, - "dependencies": { - "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/type-utils": "5.62.0", - "@typescript-eslint/utils": "5.62.0", - "debug": "^4.3.4", - "graphemer": "^1.4.0", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^5.0.0", - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "packages/salesforcedx-vscode-soql/node_modules/@typescript-eslint/parser": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", - "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", - "dev": true, - "dependencies": { - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", - "debug": "^4.3.4" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "packages/salesforcedx-vscode-soql/node_modules/@typescript-eslint/scope-manager": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", - "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "packages/salesforcedx-vscode-soql/node_modules/@typescript-eslint/type-utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", - "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", - "dev": true, - "dependencies": { - "@typescript-eslint/typescript-estree": "5.62.0", - "@typescript-eslint/utils": "5.62.0", - "debug": "^4.3.4", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "*" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "packages/salesforcedx-vscode-soql/node_modules/@typescript-eslint/types": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", - "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "packages/salesforcedx-vscode-soql/node_modules/@typescript-eslint/typescript-estree": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", - "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "packages/salesforcedx-vscode-soql/node_modules/@typescript-eslint/utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", - "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", - "dev": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "packages/salesforcedx-vscode-soql/node_modules/@typescript-eslint/utils/node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "packages/salesforcedx-vscode-soql/node_modules/@typescript-eslint/utils/node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "packages/salesforcedx-vscode-soql/node_modules/@typescript-eslint/visitor-keys": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", - "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "packages/salesforcedx-vscode-soql/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "packages/salesforcedx-vscode-soql/node_modules/applicationinsights": { "version": "1.8.10", "resolved": "https://registry.npmjs.org/applicationinsights/-/applicationinsights-1.8.10.tgz", @@ -35394,50 +34474,6 @@ "diagnostic-channel-publishers": "0.4.4" } }, - "packages/salesforcedx-vscode-soql/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "packages/salesforcedx-vscode-soql/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "packages/salesforcedx-vscode-soql/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "packages/salesforcedx-vscode-soql/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, "packages/salesforcedx-vscode-soql/node_modules/diagnostic-channel": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/diagnostic-channel/-/diagnostic-channel-0.3.1.tgz", @@ -35512,136 +34548,25 @@ "esbuild": "^0.17.1 || ^0.18.0 || ^0.19.0 || ^0.20.0" } }, - "packages/salesforcedx-vscode-soql/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "packages/salesforcedx-vscode-soql/node_modules/eslint": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.23.0.tgz", - "integrity": "sha512-pBG/XOn0MsJcKcTRLr27S5HpzQo4kLr+HjLQIyK4EiCsijDl/TB+h5uEuJU6bQ8Edvwz1XWOjpaP2qgnXGpTcA==", - "dev": true, - "dependencies": { - "@eslint/eslintrc": "^1.3.1", - "@humanwhocodes/config-array": "^0.10.4", - "@humanwhocodes/gitignore-to-minimatch": "^1.0.2", - "@humanwhocodes/module-importer": "^1.0.1", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.1", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.3.0", - "espree": "^9.4.0", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "find-up": "^5.0.0", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^6.0.1", - "globals": "^13.15.0", - "globby": "^11.1.0", - "grapheme-splitter": "^1.0.4", - "ignore": "^5.2.0", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "regexpp": "^3.2.0", - "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "packages/salesforcedx-vscode-soql/node_modules/eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "packages/salesforcedx-vscode-soql/node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "packages/salesforcedx-vscode-soql/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "packages/salesforcedx-vscode-soql/node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "packages/salesforcedx-vscode-soql/node_modules/eslint-plugin-prettier": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.1.tgz", + "integrity": "sha512-htg25EUYUeIhKHXjOinK4BgCcDwtLHjqaxCDsMy5nbnUMkKFvIhMVCp+5GFUXQ4Nr8lBsPqtGAqBenbpFqAA2g==", "dev": true, "dependencies": { - "is-glob": "^4.0.3" + "prettier-linter-helpers": "^1.0.0" }, "engines": { - "node": ">=10.13.0" - } - }, - "packages/salesforcedx-vscode-soql/node_modules/globals": { - "version": "13.23.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", - "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", - "dev": true, - "dependencies": { - "type-fest": "^0.20.2" + "node": ">=6.0.0" }, - "engines": { - "node": ">=8" + "peerDependencies": { + "eslint": ">=5.0.0", + "prettier": ">=1.13.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "peerDependenciesMeta": { + "eslint-config-prettier": { + "optional": true + } } }, "packages/salesforcedx-vscode-soql/node_modules/has-flag": { @@ -35653,18 +34578,6 @@ "node": ">=8" } }, - "packages/salesforcedx-vscode-soql/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "packages/salesforcedx-vscode-soql/node_modules/sinon": { "version": "13.0.1", "resolved": "https://registry.npmjs.org/sinon/-/sinon-13.0.1.tgz", @@ -35683,18 +34596,6 @@ "url": "https://opencollective.com/sinon" } }, - "packages/salesforcedx-vscode-soql/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "packages/salesforcedx-vscode-soql/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -35707,18 +34608,6 @@ "node": ">=8" } }, - "packages/salesforcedx-vscode-soql/node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "packages/salesforcedx-vscode-soql/node_modules/vscode-jsonrpc": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0.tgz", @@ -35781,36 +34670,20 @@ "@salesforce/salesforcedx-test-utils-vscode": "62.5.0", "@types/chai": "4.3.3", "@types/mocha": "^5", - "@types/node": "^18.11.9", + "@types/node": "^20.0.0", "@types/sinon": "^2.3.7", - "@types/vscode": "^1.86.0", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", + "@types/vscode": "^1.90.0", "chai": "^4.0.2", "cross-env": "5.2.0", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest": "27.5.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", "mocha": "^10", - "prettier": "3.0.3", + "prettier": "3.3.3", "sinon": "^13.0.1", - "typescript": "^5.2.2" + "typescript": "^5.6.2" }, "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" } }, - "packages/salesforcedx-vscode-visualforce/node_modules/@types/node": { - "version": "18.18.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.6.tgz", - "integrity": "sha512-wf3Vz+jCmOQ2HV1YUJuCWdL64adYxumkrxtc+H1VUQlnQI04+5HtH+qZCOE21lBE7gIrt+CwX2Wv8Acrw5Ak6w==", - "dev": true - }, "packages/salesforcedx-vscode-visualforce/node_modules/semver": { "version": "5.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", @@ -35839,43 +34712,27 @@ "@salesforce/salesforcedx-utils-vscode": "62.5.0", "@types/chai": "4.3.3", "@types/mocha": "^5", - "@types/node": "^18.11.9", + "@types/node": "^20.0.0", "@types/rimraf": "3.0.2", "@types/shelljs": "^0.7.4", - "@types/vscode": "^1.86.0", + "@types/vscode": "^1.90.0", "@types/webdriverio": "4.6.1", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", "chai": "^4.0.2", "cross-env": "5.2.0", "decache": "^4.1.0", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest": "27.5.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", "glob": "^8.0.3", "mocha": "^10", "mocha-junit-reporter": "^1.23.3", "mocha-multi-reporters": "^1.1.7", - "prettier": "3.0.3", + "prettier": "3.3.3", "rimraf": "^3.0.2", "shelljs": "0.8.5", - "typescript": "^5.2.2" + "typescript": "^5.6.2" }, "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" } }, - "packages/system-tests/node_modules/@types/node": { - "version": "18.18.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.6.tgz", - "integrity": "sha512-wf3Vz+jCmOQ2HV1YUJuCWdL64adYxumkrxtc+H1VUQlnQI04+5HtH+qZCOE21lBE7gIrt+CwX2Wv8Acrw5Ak6w==", - "dev": true - }, "packages/system-tests/node_modules/@types/shelljs": { "version": "0.7.9", "resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.7.9.tgz", diff --git a/package.json b/package.json index 579a413ba3..418cb1d095 100644 --- a/package.json +++ b/package.json @@ -6,15 +6,15 @@ "packages/*" ], "engines": { - "node": ">=18.11.0" + "node": ">=20.9.0" }, "dependencies": { - "@actions/core": "^1.10.0", + "@actions/core": "^1.11.0", "@actions/github": "^5.1.1", - "node": "^18.11.0", - "npm": "^9", - "semver": "^7.5.2", - "ts-node": "10.9.1" + "node": "^20.9.0", + "npm": "^10", + "semver": "^7.5.4", + "ts-node": "10.9.2" }, "devDependencies": { "@commitlint/cli": "^17.1.2", @@ -23,12 +23,15 @@ "@octokit/core": "4.2.4", "@octokit/webhooks-definitions": "^3.67.3", "@salesforce/dev-config": "^3.1.0", - "@tsconfig/node18": "18.2.2", + "@stylistic/eslint-plugin-ts": "2.10.1", + "@tony.ganchev/eslint-plugin-header": "3.1.2", + "@tsconfig/node20": "20.1.4", "@types/cross-spawn": "6.0.2", "@types/jest": "^29.5.5", + "@types/semver": "7.5.8", "@types/shelljs": "0.8.11", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", + "@typescript-eslint/eslint-plugin": "8.13.0", + "@typescript-eslint/parser": "8.13.0", "@vscode/test-electron": "2.3.0", "@vscode/vsce": "2.21.1", "acorn": "8.8.2", @@ -38,13 +41,13 @@ "cz-conventional-changelog": "3.3.0", "depcheck": "1.4.3", "esbuild": "0.15.10", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", + "eslint": "9.13.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-import": "2.31.0", "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", + "eslint-plugin-jsdoc": "50.4.3", "eslint-plugin-prefer-arrow": "1.2.3", + "eslint-plugin-prettier": "5.2.1", "husky": "1.3.1", "jest": "^29.7.0", "jest-junit": "14.0.1", @@ -55,14 +58,14 @@ "ncp": "^2.0.0", "nyc": "15.1.0", "ovsx": "0.8.0", - "prettier": "3.0.3", + "prettier": "3.3.3", "shelljs": "0.8.5", "shx": "0.3.4", "snyk": "^1.1017.0", "ts-jest": "^29.1.1", "ts-loader": "^9.3.0", - "ts-node": "10.9.1", - "typescript": "^5.2.2" + "ts-node": "10.9.2", + "typescript": "^5.6.2" }, "scripts": { "postinstall": "npm run bootstrap && npm run reformat && npm run check:peer-deps && npm run check:typescript-project-references", diff --git a/packages/salesforcedx-apex-debugger/.eslintrc.json b/packages/salesforcedx-apex-debugger/.eslintrc.json deleted file mode 100644 index a8b986b195..0000000000 --- a/packages/salesforcedx-apex-debugger/.eslintrc.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "root": true, - "extends": ["../../config/base-eslintrc.json", "./fix-these-rules.json"], - "overrides": [ - { - "files": ["./src/**/*.ts", "./test/**/*.ts"], - "parserOptions": { - "project": "./tsconfig.json" - } - } - ] -} diff --git a/packages/salesforcedx-apex-debugger/fix-these-rules.json b/packages/salesforcedx-apex-debugger/fix-these-rules.json deleted file mode 100644 index 3077701020..0000000000 --- a/packages/salesforcedx-apex-debugger/fix-these-rules.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "rules": { - "prefer-arrow/prefer-arrow-functions": ["error", {}], - "@typescript-eslint/no-floating-promises": "warn", - "@typescript-eslint/no-unsafe-argument": "warn", - "@typescript-eslint/no-unsafe-assignment": "warn", - "@typescript-eslint/no-unsafe-call": "warn", - "@typescript-eslint/no-unsafe-member-access": "warn", - "@typescript-eslint/require-await": "warn", - "@typescript-eslint/restrict-template-expressions": "warn", - "@typescript-eslint/unbound-method": "warn", - "@typescript-eslint/no-unsafe-return": "warn" - } -} diff --git a/packages/salesforcedx-apex-debugger/package.json b/packages/salesforcedx-apex-debugger/package.json index bab269f8d8..86922bab1e 100644 --- a/packages/salesforcedx-apex-debugger/package.json +++ b/packages/salesforcedx-apex-debugger/package.json @@ -6,15 +6,15 @@ "publisher": "salesforce", "license": "BSD-3-Clause", "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" }, "categories": [ "Debuggers" ], "dependencies": { "@salesforce/salesforcedx-utils": "62.5.0", - "@vscode/debugadapter": "1.65.0", - "@vscode/debugprotocol": "1.65.0", + "@vscode/debugadapter": "1.68.0", + "@vscode/debugprotocol": "1.68.0", "async-lock": "1.0.0", "faye": "1.1.2", "request-light": "^0.7.0" @@ -25,22 +25,13 @@ "@types/chai": "4.3.3", "@types/jest": "^29.5.5", "@types/mocha": "^5", - "@types/node": "^18.11.9", + "@types/node": "^20.0.0", "@types/rimraf": "^3.0.2", "@types/sinon": "^2.3.7", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", - "@vscode/debugadapter-testsupport": "1.65.0", + "@vscode/debugadapter-testsupport": "1.68.0", "chai": "^4.0.2", "cross-env": "5.2.0", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest": "27.5.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", + "eslint-plugin-jest": "28.9.0", "jest": "^29.7.0", "jest-junit": "14.0.1", "mocha": "^10", @@ -48,11 +39,11 @@ "mocha-multi-reporters": "^1.1.7", "mock-spawn": "0.2.6", "nyc": "^15", - "prettier": "3.0.3", + "prettier": "3.3.3", "rimraf": "3.0.2", "sinon": "^13.0.1", "ts-jest": "^29.1.1", - "typescript": "^5.2.2", + "typescript": "^5.6.2", "vscode-uri": "1.0.1" }, "scripts": { diff --git a/packages/salesforcedx-apex-debugger/src/adapter/apexDebug.ts b/packages/salesforcedx-apex-debugger/src/adapter/apexDebug.ts index d4f40fc556..b3ee7d430f 100644 --- a/packages/salesforcedx-apex-debugger/src/adapter/apexDebug.ts +++ b/packages/salesforcedx-apex-debugger/src/adapter/apexDebug.ts @@ -35,10 +35,7 @@ import { DebugProtocol } from '@vscode/debugprotocol'; import * as os from 'os'; import { basename } from 'path'; import { ExceptionBreakpointInfo } from '../breakpoints/exceptionBreakpoint'; -import { - LineBreakpointInfo, - LineBreakpointsInTyperef -} from '../breakpoints/lineBreakpoint'; +import { LineBreakpointInfo, LineBreakpointsInTyperef } from '../breakpoints/lineBreakpoint'; import { DebuggerResponse, FrameCommand, @@ -78,11 +75,7 @@ import { StreamingClientInfoBuilder, StreamingService } from '../core'; -import { - VscodeDebuggerMessage, - VscodeDebuggerMessageType, - WorkspaceSettings -} from '../index'; +import { VscodeDebuggerMessage, VscodeDebuggerMessageType, WorkspaceSettings } from '../index'; import { nls } from '../messages'; // Below import has to be required for bundling @@ -98,13 +91,7 @@ const TRACE_CATEGORY_STREAMINGAPI = 'streaming'; const CONNECT_TYPE_ISV_DEBUGGER = 'ISV_DEBUGGER'; -export type TraceCategory = - | 'all' - | 'variables' - | 'launch' - | 'protocol' - | 'breakpoints' - | 'streaming'; +export type TraceCategory = 'all' | 'variables' | 'launch' | 'protocol' | 'breakpoints' | 'streaming'; export type LaunchRequestArguments = DebugProtocol.LaunchRequestArguments & { // comma separated list of trace selectors (see TraceCategory) @@ -151,18 +138,8 @@ export class ApexVariable extends Variable { private readonly slot: number; private readonly kind: ApexVariableKind; - constructor( - value: Value, - kind: ApexVariableKind, - variableReference?: number, - numOfChildren?: number - ) { - super( - value.name, - ApexVariable.valueAsString(value), - variableReference, - numOfChildren - ); + constructor(value: Value, kind: ApexVariableKind, variableReference?: number, numOfChildren?: number) { + super(value.name, ApexVariable.valueAsString(value), variableReference, numOfChildren); this.declaredTypeRef = value.declaredTypeRef; this.kind = kind; this.type = value.nameForMessages; @@ -232,9 +209,7 @@ export class ApexVariable extends Variable { } private static isLocalOrField(v1: ApexVariable) { - return ( - v1.kind === ApexVariableKind.Local || v1.kind === ApexVariableKind.Field - ); + return v1.kind === ApexVariableKind.Local || v1.kind === ApexVariableKind.Field; } private static isString(value: Value) { @@ -245,12 +220,7 @@ export class ApexVariable extends Variable { export type FilterType = 'named' | 'indexed' | 'all'; export type VariableContainer = { - expand( - session: ApexDebug, - filter: FilterType, - start?: number, - count?: number - ): Promise; + expand(session: ApexDebug, filter: FilterType, start?: number, count?: number): Promise; getNumberOfChildren(): number | undefined; }; @@ -266,19 +236,8 @@ export class ScopeContainer implements VariableContainer { this.frameInfo = frameInfo; } - /* eslint-disable @typescript-eslint/no-unused-vars */ - public async expand( - session: ApexDebug, - filter: FilterType, - start?: number, - count?: number - /* eslint-enable @typescript-eslint/no-unused-vars */ - ): Promise { - if ( - !this.frameInfo.locals && - !this.frameInfo.statics && - !this.frameInfo.globals - ) { + public async expand(session: ApexDebug, filter: FilterType, start?: number, count?: number): Promise { + if (!this.frameInfo.locals && !this.frameInfo.statics && !this.frameInfo.globals) { await session.fetchFrameVariables(this.frameInfo); } @@ -303,17 +262,8 @@ export class ScopeContainer implements VariableContainer { return Promise.all( values.map(async value => { - const variableReference = - await session.resolveApexIdToVariableReference( - this.frameInfo.requestId, - value.ref - ); - return new ApexVariable( - value, - variableKind, - variableReference, - session.getNumberOfChildren(variableReference) - ); + const variableReference = await session.resolveApexIdToVariableReference(this.frameInfo.requestId, value.ref); + return new ApexVariable(value, variableKind, variableReference, session.getNumberOfChildren(variableReference)); }) ); } @@ -334,14 +284,7 @@ export class ObjectReferenceContainer implements VariableContainer { this.size = reference.size; } - /* eslint-disable @typescript-eslint/no-unused-vars */ - public async expand( - session: ApexDebug, - filter: FilterType, - start?: number, - count?: number - /* eslint-enable @typescript-eslint/no-unused-vars */ - ): Promise { + public async expand(session: ApexDebug, filter: FilterType, start?: number, count?: number): Promise { if (!this.reference.fields) { // this object is empty return []; @@ -349,11 +292,7 @@ export class ObjectReferenceContainer implements VariableContainer { return Promise.all( this.reference.fields.map(async value => { - const variableReference = - await session.resolveApexIdToVariableReference( - this.requestId, - value.ref - ); + const variableReference = await session.resolveApexIdToVariableReference(this.requestId, value.ref); return new ApexVariable( value, ApexVariableKind.Field, @@ -370,12 +309,7 @@ export class ObjectReferenceContainer implements VariableContainer { } export class CollectionReferenceContainer extends ObjectReferenceContainer { - public async expand( - session: ApexDebug, - filter: FilterType, - start?: number, - count?: number - ): Promise { + public async expand(session: ApexDebug, filter: FilterType, start?: number, count?: number): Promise { if (!this.reference.value) { // this object is empty return []; @@ -387,11 +321,7 @@ export class CollectionReferenceContainer extends ObjectReferenceContainer { count = this.reference.value.length; } const apexVariables: ApexVariable[] = []; - for ( - let i = start; - i < start + count && i < this.reference.value.length; - i++ - ) { + for (let i = start; i < start + count && i < this.reference.value.length; i++) { const variableReference = await session.resolveApexIdToVariableReference( this.requestId, this.reference.value[i].ref @@ -412,19 +342,11 @@ export class CollectionReferenceContainer extends ObjectReferenceContainer { export class MapReferenceContainer extends ObjectReferenceContainer { public readonly tupleContainers: Map = new Map(); - public addTupleContainer( - reference: number, - tupleContainer: MapTupleContainer - ): void { + public addTupleContainer(reference: number, tupleContainer: MapTupleContainer): void { this.tupleContainers.set(reference, tupleContainer); } - public async expand( - session: ApexDebug, - filter: FilterType, - start?: number, - count?: number - ): Promise { + public async expand(session: ApexDebug, filter: FilterType, start?: number, count?: number): Promise { if (start === undefined) { start = 0; } @@ -472,14 +394,7 @@ export class MapTupleContainer implements VariableContainer { return ApexVariable.valueAsString(this.tuple.value); } - /* eslint-disable @typescript-eslint/no-unused-vars */ - public async expand( - session: ApexDebug, - filter: FilterType, - start?: number, - count?: number - /* eslint-enable @typescript-eslint/no-unused-vars */ - ): Promise { + public async expand(session: ApexDebug, filter: FilterType, start?: number, count?: number): Promise { if (!this.tuple.key && !this.tuple.value) { // this object is empty return []; @@ -497,10 +412,7 @@ export class MapTupleContainer implements VariableContainer { const variables = []; if (this.tuple.key) { const keyVariableReference = this.tuple.key.ref - ? await session.resolveApexIdToVariableReference( - this.requestId, - this.tuple.key.ref - ) + ? await session.resolveApexIdToVariableReference(this.requestId, this.tuple.key.ref) : undefined; variables.push( new ApexVariable( @@ -513,10 +425,7 @@ export class MapTupleContainer implements VariableContainer { } if (this.tuple.value) { const valueVariableReference = this.tuple.value.ref - ? await session.resolveApexIdToVariableReference( - this.requestId, - this.tuple.value.ref - ) + ? await session.resolveApexIdToVariableReference(this.requestId, this.tuple.value.ref) : undefined; variables.push( new ApexVariable( @@ -567,11 +476,9 @@ export class ApexDebug extends LoggingDebugSession { this.threadId = 1; } - /* eslint-disable @typescript-eslint/no-unused-vars */ protected initializeRequest( response: DebugProtocol.InitializeResponse, args: DebugProtocol.InitializeRequestArguments - /* eslint-enable @typescript-eslint/no-unused-vars */ ): void { this.initializedResponse = response; this.initializedResponse.body = { @@ -593,12 +500,7 @@ export class ApexDebug extends LoggingDebugSession { this.sendResponse(this.initializedResponse); } - /* eslint-disable @typescript-eslint/no-unused-vars */ - protected attachRequest( - response: DebugProtocol.AttachResponse, - args: DebugProtocol.AttachRequestArguments - /* eslint-enable @typescript-eslint/no-unused-vars */ - ): void { + protected attachRequest(response: DebugProtocol.AttachResponse, args: DebugProtocol.AttachRequestArguments): void { response.success = false; this.sendResponse(response); } @@ -634,9 +536,7 @@ export class ApexDebug extends LoggingDebugSession { ); }, DEFAULT_IDLE_WARN3_MS), setTimeout(() => { - this.warnToDebugConsole( - nls.localize('idle_terminated_text', DEFAULT_IDLE_TIMEOUT_MS / 60000) - ); + this.warnToDebugConsole(nls.localize('idle_terminated_text', DEFAULT_IDLE_TIMEOUT_MS / 60000)); this.sendEvent(new TerminatedEvent()); }, DEFAULT_IDLE_TIMEOUT_MS) ); @@ -656,19 +556,13 @@ export class ApexDebug extends LoggingDebugSession { return this.idleTimers; } - protected async launchRequest( - response: DebugProtocol.LaunchResponse, - args: LaunchRequestArguments - ): Promise { + protected async launchRequest(response: DebugProtocol.LaunchResponse, args: LaunchRequestArguments): Promise { response.success = false; this.initBreakpointSessionServices(args); this.setValidBreakpointLines(args); this.setupLogger(args); this.salesforceProject = args.salesforceProject; - this.log( - TRACE_CATEGORY_LAUNCH, - `launchRequest: salesforceProject=${args.salesforceProject}` - ); + this.log(TRACE_CATEGORY_LAUNCH, `launchRequest: salesforceProject=${args.salesforceProject}`); this.sendEvent( new Event(SEND_METRIC_EVENT, { subject: `launchRequest: salesforceProject=${args.salesforceProject}`, @@ -688,10 +582,7 @@ export class ApexDebug extends LoggingDebugSession { ); const isvDebuggerSid = config.get(SF_CONFIG_ISV_DEBUGGER_SID); const isvDebuggerUrl = config.get(SF_CONFIG_ISV_DEBUGGER_URL); - if ( - typeof isvDebuggerSid === 'undefined' || - typeof isvDebuggerUrl === 'undefined' - ) { + if (typeof isvDebuggerSid === 'undefined' || typeof isvDebuggerUrl === 'undefined') { response.message = nls.localize('invalid_isv_project_config'); // telemetry for the case where the org-isv-debugger-sid and/or org-isv-debugger-url config variable is not set this.sendEvent( @@ -705,16 +596,12 @@ export class ApexDebug extends LoggingDebugSession { this.myRequestService.instanceUrl = isvDebuggerUrl; this.myRequestService.accessToken = isvDebuggerSid; } else { - const orgInfo = await new OrgDisplay().getOrgInfo( - args.salesforceProject - ); + const orgInfo = await new OrgDisplay().getOrgInfo(args.salesforceProject); this.myRequestService.instanceUrl = orgInfo.instanceUrl; this.myRequestService.accessToken = orgInfo.accessToken; } - const isStreamingConnected = await this.connectStreaming( - args.salesforceProject - ); + const isStreamingConnected = await this.connectStreaming(args.salesforceProject); if (!isStreamingConnected) { return this.sendResponse(response); } @@ -727,9 +614,7 @@ export class ApexDebug extends LoggingDebugSession { .start(); if (this.mySessionService.isConnected()) { response.success = true; - this.printToDebugConsole( - nls.localize('session_started_text', sessionId) - ); + this.printToDebugConsole(nls.localize('session_started_text', sessionId)); // telemetry for the case where the ISV debugger started successfully if (args.connectType === CONNECT_TYPE_ISV_DEBUGGER) { this.sendEvent( @@ -743,9 +628,7 @@ 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' }) ); @@ -753,9 +636,7 @@ export class ApexDebug extends LoggingDebugSession { this.sendEvent(new InitializedEvent()); this.resetIdleTimer(); } else { - this.errorToDebugConsole( - `${nls.localize('command_error_help_text')}:${os.EOL}${sessionId}` - ); + this.errorToDebugConsole(`${nls.localize('command_error_help_text')}:${os.EOL}${sessionId}`); } } catch (error) { this.tryToParseSfError(response, error); @@ -763,18 +644,13 @@ 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'), @@ -801,8 +677,7 @@ export class ApexDebug extends LoggingDebugSession { this.myRequestService.proxyUrl = workspaceSettings.proxyUrl; this.myRequestService.proxyStrictSSL = workspaceSettings.proxyStrictSSL; this.myRequestService.proxyAuthorization = workspaceSettings.proxyAuth; - this.myRequestService.connectionTimeoutMs = - workspaceSettings.connectionTimeoutMs; + this.myRequestService.connectionTimeoutMs = workspaceSettings.connectionTimeoutMs; } // initialize services @@ -814,8 +689,7 @@ export class ApexDebug extends LoggingDebugSession { if (args && args.lineBreakpointInfo) { const lineBpInfo: LineBreakpointInfo[] = args.lineBreakpointInfo; if (lineBpInfo && lineBpInfo.length > 0) { - const lineNumberMapping: Map = - new Map(); + const lineNumberMapping: Map = new Map(); const typerefMapping: Map = new Map(); for (const info of lineBpInfo) { if (!lineNumberMapping.has(info.uri)) { @@ -828,10 +702,7 @@ export class ApexDebug extends LoggingDebugSession { lineNumberMapping.get(info.uri)!.push(validLines); typerefMapping.set(info.typeref, info.uri); } - this.myBreakpointService.setValidLines( - lineNumberMapping, - typerefMapping - ); + this.myBreakpointService.setValidLines(lineNumberMapping, typerefMapping); } } } @@ -854,7 +725,7 @@ export class ApexDebug extends LoggingDebugSession { protected async disconnectRequest( response: DebugProtocol.DisconnectResponse, - // eslint-disable-next-line @typescript-eslint/no-unused-vars + args: DebugProtocol.DisconnectArguments ): Promise { try { @@ -865,15 +736,9 @@ export class ApexDebug extends LoggingDebugSession { const terminatedSessionId = await this.mySessionService.stop(); if (!this.mySessionService.isConnected()) { response.success = true; - this.printToDebugConsole( - nls.localize('session_terminated_text', terminatedSessionId) - ); + this.printToDebugConsole(nls.localize('session_terminated_text', terminatedSessionId)); } else { - this.errorToDebugConsole( - `${nls.localize('command_error_help_text')}:${ - os.EOL - }${terminatedSessionId}` - ); + this.errorToDebugConsole(`${nls.localize('command_error_help_text')}:${os.EOL}${terminatedSessionId}`); } } catch (error) { this.tryToParseSfError(response, error); @@ -897,23 +762,16 @@ export class ApexDebug extends LoggingDebugSession { const unverifiedBreakpoints: number[] = []; let verifiedBreakpoints: Set = new Set(); try { - verifiedBreakpoints = await this.lock.acquire( - `breakpoint-${uri}`, - async () => { - this.log( - TRACE_CATEGORY_BREAKPOINTS, - `setBreakPointsRequest: uri=${uri}` - ); - const knownBps = - await this.myBreakpointService.reconcileLineBreakpoints( - this.salesforceProject, - uri, - this.mySessionService.getSessionId(), - args.lines!.map(line => this.convertClientLineToDebugger(line)) - ); - return Promise.resolve(knownBps); - } - ); + verifiedBreakpoints = await this.lock.acquire(`breakpoint-${uri}`, async () => { + this.log(TRACE_CATEGORY_BREAKPOINTS, `setBreakPointsRequest: uri=${uri}`); + const knownBps = await this.myBreakpointService.reconcileLineBreakpoints( + this.salesforceProject, + uri, + this.mySessionService.getSessionId(), + args.lines!.map(line => this.convertClientLineToDebugger(line)) + ); + return Promise.resolve(knownBps); + }); // tslint:disable-next-line:no-empty } catch (error) {} verifiedBreakpoints.forEach(verifiedBreakpoint => { @@ -937,11 +795,9 @@ export class ApexDebug extends LoggingDebugSession { }); this.log( TRACE_CATEGORY_BREAKPOINTS, - `setBreakPointsRequest: uri=${uri} args.lines=${args.lines.join( - ',' - )} verified=${Array.from(verifiedBreakpoints).join( - ',' - )} unverified=${unverifiedBreakpoints.join(',')}` + `setBreakPointsRequest: uri=${uri} args.lines=${args.lines.join(',')} verified=${Array.from( + verifiedBreakpoints + ).join(',')} unverified=${unverifiedBreakpoints.join(',')}` ); } response.success = true; @@ -967,10 +823,7 @@ export class ApexDebug extends LoggingDebugSession { this.sendResponse(response); } - protected async nextRequest( - response: DebugProtocol.NextResponse, - args: DebugProtocol.NextArguments - ): Promise { + protected async nextRequest(response: DebugProtocol.NextResponse, args: DebugProtocol.NextArguments): Promise { response.success = false; if (this.requestThreads.has(args.threadId)) { const requestId = this.requestThreads.get(args.threadId)!; @@ -1021,9 +874,7 @@ export class ApexDebug extends LoggingDebugSession { protected threadsRequest(response: DebugProtocol.ThreadsResponse): void { const debuggedThreads: Thread[] = []; for (const threadId of this.requestThreads.keys()) { - debuggedThreads.push( - new Thread(threadId, `Request ID: ${this.requestThreads.get(threadId)}`) - ); + debuggedThreads.push(new Thread(threadId, `Request ID: ${this.requestThreads.get(threadId)}`)); } response.success = true; response.body = { threads: debuggedThreads }; @@ -1046,9 +897,7 @@ export class ApexDebug extends LoggingDebugSession { TRACE_CATEGORY_VARIABLES, `stackTraceRequest: args threadId=${args.threadId} startFrame=${args.startFrame} levels=${args.levels}` ); - const responseString = await this.myRequestService.execute( - new StateCommand(requestId) - ); + const responseString = await this.myRequestService.execute(new StateCommand(requestId)); return Promise.resolve(responseString); }); const stateRespObj: DebuggerResponse = JSON.parse(stateResponse); @@ -1056,58 +905,35 @@ export class ApexDebug extends LoggingDebugSession { if (this.hasStackFrames(stateRespObj)) { const serverFrames = stateRespObj.stateResponse.state.stack.stackFrame; for (let i = 0; i < serverFrames.length; i++) { - const sourcePath = this.myBreakpointService.getSourcePathFromTyperef( - serverFrames[i].typeRef - ); - const frameInfo = new ApexDebugStackFrameInfo( - requestId, - serverFrames[i].frameNumber - ); + const sourcePath = this.myBreakpointService.getSourcePathFromTyperef(serverFrames[i].typeRef); + const frameInfo = new ApexDebugStackFrameInfo(requestId, serverFrames[i].frameNumber); const frameId = this.stackFrameInfos.create(frameInfo); if (i === 0 && stateRespObj.stateResponse.state) { // populate first stack frame with info from state response (saves a server round trip) this.log( TRACE_CATEGORY_VARIABLES, - 'stackTraceRequest: state=' + - JSON.stringify(stateRespObj.stateResponse.state) + 'stackTraceRequest: state=' + JSON.stringify(stateRespObj.stateResponse.state) ); - if ( - stateRespObj.stateResponse.state.locals && - stateRespObj.stateResponse.state.locals.local - ) { + if (stateRespObj.stateResponse.state.locals && stateRespObj.stateResponse.state.locals.local) { frameInfo.locals = stateRespObj.stateResponse.state.locals.local; } else { frameInfo.locals = []; } - if ( - stateRespObj.stateResponse.state.statics && - stateRespObj.stateResponse.state.statics.static - ) { - frameInfo.statics = - stateRespObj.stateResponse.state.statics.static; + if (stateRespObj.stateResponse.state.statics && stateRespObj.stateResponse.state.statics.static) { + frameInfo.statics = stateRespObj.stateResponse.state.statics.static; } else { frameInfo.statics = []; } - if ( - stateRespObj.stateResponse.state.globals && - stateRespObj.stateResponse.state.globals.global - ) { - frameInfo.globals = - stateRespObj.stateResponse.state.globals.global; + if (stateRespObj.stateResponse.state.globals && stateRespObj.stateResponse.state.globals.global) { + frameInfo.globals = stateRespObj.stateResponse.state.globals.global; } else { frameInfo.globals = []; } - if ( - stateRespObj.stateResponse.state.references && - stateRespObj.stateResponse.state.references.references - ) { - this.populateReferences( - stateRespObj.stateResponse.state.references.references, - frameInfo.requestId - ); + if (stateRespObj.stateResponse.state.references && stateRespObj.stateResponse.state.references.references) { + this.populateReferences(stateRespObj.stateResponse.state.references.references, frameInfo.requestId); } } @@ -1115,12 +941,7 @@ export class ApexDebug extends LoggingDebugSession { new StackFrame( frameId, serverFrames[i].fullName, - sourcePath - ? new Source( - basename(sourcePath), - this.convertDebuggerPathToClient(sourcePath) - ) - : undefined, + sourcePath ? new Source(basename(sourcePath), this.convertDebuggerPathToClient(sourcePath)) : undefined, this.convertDebuggerLineToClient(serverFrames[i].lineNumber), 0 ) @@ -1149,18 +970,13 @@ export class ApexDebug extends LoggingDebugSession { return false; } - protected async customRequest( - command: string, - response: DebugProtocol.Response, - args: any - ): Promise { + protected async customRequest(command: string, response: DebugProtocol.Response, args: any): Promise { response.success = true; switch (command) { case HOTSWAP_REQUEST: this.warnToDebugConsole(nls.localize('hotswap_warn_text')); break; case EXCEPTION_BREAKPOINT_REQUEST: - // eslint-disable-next-line no-case-declarations const requestArgs: SetExceptionBreakpointsArguments = args; if (requestArgs && requestArgs.exceptionInfo) { try { @@ -1171,41 +987,24 @@ export class ApexDebug extends LoggingDebugSession { requestArgs.exceptionInfo ); }); - if ( - requestArgs.exceptionInfo.breakMode === - EXCEPTION_BREAKPOINT_BREAK_MODE_ALWAYS - ) { + if (requestArgs.exceptionInfo.breakMode === EXCEPTION_BREAKPOINT_BREAK_MODE_ALWAYS) { this.printToDebugConsole( - nls.localize( - 'created_exception_breakpoint_text', - requestArgs.exceptionInfo.label - ) + nls.localize('created_exception_breakpoint_text', requestArgs.exceptionInfo.label) ); - } else if ( - requestArgs.exceptionInfo.breakMode === - EXCEPTION_BREAKPOINT_BREAK_MODE_NEVER - ) { + } else if (requestArgs.exceptionInfo.breakMode === EXCEPTION_BREAKPOINT_BREAK_MODE_NEVER) { this.printToDebugConsole( - nls.localize( - 'removed_exception_breakpoint_text', - requestArgs.exceptionInfo.label - ) + nls.localize('removed_exception_breakpoint_text', requestArgs.exceptionInfo.label) ); } } catch (error) { response.success = false; - this.log( - TRACE_CATEGORY_BREAKPOINTS, - `exceptionBreakpointRequest: error=${error}` - ); + this.log(TRACE_CATEGORY_BREAKPOINTS, `exceptionBreakpointRequest: error=${error}`); } } break; case LIST_EXCEPTION_BREAKPOINTS_REQUEST: response.body = { - typerefs: Array.from( - this.myBreakpointService.getExceptionBreakpointCache().keys() - ) + typerefs: Array.from(this.myBreakpointService.getExceptionBreakpointCache().keys()) }; break; default: @@ -1221,37 +1020,16 @@ export class ApexDebug extends LoggingDebugSession { response.success = true; const frameInfo = this.stackFrameInfos.get(args.frameId); if (!frameInfo) { - this.log( - TRACE_CATEGORY_VARIABLES, - `scopesRequest: no frame info found for stack frame ${args.frameId}` - ); + this.log(TRACE_CATEGORY_VARIABLES, `scopesRequest: no frame info found for stack frame ${args.frameId}`); response.body = { scopes: [] }; this.sendResponse(response); return; } const scopes = new Array(); - scopes.push( - new Scope( - 'Local', - this.variableHandles.create(new ScopeContainer('local', frameInfo)), - false - ) - ); - scopes.push( - new Scope( - 'Static', - this.variableHandles.create(new ScopeContainer('static', frameInfo)), - false - ) - ); - scopes.push( - new Scope( - 'Global', - this.variableHandles.create(new ScopeContainer('global', frameInfo)), - false - ) - ); + scopes.push(new Scope('Local', this.variableHandles.create(new ScopeContainer('local', frameInfo)), false)); + scopes.push(new Scope('Static', this.variableHandles.create(new ScopeContainer('static', frameInfo)), false)); + scopes.push(new Scope('Global', this.variableHandles.create(new ScopeContainer('global', frameInfo)), false)); scopes.forEach(scope => { this.log( TRACE_CATEGORY_VARIABLES, @@ -1268,9 +1046,7 @@ export class ApexDebug extends LoggingDebugSession { args: DebugProtocol.VariablesArguments ): Promise { response.success = true; - const variablesContainer = this.variableHandles.get( - args.variablesReference - ); + const variablesContainer = this.variableHandles.get(args.variablesReference); if (!variablesContainer) { this.log( TRACE_CATEGORY_VARIABLES, @@ -1287,109 +1063,69 @@ export class ApexDebug extends LoggingDebugSession { ); } - const filter: FilterType = - args.filter === 'indexed' || args.filter === 'named' - ? args.filter - : 'all'; + const filter: FilterType = args.filter === 'indexed' || args.filter === 'named' ? args.filter : 'all'; try { - const variables = await variablesContainer.expand( - this, - filter, - args.start, - args.count - ); + const variables = await variablesContainer.expand(this, filter, args.start, args.count); variables.sort(ApexVariable.compareVariables); response.body = { variables }; this.resetIdleTimer(); this.sendResponse(response); } catch (error) { - this.log( - TRACE_CATEGORY_VARIABLES, - `variablesRequest: error reading variables ${error} ${error.stack}` - ); + this.log(TRACE_CATEGORY_VARIABLES, `variablesRequest: error reading variables ${error} ${error.stack}`); // in case of error return empty variables array response.body = { variables: [] }; this.sendResponse(response); } } - public async fetchFrameVariables( - frameInfo: ApexDebugStackFrameInfo - ): Promise { + public async fetchFrameVariables(frameInfo: ApexDebugStackFrameInfo): Promise { const frameResponse = await this.myRequestService.execute( new FrameCommand(frameInfo.requestId, frameInfo.frameNumber) ); const frameRespObj: DebuggerResponse = JSON.parse(frameResponse); - if ( - frameRespObj && - frameRespObj.frameResponse && - frameRespObj.frameResponse.frame - ) { + if (frameRespObj && frameRespObj.frameResponse && frameRespObj.frameResponse.frame) { this.log( TRACE_CATEGORY_VARIABLES, - `fetchFrameVariables: frame ${frameInfo.frameNumber} frame=` + - JSON.stringify(frameRespObj.frameResponse.frame) + `fetchFrameVariables: frame ${frameInfo.frameNumber} frame=` + JSON.stringify(frameRespObj.frameResponse.frame) ); - if ( - frameRespObj.frameResponse.frame.locals && - frameRespObj.frameResponse.frame.locals.local - ) { + if (frameRespObj.frameResponse.frame.locals && frameRespObj.frameResponse.frame.locals.local) { frameInfo.locals = frameRespObj.frameResponse.frame.locals.local; } else { frameInfo.locals = []; } - if ( - frameRespObj.frameResponse.frame.statics && - frameRespObj.frameResponse.frame.statics.static - ) { + if (frameRespObj.frameResponse.frame.statics && frameRespObj.frameResponse.frame.statics.static) { frameInfo.statics = frameRespObj.frameResponse.frame.statics.static; } else { frameInfo.statics = []; } - if ( - frameRespObj.frameResponse.frame.globals && - frameRespObj.frameResponse.frame.globals.global - ) { + if (frameRespObj.frameResponse.frame.globals && frameRespObj.frameResponse.frame.globals.global) { frameInfo.globals = frameRespObj.frameResponse.frame.globals.global; } else { frameInfo.globals = []; } - if ( - frameRespObj.frameResponse.frame.references && - frameRespObj.frameResponse.frame.references.references - ) { - this.populateReferences( - frameRespObj.frameResponse.frame.references.references, - frameInfo.requestId - ); + if (frameRespObj.frameResponse.frame.references && frameRespObj.frameResponse.frame.references.references) { + this.populateReferences(frameRespObj.frameResponse.frame.references.references, frameInfo.requestId); } } } - protected populateReferences( - references: Reference[], - requestId: string - ): void { + protected populateReferences(references: Reference[], requestId: string): void { references.map(reference => { if (this.variableContainerReferenceByApexId.has(reference.id)) { return; } let variableReference: number; if (reference.type === 'object') { - variableReference = this.variableHandles.create( - new ObjectReferenceContainer(reference, requestId) - ); + variableReference = this.variableHandles.create(new ObjectReferenceContainer(reference, requestId)); this.log( TRACE_CATEGORY_VARIABLES, `populateReferences: new object reference: ${variableReference} for ${reference.id} ${reference.nameForMessages}` ); } else if (reference.type === 'list' || reference.type === 'set') { - variableReference = this.variableHandles.create( - new CollectionReferenceContainer(reference, requestId) - ); + variableReference = this.variableHandles.create(new CollectionReferenceContainer(reference, requestId)); this.log( TRACE_CATEGORY_VARIABLES, `populateReferences: new ${reference.type} reference: ${variableReference} for ${reference.id} ${reference.nameForMessages} with size ${reference.size}` @@ -1411,24 +1147,16 @@ export class ApexDebug extends LoggingDebugSession { ); } else { const referenceInfo = JSON.stringify(reference); - this.log( - TRACE_CATEGORY_VARIABLES, - `populateReferences: unhandled reference: ${referenceInfo}` - ); + this.log(TRACE_CATEGORY_VARIABLES, `populateReferences: unhandled reference: ${referenceInfo}`); return; } // map apex id to container reference - this.variableContainerReferenceByApexId.set( - reference.id, - variableReference - ); + this.variableContainerReferenceByApexId.set(reference.id, variableReference); }); } - public getNumberOfChildren( - variableReference: number | undefined - ): number | undefined { + public getNumberOfChildren(variableReference: number | undefined): number | undefined { if (variableReference !== undefined) { const variableContainer = this.variableHandles.get(variableReference); if (variableContainer) { @@ -1454,8 +1182,7 @@ export class ApexDebug extends LoggingDebugSession { return; } } - const variableReference = - this.variableContainerReferenceByApexId.get(apexId); + const variableReference = this.variableContainerReferenceByApexId.get(apexId); this.log( TRACE_CATEGORY_VARIABLES, `resolveApexIdToVariableReference: resolved apexId=${apexId} to variableReference=${variableReference}` @@ -1463,39 +1190,25 @@ export class ApexDebug extends LoggingDebugSession { return variableReference; } - public async fetchReferences( - requestId: string, - ...apexIds: number[] - ): Promise { + public async fetchReferences(requestId: string, ...apexIds: number[]): Promise { this.log( TRACE_CATEGORY_VARIABLES, `fetchReferences: fetching references with apexIds=${apexIds} (request ${requestId})` ); - const referencesResponse = await this.myRequestService.execute( - new ReferencesCommand(requestId, ...apexIds) - ); - const referencesResponseObj: DebuggerResponse = - JSON.parse(referencesResponse); + const referencesResponse = await this.myRequestService.execute(new ReferencesCommand(requestId, ...apexIds)); + const referencesResponseObj: DebuggerResponse = JSON.parse(referencesResponse); if ( referencesResponseObj && referencesResponseObj.referencesResponse && referencesResponseObj.referencesResponse.references && referencesResponseObj.referencesResponse.references.references ) { - this.populateReferences( - referencesResponseObj.referencesResponse.references.references, - requestId - ); + this.populateReferences(referencesResponseObj.referencesResponse.references.references, requestId); } } - public async fetchReferencesIfNecessary( - requestId: string, - apexIds: number[] - ): Promise { - const apexIdsToFetch = apexIds.filter( - apexId => !this.variableContainerReferenceByApexId.has(apexId) - ); + public async fetchReferencesIfNecessary(requestId: string, apexIds: number[]): Promise { + const apexIdsToFetch = apexIds.filter(apexId => !this.variableContainerReferenceByApexId.has(apexId)); if (apexIdsToFetch.length === 0) { return; } @@ -1506,10 +1219,7 @@ export class ApexDebug extends LoggingDebugSession { await this.fetchReferences(requestId, ...apexIdsToFetch); } - protected evaluateRequest( - response: DebugProtocol.EvaluateResponse, - args: DebugProtocol.EvaluateArguments - ): void { + protected evaluateRequest(response: DebugProtocol.EvaluateResponse, args: DebugProtocol.EvaluateArguments): void { response.body = { result: args.expression, variablesReference: 0 @@ -1518,16 +1228,9 @@ export class ApexDebug extends LoggingDebugSession { this.sendResponse(response); } - protected printToDebugConsole( - msg?: string, - sourceFile?: Source, - sourceLine?: number - ): void { + protected printToDebugConsole(msg?: string, sourceFile?: Source, sourceLine?: number): void { if (msg && msg.length !== 0) { - const event: DebugProtocol.OutputEvent = new OutputEvent( - `${msg}${ApexDebug.LINEBREAK}`, - 'stdout' - ); + const event: DebugProtocol.OutputEvent = new OutputEvent(`${msg}${ApexDebug.LINEBREAK}`, 'stdout'); event.body.source = sourceFile; event.body.line = sourceLine; event.body.column = 0; @@ -1537,9 +1240,7 @@ export class ApexDebug extends LoggingDebugSession { protected warnToDebugConsole(msg?: string): void { if (msg && msg.length !== 0) { - this.sendEvent( - new OutputEvent(`${msg}${ApexDebug.LINEBREAK}`, 'console') - ); + this.sendEvent(new OutputEvent(`${msg}${ApexDebug.LINEBREAK}`, 'console')); } } @@ -1550,18 +1251,12 @@ export class ApexDebug extends LoggingDebugSession { } public log(traceCategory: TraceCategory, message: string) { - if ( - this.trace && - (this.traceAll || this.trace.indexOf(traceCategory) >= 0) - ) { + if (this.trace && (this.traceAll || this.trace.indexOf(traceCategory) >= 0)) { this.printToDebugConsole(`${process.pid}: ${message}`); } } - public tryToParseSfError( - response: DebugProtocol.Response, - error?: any - ): void { + public tryToParseSfError(response: DebugProtocol.Response, error?: any): void { if (!error) { return; } @@ -1570,54 +1265,34 @@ export class ApexDebug extends LoggingDebugSession { const errorObj = extractJsonObject(error); if (errorObj && errorObj.message) { const errorMessage: string = errorObj.message; - if ( - errorMessage.includes( - 'entity type cannot be inserted: Apex Debugger Session' - ) - ) { + if (errorMessage.includes('entity type cannot be inserted: Apex Debugger Session')) { response.message = nls.localize('session_no_entity_access_text'); } else { response.message = errorMessage; } if (errorObj.action) { - this.errorToDebugConsole( - `${nls.localize('command_error_help_text')}:${os.EOL}${ - errorObj.action - }` - ); + this.errorToDebugConsole(`${nls.localize('command_error_help_text')}:${os.EOL}${errorObj.action}`); } } else { response.message = nls.localize('unexpected_error_help_text'); - this.errorToDebugConsole( - `${nls.localize('command_error_help_text')}:${os.EOL}${error}` - ); + this.errorToDebugConsole(`${nls.localize('command_error_help_text')}:${os.EOL}${error}`); } } catch (e) { - response.message = - response.message || nls.localize('unexpected_error_help_text'); - this.errorToDebugConsole( - `${nls.localize('command_error_help_text')}:${os.EOL}${error}` - ); + response.message = response.message || nls.localize('unexpected_error_help_text'); + this.errorToDebugConsole(`${nls.localize('command_error_help_text')}:${os.EOL}${error}`); } } public async connectStreaming(projectPath: string): Promise { const clientInfos: StreamingClientInfo[] = []; - for (const channel of [ - StreamingService.SYSTEM_EVENT_CHANNEL, - StreamingService.USER_EVENT_CHANNEL - ]) { + for (const channel of [StreamingService.SYSTEM_EVENT_CHANNEL, StreamingService.USER_EVENT_CHANNEL]) { const clientInfo = new StreamingClientInfoBuilder() .forChannel(channel) .withConnectedHandler(() => { - this.printToDebugConsole( - nls.localize('streaming_connected_text', channel) - ); + this.printToDebugConsole(nls.localize('streaming_connected_text', channel)); }) .withDisconnectedHandler(() => { - this.printToDebugConsole( - nls.localize('streaming_disconnected_text', channel) - ); + this.printToDebugConsole(nls.localize('streaming_disconnected_text', channel)); }) .withErrorHandler((reason: string) => { this.errorToDebugConsole(reason); @@ -1634,22 +1309,12 @@ export class ApexDebug extends LoggingDebugSession { const systemChannelInfo = clientInfos[0]; const userChannelInfo = clientInfos[1]; - return this.myStreamingService.subscribe( - projectPath, - this.myRequestService, - systemChannelInfo, - userChannelInfo - ); + return this.myStreamingService.subscribe(projectPath, this.myRequestService, systemChannelInfo, userChannelInfo); } public handleEvent(message: DebuggerMessage): void { - const type: ApexDebuggerEventType = (ApexDebuggerEventType as any)[ - message.sobject.Type - ]; - this.log( - TRACE_CATEGORY_STREAMINGAPI, - `handleEvent: received ${JSON.stringify(message)}` - ); + const type: ApexDebuggerEventType = (ApexDebuggerEventType as any)[message.sobject.Type]; + this.log(TRACE_CATEGORY_STREAMINGAPI, `handleEvent: received ${JSON.stringify(message)}`); if ( !this.mySessionService.isConnected() || this.mySessionService.getSessionId() !== message.sobject.SessionId || @@ -1712,10 +1377,7 @@ export class ApexDebug extends LoggingDebugSession { public logEvent(message: DebuggerMessage): void { let eventDescriptionSourceFile: Source | undefined; let eventDescriptionSourceLine: number | undefined; - let logMessage = - message.event.createdDate === null - ? new Date().toUTCString() - : message.event.createdDate; + let logMessage = message.event.createdDate === null ? new Date().toUTCString() : message.event.createdDate; logMessage += ` | ${message.sobject.Type}`; if (message.sobject.RequestId) { logMessage += ` | Request: ${message.sobject.RequestId}`; @@ -1733,17 +1395,13 @@ export class ApexDebug extends LoggingDebugSession { if (matches && matches.length === 3) { const possibleClassName = matches[1]; const possibleClassLine = parseInt(matches[2], 10); - const possibleSourcePath = - this.myBreakpointService.getSourcePathFromPartialTyperef( - possibleClassName - ); + const possibleSourcePath = this.myBreakpointService.getSourcePathFromPartialTyperef(possibleClassName); if (possibleSourcePath) { eventDescriptionSourceFile = new Source( basename(possibleSourcePath), this.convertDebuggerPathToClient(possibleSourcePath) ); - eventDescriptionSourceLine = - this.convertDebuggerLineToClient(possibleClassLine); + eventDescriptionSourceLine = this.convertDebuggerLineToClient(possibleClassLine); } } } @@ -1751,16 +1409,10 @@ export class ApexDebug extends LoggingDebugSession { logMessage += ` |${os.EOL}${message.sobject.Stacktrace}`; } - this.printToDebugConsole( - logMessage, - eventDescriptionSourceFile, - eventDescriptionSourceLine - ); + this.printToDebugConsole(logMessage, eventDescriptionSourceFile, eventDescriptionSourceLine); } - private getThreadIdFromRequestId( - requestId: string | undefined - ): number | undefined { + private getThreadIdFromRequestId(requestId: string | undefined): number | undefined { for (const threadId of this.requestThreads.keys()) { if (this.requestThreads.get(threadId) === requestId) { return threadId; @@ -1785,10 +1437,7 @@ export class ApexDebug extends LoggingDebugSession { // cleanup everything that's no longer necessary after all request finished if (this.requestThreads.size === 0) { - this.log( - TRACE_CATEGORY_VARIABLES, - 'handleRequestFinished: clearing variable cache' - ); + this.log(TRACE_CATEGORY_VARIABLES, 'handleRequestFinished: clearing variable cache'); this.stackFrameInfos.reset(); this.variableHandles.reset(); this.variableContainerReferenceByApexId.clear(); @@ -1831,10 +1480,7 @@ export class ApexDebug extends LoggingDebugSession { // cleanup everything that's no longer valid after a stop event // but only if only one request is currently debugged (we wan't to preserve the info for a second request) if (this.requestThreads.size === 1) { - this.log( - TRACE_CATEGORY_VARIABLES, - 'handleStopped: clearing variable cache' - ); + this.log(TRACE_CATEGORY_VARIABLES, 'handleStopped: clearing variable cache'); this.stackFrameInfos.reset(); this.variableHandles.reset(); this.variableContainerReferenceByApexId.clear(); @@ -1847,8 +1493,7 @@ export class ApexDebug extends LoggingDebugSession { // if breakpointid is found in exception breakpoint cache // set the reason for stopped event to that reason if (message.sobject.BreakpointId) { - const cache: Map = - this.myBreakpointService.getExceptionBreakpointCache(); + const cache: Map = this.myBreakpointService.getExceptionBreakpointCache(); cache.forEach((value, key) => { if (value === message.sobject.BreakpointId) { // typerefs for exceptions will change based on whether they are custom, @@ -1861,10 +1506,7 @@ export class ApexDebug extends LoggingDebugSession { } }); } - const stoppedEvent: DebugProtocol.StoppedEvent = new StoppedEvent( - reason, - threadId - ); + const stoppedEvent: DebugProtocol.StoppedEvent = new StoppedEvent(reason, threadId); this.sendEvent(stoppedEvent); } } diff --git a/packages/salesforcedx-apex-debugger/src/commands/baseDebuggerCommand.ts b/packages/salesforcedx-apex-debugger/src/commands/baseDebuggerCommand.ts index 9e79a2d368..8696e13576 100644 --- a/packages/salesforcedx-apex-debugger/src/commands/baseDebuggerCommand.ts +++ b/packages/salesforcedx-apex-debugger/src/commands/baseDebuggerCommand.ts @@ -14,12 +14,7 @@ export class BaseDebuggerCommand extends BaseCommand { private readonly debuggerApiPath = 'services/debug/v41.0'; private readonly request: DebuggerRequest | undefined; - public constructor( - commandName: string, - debuggedRequestId: string, - queryString?: string, - request?: DebuggerRequest - ) { + public constructor(commandName: string, debuggedRequestId: string, queryString?: string, request?: DebuggerRequest) { super(queryString); this.commandName = commandName; this.debuggedRequestId = debuggedRequestId; @@ -27,11 +22,7 @@ export class BaseDebuggerCommand extends BaseCommand { } public getCommandUrl(): string { - const urlElements = [ - this.debuggerApiPath, - this.commandName, - this.debuggedRequestId - ]; + const urlElements = [this.debuggerApiPath, this.commandName, this.debuggedRequestId]; return urlElements.join('/'); } diff --git a/packages/salesforcedx-apex-debugger/src/commands/index.ts b/packages/salesforcedx-apex-debugger/src/commands/index.ts index b1226882b2..af4419c6ab 100644 --- a/packages/salesforcedx-apex-debugger/src/commands/index.ts +++ b/packages/salesforcedx-apex-debugger/src/commands/index.ts @@ -9,9 +9,5 @@ export { FrameCommand } from './frameCommand'; export * from './protocol'; export { ReferencesCommand } from './referencesCommand'; export { RunCommand } from './runCommand'; -export { - StepIntoCommand, - StepOutCommand, - StepOverCommand -} from './stepCommands'; +export { StepIntoCommand, StepOutCommand, StepOverCommand } from './stepCommands'; export { StateCommand } from './stateCommand'; diff --git a/packages/salesforcedx-apex-debugger/src/commands/referencesCommand.ts b/packages/salesforcedx-apex-debugger/src/commands/referencesCommand.ts index ee70fd9057..8b2c515428 100644 --- a/packages/salesforcedx-apex-debugger/src/commands/referencesCommand.ts +++ b/packages/salesforcedx-apex-debugger/src/commands/referencesCommand.ts @@ -9,9 +9,7 @@ import { BaseDebuggerCommand } from './baseDebuggerCommand'; import { DebuggerRequest, ReferenceRequest } from './protocol'; export class ReferencesCommand extends BaseDebuggerCommand { - protected static createGetReferenceRequest( - apexReferences: number[] - ): DebuggerRequest { + protected static createGetReferenceRequest(apexReferences: number[]): DebuggerRequest { return { getReferencesRequest: { reference: apexReferences.map(apexReference => { @@ -25,11 +23,6 @@ export class ReferencesCommand extends BaseDebuggerCommand { } public constructor(debuggedRequestId: string, ...apexReferences: number[]) { - super( - 'references', - debuggedRequestId, - undefined, - ReferencesCommand.createGetReferenceRequest(apexReferences) - ); + super('references', debuggedRequestId, undefined, ReferencesCommand.createGetReferenceRequest(apexReferences)); } } diff --git a/packages/salesforcedx-apex-debugger/src/constants.ts b/packages/salesforcedx-apex-debugger/src/constants.ts index 9570ba6dc5..0f05b8f3b4 100644 --- a/packages/salesforcedx-apex-debugger/src/constants.ts +++ b/packages/salesforcedx-apex-debugger/src/constants.ts @@ -23,4 +23,4 @@ export const EXCEPTION_BREAKPOINT_BREAK_MODE_ALWAYS = 'always'; export const EXCEPTION_BREAKPOINT_BREAK_MODE_NEVER = 'never'; export const SALESFORCE_EXCEPTION_PREFIX = 'com/salesforce/api/exception/'; export const TRIGGER_EXCEPTION_PREFIX = '__sfdc_trigger/'; -export const SEND_METRIC_EVENT = 'sendMetric'; \ No newline at end of file +export const SEND_METRIC_EVENT = 'sendMetric'; diff --git a/packages/salesforcedx-apex-debugger/src/context/isvContextUtil.ts b/packages/salesforcedx-apex-debugger/src/context/isvContextUtil.ts index 20fdedfc0a..4861bfb184 100644 --- a/packages/salesforcedx-apex-debugger/src/context/isvContextUtil.ts +++ b/packages/salesforcedx-apex-debugger/src/context/isvContextUtil.ts @@ -26,19 +26,10 @@ export class IsvContextUtil { const isvDebuggerSid = config.get(SF_CONFIG_ISV_DEBUGGER_SID); const isvDebuggerUrl = config.get(SF_CONFIG_ISV_DEBUGGER_URL); - if ( - typeof isvDebuggerSid !== 'undefined' && - typeof isvDebuggerUrl !== 'undefined' - ) { + if (typeof isvDebuggerSid !== 'undefined' && typeof isvDebuggerUrl !== 'undefined') { // set auth context - GlobalCliEnvironment.environmentVariables.set( - ENV_SF_TARGET_ORG, - isvDebuggerSid - ); - GlobalCliEnvironment.environmentVariables.set( - ENV_SF_ORG_INSTANCE_URL, - isvDebuggerUrl - ); + GlobalCliEnvironment.environmentVariables.set(ENV_SF_TARGET_ORG, isvDebuggerSid); + GlobalCliEnvironment.environmentVariables.set(ENV_SF_ORG_INSTANCE_URL, isvDebuggerUrl); isvDebugProject = true; } } @@ -49,8 +40,6 @@ export class IsvContextUtil { // reset any auth GlobalCliEnvironment.environmentVariables.delete(ENV_SF_TARGET_ORG); GlobalCliEnvironment.environmentVariables.delete(ENV_SF_ORG_INSTANCE_URL); - console.log( - `Deleted environment variables ${ENV_SF_TARGET_ORG} and ${ENV_SF_ORG_INSTANCE_URL}` - ); + console.log(`Deleted environment variables ${ENV_SF_TARGET_ORG} and ${ENV_SF_ORG_INSTANCE_URL}`); } } diff --git a/packages/salesforcedx-apex-debugger/src/core/breakpointService.ts b/packages/salesforcedx-apex-debugger/src/core/breakpointService.ts index 3c828c3465..62b49d4674 100644 --- a/packages/salesforcedx-apex-debugger/src/core/breakpointService.ts +++ b/packages/salesforcedx-apex-debugger/src/core/breakpointService.ts @@ -5,26 +5,16 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - CliCommandExecutor, - CommandOutput, - RequestService, - SfCommandBuilder -} from '@salesforce/salesforcedx-utils'; +import { CliCommandExecutor, CommandOutput, RequestService, SfCommandBuilder } from '@salesforce/salesforcedx-utils'; import { ExceptionBreakpointInfo } from '../breakpoints/exceptionBreakpoint'; -import { - ApexBreakpointLocation, - LineBreakpointsInTyperef -} from '../breakpoints/lineBreakpoint'; +import { ApexBreakpointLocation, LineBreakpointsInTyperef } from '../breakpoints/lineBreakpoint'; export const DEBUGGER_BREAKPOINT_ID_PREFIX = '07b'; export class BreakpointService { - private lineNumberMapping: Map = - new Map(); + private lineNumberMapping: Map = new Map(); private typerefMapping: Map = new Map(); - private lineBreakpointCache: Map = - new Map(); + private lineBreakpointCache: Map = new Map(); private exceptionBreakpointCache: Map = new Map(); private readonly requestService: RequestService; @@ -63,9 +53,7 @@ export class BreakpointService { return this.typerefMapping.get(typeref); } - public getSourcePathFromPartialTyperef( - partialTyperef: string - ): string | undefined { + public getSourcePathFromPartialTyperef(partialTyperef: string): string | undefined { for (const typeref of this.typerefMapping.keys()) { if (typeref.endsWith(partialTyperef)) { return this.typerefMapping.get(typeref); @@ -73,11 +61,7 @@ export class BreakpointService { } } - public cacheLineBreakpoint( - uriArg: string, - lineArg: number, - breakpointIdArg: string - ) { + public cacheLineBreakpoint(uriArg: string, lineArg: number, breakpointIdArg: string) { if (!this.lineBreakpointCache.has(uriArg)) { this.lineBreakpointCache.set(uriArg, []); } @@ -140,10 +124,7 @@ export class BreakpointService { } } - public async deleteBreakpoint( - projectPath: string, - breakpointId: string - ): Promise { + public async deleteBreakpoint(projectPath: string, breakpointId: string): Promise { const execution = new CliCommandExecutor( new SfCommandBuilder() .withArg('data:delete:record') @@ -176,18 +157,11 @@ export class BreakpointService { ): Promise> { const knownBreakpoints = this.lineBreakpointCache.get(uri); if (knownBreakpoints) { - for ( - let knownBpIdx = knownBreakpoints.length - 1; - knownBpIdx >= 0; - knownBpIdx-- - ) { + for (let knownBpIdx = knownBreakpoints.length - 1; knownBpIdx >= 0; knownBpIdx--) { const knownBp = knownBreakpoints[knownBpIdx]; if (clientLines.indexOf(knownBp.line) === -1) { try { - const breakpointId = await this.deleteBreakpoint( - projectPath, - knownBp.breakpointId - ); + const breakpointId = await this.deleteBreakpoint(projectPath, knownBp.breakpointId); if (breakpointId) { knownBreakpoints.splice(knownBpIdx, 1); } @@ -197,21 +171,11 @@ export class BreakpointService { } } for (const clientLine of clientLines) { - if ( - !knownBreakpoints || - !knownBreakpoints.find( - knownBreakpoint => knownBreakpoint.line === clientLine - ) - ) { + if (!knownBreakpoints || !knownBreakpoints.find(knownBreakpoint => knownBreakpoint.line === clientLine)) { const typeref = this.getTyperefFor(uri, clientLine); if (typeref) { try { - const breakpointId = await this.createLineBreakpoint( - projectPath, - sessionId, - typeref, - clientLine - ); + const breakpointId = await this.createLineBreakpoint(projectPath, sessionId, typeref, clientLine); if (breakpointId) { this.cacheLineBreakpoint(uri, clientLine, breakpointId); } @@ -232,10 +196,7 @@ export class BreakpointService { new SfCommandBuilder() .withArg('data:create:record') .withFlag('--sobject', 'ApexDebuggerBreakpoint') - .withFlag( - '--values', - `SessionId='${sessionId}' FileName='${typeref}' IsEnabled='true' Type='Exception'` - ) + .withFlag('--values', `SessionId='${sessionId}' FileName='${typeref}' IsEnabled='true' Type='Exception'`) .withArg('--use-tooling-api') .withJson() .build(), @@ -266,11 +227,7 @@ export class BreakpointService { await this.deleteBreakpoint(projectPath, knownBreakpointId); this.exceptionBreakpointCache.delete(info.typeref); } else if (!knownBreakpointId && info.breakMode === 'always') { - const createdBreakpointId = await this.createExceptionBreakpoint( - projectPath, - sessionId, - info.typeref - ); + const createdBreakpointId = await this.createExceptionBreakpoint(projectPath, sessionId, info.typeref); if (createdBreakpointId) { this.exceptionBreakpointCache.set(info.typeref, createdBreakpointId); } diff --git a/packages/salesforcedx-apex-debugger/src/core/sessionService.ts b/packages/salesforcedx-apex-debugger/src/core/sessionService.ts index e137ad0a13..1af0e4eb23 100644 --- a/packages/salesforcedx-apex-debugger/src/core/sessionService.ts +++ b/packages/salesforcedx-apex-debugger/src/core/sessionService.ts @@ -5,12 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - CliCommandExecutor, - CommandOutput, - RequestService, - SfCommandBuilder -} from '@salesforce/salesforcedx-utils'; +import { CliCommandExecutor, CommandOutput, RequestService, SfCommandBuilder } from '@salesforce/salesforcedx-utils'; export class SessionService { private userFilter?: string; diff --git a/packages/salesforcedx-apex-debugger/src/core/streamingClient.ts b/packages/salesforcedx-apex-debugger/src/core/streamingClient.ts index 390f8d5957..e922fcb5c0 100644 --- a/packages/salesforcedx-apex-debugger/src/core/streamingClient.ts +++ b/packages/salesforcedx-apex-debugger/src/core/streamingClient.ts @@ -86,9 +86,7 @@ export class StreamingClientInfoBuilder { return this; } - public withErrorHandler( - handler: (reason: string) => void - ): StreamingClientInfoBuilder { + public withErrorHandler(handler: (reason: string) => void): StreamingClientInfoBuilder { this.errorHandler = handler; return this; } @@ -98,16 +96,12 @@ export class StreamingClientInfoBuilder { return this; } - public withDisconnectedHandler( - handler: () => void - ): StreamingClientInfoBuilder { + public withDisconnectedHandler(handler: () => void): StreamingClientInfoBuilder { this.disconnectedHandler = handler; return this; } - public withMsgHandler( - handler: (message: any) => void - ): StreamingClientInfoBuilder { + public withMsgHandler(handler: (message: any) => void): StreamingClientInfoBuilder { this.messageHandler = handler; return this; } @@ -128,11 +122,7 @@ export class StreamingClient { private replayId = -1; private clientInfo: StreamingClientInfo; - public constructor( - url: string, - requestService: RequestService, - clientInfo: StreamingClientInfo - ) { + public constructor(url: string, requestService: RequestService, clientInfo: StreamingClientInfo) { this.clientInfo = clientInfo; this.client = new Client(url, { timeout: this.clientInfo.timeout, @@ -141,28 +131,21 @@ export class StreamingClient { auth: requestService.proxyAuthorization } }); - this.client.setHeader( - 'Authorization', - `OAuth ${requestService.accessToken}` - ); + this.client.setHeader('Authorization', `OAuth ${requestService.accessToken}`); this.client.setHeader('Content-Type', 'application/json'); } public async subscribe(): Promise { let subscribeAccept: () => void; let subscribeReject: () => void; - const returnPromise = new Promise( - (resolve: () => void, reject: () => void) => { - subscribeAccept = resolve; - subscribeReject = reject; - } - ); + const returnPromise = new Promise((resolve: () => void, reject: () => void) => { + subscribeAccept = resolve; + subscribeReject = reject; + }); this.client.on('transport:down', async () => { if (!this.connected) { - this.clientInfo.errorHandler( - nls.localize('streaming_handshake_timeout_text') - ); + this.clientInfo.errorHandler(nls.localize('streaming_handshake_timeout_text')); subscribeReject(); } }); @@ -177,16 +160,11 @@ export class StreamingClient { } else { this.connected = false; this.clientInfo.errorHandler( - `${nls.localize('streaming_handshake_error_text')}:${ - os.EOL - }${JSON.stringify(message)}${os.EOL}` + `${nls.localize('streaming_handshake_error_text')}:${os.EOL}${JSON.stringify(message)}${os.EOL}` ); subscribeReject(); } - } else if ( - message.channel === '/meta/connect' && - !this.shouldDisconnect - ) { + } else if (message.channel === '/meta/connect' && !this.shouldDisconnect) { const wasConnected = this.connected; this.connected = message.successful; if (!wasConnected && this.connected) { @@ -243,9 +221,6 @@ export class StreamingClient { } private sendSubscribeRequest(): void { - this.client.subscribe( - this.clientInfo.channel, - this.clientInfo.messageHandler - ); + this.client.subscribe(this.clientInfo.channel, this.clientInfo.messageHandler); } } diff --git a/packages/salesforcedx-apex-debugger/src/core/streamingService.ts b/packages/salesforcedx-apex-debugger/src/core/streamingService.ts index e8140d2b56..567f91146a 100644 --- a/packages/salesforcedx-apex-debugger/src/core/streamingService.ts +++ b/packages/salesforcedx-apex-debugger/src/core/streamingService.ts @@ -6,11 +6,7 @@ */ import { RequestService } from '@salesforce/salesforcedx-utils'; -import { - ApexDebuggerEventType, - StreamingClient, - StreamingClientInfo -} from './streamingClient'; +import { ApexDebuggerEventType, StreamingClient, StreamingClientInfo } from './streamingClient'; export class StreamingService { public static SYSTEM_EVENT_CHANNEL = '/systemTopic/ApexDebuggerSystemEvent'; @@ -50,10 +46,7 @@ export class StreamingService { } } - public hasProcessedEvent( - type: ApexDebuggerEventType, - replayId: number - ): boolean { + public hasProcessedEvent(type: ApexDebuggerEventType, replayId: number): boolean { const client = this.getClient(type); if (client && replayId > client.getReplayId()) { return false; @@ -61,10 +54,7 @@ export class StreamingService { return true; } - public markEventProcessed( - type: ApexDebuggerEventType, - replayId: number - ): void { + public markEventProcessed(type: ApexDebuggerEventType, replayId: number): void { const client = this.getClient(type); if (client) { client.setReplayId(replayId); @@ -77,23 +67,11 @@ export class StreamingService { systemEventClientInfo: StreamingClientInfo, userEventClientInfo: StreamingClientInfo ): Promise { - const urlElements = [ - this.removeTrailingSlashURL(requestService.instanceUrl), - 'cometd', - this.apiVersion - ]; + const urlElements = [this.removeTrailingSlashURL(requestService.instanceUrl), 'cometd', this.apiVersion]; const streamUrl = urlElements.join('/'); - this.systemEventClient = new StreamingClient( - streamUrl, - requestService, - systemEventClientInfo - ); - this.userEventClient = new StreamingClient( - streamUrl, - requestService, - userEventClientInfo - ); + this.systemEventClient = new StreamingClient(streamUrl, requestService, systemEventClientInfo); + this.userEventClient = new StreamingClient(streamUrl, requestService, userEventClientInfo); await this.systemEventClient.subscribe(); await this.userEventClient.subscribe(); diff --git a/packages/salesforcedx-apex-debugger/src/messages/i18n.ja.ts b/packages/salesforcedx-apex-debugger/src/messages/i18n.ja.ts index d38c0f77f6..aafc8c9094 100644 --- a/packages/salesforcedx-apex-debugger/src/messages/i18n.ja.ts +++ b/packages/salesforcedx-apex-debugger/src/messages/i18n.ja.ts @@ -17,38 +17,29 @@ */ export const messages = { command_error_help_text: 'コマンドは次のエラーを返しました。', - session_language_server_error_text: - 'Apex 言語サーバは有効なブレークポイントに関する情報を提供できませんでした。', - session_no_entity_access_text: - '組織またはユーザに Apex をデバッグする権限がありません。', + session_language_server_error_text: 'Apex 言語サーバは有効なブレークポイントに関する情報を提供できませんでした。', + session_no_entity_access_text: '組織またはユーザに Apex をデバッグする権限がありません。', session_started_text: 'Apex デバッガセッションを ID %s で開始しました。', session_terminated_text: 'ID %s のApex デバッガセッションを終了しました。', streaming_connected_text: 'Streaming API のチャネル %s に接続しました。', streaming_disconnected_text: 'Streaming API のチャネル %s から切断しました。', - streaming_handshake_error_text: - 'Streaming API のハンドシェイクが次のエラーで失敗しました。', + streaming_handshake_error_text: 'Streaming API のハンドシェイクが次のエラーで失敗しました。', streaming_handshake_timeout_text: 'Streaming API のハンドシェイクがソケットのタイムアウトで失敗しました。接続を確認し、再実行してください。', hotswap_warn_text: 'Apex デバッガセッションの間に Apex クラスやトリガを修正することはできません。デバッグ完了後に変更を保存してください。', - created_exception_breakpoint_text: - '%s にブレークポイント例外を作成しました。', - removed_exception_breakpoint_text: - '%s のブレークポイント例外を削除しました。', + created_exception_breakpoint_text: '%s にブレークポイント例外を作成しました。', + removed_exception_breakpoint_text: '%s のブレークポイント例外を削除しました。', idle_warn_text: '%s 分間アイドル状態です。デバッガセッションを終了させない場合は、%s 分以内に、コードを実行またはステップ実行するか、変数を検査してください。', - idle_terminated_text: - '%s 分間アイドル状態のため、デバッガセッションが終了されました。', + idle_terminated_text: '%s 分間アイドル状態のため、デバッガセッションが終了されました。', invalid_isv_project_config: 'ISV デバッグ用のプロジェクト設定が無効か未完了です。設定の Apex デバッガのページに戻り、新しいパートナーデバッグセッションを開始し、再実行してください。', unexpected_error_help_text: 'デバッガセッションを起動する際に予期せぬエラーが発生しました。詳細は、デバッグコンソールを参照してください。', - isv_debugger_launched_successfully: - 'ISV Debugger has been launched successfully.', - interactive_debugger_launched_successfully: - 'Interactive Debugger has been launched successfully.', + isv_debugger_launched_successfully: 'ISV Debugger has been launched successfully.', + interactive_debugger_launched_successfully: 'Interactive Debugger has been launched successfully.', isv_debugger_session_authentication_invalid: 'The forceIde:// URL of the ISV debugger session is expired or org-isv-debugger-sid has an invalid value.', - org_isv_debugger_url_invalid: - 'The config variable org-isv-debugger-url has an invalid value.' + org_isv_debugger_url_invalid: 'The config variable org-isv-debugger-url has an invalid value.' }; diff --git a/packages/salesforcedx-apex-debugger/src/messages/i18n.ts b/packages/salesforcedx-apex-debugger/src/messages/i18n.ts index d163b27228..044debd851 100644 --- a/packages/salesforcedx-apex-debugger/src/messages/i18n.ts +++ b/packages/salesforcedx-apex-debugger/src/messages/i18n.ts @@ -17,16 +17,13 @@ */ export const messages = { command_error_help_text: 'Command returned the following error', - session_language_server_error_text: - 'Apex language server could not provide information about valid breakpoints.', - session_no_entity_access_text: - "Either your org or user doesn't have the permission to debug Apex.", + session_language_server_error_text: 'Apex language server could not provide information about valid breakpoints.', + session_no_entity_access_text: "Either your org or user doesn't have the permission to debug Apex.", session_started_text: 'Apex Debugger session started with ID %s.', session_terminated_text: 'Apex Debugger session terminated with ID %s.', streaming_connected_text: 'Connected to Streaming API channel %s.', streaming_disconnected_text: 'Disconnected from Streaming API channel %s.', - streaming_handshake_error_text: - 'Streaming API handshake failed with the following error', + streaming_handshake_error_text: 'Streaming API handshake failed with the following error', streaming_handshake_timeout_text: 'Streaming API handshake failed due to a socket timeout. Check your connection and try again.', hotswap_warn_text: @@ -35,18 +32,14 @@ export const messages = { removed_exception_breakpoint_text: 'Removed exception breakpoint for %s.', idle_warn_text: 'You have been idle for %s minutes. To prevent your debugger session from being terminated, run or step through code, or inspect your variables, in the next %s minutes.', - idle_terminated_text: - 'Your debugger session is being terminated because it has been idle for %s minutes.', + idle_terminated_text: 'Your debugger session is being terminated because it has been idle for %s minutes.', invalid_isv_project_config: 'Your project configuration is invalid or incomplete for ISV debugging. Return to the Apex Debugger page in Setup, start a new partner debugging session, and try again.', unexpected_error_help_text: 'An unexpected error occurred while launching the debugger session. Refer to the Debug Console for details.', - isv_debugger_launched_successfully: - 'ISV Debugger has been launched successfully.', - interactive_debugger_launched_successfully: - 'Interactive Debugger has been launched successfully.', + isv_debugger_launched_successfully: 'ISV Debugger has been launched successfully.', + interactive_debugger_launched_successfully: 'Interactive Debugger has been launched successfully.', isv_debugger_session_authentication_invalid: 'The forceIde:// URL of the ISV debugger session is expired or the config variable org-isv-debugger-sid has an invalid value.', - org_isv_debugger_url_invalid: - 'The config variable org-isv-debugger-url has an invalid value.' + org_isv_debugger_url_invalid: 'The config variable org-isv-debugger-url has an invalid value.' }; diff --git a/packages/salesforcedx-apex-debugger/src/messages/index.ts b/packages/salesforcedx-apex-debugger/src/messages/index.ts index bac4e0ea7d..b2eb51ee6c 100644 --- a/packages/salesforcedx-apex-debugger/src/messages/index.ts +++ b/packages/salesforcedx-apex-debugger/src/messages/index.ts @@ -17,7 +17,6 @@ import { messages } from './i18n'; import { messages as jaMessages } from './i18n.ja'; const loadMessageBundle = (config?: Config): Message => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars const resolveFileName = (locale: string): string => { return locale === DEFAULT_LOCALE ? `${BASE_FILE_NAME}.${BASE_FILE_EXTENSION}` @@ -39,9 +38,5 @@ const loadMessageBundle = (config?: Config): Message => { }; export const nls = new Localization( - loadMessageBundle( - process.env.VSCODE_NLS_CONFIG - ? JSON.parse(process.env.VSCODE_NLS_CONFIG!) - : undefined - ) + loadMessageBundle(process.env.VSCODE_NLS_CONFIG ? JSON.parse(process.env.VSCODE_NLS_CONFIG!) : undefined) ); diff --git a/packages/salesforcedx-apex-debugger/test/.eslintrc.json b/packages/salesforcedx-apex-debugger/test/.eslintrc.json deleted file mode 100644 index f2b99a417d..0000000000 --- a/packages/salesforcedx-apex-debugger/test/.eslintrc.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": [ - "../.eslintrc.json", - "../../../config/common-test-lint-rules.json" - ] -} diff --git a/packages/salesforcedx-apex-debugger/test/integration/adapter.test.ts b/packages/salesforcedx-apex-debugger/test/integration/adapter.test.ts index 7e229b57c7..5b3bf6921d 100644 --- a/packages/salesforcedx-apex-debugger/test/integration/adapter.test.ts +++ b/packages/salesforcedx-apex-debugger/test/integration/adapter.test.ts @@ -6,11 +6,7 @@ */ import * as util from '@salesforce/salesforcedx-test-utils-vscode/out/src/orgUtils'; -import { - CliCommandExecutor, - CommandExecution, - SfCommandBuilder -} from '@salesforce/salesforcedx-utils-vscode'; +import { CliCommandExecutor, CommandExecution, SfCommandBuilder } from '@salesforce/salesforcedx-utils-vscode'; import { DebugClient } from '@vscode/debugadapter-testsupport'; import { DebugProtocol } from '@vscode/debugprotocol'; import { expect } from 'chai'; @@ -21,16 +17,7 @@ import { LaunchRequestArguments } from '../../src/adapter/apexDebug'; import { LineBreakpointInfo } from '../../src/breakpoints/lineBreakpoint'; const PROJECT_NAME = `project_${new Date().getTime()}`; -const SIMPLE_VARIABLES_DIR = path.join( - __dirname, - '..', - '..', - '..', - 'test', - 'integration', - 'config', - 'variables' -); +const SIMPLE_VARIABLES_DIR = path.join(__dirname, '..', '..', '..', 'test', 'integration', 'config', 'variables'); const SOURCE_FOLDER = path.join(SIMPLE_VARIABLES_DIR, 'source'); const APEX_EXEC_FILE = path.join(SIMPLE_VARIABLES_DIR, 'apexExec', 'test.apex'); const LINE_BREAKPOINT_INFO: LineBreakpointInfo[] = []; @@ -53,9 +40,7 @@ describe.skip('Interactive debugger adapter - integration', () => { await util.generateSFProject(PROJECT_NAME); // Create scratch org with Debug Apex enabled util.addFeatureToScratchOrgConfig(PROJECT_NAME, 'DebugApex'); - apexClassUri = Uri.file( - `${projectPath}/force-app/main/default/classes/BasicVariables.cls` - ).toString(); + apexClassUri = Uri.file(`${projectPath}/force-app/main/default/classes/BasicVariables.cls`).toString(); if (process.platform === 'win32') { apexClassUri = apexClassUri.replace('%3A', ':'); } @@ -63,10 +48,7 @@ describe.skip('Interactive debugger adapter - integration', () => { LINE_BREAKPOINT_INFO.push({ uri: apexClassUri, typeref: 'BasicVariables', - lines: [ - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 29, 30, 31, 32, 33, - 34, 36, 37, 39, 40, 42 - ] + lines: [14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 29, 30, 31, 32, 33, 34, 36, 37, 39, 40, 42] }); LINE_BREAKPOINT_INFO.push({ uri: apexClassUri, @@ -138,12 +120,8 @@ describe.skip('Interactive debugger adapter - integration', () => { }); expect(stackTraceResponse.success).to.equal(true); expect(stackTraceResponse.body.stackFrames.length).to.equal(2); - expect(stackTraceResponse.body.stackFrames[0].name).to.equal( - 'BasicVariables.testAll()' - ); - expect(stackTraceResponse.body.stackFrames[1].name).to.equal( - 'anon.execute()' - ); + expect(stackTraceResponse.body.stackFrames[0].name).to.equal('BasicVariables.testAll()'); + expect(stackTraceResponse.body.stackFrames[1].name).to.equal('anon.execute()'); // Verify threads const threadResponse = await dc.threadsRequest(); expect(threadResponse.success).to.equal(true); @@ -196,10 +174,7 @@ describe.skip('Interactive debugger adapter - integration', () => { }); }); -const execApexNoWait = ( - apexExecFilePath: string, - userName: string -): CommandExecution => { +const execApexNoWait = (apexExecFilePath: string, userName: string): CommandExecution => { return new CliCommandExecutor( new SfCommandBuilder() .withArg('apex:run') diff --git a/packages/salesforcedx-apex-debugger/test/jest/core/breakpointService.test.ts b/packages/salesforcedx-apex-debugger/test/jest/core/breakpointService.test.ts index 571167f593..6dc63b5c69 100644 --- a/packages/salesforcedx-apex-debugger/test/jest/core/breakpointService.test.ts +++ b/packages/salesforcedx-apex-debugger/test/jest/core/breakpointService.test.ts @@ -78,9 +78,7 @@ describe('breakpointService Unit Tests.', () => { }); it('Should return false if isApexDebuggerBreakpointId is empty.', () => { - expect( - breakpointService.isApexDebuggerBreakpointId('NOT_THE_DEBUGGER_ID') - ).toBeFalsy(); + expect(breakpointService.isApexDebuggerBreakpointId('NOT_THE_DEBUGGER_ID')).toBeFalsy(); }); it('Should return true if isApexDebuggerBreakpointId is not value.', () => { @@ -227,12 +225,7 @@ describe('breakpointService Unit Tests.', () => { result: { id: bpId } }) ); - const result = await breakpointService.createLineBreakpoint( - 'fake/project/path', - 'fakeSessionId', - 'test', - 1 - ); + const result = await breakpointService.createLineBreakpoint('fake/project/path', 'fakeSessionId', 'test', 1); expect(executeMock).toHaveBeenCalled(); expect(getCmdResultMock).toHaveBeenCalled(); expect(result).toEqual(bpId); @@ -245,14 +238,9 @@ describe('breakpointService Unit Tests.', () => { getCmdResultMock.mockResolvedValue(expectedResults); // eslint-disable-next-line @typescript-eslint/no-floating-promises - expect( - breakpointService.createLineBreakpoint( - 'fake/project/path', - 'fakeSessionId', - 'test', - 1 - ) - ).rejects.toEqual(expectedResults); + expect(breakpointService.createLineBreakpoint('fake/project/path', 'fakeSessionId', 'test', 1)).rejects.toEqual( + expectedResults + ); expect(executeMock).toHaveBeenCalled(); expect(getCmdResultMock).toHaveBeenCalled(); }); @@ -264,14 +252,9 @@ describe('breakpointService Unit Tests.', () => { getCmdResultMock.mockResolvedValue(expectedResults); // eslint-disable-next-line @typescript-eslint/no-floating-promises - expect( - breakpointService.createLineBreakpoint( - 'fake/project/path', - 'fakeSessionId', - 'test', - 1 - ) - ).rejects.toEqual(expectedResults); + expect(breakpointService.createLineBreakpoint('fake/project/path', 'fakeSessionId', 'test', 1)).rejects.toEqual( + expectedResults + ); expect(executeMock).toHaveBeenCalled(); expect(getCmdResultMock).toHaveBeenCalled(); }); @@ -284,10 +267,7 @@ describe('breakpointService Unit Tests.', () => { result: { id: bpId } }) ); - const result = await breakpointService.deleteBreakpoint( - 'fake/project/path', - bpId - ); + const result = await breakpointService.deleteBreakpoint('fake/project/path', bpId); expect(executeMock).toHaveBeenCalled(); expect(getCmdResultMock).toHaveBeenCalled(); expect(result).toEqual(bpId); @@ -300,9 +280,7 @@ describe('breakpointService Unit Tests.', () => { getCmdResultMock.mockResolvedValue(expectedResults); // eslint-disable-next-line @typescript-eslint/no-floating-promises - expect( - breakpointService.deleteBreakpoint('fake/project/path', bpId) - ).rejects.toEqual(expectedResults); + expect(breakpointService.deleteBreakpoint('fake/project/path', bpId)).rejects.toEqual(expectedResults); expect(executeMock).toHaveBeenCalled(); expect(getCmdResultMock).toHaveBeenCalled(); }); @@ -314,9 +292,7 @@ describe('breakpointService Unit Tests.', () => { getCmdResultMock.mockResolvedValue(expectedResults); // eslint-disable-next-line @typescript-eslint/no-floating-promises - expect( - breakpointService.deleteBreakpoint('fake/project/path', bpId) - ).rejects.toEqual(expectedResults); + expect(breakpointService.deleteBreakpoint('fake/project/path', bpId)).rejects.toEqual(expectedResults); expect(executeMock).toHaveBeenCalled(); expect(getCmdResultMock).toHaveBeenCalled(); }); @@ -326,9 +302,7 @@ describe('breakpointService Unit Tests.', () => { const fakeUri = 'fake/project/path'; beforeEach(() => { jest.spyOn(breakpointService, 'deleteBreakpoint').mockResolvedValue(bpId); - jest - .spyOn(breakpointService, 'createLineBreakpoint') - .mockResolvedValue(bpId); + jest.spyOn(breakpointService, 'createLineBreakpoint').mockResolvedValue(bpId); jest.spyOn(breakpointService, 'getTyperefFor').mockReturnValue('typeref'); }); @@ -340,16 +314,8 @@ describe('breakpointService Unit Tests.', () => { } ]); - await breakpointService.reconcileLineBreakpoints( - 'fake/project/path', - fakeUri, - 'test', - [2, 3] - ); - expect(breakpointService.deleteBreakpoint).toHaveBeenCalledWith( - 'fake/project/path', - bpId + '1' - ); + await breakpointService.reconcileLineBreakpoints('fake/project/path', fakeUri, 'test', [2, 3]); + expect(breakpointService.deleteBreakpoint).toHaveBeenCalledWith('fake/project/path', bpId + '1'); }); it('Should create a breakpoint if typeref is found .', async () => { @@ -360,24 +326,9 @@ describe('breakpointService Unit Tests.', () => { } ]); - await breakpointService.reconcileLineBreakpoints( - 'fake/project/path', - fakeUri, - 'test', - [2, 3] - ); - expect(breakpointService.createLineBreakpoint).toHaveBeenCalledWith( - 'fake/project/path', - 'test', - 'typeref', - 2 - ); - expect(breakpointService.createLineBreakpoint).toHaveBeenCalledWith( - 'fake/project/path', - 'test', - 'typeref', - 3 - ); + await breakpointService.reconcileLineBreakpoints('fake/project/path', fakeUri, 'test', [2, 3]); + expect(breakpointService.createLineBreakpoint).toHaveBeenCalledWith('fake/project/path', 'test', 'typeref', 2); + expect(breakpointService.createLineBreakpoint).toHaveBeenCalledWith('fake/project/path', 'test', 'typeref', 3); }); }); @@ -406,11 +357,7 @@ describe('breakpointService Unit Tests.', () => { // eslint-disable-next-line @typescript-eslint/no-floating-promises expect( - breakpointService.createExceptionBreakpoint( - 'fake/project/path', - 'fakeSessionId', - 'fakeTypeRef' - ) + breakpointService.createExceptionBreakpoint('fake/project/path', 'fakeSessionId', 'fakeTypeRef') ).rejects.toEqual(expectedResults); expect(executeMock).toHaveBeenCalled(); expect(getCmdResultMock).toHaveBeenCalled(); @@ -424,11 +371,7 @@ describe('breakpointService Unit Tests.', () => { // eslint-disable-next-line @typescript-eslint/no-floating-promises expect( - breakpointService.createExceptionBreakpoint( - 'fake/project/path', - 'fakeSessionId', - 'fakeTypeRef' - ) + breakpointService.createExceptionBreakpoint('fake/project/path', 'fakeSessionId', 'fakeTypeRef') ).rejects.toEqual(expectedResults); expect(executeMock).toHaveBeenCalled(); expect(getCmdResultMock).toHaveBeenCalled(); @@ -437,12 +380,8 @@ describe('breakpointService Unit Tests.', () => { describe('reconcileExceptionBreakpoints()', () => { beforeEach(() => { - jest - .spyOn(breakpointService, 'deleteBreakpoint') - .mockResolvedValue(undefined); - jest - .spyOn(breakpointService, 'createExceptionBreakpoint') - .mockResolvedValue(bpId); + jest.spyOn(breakpointService, 'deleteBreakpoint').mockResolvedValue(undefined); + jest.spyOn(breakpointService, 'createExceptionBreakpoint').mockResolvedValue(bpId); (breakpointService as any).exceptionBreakpointCache = { get: jest.fn().mockReturnValue('test'), set: jest.fn(), @@ -450,52 +389,31 @@ describe('breakpointService Unit Tests.', () => { }; }); it('Should delete breakpoint if known and never.', async () => { - await breakpointService.reconcileExceptionBreakpoints( - 'fake/project/path', - 'fakeSessionId', - { - label: 'fakeFake', - typeref: 'test', - breakMode: 'never' - } - ); - expect(breakpointService.deleteBreakpoint).toHaveBeenCalledWith( - 'fake/project/path', - 'test' - ); - expect( - (breakpointService as any).exceptionBreakpointCache.delete - ).toHaveBeenCalledWith('test'); - expect( - (breakpointService as any).exceptionBreakpointCache.set - ).not.toHaveBeenCalled(); + await breakpointService.reconcileExceptionBreakpoints('fake/project/path', 'fakeSessionId', { + label: 'fakeFake', + typeref: 'test', + breakMode: 'never' + }); + expect(breakpointService.deleteBreakpoint).toHaveBeenCalledWith('fake/project/path', 'test'); + expect((breakpointService as any).exceptionBreakpointCache.delete).toHaveBeenCalledWith('test'); + expect((breakpointService as any).exceptionBreakpointCache.set).not.toHaveBeenCalled(); }); it('Should create breakpoint if not known and always.', async () => { - (breakpointService as any).exceptionBreakpointCache.get.mockReturnValue( - undefined - ); - await breakpointService.reconcileExceptionBreakpoints( - 'fake/project/path', - 'fakeSessionId', - { - label: 'fakeFake', - typeref: 'test', - breakMode: 'always' - } - ); + (breakpointService as any).exceptionBreakpointCache.get.mockReturnValue(undefined); + await breakpointService.reconcileExceptionBreakpoints('fake/project/path', 'fakeSessionId', { + label: 'fakeFake', + typeref: 'test', + breakMode: 'always' + }); expect(breakpointService.deleteBreakpoint).not.toHaveBeenCalled(); expect(breakpointService.createExceptionBreakpoint).toHaveBeenCalledWith( 'fake/project/path', 'fakeSessionId', 'test' ); - expect( - (breakpointService as any).exceptionBreakpointCache.delete - ).not.toHaveBeenCalled(); - expect( - (breakpointService as any).exceptionBreakpointCache.set - ).toHaveBeenCalledWith('test', bpId); + expect((breakpointService as any).exceptionBreakpointCache.delete).not.toHaveBeenCalled(); + expect((breakpointService as any).exceptionBreakpointCache.set).toHaveBeenCalledWith('test', bpId); }); }); @@ -510,9 +428,7 @@ describe('breakpointService Unit Tests.', () => { breakpointService.clearSavedBreakpoints(); expect((breakpointService as any).lineBreakpointCache.size).toEqual(0); - expect((breakpointService as any).exceptionBreakpointCache.size).toEqual( - 0 - ); + expect((breakpointService as any).exceptionBreakpointCache.size).toEqual(0); }); }); }); diff --git a/packages/salesforcedx-apex-debugger/test/unit/adapter/apexDebug.test.ts b/packages/salesforcedx-apex-debugger/test/unit/adapter/apexDebug.test.ts index c9181e80e1..56573265c5 100644 --- a/packages/salesforcedx-apex-debugger/test/unit/adapter/apexDebug.test.ts +++ b/packages/salesforcedx-apex-debugger/test/unit/adapter/apexDebug.test.ts @@ -13,13 +13,7 @@ import { OrgInfo, RequestService } from '@salesforce/salesforcedx-utils'; -import { - OutputEvent, - Source, - StackFrame, - StoppedEvent, - ThreadEvent -} from '@vscode/debugadapter'; +import { OutputEvent, Source, StackFrame, StoppedEvent, ThreadEvent } from '@vscode/debugadapter'; import { DebugProtocol } from '@vscode/debugprotocol'; import * as AsyncLock from 'async-lock'; import { expect } from 'chai'; @@ -33,17 +27,8 @@ import { LaunchRequestArguments, SetExceptionBreakpointsArguments } from '../../../src/adapter/apexDebug'; -import { - LineBreakpointInfo, - LineBreakpointsInTyperef -} from '../../../src/breakpoints/lineBreakpoint'; -import { - RunCommand, - StateCommand, - StepIntoCommand, - StepOutCommand, - StepOverCommand -} from '../../../src/commands'; +import { LineBreakpointInfo, LineBreakpointsInTyperef } from '../../../src/breakpoints/lineBreakpoint'; +import { RunCommand, StateCommand, StepIntoCommand, StepOutCommand, StepOverCommand } from '../../../src/commands'; import { DEFAULT_IDLE_TIMEOUT_MS, DEFAULT_IDLE_WARN1_MS, @@ -68,17 +53,10 @@ import { StreamingEvent, StreamingService } from '../../../src/core'; -import { - VscodeDebuggerMessage, - VscodeDebuggerMessageType, - WorkspaceSettings -} from '../../../src/index'; +import { VscodeDebuggerMessage, VscodeDebuggerMessageType, WorkspaceSettings } from '../../../src/index'; import { nls } from '../../../src/messages'; import { ApexDebugForTest } from './apexDebugForTest'; -import { - DummyContainer, - newStringValue -} from './apexDebugVariablesHandling.test'; +import { DummyContainer, newStringValue } from './apexDebugVariablesHandling.test'; describe('Interactive debugger adapter - unit', () => { let adapter: ApexDebugForTest; @@ -157,37 +135,17 @@ describe('Interactive debugger adapter - unit', () => { beforeEach(() => { sessionProjectSpy = sinon.spy(SessionService.prototype, 'forProject'); - sessionUserFilterSpy = sinon.spy( - SessionService.prototype, - 'withUserFilter' - ); - sessionEntryFilterSpy = sinon.spy( - SessionService.prototype, - 'withEntryFilter' - ); - sessionRequestFilterSpy = sinon.spy( - SessionService.prototype, - 'withRequestFilter' - ); - resetIdleTimersSpy = sinon.spy( - ApexDebugForTest.prototype, - 'resetIdleTimer' - ); - orgInfoSpy = sinon - .stub(OrgDisplay.prototype, 'getOrgInfo') - .returns({} as OrgInfo); - configGetSpy = sinon - .stub(ConfigGet.prototype, 'getConfig') - .returns({} as Map); + sessionUserFilterSpy = sinon.spy(SessionService.prototype, 'withUserFilter'); + sessionEntryFilterSpy = sinon.spy(SessionService.prototype, 'withEntryFilter'); + sessionRequestFilterSpy = sinon.spy(SessionService.prototype, 'withRequestFilter'); + resetIdleTimersSpy = sinon.spy(ApexDebugForTest.prototype, 'resetIdleTimer'); + orgInfoSpy = sinon.stub(OrgDisplay.prototype, 'getOrgInfo').returns({} as OrgInfo); + configGetSpy = sinon.stub(ConfigGet.prototype, 'getConfig').returns({} as Map); args = { salesforceProject: 'project', userIdFilter: ['005FAKE1', '005FAKE2', '005FAKE1'], entryPointFilter: 'entry', - requestTypeFilter: [ - 'RUN_TESTS_SYNCHRONOUS', - 'EXECUTE_ANONYMOUS', - 'RUN_TESTS_SYNCHRONOUS' - ], + requestTypeFilter: ['RUN_TESTS_SYNCHRONOUS', 'EXECUTE_ANONYMOUS', 'RUN_TESTS_SYNCHRONOUS'], workspaceSettings: { proxyUrl: 'http://localhost:443', proxyStrictSSL: false, @@ -217,18 +175,10 @@ describe('Interactive debugger adapter - unit', () => { it('Should launch successfully (interactive debugger)', async () => { const sessionId = '07aFAKE'; - sessionStartSpy = sinon - .stub(SessionService.prototype, 'start') - .returns(Promise.resolve(sessionId)); - sessionConnectedSpy = sinon - .stub(SessionService.prototype, 'isConnected') - .returns(true); - streamingSubscribeSpy = sinon - .stub(StreamingService.prototype, 'subscribe') - .returns(Promise.resolve(true)); - breakpointHasLineNumberMappingSpy = sinon - .stub(BreakpointService.prototype, 'hasLineNumberMapping') - .returns(true); + sessionStartSpy = sinon.stub(SessionService.prototype, 'start').returns(Promise.resolve(sessionId)); + sessionConnectedSpy = sinon.stub(SessionService.prototype, 'isConnected').returns(true); + streamingSubscribeSpy = sinon.stub(StreamingService.prototype, 'subscribe').returns(Promise.resolve(true)); + breakpointHasLineNumberMappingSpy = sinon.stub(BreakpointService.prototype, 'hasLineNumberMapping').returns(true); await adapter.launchRequest(initializedResponse, args); @@ -236,23 +186,17 @@ describe('Interactive debugger adapter - unit', () => { expect(adapter.getResponse(0).success).to.equal(true); expect(adapter.getEvents()[0].event).to.equal('sendMetric'); // launch Apex debugger expect(adapter.getEvents()[1].event).to.equal('output'); - expect( - (adapter.getEvents()[1] as OutputEvent).body.output - ).to.have.string(nls.localize('session_started_text', sessionId)); + expect((adapter.getEvents()[1] as OutputEvent).body.output).to.have.string( + nls.localize('session_started_text', sessionId) + ); expect(adapter.getEvents()[2].event).to.equal('sendMetric'); // interactive debugger started successfully expect(adapter.getEvents()[3].event).to.equal('initialized'); expect(sessionUserFilterSpy.calledOnce).to.equal(true); expect(sessionEntryFilterSpy.calledOnce).to.equal(true); expect(sessionRequestFilterSpy.calledOnce).to.equal(true); - expect(sessionUserFilterSpy.getCall(0).args).to.have.same.members([ - '005FAKE1,005FAKE2' - ]); - expect(sessionEntryFilterSpy.getCall(0).args).to.have.same.members([ - 'entry' - ]); - expect(sessionRequestFilterSpy.getCall(0).args).to.have.same.members([ - 'RUN_TESTS_SYNCHRONOUS,EXECUTE_ANONYMOUS' - ]); + expect(sessionUserFilterSpy.getCall(0).args).to.have.same.members(['005FAKE1,005FAKE2']); + expect(sessionEntryFilterSpy.getCall(0).args).to.have.same.members(['entry']); + expect(sessionRequestFilterSpy.getCall(0).args).to.have.same.members(['RUN_TESTS_SYNCHRONOUS,EXECUTE_ANONYMOUS']); expect(resetIdleTimersSpy.calledOnce).to.equal(true); }); @@ -260,49 +204,29 @@ describe('Interactive debugger adapter - unit', () => { sessionStartSpy = sinon .stub(SessionService.prototype, 'start') .returns( - Promise.reject( - '{"message":"entity type cannot be inserted: Apex Debugger Session", "action":"Try again"}' - ) + Promise.reject('{"message":"entity type cannot be inserted: Apex Debugger Session", "action":"Try again"}') ); - sessionConnectedSpy = sinon - .stub(SessionService.prototype, 'isConnected') - .returns(false); - streamingSubscribeSpy = sinon - .stub(StreamingService.prototype, 'subscribe') - .returns(Promise.resolve(true)); - breakpointHasLineNumberMappingSpy = sinon - .stub(BreakpointService.prototype, 'hasLineNumberMapping') - .returns(true); + sessionConnectedSpy = sinon.stub(SessionService.prototype, 'isConnected').returns(false); + streamingSubscribeSpy = sinon.stub(StreamingService.prototype, 'subscribe').returns(Promise.resolve(true)); + breakpointHasLineNumberMappingSpy = sinon.stub(BreakpointService.prototype, 'hasLineNumberMapping').returns(true); await adapter.launchRequest(initializedResponse, args); expect(sessionStartSpy.calledOnce).to.equal(true); expect(adapter.getResponse(0).success).to.equal(false); - expect(adapter.getResponse(0).message).to.equal( - nls.localize('session_no_entity_access_text') - ); + expect(adapter.getResponse(0).message).to.equal(nls.localize('session_no_entity_access_text')); expect(adapter.getEvents()[0].event).to.equal('sendMetric'); // launch Apex debugger expect(adapter.getEvents()[1].event).to.equal('output'); - expect( - (adapter.getEvents()[1] as OutputEvent).body.output - ).to.have.string('Try again'); + expect((adapter.getEvents()[1] as OutputEvent).body.output).to.have.string('Try again'); expect(resetIdleTimersSpy.called).to.equal(false); }); it('Should not launch if streaming service errors out', async () => { const sessionId = '07aFAKE'; - sessionStartSpy = sinon - .stub(SessionService.prototype, 'start') - .returns(Promise.resolve(sessionId)); - sessionConnectedSpy = sinon - .stub(SessionService.prototype, 'isConnected') - .returns(true); - streamingSubscribeSpy = sinon - .stub(StreamingService.prototype, 'subscribe') - .returns(Promise.resolve(false)); - breakpointHasLineNumberMappingSpy = sinon - .stub(BreakpointService.prototype, 'hasLineNumberMapping') - .returns(true); + sessionStartSpy = sinon.stub(SessionService.prototype, 'start').returns(Promise.resolve(sessionId)); + sessionConnectedSpy = sinon.stub(SessionService.prototype, 'isConnected').returns(true); + streamingSubscribeSpy = sinon.stub(StreamingService.prototype, 'subscribe').returns(Promise.resolve(false)); + breakpointHasLineNumberMappingSpy = sinon.stub(BreakpointService.prototype, 'hasLineNumberMapping').returns(true); await adapter.launchRequest(initializedResponse, args); @@ -315,10 +239,7 @@ describe('Interactive debugger adapter - unit', () => { it('Should not launch without line number mapping', async () => { sessionStartSpy = sinon.stub(SessionService.prototype, 'start'); sessionConnectedSpy = sinon.stub(SessionService.prototype, 'isConnected'); - streamingSubscribeSpy = sinon.stub( - StreamingService.prototype, - 'subscribe' - ); + streamingSubscribeSpy = sinon.stub(StreamingService.prototype, 'subscribe'); breakpointHasLineNumberMappingSpy = sinon .stub(BreakpointService.prototype, 'hasLineNumberMapping') .returns(false); @@ -326,27 +247,17 @@ describe('Interactive debugger adapter - unit', () => { await adapter.launchRequest(initializedResponse, args); expect(sessionStartSpy.called).to.equal(false); expect(adapter.getResponse(0).success).to.equal(false); - expect(adapter.getResponse(0).message).to.equal( - nls.localize('session_language_server_error_text') - ); + expect(adapter.getResponse(0).message).to.equal(nls.localize('session_language_server_error_text')); expect(adapter.getEvents().length).to.equal(1); // value is 1 because the Launch Apex Debugger button is clicked expect(resetIdleTimersSpy.called).to.equal(false); }); it('Should launch successfully for ISV project (ISV debugger)', async () => { const sessionId = '07aFAKE'; - sessionStartSpy = sinon - .stub(SessionService.prototype, 'start') - .returns(Promise.resolve(sessionId)); - sessionConnectedSpy = sinon - .stub(SessionService.prototype, 'isConnected') - .returns(true); - streamingSubscribeSpy = sinon - .stub(StreamingService.prototype, 'subscribe') - .returns(Promise.resolve(true)); - breakpointHasLineNumberMappingSpy = sinon - .stub(BreakpointService.prototype, 'hasLineNumberMapping') - .returns(true); + sessionStartSpy = sinon.stub(SessionService.prototype, 'start').returns(Promise.resolve(sessionId)); + sessionConnectedSpy = sinon.stub(SessionService.prototype, 'isConnected').returns(true); + streamingSubscribeSpy = sinon.stub(StreamingService.prototype, 'subscribe').returns(Promise.resolve(true)); + breakpointHasLineNumberMappingSpy = sinon.stub(BreakpointService.prototype, 'hasLineNumberMapping').returns(true); args.connectType = 'ISV_DEBUGGER'; const config = new Map(); @@ -363,40 +274,26 @@ describe('Interactive debugger adapter - unit', () => { expect(adapter.getResponse(0).success).to.equal(true); expect(adapter.getEvents()[0].event).to.equal('sendMetric'); // launch Apex debugger expect(adapter.getEvents()[1].event).to.equal('output'); - expect( - (adapter.getEvents()[1] as OutputEvent).body.output - ).to.have.string(nls.localize('session_started_text', sessionId)); + expect((adapter.getEvents()[1] as OutputEvent).body.output).to.have.string( + nls.localize('session_started_text', sessionId) + ); expect(adapter.getEvents()[2].event).to.equal('sendMetric'); // ISV debugger started successfully expect(adapter.getEvents()[3].event).to.equal('initialized'); expect(sessionUserFilterSpy.calledOnce).to.equal(true); expect(sessionEntryFilterSpy.calledOnce).to.equal(true); expect(sessionRequestFilterSpy.calledOnce).to.equal(true); - expect(sessionUserFilterSpy.getCall(0).args).to.have.same.members([ - '005FAKE1,005FAKE2' - ]); - expect(sessionEntryFilterSpy.getCall(0).args).to.have.same.members([ - 'entry' - ]); - expect(sessionRequestFilterSpy.getCall(0).args).to.have.same.members([ - 'RUN_TESTS_SYNCHRONOUS,EXECUTE_ANONYMOUS' - ]); + expect(sessionUserFilterSpy.getCall(0).args).to.have.same.members(['005FAKE1,005FAKE2']); + expect(sessionEntryFilterSpy.getCall(0).args).to.have.same.members(['entry']); + expect(sessionRequestFilterSpy.getCall(0).args).to.have.same.members(['RUN_TESTS_SYNCHRONOUS,EXECUTE_ANONYMOUS']); expect(resetIdleTimersSpy.calledOnce).to.equal(true); }); it('Should popup error message when org-isv-debugger-sid and/or org-isv-debugger-url config variables are not set (ISV debugger)', async () => { const sessionId = '07aFAKE'; - sessionStartSpy = sinon - .stub(SessionService.prototype, 'start') - .returns(Promise.resolve(sessionId)); - sessionConnectedSpy = sinon - .stub(SessionService.prototype, 'isConnected') - .returns(true); - streamingSubscribeSpy = sinon - .stub(StreamingService.prototype, 'subscribe') - .returns(Promise.resolve(true)); - breakpointHasLineNumberMappingSpy = sinon - .stub(BreakpointService.prototype, 'hasLineNumberMapping') - .returns(true); + sessionStartSpy = sinon.stub(SessionService.prototype, 'start').returns(Promise.resolve(sessionId)); + sessionConnectedSpy = sinon.stub(SessionService.prototype, 'isConnected').returns(true); + streamingSubscribeSpy = sinon.stub(StreamingService.prototype, 'subscribe').returns(Promise.resolve(true)); + breakpointHasLineNumberMappingSpy = sinon.stub(BreakpointService.prototype, 'hasLineNumberMapping').returns(true); args.connectType = 'ISV_DEBUGGER'; const config = new Map(); @@ -411,9 +308,7 @@ describe('Interactive debugger adapter - unit', () => { expect(sessionStartSpy.calledOnce).to.equal(false); // false because the session doesn't start if the error message pops up expect(adapter.getResponse(0).success).to.equal(false); - expect(adapter.getResponse(0).message).to.equal( - nls.localize('invalid_isv_project_config') - ); + expect(adapter.getResponse(0).message).to.equal(nls.localize('invalid_isv_project_config')); expect(adapter.getEvents()[0].event).to.equal('sendMetric'); // launch Apex debugger expect(adapter.getEvents()[1].event).to.equal('sendMetric'); // ISV debugger failed to launch because nonexistent config variables were set @@ -427,21 +322,11 @@ describe('Interactive debugger adapter - unit', () => { it('Should configure tracing with boolean', async () => { const sessionId = '07aFAKE'; - sessionPrintToDebugSpy = sinon - .stub(ApexDebugForTest.prototype, 'printToDebugConsole') - .returns(Promise.resolve()); - sessionStartSpy = sinon - .stub(SessionService.prototype, 'start') - .returns(Promise.resolve(sessionId)); - sessionConnectedSpy = sinon - .stub(SessionService.prototype, 'isConnected') - .returns(true); - streamingSubscribeSpy = sinon - .stub(StreamingService.prototype, 'subscribe') - .returns(Promise.resolve(true)); - breakpointHasLineNumberMappingSpy = sinon - .stub(BreakpointService.prototype, 'hasLineNumberMapping') - .returns(true); + sessionPrintToDebugSpy = sinon.stub(ApexDebugForTest.prototype, 'printToDebugConsole').returns(Promise.resolve()); + sessionStartSpy = sinon.stub(SessionService.prototype, 'start').returns(Promise.resolve(sessionId)); + sessionConnectedSpy = sinon.stub(SessionService.prototype, 'isConnected').returns(true); + streamingSubscribeSpy = sinon.stub(StreamingService.prototype, 'subscribe').returns(Promise.resolve(true)); + breakpointHasLineNumberMappingSpy = sinon.stub(BreakpointService.prototype, 'hasLineNumberMapping').returns(true); // given args.trace = true; @@ -457,21 +342,11 @@ describe('Interactive debugger adapter - unit', () => { it('Should not do any tracing by default', async () => { const sessionId = '07aFAKE'; - sessionPrintToDebugSpy = sinon - .stub(ApexDebugForTest.prototype, 'printToDebugConsole') - .returns(Promise.resolve()); - sessionStartSpy = sinon - .stub(SessionService.prototype, 'start') - .returns(Promise.resolve(sessionId)); - sessionConnectedSpy = sinon - .stub(SessionService.prototype, 'isConnected') - .returns(true); - streamingSubscribeSpy = sinon - .stub(StreamingService.prototype, 'subscribe') - .returns(Promise.resolve(true)); - breakpointHasLineNumberMappingSpy = sinon - .stub(BreakpointService.prototype, 'hasLineNumberMapping') - .returns(true); + sessionPrintToDebugSpy = sinon.stub(ApexDebugForTest.prototype, 'printToDebugConsole').returns(Promise.resolve()); + sessionStartSpy = sinon.stub(SessionService.prototype, 'start').returns(Promise.resolve(sessionId)); + sessionConnectedSpy = sinon.stub(SessionService.prototype, 'isConnected').returns(true); + streamingSubscribeSpy = sinon.stub(StreamingService.prototype, 'subscribe').returns(Promise.resolve(true)); + breakpointHasLineNumberMappingSpy = sinon.stub(BreakpointService.prototype, 'hasLineNumberMapping').returns(true); // given await adapter.launchRequest(initializedResponse, args); @@ -486,21 +361,11 @@ describe('Interactive debugger adapter - unit', () => { it('Should configure tracing for specific category only', async () => { const sessionId = '07aFAKE'; - sessionPrintToDebugSpy = sinon - .stub(ApexDebugForTest.prototype, 'printToDebugConsole') - .returns(Promise.resolve()); - sessionStartSpy = sinon - .stub(SessionService.prototype, 'start') - .returns(Promise.resolve(sessionId)); - sessionConnectedSpy = sinon - .stub(SessionService.prototype, 'isConnected') - .returns(true); - streamingSubscribeSpy = sinon - .stub(StreamingService.prototype, 'subscribe') - .returns(Promise.resolve(true)); - breakpointHasLineNumberMappingSpy = sinon - .stub(BreakpointService.prototype, 'hasLineNumberMapping') - .returns(true); + sessionPrintToDebugSpy = sinon.stub(ApexDebugForTest.prototype, 'printToDebugConsole').returns(Promise.resolve()); + sessionStartSpy = sinon.stub(SessionService.prototype, 'start').returns(Promise.resolve(sessionId)); + sessionConnectedSpy = sinon.stub(SessionService.prototype, 'isConnected').returns(true); + streamingSubscribeSpy = sinon.stub(StreamingService.prototype, 'subscribe').returns(Promise.resolve(true)); + breakpointHasLineNumberMappingSpy = sinon.stub(BreakpointService.prototype, 'hasLineNumberMapping').returns(true); // given args.trace = 'variables, launch, protocol'; @@ -518,21 +383,11 @@ describe('Interactive debugger adapter - unit', () => { it('Should configure tracing for all categories', async () => { const sessionId = '07aFAKE'; - sessionPrintToDebugSpy = sinon - .stub(ApexDebugForTest.prototype, 'printToDebugConsole') - .returns(Promise.resolve()); - sessionStartSpy = sinon - .stub(SessionService.prototype, 'start') - .returns(Promise.resolve(sessionId)); - sessionConnectedSpy = sinon - .stub(SessionService.prototype, 'isConnected') - .returns(true); - streamingSubscribeSpy = sinon - .stub(StreamingService.prototype, 'subscribe') - .returns(Promise.resolve(true)); - breakpointHasLineNumberMappingSpy = sinon - .stub(BreakpointService.prototype, 'hasLineNumberMapping') - .returns(true); + sessionPrintToDebugSpy = sinon.stub(ApexDebugForTest.prototype, 'printToDebugConsole').returns(Promise.resolve()); + sessionStartSpy = sinon.stub(SessionService.prototype, 'start').returns(Promise.resolve(sessionId)); + sessionConnectedSpy = sinon.stub(SessionService.prototype, 'isConnected').returns(true); + streamingSubscribeSpy = sinon.stub(StreamingService.prototype, 'subscribe').returns(Promise.resolve(true)); + breakpointHasLineNumberMappingSpy = sinon.stub(BreakpointService.prototype, 'hasLineNumberMapping').returns(true); // given args.trace = 'all'; @@ -592,18 +447,10 @@ describe('Interactive debugger adapter - unit', () => { it('Should save proxy settings', async () => { const sessionId = '07aFAKE'; - sessionStartSpy = sinon - .stub(SessionService.prototype, 'start') - .returns(Promise.resolve(sessionId)); - sessionConnectedSpy = sinon - .stub(SessionService.prototype, 'isConnected') - .returns(true); - streamingSubscribeSpy = sinon - .stub(StreamingService.prototype, 'subscribe') - .returns(Promise.resolve(true)); - breakpointHasLineNumberMappingSpy = sinon - .stub(BreakpointService.prototype, 'hasLineNumberMapping') - .returns(true); + sessionStartSpy = sinon.stub(SessionService.prototype, 'start').returns(Promise.resolve(sessionId)); + sessionConnectedSpy = sinon.stub(SessionService.prototype, 'isConnected').returns(true); + streamingSubscribeSpy = sinon.stub(StreamingService.prototype, 'subscribe').returns(Promise.resolve(true)); + breakpointHasLineNumberMappingSpy = sinon.stub(BreakpointService.prototype, 'hasLineNumberMapping').returns(true); args = { salesforceProject: 'some/project/path', @@ -620,12 +467,8 @@ describe('Interactive debugger adapter - unit', () => { expect(requestService.proxyUrl).to.equal('http://localhost:443'); expect(requestService.proxyStrictSSL).to.equal(false); expect(requestService.proxyAuthorization).to.equal('Basic 123'); - expect(requestService.connectionTimeoutMs).to.equal( - DEFAULT_CONNECTION_TIMEOUT_MS - ); - expect(requestService.instanceUrl).to.equal( - 'https://na15.salesforce.com' - ); + expect(requestService.connectionTimeoutMs).to.equal(DEFAULT_CONNECTION_TIMEOUT_MS); + expect(requestService.instanceUrl).to.equal('https://na15.salesforce.com'); expect(requestService.accessToken).to.equal('00DxxFaK3T0ken'); }); @@ -658,27 +501,15 @@ describe('Interactive debugger adapter - unit', () => { let streamingSubscribeSpy: sinon.SinonStub; beforeEach(() => { - adapter.initializeReq( - initializedResponse, - {} as DebugProtocol.InitializeRequestArguments - ); + adapter.initializeReq(initializedResponse, {} as DebugProtocol.InitializeRequestArguments); orgInfoSpy = sinon.stub(OrgDisplay.prototype, 'getOrgInfo').returns({ instanceUrl: 'https://na15.salesforce.com', accessToken: '00DxxFaK3T0ken' } as OrgInfo); - setValidLinesSpy = sinon.spy( - BreakpointService.prototype, - 'setValidLines' - ); - sessionStartSpy = sinon - .stub(SessionService.prototype, 'start') - .returns(Promise.resolve('07aFAKE')); - sessionConnectedSpy = sinon - .stub(SessionService.prototype, 'isConnected') - .returns(true); - streamingSubscribeSpy = sinon - .stub(StreamingService.prototype, 'subscribe') - .returns(Promise.resolve(true)); + setValidLinesSpy = sinon.spy(BreakpointService.prototype, 'setValidLines'); + sessionStartSpy = sinon.stub(SessionService.prototype, 'start').returns(Promise.resolve('07aFAKE')); + sessionConnectedSpy = sinon.stub(SessionService.prototype, 'isConnected').returns(true); + streamingSubscribeSpy = sinon.stub(StreamingService.prototype, 'subscribe').returns(Promise.resolve(true)); }); afterEach(() => { @@ -703,9 +534,7 @@ describe('Interactive debugger adapter - unit', () => { expect(setValidLinesSpy.called).to.equal(false); expect(adapter.getResponse(0).success).to.equal(false); - expect(adapter.getResponse(0).message).to.equal( - nls.localize('session_language_server_error_text') - ); + expect(adapter.getResponse(0).message).to.equal(nls.localize('session_language_server_error_text')); }); it('Should save line number mapping', async () => { @@ -715,8 +544,7 @@ describe('Interactive debugger adapter - unit', () => { { uri: 'file:///bar.cls', typeref: 'bar', lines: [1, 2, 3] }, { uri: 'file:///bar.cls', typeref: 'bar$inner', lines: [4, 5, 6] } ]; - const expectedLineNumberMapping: Map = - new Map(); + const expectedLineNumberMapping: Map = new Map(); const expectedTyperefMapping: Map = new Map(); expectedLineNumberMapping.set('file:///foo.cls', [ { typeref: 'foo', lines: [1, 2, 3] }, @@ -736,12 +564,8 @@ describe('Interactive debugger adapter - unit', () => { expect(setValidLinesSpy.calledOnce).to.equal(true); expect(setValidLinesSpy.getCall(0).args.length).to.equal(2); - expect(setValidLinesSpy.getCall(0).args[0]).to.deep.equal( - expectedLineNumberMapping - ); - expect(setValidLinesSpy.getCall(0).args[1]).to.deep.equal( - expectedTyperefMapping - ); + expect(setValidLinesSpy.getCall(0).args[0]).to.deep.equal(expectedLineNumberMapping); + expect(setValidLinesSpy.getCall(0).args[1]).to.deep.equal(expectedTyperefMapping); expect(adapter.getResponse(0)).to.deep.equal(initializedResponse); expect(adapter.getResponse(1).success).to.equal(true); }); @@ -775,9 +599,7 @@ describe('Interactive debugger adapter - unit', () => { setTimeout(() => { expect(adapter.getEvents()[0].event).to.equal('output'); - expect( - (adapter.getEvents()[0] as OutputEvent).body.output - ).to.have.string( + expect((adapter.getEvents()[0] as OutputEvent).body.output).to.have.string( nls.localize( 'idle_warn_text', DEFAULT_IDLE_WARN1_MS / 60000, @@ -789,9 +611,7 @@ describe('Interactive debugger adapter - unit', () => { setTimeout(() => { expect(adapter.getEvents()[1].event).to.equal('output'); - expect( - (adapter.getEvents()[1] as OutputEvent).body.output - ).to.have.string( + expect((adapter.getEvents()[1] as OutputEvent).body.output).to.have.string( nls.localize( 'idle_warn_text', DEFAULT_IDLE_WARN2_MS / 60000, @@ -803,9 +623,7 @@ describe('Interactive debugger adapter - unit', () => { setTimeout(() => { expect(adapter.getEvents()[2].event).to.equal('output'); - expect( - (adapter.getEvents()[2] as OutputEvent).body.output - ).to.have.string( + expect((adapter.getEvents()[2] as OutputEvent).body.output).to.have.string( nls.localize( 'idle_warn_text', DEFAULT_IDLE_WARN3_MS / 60000, @@ -817,9 +635,7 @@ describe('Interactive debugger adapter - unit', () => { setTimeout(() => { expect(adapter.getEvents()[3].event).to.equal('output'); - expect( - (adapter.getEvents()[3] as OutputEvent).body.output - ).to.have.string( + expect((adapter.getEvents()[3] as OutputEvent).body.output).to.have.string( nls.localize('idle_terminated_text', DEFAULT_IDLE_TIMEOUT_MS / 60000) ); expect(adapter.getEvents()[4].event).to.equal('terminated'); @@ -838,18 +654,9 @@ describe('Interactive debugger adapter - unit', () => { let args: DebugProtocol.DisconnectArguments; beforeEach(() => { - streamingDisconnectSpy = sinon.stub( - StreamingService.prototype, - 'disconnect' - ); - breakpointClearSpy = sinon.spy( - BreakpointService.prototype, - 'clearSavedBreakpoints' - ); - clearIdleTimersSpy = sinon.spy( - ApexDebugForTest.prototype, - 'clearIdleTimers' - ); + streamingDisconnectSpy = sinon.stub(StreamingService.prototype, 'disconnect'); + breakpointClearSpy = sinon.spy(BreakpointService.prototype, 'clearSavedBreakpoints'); + clearIdleTimersSpy = sinon.spy(ApexDebugForTest.prototype, 'clearIdleTimers'); response = { command: '', success: true, @@ -871,9 +678,7 @@ describe('Interactive debugger adapter - unit', () => { }); it('Should not use session service if not connected', async () => { - sessionConnectedSpy = sinon - .stub(SessionService.prototype, 'isConnected') - .returns(false); + sessionConnectedSpy = sinon.stub(SessionService.prototype, 'isConnected').returns(false); await adapter.disconnectReq(response, args); @@ -885,9 +690,7 @@ describe('Interactive debugger adapter - unit', () => { it('Should try to disconnect and stop', async () => { const sessionId = '07aFAKE'; - sessionStopSpy = sinon - .stub(SessionService.prototype, 'stop') - .returns(Promise.resolve(sessionId)); + sessionStopSpy = sinon.stub(SessionService.prototype, 'stop').returns(Promise.resolve(sessionId)); sessionConnectedSpy = sinon.stub(SessionService.prototype, 'isConnected'); sessionConnectedSpy.onCall(0).returns(true); sessionConnectedSpy.onCall(1).returns(false); @@ -896,9 +699,9 @@ describe('Interactive debugger adapter - unit', () => { expect(sessionStopSpy.calledOnce).to.equal(true); expect(adapter.getResponse(0)).to.deep.equal(response); - expect( - (adapter.getEvents()[0] as OutputEvent).body.output - ).to.have.string(nls.localize('session_terminated_text', sessionId)); + expect((adapter.getEvents()[0] as OutputEvent).body.output).to.have.string( + nls.localize('session_terminated_text', sessionId) + ); expect(streamingDisconnectSpy.calledOnce).to.equal(true); expect(breakpointClearSpy.called).to.equal(false); expect(clearIdleTimersSpy.calledOnce).to.equal(true); @@ -907,11 +710,7 @@ describe('Interactive debugger adapter - unit', () => { it('Should try to disconnect and not stop', async () => { sessionStopSpy = sinon .stub(SessionService.prototype, 'stop') - .returns( - Promise.reject( - '{"message":"There was an error", "action":"Try again"}' - ) - ); + .returns(Promise.reject('{"message":"There was an error", "action":"Try again"}')); sessionConnectedSpy = sinon.stub(SessionService.prototype, 'isConnected'); sessionConnectedSpy.onCall(0).returns(true); sessionConnectedSpy.onCall(1).returns(true); @@ -922,9 +721,7 @@ describe('Interactive debugger adapter - unit', () => { expect(adapter.getResponse(0).success).to.equal(false); expect(adapter.getResponse(0).message).to.equal('There was an error'); expect(adapter.getEvents()[0].event).to.equal('output'); - expect( - (adapter.getEvents()[0] as OutputEvent).body.output - ).to.have.string('Try again'); + expect((adapter.getEvents()[0] as OutputEvent).body.output).to.have.string('Try again'); expect(streamingDisconnectSpy.calledOnce).to.equal(true); expect(breakpointClearSpy.called).to.equal(false); expect(clearIdleTimersSpy.calledOnce).to.equal(true); @@ -941,25 +738,11 @@ describe('Interactive debugger adapter - unit', () => { let lockSpy: sinon.SinonSpy; beforeEach(() => { - breakpointGetSpy = sinon.spy( - BreakpointService.prototype, - 'getBreakpointsFor' - ); - breakpointGetTyperefSpy = sinon.spy( - BreakpointService.prototype, - 'getTyperefFor' - ); - breakpointCreateSpy = sinon.spy( - BreakpointService.prototype, - 'createLineBreakpoint' - ); - breakpointCacheSpy = sinon.spy( - BreakpointService.prototype, - 'cacheLineBreakpoint' - ); - sessionIdSpy = sinon - .stub(SessionService.prototype, 'getSessionId') - .returns('07aFAKE'); + breakpointGetSpy = sinon.spy(BreakpointService.prototype, 'getBreakpointsFor'); + breakpointGetTyperefSpy = sinon.spy(BreakpointService.prototype, 'getTyperefFor'); + breakpointCreateSpy = sinon.spy(BreakpointService.prototype, 'createLineBreakpoint'); + breakpointCacheSpy = sinon.spy(BreakpointService.prototype, 'cacheLineBreakpoint'); + sessionIdSpy = sinon.stub(SessionService.prototype, 'getSessionId').returns('07aFAKE'); lockSpy = sinon.spy(AsyncLock.prototype, 'acquire'); }); @@ -990,15 +773,12 @@ describe('Interactive debugger adapter - unit', () => { .returns(Promise.resolve(new Set().add(1))); adapter.setSalesforceProject('someProjectPath'); - await adapter.setBreakPointsReq( - {} as DebugProtocol.SetBreakpointsResponse, - { - source: { - path: 'foo.cls' - }, - lines: bpLines - } - ); + await adapter.setBreakPointsReq({} as DebugProtocol.SetBreakpointsResponse, { + source: { + path: 'foo.cls' + }, + lines: bpLines + }); expect(lockSpy.calledOnce).to.equal(true); expect(lockSpy.getCall(0).args[0]).to.equal('breakpoint-file:///foo.cls'); @@ -1045,15 +825,12 @@ describe('Interactive debugger adapter - unit', () => { .returns(Promise.resolve(bpLines)); adapter.setSalesforceProject('someProjectPath'); - await adapter.setBreakPointsReq( - {} as DebugProtocol.SetBreakpointsResponse, - { - source: { - path: undefined - }, - lines: bpLines - } - ); + await adapter.setBreakPointsReq({} as DebugProtocol.SetBreakpointsResponse, { + source: { + path: undefined + }, + lines: bpLines + }); expect(breakpointReconcileSpy.called).to.equal(false); expect(breakpointGetTyperefSpy.called).to.equal(false); @@ -1073,15 +850,12 @@ describe('Interactive debugger adapter - unit', () => { .returns(Promise.resolve(bpLines)); adapter.setSalesforceProject('someProjectPath'); - await adapter.setBreakPointsReq( - {} as DebugProtocol.SetBreakpointsResponse, - { - source: { - path: 'foo.cls' - }, - lines: undefined - } - ); + await adapter.setBreakPointsReq({} as DebugProtocol.SetBreakpointsResponse, { + source: { + path: 'foo.cls' + }, + lines: undefined + }); expect(breakpointReconcileSpy.called).to.equal(false); expect(breakpointGetTyperefSpy.called).to.equal(false); @@ -1108,9 +882,7 @@ describe('Interactive debugger adapter - unit', () => { }); it('Should continue successfully', async () => { - runSpy = sinon - .stub(RequestService.prototype, 'execute') - .returns(Promise.resolve('')); + runSpy = sinon.stub(RequestService.prototype, 'execute').returns(Promise.resolve('')); await adapter.continueReq( {} as DebugProtocol.ContinueResponse, @@ -1124,9 +896,7 @@ describe('Interactive debugger adapter - unit', () => { }); it('Should not continue unknown thread', async () => { - runSpy = sinon - .stub(RequestService.prototype, 'execute') - .returns(Promise.resolve('')); + runSpy = sinon.stub(RequestService.prototype, 'execute').returns(Promise.resolve('')); await adapter.continueReq( {} as DebugProtocol.ContinueResponse, @@ -1141,9 +911,7 @@ describe('Interactive debugger adapter - unit', () => { it('Should handle run command error response', async () => { runSpy = sinon .stub(RequestService.prototype, 'execute') - .returns( - Promise.reject({ message: 'There was an error', action: 'Try again' }) - ); + .returns(Promise.reject({ message: 'There was an error', action: 'Try again' })); await adapter.continueReq( {} as DebugProtocol.ContinueResponse, @@ -1169,14 +937,9 @@ describe('Interactive debugger adapter - unit', () => { }); it('Step into should call proper command', async () => { - stepSpy = sinon - .stub(RequestService.prototype, 'execute') - .returns(Promise.resolve('')); + stepSpy = sinon.stub(RequestService.prototype, 'execute').returns(Promise.resolve('')); - await adapter.stepInRequest( - {} as DebugProtocol.StepInResponse, - { threadId: 1 } as DebugProtocol.StepInArguments - ); + await adapter.stepInRequest({} as DebugProtocol.StepInResponse, { threadId: 1 } as DebugProtocol.StepInArguments); expect(adapter.getResponse(0).success).to.equal(true); expect(stepSpy.calledOnce).to.equal(true); @@ -1184,9 +947,7 @@ describe('Interactive debugger adapter - unit', () => { }); it('Step out should send proper command', async () => { - stepSpy = sinon - .stub(RequestService.prototype, 'execute') - .returns(Promise.resolve('')); + stepSpy = sinon.stub(RequestService.prototype, 'execute').returns(Promise.resolve('')); await adapter.stepOutRequest( {} as DebugProtocol.StepOutResponse, @@ -1199,14 +960,9 @@ describe('Interactive debugger adapter - unit', () => { }); it('Step over should send proper command', async () => { - stepSpy = sinon - .stub(RequestService.prototype, 'execute') - .returns(Promise.resolve('')); + stepSpy = sinon.stub(RequestService.prototype, 'execute').returns(Promise.resolve('')); - await adapter.nextRequest( - {} as DebugProtocol.NextResponse, - { threadId: 1 } as DebugProtocol.NextArguments - ); + await adapter.nextRequest({} as DebugProtocol.NextResponse, { threadId: 1 } as DebugProtocol.NextArguments); expect(adapter.getResponse(0).success).to.equal(true); expect(stepSpy.calledOnce).to.equal(true); @@ -1260,9 +1016,7 @@ describe('Interactive debugger adapter - unit', () => { }); it('Should not get state of unknown thread', async () => { - stateSpy = sinon - .stub(RequestService.prototype, 'execute') - .returns(Promise.resolve('{}')); + stateSpy = sinon.stub(RequestService.prototype, 'execute').returns(Promise.resolve('{}')); await adapter.stackTraceRequest( {} as DebugProtocol.StackTraceResponse, @@ -1276,11 +1030,7 @@ describe('Interactive debugger adapter - unit', () => { it('Should return response with empty stackframes', async () => { stateSpy = sinon .stub(RequestService.prototype, 'execute') - .returns( - Promise.resolve( - '{"stateResponse":{"state":{"stack":{"stackFrame":[]}}}}' - ) - ); + .returns(Promise.resolve('{"stateResponse":{"state":{"stack":{"stackFrame":[]}}}}')); await adapter.stackTraceRequest( {} as DebugProtocol.StackTraceResponse, @@ -1288,9 +1038,7 @@ describe('Interactive debugger adapter - unit', () => { ); expect(stateSpy.called).to.equal(true); - const response = adapter.getResponse( - 0 - ) as DebugProtocol.StackTraceResponse; + const response = adapter.getResponse(0) as DebugProtocol.StackTraceResponse; expect(response.success).to.equal(true); expect(response.body.stackFrames.length).to.equal(0); }); @@ -1304,9 +1052,7 @@ describe('Interactive debugger adapter - unit', () => { ) ); const fileUri = 'file:///foo.cls'; - sourcePathSpy = sinon - .stub(BreakpointService.prototype, 'getSourcePathFromTyperef') - .returns(fileUri); + sourcePathSpy = sinon.stub(BreakpointService.prototype, 'getSourcePathFromTyperef').returns(fileUri); await adapter.stackTraceRequest( {} as DebugProtocol.StackTraceResponse, @@ -1317,29 +1063,15 @@ describe('Interactive debugger adapter - unit', () => { expect(lockSpy.getCall(0).args[0]).to.equal('stacktrace'); expect(stateSpy.called).to.equal(true); expect(stateSpy.getCall(0).args[0]).to.be.instanceof(StateCommand); - const response = adapter.getResponse( - 0 - ) as DebugProtocol.StackTraceResponse; + const response = adapter.getResponse(0) as DebugProtocol.StackTraceResponse; expect(response.success).to.equal(true); const stackFrames = response.body.stackFrames; expect(stackFrames.length).to.equal(2); expect(stackFrames[0]).to.deep.equal( - new StackFrame( - 1000, - 'FooDebug.test()', - new Source('foo.cls', Uri.parse(fileUri).fsPath), - 1, - 0 - ) + new StackFrame(1000, 'FooDebug.test()', new Source('foo.cls', Uri.parse(fileUri).fsPath), 1, 0) ); expect(stackFrames[1]).to.deep.equal( - new StackFrame( - 1001, - 'BarDebug.test()', - new Source('foo.cls', Uri.parse(fileUri).fsPath), - 2, - 0 - ) + new StackFrame(1001, 'BarDebug.test()', new Source('foo.cls', Uri.parse(fileUri).fsPath), 2, 0) ); }); @@ -1358,23 +1090,17 @@ describe('Interactive debugger adapter - unit', () => { ); expect(stateSpy.called).to.equal(true); - const response = adapter.getResponse( - 0 - ) as DebugProtocol.StackTraceResponse; + const response = adapter.getResponse(0) as DebugProtocol.StackTraceResponse; expect(response.success).to.equal(true); const stackFrames = response.body.stackFrames; expect(stackFrames.length).to.equal(1); - expect(stackFrames[0]).to.deep.equal( - new StackFrame(1000, 'anon.execute()', undefined, 2, 0) - ); + expect(stackFrames[0]).to.deep.equal(new StackFrame(1000, 'anon.execute()', undefined, 2, 0)); }); it('Should handle state command error response', async () => { stateSpy = sinon .stub(RequestService.prototype, 'execute') - .returns( - Promise.reject({ message: 'There was an error', action: 'Try again' }) - ); + .returns(Promise.reject({ message: 'There was an error', action: 'Try again' })); await adapter.stackTraceRequest( {} as DebugProtocol.StackTraceResponse, @@ -1390,18 +1116,12 @@ describe('Interactive debugger adapter - unit', () => { describe('Custom request', () => { describe('Hotswap warning', () => { it('Should log warning to debug console', () => { - adapter.customRequest( - HOTSWAP_REQUEST, - {} as DebugProtocol.Response, - undefined - ); + adapter.customRequest(HOTSWAP_REQUEST, {} as DebugProtocol.Response, undefined); expect(adapter.getEvents().length).to.equal(1); expect(adapter.getEvents()[0].event).to.equal('output'); const outputEvent = adapter.getEvents()[0] as DebugProtocol.OutputEvent; - expect(outputEvent.body.output).to.have.string( - nls.localize('hotswap_warn_text') - ); + expect(outputEvent.body.output).to.have.string(nls.localize('hotswap_warn_text')); expect(outputEvent.body.category).to.equal('console'); }); }); @@ -1417,9 +1137,7 @@ describe('Interactive debugger adapter - unit', () => { reconcileExceptionBreakpointSpy = sinon .stub(BreakpointService.prototype, 'reconcileExceptionBreakpoints') .returns(Promise.resolve()); - sessionIdSpy = sinon - .stub(SessionService.prototype, 'getSessionId') - .returns('07aFAKE'); + sessionIdSpy = sinon.stub(SessionService.prototype, 'getSessionId').returns('07aFAKE'); }); afterEach(() => { @@ -1437,31 +1155,17 @@ describe('Interactive debugger adapter - unit', () => { uri: 'file:///fooexception.cls' } } as SetExceptionBreakpointsArguments; - await adapter.customRequest( - EXCEPTION_BREAKPOINT_REQUEST, - {} as DebugProtocol.Response, - requestArg - ); + await adapter.customRequest(EXCEPTION_BREAKPOINT_REQUEST, {} as DebugProtocol.Response, requestArg); expect(lockSpy.calledOnce).to.equal(true); expect(lockSpy.getCall(0).args[0]).to.equal('exception-breakpoint'); expect(reconcileExceptionBreakpointSpy.calledOnce).to.equal(true); - expect(reconcileExceptionBreakpointSpy.getCall(0).args.length).to.equal( - 3 - ); - expect(reconcileExceptionBreakpointSpy.getCall(0).args[0]).to.equal( - 'someProjectPath' - ); - expect(reconcileExceptionBreakpointSpy.getCall(0).args[1]).to.equal( - '07aFAKE' - ); - expect( - reconcileExceptionBreakpointSpy.getCall(0).args[2] - ).to.deep.equal(requestArg.exceptionInfo); + expect(reconcileExceptionBreakpointSpy.getCall(0).args.length).to.equal(3); + expect(reconcileExceptionBreakpointSpy.getCall(0).args[0]).to.equal('someProjectPath'); + expect(reconcileExceptionBreakpointSpy.getCall(0).args[1]).to.equal('07aFAKE'); + expect(reconcileExceptionBreakpointSpy.getCall(0).args[2]).to.deep.equal(requestArg.exceptionInfo); expect(adapter.getEvents()[0].event).to.equal('output'); - expect( - (adapter.getEvents()[0] as OutputEvent).body.output - ).to.have.string( + expect((adapter.getEvents()[0] as OutputEvent).body.output).to.have.string( nls.localize('created_exception_breakpoint_text', 'fooexception') ); }); @@ -1476,31 +1180,17 @@ describe('Interactive debugger adapter - unit', () => { } } as SetExceptionBreakpointsArguments; - await adapter.customRequest( - EXCEPTION_BREAKPOINT_REQUEST, - {} as DebugProtocol.Response, - requestArg - ); + await adapter.customRequest(EXCEPTION_BREAKPOINT_REQUEST, {} as DebugProtocol.Response, requestArg); expect(lockSpy.calledOnce).to.equal(true); expect(lockSpy.getCall(0).args[0]).to.equal('exception-breakpoint'); expect(reconcileExceptionBreakpointSpy.calledOnce).to.equal(true); - expect(reconcileExceptionBreakpointSpy.getCall(0).args.length).to.equal( - 3 - ); - expect(reconcileExceptionBreakpointSpy.getCall(0).args[0]).to.equal( - 'someProjectPath' - ); - expect(reconcileExceptionBreakpointSpy.getCall(0).args[1]).to.equal( - '07aFAKE' - ); - expect( - reconcileExceptionBreakpointSpy.getCall(0).args[2] - ).to.deep.equal(requestArg.exceptionInfo); + expect(reconcileExceptionBreakpointSpy.getCall(0).args.length).to.equal(3); + expect(reconcileExceptionBreakpointSpy.getCall(0).args[0]).to.equal('someProjectPath'); + expect(reconcileExceptionBreakpointSpy.getCall(0).args[1]).to.equal('07aFAKE'); + expect(reconcileExceptionBreakpointSpy.getCall(0).args[2]).to.deep.equal(requestArg.exceptionInfo); expect(adapter.getEvents()[0].event).to.equal('output'); - expect( - (adapter.getEvents()[0] as OutputEvent).body.output - ).to.have.string( + expect((adapter.getEvents()[0] as OutputEvent).body.output).to.have.string( nls.localize('removed_exception_breakpoint_text', 'fooexception') ); }); @@ -1515,36 +1205,20 @@ describe('Interactive debugger adapter - unit', () => { } } as SetExceptionBreakpointsArguments; - await adapter.customRequest( - EXCEPTION_BREAKPOINT_REQUEST, - {} as DebugProtocol.Response, - requestArg - ); + await adapter.customRequest(EXCEPTION_BREAKPOINT_REQUEST, {} as DebugProtocol.Response, requestArg); expect(lockSpy.calledOnce).to.equal(true); expect(lockSpy.getCall(0).args[0]).to.equal('exception-breakpoint'); expect(reconcileExceptionBreakpointSpy.calledOnce).to.equal(true); - expect(reconcileExceptionBreakpointSpy.getCall(0).args.length).to.equal( - 3 - ); - expect(reconcileExceptionBreakpointSpy.getCall(0).args[0]).to.equal( - 'someProjectPath' - ); - expect(reconcileExceptionBreakpointSpy.getCall(0).args[1]).to.equal( - '07aFAKE' - ); - expect( - reconcileExceptionBreakpointSpy.getCall(0).args[2] - ).to.deep.equal(requestArg.exceptionInfo); + expect(reconcileExceptionBreakpointSpy.getCall(0).args.length).to.equal(3); + expect(reconcileExceptionBreakpointSpy.getCall(0).args[0]).to.equal('someProjectPath'); + expect(reconcileExceptionBreakpointSpy.getCall(0).args[1]).to.equal('07aFAKE'); + expect(reconcileExceptionBreakpointSpy.getCall(0).args[2]).to.deep.equal(requestArg.exceptionInfo); expect(adapter.getEvents().length).to.equal(0); }); it('Should not call breakpoint service with undefined request args', async () => { - await adapter.customRequest( - EXCEPTION_BREAKPOINT_REQUEST, - {} as DebugProtocol.Response, - undefined - ); + await adapter.customRequest(EXCEPTION_BREAKPOINT_REQUEST, {} as DebugProtocol.Response, undefined); expect(lockSpy.called).to.equal(false); expect(reconcileExceptionBreakpointSpy.called).to.equal(false); @@ -1580,18 +1254,11 @@ describe('Interactive debugger adapter - unit', () => { }); it('Should return list of breakpoint typerefs', async () => { - await adapter.customRequest( - LIST_EXCEPTION_BREAKPOINTS_REQUEST, - {} as DebugProtocol.Response, - undefined - ); + await adapter.customRequest(LIST_EXCEPTION_BREAKPOINTS_REQUEST, {} as DebugProtocol.Response, undefined); expect(getExceptionBreakpointCacheSpy.calledOnce).to.equal(true); expect(adapter.getResponse(0).success).to.equal(true); - expect(adapter.getResponse(0).body.typerefs).to.have.same.members([ - 'fooexception', - 'barexception' - ]); + expect(adapter.getResponse(0).body.typerefs).to.have.same.members(['fooexception', 'barexception']); }); }); }); @@ -1599,17 +1266,14 @@ describe('Interactive debugger adapter - unit', () => { describe('Logging', () => { let breakpointService: BreakpointService; let response: DebugProtocol.Response; - const lineNumberMapping: Map = - new Map(); + const lineNumberMapping: Map = new Map(); const typerefMapping: Map = new Map(); const fooUri = 'file:///foo.cls'; lineNumberMapping.set(fooUri, [ { typeref: 'foo', lines: [1, 2] }, { typeref: 'foo$inner', lines: [3, 4] } ]); - lineNumberMapping.set('file:///bar.cls', [ - { typeref: 'bar', lines: [3, 4] } - ]); + lineNumberMapping.set('file:///bar.cls', [{ typeref: 'bar', lines: [3, 4] }]); typerefMapping.set('foo', fooUri); typerefMapping.set('foo$inner', fooUri); typerefMapping.set('bar', 'file:///bar.cls'); @@ -1634,35 +1298,23 @@ describe('Interactive debugger adapter - unit', () => { it('Should not log error without an error message', () => { adapter.tryToParseSfError(response, {}); - expect(response.message).to.equal( - nls.localize('unexpected_error_help_text') - ); + expect(response.message).to.equal(nls.localize('unexpected_error_help_text')); }); it('Should error to console with unexpected error schema', () => { - adapter.tryToParseSfError( - {} as DebugProtocol.Response, - '{"subject":"There was an error", "action":"Try again"}' - ); + adapter.tryToParseSfError({} as DebugProtocol.Response, '{"subject":"There was an error", "action":"Try again"}'); expect(adapter.getEvents()[0].event).to.equal('output'); - expect( - (adapter.getEvents()[0] as OutputEvent).body.output - ).to.have.string( + expect((adapter.getEvents()[0] as OutputEvent).body.output).to.have.string( '{"subject":"There was an error", "action":"Try again"}' ); }); it('Should error to console with non JSON', () => { - adapter.tryToParseSfError( - {} as DebugProtocol.Response, - 'There was an error"}' - ); + adapter.tryToParseSfError({} as DebugProtocol.Response, 'There was an error"}'); expect(adapter.getEvents()[0].event).to.equal('output'); - expect( - (adapter.getEvents()[0] as OutputEvent).body.output - ).to.have.string('There was an error'); + expect((adapter.getEvents()[0] as OutputEvent).body.output).to.have.string('There was an error'); }); it('Should log debugger event to console', () => { @@ -1698,9 +1350,7 @@ describe('Interactive debugger adapter - unit', () => { let streamingSubscribeSpy: sinon.SinonStub; beforeEach(() => { - streamingSubscribeSpy = sinon - .stub(StreamingService.prototype, 'subscribe') - .returns(Promise.resolve()); + streamingSubscribeSpy = sinon.stub(StreamingService.prototype, 'subscribe').returns(Promise.resolve()); }); afterEach(() => { @@ -1713,9 +1363,7 @@ describe('Interactive debugger adapter - unit', () => { expect(streamingSubscribeSpy.calledOnce).to.equal(true); expect(streamingSubscribeSpy.getCall(0).args.length).to.equal(4); expect(streamingSubscribeSpy.getCall(0).args[0]).to.equal('foo'); - expect(streamingSubscribeSpy.getCall(0).args[1]).to.equal( - adapter.getRequestService() - ); + expect(streamingSubscribeSpy.getCall(0).args[1]).to.equal(adapter.getRequestService()); for (const index of [2, 3]) { const obj = streamingSubscribeSpy.getCall(0).args[index]; expect(obj).to.be.instanceof(StreamingClientInfo); @@ -1745,10 +1393,7 @@ describe('Interactive debugger adapter - unit', () => { [`${SALESFORCE_EXCEPTION_PREFIX}AssertException`, '07bFAKE1'], ['namespace/fooexception', '07bFAKE2'], ['namespace/MyClass$InnerException', '07bFAKE3'], - [ - `${TRIGGER_EXCEPTION_PREFIX}namespace/MyTrigger$InnerException`, - '07bFAKE4' - ] + [`${TRIGGER_EXCEPTION_PREFIX}namespace/MyTrigger$InnerException`, '07bFAKE4'] ]); beforeEach(() => { @@ -1756,19 +1401,10 @@ describe('Interactive debugger adapter - unit', () => { .stub(BreakpointService.prototype, 'getExceptionBreakpointCache') .returns(knownExceptionBreakpoints); sessionStopSpy = sinon.spy(SessionService.prototype, 'forceStop'); - sessionConnectedSpy = sinon - .stub(SessionService.prototype, 'isConnected') - .returns(true); - sessionIdSpy = sinon - .stub(SessionService.prototype, 'getSessionId') - .returns('07aFAKE'); - eventProcessedSpy = sinon - .stub(StreamingService.prototype, 'hasProcessedEvent') - .returns(false); - markEventProcessedSpy = sinon.spy( - StreamingService.prototype, - 'markEventProcessed' - ); + sessionConnectedSpy = sinon.stub(SessionService.prototype, 'isConnected').returns(true); + sessionIdSpy = sinon.stub(SessionService.prototype, 'getSessionId').returns('07aFAKE'); + eventProcessedSpy = sinon.stub(StreamingService.prototype, 'hasProcessedEvent').returns(false); + markEventProcessedSpy = sinon.spy(StreamingService.prototype, 'markEventProcessed'); }); afterEach(() => { @@ -1795,9 +1431,7 @@ describe('Interactive debugger adapter - unit', () => { expect(sessionStopSpy.calledOnce).to.equal(true); expect(adapter.getEvents().length).to.equal(3); expect(adapter.getEvents()[0].event).to.equal('output'); - expect( - (adapter.getEvents()[0] as OutputEvent).body.output - ).to.have.string('foo'); + expect((adapter.getEvents()[0] as OutputEvent).body.output).to.have.string('foo'); expect(adapter.getEvents()[1].event).to.equal(SHOW_MESSAGE_EVENT); const showMessageEvent = adapter.getEvents()[1]; expect(showMessageEvent.body).to.deep.equal({ @@ -1825,9 +1459,7 @@ describe('Interactive debugger adapter - unit', () => { it('[SessionTerminated] - Should not stop session service if it is not connected', () => { sessionConnectedSpy.restore(); - sessionConnectedSpy = sinon - .stub(SessionService.prototype, 'isConnected') - .returns(false); + sessionConnectedSpy = sinon.stub(SessionService.prototype, 'isConnected').returns(false); const message: DebuggerMessage = { event: {} as StreamingEvent, sobject: { @@ -1876,9 +1508,7 @@ describe('Interactive debugger adapter - unit', () => { new ApexVariable(newStringValue('var1'), ApexVariableKind.Static), new ApexVariable(newStringValue('var2'), ApexVariableKind.Global) ]; - const variableReference = adapter.createVariableContainer( - new DummyContainer(variables) - ); + const variableReference = adapter.createVariableContainer(new DummyContainer(variables)); adapter.getVariableContainerReferenceByApexId().set(0, variableReference); const frameInfo = new ApexDebugStackFrameInfo('07cFAKE1', 0); const frameId = adapter.createStackFrameInfo(frameInfo); @@ -1893,13 +1523,10 @@ describe('Interactive debugger adapter - unit', () => { expect(threadEvent.body.reason).to.equal('exited'); expect(threadEvent.body.threadId).to.equal(1); // tslint:disable:no-unused-expression - expect(adapter.getVariableContainer(variableReference)).to.not.be - .undefined; + expect(adapter.getVariableContainer(variableReference)).to.not.be.undefined; expect(adapter.getStackFrameInfo(frameId)).to.not.be.undefined; // tslint:enable:no-unused-expression - expect(adapter.getVariableContainerReferenceByApexId().has(0)).to.equal( - true - ); + expect(adapter.getVariableContainerReferenceByApexId().has(0)).to.equal(true); }); it('[RequestFinished] - Should not handle unknown request', () => { @@ -1933,9 +1560,7 @@ describe('Interactive debugger adapter - unit', () => { new ApexVariable(newStringValue('var1'), ApexVariableKind.Static), new ApexVariable(newStringValue('var2'), ApexVariableKind.Global) ]; - const variableReference = adapter.createVariableContainer( - new DummyContainer(variables) - ); + const variableReference = adapter.createVariableContainer(new DummyContainer(variables)); adapter.getVariableContainerReferenceByApexId().set(0, variableReference); const frameInfo = new ApexDebugStackFrameInfo('07cFAKE1', 0); const frameId = adapter.createStackFrameInfo(frameInfo); @@ -1948,9 +1573,7 @@ describe('Interactive debugger adapter - unit', () => { expect(adapter.getVariableContainer(variableReference)).to.be.undefined; expect(adapter.getStackFrameInfo(frameId)).to.be.undefined; // tslint:enable:no-unused-expression - expect(adapter.getVariableContainerReferenceByApexId().has(0)).to.equal( - false - ); + expect(adapter.getVariableContainerReferenceByApexId().has(0)).to.equal(false); }); it('[Resumed] - Should send continued event', () => { @@ -2005,9 +1628,7 @@ describe('Interactive debugger adapter - unit', () => { new ApexVariable(newStringValue('var1'), ApexVariableKind.Static), new ApexVariable(newStringValue('var2'), ApexVariableKind.Global) ]; - const variableReference = adapter.createVariableContainer( - new DummyContainer(variables) - ); + const variableReference = adapter.createVariableContainer(new DummyContainer(variables)); adapter.getVariableContainerReferenceByApexId().set(0, variableReference); const frameInfo = new ApexDebugStackFrameInfo('07cFAKE', 0); const frameId = adapter.createStackFrameInfo(frameInfo); @@ -2024,17 +1645,12 @@ describe('Interactive debugger adapter - unit', () => { reason: '' }); expect(markEventProcessedSpy.calledOnce).to.equal(true); - expect(markEventProcessedSpy.getCall(0).args).to.have.same.members([ - ApexDebuggerEventType.Stopped, - 0 - ]); + expect(markEventProcessedSpy.getCall(0).args).to.have.same.members([ApexDebuggerEventType.Stopped, 0]); // tslint:disable:no-unused-expression expect(adapter.getVariableContainer(variableReference)).to.be.undefined; expect(adapter.getStackFrameInfo(frameId)).to.be.undefined; // tslint:enable:no-unused-expression - expect(adapter.getVariableContainerReferenceByApexId().has(0)).to.equal( - false - ); + expect(adapter.getVariableContainerReferenceByApexId().has(0)).to.equal(false); }); it('[Stopped] - Should display exception type when stopped on exception breakpoint', () => { @@ -2158,14 +1774,8 @@ describe('Interactive debugger adapter - unit', () => { adapter.handleEvent(message); - expect( - adapter.getRequestThreads().size, - 'must have no registered request thread' - ).to.equal(0); - expect( - adapter.getEvents().length, - 'must not handle an event without a request id' - ).to.equal(0); + expect(adapter.getRequestThreads().size, 'must have no registered request thread').to.equal(0); + expect(adapter.getEvents().length, 'must not handle an event without a request id').to.equal(0); }); it('[Stopped] - Should not clear variable handles', () => { @@ -2186,9 +1796,7 @@ describe('Interactive debugger adapter - unit', () => { new ApexVariable(newStringValue('var1'), ApexVariableKind.Static), new ApexVariable(newStringValue('var2'), ApexVariableKind.Global) ]; - const variableReference = adapter.createVariableContainer( - new DummyContainer(variables) - ); + const variableReference = adapter.createVariableContainer(new DummyContainer(variables)); adapter.getVariableContainerReferenceByApexId().set(0, variableReference); const frameInfo = new ApexDebugStackFrameInfo('07cFAKE2', 0); const frameId = adapter.createStackFrameInfo(frameInfo); @@ -2198,13 +1806,10 @@ describe('Interactive debugger adapter - unit', () => { expect(adapter.getRequestThreads().size).to.equal(2); expect(adapter.getEvents().length).to.equal(2); // tslint:disable:no-unused-expression - expect(adapter.getVariableContainer(variableReference)).to.not.be - .undefined; + expect(adapter.getVariableContainer(variableReference)).to.not.be.undefined; expect(adapter.getStackFrameInfo(frameId)).to.not.be.undefined; // tslint:enable:no-unused-expression - expect(adapter.getVariableContainerReferenceByApexId().has(0)).to.equal( - true - ); + expect(adapter.getVariableContainerReferenceByApexId().has(0)).to.equal(true); }); it('[SystemWarning] - Should send events with description', () => { diff --git a/packages/salesforcedx-apex-debugger/test/unit/adapter/apexDebugForTest.ts b/packages/salesforcedx-apex-debugger/test/unit/adapter/apexDebugForTest.ts index a7468d657e..2958abda8e 100644 --- a/packages/salesforcedx-apex-debugger/test/unit/adapter/apexDebugForTest.ts +++ b/packages/salesforcedx-apex-debugger/test/unit/adapter/apexDebugForTest.ts @@ -17,11 +17,7 @@ import { VariableContainer } from '../../../src/adapter/apexDebug'; import { Reference } from '../../../src/commands'; -import { - BreakpointService, - SessionService, - StreamingService -} from '../../../src/core'; +import { BreakpointService, SessionService, StreamingService } from '../../../src/core'; export class ApexDebugForTest extends ApexDebug { private receivedResponses: DebugProtocol.Response[] = []; @@ -35,15 +31,9 @@ export class ApexDebugForTest extends ApexDebug { ) { super(); this.myRequestService = requestService; - this.mySessionService = sessionService - ? sessionService - : new SessionService(requestService); - this.myStreamingService = streamingService - ? streamingService - : new StreamingService(); - this.myBreakpointService = breakpointService - ? breakpointService - : new BreakpointService(requestService); + this.mySessionService = sessionService ? sessionService : new SessionService(requestService); + this.myStreamingService = streamingService ? streamingService : new StreamingService(); + this.myBreakpointService = breakpointService ? breakpointService : new BreakpointService(requestService); } public getBreakpointService(): BreakpointService { @@ -81,17 +71,11 @@ export class ApexDebugForTest extends ApexDebug { super.initializeRequest(response, args); } - public attachReq( - response: DebugProtocol.AttachResponse, - args: DebugProtocol.AttachRequestArguments - ): void { + public attachReq(response: DebugProtocol.AttachResponse, args: DebugProtocol.AttachRequestArguments): void { super.attachRequest(response, args); } - public async launchRequest( - response: DebugProtocol.LaunchResponse, - args: LaunchRequestArguments - ): Promise { + public async launchRequest(response: DebugProtocol.LaunchResponse, args: LaunchRequestArguments): Promise { return super.launchRequest(response, args); } @@ -116,10 +100,7 @@ export class ApexDebugForTest extends ApexDebug { return super.continueRequest(response, args); } - public async nextRequest( - response: DebugProtocol.NextResponse, - args: DebugProtocol.NextArguments - ): Promise { + public async nextRequest(response: DebugProtocol.NextResponse, args: DebugProtocol.NextArguments): Promise { super.nextRequest(response, args); } @@ -148,11 +129,7 @@ export class ApexDebugForTest extends ApexDebug { return super.stackTraceRequest(response, args); } - public async customRequest( - command: string, - response: DebugProtocol.Response, - args: any - ): Promise { + public async customRequest(command: string, response: DebugProtocol.Response, args: any): Promise { return super.customRequest(command, response, args); } @@ -168,11 +145,7 @@ export class ApexDebugForTest extends ApexDebug { return this.requestThreads; } - public printToDebugConsole( - msg?: string, - sourceFile?: Source, - sourceLine?: number - ): void { + public printToDebugConsole(msg?: string, sourceFile?: Source, sourceLine?: number): void { super.printToDebugConsole(msg, sourceFile, sourceLine); } @@ -180,9 +153,7 @@ export class ApexDebugForTest extends ApexDebug { super.populateReferences(references, requestId); } - public getVariableContainer( - variableReference: number - ): VariableContainer | undefined { + public getVariableContainer(variableReference: number): VariableContainer | undefined { return this.variableHandles.get(variableReference); } diff --git a/packages/salesforcedx-apex-debugger/test/unit/adapter/apexDebugVariablesHandling.test.ts b/packages/salesforcedx-apex-debugger/test/unit/adapter/apexDebugVariablesHandling.test.ts index 0210680d58..581915a7c0 100644 --- a/packages/salesforcedx-apex-debugger/test/unit/adapter/apexDebugVariablesHandling.test.ts +++ b/packages/salesforcedx-apex-debugger/test/unit/adapter/apexDebugVariablesHandling.test.ts @@ -135,14 +135,8 @@ describe('Debugger adapter variable handling - unit', () => { it('Should compare based on slot for Local', async () => { // given - const v1 = new ApexVariable( - newStringValue('a_name', 'value', 10), - ApexVariableKind.Local - ); - const v2 = new ApexVariable( - newStringValue('z_name', 'value', 9), - ApexVariableKind.Local - ); + const v1 = new ApexVariable(newStringValue('a_name', 'value', 10), ApexVariableKind.Local); + const v2 = new ApexVariable(newStringValue('z_name', 'value', 9), ApexVariableKind.Local); // when const result1 = ApexVariable.compareVariables(v1, v2); @@ -155,14 +149,8 @@ describe('Debugger adapter variable handling - unit', () => { it('Should compare based on slot for Field', async () => { // given - const v1 = new ApexVariable( - newStringValue('a_name', 'value', 10), - ApexVariableKind.Field - ); - const v2 = new ApexVariable( - newStringValue('z_name', 'value', 9), - ApexVariableKind.Field - ); + const v1 = new ApexVariable(newStringValue('a_name', 'value', 10), ApexVariableKind.Field); + const v2 = new ApexVariable(newStringValue('z_name', 'value', 9), ApexVariableKind.Field); // when const result1 = ApexVariable.compareVariables(v1, v2); @@ -175,14 +163,8 @@ describe('Debugger adapter variable handling - unit', () => { it('Should compare based on name for others', async () => { // given - const v1 = new ApexVariable( - newStringValue('a_name', 'value'), - ApexVariableKind.Static - ); - const v2 = new ApexVariable( - newStringValue('z_name', 'value'), - ApexVariableKind.Static - ); + const v1 = new ApexVariable(newStringValue('a_name', 'value'), ApexVariableKind.Static); + const v2 = new ApexVariable(newStringValue('z_name', 'value'), ApexVariableKind.Static); // when const result1 = ApexVariable.compareVariables(v1, v2); @@ -195,14 +177,8 @@ describe('Debugger adapter variable handling - unit', () => { it('Should compare based on numbered name (eg. array index)', async () => { // given - const v1 = new ApexVariable( - newStringValue('[124]', 'value'), - ApexVariableKind.Static - ); - const v2 = new ApexVariable( - newStringValue('123', 'value'), - ApexVariableKind.Static - ); + const v1 = new ApexVariable(newStringValue('[124]', 'value'), ApexVariableKind.Static); + const v2 = new ApexVariable(newStringValue('123', 'value'), ApexVariableKind.Static); // when const result1 = ApexVariable.compareVariables(v1, v2); @@ -215,14 +191,8 @@ describe('Debugger adapter variable handling - unit', () => { it('Should compare numbered name with string', async () => { // given - const v1 = new ApexVariable( - newStringValue('12', 'value'), - ApexVariableKind.Static - ); - const v2 = new ApexVariable( - newStringValue('a_name', 'value'), - ApexVariableKind.Static - ); + const v1 = new ApexVariable(newStringValue('12', 'value'), ApexVariableKind.Static); + const v2 = new ApexVariable(newStringValue('a_name', 'value'), ApexVariableKind.Static); // when const result1 = ApexVariable.compareVariables(v1, v2); @@ -260,10 +230,7 @@ describe('Debugger adapter variable handling - unit', () => { adapter.populateReferences(references, 'FakeRequestId'); - const variableRef = await adapter.resolveApexIdToVariableReference( - 'FakeRequestId', - 0 - ); + const variableRef = await adapter.resolveApexIdToVariableReference('FakeRequestId', 0); expect(variableRef).to.be.at.least(0); const container = adapter.getVariableContainer(variableRef as number); @@ -318,10 +285,7 @@ describe('Debugger adapter variable handling - unit', () => { adapter.populateReferences(references, 'FakeRequestId'); - const variableRef = await adapter.resolveApexIdToVariableReference( - 'FakeRequestId', - 0 - ); + const variableRef = await adapter.resolveApexIdToVariableReference('FakeRequestId', 0); expect(variableRef).to.be.at.least(0); const container = adapter.getVariableContainer(variableRef as number); @@ -359,10 +323,7 @@ describe('Debugger adapter variable handling - unit', () => { adapter.populateReferences(references, 'FakeRequestId'); - const variableRef = await adapter.resolveApexIdToVariableReference( - 'FakeRequestId', - 0 - ); + const variableRef = await adapter.resolveApexIdToVariableReference('FakeRequestId', 0); expect(variableRef).to.be.at.least(0); const container = adapter.getVariableContainer(variableRef as number); @@ -388,10 +349,7 @@ describe('Debugger adapter variable handling - unit', () => { nameForMessages: 'foo' } }; - const expectedTupleContainer = new MapTupleContainer( - tupleA, - 'FakeRequestId' - ); + const expectedTupleContainer = new MapTupleContainer(tupleA, 'FakeRequestId'); const references: Reference[] = [ { type: 'map', @@ -414,10 +372,7 @@ describe('Debugger adapter variable handling - unit', () => { adapter.populateReferences(references, 'FakeRequestId'); - const variableRef = await adapter.resolveApexIdToVariableReference( - 'FakeRequestId', - 0 - ); + const variableRef = await adapter.resolveApexIdToVariableReference('FakeRequestId', 0); expect(variableRef).to.be.at.least(0); const container = adapter.getVariableContainer(variableRef as number); @@ -427,11 +382,8 @@ describe('Debugger adapter variable handling - unit', () => { const mapContainer = container as MapReferenceContainer; expect(mapContainer.getNumberOfChildren()).to.equal(1); expect(mapContainer.tupleContainers.size).to.equal(1); - expect(mapContainer.tupleContainers.get(1000)).to.deep.equal( - expectedTupleContainer - ); - expect(mapContainer.tupleContainers.get(1000)!.getNumberOfChildren()).to - .be.undefined; + expect(mapContainer.tupleContainers.get(1000)).to.deep.equal(expectedTupleContainer); + expect(mapContainer.tupleContainers.get(1000)!.getNumberOfChildren()).to.be.undefined; }); it('Should not expand unknown reference type', async () => { @@ -480,10 +432,7 @@ describe('Debugger adapter variable handling - unit', () => { const apexId = undefined; // when - const variableRef = await adapter.resolveApexIdToVariableReference( - 'FakeRequestId', - apexId - ); + const variableRef = await adapter.resolveApexIdToVariableReference('FakeRequestId', apexId); // then expect(variableRef).to.be.undefined; @@ -522,10 +471,7 @@ describe('Debugger adapter variable handling - unit', () => { ); // when - const variableRef = await adapter.resolveApexIdToVariableReference( - 'FakeRequestId', - apexId - ); + const variableRef = await adapter.resolveApexIdToVariableReference('FakeRequestId', apexId); // then expect(referencesSpy.callCount).to.equal(1); @@ -589,9 +535,7 @@ describe('Debugger adapter variable handling - unit', () => { stateSpy = sinon .stub(RequestService.prototype, 'execute') .returns(Promise.resolve(JSON.stringify(stateResponse))); - sourcePathSpy = sinon - .stub(BreakpointService.prototype, 'getSourcePathFromTyperef') - .returns('file:///foo.cls'); + sourcePathSpy = sinon.stub(BreakpointService.prototype, 'getSourcePathFromTyperef').returns('file:///foo.cls'); // when await adapter.stackTraceRequest( @@ -601,9 +545,7 @@ describe('Debugger adapter variable handling - unit', () => { // then expect(stateSpy.called).to.equal(true); - const response = adapter.getResponse( - 0 - ) as DebugProtocol.StackTraceResponse; + const response = adapter.getResponse(0) as DebugProtocol.StackTraceResponse; expect(response.success).to.equal(true); const stackFrames = response.body.stackFrames; expect(stackFrames.length).to.equal(2); @@ -611,17 +553,11 @@ describe('Debugger adapter variable handling - unit', () => { const frameInfo = adapter.getStackFrameInfo(stackFrames[0].id); expect(frameInfo).to.be.ok; // should have frame info for frame id expect(frameInfo.locals).to.be.ok; - expect(frameInfo.locals).to.deep.equal( - stateResponse.stateResponse.state.locals.local - ); + expect(frameInfo.locals).to.deep.equal(stateResponse.stateResponse.state.locals.local); expect(frameInfo.statics).to.be.ok; - expect(frameInfo.statics).to.deep.equal( - stateResponse.stateResponse.state.statics.static - ); + expect(frameInfo.statics).to.deep.equal(stateResponse.stateResponse.state.statics.static); expect(frameInfo.globals).to.be.ok; - expect(frameInfo.globals).to.deep.equal( - stateResponse.stateResponse.state.globals.global - ); + expect(frameInfo.globals).to.deep.equal(stateResponse.stateResponse.state.globals.global); }); it('Should create as part of stackTraceRequest without variables info', async () => { @@ -651,9 +587,7 @@ describe('Debugger adapter variable handling - unit', () => { stateSpy = sinon .stub(RequestService.prototype, 'execute') .returns(Promise.resolve(JSON.stringify(stateResponse))); - sourcePathSpy = sinon - .stub(BreakpointService.prototype, 'getSourcePathFromTyperef') - .returns('file:///foo.cls'); + sourcePathSpy = sinon.stub(BreakpointService.prototype, 'getSourcePathFromTyperef').returns('file:///foo.cls'); // when await adapter.stackTraceRequest( @@ -663,9 +597,7 @@ describe('Debugger adapter variable handling - unit', () => { // then expect(stateSpy.called).to.equal(true); - const response = adapter.getResponse( - 0 - ) as DebugProtocol.StackTraceResponse; + const response = adapter.getResponse(0) as DebugProtocol.StackTraceResponse; expect(response.success).to.equal(true); const stackFrames = response.body.stackFrames; expect(stackFrames.length).to.equal(2); @@ -695,9 +627,7 @@ describe('Debugger adapter variable handling - unit', () => { } } }; - stateSpy = sinon - .stub(RequestService.prototype, 'execute') - .returns(Promise.resolve(JSON.stringify(frameRespObj))); + stateSpy = sinon.stub(RequestService.prototype, 'execute').returns(Promise.resolve(JSON.stringify(frameRespObj))); // when await adapter.fetchFrameVariables(frameInfo); @@ -706,17 +636,11 @@ describe('Debugger adapter variable handling - unit', () => { expect(stateSpy.called).to.equal(true); expect(frameInfo).to.be.ok; // should have frame info for frame id expect(frameInfo.locals).to.be.ok; - expect(frameInfo.locals).to.deep.equal( - frameRespObj.frameResponse.frame.locals.local - ); + expect(frameInfo.locals).to.deep.equal(frameRespObj.frameResponse.frame.locals.local); expect(frameInfo.statics).to.be.ok; - expect(frameInfo.statics).to.deep.equal( - frameRespObj.frameResponse.frame.statics.static - ); + expect(frameInfo.statics).to.deep.equal(frameRespObj.frameResponse.frame.statics.static); expect(frameInfo.globals).to.be.ok; - expect(frameInfo.globals).to.deep.equal( - frameRespObj.frameResponse.frame.globals.global - ); + expect(frameInfo.globals).to.deep.equal(frameRespObj.frameResponse.frame.globals.global); }); }); @@ -807,18 +731,12 @@ describe('Debugger adapter variable handling - unit', () => { resolveApexIdToVariableReferenceSpy = sinon .stub(ApexDebugForTest.prototype, 'resolveApexIdToVariableReference') .returns(1001); - const expectedVariableObj = new ApexVariable( - variableValue, - ApexVariableKind.Local, - 1001 - ); + const expectedVariableObj = new ApexVariable(variableValue, ApexVariableKind.Local, 1001); const localScope = new ScopeContainer('local', frameInfo); const vars = await localScope.expand(adapter, 'all', 0, 0); expect(vars.length).to.equal(1); - expect( - ApexVariable.compareVariables(expectedVariableObj, vars[0]) - ).to.equal(0); + expect(ApexVariable.compareVariables(expectedVariableObj, vars[0])).to.equal(0); }); it('Should expand static scope', async () => { @@ -835,18 +753,12 @@ describe('Debugger adapter variable handling - unit', () => { resolveApexIdToVariableReferenceSpy = sinon .stub(ApexDebugForTest.prototype, 'resolveApexIdToVariableReference') .returns(1001); - const expectedVariableObj = new ApexVariable( - variableValue, - ApexVariableKind.Static, - 1001 - ); + const expectedVariableObj = new ApexVariable(variableValue, ApexVariableKind.Static, 1001); const localScope = new ScopeContainer('static', frameInfo); const vars = await localScope.expand(adapter, 'all', 0, 0); expect(vars.length).to.equal(1); - expect( - ApexVariable.compareVariables(expectedVariableObj, vars[0]) - ).to.equal(0); + expect(ApexVariable.compareVariables(expectedVariableObj, vars[0])).to.equal(0); }); it('Should expand global scope', async () => { @@ -863,18 +775,12 @@ describe('Debugger adapter variable handling - unit', () => { resolveApexIdToVariableReferenceSpy = sinon .stub(ApexDebugForTest.prototype, 'resolveApexIdToVariableReference') .returns(1001); - const expectedVariableObj = new ApexVariable( - variableValue, - ApexVariableKind.Global, - 1001 - ); + const expectedVariableObj = new ApexVariable(variableValue, ApexVariableKind.Global, 1001); const localScope = new ScopeContainer('global', frameInfo); const vars = await localScope.expand(adapter, 'all', 0, 0); expect(vars.length).to.equal(1); - expect( - ApexVariable.compareVariables(expectedVariableObj, vars[0]) - ).to.equal(0); + expect(ApexVariable.compareVariables(expectedVariableObj, vars[0])).to.equal(0); }); }); @@ -886,10 +792,7 @@ describe('Debugger adapter variable handling - unit', () => { adapter = new ApexDebugForTest(new RequestService()); adapter.setSalesforceProject('someProjectPath'); adapter.addRequestThread('07cFAKE'); - resetIdleTimersSpy = sinon.spy( - ApexDebugForTest.prototype, - 'resetIdleTimer' - ); + resetIdleTimersSpy = sinon.spy(ApexDebugForTest.prototype, 'resetIdleTimer'); }); afterEach(() => { @@ -903,15 +806,10 @@ describe('Debugger adapter variable handling - unit', () => { }; // when - await adapter.variablesRequest( - {} as DebugProtocol.VariablesResponse, - args - ); + await adapter.variablesRequest({} as DebugProtocol.VariablesResponse, args); // then - const response = adapter.getResponse( - 0 - ) as DebugProtocol.VariablesResponse; + const response = adapter.getResponse(0) as DebugProtocol.VariablesResponse; expect(response.success).to.equal(true); expect(response.body).to.be.ok; expect(response.body.variables).to.be.ok; @@ -925,9 +823,7 @@ describe('Debugger adapter variable handling - unit', () => { new ApexVariable(newStringValue('var1'), ApexVariableKind.Static), new ApexVariable(newStringValue('var2'), ApexVariableKind.Global) ]; - const variableReference = adapter.createVariableContainer( - new DummyContainer(variables) - ); + const variableReference = adapter.createVariableContainer(new DummyContainer(variables)); // when await adapter.variablesRequest( @@ -938,9 +834,7 @@ describe('Debugger adapter variable handling - unit', () => { ); // then - const response = adapter.getResponse( - 0 - ) as DebugProtocol.VariablesResponse; + const response = adapter.getResponse(0) as DebugProtocol.VariablesResponse; expect(response.success).to.equal(true); expect(response.body).to.be.ok; expect(response.body.variables).to.be.ok; @@ -954,9 +848,7 @@ describe('Debugger adapter variable handling - unit', () => { new ApexVariable(newStringValue('var1'), ApexVariableKind.Static), new ApexVariable(newStringValue('var2'), ApexVariableKind.Global) ]; - const variableReference = adapter.createVariableContainer( - new ErrorDummyContainer(variables) - ); + const variableReference = adapter.createVariableContainer(new ErrorDummyContainer(variables)); await adapter.variablesRequest( {} as DebugProtocol.VariablesResponse, @@ -965,9 +857,7 @@ describe('Debugger adapter variable handling - unit', () => { } as DebugProtocol.VariablesArguments ); - const response = adapter.getResponse( - 0 - ) as DebugProtocol.VariablesResponse; + const response = adapter.getResponse(0) as DebugProtocol.VariablesResponse; expect(response.success).to.equal(true); expect(response.body.variables.length).to.equal(0); expect(resetIdleTimersSpy.called).to.equal(false); @@ -975,11 +865,7 @@ describe('Debugger adapter variable handling - unit', () => { }); }); -export const newStringValue = ( - name: string, - value = 'value', - slot?: number -): Value => { +export const newStringValue = (name: string, value = 'value', slot?: number): Value => { const result: any = { name, declaredTypeRef: 'java/lang/String', diff --git a/packages/salesforcedx-apex-debugger/test/unit/commands/baseDebuggerCommand.test.ts b/packages/salesforcedx-apex-debugger/test/unit/commands/baseDebuggerCommand.test.ts index 5e15c93483..96ff98758d 100644 --- a/packages/salesforcedx-apex-debugger/test/unit/commands/baseDebuggerCommand.test.ts +++ b/packages/salesforcedx-apex-debugger/test/unit/commands/baseDebuggerCommand.test.ts @@ -5,11 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - CLIENT_ID, - DEFAULT_CONNECTION_TIMEOUT_MS, - RequestService -} from '@salesforce/salesforcedx-utils'; +import { CLIENT_ID, DEFAULT_CONNECTION_TIMEOUT_MS, RequestService } from '@salesforce/salesforcedx-utils'; import { expect } from 'chai'; import { XHROptions, XHRResponse } from 'request-light'; import * as sinon from 'sinon'; @@ -17,12 +13,7 @@ import { BaseDebuggerCommand } from '../../../src/commands/baseDebuggerCommand'; import { DebuggerRequest } from '../../../src/commands/protocol'; class DummyCommand extends BaseDebuggerCommand { - public constructor( - commandName: string, - debuggedRequestId: string, - queryString?: string, - request?: DebuggerRequest - ) { + public constructor(commandName: string, debuggedRequestId: string, queryString?: string, request?: DebuggerRequest) { super(commandName, debuggedRequestId, queryString, request); } } @@ -56,9 +47,7 @@ describe('Base command', () => { dummyCommand = new DummyCommand('dummy', '07cFAKE'); sendRequestSpy = sinon .stub(RequestService.prototype, 'sendRequest') - .returns( - Promise.resolve({ status: 200, responseText: '' } as XHRResponse) - ); + .returns(Promise.resolve({ status: 200, responseText: '' } as XHRResponse)); const expectedOptions: XHROptions = { type: 'POST', url: 'https://www.salesforce.com/services/debug/v41.0/dummy/07cFAKE', @@ -71,18 +60,14 @@ describe('Base command', () => { expect(sendRequestSpy.calledOnce).to.equal(true); expect(sendRequestSpy.getCall(0).args[0]).to.deep.equal(expectedOptions); - expect(dummyCommand.getCommandUrl()).to.equal( - 'services/debug/v41.0/dummy/07cFAKE' - ); + expect(dummyCommand.getCommandUrl()).to.equal('services/debug/v41.0/dummy/07cFAKE'); }); it('Should build request with query string', async () => { dummyCommand = new DummyCommand('dummy2', '07cFAKE', 'param=whoops'); sendRequestSpy = sinon .stub(RequestService.prototype, 'sendRequest') - .returns( - Promise.resolve({ status: 200, responseText: '' } as XHRResponse) - ); + .returns(Promise.resolve({ status: 200, responseText: '' } as XHRResponse)); const expectedOptions: XHROptions = { type: 'POST', url: 'https://www.salesforce.com/services/debug/v41.0/dummy2/07cFAKE?param=whoops', @@ -104,17 +89,10 @@ describe('Base command', () => { reference: [] } }; - dummyCommand = new DummyCommand( - 'dummy2', - '07cFAKE', - 'param=whoops', - myRequest - ); + dummyCommand = new DummyCommand('dummy2', '07cFAKE', 'param=whoops', myRequest); sendRequestSpy = sinon .stub(RequestService.prototype, 'sendRequest') - .returns( - Promise.resolve({ status: 200, responseText: '' } as XHRResponse) - ); + .returns(Promise.resolve({ status: 200, responseText: '' } as XHRResponse)); const requestBody = JSON.stringify(myRequest); const expectedOptions: XHROptions = { type: 'POST', @@ -133,21 +111,17 @@ describe('Base command', () => { it('Should handle command error', async () => { dummyCommand = new DummyCommand('dummy', '07cFAKE'); - sendRequestSpy = sinon - .stub(RequestService.prototype, 'sendRequest') - .returns( - Promise.reject({ - status: 500, - responseText: '{"message":"There was an error", "action":"Try again"}' - } as XHRResponse) - ); + sendRequestSpy = sinon.stub(RequestService.prototype, 'sendRequest').returns( + Promise.reject({ + status: 500, + responseText: '{"message":"There was an error", "action":"Try again"}' + } as XHRResponse) + ); try { await requestService.execute(dummyCommand); } catch (error) { - expect(error).to.equal( - '{"message":"There was an error", "action":"Try again"}' - ); + expect(error).to.equal('{"message":"There was an error", "action":"Try again"}'); } }); }); diff --git a/packages/salesforcedx-apex-debugger/test/unit/commands/frameCommand.test.ts b/packages/salesforcedx-apex-debugger/test/unit/commands/frameCommand.test.ts index edd3655120..fef46f7d4a 100644 --- a/packages/salesforcedx-apex-debugger/test/unit/commands/frameCommand.test.ts +++ b/packages/salesforcedx-apex-debugger/test/unit/commands/frameCommand.test.ts @@ -5,10 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - DEFAULT_CONNECTION_TIMEOUT_MS, - RequestService -} from '@salesforce/salesforcedx-utils'; +import { DEFAULT_CONNECTION_TIMEOUT_MS, RequestService } from '@salesforce/salesforcedx-utils'; import { expect } from 'chai'; import { XHROptions, XHRResponse } from 'request-light'; import * as sinon from 'sinon'; @@ -33,13 +30,10 @@ describe('Frame command', () => { it('Should build request', async () => { sendRequestSpy = sinon .stub(RequestService.prototype, 'sendRequest') - .returns( - Promise.resolve({ status: 200, responseText: '' } as XHRResponse) - ); + .returns(Promise.resolve({ status: 200, responseText: '' } as XHRResponse)); const expectedOptions: XHROptions = { type: 'POST', - url: - 'https://www.salesforce.com/services/debug/v41.0/frame/07cFAKE?stackFrame=1', + url: 'https://www.salesforce.com/services/debug/v41.0/frame/07cFAKE?stackFrame=1', timeout: DEFAULT_CONNECTION_TIMEOUT_MS, headers: getDefaultHeaders(0), data: undefined diff --git a/packages/salesforcedx-apex-debugger/test/unit/commands/referencesCommand.test.ts b/packages/salesforcedx-apex-debugger/test/unit/commands/referencesCommand.test.ts index a14849b575..936736a9ee 100644 --- a/packages/salesforcedx-apex-debugger/test/unit/commands/referencesCommand.test.ts +++ b/packages/salesforcedx-apex-debugger/test/unit/commands/referencesCommand.test.ts @@ -5,10 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - DEFAULT_CONNECTION_TIMEOUT_MS, - RequestService -} from '@salesforce/salesforcedx-utils'; +import { DEFAULT_CONNECTION_TIMEOUT_MS, RequestService } from '@salesforce/salesforcedx-utils'; import { expect } from 'chai'; import { XHROptions, XHRResponse } from 'request-light'; import * as sinon from 'sinon'; @@ -33,9 +30,7 @@ describe('References command', () => { it('Should build request', async () => { sendRequestSpy = sinon .stub(RequestService.prototype, 'sendRequest') - .returns( - Promise.resolve({ status: 200, responseText: '' } as XHRResponse) - ); + .returns(Promise.resolve({ status: 200, responseText: '' } as XHRResponse)); const requestBody = JSON.stringify({ getReferencesRequest: { reference: [] diff --git a/packages/salesforcedx-apex-debugger/test/unit/commands/runCommand.test.ts b/packages/salesforcedx-apex-debugger/test/unit/commands/runCommand.test.ts index 1ff1309060..7462c3fda1 100644 --- a/packages/salesforcedx-apex-debugger/test/unit/commands/runCommand.test.ts +++ b/packages/salesforcedx-apex-debugger/test/unit/commands/runCommand.test.ts @@ -5,10 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - DEFAULT_CONNECTION_TIMEOUT_MS, - RequestService -} from '@salesforce/salesforcedx-utils'; +import { DEFAULT_CONNECTION_TIMEOUT_MS, RequestService } from '@salesforce/salesforcedx-utils'; import { expect } from 'chai'; import { XHROptions, XHRResponse } from 'request-light'; import * as sinon from 'sinon'; @@ -33,9 +30,7 @@ describe('Run command', () => { it('Should have proper request path', async () => { sendRequestSpy = sinon .stub(RequestService.prototype, 'sendRequest') - .returns( - Promise.resolve({ status: 200, responseText: '' } as XHRResponse) - ); + .returns(Promise.resolve({ status: 200, responseText: '' } as XHRResponse)); const expectedOptions: XHROptions = { type: 'POST', url: 'https://www.salesforce.com/services/debug/v41.0/run/07cFAKE', diff --git a/packages/salesforcedx-apex-debugger/test/unit/commands/stateCommand.test.ts b/packages/salesforcedx-apex-debugger/test/unit/commands/stateCommand.test.ts index e67115cf51..fc0266100b 100644 --- a/packages/salesforcedx-apex-debugger/test/unit/commands/stateCommand.test.ts +++ b/packages/salesforcedx-apex-debugger/test/unit/commands/stateCommand.test.ts @@ -5,10 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - DEFAULT_CONNECTION_TIMEOUT_MS, - RequestService -} from '@salesforce/salesforcedx-utils'; +import { DEFAULT_CONNECTION_TIMEOUT_MS, RequestService } from '@salesforce/salesforcedx-utils'; import { expect } from 'chai'; import { XHROptions, XHRResponse } from 'request-light'; import * as sinon from 'sinon'; @@ -33,9 +30,7 @@ describe('State command', () => { it('Should build request', async () => { sendRequestSpy = sinon .stub(RequestService.prototype, 'sendRequest') - .returns( - Promise.resolve({ status: 200, responseText: '' } as XHRResponse) - ); + .returns(Promise.resolve({ status: 200, responseText: '' } as XHRResponse)); const expectedOptions: XHROptions = { type: 'POST', url: 'https://www.salesforce.com/services/debug/v41.0/state/07cFAKE', @@ -51,21 +46,17 @@ describe('State command', () => { }); it('Should handle run command error', async () => { - sendRequestSpy = sinon - .stub(RequestService.prototype, 'sendRequest') - .returns( - Promise.reject({ - status: 500, - responseText: '{"message":"There was an error", "action":"Try again"}' - } as XHRResponse) - ); + sendRequestSpy = sinon.stub(RequestService.prototype, 'sendRequest').returns( + Promise.reject({ + status: 500, + responseText: '{"message":"There was an error", "action":"Try again"}' + } as XHRResponse) + ); try { await requestService.execute(stateCommand); } catch (error) { - expect(error).to.equal( - '{"message":"There was an error", "action":"Try again"}' - ); + expect(error).to.equal('{"message":"There was an error", "action":"Try again"}'); } }); }); diff --git a/packages/salesforcedx-apex-debugger/test/unit/commands/stepCommands.test.ts b/packages/salesforcedx-apex-debugger/test/unit/commands/stepCommands.test.ts index ceba19b6e6..fb6d59ca61 100644 --- a/packages/salesforcedx-apex-debugger/test/unit/commands/stepCommands.test.ts +++ b/packages/salesforcedx-apex-debugger/test/unit/commands/stepCommands.test.ts @@ -5,18 +5,11 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - DEFAULT_CONNECTION_TIMEOUT_MS, - RequestService -} from '@salesforce/salesforcedx-utils'; +import { DEFAULT_CONNECTION_TIMEOUT_MS, RequestService } from '@salesforce/salesforcedx-utils'; import { expect } from 'chai'; import { XHROptions, XHRResponse } from 'request-light'; import * as sinon from 'sinon'; -import { - StepIntoCommand, - StepOutCommand, - StepOverCommand -} from '../../../src/commands'; +import { StepIntoCommand, StepOutCommand, StepOverCommand } from '../../../src/commands'; import { getDefaultHeaders } from './baseDebuggerCommand.test'; describe('Step commands', () => { @@ -36,13 +29,10 @@ describe('Step commands', () => { const command = new StepIntoCommand('07cFAKE'); sendRequestSpy = sinon .stub(RequestService.prototype, 'sendRequest') - .returns( - Promise.resolve({ status: 200, responseText: '' } as XHRResponse) - ); + .returns(Promise.resolve({ status: 200, responseText: '' } as XHRResponse)); const expectedOptions: XHROptions = { type: 'POST', - url: - 'https://www.salesforce.com/services/debug/v41.0/step/07cFAKE?type=into', + url: 'https://www.salesforce.com/services/debug/v41.0/step/07cFAKE?type=into', timeout: DEFAULT_CONNECTION_TIMEOUT_MS, headers: getDefaultHeaders(0), data: undefined @@ -58,13 +48,10 @@ describe('Step commands', () => { const command = new StepOutCommand('07cFAKE'); sendRequestSpy = sinon .stub(RequestService.prototype, 'sendRequest') - .returns( - Promise.resolve({ status: 200, responseText: '' } as XHRResponse) - ); + .returns(Promise.resolve({ status: 200, responseText: '' } as XHRResponse)); const expectedOptions: XHROptions = { type: 'POST', - url: - 'https://www.salesforce.com/services/debug/v41.0/step/07cFAKE?type=out', + url: 'https://www.salesforce.com/services/debug/v41.0/step/07cFAKE?type=out', timeout: DEFAULT_CONNECTION_TIMEOUT_MS, headers: getDefaultHeaders(0), data: undefined @@ -80,13 +67,10 @@ describe('Step commands', () => { const command = new StepOverCommand('07cFAKE'); sendRequestSpy = sinon .stub(RequestService.prototype, 'sendRequest') - .returns( - Promise.resolve({ status: 200, responseText: '' } as XHRResponse) - ); + .returns(Promise.resolve({ status: 200, responseText: '' } as XHRResponse)); const expectedOptions: XHROptions = { type: 'POST', - url: - 'https://www.salesforce.com/services/debug/v41.0/step/07cFAKE?type=over', + url: 'https://www.salesforce.com/services/debug/v41.0/step/07cFAKE?type=over', timeout: DEFAULT_CONNECTION_TIMEOUT_MS, headers: getDefaultHeaders(0), data: undefined diff --git a/packages/salesforcedx-apex-debugger/test/unit/core/streamingClient.test.ts b/packages/salesforcedx-apex-debugger/test/unit/core/streamingClient.test.ts index 1bcd9281e1..92cdca38d7 100644 --- a/packages/salesforcedx-apex-debugger/test/unit/core/streamingClient.test.ts +++ b/packages/salesforcedx-apex-debugger/test/unit/core/streamingClient.test.ts @@ -50,14 +50,8 @@ describe('Debugger streaming client', () => { ); expect(fayeHeaderSpy.calledTwice).to.equal(true); - expect(fayeHeaderSpy.getCall(0).args).to.have.same.members([ - 'Authorization', - 'OAuth 123' - ]); - expect(fayeHeaderSpy.getCall(1).args).to.have.same.members([ - 'Content-Type', - 'application/json' - ]); + expect(fayeHeaderSpy.getCall(0).args).to.have.same.members(['Authorization', 'OAuth 123']); + expect(fayeHeaderSpy.getCall(1).args).to.have.same.members(['Content-Type', 'application/json']); expect(client.getReplayId()).to.equal(-1); }); }); diff --git a/packages/salesforcedx-apex-replay-debugger/.eslintignore b/packages/salesforcedx-apex-replay-debugger/.eslintignore deleted file mode 100644 index 39f8bdd3b0..0000000000 --- a/packages/salesforcedx-apex-replay-debugger/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -src/** diff --git a/packages/salesforcedx-apex-replay-debugger/.eslintrc.json b/packages/salesforcedx-apex-replay-debugger/.eslintrc.json deleted file mode 100644 index a8b986b195..0000000000 --- a/packages/salesforcedx-apex-replay-debugger/.eslintrc.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "root": true, - "extends": ["../../config/base-eslintrc.json", "./fix-these-rules.json"], - "overrides": [ - { - "files": ["./src/**/*.ts", "./test/**/*.ts"], - "parserOptions": { - "project": "./tsconfig.json" - } - } - ] -} diff --git a/packages/salesforcedx-apex-replay-debugger/fix-these-rules.json b/packages/salesforcedx-apex-replay-debugger/fix-these-rules.json deleted file mode 100644 index 0cc0ab0f5b..0000000000 --- a/packages/salesforcedx-apex-replay-debugger/fix-these-rules.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "rules": { - "prefer-arrow/prefer-arrow-functions": ["error", {}], - "@typescript-eslint/no-floating-promises": "warn", - "@typescript-eslint/require-await": "warn", - "@typescript-eslint/no-unsafe-return": "warn" - } -} diff --git a/packages/salesforcedx-apex-replay-debugger/package.json b/packages/salesforcedx-apex-replay-debugger/package.json index 222f758488..fe21322a5c 100644 --- a/packages/salesforcedx-apex-replay-debugger/package.json +++ b/packages/salesforcedx-apex-replay-debugger/package.json @@ -7,46 +7,36 @@ "preview": true, "license": "BSD-3-Clause", "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" }, "categories": [ "Debuggers" ], "dependencies": { "@salesforce/salesforcedx-utils": "62.5.0", - "@vscode/debugadapter": "1.65.0", - "@vscode/debugprotocol": "1.65.0", + "@vscode/debugadapter": "1.68.0", + "@vscode/debugprotocol": "1.68.0", "vscode-uri": "1.0.1" }, "devDependencies": { "@types/chai": "4.3.3", "@types/jest": "^29.5.5", "@types/mocha": "^5", - "@types/node": "^18.11.9", + "@types/node": "^20.0.0", "@types/sinon": "^2.3.7", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", - "@vscode/debugadapter-testsupport": "1.65.0", + "@vscode/debugadapter-testsupport": "1.68.0", "chai": "^4.0.2", "cross-env": "5.2.0", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest": "27.5.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", "jest": "^29.7.0", "mocha": "^10", "mocha-junit-reporter": "^1.23.3", "mocha-multi-reporters": "^1.1.7", "nyc": "^15", - "prettier": "3.0.3", + "prettier": "3.3.3", "request-light": "^0.7.0", "sinon": "^13.0.1", "ts-jest": "^29.1.1", - "typescript": "^5.2.2" + "typescript": "^5.6.2" }, "scripts": { "bundle:debugger": "esbuild ./src/adapter/apexReplayDebug.ts --bundle --outfile=dist/apexreplaydebug.js --format=cjs --platform=node --minify", diff --git a/packages/salesforcedx-apex-replay-debugger/test/.eslintrc.json b/packages/salesforcedx-apex-replay-debugger/test/.eslintrc.json deleted file mode 100644 index f2b99a417d..0000000000 --- a/packages/salesforcedx-apex-replay-debugger/test/.eslintrc.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": [ - "../.eslintrc.json", - "../../../config/common-test-lint-rules.json" - ] -} diff --git a/packages/salesforcedx-apex-replay-debugger/test/integration/adapter.test.ts b/packages/salesforcedx-apex-replay-debugger/test/integration/adapter.test.ts index b59b69c24b..b5085d3345 100644 --- a/packages/salesforcedx-apex-replay-debugger/test/integration/adapter.test.ts +++ b/packages/salesforcedx-apex-replay-debugger/test/integration/adapter.test.ts @@ -10,22 +10,12 @@ import { DebugProtocol } from '@vscode/debugprotocol'; import { expect } from 'chai'; import * as path from 'path'; import Uri from 'vscode-uri'; -import { - ApexReplayDebug, - LaunchRequestArguments -} from '../../src/adapter/apexReplayDebug'; +import { ApexReplayDebug, LaunchRequestArguments } from '../../src/adapter/apexReplayDebug'; import { LineBreakpointInfo } from '../../src/breakpoints'; import { GoldFileUtil } from './goldFileUtil'; const PROJECT_NAME = `project_${new Date().getTime()}`; -const CONFIG_DIR = path.join( - __dirname, - '..', - '..', - 'test', - 'integration', - 'config' -); +const CONFIG_DIR = path.join(__dirname, '..', '..', 'test', 'integration', 'config'); const LOG_FOLDER = path.join(CONFIG_DIR, 'logs'); // tslint:disable:no-unused-expression @@ -43,11 +33,7 @@ describe('Replay debugger adapter - integration', () => { // Use dc.start(4712) to debug the adapter during // tests (adapter needs to be launched in debug mode separately). - dc = new DebugClient( - 'node', - './out/src/adapter/apexReplayDebug.js', - 'apex-replay' - ); + dc = new DebugClient('node', './out/src/adapter/apexReplayDebug.js', 'apex-replay'); await dc.start(); dc.defaultTimeout = 10000; }); @@ -67,15 +53,9 @@ describe('Replay debugger adapter - integration', () => { }); it('Recursive stack', async () => { - let classA = Uri.file( - `${projectPath}/force-app/main/default/classes/A.cls` - ).toString(); - let classB = Uri.file( - `${projectPath}/force-app/main/default/classes/B.cls` - ).toString(); - let classRecursive = Uri.file( - `${projectPath}/force-app/main/default/classes/RecursiveTest.cls` - ).toString(); + let classA = Uri.file(`${projectPath}/force-app/main/default/classes/A.cls`).toString(); + let classB = Uri.file(`${projectPath}/force-app/main/default/classes/B.cls`).toString(); + let classRecursive = Uri.file(`${projectPath}/force-app/main/default/classes/RecursiveTest.cls`).toString(); const classAValidLines = [42]; const classBValidLines = [42]; const classRecursiveValidLines = [7]; @@ -84,9 +64,7 @@ describe('Replay debugger adapter - integration', () => { classB = classB.replace('%3A', ':'); classRecursive = classRecursive.replace('%3A', ':'); } - console.log( - `classA: ${classA}. classB: ${classB}. classRecursive: ${classRecursive}` - ); + console.log(`classA: ${classA}. classB: ${classB}. classRecursive: ${classRecursive}`); lineBpInfo.push( { uri: classA, @@ -106,10 +84,7 @@ describe('Replay debugger adapter - integration', () => { ); const testName = 'recursive'; const logFilePath = path.join(LOG_FOLDER, `${testName}.log`); - goldFileUtil = new GoldFileUtil( - dc, - path.join(LOG_FOLDER, `${testName}.gold`) - ); + goldFileUtil = new GoldFileUtil(dc, path.join(LOG_FOLDER, `${testName}.gold`)); const launchResponse = await dc.launchRequest({ salesforceProject: projectPath, @@ -125,27 +100,11 @@ describe('Replay debugger adapter - integration', () => { const classAPath = Uri.parse(classA).fsPath; const classBPath = Uri.parse(classB).fsPath; const classRecursivePath = Uri.parse(classRecursive).fsPath; - console.log( - `classAPath: ${classAPath}. classBPath: ${classBPath}. classRecursivePath: ${classRecursivePath}` - ); - let addBreakpointsResponse = await dc.setBreakpointsRequest( - createBreakpointsArgs(classAPath, classAValidLines) - ); - assertBreakpointsCreated( - addBreakpointsResponse, - 1, - classAPath, - classAValidLines - ); - addBreakpointsResponse = await dc.setBreakpointsRequest( - createBreakpointsArgs(classBPath, classBValidLines) - ); - assertBreakpointsCreated( - addBreakpointsResponse, - 1, - classBPath, - classBValidLines - ); + console.log(`classAPath: ${classAPath}. classBPath: ${classBPath}. classRecursivePath: ${classRecursivePath}`); + let addBreakpointsResponse = await dc.setBreakpointsRequest(createBreakpointsArgs(classAPath, classAValidLines)); + assertBreakpointsCreated(addBreakpointsResponse, 1, classAPath, classAValidLines); + addBreakpointsResponse = await dc.setBreakpointsRequest(createBreakpointsArgs(classBPath, classBValidLines)); + assertBreakpointsCreated(addBreakpointsResponse, 1, classBPath, classBValidLines); // tslint:disable-next-line:no-floating-promises dc.configurationDoneRequest({}); // Verify stopped on the first line of debug log @@ -158,29 +117,17 @@ describe('Replay debugger adapter - integration', () => { await dc.continueRequest({ threadId: ApexReplayDebug.THREAD_ID }); - await goldFileUtil.assertTopState( - 'breakpoint', - classBPath, - classBValidLines[0] - ); + await goldFileUtil.assertTopState('breakpoint', classBPath, classBValidLines[0]); // Verify stopped on second breakpoint await dc.continueRequest({ threadId: ApexReplayDebug.THREAD_ID }); - await goldFileUtil.assertTopState( - 'breakpoint', - classAPath, - classAValidLines[0] - ); + await goldFileUtil.assertTopState('breakpoint', classAPath, classAValidLines[0]); // Step out to test class await dc.stepOutRequest({ threadId: ApexReplayDebug.THREAD_ID }); - await goldFileUtil.assertTopState( - 'step', - classRecursivePath, - classRecursiveValidLines[0] - ); + await goldFileUtil.assertTopState('step', classRecursivePath, classRecursiveValidLines[0]); } finally { const disconnectResponse = await dc.disconnectRequest({}); expect(disconnectResponse.success).to.equal(true); @@ -188,9 +135,7 @@ describe('Replay debugger adapter - integration', () => { }); it('Static variable of one class in different frames', async () => { - let classStaticVarsA = Uri.file( - `${projectPath}/force-app/main/default/classes/StaticVarsA.cls` - ).toString(); + let classStaticVarsA = Uri.file(`${projectPath}/force-app/main/default/classes/StaticVarsA.cls`).toString(); const classStaticVarsAValidLines = [9]; if (process.platform === 'win32') { classStaticVarsA = classStaticVarsA.replace('%3A', ':'); @@ -203,10 +148,7 @@ describe('Replay debugger adapter - integration', () => { }); const testName = 'statics'; const logFilePath = path.join(LOG_FOLDER, `${testName}.log`); - goldFileUtil = new GoldFileUtil( - dc, - path.join(LOG_FOLDER, `${testName}.gold`) - ); + goldFileUtil = new GoldFileUtil(dc, path.join(LOG_FOLDER, `${testName}.gold`)); const launchResponse = await dc.launchRequest({ salesforceProject: projectPath, @@ -224,12 +166,7 @@ describe('Replay debugger adapter - integration', () => { const addBreakpointsResponse = await dc.setBreakpointsRequest( createBreakpointsArgs(classStaticVarsAPath, classStaticVarsAValidLines) ); - assertBreakpointsCreated( - addBreakpointsResponse, - 1, - classStaticVarsAPath, - classStaticVarsAValidLines - ); + assertBreakpointsCreated(addBreakpointsResponse, 1, classStaticVarsAPath, classStaticVarsAValidLines); // tslint:disable-next-line:no-floating-promises dc.configurationDoneRequest({}); @@ -244,11 +181,7 @@ describe('Replay debugger adapter - integration', () => { await dc.continueRequest({ threadId: ApexReplayDebug.THREAD_ID }); - await goldFileUtil.assertEntireState( - 'breakpoint', - classStaticVarsAPath, - classStaticVarsAValidLines[0] - ); + await goldFileUtil.assertEntireState('breakpoint', classStaticVarsAPath, classStaticVarsAValidLines[0]); } finally { const disconnectResponse = await dc.disconnectRequest({}); expect(disconnectResponse.success).to.equal(true); @@ -256,10 +189,7 @@ describe('Replay debugger adapter - integration', () => { }); }); -const createBreakpointsArgs = ( - classPath: string, - lineNumbers: number[] -): DebugProtocol.SetBreakpointsArguments => { +const createBreakpointsArgs = (classPath: string, lineNumbers: number[]): DebugProtocol.SetBreakpointsArguments => { const result: DebugProtocol.SetBreakpointsArguments = { source: { path: classPath @@ -267,9 +197,7 @@ const createBreakpointsArgs = ( lines: lineNumbers, breakpoints: [] }; - lineNumbers.forEach(lineNumber => - result.breakpoints!.push({ line: lineNumber }) - ); + lineNumbers.forEach(lineNumber => result.breakpoints!.push({ line: lineNumber })); return result; }; diff --git a/packages/salesforcedx-apex-replay-debugger/test/integration/goldFileUtil.ts b/packages/salesforcedx-apex-replay-debugger/test/integration/goldFileUtil.ts index 03373b3e3a..edab4cecdf 100644 --- a/packages/salesforcedx-apex-replay-debugger/test/integration/goldFileUtil.ts +++ b/packages/salesforcedx-apex-replay-debugger/test/integration/goldFileUtil.ts @@ -20,9 +20,7 @@ export class GoldFileUtil { constructor(dc: DebugClient, goldFilePath: string) { this.dc = dc; this.goldFilePath = goldFilePath; - this.golds = fs - .readFileSync(this.goldFilePath, 'utf-8') - .split(this.delimiter); + this.golds = fs.readFileSync(this.goldFilePath, 'utf-8').split(this.delimiter); this.golds = this.golds.map(gold => { return gold.trim(); }); @@ -34,16 +32,8 @@ export class GoldFileUtil { }); } - public async assertTopState( - stoppedReason: string, - stoppedFilePath: string, - stoppedLine: number - ): Promise { - const stackTraceResponse = await this.assertStackTrace( - stoppedReason, - stoppedFilePath, - stoppedLine - ); + public async assertTopState(stoppedReason: string, stoppedFilePath: string, stoppedLine: number): Promise { + const stackTraceResponse = await this.assertStackTrace(stoppedReason, stoppedFilePath, stoppedLine); const scopesResponse = await this.dc.scopesRequest({ frameId: stackTraceResponse.body.stackFrames[0].id @@ -60,16 +50,8 @@ export class GoldFileUtil { await this.assertVariables(staticScope); } - public async assertEntireState( - stoppedReason: string, - stoppedFilePath: string, - stoppedLine: number - ): Promise { - const stackTraceResponse = await this.assertStackTrace( - stoppedReason, - stoppedFilePath, - stoppedLine - ); + public async assertEntireState(stoppedReason: string, stoppedFilePath: string, stoppedLine: number): Promise { + const stackTraceResponse = await this.assertStackTrace(stoppedReason, stoppedFilePath, stoppedLine); for (const frame of stackTraceResponse.body.stackFrames) { const scopesResponse = await this.dc.scopesRequest({ @@ -93,23 +75,16 @@ export class GoldFileUtil { stoppedFilePath: string, stoppedLine: number ): Promise { - const stackTraceResponse = await this.dc.assertStoppedLocation( - stoppedReason, - { - path: stoppedFilePath, - line: stoppedLine - } - ); + const stackTraceResponse = await this.dc.assertStoppedLocation(stoppedReason, { + path: stoppedFilePath, + line: stoppedLine + }); stackTraceResponse.body.stackFrames.forEach(frame => { if (frame.source && frame.source.path) { frame.source.path = ''; } }); - const actualStack = JSON.stringify( - stackTraceResponse.body.stackFrames, - null, - 2 - ); + const actualStack = JSON.stringify(stackTraceResponse.body.stackFrames, null, 2); this.compareGoldValue(actualStack); return stackTraceResponse; } @@ -118,11 +93,7 @@ export class GoldFileUtil { const variablesResponse = await this.dc.variablesRequest({ variablesReference: scope.variablesReference }); - const actualVariables = JSON.stringify( - variablesResponse.body.variables, - null, - 2 - ); + const actualVariables = JSON.stringify(variablesResponse.body.variables, null, 2); this.compareGoldValue(actualVariables); } diff --git a/packages/salesforcedx-apex-replay-debugger/test/unit/adapter/apexReplayDebug.test.ts b/packages/salesforcedx-apex-replay-debugger/test/unit/adapter/apexReplayDebug.test.ts index 86769df887..a5648a485c 100644 --- a/packages/salesforcedx-apex-replay-debugger/test/unit/adapter/apexReplayDebug.test.ts +++ b/packages/salesforcedx-apex-replay-debugger/test/unit/adapter/apexReplayDebug.test.ts @@ -17,19 +17,9 @@ import { import { DebugProtocol } from '@vscode/debugprotocol'; import { expect } from 'chai'; import * as sinon from 'sinon'; -import { - ApexReplayDebug, - LaunchRequestArguments -} from '../../../src/adapter/apexReplayDebug'; -import { - BreakpointUtil, - LineBreakpointInfo, - breakpointUtil -} from '../../../src/breakpoints'; -import { - SEND_METRIC_ERROR_EVENT, - SEND_METRIC_LAUNCH_EVENT -} from '../../../src/constants'; +import { ApexReplayDebug, LaunchRequestArguments } from '../../../src/adapter/apexReplayDebug'; +import { BreakpointUtil, LineBreakpointInfo, breakpointUtil } from '../../../src/breakpoints'; +import { SEND_METRIC_ERROR_EVENT, SEND_METRIC_LAUNCH_EVENT } from '../../../src/constants'; import { LogContext, LogContextUtil } from '../../../src/core'; import { HeapDumpService } from '../../../src/core/heapDumpService'; import { nls } from '../../../src/messages'; @@ -113,20 +103,10 @@ describe('Replay debugger adapter - unit', () => { }; sendResponseSpy = sinon.spy(ApexReplayDebug.prototype, 'sendResponse'); sendEventSpy = sinon.spy(ApexReplayDebug.prototype, 'sendEvent'); - readLogFileStub = sinon - .stub(LogContextUtil.prototype, 'readLogFile') - .returns(['line1', 'line2']); - getLogSizeStub = sinon - .stub(LogContext.prototype, 'getLogSize') - .returns(123); - printToDebugConsoleStub = sinon.stub( - ApexReplayDebug.prototype, - 'printToDebugConsole' - ); - errorToDebugConsoleStub = sinon.stub( - ApexReplayDebug.prototype, - 'errorToDebugConsole' - ); + readLogFileStub = sinon.stub(LogContextUtil.prototype, 'readLogFile').returns(['line1', 'line2']); + getLogSizeStub = sinon.stub(LogContext.prototype, 'getLogSize').returns(123); + printToDebugConsoleStub = sinon.stub(ApexReplayDebug.prototype, 'printToDebugConsole'); + errorToDebugConsoleStub = sinon.stub(ApexReplayDebug.prototype, 'errorToDebugConsole'); }); afterEach(() => { @@ -147,12 +127,8 @@ describe('Replay debugger adapter - unit', () => { }); it('Should return error when there are no log lines', async () => { - hasLogLinesStub = sinon - .stub(LogContext.prototype, 'hasLogLines') - .returns(false); - meetsLogLevelRequirementsStub = sinon - .stub(LogContext.prototype, 'meetsLogLevelRequirements') - .returns(false); + hasLogLinesStub = sinon.stub(LogContext.prototype, 'hasLogLines').returns(false); + meetsLogLevelRequirementsStub = sinon.stub(LogContext.prototype, 'meetsLogLevelRequirements').returns(false); await adapter.launchRequest(response, args); @@ -160,17 +136,12 @@ describe('Replay debugger adapter - unit', () => { expect(meetsLogLevelRequirementsStub.calledOnce).to.be.false; expect(sendResponseSpy.calledOnce).to.be.true; expect(sendEventSpy.callCount).to.equal(4); - const actualResponse: DebugProtocol.LaunchResponse = - sendResponseSpy.getCall(0).args[0]; + const actualResponse: DebugProtocol.LaunchResponse = sendResponseSpy.getCall(0).args[0]; expect(actualResponse.success).to.be.false; expect(actualResponse.message).to.equal(nls.localize('no_log_file_text')); expect(sendEventSpy.getCall(1).args[0]).to.be.instanceof(Event); - expect(sendEventSpy.getCall(1).args[0].body.subject).to.equal( - 'No log lines found' - ); - expect(sendEventSpy.getCall(2).args[0]).to.be.instanceof( - InitializedEvent - ); + expect(sendEventSpy.getCall(1).args[0].body.subject).to.equal('No log lines found'); + expect(sendEventSpy.getCall(2).args[0]).to.be.instanceof(InitializedEvent); const eventObj = sendEventSpy.getCall(3).args[0] as DebugProtocol.Event; expect(eventObj.event).to.equal(SEND_METRIC_LAUNCH_EVENT); expect(eventObj.body).to.deep.equal({ @@ -180,12 +151,8 @@ describe('Replay debugger adapter - unit', () => { }); it('Should return error when log levels are incorrect', async () => { - hasLogLinesStub = sinon - .stub(LogContext.prototype, 'hasLogLines') - .returns(true); - meetsLogLevelRequirementsStub = sinon - .stub(LogContext.prototype, 'meetsLogLevelRequirements') - .returns(false); + hasLogLinesStub = sinon.stub(LogContext.prototype, 'hasLogLines').returns(true); + meetsLogLevelRequirementsStub = sinon.stub(LogContext.prototype, 'meetsLogLevelRequirements').returns(false); await adapter.launchRequest(response, args); @@ -193,19 +160,12 @@ describe('Replay debugger adapter - unit', () => { expect(meetsLogLevelRequirementsStub.calledOnce).to.be.true; expect(sendResponseSpy.calledOnce).to.be.true; expect(sendEventSpy.callCount).to.equal(4); - const actualResponse: DebugProtocol.LaunchResponse = - sendResponseSpy.getCall(0).args[0]; + const actualResponse: DebugProtocol.LaunchResponse = sendResponseSpy.getCall(0).args[0]; expect(actualResponse.success).to.be.false; - expect(actualResponse.message).to.equal( - nls.localize('incorrect_log_levels_text') - ); + expect(actualResponse.message).to.equal(nls.localize('incorrect_log_levels_text')); expect(sendEventSpy.getCall(1).args[0]).to.be.instanceof(Event); - expect(sendEventSpy.getCall(1).args[0].body.subject).to.equal( - 'Incorrect log levels' - ); - expect(sendEventSpy.getCall(2).args[0]).to.be.instanceof( - InitializedEvent - ); + expect(sendEventSpy.getCall(1).args[0].body.subject).to.equal('Incorrect log levels'); + expect(sendEventSpy.getCall(2).args[0]).to.be.instanceof(InitializedEvent); const eventObj = sendEventSpy.getCall(3).args[0] as DebugProtocol.Event; expect(eventObj.event).to.equal(SEND_METRIC_LAUNCH_EVENT); expect(eventObj.body).to.deep.equal({ @@ -215,12 +175,8 @@ describe('Replay debugger adapter - unit', () => { }); it('Should send response', async () => { - hasLogLinesStub = sinon - .stub(LogContext.prototype, 'hasLogLines') - .returns(true); - meetsLogLevelRequirementsStub = sinon - .stub(LogContext.prototype, 'meetsLogLevelRequirements') - .returns(true); + hasLogLinesStub = sinon.stub(LogContext.prototype, 'hasLogLines').returns(true); + meetsLogLevelRequirementsStub = sinon.stub(LogContext.prototype, 'meetsLogLevelRequirements').returns(true); args.lineBreakpointInfo = lineBpInfo; await adapter.launchRequest(response, args); @@ -229,25 +185,16 @@ describe('Replay debugger adapter - unit', () => { expect(meetsLogLevelRequirementsStub.calledOnce).to.be.true; expect(printToDebugConsoleStub.calledOnce).to.be.true; const consoleMessage = printToDebugConsoleStub.getCall(0).args[0]; - expect(consoleMessage).to.equal( - nls.localize('session_started_text', logFileName) - ); + expect(consoleMessage).to.equal(nls.localize('session_started_text', logFileName)); expect(sendResponseSpy.calledOnce).to.be.true; - const actualResponse: DebugProtocol.LaunchResponse = - sendResponseSpy.getCall(0).args[0]; + const actualResponse: DebugProtocol.LaunchResponse = sendResponseSpy.getCall(0).args[0]; expect(actualResponse.success).to.be.true; }); it('Should not scan for log lines if projectPath is undefined', async () => { - hasLogLinesStub = sinon - .stub(LogContext.prototype, 'hasLogLines') - .returns(true); - meetsLogLevelRequirementsStub = sinon - .stub(LogContext.prototype, 'meetsLogLevelRequirements') - .returns(true); - scanLogForHeapDumpLinesStub = sinon - .stub(LogContext.prototype, 'scanLogForHeapDumpLines') - .returns(false); + hasLogLinesStub = sinon.stub(LogContext.prototype, 'hasLogLines').returns(true); + meetsLogLevelRequirementsStub = sinon.stub(LogContext.prototype, 'meetsLogLevelRequirements').returns(true); + scanLogForHeapDumpLinesStub = sinon.stub(LogContext.prototype, 'scanLogForHeapDumpLines').returns(false); adapter.setProjectPath(undefined); await adapter.launchRequest(response, args); @@ -258,15 +205,9 @@ describe('Replay debugger adapter - unit', () => { }); it('Should scan log lines for heap dumps if projectPath is set', async () => { - hasLogLinesStub = sinon - .stub(LogContext.prototype, 'hasLogLines') - .returns(true); - meetsLogLevelRequirementsStub = sinon - .stub(LogContext.prototype, 'meetsLogLevelRequirements') - .returns(true); - scanLogForHeapDumpLinesStub = sinon - .stub(LogContext.prototype, 'scanLogForHeapDumpLines') - .returns(false); + hasLogLinesStub = sinon.stub(LogContext.prototype, 'hasLogLines').returns(true); + meetsLogLevelRequirementsStub = sinon.stub(LogContext.prototype, 'meetsLogLevelRequirements').returns(true); + scanLogForHeapDumpLinesStub = sinon.stub(LogContext.prototype, 'scanLogForHeapDumpLines').returns(false); fetchOverlayResultsForApexHeapDumpsStub = sinon .stub(LogContext.prototype, 'fetchOverlayResultsForApexHeapDumps') .returns(true); @@ -282,15 +223,9 @@ describe('Replay debugger adapter - unit', () => { }); it('Should call to fetch overlay results if heap dumps are found in the logs', async () => { - hasLogLinesStub = sinon - .stub(LogContext.prototype, 'hasLogLines') - .returns(true); - meetsLogLevelRequirementsStub = sinon - .stub(LogContext.prototype, 'meetsLogLevelRequirements') - .returns(true); - scanLogForHeapDumpLinesStub = sinon - .stub(LogContext.prototype, 'scanLogForHeapDumpLines') - .returns(true); + hasLogLinesStub = sinon.stub(LogContext.prototype, 'hasLogLines').returns(true); + meetsLogLevelRequirementsStub = sinon.stub(LogContext.prototype, 'meetsLogLevelRequirements').returns(true); + scanLogForHeapDumpLinesStub = sinon.stub(LogContext.prototype, 'scanLogForHeapDumpLines').returns(true); fetchOverlayResultsForApexHeapDumpsStub = sinon .stub(LogContext.prototype, 'fetchOverlayResultsForApexHeapDumps') .returns(true); @@ -305,15 +240,9 @@ describe('Replay debugger adapter - unit', () => { }); it('Should report a wrap up error if fetching heap dumps has a failure', async () => { - hasLogLinesStub = sinon - .stub(LogContext.prototype, 'hasLogLines') - .returns(true); - meetsLogLevelRequirementsStub = sinon - .stub(LogContext.prototype, 'meetsLogLevelRequirements') - .returns(true); - scanLogForHeapDumpLinesStub = sinon - .stub(LogContext.prototype, 'scanLogForHeapDumpLines') - .returns(true); + hasLogLinesStub = sinon.stub(LogContext.prototype, 'hasLogLines').returns(true); + meetsLogLevelRequirementsStub = sinon.stub(LogContext.prototype, 'meetsLogLevelRequirements').returns(true); + scanLogForHeapDumpLinesStub = sinon.stub(LogContext.prototype, 'scanLogForHeapDumpLines').returns(true); fetchOverlayResultsForApexHeapDumpsStub = sinon .stub(LogContext.prototype, 'fetchOverlayResultsForApexHeapDumps') .returns(false); @@ -328,16 +257,10 @@ describe('Replay debugger adapter - unit', () => { expect(errorToDebugConsoleStub.calledOnce).to.be.true; expect(sendEventSpy.callCount).to.equal(4); const errorMessage = errorToDebugConsoleStub.getCall(0).args[0]; - expect(errorMessage).to.equal( - nls.localize('heap_dump_error_wrap_up_text') - ); + expect(errorMessage).to.equal(nls.localize('heap_dump_error_wrap_up_text')); expect(sendEventSpy.getCall(1).args[0]).to.be.instanceof(Event); - expect(sendEventSpy.getCall(1).args[0].body.subject).to.equal( - 'Fetching heap dumps failed' - ); - expect(sendEventSpy.getCall(2).args[0]).to.be.instanceof( - InitializedEvent - ); + expect(sendEventSpy.getCall(1).args[0].body.subject).to.equal('Fetching heap dumps failed'); + expect(sendEventSpy.getCall(2).args[0]).to.be.instanceof(InitializedEvent); const eventObj = sendEventSpy.getCall(3).args[0] as DebugProtocol.Event; expect(eventObj.event).to.equal(SEND_METRIC_LAUNCH_EVENT); expect(eventObj.body).to.deep.equal({ @@ -365,10 +288,7 @@ describe('Replay debugger adapter - unit', () => { adapter.setLogFile(launchRequestArgs); sendEventSpy = sinon.spy(ApexReplayDebug.prototype, 'sendEvent'); updateFramesStub = sinon.stub(LogContext.prototype, 'updateFrames'); - continueRequestStub = sinon.stub( - ApexReplayDebug.prototype, - 'continueRequest' - ); + continueRequestStub = sinon.stub(ApexReplayDebug.prototype, 'continueRequest'); response = adapter.getDefaultResponse(); }); @@ -380,11 +300,9 @@ describe('Replay debugger adapter - unit', () => { }); it('Should send stopped event', () => { - getLaunchArgsStub = sinon - .stub(LogContext.prototype, 'getLaunchArgs') - .returns({ - stopOnEntry: true - } as LaunchRequestArguments); + getLaunchArgsStub = sinon.stub(LogContext.prototype, 'getLaunchArgs').returns({ + stopOnEntry: true + } as LaunchRequestArguments); adapter.configurationDoneRequest(response, args); @@ -393,17 +311,13 @@ describe('Replay debugger adapter - unit', () => { const event = sendEventSpy.getCall(0).args[0]; expect(event).to.be.instanceof(StoppedEvent); expect(sendEventSpy.getCall(1).args[0]).to.be.instanceof(Event); - expect(sendEventSpy.getCall(1).args[0].body.subject).to.equal( - 'configurationDoneRequest' - ); + expect(sendEventSpy.getCall(1).args[0].body.subject).to.equal('configurationDoneRequest'); }); it('Should continue until next breakpoint', () => { - getLaunchArgsStub = sinon - .stub(LogContext.prototype, 'getLaunchArgs') - .returns({ - stopOnEntry: false - } as LaunchRequestArguments); + getLaunchArgsStub = sinon.stub(LogContext.prototype, 'getLaunchArgs').returns({ + stopOnEntry: false + } as LaunchRequestArguments); adapter.configurationDoneRequest(response, args); @@ -412,9 +326,7 @@ describe('Replay debugger adapter - unit', () => { expect(updateFramesStub.called).to.be.false; expect(continueRequestStub.calledOnce).to.be.true; expect(sendEventSpy.getCall(0).args[0]).to.be.instanceof(Event); - expect(sendEventSpy.getCall(0).args[0].body.subject).to.equal( - 'configurationDoneRequest' - ); + expect(sendEventSpy.getCall(0).args[0].body.subject).to.equal('configurationDoneRequest'); }); }); @@ -431,10 +343,7 @@ describe('Replay debugger adapter - unit', () => { args = {}; sendEventSpy = sinon.spy(ApexReplayDebug.prototype, 'sendEvent'); sendResponseSpy = sinon.spy(ApexReplayDebug.prototype, 'sendResponse'); - printToDebugConsoleStub = sinon.stub( - ApexReplayDebug.prototype, - 'printToDebugConsole' - ); + printToDebugConsoleStub = sinon.stub(ApexReplayDebug.prototype, 'printToDebugConsole'); }); afterEach(() => { @@ -450,13 +359,10 @@ describe('Replay debugger adapter - unit', () => { const consoleMessage = printToDebugConsoleStub.getCall(0).args[0]; expect(consoleMessage).to.equal(nls.localize('session_terminated_text')); expect(sendResponseSpy.calledOnce).to.be.true; - const actualResponse: DebugProtocol.DisconnectResponse = - sendResponseSpy.getCall(0).args[0]; + const actualResponse: DebugProtocol.DisconnectResponse = sendResponseSpy.getCall(0).args[0]; expect(actualResponse.success).to.be.true; expect(sendEventSpy.getCall(0).args[0]).to.be.instanceof(Event); - expect(sendEventSpy.getCall(0).args[0].body.subject).to.equal( - 'disconnectRequest' - ); + expect(sendEventSpy.getCall(0).args[0].body.subject).to.equal('disconnectRequest'); }); }); @@ -476,9 +382,7 @@ describe('Replay debugger adapter - unit', () => { body: { threads: [] } }); sendResponseSpy = sinon.spy(ApexReplayDebug.prototype, 'sendResponse'); - readLogFileStub = sinon - .stub(LogContextUtil.prototype, 'readLogFile') - .returns(['line1', 'line2']); + readLogFileStub = sinon.stub(LogContextUtil.prototype, 'readLogFile').returns(['line1', 'line2']); adapter.setLogFile(launchRequestArgs); }); @@ -491,8 +395,7 @@ describe('Replay debugger adapter - unit', () => { adapter.threadsRequest(response); expect(sendResponseSpy.calledOnce).to.be.true; - const actualResponse: DebugProtocol.ThreadsResponse = - sendResponseSpy.getCall(0).args[0]; + const actualResponse: DebugProtocol.ThreadsResponse = sendResponseSpy.getCall(0).args[0]; expect(actualResponse.success).to.be.true; expect(actualResponse.body.threads.length).to.equal(1); const thread: Thread = actualResponse.body.threads[0]; @@ -537,13 +440,9 @@ describe('Replay debugger adapter - unit', () => { threadId: ApexReplayDebug.THREAD_ID }; sendResponseSpy = sinon.spy(ApexReplayDebug.prototype, 'sendResponse'); - readLogFileStub = sinon - .stub(LogContextUtil.prototype, 'readLogFile') - .returns(['line1', 'line2']); + readLogFileStub = sinon.stub(LogContextUtil.prototype, 'readLogFile').returns(['line1', 'line2']); adapter.setLogFile(launchRequestArgs); - getFramesStub = sinon - .stub(LogContext.prototype, 'getFrames') - .returns(sampleStackFrames); + getFramesStub = sinon.stub(LogContext.prototype, 'getFrames').returns(sampleStackFrames); }); afterEach(() => { @@ -556,12 +455,9 @@ describe('Replay debugger adapter - unit', () => { adapter.stackTraceRequest(response, args); expect(sendResponseSpy.calledOnce).to.be.true; - const actualResponse: DebugProtocol.StackTraceResponse = - sendResponseSpy.getCall(0).args[0]; + const actualResponse: DebugProtocol.StackTraceResponse = sendResponseSpy.getCall(0).args[0]; expect(actualResponse.success).to.be.true; - expect(actualResponse.body.stackFrames).to.eql( - sampleStackFrames.slice().reverse() - ); + expect(actualResponse.body.stackFrames).to.eql(sampleStackFrames.slice().reverse()); }); }); @@ -605,15 +501,12 @@ describe('Replay debugger adapter - unit', () => { }); it('Should terminate session', () => { - hasLogLinesStub = sinon - .stub(LogContext.prototype, 'hasLogLines') - .returns(false); + hasLogLinesStub = sinon.stub(LogContext.prototype, 'hasLogLines').returns(false); adapter.continueRequest(response, args); expect(sendResponseSpy.calledOnce).to.be.true; - const actualResponse: DebugProtocol.StackTraceResponse = - sendResponseSpy.getCall(0).args[0]; + const actualResponse: DebugProtocol.StackTraceResponse = sendResponseSpy.getCall(0).args[0]; expect(actualResponse.success).to.be.true; expect(sendEventSpy.calledOnce).to.be.true; expect(sendEventSpy.getCall(0).args[0]).to.be.instanceof(TerminatedEvent); @@ -627,15 +520,12 @@ describe('Replay debugger adapter - unit', () => { .onSecondCall() .returns(false); updateFramesStub = sinon.stub(LogContext.prototype, 'updateFrames'); - shouldStopForBreakpointStub = sinon - .stub(MockApexReplayDebug.prototype, 'shouldStopForBreakpoint') - .returns(true); + shouldStopForBreakpointStub = sinon.stub(MockApexReplayDebug.prototype, 'shouldStopForBreakpoint').returns(true); adapter.continueRequest(response, args); expect(sendResponseSpy.calledOnce).to.be.true; - const actualResponse: DebugProtocol.StackTraceResponse = - sendResponseSpy.getCall(0).args[0]; + const actualResponse: DebugProtocol.StackTraceResponse = sendResponseSpy.getCall(0).args[0]; expect(actualResponse.success).to.be.true; expect(sendEventSpy.called).to.be.false; }); @@ -648,15 +538,12 @@ describe('Replay debugger adapter - unit', () => { .onSecondCall() .returns(false); updateFramesStub = sinon.stub(LogContext.prototype, 'updateFrames'); - shouldStopForBreakpointStub = sinon - .stub(MockApexReplayDebug.prototype, 'shouldStopForBreakpoint') - .returns(false); + shouldStopForBreakpointStub = sinon.stub(MockApexReplayDebug.prototype, 'shouldStopForBreakpoint').returns(false); adapter.continueRequest(response, args); expect(sendResponseSpy.calledOnce).to.be.true; - const actualResponse: DebugProtocol.StackTraceResponse = - sendResponseSpy.getCall(0).args[0]; + const actualResponse: DebugProtocol.StackTraceResponse = sendResponseSpy.getCall(0).args[0]; expect(actualResponse.success).to.be.true; expect(sendEventSpy.calledOnce).to.be.true; const event = sendEventSpy.getCall(0).args[0]; @@ -664,20 +551,13 @@ describe('Replay debugger adapter - unit', () => { }); it('Should handle errors during step execution', () => { - hasLogLinesStub = sinon - .stub(LogContext.prototype, 'hasLogLines') - .onFirstCall() - .returns(true); + hasLogLinesStub = sinon.stub(LogContext.prototype, 'hasLogLines').onFirstCall().returns(true); // Cause `updateFrames` to throw an error to trigger the catch block const error = new Error('Test error during step execution'); - updateFramesStub = sinon - .stub(LogContext.prototype, 'updateFrames') - .throws(error); + updateFramesStub = sinon.stub(LogContext.prototype, 'updateFrames').throws(error); - shouldStopForBreakpointStub = sinon - .stub(MockApexReplayDebug.prototype, 'shouldStopForBreakpoint') - .returns(false); + shouldStopForBreakpointStub = sinon.stub(MockApexReplayDebug.prototype, 'shouldStopForBreakpoint').returns(false); try { adapter.continueRequest(response, args); @@ -741,8 +621,7 @@ describe('Replay debugger adapter - unit', () => { ); expect(sendResponseSpy.calledOnce).to.be.true; - const actualResponse: DebugProtocol.StackTraceResponse = - sendResponseSpy.getCall(0).args[0]; + const actualResponse: DebugProtocol.StackTraceResponse = sendResponseSpy.getCall(0).args[0]; expect(actualResponse.success).to.be.true; expect(sendEventSpy.calledOnce).to.be.true; const event = sendEventSpy.getCall(0).args[0]; @@ -768,8 +647,7 @@ describe('Replay debugger adapter - unit', () => { ); expect(sendResponseSpy.calledOnce).to.be.true; - const actualResponse: DebugProtocol.StackTraceResponse = - sendResponseSpy.getCall(0).args[0]; + const actualResponse: DebugProtocol.StackTraceResponse = sendResponseSpy.getCall(0).args[0]; expect(actualResponse.success).to.be.true; expect(sendEventSpy.calledOnce).to.be.true; const event = sendEventSpy.getCall(0).args[0]; @@ -795,8 +673,7 @@ describe('Replay debugger adapter - unit', () => { ); expect(sendResponseSpy.calledOnce).to.be.true; - const actualResponse: DebugProtocol.StackTraceResponse = - sendResponseSpy.getCall(0).args[0]; + const actualResponse: DebugProtocol.StackTraceResponse = sendResponseSpy.getCall(0).args[0]; expect(actualResponse.success).to.be.true; expect(sendEventSpy.calledOnce).to.be.true; const event = sendEventSpy.getCall(0).args[0]; @@ -874,8 +751,7 @@ describe('Replay debugger adapter - unit', () => { adapter.setBreakPointsRequest(response, args); expect(sendResponseSpy.calledOnce).to.be.true; - const actualResponse: DebugProtocol.SetBreakpointsResponse = - sendResponseSpy.getCall(0).args[0]; + const actualResponse: DebugProtocol.SetBreakpointsResponse = sendResponseSpy.getCall(0).args[0]; expect(actualResponse.success).to.be.true; expect(actualResponse.body.breakpoints).to.be.empty; expect(sendEventSpy.calledOnce).to.be.true; @@ -891,8 +767,7 @@ describe('Replay debugger adapter - unit', () => { adapter.setBreakPointsRequest(response, args); expect(sendResponseSpy.calledOnce).to.be.true; - const actualResponse: DebugProtocol.SetBreakpointsResponse = - sendResponseSpy.getCall(0).args[0]; + const actualResponse: DebugProtocol.SetBreakpointsResponse = sendResponseSpy.getCall(0).args[0]; expect(actualResponse.success).to.be.true; expect(actualResponse.body.breakpoints).to.be.empty; expect(sendEventSpy.calledOnce).to.be.true; @@ -903,9 +778,7 @@ describe('Replay debugger adapter - unit', () => { }); it('Should return breakpoints', () => { - const expectedPath = /^win32/.test(process.platform) - ? 'C:\\space in path\\foo.cls' - : '/space in path/foo.cls'; + const expectedPath = /^win32/.test(process.platform) ? 'C:\\space in path\\foo.cls' : '/space in path/foo.cls'; const uriFromLanguageServer = /^win32/.test(process.platform) ? 'file:///c:/space%20in%20path/foo.cls' : 'file:///space%20in%20path/foo.cls'; @@ -923,8 +796,7 @@ describe('Replay debugger adapter - unit', () => { adapter.setBreakPointsRequest(response, args); expect(sendResponseSpy.calledOnce).to.be.true; - const actualResponse: DebugProtocol.SetBreakpointsResponse = - sendResponseSpy.getCall(0).args[0]; + const actualResponse: DebugProtocol.SetBreakpointsResponse = sendResponseSpy.getCall(0).args[0]; expect(actualResponse.success).to.be.true; expect(actualResponse.body.breakpoints).to.deep.equal([ { @@ -939,23 +811,13 @@ describe('Replay debugger adapter - unit', () => { } ]); expect(canSetLineBreakpointStub.calledTwice).to.be.true; - expect(canSetLineBreakpointStub.getCall(0).args).to.have.same.members([ - uriFromLanguageServer, - 1 - ]); - expect(canSetLineBreakpointStub.getCall(1).args).to.have.same.members([ - uriFromLanguageServer, - 2 - ]); + expect(canSetLineBreakpointStub.getCall(0).args).to.have.same.members([uriFromLanguageServer, 1]); + expect(canSetLineBreakpointStub.getCall(1).args).to.have.same.members([uriFromLanguageServer, 2]); expect(sendEventSpy.calledTwice).to.be.true; expect(sendEventSpy.getCall(0).args[0]).to.be.instanceof(Event); - expect(sendEventSpy.getCall(0).args[0].body.subject).to.equal( - 'Failed to set breakpoint' - ); + expect(sendEventSpy.getCall(0).args[0].body.subject).to.equal('Failed to set breakpoint'); expect(sendEventSpy.getCall(1).args[0]).to.be.instanceof(Event); - expect(sendEventSpy.getCall(1).args[0].body.subject).to.equal( - 'setBreakPointsRequest' - ); + expect(sendEventSpy.getCall(1).args[0].body.subject).to.equal('setBreakPointsRequest'); }); }); @@ -988,12 +850,8 @@ describe('Replay debugger adapter - unit', () => { beforeEach(() => { adapter = new MockApexReplayDebug(); - hasLogLinesStub = sinon - .stub(LogContext.prototype, 'hasLogLines') - .returns(true); - meetsLogLevelRequirementsStub = sinon - .stub(LogContext.prototype, 'meetsLogLevelRequirements') - .returns(true); + hasLogLinesStub = sinon.stub(LogContext.prototype, 'hasLogLines').returns(true); + meetsLogLevelRequirementsStub = sinon.stub(LogContext.prototype, 'meetsLogLevelRequirements').returns(true); sendEventSpy = sinon.spy(ApexReplayDebug.prototype, 'sendEvent'); sendResponseSpy = sinon.spy(ApexReplayDebug.prototype, 'sendResponse'); createMappingsFromLineBreakpointInfo = sinon.spy( @@ -1011,19 +869,12 @@ describe('Replay debugger adapter - unit', () => { }); it('Should handle undefined args', async () => { - await adapter.launchRequest( - initializedResponse, - {} as LaunchRequestArguments - ); + await adapter.launchRequest(initializedResponse, {} as LaunchRequestArguments); expect(createMappingsFromLineBreakpointInfo.called).to.be.false; - expect(initializedResponse.message).to.deep.equal( - nls.localize('session_language_server_error_text') - ); + expect(initializedResponse.message).to.deep.equal(nls.localize('session_language_server_error_text')); expect(sendEventSpy.callCount).to.equal(4); expect(sendEventSpy.getCall(1).args[0]).to.be.instanceof(Event); - expect(sendEventSpy.getCall(1).args[0].body.subject).to.equal( - 'No line breakpoint info available' - ); + expect(sendEventSpy.getCall(1).args[0].body.subject).to.equal('No line breakpoint info available'); }); it('Should handle empty line breakpoint info', async () => { @@ -1033,14 +884,10 @@ describe('Replay debugger adapter - unit', () => { projectPath: undefined }; - await adapter.launchRequest( - initializedResponse, - config as LaunchRequestArguments - ); + await adapter.launchRequest(initializedResponse, config as LaunchRequestArguments); expect(createMappingsFromLineBreakpointInfo.called).to.be.true; expect(sendResponseSpy.called).to.be.true; - const actualResponse: DebugProtocol.InitializeResponse = - sendResponseSpy.getCall(0).args[0]; + const actualResponse: DebugProtocol.InitializeResponse = sendResponseSpy.getCall(0).args[0]; expect(actualResponse.success).to.be.true; expect(actualResponse).to.deep.equal(initializedResponse); expect(adapter.getProjectPath()).to.equal(undefined); @@ -1063,24 +910,16 @@ describe('Replay debugger adapter - unit', () => { projectPath: projectPathArg, logFile: 'someTestLogFile.log' }; - await adapter.launchRequest( - initializedResponse, - config as LaunchRequestArguments - ); + await adapter.launchRequest(initializedResponse, config as LaunchRequestArguments); expect(createMappingsFromLineBreakpointInfo.calledOnce).to.be.true; - expect( - createMappingsFromLineBreakpointInfo.getCall(0).args[0] - ).to.deep.equal(info); + expect(createMappingsFromLineBreakpointInfo.getCall(0).args[0]).to.deep.equal(info); expect(sendResponseSpy.called).to.be.true; - const actualResponse: DebugProtocol.InitializeResponse = - sendResponseSpy.getCall(0).args[0]; + const actualResponse: DebugProtocol.InitializeResponse = sendResponseSpy.getCall(0).args[0]; expect(actualResponse.success).to.be.true; expect(actualResponse).to.deep.equal(initializedResponse); // Verify that the line number mapping is the expected line number mapping - expect(breakpointUtil.getLineNumberMapping()).to.deep.eq( - expectedLineNumberMapping - ); + expect(breakpointUtil.getLineNumberMapping()).to.deep.eq(expectedLineNumberMapping); expect(adapter.getProjectPath()).to.equal(projectPathArg); }); }); diff --git a/packages/salesforcedx-apex-replay-debugger/test/unit/adapter/apexReplayDebugVariablesHandling.test.ts b/packages/salesforcedx-apex-replay-debugger/test/unit/adapter/apexReplayDebugVariablesHandling.test.ts index 3f1ec11108..bd09a86aa4 100644 --- a/packages/salesforcedx-apex-replay-debugger/test/unit/adapter/apexReplayDebugVariablesHandling.test.ts +++ b/packages/salesforcedx-apex-replay-debugger/test/unit/adapter/apexReplayDebugVariablesHandling.test.ts @@ -65,9 +65,7 @@ describe('Replay debugger adapter variable handling - unit', () => { }; frameHandler = new Handles(); sendResponseSpy = sinon.spy(ApexReplayDebug.prototype, 'sendResponse'); - getFrameHandlerStub = sinon - .stub(LogContext.prototype, 'getFrameHandler') - .returns(frameHandler); + getFrameHandlerStub = sinon.stub(LogContext.prototype, 'getFrameHandler').returns(frameHandler); }); afterEach(() => { @@ -86,30 +84,24 @@ describe('Replay debugger adapter variable handling - unit', () => { }); it('Should return no scopes for unknown frame', async () => { - hasHeapDumpForTopFrameStub = sinon - .stub(LogContext.prototype, 'hasHeapDumpForTopFrame') - .returns(false); + hasHeapDumpForTopFrameStub = sinon.stub(LogContext.prototype, 'hasHeapDumpForTopFrame').returns(false); await adapter.scopesRequest(response, args); expect(sendResponseSpy.calledOnce).to.be.true; - const actualResponse: DebugProtocol.ScopesResponse = - sendResponseSpy.getCall(0).args[0]; + const actualResponse: DebugProtocol.ScopesResponse = sendResponseSpy.getCall(0).args[0]; expect(actualResponse.success).to.be.true; expect(actualResponse.body.scopes.length).to.equal(0); }); it('Should return local, static, and global scopes', async () => { - hasHeapDumpForTopFrameStub = sinon - .stub(LogContext.prototype, 'hasHeapDumpForTopFrame') - .returns(false); + hasHeapDumpForTopFrameStub = sinon.stub(LogContext.prototype, 'hasHeapDumpForTopFrame').returns(false); const id = frameHandler.create(new ApexDebugStackFrameInfo(0, 'foo')); args.frameId = id; await adapter.scopesRequest(response, args); - const actualResponse: DebugProtocol.ScopesResponse = - sendResponseSpy.getCall(0).args[0]; + const actualResponse: DebugProtocol.ScopesResponse = sendResponseSpy.getCall(0).args[0]; expect(actualResponse.success).to.be.true; expect(actualResponse.body.scopes.length).to.equal(3); expect(actualResponse.body.scopes[0].name).to.equal('Local'); @@ -118,21 +110,10 @@ describe('Replay debugger adapter variable handling - unit', () => { }); it('Should replace with heapdump variables', async () => { - hasHeapDumpForTopFrameStub = sinon - .stub(LogContext.prototype, 'hasHeapDumpForTopFrame') - .returns(true); - copyStateForHeapDumpStub = sinon.stub( - LogContext.prototype, - 'copyStateForHeapDump' - ); - replaceVariablesWithHeapDumpStub = sinon.stub( - HeapDumpService.prototype, - 'replaceVariablesWithHeapDump' - ); - resetLastSeenHeapDumpLogLineStub = sinon.stub( - LogContext.prototype, - 'resetLastSeenHeapDumpLogLine' - ); + hasHeapDumpForTopFrameStub = sinon.stub(LogContext.prototype, 'hasHeapDumpForTopFrame').returns(true); + copyStateForHeapDumpStub = sinon.stub(LogContext.prototype, 'copyStateForHeapDump'); + replaceVariablesWithHeapDumpStub = sinon.stub(HeapDumpService.prototype, 'replaceVariablesWithHeapDump'); + resetLastSeenHeapDumpLogLineStub = sinon.stub(LogContext.prototype, 'resetLastSeenHeapDumpLogLine'); await adapter.scopesRequest(response, args); @@ -175,28 +156,22 @@ describe('Replay debugger adapter variable handling - unit', () => { it('Should return no variables for unknown scope', async () => { await adapter.variablesRequest(response, args); - const actualResponse: DebugProtocol.VariablesResponse = - sendResponseSpy.getCall(0).args[0]; + const actualResponse: DebugProtocol.VariablesResponse = sendResponseSpy.getCall(0).args[0]; expect(actualResponse.success).to.be.true; expect(actualResponse.body.variables.length).to.equal(0); }); it('Should collect variables from scope container', async () => { - getVariableHandlerStub = sinon - .stub(LogContext.prototype, 'getVariableHandler') - .returns(variableHandler); + getVariableHandlerStub = sinon.stub(LogContext.prototype, 'getVariableHandler').returns(variableHandler); getAllVariablesStub = sinon .stub(VariableContainer.prototype, 'getAllVariables') .returns([new ApexVariable('foo', 'bar', 'String')]); - const id = variableHandler.create( - new ApexVariableContainer('foo', 'bar', 'String') - ); + const id = variableHandler.create(new ApexVariableContainer('foo', 'bar', 'String')); args.variablesReference = id; await adapter.variablesRequest(response, args); - const actualResponse: DebugProtocol.VariablesResponse = - sendResponseSpy.getCall(0).args[0]; + const actualResponse: DebugProtocol.VariablesResponse = sendResponseSpy.getCall(0).args[0]; expect(actualResponse.success).to.be.true; expect(actualResponse.body.variables.length).to.equal(1); const apexVariable = actualResponse.body.variables[0]; @@ -241,32 +216,14 @@ describe('Replay debugger adapter variable handling - unit', () => { adapter.setLogFile(launchRequestArgs); frameHandler = new Handles(); refsMap = new Map(); - staticVariablesClassMap = new Map< - string, - Map - >(); - getTopFrameStub = sinon - .stub(LogContext.prototype, 'getTopFrame') - .returns(topFrame); - - createStringRefsFromHeapdumpSpy = sinon.spy( - HeapDumpService.prototype, - 'createStringRefsFromHeapdump' - ); - updateLeafReferenceContainerSpy = sinon.spy( - HeapDumpService.prototype, - 'updateLeafReferenceContainer' - ); - createVariableFromReferenceSpy = sinon.spy( - HeapDumpService.prototype, - 'createVariableFromReference' - ); - getFrameHandlerStub = sinon - .stub(LogContext.prototype, 'getFrameHandler') - .returns(frameHandler); - getRefsMapStub = sinon - .stub(LogContext.prototype, 'getRefsMap') - .returns(refsMap); + staticVariablesClassMap = new Map>(); + getTopFrameStub = sinon.stub(LogContext.prototype, 'getTopFrame').returns(topFrame); + + createStringRefsFromHeapdumpSpy = sinon.spy(HeapDumpService.prototype, 'createStringRefsFromHeapdump'); + updateLeafReferenceContainerSpy = sinon.spy(HeapDumpService.prototype, 'updateLeafReferenceContainer'); + createVariableFromReferenceSpy = sinon.spy(HeapDumpService.prototype, 'createVariableFromReference'); + getFrameHandlerStub = sinon.stub(LogContext.prototype, 'getFrameHandler').returns(frameHandler); + getRefsMapStub = sinon.stub(LogContext.prototype, 'getRefsMap').returns(refsMap); getStaticVariablesClassMapStub = sinon .stub(LogContext.prototype, 'getStaticVariablesClassMap') .returns(staticVariablesClassMap); @@ -310,25 +267,19 @@ describe('Replay debugger adapter variable handling - unit', () => { it('Should not create string refs if there are not any in the heapdump', () => { const heapdump = createHeapDumpWithNoStringTypes(); - heapDumpService.createStringRefsFromHeapdump( - heapdump.getOverlaySuccessResult()! - ); + heapDumpService.createStringRefsFromHeapdump(heapdump.getOverlaySuccessResult()!); expect(refsMap.size).to.be.eq(0); }); it('Should only create string refs if there are not any in the heapdump', () => { const heapdump = createHeapDumpWithNoStringTypes(); - heapDumpService.createStringRefsFromHeapdump( - heapdump.getOverlaySuccessResult()! - ); + heapDumpService.createStringRefsFromHeapdump(heapdump.getOverlaySuccessResult()!); expect(refsMap.size).to.be.eq(0); }); it('Should create string refs if there are any in the heapdump', () => { const heapdump = createHeapDumpWithStrings(); - heapDumpService.createStringRefsFromHeapdump( - heapdump.getOverlaySuccessResult()! - ); + heapDumpService.createStringRefsFromHeapdump(heapdump.getOverlaySuccessResult()!); expect(refsMap.size).to.be.eq(2); let tempStringVar = refsMap.get('0x47a32f5b') as ApexVariableContainer; expect(tempStringVar.value).to.be.eq( @@ -358,60 +309,31 @@ describe('Replay debugger adapter variable handling - unit', () => { // value let tempApexVar = refsMap.get('0x3557adc7') as ApexVariableContainer; expect(tempApexVar.variables.size).to.be.eq(7); - expect( - (tempApexVar.variables.get('MyBoolean') as ApexVariableContainer) - .value - ).to.be.eq('false'); - expect( - (tempApexVar.variables.get('MyDate') as ApexVariableContainer).value - ).to.be.eq('Thu Sep 13 00:00:00 GMT 2018'); - expect( - (tempApexVar.variables.get('MyDouble') as ApexVariableContainer).value - ).to.be.eq('4.37559'); - expect( - (tempApexVar.variables.get('MyInteger') as ApexVariableContainer) - .value - ).to.be.eq('10'); - expect( - (tempApexVar.variables.get('MyLong') as ApexVariableContainer).value - ).to.be.eq('4271993'); - expect( - (tempApexVar.variables.get('MyString') as ApexVariableContainer).value - ).to.be.eq( + expect((tempApexVar.variables.get('MyBoolean') as ApexVariableContainer).value).to.be.eq('false'); + expect((tempApexVar.variables.get('MyDate') as ApexVariableContainer).value).to.be.eq( + 'Thu Sep 13 00:00:00 GMT 2018' + ); + expect((tempApexVar.variables.get('MyDouble') as ApexVariableContainer).value).to.be.eq('4.37559'); + expect((tempApexVar.variables.get('MyInteger') as ApexVariableContainer).value).to.be.eq('10'); + expect((tempApexVar.variables.get('MyLong') as ApexVariableContainer).value).to.be.eq('4271993'); + expect((tempApexVar.variables.get('MyString') as ApexVariableContainer).value).to.be.eq( "'This is a longer string that will certainly get truncated until we hit a checkpoint and inspect it_extra'" ); - const innerApexRefVar = tempApexVar.variables.get( - 'innerVariable' - ) as ApexVariableContainer; + const innerApexRefVar = tempApexVar.variables.get('innerVariable') as ApexVariableContainer; expect(innerApexRefVar.ref).to.be.eq('0x55260a7a'); expect(innerApexRefVar.variables.size).to.be.eq(0); tempApexVar = refsMap.get('0x55260a7a') as ApexVariableContainer; expect(tempApexVar.variables.size).to.be.eq(7); - expect( - (tempApexVar.variables.get('MyBoolean') as ApexVariableContainer) - .value - ).to.be.eq('true'); - expect( - (tempApexVar.variables.get('MyDate') as ApexVariableContainer).value - ).to.be.eq('Thu Sep 13 00:00:00 GMT 2018'); - expect( - (tempApexVar.variables.get('MyDouble') as ApexVariableContainer).value - ).to.be.eq('3.14159'); - expect( - (tempApexVar.variables.get('MyInteger') as ApexVariableContainer) - .value - ).to.be.eq('5'); - expect( - (tempApexVar.variables.get('MyLong') as ApexVariableContainer).value - ).to.be.eq('4271990'); - expect( - (tempApexVar.variables.get('MyString') as ApexVariableContainer).value - ).to.be.eq("'9/13/2018'"); - expect( - (tempApexVar.variables.get('innerVariable') as ApexVariableContainer) - .value - ).to.be.eq('null'); + expect((tempApexVar.variables.get('MyBoolean') as ApexVariableContainer).value).to.be.eq('true'); + expect((tempApexVar.variables.get('MyDate') as ApexVariableContainer).value).to.be.eq( + 'Thu Sep 13 00:00:00 GMT 2018' + ); + expect((tempApexVar.variables.get('MyDouble') as ApexVariableContainer).value).to.be.eq('3.14159'); + expect((tempApexVar.variables.get('MyInteger') as ApexVariableContainer).value).to.be.eq('5'); + expect((tempApexVar.variables.get('MyLong') as ApexVariableContainer).value).to.be.eq('4271990'); + expect((tempApexVar.variables.get('MyString') as ApexVariableContainer).value).to.be.eq("'9/13/2018'"); + expect((tempApexVar.variables.get('innerVariable') as ApexVariableContainer).value).to.be.eq('null'); }); it('Should follow reference chain when creating instance variables from references', () => { @@ -420,103 +342,39 @@ describe('Replay debugger adapter variable handling - unit', () => { .stub(LogContext.prototype, 'getHeapDumpForThisLocation') .returns(heapdump); - const localRefVariable = new ApexVariableContainer( - 'foo', - '', - 'NonStaticClassWithVariablesToInspect' - ); + const localRefVariable = new ApexVariableContainer('foo', '', 'NonStaticClassWithVariablesToInspect'); const frameInfo = new ApexDebugStackFrameInfo(0, 'Foo'); const id = frameHandler.create(frameInfo); topFrame.id = id; frameInfo.locals.set(localRefVariable.name, localRefVariable); heapDumpService.replaceVariablesWithHeapDump(); - const updatedLocRefVariable = frameInfo.locals.get( - localRefVariable.name - ) as ApexVariableContainer; + const updatedLocRefVariable = frameInfo.locals.get(localRefVariable.name) as ApexVariableContainer; expect(updatedLocRefVariable.variables.size).to.be.eq(7); - expect( - ( - updatedLocRefVariable.variables.get( - 'MyBoolean' - ) as ApexVariableContainer - ).value - ).to.be.eq('false'); - expect( - ( - updatedLocRefVariable.variables.get( - 'MyDate' - ) as ApexVariableContainer - ).value - ).to.be.eq('Thu Sep 13 00:00:00 GMT 2018'); - expect( - ( - updatedLocRefVariable.variables.get( - 'MyDouble' - ) as ApexVariableContainer - ).value - ).to.be.eq('4.37559'); - expect( - ( - updatedLocRefVariable.variables.get( - 'MyInteger' - ) as ApexVariableContainer - ).value - ).to.be.eq('10'); - expect( - ( - updatedLocRefVariable.variables.get( - 'MyLong' - ) as ApexVariableContainer - ).value - ).to.be.eq('4271993'); - expect( - ( - updatedLocRefVariable.variables.get( - 'MyString' - ) as ApexVariableContainer - ).value - ).to.be.eq( + expect((updatedLocRefVariable.variables.get('MyBoolean') as ApexVariableContainer).value).to.be.eq('false'); + expect((updatedLocRefVariable.variables.get('MyDate') as ApexVariableContainer).value).to.be.eq( + 'Thu Sep 13 00:00:00 GMT 2018' + ); + expect((updatedLocRefVariable.variables.get('MyDouble') as ApexVariableContainer).value).to.be.eq('4.37559'); + expect((updatedLocRefVariable.variables.get('MyInteger') as ApexVariableContainer).value).to.be.eq('10'); + expect((updatedLocRefVariable.variables.get('MyLong') as ApexVariableContainer).value).to.be.eq('4271993'); + expect((updatedLocRefVariable.variables.get('MyString') as ApexVariableContainer).value).to.be.eq( "'This is a longer string that will certainly get truncated until we hit a checkpoint and inspect it_extra'" ); - const innerApexRefVar = updatedLocRefVariable.variables.get( - 'innerVariable' - ) as ApexVariableContainer; + const innerApexRefVar = updatedLocRefVariable.variables.get('innerVariable') as ApexVariableContainer; expect(innerApexRefVar.ref).to.be.eq('0x55260a7a'); expect(innerApexRefVar.variables.size).to.be.eq(7); - expect( - (innerApexRefVar.variables.get('MyBoolean') as ApexVariableContainer) - .value - ).to.be.eq('true'); - expect( - (innerApexRefVar.variables.get('MyDate') as ApexVariableContainer) - .value - ).to.be.eq('Thu Sep 13 00:00:00 GMT 2018'); - expect( - (innerApexRefVar.variables.get('MyDouble') as ApexVariableContainer) - .value - ).to.be.eq('3.14159'); - expect( - (innerApexRefVar.variables.get('MyInteger') as ApexVariableContainer) - .value - ).to.be.eq('5'); - expect( - (innerApexRefVar.variables.get('MyLong') as ApexVariableContainer) - .value - ).to.be.eq('4271990'); - expect( - (innerApexRefVar.variables.get('MyString') as ApexVariableContainer) - .value - ).to.be.eq("'9/13/2018'"); - expect( - ( - innerApexRefVar.variables.get( - 'innerVariable' - ) as ApexVariableContainer - ).value - ).to.be.eq('null'); + expect((innerApexRefVar.variables.get('MyBoolean') as ApexVariableContainer).value).to.be.eq('true'); + expect((innerApexRefVar.variables.get('MyDate') as ApexVariableContainer).value).to.be.eq( + 'Thu Sep 13 00:00:00 GMT 2018' + ); + expect((innerApexRefVar.variables.get('MyDouble') as ApexVariableContainer).value).to.be.eq('3.14159'); + expect((innerApexRefVar.variables.get('MyInteger') as ApexVariableContainer).value).to.be.eq('5'); + expect((innerApexRefVar.variables.get('MyLong') as ApexVariableContainer).value).to.be.eq('4271990'); + expect((innerApexRefVar.variables.get('MyString') as ApexVariableContainer).value).to.be.eq("'9/13/2018'"); + expect((innerApexRefVar.variables.get('innerVariable') as ApexVariableContainer).value).to.be.eq('null'); }); it('Should update a non-reference variable', () => { @@ -550,11 +408,7 @@ describe('Replay debugger adapter variable handling - unit', () => { getHeapDumpForThisLocationStub = sinon .stub(LogContext.prototype, 'getHeapDumpForThisLocation') .returns(heapdump); - const nonRefVariable = new ApexVariableContainer( - 'theInt', - '2', - 'Double' - ); + const nonRefVariable = new ApexVariableContainer('theInt', '2', 'Double'); const frameInfo = new ApexDebugStackFrameInfo(0, 'Foo'); const id = frameHandler.create(frameInfo); topFrame.id = id; @@ -564,9 +418,7 @@ describe('Replay debugger adapter variable handling - unit', () => { expect(createStringRefsFromHeapdumpSpy.calledOnce).to.be.true; expect(updateLeafReferenceContainerSpy.calledOnce).to.be.false; expect(createVariableFromReferenceSpy.calledOnce).to.be.false; - const updatedNonRefVariable = frameInfo.locals.get( - nonRefVariable.name - ) as ApexVariableContainer; + const updatedNonRefVariable = frameInfo.locals.get(nonRefVariable.name) as ApexVariableContainer; expect(updatedNonRefVariable.value).to.be.eq('5'); }); @@ -601,15 +453,8 @@ describe('Replay debugger adapter variable handling - unit', () => { getHeapDumpForThisLocationStub = sinon .stub(LogContext.prototype, 'getHeapDumpForThisLocation') .returns(heapdump); - const nonRefVariable = new ApexVariableContainer( - 'theInt', - '2', - 'Double' - ); - staticVariablesClassMap.set( - 'Foo', - new Map([['theInt', nonRefVariable]]) - ); + const nonRefVariable = new ApexVariableContainer('theInt', '2', 'Double'); + staticVariablesClassMap.set('Foo', new Map([['theInt', nonRefVariable]])); const frameInfo = new ApexDebugStackFrameInfo(0, 'Foo'); const id = frameHandler.create(frameInfo); topFrame.id = id; @@ -619,9 +464,7 @@ describe('Replay debugger adapter variable handling - unit', () => { expect(createStringRefsFromHeapdumpSpy.calledOnce).to.be.true; expect(updateLeafReferenceContainerSpy.calledOnce).to.be.false; expect(createVariableFromReferenceSpy.calledOnce).to.be.false; - const updatedNonRefVariable = frameInfo.statics.get( - nonRefVariable.name - ) as ApexVariableContainer; + const updatedNonRefVariable = frameInfo.statics.get(nonRefVariable.name) as ApexVariableContainer; expect(updatedNonRefVariable.value).to.be.eq('5'); }); @@ -631,12 +474,7 @@ describe('Replay debugger adapter variable handling - unit', () => { .stub(LogContext.prototype, 'getHeapDumpForThisLocation') .returns(heapdump); - const localRefVariable = new ApexVariableContainer( - 'cf1', - '', - 'CircularReference', - '0x717304ef' - ); + const localRefVariable = new ApexVariableContainer('cf1', '', 'CircularReference', '0x717304ef'); const frameInfo = new ApexDebugStackFrameInfo(0, 'Foo'); const id = frameHandler.create(frameInfo); topFrame.id = id; @@ -647,39 +485,22 @@ describe('Replay debugger adapter variable handling - unit', () => { // was set up correctly. The local variable cf1, of type CircularReference contains // a field that's a List. After creating cf1 we add cf1 to its own // list. - const expectedVariableValue = - 'CircularReference:{(already output), someInt=5}'; - const expectedListVarValue = - '(CircularReference:{already output, someInt=5})'; - - const updatedLocRefVariable = frameInfo.locals.get( - localRefVariable.name - ) as ApexVariableContainer; + const expectedVariableValue = 'CircularReference:{(already output), someInt=5}'; + const expectedListVarValue = '(CircularReference:{already output, someInt=5})'; + + const updatedLocRefVariable = frameInfo.locals.get(localRefVariable.name) as ApexVariableContainer; expect(updatedLocRefVariable.value).to.be.eq(expectedVariableValue); expect(updatedLocRefVariable.variables.size).to.be.eq(2); - expect( - ( - updatedLocRefVariable.variables.get( - 'someInt' - ) as ApexVariableContainer - ).value - ).to.be.eq('5'); - const listChildVar = updatedLocRefVariable.variables.get( - 'cfList' - ) as ApexVariableContainer; + expect((updatedLocRefVariable.variables.get('someInt') as ApexVariableContainer).value).to.be.eq('5'); + const listChildVar = updatedLocRefVariable.variables.get('cfList') as ApexVariableContainer; expect(listChildVar.value).to.be.eq(expectedListVarValue); expect(listChildVar.variables.size).to.be.eq(1); - const listElementVar = listChildVar.variables.get( - '0' - ) as ApexVariableContainer; + const listElementVar = listChildVar.variables.get('0') as ApexVariableContainer; expect(listElementVar.value).to.be.eq(expectedVariableValue); - expect( - (listElementVar.variables.get('cfList') as ApexVariableContainer) - .value - ).to.be.eq(expectedListVarValue); + expect((listElementVar.variables.get('cfList') as ApexVariableContainer).value).to.be.eq(expectedListVarValue); }); }); // Describe replaceVariablesWithHeapDump @@ -709,27 +530,15 @@ describe('Replay debugger adapter variable handling - unit', () => { adapter.setLogFile(launchRequestArgs); frameHandler = new Handles(); refsMap = new Map(); - staticVariablesClassMap = new Map< - string, - Map - >(); - getTopFrameStub = sinon - .stub(LogContext.prototype, 'getTopFrame') - .returns(topFrame); - getFrameHandlerStub = sinon - .stub(LogContext.prototype, 'getFrameHandler') - .returns(frameHandler); - getRefsMapStub = sinon - .stub(LogContext.prototype, 'getRefsMap') - .returns(refsMap); + staticVariablesClassMap = new Map>(); + getTopFrameStub = sinon.stub(LogContext.prototype, 'getTopFrame').returns(topFrame); + getFrameHandlerStub = sinon.stub(LogContext.prototype, 'getFrameHandler').returns(frameHandler); + getRefsMapStub = sinon.stub(LogContext.prototype, 'getRefsMap').returns(refsMap); getStaticVariablesClassMapStub = sinon .stub(LogContext.prototype, 'getStaticVariablesClassMap') .returns(staticVariablesClassMap); variableHandler = new Handles(); - isRunningApexTriggerStub = sinon.stub( - LogContext.prototype, - 'isRunningApexTrigger' - ); + isRunningApexTriggerStub = sinon.stub(LogContext.prototype, 'isRunningApexTrigger'); }); afterEach(() => { @@ -753,9 +562,7 @@ describe('Replay debugger adapter variable handling - unit', () => { .stub(LogContext.prototype, 'getHeapDumpForThisLocation') .returns(heapdump); - getVariableHandlerStub = sinon - .stub(LogContext.prototype, 'getVariableHandler') - .returns(variableHandler); + getVariableHandlerStub = sinon.stub(LogContext.prototype, 'getVariableHandler').returns(variableHandler); isRunningApexTriggerStub.returns(false); @@ -775,9 +582,7 @@ describe('Replay debugger adapter variable handling - unit', () => { .stub(LogContext.prototype, 'getHeapDumpForThisLocation') .returns(heapdump); - getVariableHandlerStub = sinon - .stub(LogContext.prototype, 'getVariableHandler') - .returns(variableHandler); + getVariableHandlerStub = sinon.stub(LogContext.prototype, 'getVariableHandler').returns(variableHandler); isRunningApexTriggerStub.returns(true); @@ -789,114 +594,60 @@ describe('Replay debugger adapter variable handling - unit', () => { heapDumpService.replaceVariablesWithHeapDump(); expect(frameInfo.globals.size).to.eq(8); - expect( - ( - frameInfo.globals.get( - EXTENT_TRIGGER_PREFIX + 'isbefore' - ) as ApexVariableContainer - ).value - ).to.eq('false'); - expect( - ( - frameInfo.globals.get( - EXTENT_TRIGGER_PREFIX + 'isdelete' - ) as ApexVariableContainer - ).value - ).to.eq('false'); - expect( - ( - frameInfo.globals.get( - EXTENT_TRIGGER_PREFIX + 'isundelete' - ) as ApexVariableContainer - ).value - ).to.eq('false'); - expect( - ( - frameInfo.globals.get( - EXTENT_TRIGGER_PREFIX + 'isupdate' - ) as ApexVariableContainer - ).value - ).to.eq('false'); - expect( - ( - frameInfo.globals.get( - EXTENT_TRIGGER_PREFIX + 'isafter' - ) as ApexVariableContainer - ).value - ).to.eq('true'); - expect( - ( - frameInfo.globals.get( - EXTENT_TRIGGER_PREFIX + 'isinsert' - ) as ApexVariableContainer - ).value - ).to.eq('true'); - - const triggerNew = frameInfo.globals.get( - EXTENT_TRIGGER_PREFIX + 'new' - ) as ApexVariableContainer; + expect((frameInfo.globals.get(EXTENT_TRIGGER_PREFIX + 'isbefore') as ApexVariableContainer).value).to.eq( + 'false' + ); + expect((frameInfo.globals.get(EXTENT_TRIGGER_PREFIX + 'isdelete') as ApexVariableContainer).value).to.eq( + 'false' + ); + expect((frameInfo.globals.get(EXTENT_TRIGGER_PREFIX + 'isundelete') as ApexVariableContainer).value).to.eq( + 'false' + ); + expect((frameInfo.globals.get(EXTENT_TRIGGER_PREFIX + 'isupdate') as ApexVariableContainer).value).to.eq( + 'false' + ); + expect((frameInfo.globals.get(EXTENT_TRIGGER_PREFIX + 'isafter') as ApexVariableContainer).value).to.eq('true'); + expect((frameInfo.globals.get(EXTENT_TRIGGER_PREFIX + 'isinsert') as ApexVariableContainer).value).to.eq( + 'true' + ); + + const triggerNew = frameInfo.globals.get(EXTENT_TRIGGER_PREFIX + 'new') as ApexVariableContainer; expect(triggerNew.type).to.be.eq('List'); expect(triggerNew.variablesRef).to.be.greaterThan(0); expect(triggerNew.variables.size).to.be.eq(3); - expect( - (triggerNew.variables.get('0') as ApexVariableContainer).ref - ).to.eq('0x5f163c72'); - expect( - (triggerNew.variables.get('1') as ApexVariableContainer).ref - ).to.eq('0xf1fabe'); - expect( - (triggerNew.variables.get('2') as ApexVariableContainer).ref - ).to.eq('0x76e9852b'); - - const triggerNewmap = frameInfo.globals.get( - EXTENT_TRIGGER_PREFIX + 'newmap' - ) as ApexVariableContainer; + expect((triggerNew.variables.get('0') as ApexVariableContainer).ref).to.eq('0x5f163c72'); + expect((triggerNew.variables.get('1') as ApexVariableContainer).ref).to.eq('0xf1fabe'); + expect((triggerNew.variables.get('2') as ApexVariableContainer).ref).to.eq('0x76e9852b'); + + const triggerNewmap = frameInfo.globals.get(EXTENT_TRIGGER_PREFIX + 'newmap') as ApexVariableContainer; expect(triggerNewmap.type).to.be.eq('Map'); expect(triggerNewmap.variablesRef).to.be.greaterThan(0); expect(triggerNewmap.variables.size).to.be.eq(3); - let tempKeyValPairApexVar = triggerNewmap.variables.get( - 'key0_value0' - ) as ApexVariableContainer; + let tempKeyValPairApexVar = triggerNewmap.variables.get('key0_value0') as ApexVariableContainer; expect(tempKeyValPairApexVar.name).to.be.eq("'001xx000003Dv3YAAS'"); - let keyApexVar = tempKeyValPairApexVar.variables.get( - 'key' - ) as ApexVariableContainer; + let keyApexVar = tempKeyValPairApexVar.variables.get('key') as ApexVariableContainer; expect(keyApexVar.type).to.eq('Id'); expect(keyApexVar.value).to.eq(tempKeyValPairApexVar.name); - let valueApexVar = tempKeyValPairApexVar.variables.get( - 'value' - ) as ApexVariableContainer; + let valueApexVar = tempKeyValPairApexVar.variables.get('value') as ApexVariableContainer; expect(valueApexVar.type).to.be.eq('Account'); expect(valueApexVar.ref).to.be.eq('0x5f163c72'); - tempKeyValPairApexVar = triggerNewmap.variables.get( - 'key1_value1' - ) as ApexVariableContainer; + tempKeyValPairApexVar = triggerNewmap.variables.get('key1_value1') as ApexVariableContainer; expect(tempKeyValPairApexVar.name).to.be.eq("'001xx000003Dv3ZAAS'"); - keyApexVar = tempKeyValPairApexVar.variables.get( - 'key' - ) as ApexVariableContainer; + keyApexVar = tempKeyValPairApexVar.variables.get('key') as ApexVariableContainer; expect(keyApexVar.type).to.eq('Id'); expect(keyApexVar.value).to.eq(tempKeyValPairApexVar.name); - valueApexVar = tempKeyValPairApexVar.variables.get( - 'value' - ) as ApexVariableContainer; + valueApexVar = tempKeyValPairApexVar.variables.get('value') as ApexVariableContainer; expect(valueApexVar.type).to.be.eq('Account'); expect(valueApexVar.ref).to.be.eq('0xf1fabe'); - tempKeyValPairApexVar = triggerNewmap.variables.get( - 'key2_value2' - ) as ApexVariableContainer; + tempKeyValPairApexVar = triggerNewmap.variables.get('key2_value2') as ApexVariableContainer; expect(tempKeyValPairApexVar.name).to.be.eq("'001xx000003Dv3aAAC'"); - keyApexVar = tempKeyValPairApexVar.variables.get( - 'key' - ) as ApexVariableContainer; + keyApexVar = tempKeyValPairApexVar.variables.get('key') as ApexVariableContainer; expect(keyApexVar.type).to.eq('Id'); expect(keyApexVar.value).to.eq(tempKeyValPairApexVar.name); - valueApexVar = tempKeyValPairApexVar.variables.get( - 'value' - ) as ApexVariableContainer; + valueApexVar = tempKeyValPairApexVar.variables.get('value') as ApexVariableContainer; expect(valueApexVar.type).to.be.eq('Account'); expect(valueApexVar.ref).to.be.eq('0x76e9852b'); }); diff --git a/packages/salesforcedx-apex-replay-debugger/test/unit/adapter/debugConsole.test.ts b/packages/salesforcedx-apex-replay-debugger/test/unit/adapter/debugConsole.test.ts index 8bc9eca0b8..a44e65baa0 100644 --- a/packages/salesforcedx-apex-replay-debugger/test/unit/adapter/debugConsole.test.ts +++ b/packages/salesforcedx-apex-replay-debugger/test/unit/adapter/debugConsole.test.ts @@ -9,10 +9,7 @@ import { Source } from '@vscode/debugadapter'; import { DebugProtocol } from '@vscode/debugprotocol'; import { expect } from 'chai'; import * as sinon from 'sinon'; -import { - ApexReplayDebug, - LaunchRequestArguments -} from '../../../src/adapter/apexReplayDebug'; +import { ApexReplayDebug, LaunchRequestArguments } from '../../../src/adapter/apexReplayDebug'; import { MockApexReplayDebug } from './apexReplayDebug.test'; // tslint:disable:no-unused-expression @@ -61,11 +58,7 @@ describe('Debug console', () => { adapter.setupLogger(args); - expect(adapter.getTraceConfig()).to.be.eql([ - 'all', - 'launch', - 'breakpoints' - ]); + expect(adapter.getTraceConfig()).to.be.eql(['all', 'launch', 'breakpoints']); expect(adapter.getTraceAllConfig()).to.be.true; }); @@ -97,15 +90,11 @@ describe('Debug console', () => { }); it('Should send Output event', () => { - const source = new Source( - logFileName, - encodeURI(`file://${logFilePath}`) - ); + const source = new Source(logFileName, encodeURI(`file://${logFilePath}`)); adapter.printToDebugConsole('test', source, 5, 'stdout'); expect(sendEventSpy.calledOnce).to.be.true; - const outputEvent: DebugProtocol.OutputEvent = - sendEventSpy.getCall(0).args[0]; + const outputEvent: DebugProtocol.OutputEvent = sendEventSpy.getCall(0).args[0]; expect(outputEvent.body.output).to.have.string('test'); expect(outputEvent.body.category).to.equal('stdout'); expect(outputEvent.body.line).to.equal(5); @@ -134,8 +123,7 @@ describe('Debug console', () => { adapter.warnToDebugConsole('test'); expect(sendEventSpy.calledOnce).to.be.true; - const outputEvent: DebugProtocol.OutputEvent = - sendEventSpy.getCall(0).args[0]; + const outputEvent: DebugProtocol.OutputEvent = sendEventSpy.getCall(0).args[0]; expect(outputEvent.body.output).to.have.string('test'); expect(outputEvent.body.category).to.equal('console'); }); @@ -161,8 +149,7 @@ describe('Debug console', () => { adapter.errorToDebugConsole('test'); expect(sendEventSpy.calledOnce).to.be.true; - const outputEvent: DebugProtocol.OutputEvent = - sendEventSpy.getCall(0).args[0]; + const outputEvent: DebugProtocol.OutputEvent = sendEventSpy.getCall(0).args[0]; expect(outputEvent.body.output).to.have.string('test'); expect(outputEvent.body.category).to.equal('stderr'); }); diff --git a/packages/salesforcedx-apex-replay-debugger/test/unit/adapter/heapDumpTestUtil.ts b/packages/salesforcedx-apex-replay-debugger/test/unit/adapter/heapDumpTestUtil.ts index e3d81ae473..235f49f2d2 100644 --- a/packages/salesforcedx-apex-replay-debugger/test/unit/adapter/heapDumpTestUtil.ts +++ b/packages/salesforcedx-apex-replay-debugger/test/unit/adapter/heapDumpTestUtil.ts @@ -329,12 +329,7 @@ export const createHeapDumpResultForTriggers = (): ApexHeapDump => { { address: '0x10954bcf', size: 5, - symbols: [ - 'Trigger.isbefore', - 'Trigger.isdelete', - 'Trigger.isundelete', - 'Trigger.isupdate' - ], + symbols: ['Trigger.isbefore', 'Trigger.isdelete', 'Trigger.isundelete', 'Trigger.isupdate'], value: { value: false } diff --git a/packages/salesforcedx-apex-replay-debugger/test/unit/breakpoints/breakpointUtil.test.ts b/packages/salesforcedx-apex-replay-debugger/test/unit/breakpoints/breakpointUtil.test.ts index f5c8f76075..b76792fbbd 100644 --- a/packages/salesforcedx-apex-replay-debugger/test/unit/breakpoints/breakpointUtil.test.ts +++ b/packages/salesforcedx-apex-replay-debugger/test/unit/breakpoints/breakpointUtil.test.ts @@ -52,34 +52,13 @@ describe('Breakpoint utilities', () => { // It should be noted that the order of insertion is intentionally being mixed up to ensure // that insertion order doesn't play any part in what is returned. typerefMapping.set('YourClassName', 'file:///ClassWithNoNamespace.cls'); - typerefMapping.set( - 'YourClassName$InnerClass', - 'file:///ClassWithNoNamespace.cls' - ); - typerefMapping.set( - 'YourClassName$InnerClass$InnerInnerClass', - 'file:///ClassWithNoNamespace.cls' - ); - typerefMapping.set( - 'YourNamespace/YourClassName$InnerClass$InnerInnerClass', - 'file:///ClassWithNamespace.cls' - ); - typerefMapping.set( - 'YourNamespace/YourClassName', - 'file:///ClassWithNamespace.cls' - ); - typerefMapping.set( - 'YourNamespace/YourClassName$InnerClass', - 'file:///ClassWithNamespace.cls' - ); - typerefMapping.set( - '__sfdc_trigger/YourTriggerName$TriggerInnerClass', - 'file:///triggerNoNamespace.trigger' - ); - typerefMapping.set( - '__sfdc_trigger/YourTriggerName', - 'file:///triggerNoNamespace.trigger' - ); + typerefMapping.set('YourClassName$InnerClass', 'file:///ClassWithNoNamespace.cls'); + typerefMapping.set('YourClassName$InnerClass$InnerInnerClass', 'file:///ClassWithNoNamespace.cls'); + typerefMapping.set('YourNamespace/YourClassName$InnerClass$InnerInnerClass', 'file:///ClassWithNamespace.cls'); + typerefMapping.set('YourNamespace/YourClassName', 'file:///ClassWithNamespace.cls'); + typerefMapping.set('YourNamespace/YourClassName$InnerClass', 'file:///ClassWithNamespace.cls'); + typerefMapping.set('__sfdc_trigger/YourTriggerName$TriggerInnerClass', 'file:///triggerNoNamespace.trigger'); + typerefMapping.set('__sfdc_trigger/YourTriggerName', 'file:///triggerNoNamespace.trigger'); typerefMapping.set( '__sfdc_trigger/YourTriggerName$TriggerInnerClass$TriggerInnerInnerClass', 'file:///triggerNoNamespace.trigger' @@ -92,25 +71,18 @@ describe('Breakpoint utilities', () => { '__sfdc_trigger/Namespace/YourTriggerName/$InnerTriggerClass$TriggerInnerInnerClass', 'file:///triggerWithNamespace.trigger' ); - typerefMapping.set( - '__sfdc_trigger/Namespace/YourTriggerName', - 'file:///triggerWithNamespace.trigger' - ); + typerefMapping.set('__sfdc_trigger/Namespace/YourTriggerName', 'file:///triggerWithNamespace.trigger'); util = new BreakpointUtil(); util.setValidLines(lineNumberMapping, typerefMapping); - expect( - util.getTopLevelTyperefForUri('file:///ClassWithNoNamespace.cls') - ).to.be.equal('YourClassName'); - expect( - util.getTopLevelTyperefForUri('file:///ClassWithNamespace.cls') - ).to.be.equal('YourNamespace/YourClassName'); - expect( - util.getTopLevelTyperefForUri('file:///triggerNoNamespace.trigger') - ).to.be.equal('__sfdc_trigger/YourTriggerName'); - expect( - util.getTopLevelTyperefForUri('file:///triggerWithNamespace.trigger') - ).to.be.equal('__sfdc_trigger/Namespace/YourTriggerName'); + expect(util.getTopLevelTyperefForUri('file:///ClassWithNoNamespace.cls')).to.be.equal('YourClassName'); + expect(util.getTopLevelTyperefForUri('file:///ClassWithNamespace.cls')).to.be.equal('YourNamespace/YourClassName'); + expect(util.getTopLevelTyperefForUri('file:///triggerNoNamespace.trigger')).to.be.equal( + '__sfdc_trigger/YourTriggerName' + ); + expect(util.getTopLevelTyperefForUri('file:///triggerWithNamespace.trigger')).to.be.equal( + '__sfdc_trigger/Namespace/YourTriggerName' + ); }); }); diff --git a/packages/salesforcedx-apex-replay-debugger/test/unit/commands/apexExecutionOverlayResultCommand.test.ts b/packages/salesforcedx-apex-replay-debugger/test/unit/commands/apexExecutionOverlayResultCommand.test.ts index a016fac2d0..f5deb46aaa 100644 --- a/packages/salesforcedx-apex-replay-debugger/test/unit/commands/apexExecutionOverlayResultCommand.test.ts +++ b/packages/salesforcedx-apex-replay-debugger/test/unit/commands/apexExecutionOverlayResultCommand.test.ts @@ -52,8 +52,7 @@ describe('ApexExecutionOverlayResult basic heapdump response parsing, no actionS '{"attributes":{"type":"ApexExecutionOverlayResult","url":"/services/data/v43.0/tooling/sobjects/ApexExecutionOverlayResult/07nxx00000000BOAAY"},"Id":"07nxx00000000BOAAY","IsDeleted":false,"CreatedDate":"2018-06-14T20:41:35.000+0000","CreatedById":"005xx000001UtEwAAK","LastModifiedDate":"2018-06-14T20:41:35.000+0000","LastModifiedById":"005xx000001UtEwAAK","SystemModstamp":"2018-06-14T20:41:35.000+0000","UserId":"005xx000001UtEwAAK","RequestedById":"005xx000001UtEwAAK","OverlayResultLength":3499,"HeapDump":{"className":"TriggerTest","extents":[{"collectionType":null,"count":7,"definition":[],"extent":[{"address":"0x484889c1","size":16,"symbols":null,"value":{"entry":[{"keyDisplayValue":"Name","value":{"value":"okToDelete4"}},{"keyDisplayValue":"AccountNumber","value":{"value":"xxx"}},{"keyDisplayValue":"Id","value":{"value":"001xx000003Dt1SAAS"}}]}},{"address":"0x2af6c0c3","size":16,"symbols":null,"value":{"entry":[{"keyDisplayValue":"Name","value":{"value":"okToDelete0"}},{"keyDisplayValue":"AccountNumber","value":{"value":"xxx"}},{"keyDisplayValue":"Id","value":{"value":"001xx000003Dt1OAAS"}}]}},{"address":"0x41a7990b","size":16,"symbols":["a"],"value":{"entry":[{"keyDisplayValue":"Name","value":{"value":"okToDelete5"}},{"keyDisplayValue":"AccountNumber","value":{"value":"xxx"}},{"keyDisplayValue":"Id","value":{"value":"001xx000003Dt1TAAS"}}]}},{"address":"0x419440c","size":16,"symbols":null,"value":{"entry":[{"keyDisplayValue":"Name","value":{"value":"okToDelete3"}},{"keyDisplayValue":"AccountNumber","value":{"value":"xxx"}},{"keyDisplayValue":"Id","value":{"value":"001xx000003Dt1RAAS"}}]}},{"address":"0x29f53bd2","size":16,"symbols":null,"value":{"entry":[{"keyDisplayValue":"Name","value":{"value":"okToDelete1"}},{"keyDisplayValue":"AccountNumber","value":{"value":"xxx"}},{"keyDisplayValue":"Id","value":{"value":"001xx000003Dt1PAAS"}}]}},{"address":"0x4fe40625","size":16,"symbols":null,"value":{"entry":[{"keyDisplayValue":"Name","value":{"value":"okToDelete2"}},{"keyDisplayValue":"AccountNumber","value":{"value":"xxx"}},{"keyDisplayValue":"Id","value":{"value":"001xx000003Dt1QAAS"}}]}},{"address":"0x759f8f2c","size":16,"symbols":["foo"],"value":{"entry":[{"keyDisplayValue":"Name","value":{"value":"okToDelete2"}},{"keyDisplayValue":"AccountNumber","value":{"value":"yyy"}},{"keyDisplayValue":"Id","value":{"value":"001xx000003Dt1QAAS"}}]}}],"totalSize":112,"typeName":"Account"},{"collectionType":"Account","count":2,"definition":[],"extent":[{"address":"0x67581704","size":16,"symbols":["accts2"],"value":{"value":[{"value":"0x419440c"},{"value":"0x484889c1"},{"value":"0x41a7990b"}]}},{"address":"0x7ee19456","size":16,"symbols":["accts"],"value":{"value":[{"value":"0x2af6c0c3"},{"value":"0x29f53bd2"},{"value":"0x4fe40625"}]}}],"totalSize":32,"typeName":"List"},{"collectionType":null,"count":1,"definition":[{"name":"value","type":"Double"}],"extent":[{"address":"0x31324ba9","size":8,"symbols":["i"],"value":{"value":6.0}}],"totalSize":8,"typeName":"Integer"},{"collectionType":null,"count":23,"definition":[{"name":"stringValue","type":"char[]"}],"extent":[{"address":"0x2997a582","size":2,"symbols":null,"value":{"value":"Id"}},{"address":"0x6fabc54c","size":13,"symbols":null,"value":{"value":"AccountNumber"}},{"address":"0x157c88cd","size":18,"symbols":null,"value":{"value":"001xx000003Dt1QAAS"}},{"address":"0x661513cf","size":4,"symbols":null,"value":{"value":"Name"}},{"address":"0x25089450","size":11,"symbols":null,"value":{"value":"okToDelete2"}},{"address":"0x4a133a13","size":2,"symbols":null,"value":{"value":"Id"}},{"address":"0x41fdd694","size":4,"symbols":null,"value":{"value":"Name"}},{"address":"0x72c1ffd5","size":11,"symbols":null,"value":{"value":"okToDelete2"}},{"address":"0x5edb0cd2","size":11,"symbols":null,"value":{"value":"okToDelete1"}},{"address":"0x5551729c","size":18,"symbols":null,"value":{"value":"001xx000003Dt1SAAS"}},{"address":"0x29cc091e","size":3,"symbols":null,"value":{"value":"foo"}},{"address":"0x48439a20","size":3,"symbols":null,"value":{"value":"yyy"}},{"address":"0x3a99f3a0","size":11,"symbols":null,"value":{"value":"okToDelete3"}},{"address":"0x73dadd26","size":13,"symbols":null,"value":{"value":"AccountNumber"}},{"address":"0x407d1be9","size":11,"symbols":null,"value":{"value":"okToDelete4"}},{"address":"0x29883d6c","size":18,"symbols":null,"value":{"value":"001xx000003Dt1QAAS"}},{"address":"0x5843f270","size":11,"symbols":null,"value":{"value":"okToDelete5"}},{"address":"0x71c78df0","size":11,"symbols":null,"value":{"value":"okToDelete0"}},{"address":"0x777c58b2","size":18,"symbols":null,"value":{"value":"001xx000003Dt1PAAS"}},{"address":"0x44623a37","size":3,"symbols":null,"value":{"value":"xxx"}},{"address":"0x194cbdf9","size":18,"symbols":null,"value":{"value":"001xx000003Dt1OAAS"}},{"address":"0x258191fa","size":18,"symbols":null,"value":{"value":"001xx000003Dt1TAAS"}},{"address":"0x46c6227f","size":18,"symbols":null,"value":{"value":"001xx000003Dt1RAAS"}}],"totalSize":250,"typeName":"String"}],"heapDumpDate":"2018-06-14T20:41:34.377+0000","namespace":"none"},"ApexResult":null,"SOQLResult":null,"Line":23,"Iteration":1,"ExpirationDate":"2018-06-14T21:05:57.000+0000","IsDumpingHeap":true,"ActionScript":null,"ActionScriptType":"None","ClassName":"TriggerTest","Namespace":"none"}'; // Reseponse failures are going to be a message and an errorCode string - const responseFailure = - '[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]'; + const responseFailure = '[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]'; const responseFailureMessage = 'Session expired or invalid'; const responseFailureErrorCode = 'INVALID_SESSION_ID'; @@ -68,14 +67,12 @@ describe('ApexExecutionOverlayResult basic heapdump response parsing, no actionS it('ApexExecutionOverlayResultCommand GET REST call with parse-able heapdump success result', async () => { overlayResultCommand = new ApexExecutionOverlayResultCommand(heapdumpKey); - sendRequestSpy = sinon - .stub(RequestService.prototype, 'sendRequest') - .returns( - Promise.resolve({ - status: 200, - responseText: responseSuccess - } as XHRResponse) - ); + sendRequestSpy = sinon.stub(RequestService.prototype, 'sendRequest').returns( + Promise.resolve({ + status: 200, + responseText: responseSuccess + } as XHRResponse) + ); // The expected options needs to contain the request body, url and RestHttpMethodEnum.Get // The query string needs to be pulled from the overlayResultCommand since it contains the @@ -86,17 +83,12 @@ describe('ApexExecutionOverlayResult basic heapdump response parsing, no actionS RestHttpMethodEnum.Get ); - const returnString = await requestService.execute( - overlayResultCommand, - RestHttpMethodEnum.Get - ); + const returnString = await requestService.execute(overlayResultCommand, RestHttpMethodEnum.Get); expect(sendRequestSpy.calledOnce).to.equal(true); expect(sendRequestSpy.getCall(0).args[0]).to.deep.equal(expectedOptions); - const response = JSON.parse( - returnString - ) as ApexExecutionOverlayResultCommandSuccess; + const response = JSON.parse(returnString) as ApexExecutionOverlayResultCommandSuccess; // Verify the basic information has been parsed. expect(response.ActionScript).to.equal(null); @@ -126,9 +118,7 @@ describe('ApexExecutionOverlayResult basic heapdump response parsing, no actionS // Verity the response.heapdump top level information expect(response.HeapDump.className).to.equal('TriggerTest'); - expect(response.HeapDump.heapDumpDate).to.equal( - '2018-06-14T20:41:34.377+0000' - ); + expect(response.HeapDump.heapDumpDate).to.equal('2018-06-14T20:41:34.377+0000'); expect(response.HeapDump.namespace).to.equal('none'); // There should be 4 extents @@ -149,20 +139,14 @@ describe('ApexExecutionOverlayResult basic heapdump response parsing, no actionS // Verify the Name keyDisplayValue and that the value starts with okToDelete expect(extent[i].value.entry![0].keyDisplayValue).to.equal('Name'); - expect( - extent[i].value.entry![0].value.value.startsWith('okToDelete') - ).to.equal(true); + expect(extent[i].value.entry![0].value.value.startsWith('okToDelete')).to.equal(true); // Verity the AccountNumber keyDisplayValue - expect(extent[i].value.entry![1].keyDisplayValue).to.equal( - 'AccountNumber' - ); + expect(extent[i].value.entry![1].keyDisplayValue).to.equal('AccountNumber'); // Verify the Id keyDisplayValue and the value starts with 001xx000003Dt1 expect(extent[i].value.entry![2].keyDisplayValue).to.equal('Id'); - expect( - extent[i].value.entry![2].value.value.startsWith('001xx000003Dt1') - ).to.equal(true); + expect(extent[i].value.entry![2].value.value.startsWith('001xx000003Dt1')).to.equal(true); // Symbols are only there for 2 local variables, 'a' and 'foo', verify we got them if (extent[i].symbols) { @@ -228,14 +212,12 @@ describe('ApexExecutionOverlayResult basic heapdump response parsing, no actionS it('ApexExecutionOverlayResultCommand GET REST call with parse-able heapdump failure result', async () => { overlayResultCommand = new ApexExecutionOverlayResultCommand(heapdumpKey); - sendRequestSpy = sinon - .stub(RequestService.prototype, 'sendRequest') - .returns( - Promise.resolve({ - status: 200, - responseText: responseFailure - } as XHRResponse) - ); + sendRequestSpy = sinon.stub(RequestService.prototype, 'sendRequest').returns( + Promise.resolve({ + status: 200, + responseText: responseFailure + } as XHRResponse) + ); const expectedOptions: XHROptions = createExpectedXHROptions( undefined, @@ -243,17 +225,12 @@ describe('ApexExecutionOverlayResult basic heapdump response parsing, no actionS RestHttpMethodEnum.Get ); - const returnString = await requestService.execute( - overlayResultCommand, - RestHttpMethodEnum.Get - ); + const returnString = await requestService.execute(overlayResultCommand, RestHttpMethodEnum.Get); expect(sendRequestSpy.calledOnce).to.equal(true); expect(sendRequestSpy.getCall(0).args[0]).to.deep.equal(expectedOptions); - const response = JSON.parse( - returnString - ) as ApexExecutionOverlayResultCommandFailure[]; + const response = JSON.parse(returnString) as ApexExecutionOverlayResultCommandFailure[]; expect(response.length).to.equal(1); expect(response[0].message).to.equal(responseFailureMessage); @@ -272,13 +249,11 @@ describe('ApexExecutionOverlayResult heapdump parsing with ActionScript SOQL res const responseSuccessSOQL = '{"attributes":{"type":"ApexExecutionOverlayResult","url":"/services/data/v43.0/tooling/sobjects/ApexExecutionOverlayResult/07nxx00000000CHAAY"},"Id":"07nxx00000000CHAAY","IsDeleted":false,"CreatedDate":"2018-06-18T16:00:44.000+0000","CreatedById":"005xx000001UtEwAAK","LastModifiedDate":"2018-06-18T16:00:44.000+0000","LastModifiedById":"005xx000001UtEwAAK","SystemModstamp":"2018-06-18T16:00:44.000+0000","UserId":"005xx000001UtEwAAK","RequestedById":"005xx000001UtEwAAK","OverlayResultLength":5854,"HeapDump":{"className":"TriggerTest","extents":[{"collectionType":null,"count":7,"definition":[],"extent":[{"address":"0x1eb9a287","size":16,"symbols":["a"],"value":{"entry":[{"keyDisplayValue":"Name","value":{"value":"okToDelete5"}},{"keyDisplayValue":"AccountNumber","value":{"value":"xxx"}},{"keyDisplayValue":"Id","value":{"value":"001xx000003Dt2RAAS"}}]}},{"address":"0x4d58024c","size":16,"symbols":null,"value":{"entry":[{"keyDisplayValue":"Name","value":{"value":"okToDelete1"}},{"keyDisplayValue":"AccountNumber","value":{"value":"xxx"}},{"keyDisplayValue":"Id","value":{"value":"001xx000003Dt2NAAS"}}]}},{"address":"0x277111ce","size":16,"symbols":null,"value":{"entry":[{"keyDisplayValue":"Name","value":{"value":"okToDelete0"}},{"keyDisplayValue":"AccountNumber","value":{"value":"xxx"}},{"keyDisplayValue":"Id","value":{"value":"001xx000003Dt2MAAS"}}]}},{"address":"0x6e9e59d6","size":16,"symbols":null,"value":{"entry":[{"keyDisplayValue":"Name","value":{"value":"okToDelete3"}},{"keyDisplayValue":"AccountNumber","value":{"value":"xxx"}},{"keyDisplayValue":"Id","value":{"value":"001xx000003Dt2PAAS"}}]}},{"address":"0x83ee3a9","size":16,"symbols":["foo"],"value":{"entry":[{"keyDisplayValue":"Name","value":{"value":"okToDelete2"}},{"keyDisplayValue":"AccountNumber","value":{"value":"yyy"}},{"keyDisplayValue":"Id","value":{"value":"001xx000003Dt2OAAS"}}]}},{"address":"0x789d46b4","size":16,"symbols":null,"value":{"entry":[{"keyDisplayValue":"Name","value":{"value":"okToDelete2"}},{"keyDisplayValue":"AccountNumber","value":{"value":"xxx"}},{"keyDisplayValue":"Id","value":{"value":"001xx000003Dt2OAAS"}}]}},{"address":"0x61e536b9","size":16,"symbols":null,"value":{"entry":[{"keyDisplayValue":"Name","value":{"value":"okToDelete4"}},{"keyDisplayValue":"AccountNumber","value":{"value":"xxx"}},{"keyDisplayValue":"Id","value":{"value":"001xx000003Dt2QAAS"}}]}}],"totalSize":112,"typeName":"Account"},{"collectionType":"Account","count":2,"definition":[],"extent":[{"address":"0x494570be","size":16,"symbols":["accts"],"value":{"value":[{"value":"0x277111ce"},{"value":"0x4d58024c"},{"value":"0x789d46b4"}]}},{"address":"0x6274a4ae","size":16,"symbols":["accts2"],"value":{"value":[{"value":"0x6e9e59d6"},{"value":"0x61e536b9"},{"value":"0x1eb9a287"}]}}],"totalSize":32,"typeName":"List"},{"collectionType":null,"count":1,"definition":[{"name":"value","type":"Double"}],"extent":[{"address":"0x4437681f","size":8,"symbols":["i"],"value":{"value":6.0}}],"totalSize":8,"typeName":"Integer"},{"collectionType":null,"count":23,"definition":[{"name":"stringValue","type":"char[]"}],"extent":[{"address":"0x432f75fe","size":3,"symbols":null,"value":{"value":"foo"}},{"address":"0x79e58884","size":11,"symbols":null,"value":{"value":"okToDelete4"}},{"address":"0x3fb38fc5","size":11,"symbols":null,"value":{"value":"okToDelete3"}},{"address":"0x151e3c89","size":2,"symbols":null,"value":{"value":"Id"}},{"address":"0x7acb3e8c","size":18,"symbols":null,"value":{"value":"001xx000003Dt2QAAS"}},{"address":"0x23e5508e","size":4,"symbols":null,"value":{"value":"Name"}},{"address":"0x6bd5451","size":2,"symbols":null,"value":{"value":"Id"}},{"address":"0x6da087d2","size":3,"symbols":null,"value":{"value":"xxx"}},{"address":"0x1ea6f551","size":18,"symbols":null,"value":{"value":"001xx000003Dt2OAAS"}},{"address":"0x1b59239a","size":18,"symbols":null,"value":{"value":"001xx000003Dt2OAAS"}},{"address":"0x4152e51f","size":11,"symbols":null,"value":{"value":"okToDelete2"}},{"address":"0x2a2bbd60","size":11,"symbols":null,"value":{"value":"okToDelete2"}},{"address":"0x7fc464e0","size":11,"symbols":null,"value":{"value":"okToDelete0"}},{"address":"0x630c1420","size":18,"symbols":null,"value":{"value":"001xx000003Dt2NAAS"}},{"address":"0x10910624","size":11,"symbols":null,"value":{"value":"okToDelete1"}},{"address":"0x1a9d3e68","size":18,"symbols":null,"value":{"value":"001xx000003Dt2RAAS"}},{"address":"0x4c3140ec","size":11,"symbols":null,"value":{"value":"okToDelete5"}},{"address":"0x56e11a34","size":18,"symbols":null,"value":{"value":"001xx000003Dt2MAAS"}},{"address":"0x568c2039","size":13,"symbols":null,"value":{"value":"AccountNumber"}},{"address":"0x7468263c","size":4,"symbols":null,"value":{"value":"Name"}},{"address":"0x61dd12bd","size":18,"symbols":null,"value":{"value":"001xx000003Dt2PAAS"}},{"address":"0x699195be","size":3,"symbols":null,"value":{"value":"yyy"}},{"address":"0x4ffda43f","size":13,"symbols":null,"value":{"value":"AccountNumber"}}],"totalSize":250,"typeName":"String"}],"heapDumpDate":"2018-06-18T16:00:44.577+0000","namespace":"none"},"ApexResult":null,"SOQLResult":{"queryError":null,"queryMetadata":{"columnMetadata":[{"aggregate":false,"apexType":"Id","booleanType":false,"columnName":"Id","custom":false,"displayName":"Id","foreignKeyName":null,"insertable":false,"joinColumns":[],"numberType":false,"textType":false,"updatable":false},{"aggregate":false,"apexType":"String","booleanType":false,"columnName":"Name","custom":false,"displayName":"Name","foreignKeyName":null,"insertable":true,"joinColumns":[],"numberType":false,"textType":true,"updatable":true},{"aggregate":false,"apexType":"String","booleanType":false,"columnName":"AccountNumber","custom":false,"displayName":"AccountNumber","foreignKeyName":null,"insertable":true,"joinColumns":[],"numberType":false,"textType":true,"updatable":true}],"entityName":"Account","groupBy":false,"idSelected":true,"keyPrefix":"001"},"queryResult":[{"attributes":{"type":"Account","url":"/services/data/v43.0/tooling/sobjects/Account/001xx000003Dt2MAAS"},"Id":"001xx000003Dt2MAAS","Name":"okToDelete0","AccountNumber":"yyy"},{"attributes":{"type":"Account","url":"/services/data/v43.0/tooling/sobjects/Account/001xx000003Dt2NAAS"},"Id":"001xx000003Dt2NAAS","Name":"okToDelete1","AccountNumber":"yyy"},{"attributes":{"type":"Account","url":"/services/data/v43.0/tooling/sobjects/Account/001xx000003Dt2OAAS"},"Id":"001xx000003Dt2OAAS","Name":"okToDelete2","AccountNumber":"yyy"},{"attributes":{"type":"Account","url":"/services/data/v43.0/tooling/sobjects/Account/001xx000003Dt2PAAS"},"Id":"001xx000003Dt2PAAS","Name":"okToDelete3","AccountNumber":"yyy"},{"attributes":{"type":"Account","url":"/services/data/v43.0/tooling/sobjects/Account/001xx000003Dt2QAAS"},"Id":"001xx000003Dt2QAAS","Name":"okToDelete4","AccountNumber":"yyy"},{"attributes":{"type":"Account","url":"/services/data/v43.0/tooling/sobjects/Account/001xx000003Dt2RAAS"},"Id":"001xx000003Dt2RAAS","Name":"okToDelete5","AccountNumber":"yyy"}]},"Line":23,"Iteration":1,"ExpirationDate":"2018-06-18T16:30:13.000+0000","IsDumpingHeap":true,"ActionScript":"SELECT Id, Name, AccountNumber FROM Account WHERE Name like \'okToDelete%\'","ActionScriptType":"SOQL","ClassName":"TriggerTest","Namespace":"none"}'; - const expectedActionScript = - "SELECT Id, Name, AccountNumber FROM Account WHERE Name like 'okToDelete%'"; + const expectedActionScript = "SELECT Id, Name, AccountNumber FROM Account WHERE Name like 'okToDelete%'"; const reseponseErrorSOQL = '{"attributes":{"type":"ApexExecutionOverlayResult","url":"/services/data/v44.0/tooling/sobjects/ApexExecutionOverlayResult/07nxx00000000CMAAY"},"Id":"07nxx00000000CMAAY","IsDeleted":false,"CreatedDate":"2018-06-18T18:40:19.000+0000","CreatedById":"005xx000001UtEwAAK","LastModifiedDate":"2018-06-18T18:40:19.000+0000","LastModifiedById":"005xx000001UtEwAAK","SystemModstamp":"2018-06-18T18:40:19.000+0000","UserId":"005xx000001UtEwAAK","RequestedById":"005xx000001UtEwAAK","OverlayResultLength":4043,"HeapDump":{"className":"TriggerTest","extents":[{"collectionType":null,"count":7,"definition":[],"extent":[{"address":"0x444e4e83","size":16,"symbols":null,"value":{"entry":[{"keyDisplayValue":"Name","value":{"value":"okToDelete2"}},{"keyDisplayValue":"AccountNumber","value":{"value":"xxx"}},{"keyDisplayValue":"Id","value":{"value":"001xx000003Dt2YAAS"}}]}},{"address":"0x49d41795","size":16,"symbols":null,"value":{"entry":[{"keyDisplayValue":"Name","value":{"value":"okToDelete0"}},{"keyDisplayValue":"AccountNumber","value":{"value":"xxx"}},{"keyDisplayValue":"Id","value":{"value":"001xx000003Dt2WAAS"}}]}},{"address":"0x154b7a1f","size":16,"symbols":null,"value":{"entry":[{"keyDisplayValue":"Name","value":{"value":"okToDelete1"}},{"keyDisplayValue":"AccountNumber","value":{"value":"xxx"}},{"keyDisplayValue":"Id","value":{"value":"001xx000003Dt2XAAS"}}]}},{"address":"0x592cade4","size":16,"symbols":null,"value":{"entry":[{"keyDisplayValue":"Name","value":{"value":"okToDelete4"}},{"keyDisplayValue":"AccountNumber","value":{"value":"xxx"}},{"keyDisplayValue":"Id","value":{"value":"001xx000003Dt2aAAC"}}]}},{"address":"0x5aafa32e","size":16,"symbols":["a"],"value":{"entry":[{"keyDisplayValue":"Name","value":{"value":"okToDelete5"}},{"keyDisplayValue":"AccountNumber","value":{"value":"xxx"}},{"keyDisplayValue":"Id","value":{"value":"001xx000003Dt2bAAC"}}]}},{"address":"0x8f2d830","size":16,"symbols":null,"value":{"entry":[{"keyDisplayValue":"Name","value":{"value":"okToDelete3"}},{"keyDisplayValue":"AccountNumber","value":{"value":"xxx"}},{"keyDisplayValue":"Id","value":{"value":"001xx000003Dt2ZAAS"}}]}},{"address":"0x59ab457a","size":16,"symbols":["foo"],"value":{"entry":[{"keyDisplayValue":"Name","value":{"value":"okToDelete2"}},{"keyDisplayValue":"AccountNumber","value":{"value":"yyy"}},{"keyDisplayValue":"Id","value":{"value":"001xx000003Dt2YAAS"}}]}}],"totalSize":112,"typeName":"Account"},{"collectionType":"Account","count":2,"definition":[],"extent":[{"address":"0x93ad942","size":16,"symbols":["accts"],"value":{"value":[{"value":"0x49d41795"},{"value":"0x154b7a1f"},{"value":"0x444e4e83"}]}},{"address":"0x2c1dbd56","size":16,"symbols":["accts2"],"value":{"value":[{"value":"0x8f2d830"},{"value":"0x592cade4"},{"value":"0x5aafa32e"}]}}],"totalSize":32,"typeName":"List"},{"collectionType":null,"count":1,"definition":[{"name":"value","type":"Double"}],"extent":[{"address":"0x4437681f","size":8,"symbols":["i"],"value":{"value":6.0}}],"totalSize":8,"typeName":"Integer"},{"collectionType":null,"count":23,"definition":[{"name":"stringValue","type":"char[]"}],"extent":[{"address":"0x432f75fe","size":3,"symbols":null,"value":{"value":"foo"}},{"address":"0x4ffda43f","size":13,"symbols":null,"value":{"value":"AccountNumber"}},{"address":"0x71c93045","size":11,"symbols":null,"value":{"value":"okToDelete2"}},{"address":"0x151e3c89","size":2,"symbols":null,"value":{"value":"Id"}},{"address":"0x23e5508e","size":4,"symbols":null,"value":{"value":"Name"}},{"address":"0x7f6deccf","size":11,"symbols":null,"value":{"value":"okToDelete3"}},{"address":"0x6bd5451","size":2,"symbols":null,"value":{"value":"Id"}},{"address":"0x6da087d2","size":3,"symbols":null,"value":{"value":"xxx"}},{"address":"0x69c6ed15","size":18,"symbols":null,"value":{"value":"001xx000003Dt2WAAS"}},{"address":"0x6b7fb095","size":18,"symbols":null,"value":{"value":"001xx000003Dt2aAAC"}},{"address":"0x6a48115b","size":18,"symbols":null,"value":{"value":"001xx000003Dt2YAAS"}},{"address":"0xde0b05e","size":11,"symbols":null,"value":{"value":"okToDelete5"}},{"address":"0x432efee2","size":11,"symbols":null,"value":{"value":"okToDelete0"}},{"address":"0x4b00d2a3","size":18,"symbols":null,"value":{"value":"001xx000003Dt2XAAS"}},{"address":"0x79de8b26","size":11,"symbols":null,"value":{"value":"okToDelete2"}},{"address":"0x26a7eb28","size":11,"symbols":null,"value":{"value":"okToDelete4"}},{"address":"0x73929baf","size":18,"symbols":null,"value":{"value":"001xx000003Dt2YAAS"}},{"address":"0x211d1872","size":18,"symbols":null,"value":{"value":"001xx000003Dt2ZAAS"}},{"address":"0x612cd233","size":11,"symbols":null,"value":{"value":"okToDelete1"}},{"address":"0x568c2039","size":13,"symbols":null,"value":{"value":"AccountNumber"}},{"address":"0x7468263c","size":4,"symbols":null,"value":{"value":"Name"}},{"address":"0x67c2213e","size":3,"symbols":null,"value":{"value":"yyy"}},{"address":"0x3593f2bf","size":18,"symbols":null,"value":{"value":"001xx000003Dt2bAAC"}}],"totalSize":250,"typeName":"String"}],"heapDumpDate":"2018-06-18T18:40:18.956+0000","namespace":"none"},"ApexResult":null,"SOQLResult":{"queryError":"\\nSELECT Id, Name, AccountNumber FROM AccountOpps WHERE Name like \'okToDelete%\'\\n ^\\nERROR at Row:1:Column:37\\nsObject type \'AccountOpps\' is not supported. If you are attempting to use a custom object, be sure to append the \'__c\' after the entity name. Please reference your WSDL or the describe call for the appropriate names.","queryMetadata":null,"queryResult":null},"Line":23,"Iteration":1,"ExpirationDate":"2018-06-18T19:09:36.000+0000","IsDumpingHeap":true,"ActionScript":"SELECT Id, Name, AccountNumber FROM AccountOpps WHERE Name like \'okToDelete%\'","ActionScriptType":"SOQL","ClassName":"TriggerTest","Namespace":"none"}'; - const expectedErrorActionScript = - "SELECT Id, Name, AccountNumber FROM AccountOpps WHERE Name like 'okToDelete%'"; + const expectedErrorActionScript = "SELECT Id, Name, AccountNumber FROM AccountOpps WHERE Name like 'okToDelete%'"; const expectedQueryError = "\nSELECT Id, Name, AccountNumber FROM AccountOpps WHERE Name like 'okToDelete%'\n ^\nERROR at Row:1:Column:37\nsObject type 'AccountOpps' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names."; @@ -302,14 +277,12 @@ describe('ApexExecutionOverlayResult heapdump parsing with ActionScript SOQL res it('ApexExecutionOverlayResultCommand GET REST call with SOQL ActionScript success result', async () => { overlayResultCommand = new ApexExecutionOverlayResultCommand(heapdumpKey); - sendRequestSpy = sinon - .stub(RequestService.prototype, 'sendRequest') - .returns( - Promise.resolve({ - status: 200, - responseText: responseSuccessSOQL - } as XHRResponse) - ); + sendRequestSpy = sinon.stub(RequestService.prototype, 'sendRequest').returns( + Promise.resolve({ + status: 200, + responseText: responseSuccessSOQL + } as XHRResponse) + ); // The expected options needs to contain the request body, url and RestHttpMethodEnum.Get // The query string needs to be pulled from the overlayResultCommand since it contains the @@ -320,17 +293,12 @@ describe('ApexExecutionOverlayResult heapdump parsing with ActionScript SOQL res RestHttpMethodEnum.Get ); - const returnString = await requestService.execute( - overlayResultCommand, - RestHttpMethodEnum.Get - ); + const returnString = await requestService.execute(overlayResultCommand, RestHttpMethodEnum.Get); expect(sendRequestSpy.calledOnce).to.equal(true); expect(sendRequestSpy.getCall(0).args[0]).to.deep.equal(expectedOptions); - const response = JSON.parse( - returnString - ) as ApexExecutionOverlayResultCommandSuccess; + const response = JSON.parse(returnString) as ApexExecutionOverlayResultCommandSuccess; // Parsing the SOQL first requires reading the metadata returned with the result // There will only ever be one type of result as a checkpoint cannot have both Apex and SOQL results @@ -338,20 +306,14 @@ describe('ApexExecutionOverlayResult heapdump parsing with ActionScript SOQL res expect(response.ActionScript).to.equal(expectedActionScript); expect(response.ActionScriptType).to.equal(ActionScriptEnum.SOQL); expect(response.SOQLResult!.queryError).to.equal(null); - expect(response.SOQLResult!.queryMetadata!.entityName).to.equal( - accountType - ); + expect(response.SOQLResult!.queryMetadata!.entityName).to.equal(accountType); expect(response.SOQLResult!.queryMetadata!.groupBy).to.equal(false); expect(response.SOQLResult!.queryMetadata!.idSelected).to.equal(true); - expect(response.SOQLResult!.queryMetadata!.keyPrefix).to.equal( - expectedKeyPrefix - ); + expect(response.SOQLResult!.queryMetadata!.keyPrefix).to.equal(expectedKeyPrefix); // There are 3 pieces of metdata, Id, Name and AccountNumber in that order. // Verify the Id metadata - let columnMetadata = response.SOQLResult!.queryMetadata!.columnMetadata[ - metadataId - ]; + let columnMetadata = response.SOQLResult!.queryMetadata!.columnMetadata[metadataId]; expect(columnMetadata.aggregate).to.equal(false); expect(columnMetadata.apexType).to.equal(apexTypeId); expect(columnMetadata.booleanType).to.equal(false); @@ -366,9 +328,7 @@ describe('ApexExecutionOverlayResult heapdump parsing with ActionScript SOQL res expect(columnMetadata.updatable).to.equal(false); // very the Name metadata - columnMetadata = response.SOQLResult!.queryMetadata!.columnMetadata[ - metadataName - ]; + columnMetadata = response.SOQLResult!.queryMetadata!.columnMetadata[metadataName]; expect(columnMetadata.aggregate).to.equal(false); expect(columnMetadata.apexType).to.equal(apexTypeString); expect(columnMetadata.booleanType).to.equal(false); @@ -383,9 +343,7 @@ describe('ApexExecutionOverlayResult heapdump parsing with ActionScript SOQL res expect(columnMetadata.updatable).to.equal(true); // Verify the AccountNumber metadata - columnMetadata = response.SOQLResult!.queryMetadata!.columnMetadata[ - metadataAccountNumber - ]; + columnMetadata = response.SOQLResult!.queryMetadata!.columnMetadata[metadataAccountNumber]; expect(columnMetadata.aggregate).to.equal(false); expect(columnMetadata.apexType).to.equal(apexTypeString); expect(columnMetadata.booleanType).to.equal(false); @@ -409,37 +367,29 @@ describe('ApexExecutionOverlayResult heapdump parsing with ActionScript SOQL res expect(singleEntry.attributes.type).to.equal(accountType); // The accountId is needed to verify the url in the attributes const accountId = singleEntry[ - response.SOQLResult!.queryMetadata!.columnMetadata[metadataId] - .columnName + response.SOQLResult!.queryMetadata!.columnMetadata[metadataId].columnName ] as string; expect(accountId.startsWith('001xx000003Dt')).to.equal(true); expect(singleEntry.attributes.url).to.equal(`${urlBase}${accountId}`); expect( - (singleEntry[ - response.SOQLResult!.queryMetadata!.columnMetadata[metadataName] - .columnName - ] as string).startsWith('okToDelete') + (singleEntry[response.SOQLResult!.queryMetadata!.columnMetadata[metadataName].columnName] as string).startsWith( + 'okToDelete' + ) ).to.equal(true); expect( - singleEntry[ - response.SOQLResult!.queryMetadata!.columnMetadata[ - metadataAccountNumber - ].columnName - ] as string + singleEntry[response.SOQLResult!.queryMetadata!.columnMetadata[metadataAccountNumber].columnName] as string ).to.equal('yyy'); } }); it('ApexExecutionOverlayResultCommand GET REST call with SOQL ActionScript failure result', async () => { overlayResultCommand = new ApexExecutionOverlayResultCommand(heapdumpKey); - sendRequestSpy = sinon - .stub(RequestService.prototype, 'sendRequest') - .returns( - Promise.resolve({ - status: 200, - responseText: reseponseErrorSOQL - } as XHRResponse) - ); + sendRequestSpy = sinon.stub(RequestService.prototype, 'sendRequest').returns( + Promise.resolve({ + status: 200, + responseText: reseponseErrorSOQL + } as XHRResponse) + ); // The expected options needs to contain the request body, url and RestHttpMethodEnum.Get // The query string needs to be pulled from the overlayResultCommand since it contains the @@ -450,17 +400,12 @@ describe('ApexExecutionOverlayResult heapdump parsing with ActionScript SOQL res RestHttpMethodEnum.Get ); - const returnString = await requestService.execute( - overlayResultCommand, - RestHttpMethodEnum.Get - ); + const returnString = await requestService.execute(overlayResultCommand, RestHttpMethodEnum.Get); expect(sendRequestSpy.calledOnce).to.equal(true); expect(sendRequestSpy.getCall(0).args[0]).to.deep.equal(expectedOptions); - const response = JSON.parse( - returnString - ) as ApexExecutionOverlayResultCommandSuccess; + const response = JSON.parse(returnString) as ApexExecutionOverlayResultCommandSuccess; expect(response.ActionScript).to.equal(expectedErrorActionScript); expect(response.ActionScriptType).to.equal(ActionScriptEnum.SOQL); @@ -486,16 +431,13 @@ describe('ApexExecutionOverlayResult heapdump parsing with ActionScript SOQL res const reseponseFailureRuntimeException = '{"attributes":{"type":"ApexExecutionOverlayResult","url":"/services/data/v44.0/tooling/sobjects/ApexExecutionOverlayResult/07nxx00000000CqAAI"},"Id":"07nxx00000000CqAAI","IsDeleted":false,"CreatedDate":"2018-06-18T21:33:11.000+0000","CreatedById":"005xx000001UtEwAAK","LastModifiedDate":"2018-06-18T21:33:11.000+0000","LastModifiedById":"005xx000001UtEwAAK","SystemModstamp":"2018-06-18T21:33:11.000+0000","UserId":"005xx000001UtEwAAK","RequestedById":"005xx000001UtEwAAK","OverlayResultLength":686,"HeapDump":{"className":"SimpleTestClass","extents":[],"heapDumpDate":"2018-06-18T21:33:11.027+0000","namespace":"none"},"ApexResult":{"apexError":null,"apexExecutionResult":{"column":1,"compileProblem":null,"compiled":true,"exceptionMessage":"System.MathException: Divide by 0","exceptionStackTrace":"AnonymousBlock: line 1, column 1","line":1,"success":false}},"SOQLResult":null,"Line":6,"Iteration":1,"ExpirationDate":"2018-06-18T21:06:29.000+0000","IsDumpingHeap":true,"ActionScript":"System.Debug(4/0);","ActionScriptType":"Apex","ClassName":"SimpleTestClass","Namespace":"none"}'; const expectedFailureRuntimeExceptionActionScript = 'System.Debug(4/0);'; - const expectedFailureRuntimeExceptionStackTrace = - 'AnonymousBlock: line 1, column 1'; - const expectedFailureRuntimeExceptionMessage = - 'System.MathException: Divide by 0'; + const expectedFailureRuntimeExceptionStackTrace = 'AnonymousBlock: line 1, column 1'; + const expectedFailureRuntimeExceptionMessage = 'System.MathException: Divide by 0'; const reseponseFailureCompilationError = '{"attributes":{"type":"ApexExecutionOverlayResult","url":"/services/data/v44.0/tooling/sobjects/ApexExecutionOverlayResult/07nxx00000000CvAAI"},"Id":"07nxx00000000CvAAI","IsDeleted":false,"CreatedDate":"2018-06-18T21:33:51.000+0000","CreatedById":"005xx000001UtEwAAK","LastModifiedDate":"2018-06-18T21:33:51.000+0000","LastModifiedById":"005xx000001UtEwAAK","SystemModstamp":"2018-06-18T21:33:51.000+0000","UserId":"005xx000001UtEwAAK","RequestedById":"005xx000001UtEwAAK","OverlayResultLength":652,"HeapDump":{"className":"SimpleTestClass","extents":[],"heapDumpDate":"2018-06-18T21:33:51.902+0000","namespace":"none"},"ApexResult":{"apexError":null,"apexExecutionResult":{"column":1,"compileProblem":"Expression cannot be a statement.","compiled":false,"exceptionMessage":null,"exceptionStackTrace":null,"line":1,"success":false}},"SOQLResult":null,"Line":6,"Iteration":1,"ExpirationDate":"2018-06-18T21:06:29.000+0000","IsDumpingHeap":true,"ActionScript":"\'Neener neener neener\';","ActionScriptType":"Apex","ClassName":"SimpleTestClass","Namespace":"none"}'; const expectedFailureCompilationErrorActionScript = "'Neener neener neener';"; - const expectedFailureCompilationErrorCompileProblem = - 'Expression cannot be a statement.'; + const expectedFailureCompilationErrorCompileProblem = 'Expression cannot be a statement.'; beforeEach(() => { requestService.instanceUrl = 'https://www.salesforce.com'; @@ -508,14 +450,12 @@ describe('ApexExecutionOverlayResult heapdump parsing with ActionScript SOQL res it('ApexExecutionOverlayResultCommand GET REST call with Apex ActionScript success result', async () => { overlayResultCommand = new ApexExecutionOverlayResultCommand(heapdumpKey); - sendRequestSpy = sinon - .stub(RequestService.prototype, 'sendRequest') - .returns( - Promise.resolve({ - status: 200, - responseText: responseSuccess - } as XHRResponse) - ); + sendRequestSpy = sinon.stub(RequestService.prototype, 'sendRequest').returns( + Promise.resolve({ + status: 200, + responseText: responseSuccess + } as XHRResponse) + ); // The expected options needs to contain the request body, url and RestHttpMethodEnum.Get // The query string needs to be pulled from the overlayResultCommand since it contains the @@ -526,17 +466,12 @@ describe('ApexExecutionOverlayResult heapdump parsing with ActionScript SOQL res RestHttpMethodEnum.Get ); - const returnString = await requestService.execute( - overlayResultCommand, - RestHttpMethodEnum.Get - ); + const returnString = await requestService.execute(overlayResultCommand, RestHttpMethodEnum.Get); expect(sendRequestSpy.calledOnce).to.equal(true); expect(sendRequestSpy.getCall(0).args[0]).to.deep.equal(expectedOptions); - const response = JSON.parse( - returnString - ) as ApexExecutionOverlayResultCommandSuccess; + const response = JSON.parse(returnString) as ApexExecutionOverlayResultCommandSuccess; expect(response.ActionScript).to.equal(expectedSuccessActionScript); expect(response.ActionScriptType).to.equal(ActionScriptEnum.Apex); @@ -556,14 +491,12 @@ describe('ApexExecutionOverlayResult heapdump parsing with ActionScript SOQL res it('ApexExecutionOverlayResultCommand GET REST call with Apex ActionScript unhandled runtime exception', async () => { overlayResultCommand = new ApexExecutionOverlayResultCommand(heapdumpKey); - sendRequestSpy = sinon - .stub(RequestService.prototype, 'sendRequest') - .returns( - Promise.resolve({ - status: 200, - responseText: reseponseFailureRuntimeException - } as XHRResponse) - ); + sendRequestSpy = sinon.stub(RequestService.prototype, 'sendRequest').returns( + Promise.resolve({ + status: 200, + responseText: reseponseFailureRuntimeException + } as XHRResponse) + ); // The expected options needs to contain the request body, url and RestHttpMethodEnum.Get // The query string needs to be pulled from the overlayResultCommand since it contains the @@ -574,21 +507,14 @@ describe('ApexExecutionOverlayResult heapdump parsing with ActionScript SOQL res RestHttpMethodEnum.Get ); - const returnString = await requestService.execute( - overlayResultCommand, - RestHttpMethodEnum.Get - ); + const returnString = await requestService.execute(overlayResultCommand, RestHttpMethodEnum.Get); expect(sendRequestSpy.calledOnce).to.equal(true); expect(sendRequestSpy.getCall(0).args[0]).to.deep.equal(expectedOptions); - const response = JSON.parse( - returnString - ) as ApexExecutionOverlayResultCommandSuccess; + const response = JSON.parse(returnString) as ApexExecutionOverlayResultCommandSuccess; - expect(response.ActionScript).to.equal( - expectedFailureRuntimeExceptionActionScript - ); + expect(response.ActionScript).to.equal(expectedFailureRuntimeExceptionActionScript); expect(response.ActionScriptType).to.equal(ActionScriptEnum.Apex); expect(response.ApexResult!.apexError).to.equal(null); expect(response.ApexResult!.apexExecutionResult).to.not.equal(undefined); @@ -597,12 +523,8 @@ describe('ApexExecutionOverlayResult heapdump parsing with ActionScript SOQL res expect(apexExecutionResult.column).to.equal(1); expect(apexExecutionResult.compiled).to.equal(true); expect(apexExecutionResult.compileProblem).to.equal(null); - expect(apexExecutionResult.exceptionMessage).to.equal( - expectedFailureRuntimeExceptionMessage - ); - expect(apexExecutionResult.exceptionStackTrace).to.equal( - expectedFailureRuntimeExceptionStackTrace - ); + expect(apexExecutionResult.exceptionMessage).to.equal(expectedFailureRuntimeExceptionMessage); + expect(apexExecutionResult.exceptionStackTrace).to.equal(expectedFailureRuntimeExceptionStackTrace); expect(apexExecutionResult.line).to.equal(1); expect(apexExecutionResult.success).to.equal(false); } @@ -610,14 +532,12 @@ describe('ApexExecutionOverlayResult heapdump parsing with ActionScript SOQL res it('ApexExecutionOverlayResultCommand GET REST call with Apex ActionScript compilation error', async () => { overlayResultCommand = new ApexExecutionOverlayResultCommand(heapdumpKey); - sendRequestSpy = sinon - .stub(RequestService.prototype, 'sendRequest') - .returns( - Promise.resolve({ - status: 200, - responseText: reseponseFailureCompilationError - } as XHRResponse) - ); + sendRequestSpy = sinon.stub(RequestService.prototype, 'sendRequest').returns( + Promise.resolve({ + status: 200, + responseText: reseponseFailureCompilationError + } as XHRResponse) + ); // The expected options needs to contain the request body, url and RestHttpMethodEnum.Get // The query string needs to be pulled from the overlayResultCommand since it contains the @@ -628,21 +548,14 @@ describe('ApexExecutionOverlayResult heapdump parsing with ActionScript SOQL res RestHttpMethodEnum.Get ); - const returnString = await requestService.execute( - overlayResultCommand, - RestHttpMethodEnum.Get - ); + const returnString = await requestService.execute(overlayResultCommand, RestHttpMethodEnum.Get); expect(sendRequestSpy.calledOnce).to.equal(true); expect(sendRequestSpy.getCall(0).args[0]).to.deep.equal(expectedOptions); - const response = JSON.parse( - returnString - ) as ApexExecutionOverlayResultCommandSuccess; + const response = JSON.parse(returnString) as ApexExecutionOverlayResultCommandSuccess; - expect(response.ActionScript).to.equal( - expectedFailureCompilationErrorActionScript - ); + expect(response.ActionScript).to.equal(expectedFailureCompilationErrorActionScript); expect(response.ActionScriptType).to.equal(ActionScriptEnum.Apex); expect(response.ApexResult!.apexError).to.equal(null); expect(response.ApexResult!.apexExecutionResult).to.not.equal(undefined); @@ -650,9 +563,7 @@ describe('ApexExecutionOverlayResult heapdump parsing with ActionScript SOQL res if (apexExecutionResult) { expect(apexExecutionResult.column).to.equal(1); expect(apexExecutionResult.compiled).to.equal(false); - expect(apexExecutionResult.compileProblem).to.equal( - expectedFailureCompilationErrorCompileProblem - ); + expect(apexExecutionResult.compileProblem).to.equal(expectedFailureCompilationErrorCompileProblem); expect(apexExecutionResult.exceptionMessage).to.equal(null); expect(apexExecutionResult.exceptionStackTrace).to.equal(null); expect(apexExecutionResult.line).to.equal(1); @@ -679,9 +590,7 @@ export const createExpectedXHROptions = ( 'Content-Type': 'application/json;charset=utf-8', Accept: 'application/json', Authorization: 'OAuth 123', - 'Content-Length': requestBody - ? String(Buffer.byteLength(requestBody, 'utf-8')) - : '0', + 'Content-Length': requestBody ? String(Buffer.byteLength(requestBody, 'utf-8')) : '0', 'Sforce-Call-Options': `client=${CLIENT_ID}` }, data: requestBody diff --git a/packages/salesforcedx-apex-replay-debugger/test/unit/core/logContext.test.ts b/packages/salesforcedx-apex-replay-debugger/test/unit/core/logContext.test.ts index bfd2093e7c..835df8042a 100644 --- a/packages/salesforcedx-apex-replay-debugger/test/unit/core/logContext.test.ts +++ b/packages/salesforcedx-apex-replay-debugger/test/unit/core/logContext.test.ts @@ -8,10 +8,7 @@ import { StackFrame } from '@vscode/debugadapter'; import { expect } from 'chai'; import * as sinon from 'sinon'; -import { - ApexReplayDebug, - LaunchRequestArguments -} from '../../../src/adapter/apexReplayDebug'; +import { ApexReplayDebug, LaunchRequestArguments } from '../../../src/adapter/apexReplayDebug'; import { BreakpointUtil } from '../../../src/breakpoints'; import { EVENT_CODE_UNIT_FINISHED, @@ -59,25 +56,11 @@ describe('LogContext', () => { beforeEach(() => { readLogFileStub = sinon .stub(LogContextUtil.prototype, 'readLogFile') - .returns([ - '43.0 APEX_CODE,FINEST;...;VISUALFORCE,FINER;..', - 'line1', - 'line2' - ]); - getFileSizeStub = sinon - .stub(LogContextUtil.prototype, 'getFileSize') - .returns(123); - shouldTraceLogFileStub = sinon - .stub(ApexReplayDebug.prototype, 'shouldTraceLogFile') - .returns(true); - printToDebugConsoleStub = sinon.stub( - ApexReplayDebug.prototype, - 'printToDebugConsole' - ); - revertStateAfterHeapDumpSpy = sinon.spy( - LogContext.prototype, - 'revertStateAfterHeapDump' - ); + .returns(['43.0 APEX_CODE,FINEST;...;VISUALFORCE,FINER;..', 'line1', 'line2']); + getFileSizeStub = sinon.stub(LogContextUtil.prototype, 'getFileSize').returns(123); + shouldTraceLogFileStub = sinon.stub(ApexReplayDebug.prototype, 'shouldTraceLogFile').returns(true); + printToDebugConsoleStub = sinon.stub(ApexReplayDebug.prototype, 'printToDebugConsole'); + revertStateAfterHeapDumpSpy = sinon.spy(LogContext.prototype, 'revertStateAfterHeapDump'); context = new LogContext(launchRequestArgs, new ApexReplayDebug()); }); @@ -119,9 +102,7 @@ describe('LogContext', () => { it('Should not have log lines', () => { readLogFileStub.restore(); - readLogFileStub = sinon - .stub(LogContextUtil.prototype, 'readLogFile') - .returns([]); + readLogFileStub = sinon.stub(LogContextUtil.prototype, 'readLogFile').returns([]); context = new LogContext(launchRequestArgs, new ApexReplayDebug()); expect(context.hasLogLines()).to.be.false; @@ -133,11 +114,7 @@ describe('LogContext', () => { readLogFileStub.restore(); readLogFileStub = sinon .stub(LogContextUtil.prototype, 'readLogFile') - .returns([ - '43.0 APEX_CODE,DEBUG;...;VISUALFORCE,DEBUG;..', - 'line1', - 'line2' - ]); + .returns(['43.0 APEX_CODE,DEBUG;...;VISUALFORCE,DEBUG;..', 'line1', 'line2']); context = new LogContext(launchRequestArgs, new ApexReplayDebug()); expect(context.meetsLogLevelRequirements()).to.be.false; @@ -166,9 +143,7 @@ describe('LogContext', () => { }); it('Should handle undefined log event', () => { - parseLogEventStub = sinon - .stub(LogContext.prototype, 'parseLogEvent') - .returns(undefined); + parseLogEventStub = sinon.stub(LogContext.prototype, 'parseLogEvent').returns(undefined); context.updateFrames(); @@ -177,9 +152,7 @@ describe('LogContext', () => { it('Should continue handling until the end of log file', () => { noOpHandleStub = sinon.stub(NoOpState.prototype, 'handle').returns(false); - parseLogEventStub = sinon - .stub(LogContext.prototype, 'parseLogEvent') - .returns(new NoOpState()); + parseLogEventStub = sinon.stub(LogContext.prototype, 'parseLogEvent').returns(new NoOpState()); context.updateFrames(); @@ -194,9 +167,7 @@ describe('LogContext', () => { .returns(false) .onSecondCall() .returns(true); - parseLogEventStub = sinon - .stub(LogContext.prototype, 'parseLogEvent') - .returns(new NoOpState()); + parseLogEventStub = sinon.stub(LogContext.prototype, 'parseLogEvent').returns(new NoOpState()); context.setState(new LogEntryState()); context.getFrames().push({} as StackFrame); @@ -209,9 +180,7 @@ describe('LogContext', () => { }); it('Should revert state if there is a heapdump', () => { - hasHeapDumpStub = sinon - .stub(LogContext.prototype, 'hasHeapDump') - .returns(true); + hasHeapDumpStub = sinon.stub(LogContext.prototype, 'hasHeapDump').returns(true); context = new LogContext(launchRequestArgs, new ApexReplayDebug()); context.updateFrames(); @@ -220,9 +189,7 @@ describe('LogContext', () => { }); it('Should not revert state if there is no heapdump', () => { - hasHeapDumpStub = sinon - .stub(LogContext.prototype, 'hasHeapDump') - .returns(false); + hasHeapDumpStub = sinon.stub(LogContext.prototype, 'hasHeapDump').returns(false); context = new LogContext(launchRequestArgs, new ApexReplayDebug()); context.updateFrames(); @@ -301,9 +268,7 @@ describe('LogContext', () => { context = new LogContext(launchRequestArgs, new ApexReplayDebug()); context.setState(new LogEntryState()); - context.parseLogEvent( - `|${EVENT_HEAP_DUMP}|[11]||ClassName1|Namespace1|11` - ); + context.parseLogEvent(`|${EVENT_HEAP_DUMP}|[11]||ClassName1|Namespace1|11`); expect(context.scanLogForHeapDumpLines()).to.be.true; expect(context.hasHeapDumpForTopFrame()).to.equal(''); @@ -324,9 +289,7 @@ describe('LogContext', () => { context = new LogContext(launchRequestArgs, new ApexReplayDebug()); context.setState(new LogEntryState()); - context.parseLogEvent( - `|${EVENT_HEAP_DUMP}|[11]||ClassName1|Namespace1|11` - ); + context.parseLogEvent(`|${EVENT_HEAP_DUMP}|[11]||ClassName1|Namespace1|11`); expect(context.scanLogForHeapDumpLines()).to.be.true; expect(context.hasHeapDumpForTopFrame()).to.be.undefined; @@ -348,16 +311,12 @@ describe('LogContext', () => { it('Should detect NoOp with unexpected number of fields', () => { context.setState(new LogEntryState()); - expect(context.parseLogEvent('timestamp|foo')).to.be.an.instanceof( - NoOpState - ); + expect(context.parseLogEvent('timestamp|foo')).to.be.an.instanceof(NoOpState); }); it('Should detect NoOp with unknown event', () => { context.setState(new LogEntryState()); - expect(context.parseLogEvent('timestamp|foo|bar')).to.be.an.instanceof( - NoOpState - ); + expect(context.parseLogEvent('timestamp|foo|bar')).to.be.an.instanceof(NoOpState); }); it('Should detect execute anonymous script line', () => { @@ -371,81 +330,61 @@ describe('LogContext', () => { it('Should detect FrameEntry with CODE_UNIT_STARTED', () => { context.setState(new LogEntryState()); - expect( - context.parseLogEvent(`|${EVENT_CODE_UNIT_STARTED}|`) - ).to.be.an.instanceof(FrameEntryState); + expect(context.parseLogEvent(`|${EVENT_CODE_UNIT_STARTED}|`)).to.be.an.instanceof(FrameEntryState); }); it('Should detect FrameEntry with CONSTRUCTOR_ENTRY', () => { context.setState(new LogEntryState()); - expect( - context.parseLogEvent(`|${EVENT_CONSTRUCTOR_ENTRY}|`) - ).to.be.an.instanceof(FrameEntryState); + expect(context.parseLogEvent(`|${EVENT_CONSTRUCTOR_ENTRY}|`)).to.be.an.instanceof(FrameEntryState); }); it('Should detect FrameEntry with METHOD_ENTRY', () => { context.setState(new LogEntryState()); - expect( - context.parseLogEvent(`|${EVENT_METHOD_ENTRY}|`) - ).to.be.an.instanceof(FrameEntryState); + expect(context.parseLogEvent(`|${EVENT_METHOD_ENTRY}|`)).to.be.an.instanceof(FrameEntryState); }); it('Should detect FrameEntry with VF_APEX_CALL_START', () => { context.setState(new LogEntryState()); - expect( - context.parseLogEvent(`|${EVENT_VF_APEX_CALL_START}|`) - ).to.be.an.instanceof(FrameEntryState); + expect(context.parseLogEvent(`|${EVENT_VF_APEX_CALL_START}|`)).to.be.an.instanceof(FrameEntryState); }); it('Should detect FrameExit with CODE_UNIT_FINISHED', () => { context.setState(new LogEntryState()); - expect( - context.parseLogEvent(`|${EVENT_CODE_UNIT_FINISHED}|`) - ).to.be.an.instanceof(FrameExitState); + expect(context.parseLogEvent(`|${EVENT_CODE_UNIT_FINISHED}|`)).to.be.an.instanceof(FrameExitState); }); it('Should detect FrameExit with CONSTRUCTOR_EXIT', () => { context.setState(new LogEntryState()); - expect( - context.parseLogEvent(`|${EVENT_CONSTRUCTOR_EXIT}|`) - ).to.be.an.instanceof(FrameExitState); + expect(context.parseLogEvent(`|${EVENT_CONSTRUCTOR_EXIT}|`)).to.be.an.instanceof(FrameExitState); }); it('Should detect FrameExit with METHOD_EXIT', () => { context.setState(new LogEntryState()); - expect( - context.parseLogEvent(`|${EVENT_METHOD_EXIT}|`) - ).to.be.an.instanceof(FrameExitState); + expect(context.parseLogEvent(`|${EVENT_METHOD_EXIT}|`)).to.be.an.instanceof(FrameExitState); }); it('Should detect FrameExit with VF_APEX_CALL_END', () => { context.setState(new LogEntryState()); - expect( - context.parseLogEvent(`|${EVENT_VF_APEX_CALL_END}|`) - ).to.be.an.instanceof(FrameExitState); + expect(context.parseLogEvent(`|${EVENT_VF_APEX_CALL_END}|`)).to.be.an.instanceof(FrameExitState); }); it('Should detect StatementExecute with STATEMENT_EXECUTE', () => { context.setState(new LogEntryState()); - expect( - context.parseLogEvent(`|${EVENT_STATEMENT_EXECUTE}|[1]`) - ).to.be.an.instanceof(StatementExecuteState); + expect(context.parseLogEvent(`|${EVENT_STATEMENT_EXECUTE}|[1]`)).to.be.an.instanceof(StatementExecuteState); }); it('Should detect UserDebug with USER_DEBUG', () => { context.setState(new LogEntryState()); - expect( - context.parseLogEvent(`|${EVENT_USER_DEBUG}|[1]|DEBUG|Hello`) - ).to.be.an.instanceof(UserDebugState); + expect(context.parseLogEvent(`|${EVENT_USER_DEBUG}|[1]|DEBUG|Hello`)).to.be.an.instanceof(UserDebugState); }); }); @@ -454,15 +393,10 @@ describe('LogContext', () => { const typerefMapping: Map = new Map(); typerefMapping.set('namespace/Foo$Bar', '/path/foo.cls'); typerefMapping.set('namespace/Foo', '/path/foo.cls'); - typerefMapping.set( - '__sfdc_trigger/namespace/MyTrigger', - '/path/MyTrigger.trigger' - ); + typerefMapping.set('__sfdc_trigger/namespace/MyTrigger', '/path/MyTrigger.trigger'); beforeEach(() => { - getTyperefMappingStub = sinon - .stub(BreakpointUtil.prototype, 'getTyperefMapping') - .returns(typerefMapping); + getTyperefMappingStub = sinon.stub(BreakpointUtil.prototype, 'getTyperefMapping').returns(typerefMapping); }); afterEach(() => { @@ -470,23 +404,17 @@ describe('LogContext', () => { }); it('Should return debug log fs path for execute anonymous signature', () => { - expect(context.getUriFromSignature(EXEC_ANON_SIGNATURE)).to.equal( - context.getLogFilePath() - ); + expect(context.getUriFromSignature(EXEC_ANON_SIGNATURE)).to.equal(context.getLogFilePath()); }); it('Should return URI for inner class', () => { expect( - context.getUriFromSignature( - 'namespace.Foo.Bar(namespace.Foo.Bar, String, Map, List)' - ) + context.getUriFromSignature('namespace.Foo.Bar(namespace.Foo.Bar, String, Map, List)') ).to.equal('/path/foo.cls'); }); it('Should return URI for trigger', () => { - expect( - context.getUriFromSignature('__sfdc_trigger/namespace/MyTrigger') - ).to.be.equal('/path/MyTrigger.trigger'); + expect(context.getUriFromSignature('__sfdc_trigger/namespace/MyTrigger')).to.be.equal('/path/MyTrigger.trigger'); }); }); }); diff --git a/packages/salesforcedx-apex-replay-debugger/test/unit/states/frameEntryState.test.ts b/packages/salesforcedx-apex-replay-debugger/test/unit/states/frameEntryState.test.ts index f4638a670c..edf5509ef4 100644 --- a/packages/salesforcedx-apex-replay-debugger/test/unit/states/frameEntryState.test.ts +++ b/packages/salesforcedx-apex-replay-debugger/test/unit/states/frameEntryState.test.ts @@ -9,11 +9,7 @@ import { StackFrame } from '@vscode/debugadapter'; import { expect } from 'chai'; import * as sinon from 'sinon'; import Uri from 'vscode-uri'; -import { - ApexReplayDebug, - ApexVariable, - LaunchRequestArguments -} from '../../../src/adapter/apexReplayDebug'; +import { ApexReplayDebug, ApexVariable, LaunchRequestArguments } from '../../../src/adapter/apexReplayDebug'; import { LogContext } from '../../../src/core'; import { FrameEntryState } from '../../../src/states'; @@ -34,15 +30,9 @@ describe('Frame entry event', () => { beforeEach(() => { map = new Map>(); map.set('previousClass', new Map()); - map - .get('previousClass')! - .set('var1', new ApexVariable('var1', '0', 'Integer')); - getUriFromSignatureStub = sinon - .stub(LogContext.prototype, 'getUriFromSignature') - .returns(uriFromSignature); - getStaticMapStub = sinon - .stub(LogContext.prototype, 'getStaticVariablesClassMap') - .returns(map); + map.get('previousClass')!.set('var1', new ApexVariable('var1', '0', 'Integer')); + getUriFromSignatureStub = sinon.stub(LogContext.prototype, 'getUriFromSignature').returns(uriFromSignature); + getStaticMapStub = sinon.stub(LogContext.prototype, 'getStaticVariablesClassMap').returns(map); }); afterEach(() => { @@ -53,9 +43,7 @@ describe('Frame entry event', () => { it('Should add a frame', () => { const state = new FrameEntryState(['signature']); const context = new LogContext(launchRequestArgs, new ApexReplayDebug()); - context - .getFrames() - .push({ id: 0, name: 'execute_anonymous_apex' } as StackFrame); + context.getFrames().push({ id: 0, name: 'execute_anonymous_apex' } as StackFrame); expect(state.handle(context)).to.be.false; @@ -73,17 +61,13 @@ describe('Frame entry event', () => { } } as StackFrame); expect(context.getStaticVariablesClassMap().has('signature')).to.be.true; - expect( - context.getStaticVariablesClassMap().get('signature')!.size - ).to.equal(0); + expect(context.getStaticVariablesClassMap().get('signature')!.size).to.equal(0); }); it('Should parse the class name from method signature and add it to static variable map', () => { const state = new FrameEntryState(['className.method']); const context = new LogContext(launchRequestArgs, new ApexReplayDebug()); - context - .getFrames() - .push({ id: 0, name: 'execute_anonymous_apex' } as StackFrame); + context.getFrames().push({ id: 0, name: 'execute_anonymous_apex' } as StackFrame); expect(state.handle(context)).to.be.false; @@ -101,17 +85,13 @@ describe('Frame entry event', () => { } } as StackFrame); expect(context.getStaticVariablesClassMap()).to.include.keys('className'); - expect( - context.getStaticVariablesClassMap().get('className')!.size - ).to.equal(0); + expect(context.getStaticVariablesClassMap().get('className')!.size).to.equal(0); }); it('Should use existing static variables when the entry is for a class that was seen earlier', () => { const state = new FrameEntryState(['previousClass.seenBefore']); const context = new LogContext(launchRequestArgs, new ApexReplayDebug()); - context - .getFrames() - .push({ id: 0, name: 'execute_anonymous_apex' } as StackFrame); + context.getFrames().push({ id: 0, name: 'execute_anonymous_apex' } as StackFrame); expect(state.handle(context)).to.be.false; @@ -128,11 +108,7 @@ describe('Frame entry event', () => { sourceReference: 0 } } as StackFrame); - expect(context.getStaticVariablesClassMap()).to.include.keys( - 'previousClass' - ); - expect(context.getStaticVariablesClassMap().get('previousClass')).equals( - map.get('previousClass') - ); + expect(context.getStaticVariablesClassMap()).to.include.keys('previousClass'); + expect(context.getStaticVariablesClassMap().get('previousClass')).equals(map.get('previousClass')); }); }); diff --git a/packages/salesforcedx-apex-replay-debugger/test/unit/states/frameExitState.test.ts b/packages/salesforcedx-apex-replay-debugger/test/unit/states/frameExitState.test.ts index 646a91ddb1..b90ed15940 100644 --- a/packages/salesforcedx-apex-replay-debugger/test/unit/states/frameExitState.test.ts +++ b/packages/salesforcedx-apex-replay-debugger/test/unit/states/frameExitState.test.ts @@ -7,10 +7,7 @@ import { StackFrame } from '@vscode/debugadapter'; import { expect } from 'chai'; -import { - ApexReplayDebug, - LaunchRequestArguments -} from '../../../src/adapter/apexReplayDebug'; +import { ApexReplayDebug, LaunchRequestArguments } from '../../../src/adapter/apexReplayDebug'; import { LogContext } from '../../../src/core'; import { FrameExitState } from '../../../src/states'; diff --git a/packages/salesforcedx-apex-replay-debugger/test/unit/states/frameStateUtil.test.ts b/packages/salesforcedx-apex-replay-debugger/test/unit/states/frameStateUtil.test.ts index 92554b51be..6b2d3eb79d 100644 --- a/packages/salesforcedx-apex-replay-debugger/test/unit/states/frameStateUtil.test.ts +++ b/packages/salesforcedx-apex-replay-debugger/test/unit/states/frameStateUtil.test.ts @@ -12,105 +12,69 @@ describe('Frame state utilities', () => { describe('Verify frame name generation', () => { // EVENT_CODE_UNIT_STARTED/FINISHED tests it('EVENT_CODE_UNIT_STARTED only strips trigger prefix', () => { - const fields = 'NothingHereMatters|CODE_UNIT_STARTED|NothingHereMatters|__sfdc_trigger/Nothing/Here.Matters'.split( - '|' - ); - expect(FrameStateUtil.computeFrameName(fields)).to.equal( - 'Nothing/Here.Matters' - ); + const fields = + 'NothingHereMatters|CODE_UNIT_STARTED|NothingHereMatters|__sfdc_trigger/Nothing/Here.Matters'.split('|'); + expect(FrameStateUtil.computeFrameName(fields)).to.equal('Nothing/Here.Matters'); }); it('EVENT_CODE_UNIT_FINISHED only strips trigger prefix', () => { - const fields = 'NothingHereMatters|CODE_UNIT_FINISHED|NothingHereMatters|__sfdc_trigger/Nothing/Here.Matters'.split( - '|' - ); - expect(FrameStateUtil.computeFrameName(fields)).to.equal( - 'Nothing/Here.Matters' - ); + const fields = + 'NothingHereMatters|CODE_UNIT_FINISHED|NothingHereMatters|__sfdc_trigger/Nothing/Here.Matters'.split('|'); + expect(FrameStateUtil.computeFrameName(fields)).to.equal('Nothing/Here.Matters'); }); it('EVENT_CODE_UNIT_STARTED nothing parsed if non-trigger', () => { - const fields = 'NothingHereMatters|CODE_UNIT_STARTED|NothingHereMatters|Nothing/Here.Matters'.split( - '|' - ); - expect(FrameStateUtil.computeFrameName(fields)).to.equal( - 'Nothing/Here.Matters' - ); + const fields = 'NothingHereMatters|CODE_UNIT_STARTED|NothingHereMatters|Nothing/Here.Matters'.split('|'); + expect(FrameStateUtil.computeFrameName(fields)).to.equal('Nothing/Here.Matters'); }); it('EVENT_CODE_UNIT_FINISHED nothing parsed if non-trigger', () => { - const fields = 'NothingHereMatters|CODE_UNIT_FINISHED|NothingHereMatters|Nothing/Here.Matters'.split( - '|' - ); - expect(FrameStateUtil.computeFrameName(fields)).to.equal( - 'Nothing/Here.Matters' - ); + const fields = 'NothingHereMatters|CODE_UNIT_FINISHED|NothingHereMatters|Nothing/Here.Matters'.split('|'); + expect(FrameStateUtil.computeFrameName(fields)).to.equal('Nothing/Here.Matters'); }); // EVENT_CONSTRUCTOR_ENTRY/EXIT tests it('EVENT_CONSTRUCTOR_ENTRY simple class', () => { - const fields = 'NothingHereMatters|CONSTRUCTOR_ENTRY|NothingHereMatters|SomeClassName'.split( - '|' - ); - expect(FrameStateUtil.computeFrameName(fields)).to.equal( - 'SomeClassName.SomeClassName' - ); + const fields = 'NothingHereMatters|CONSTRUCTOR_ENTRY|NothingHereMatters|SomeClassName'.split('|'); + expect(FrameStateUtil.computeFrameName(fields)).to.equal('SomeClassName.SomeClassName'); }); it('EVENT_CONSTRUCTOR_EXIT simple class', () => { - const fields = 'NothingHereMatters|CONSTRUCTOR_EXIT|NothingHereMatters|SomeClassName'.split( - '|' - ); - expect(FrameStateUtil.computeFrameName(fields)).to.equal( - 'SomeClassName.SomeClassName' - ); + const fields = 'NothingHereMatters|CONSTRUCTOR_EXIT|NothingHereMatters|SomeClassName'.split('|'); + expect(FrameStateUtil.computeFrameName(fields)).to.equal('SomeClassName.SomeClassName'); }); it('EVENT_CONSTRUCTOR_ENTRY inner class', () => { - const fields = 'NothingHereMatters|CONSTRUCTOR_ENTRY|NothingHereMatters|ClassName.InnerClassName'.split( - '|' - ); - expect(FrameStateUtil.computeFrameName(fields)).to.equal( - 'ClassName.InnerClassName.InnerClassName' - ); + const fields = 'NothingHereMatters|CONSTRUCTOR_ENTRY|NothingHereMatters|ClassName.InnerClassName'.split('|'); + expect(FrameStateUtil.computeFrameName(fields)).to.equal('ClassName.InnerClassName.InnerClassName'); }); it('EVENT_CONSTRUCTOR_EXIT inner class', () => { - const fields = 'NothingHereMatters|CONSTRUCTOR_EXIT|NothingHereMatters|ClassName.InnerClassName'.split( - '|' - ); - expect(FrameStateUtil.computeFrameName(fields)).to.equal( - 'ClassName.InnerClassName.InnerClassName' - ); + const fields = 'NothingHereMatters|CONSTRUCTOR_EXIT|NothingHereMatters|ClassName.InnerClassName'.split('|'); + expect(FrameStateUtil.computeFrameName(fields)).to.equal('ClassName.InnerClassName.InnerClassName'); }); it('EVENT_CONSTRUCTOR_EXIT inner class', () => { - const fields = 'NothingHereMatters|CONSTRUCTOR_EXIT|NothingHereMatters|ClassName.InnerClassName'.split( - '|' - ); - expect(FrameStateUtil.computeFrameName(fields)).to.equal( - 'ClassName.InnerClassName.InnerClassName' - ); + const fields = 'NothingHereMatters|CONSTRUCTOR_EXIT|NothingHereMatters|ClassName.InnerClassName'.split('|'); + expect(FrameStateUtil.computeFrameName(fields)).to.equal('ClassName.InnerClassName.InnerClassName'); }); // VF_APEX_CALL_START/END tests it('EVENT_VF_APEX_CALL_START parse method name from invoke', () => { - const fields = 'NothingMattersHere|VF_APEX_CALL_START|NothingHereMatters|NothingHereMatters invoke(method)|ClassName'.split( - '|' - ); - expect(FrameStateUtil.computeFrameName(fields)).to.equal( - 'ClassName.method()' - ); + const fields = + 'NothingMattersHere|VF_APEX_CALL_START|NothingHereMatters|NothingHereMatters invoke(method)|ClassName'.split( + '|' + ); + expect(FrameStateUtil.computeFrameName(fields)).to.equal('ClassName.method()'); }); it('EVENT_VF_APEX_CALL_END parse method name from invoke', () => { - const fields = 'NothingMattersHere|VF_APEX_CALL_END|NothingHereMatters|NothingHereMatters invoke(method)|ClassName'.split( - '|' - ); - expect(FrameStateUtil.computeFrameName(fields)).to.equal( - 'ClassName.method()' - ); + const fields = + 'NothingMattersHere|VF_APEX_CALL_END|NothingHereMatters|NothingHereMatters invoke(method)|ClassName'.split('|'); + expect(FrameStateUtil.computeFrameName(fields)).to.equal('ClassName.method()'); }); it('EVENT_VF_APEX_CALL_START nothing parsed if not invoke', () => { - const fields = 'NothingMattersHere|VF_APEX_CALL_START|NothingHereMatters|NothingHereMatters notinvoke(method)|ClassName'.split( - '|' - ); + const fields = + 'NothingMattersHere|VF_APEX_CALL_START|NothingHereMatters|NothingHereMatters notinvoke(method)|ClassName'.split( + '|' + ); expect(FrameStateUtil.computeFrameName(fields)).to.equal('ClassName'); }); it('EVENT_VF_APEX_CALL_END nothing parsed if not invoke', () => { - const fields = 'NothingMattersHere|VF_APEX_CALL_END|NothingHereMatters|NothingHereMatters notinvoke(method)|ClassName'.split( - '|' - ); + const fields = + 'NothingMattersHere|VF_APEX_CALL_END|NothingHereMatters|NothingHereMatters notinvoke(method)|ClassName'.split( + '|' + ); expect(FrameStateUtil.computeFrameName(fields)).to.equal('ClassName'); }); }); @@ -119,52 +83,36 @@ describe('Frame state utilities', () => { // Positive match cases - all should return true it('Bare Minimum Get Match returns true', () => { const logLinePiece = ' get(ThisPartOfTheStringShouldNotMatter)'; - expect( - FrameStateUtil.isExtraneousVFGetterOrSetterLogLine(logLinePiece) - ).to.equal(true); + expect(FrameStateUtil.isExtraneousVFGetterOrSetterLogLine(logLinePiece)).to.equal(true); }); it('Bare Minimum Set Match returns true', () => { const logLinePiece = ' set(ThisPartOfTheStringShouldNotMatter)'; - expect( - FrameStateUtil.isExtraneousVFGetterOrSetterLogLine(logLinePiece) - ).to.equal(true); + expect(FrameStateUtil.isExtraneousVFGetterOrSetterLogLine(logLinePiece)).to.equal(true); }); it('Non-invoke Get should return true', () => { const logLinePiece = 'ThisPartOfTheStringShouldNotMatter get(ThisPartOfTheStringShouldNotMatter)'; - expect( - FrameStateUtil.isExtraneousVFGetterOrSetterLogLine(logLinePiece) - ).to.equal(true); + expect(FrameStateUtil.isExtraneousVFGetterOrSetterLogLine(logLinePiece)).to.equal(true); }); it('Non-invoke Set should return true', () => { const logLinePiece = 'ThisPartOfTheStringShouldNotMatter set(ThisPartOfTheStringShouldNotMatter)'; - expect( - FrameStateUtil.isExtraneousVFGetterOrSetterLogLine(logLinePiece) - ).to.equal(true); + expect(FrameStateUtil.isExtraneousVFGetterOrSetterLogLine(logLinePiece)).to.equal(true); }); // Negative match cases - all should return false it('Malformed set returns false', () => { const logLinePiece = 'set(ThisPartOfTheStringShouldNotMatter)'; - expect( - FrameStateUtil.isExtraneousVFGetterOrSetterLogLine(logLinePiece) - ).to.equal(false); + expect(FrameStateUtil.isExtraneousVFGetterOrSetterLogLine(logLinePiece)).to.equal(false); }); it('Malformed get returns false', () => { const logLinePiece = 'get(ThisPartOfTheStringShouldNotMatter)'; - expect( - FrameStateUtil.isExtraneousVFGetterOrSetterLogLine(logLinePiece) - ).to.equal(false); + expect(FrameStateUtil.isExtraneousVFGetterOrSetterLogLine(logLinePiece)).to.equal(false); }); it('Anything not Get/Set should return false', () => { const logLinePiece = 'ThisPartOfTheStringShouldNotMatter notgetorset(ThisPartOfTheStringShouldNotMatter)'; - expect( - FrameStateUtil.isExtraneousVFGetterOrSetterLogLine(logLinePiece) - ).to.equal(false); + expect(FrameStateUtil.isExtraneousVFGetterOrSetterLogLine(logLinePiece)).to.equal(false); }); it('Non-Get/Set should return false', () => { const logLinePiece = 'ThisPartOfTheStringShouldNotMatter invoke(ThisPartOfTheStringShouldNotMatter)'; - expect( - FrameStateUtil.isExtraneousVFGetterOrSetterLogLine(logLinePiece) - ).to.equal(false); + expect(FrameStateUtil.isExtraneousVFGetterOrSetterLogLine(logLinePiece)).to.equal(false); }); }); }); diff --git a/packages/salesforcedx-apex-replay-debugger/test/unit/states/logEntryState.test.ts b/packages/salesforcedx-apex-replay-debugger/test/unit/states/logEntryState.test.ts index cae91df380..0993704134 100644 --- a/packages/salesforcedx-apex-replay-debugger/test/unit/states/logEntryState.test.ts +++ b/packages/salesforcedx-apex-replay-debugger/test/unit/states/logEntryState.test.ts @@ -7,10 +7,7 @@ import { expect } from 'chai'; import * as sinon from 'sinon'; -import { - ApexReplayDebug, - LaunchRequestArguments -} from '../../../src/adapter/apexReplayDebug'; +import { ApexReplayDebug, LaunchRequestArguments } from '../../../src/adapter/apexReplayDebug'; import { LogContext, LogContextUtil } from '../../../src/core'; import { LogEntryState } from '../../../src/states'; @@ -19,9 +16,7 @@ describe('LogEntry event', () => { let readLogFileStub: sinon.SinonStub; beforeEach(() => { - readLogFileStub = sinon - .stub(LogContextUtil.prototype, 'readLogFile') - .returns(['line1', 'line2']); + readLogFileStub = sinon.stub(LogContextUtil.prototype, 'readLogFile').returns(['line1', 'line2']); }); afterEach(() => { diff --git a/packages/salesforcedx-apex-replay-debugger/test/unit/states/noOpState.test.ts b/packages/salesforcedx-apex-replay-debugger/test/unit/states/noOpState.test.ts index 2ca3f4cf38..72477da78d 100644 --- a/packages/salesforcedx-apex-replay-debugger/test/unit/states/noOpState.test.ts +++ b/packages/salesforcedx-apex-replay-debugger/test/unit/states/noOpState.test.ts @@ -6,10 +6,7 @@ */ import { expect } from 'chai'; -import { - ApexReplayDebug, - LaunchRequestArguments -} from '../../../src/adapter/apexReplayDebug'; +import { ApexReplayDebug, LaunchRequestArguments } from '../../../src/adapter/apexReplayDebug'; import { LogContext } from '../../../src/core'; import { NoOpState } from '../../../src/states'; diff --git a/packages/salesforcedx-apex-replay-debugger/test/unit/states/statementExecuteState.test.ts b/packages/salesforcedx-apex-replay-debugger/test/unit/states/statementExecuteState.test.ts index 43211bc3be..d98308fe68 100644 --- a/packages/salesforcedx-apex-replay-debugger/test/unit/states/statementExecuteState.test.ts +++ b/packages/salesforcedx-apex-replay-debugger/test/unit/states/statementExecuteState.test.ts @@ -7,10 +7,7 @@ import { StackFrame } from '@vscode/debugadapter'; import { expect } from 'chai'; -import { - ApexReplayDebug, - LaunchRequestArguments -} from '../../../src/adapter/apexReplayDebug'; +import { ApexReplayDebug, LaunchRequestArguments } from '../../../src/adapter/apexReplayDebug'; import { EXEC_ANON_SIGNATURE } from '../../../src/constants'; import { LogContext } from '../../../src/core'; import { StatementExecuteState } from '../../../src/states'; diff --git a/packages/salesforcedx-apex-replay-debugger/test/unit/states/userDebugState.test.ts b/packages/salesforcedx-apex-replay-debugger/test/unit/states/userDebugState.test.ts index 5815fdd6ce..9b3ab7eeb2 100644 --- a/packages/salesforcedx-apex-replay-debugger/test/unit/states/userDebugState.test.ts +++ b/packages/salesforcedx-apex-replay-debugger/test/unit/states/userDebugState.test.ts @@ -9,10 +9,7 @@ import { Source, StackFrame } from '@vscode/debugadapter'; import { expect } from 'chai'; import { EOL } from 'os'; import * as sinon from 'sinon'; -import { - ApexReplayDebug, - LaunchRequestArguments -} from '../../../src/adapter/apexReplayDebug'; +import { ApexReplayDebug, LaunchRequestArguments } from '../../../src/adapter/apexReplayDebug'; import { EXEC_ANON_SIGNATURE } from '../../../src/constants'; import { LogContext } from '../../../src/core'; import { UserDebugState } from '../../../src/states'; @@ -32,10 +29,7 @@ describe('User debug event', () => { beforeEach(() => { context = new LogContext(launchRequestArgs, new ApexReplayDebug()); - warnToDebugConsoleStub = sinon.stub( - ApexReplayDebug.prototype, - 'warnToDebugConsole' - ); + warnToDebugConsoleStub = sinon.stub(ApexReplayDebug.prototype, 'warnToDebugConsole'); getLogLinesStub = sinon .stub(LogContext.prototype, 'getLogLines') .returns(['foo', 'bar', 'timestamp|USER_DEBUG|[3]|DEBUG|Next message']); @@ -47,13 +41,7 @@ describe('User debug event', () => { }); it('Should not print without any frames', () => { - const state = new UserDebugState([ - 'timestamp', - 'USER_DEBUG', - '2', - 'DEBUG', - 'Hello' - ]); + const state = new UserDebugState(['timestamp', 'USER_DEBUG', '2', 'DEBUG', 'Hello']); expect(state.handle(context)).to.be.false; expect(context.getFrames()).to.be.empty; @@ -67,21 +55,11 @@ describe('User debug event', () => { } as StackFrame; context.getFrames().push(frame); context.getExecAnonScriptMapping().set(2, 5); - const state = new UserDebugState([ - 'timestamp', - 'USER_DEBUG', - '2', - 'DEBUG', - 'Hello' - ]); + const state = new UserDebugState(['timestamp', 'USER_DEBUG', '2', 'DEBUG', 'Hello']); expect(state.handle(context)).to.be.false; expect(warnToDebugConsoleStub.calledOnce).to.be.true; - expect(warnToDebugConsoleStub.getCall(0).args).to.have.same.members([ - `Hello${EOL}foo${EOL}bar`, - frame.source, - 5 - ]); + expect(warnToDebugConsoleStub.getCall(0).args).to.have.same.members([`Hello${EOL}foo${EOL}bar`, frame.source, 5]); }); it('Should use line number in log line', () => { @@ -90,20 +68,10 @@ describe('User debug event', () => { source: new Source('foo.log') } as StackFrame; context.getFrames().push(frame); - const state = new UserDebugState([ - 'timestamp', - 'USER_DEBUG', - '2', - 'DEBUG', - 'Hello' - ]); + const state = new UserDebugState(['timestamp', 'USER_DEBUG', '2', 'DEBUG', 'Hello']); expect(state.handle(context)).to.be.false; expect(warnToDebugConsoleStub.calledOnce).to.be.true; - expect(warnToDebugConsoleStub.getCall(0).args).to.have.same.members([ - `Hello${EOL}foo${EOL}bar`, - frame.source, - 2 - ]); + expect(warnToDebugConsoleStub.getCall(0).args).to.have.same.members([`Hello${EOL}foo${EOL}bar`, frame.source, 2]); }); }); diff --git a/packages/salesforcedx-apex-replay-debugger/test/unit/states/variableAssignmentState.test.ts b/packages/salesforcedx-apex-replay-debugger/test/unit/states/variableAssignmentState.test.ts index e77861ad03..3bf560364b 100644 --- a/packages/salesforcedx-apex-replay-debugger/test/unit/states/variableAssignmentState.test.ts +++ b/packages/salesforcedx-apex-replay-debugger/test/unit/states/variableAssignmentState.test.ts @@ -15,11 +15,7 @@ import { VariableContainer } from '../../../src/adapter/apexReplayDebug'; import { LogContext } from '../../../src/core'; -import { - FrameEntryState, - VariableAssignmentState, - VariableBeginState -} from '../../../src/states'; +import { FrameEntryState, VariableAssignmentState, VariableBeginState } from '../../../src/states'; // tslint:disable:no-unused-expression describe('Variable assignment event', () => { @@ -36,34 +32,23 @@ describe('Variable assignment event', () => { describe('Primitive assignment', () => { const STATIC_PRIMITIVE_VARIABLE_SCOPE_BEGIN = 'fakeTime|VARIABLE_SCOPE_BEGIN|[38]|signature.staticInteger|Integer|false|true'; - const LOCAL_PRIMITIVE_VARIABLE_SCOPE_BEGIN = - 'fakeTime|VARIABLE_SCOPE_BEGIN|[38]|localInteger|Integer|false|false'; - const STATIC_PRIMITIVE_VARIABLE_ASSIGNMENT = - 'fakeTime|VARIABLE_ASSIGNMENT|[5]|signature.staticInteger|5'; - const LOCAL_PRIMITIVE_VARIABLE_ASSIGNMENT = - 'fakeTime|VARIABLE_ASSIGNMENT|[5]|localInteger|0'; + const LOCAL_PRIMITIVE_VARIABLE_SCOPE_BEGIN = 'fakeTime|VARIABLE_SCOPE_BEGIN|[38]|localInteger|Integer|false|false'; + const STATIC_PRIMITIVE_VARIABLE_ASSIGNMENT = 'fakeTime|VARIABLE_ASSIGNMENT|[5]|signature.staticInteger|5'; + const LOCAL_PRIMITIVE_VARIABLE_ASSIGNMENT = 'fakeTime|VARIABLE_ASSIGNMENT|[5]|localInteger|0'; beforeEach(() => { // push frames on const state = new FrameEntryState(['signature']); context = new LogContext(launchRequestArgs, new ApexReplayDebug()); - context - .getFrames() - .push({ id: 0, name: 'execute_anonymous_apex' } as StackFrame); + context.getFrames().push({ id: 0, name: 'execute_anonymous_apex' } as StackFrame); expect(state.handle(context)).to.be.false; // add begin states for a local and static variable - let beginState = new VariableBeginState( - STATIC_PRIMITIVE_VARIABLE_SCOPE_BEGIN.split('|') - ); + let beginState = new VariableBeginState(STATIC_PRIMITIVE_VARIABLE_SCOPE_BEGIN.split('|')); beginState.handle(context); - beginState = new VariableBeginState( - LOCAL_PRIMITIVE_VARIABLE_SCOPE_BEGIN.split('|') - ); + beginState = new VariableBeginState(LOCAL_PRIMITIVE_VARIABLE_SCOPE_BEGIN.split('|')); beginState.handle(context); - getUriFromSignatureStub = sinon - .stub(LogContext.prototype, 'getUriFromSignature') - .returns(uriFromSignature); + getUriFromSignatureStub = sinon.stub(LogContext.prototype, 'getUriFromSignature').returns(uriFromSignature); }); afterEach(() => { @@ -71,46 +56,26 @@ describe('Variable assignment event', () => { }); it('Should assign static variable for class', () => { - const state = new VariableAssignmentState( - STATIC_PRIMITIVE_VARIABLE_ASSIGNMENT.split('|') - ); + const state = new VariableAssignmentState(STATIC_PRIMITIVE_VARIABLE_ASSIGNMENT.split('|')); // expect unassigned beforehand - expect(context.getStaticVariablesClassMap().get('signature')).to.have.key( - 'staticInteger' - ); - expect( - context - .getStaticVariablesClassMap() - .get('signature')! - .get('staticInteger') - ).to.include({ + expect(context.getStaticVariablesClassMap().get('signature')).to.have.key('staticInteger'); + expect(context.getStaticVariablesClassMap().get('signature')!.get('staticInteger')).to.include({ name: 'staticInteger', value: 'null' }); state.handle(context); - expect(context.getStaticVariablesClassMap().get('signature')).to.have.key( - 'staticInteger' - ); - expect( - context - .getStaticVariablesClassMap() - .get('signature')! - .get('staticInteger') - ).to.include({ + expect(context.getStaticVariablesClassMap().get('signature')).to.have.key('staticInteger'); + expect(context.getStaticVariablesClassMap().get('signature')!.get('staticInteger')).to.include({ name: 'staticInteger', value: '5' }); }); it('Should add local variable to frame', () => { - const state = new VariableAssignmentState( - LOCAL_PRIMITIVE_VARIABLE_ASSIGNMENT.split('|') - ); + const state = new VariableAssignmentState(LOCAL_PRIMITIVE_VARIABLE_ASSIGNMENT.split('|')); // locals of frame should one entry - const frameInfo = context - .getFrameHandler() - .get(context.getTopFrame()!.id); + const frameInfo = context.getFrameHandler().get(context.getTopFrame()!.id); expect(frameInfo.locals).to.have.key('localInteger'); expect(frameInfo.locals.get('localInteger')).to.include({ name: 'localInteger', @@ -127,8 +92,7 @@ describe('Variable assignment event', () => { describe('Local nested assignment', () => { const DUMMY_REF = '0x00000000'; - const LOCAL_NESTED_VARIABLE_SCOPE_BEGIN = - 'fakeTime|VARIABLE_SCOPE_BEGIN|[8]|this|NestedClass|true|false'; + const LOCAL_NESTED_VARIABLE_SCOPE_BEGIN = 'fakeTime|VARIABLE_SCOPE_BEGIN|[8]|this|NestedClass|true|false'; const LOCAL_NESTED_VARIABLE_ASSIGNMENT = `fakeTime|VARIABLE_ASSIGNMENT|[8]|this|{}|${DUMMY_REF}`; const LOCAL_NESTED_JSON_VARIABLE_ASSIGNMENT = `fakeTime|VARIABLE_ASSIGNMENT|[8]|this|{"a":"0x37e2e22e","b1":BLOB(5 bytes),"b2":BLOB(50 bytes),"d":3.14,"m":"0xff6e2ff","s":"MyObject.s"}|${DUMMY_REF}`; const LOCAL_NESTED_INNER_VARIABLE_ASSIGNMENT = `fakeTime|VARIABLE_ASSIGNMENT|[12]|this.s|"MyObject.s"|${DUMMY_REF}`; @@ -137,18 +101,12 @@ describe('Variable assignment event', () => { // push frames on const state = new FrameEntryState(['signature']); context = new LogContext(launchRequestArgs, new ApexReplayDebug()); - context - .getFrames() - .push({ id: 0, name: 'execute_anonymous_apex' } as StackFrame); + context.getFrames().push({ id: 0, name: 'execute_anonymous_apex' } as StackFrame); expect(state.handle(context)).to.be.false; // add begin states for a local and static variable - const beginState = new VariableBeginState( - LOCAL_NESTED_VARIABLE_SCOPE_BEGIN.split('|') - ); + const beginState = new VariableBeginState(LOCAL_NESTED_VARIABLE_SCOPE_BEGIN.split('|')); beginState.handle(context); - getUriFromSignatureStub = sinon - .stub(LogContext.prototype, 'getUriFromSignature') - .returns(uriFromSignature); + getUriFromSignatureStub = sinon.stub(LogContext.prototype, 'getUriFromSignature').returns(uriFromSignature); }); afterEach(() => { @@ -156,12 +114,8 @@ describe('Variable assignment event', () => { }); it('Should create a nested variable for an empty object', () => { - const state = new VariableAssignmentState( - LOCAL_NESTED_VARIABLE_ASSIGNMENT.split('|') - ); - const frameInfo = context - .getFrameHandler() - .get(context.getTopFrame()!.id); + const state = new VariableAssignmentState(LOCAL_NESTED_VARIABLE_ASSIGNMENT.split('|')); + const frameInfo = context.getFrameHandler().get(context.getTopFrame()!.id); expect(frameInfo.locals).to.have.key('this'); const container = frameInfo.locals.get('this') as ApexVariableContainer; expect(container.variablesRef).to.equal(0); @@ -174,17 +128,11 @@ describe('Variable assignment event', () => { }); it('Should update variable to a nested variable if assigning to inner value', () => { - let state = new VariableAssignmentState( - LOCAL_NESTED_VARIABLE_ASSIGNMENT.split('|') - ); + let state = new VariableAssignmentState(LOCAL_NESTED_VARIABLE_ASSIGNMENT.split('|')); state.handle(context); - const frameInfo = context - .getFrameHandler() - .get(context.getTopFrame()!.id); + const frameInfo = context.getFrameHandler().get(context.getTopFrame()!.id); const container = frameInfo.locals.get('this') as ApexVariableContainer; - state = new VariableAssignmentState( - LOCAL_NESTED_INNER_VARIABLE_ASSIGNMENT.split('|') - ); + state = new VariableAssignmentState(LOCAL_NESTED_INNER_VARIABLE_ASSIGNMENT.split('|')); state.handle(context); expect(container.value).to.equal(''); expect(container.variablesRef).to.not.equal(0); @@ -196,49 +144,25 @@ describe('Variable assignment event', () => { value: "'MyObject.s'", evaluateName: "'MyObject.s'" }); - const innerContainer = container.variables.get( - 's' - ) as ApexVariableContainer; + const innerContainer = container.variables.get('s') as ApexVariableContainer; expect(innerContainer.value).to.equal("'MyObject.s'"); expect(innerContainer.variables).to.be.empty; expect(innerContainer.variablesRef).to.equal(0); }); it('Should update variable to a nested variable if json assignment', () => { - let state = new VariableAssignmentState( - LOCAL_NESTED_VARIABLE_ASSIGNMENT.split('|') - ); + let state = new VariableAssignmentState(LOCAL_NESTED_VARIABLE_ASSIGNMENT.split('|')); state.handle(context); - const frameInfo = context - .getFrameHandler() - .get(context.getTopFrame()!.id); + const frameInfo = context.getFrameHandler().get(context.getTopFrame()!.id); const container = frameInfo.locals.get('this') as ApexVariableContainer; - state = new VariableAssignmentState( - LOCAL_NESTED_JSON_VARIABLE_ASSIGNMENT.split('|') - ); + state = new VariableAssignmentState(LOCAL_NESTED_JSON_VARIABLE_ASSIGNMENT.split('|')); state.handle(context); expect(container.value).to.equal(''); expect(container.variablesRef).to.not.equal(0); - expect(container.variables).to.have.keys([ - 'a', - 'b1', - 'b2', - 'd', - 'm', - 's' - ]); - const VAR_VALUES = [ - "'0x37e2e22e'", - 'BLOB(5 bytes)', - 'BLOB(50 bytes)', - '3.14', - "'0xff6e2ff'", - "'MyObject.s'" - ]; + expect(container.variables).to.have.keys(['a', 'b1', 'b2', 'd', 'm', 's']); + const VAR_VALUES = ["'0x37e2e22e'", 'BLOB(5 bytes)', 'BLOB(50 bytes)', '3.14', "'0xff6e2ff'", "'MyObject.s'"]; ['a', 'b1', 'b2', 'd', 'm', 's'].forEach((element, index) => { - const innerContainer = container.variables.get( - element - ) as ApexVariableContainer; + const innerContainer = container.variables.get(element) as ApexVariableContainer; expect(innerContainer.value).to.equal(`${VAR_VALUES[index]}`); expect(innerContainer.variables).to.be.empty; expect(innerContainer.variablesRef).to.equal(0); @@ -246,24 +170,16 @@ describe('Variable assignment event', () => { }); it('Should update variable to a nested variable holding another nested variable if assigning json to inner value', () => { - let state = new VariableAssignmentState( - LOCAL_NESTED_VARIABLE_ASSIGNMENT.split('|') - ); + let state = new VariableAssignmentState(LOCAL_NESTED_VARIABLE_ASSIGNMENT.split('|')); state.handle(context); - const frameInfo = context - .getFrameHandler() - .get(context.getTopFrame()!.id); + const frameInfo = context.getFrameHandler().get(context.getTopFrame()!.id); const container = frameInfo.locals.get('this') as ApexVariableContainer; - state = new VariableAssignmentState( - LOCAL_NESTED_JSON_INNER_VARIABLE_ASSIGNMENT.split('|') - ); + state = new VariableAssignmentState(LOCAL_NESTED_JSON_INNER_VARIABLE_ASSIGNMENT.split('|')); state.handle(context); expect(container.value).to.equal(''); expect(container.variablesRef).to.not.equal(0); expect(container.variables).to.have.key('a'); - const innerContainer = container.variables.get( - 'a' - ) as ApexVariableContainer; + const innerContainer = container.variables.get('a') as ApexVariableContainer; const variables = innerContainer.getAllVariables(); expect(variables.length).to.equal(1); expect(variables[0]).to.include({ @@ -274,21 +190,15 @@ describe('Variable assignment event', () => { expect(innerContainer.value).to.equal(''); expect(innerContainer.variables).to.have.key('Name'); expect(innerContainer.variablesRef).to.not.equal(0); - const innerContainerVariable = innerContainer.variables.get( - 'Name' - ) as ApexVariableContainer; + const innerContainerVariable = innerContainer.variables.get('Name') as ApexVariableContainer; expect(innerContainerVariable.value).to.equal("'MyObjectAccount'"); expect(innerContainerVariable.variablesRef).to.equal(0); }); it('Should not overwrite the this variable once assigned', () => { - const state = new VariableAssignmentState( - LOCAL_NESTED_VARIABLE_ASSIGNMENT.split('|') - ); + const state = new VariableAssignmentState(LOCAL_NESTED_VARIABLE_ASSIGNMENT.split('|')); state.handle(context); - const frameInfo = context - .getFrameHandler() - .get(context.getTopFrame()!.id); + const frameInfo = context.getFrameHandler().get(context.getTopFrame()!.id); expect(frameInfo.locals).to.include.keys('this'); const container = frameInfo.locals.get('this') as ApexVariableContainer; const originalVariablesRef = container.variablesRef; @@ -308,8 +218,7 @@ describe('Variable assignment event', () => { const DUMMY_REF = '0x00000000'; const DUMMY_REF1 = '0x00000001'; const DUMMY_REF2 = '0x00000002'; - const STATIC_NESTED_VARIABLE_SCOPE_BEGIN = - 'fakeTime|VARIABLE_SCOPE_BEGIN|[6]|NestedClass.sa|Account|true|true'; + const STATIC_NESTED_VARIABLE_SCOPE_BEGIN = 'fakeTime|VARIABLE_SCOPE_BEGIN|[6]|NestedClass.sa|Account|true|true'; const STATIC_NESTED_VARIABLE_ASSIGNMENT = `fakeTime|VARIABLE_ASSIGNMENT|[6]|NestedClass.sa|{}|${DUMMY_REF}`; const STATIC_NESTED_JSON_VARIABLE_ASSIGNMENT = `fakeTime|VARIABLE_ASSIGNMENT|[8]|NestedClass.sa|{"Name":"testName"}|${DUMMY_REF}`; const STATIC_NESTED_INNER_VARIABLE_ASSIGNMENT = `fakeTime|VARIABLE_ASSIGNMENT|[12]|sa.Name|"testName2"|${DUMMY_REF}`; @@ -325,18 +234,12 @@ describe('Variable assignment event', () => { // push frames on const state = new FrameEntryState(['signature']); context = new LogContext(launchRequestArgs, new ApexReplayDebug()); - context - .getFrames() - .push({ id: 0, name: 'execute_anonymous_apex' } as StackFrame); + context.getFrames().push({ id: 0, name: 'execute_anonymous_apex' } as StackFrame); expect(state.handle(context)).to.be.false; // add begin states for a local and static variable - const beginState = new VariableBeginState( - STATIC_NESTED_VARIABLE_SCOPE_BEGIN.split('|') - ); + const beginState = new VariableBeginState(STATIC_NESTED_VARIABLE_SCOPE_BEGIN.split('|')); beginState.handle(context); - getUriFromSignatureStub = sinon - .stub(LogContext.prototype, 'getUriFromSignature') - .returns(uriFromSignature); + getUriFromSignatureStub = sinon.stub(LogContext.prototype, 'getUriFromSignature').returns(uriFromSignature); }); afterEach(() => { @@ -344,15 +247,10 @@ describe('Variable assignment event', () => { }); it('Should create a nested variable for an empty object', () => { - const state = new VariableAssignmentState( - STATIC_NESTED_VARIABLE_ASSIGNMENT.split('|') - ); + const state = new VariableAssignmentState(STATIC_NESTED_VARIABLE_ASSIGNMENT.split('|')); const staticMapping = context.getStaticVariablesClassMap(); expect(staticMapping).to.include.keys('NestedClass'); - const classMap = staticMapping.get('NestedClass') as Map< - string, - VariableContainer - >; + const classMap = staticMapping.get('NestedClass') as Map; expect(classMap).to.have.key('sa'); const container = classMap.get('sa')! as ApexVariableContainer; expect(container.variablesRef).to.equal(0); @@ -365,95 +263,64 @@ describe('Variable assignment event', () => { }); it('Should update variable to a nested variable if json assignment', () => { - let state = new VariableAssignmentState( - STATIC_NESTED_VARIABLE_ASSIGNMENT.split('|') - ); + let state = new VariableAssignmentState(STATIC_NESTED_VARIABLE_ASSIGNMENT.split('|')); state.handle(context); const staticMapping = context.getStaticVariablesClassMap(); expect(staticMapping).to.include.keys('NestedClass'); - const classMap = staticMapping.get('NestedClass') as Map< - string, - VariableContainer - >; + const classMap = staticMapping.get('NestedClass') as Map; expect(classMap).to.have.key('sa'); const container = classMap.get('sa')! as ApexVariableContainer; expect(container.variablesRef).to.not.equal(0); expect(container.variables).to.be.empty; expect(container.value).to.equal(''); - state = new VariableAssignmentState( - STATIC_NESTED_JSON_VARIABLE_ASSIGNMENT.split('|') - ); + state = new VariableAssignmentState(STATIC_NESTED_JSON_VARIABLE_ASSIGNMENT.split('|')); state.handle(context); expect(container.value).to.equal(''); expect(container.variablesRef).to.not.equal(0); expect(container.variables).to.have.key('Name'); - const innerContainer = container.variables.get( - 'Name' - ) as ApexVariableContainer; + const innerContainer = container.variables.get('Name') as ApexVariableContainer; expect(innerContainer.value).to.equal("'testName'"); }); it('Should update variable if inner variable assigned', () => { - let state = new VariableAssignmentState( - STATIC_NESTED_VARIABLE_ASSIGNMENT.split('|') - ); + let state = new VariableAssignmentState(STATIC_NESTED_VARIABLE_ASSIGNMENT.split('|')); state.handle(context); const staticMapping = context.getStaticVariablesClassMap(); expect(staticMapping).to.include.keys('NestedClass'); - const classMap = staticMapping.get('NestedClass') as Map< - string, - VariableContainer - >; + const classMap = staticMapping.get('NestedClass') as Map; expect(classMap).to.have.key('sa'); const container = classMap.get('sa')! as ApexVariableContainer; expect(container.variablesRef).to.not.equal(0); expect(container.variables).to.be.empty; expect(container.value).to.equal(''); - state = new VariableAssignmentState( - STATIC_NESTED_INNER_VARIABLE_ASSIGNMENT.split('|') - ); + state = new VariableAssignmentState(STATIC_NESTED_INNER_VARIABLE_ASSIGNMENT.split('|')); state.handle(context); expect(container.variablesRef).to.not.equal(0); expect(container.value).to.equal(''); expect(container.variables).to.have.key('Name'); - const innerContainer = container.variables.get( - 'Name' - ) as ApexVariableContainer; + const innerContainer = container.variables.get('Name') as ApexVariableContainer; expect(innerContainer.value).to.equal("'testName2'"); }); it('Should update variable if reassigned to newly created reference', () => { - let beginState = new VariableBeginState( - STATIC_NESTED_REASSIGNMENT_BEGIN.split('|') - ); + let beginState = new VariableBeginState(STATIC_NESTED_REASSIGNMENT_BEGIN.split('|')); beginState.handle(context); - beginState = new VariableBeginState( - STATIC_NESTED_REASSIGNMENT_BEGIN1.split('|') - ); + beginState = new VariableBeginState(STATIC_NESTED_REASSIGNMENT_BEGIN1.split('|')); beginState.handle(context); - let state = new VariableAssignmentState( - STATIC_NESTED_REASSIGNMENT.split('|') - ); + let state = new VariableAssignmentState(STATIC_NESTED_REASSIGNMENT.split('|')); state.handle(context); - state = new VariableAssignmentState( - STATIC_NESTED_REASSIGNMENT2.split('|') - ); + state = new VariableAssignmentState(STATIC_NESTED_REASSIGNMENT2.split('|')); state.handle(context); const staticMapping = context.getStaticVariablesClassMap(); expect(staticMapping).to.include.keys('NestedClass'); - const classMap = staticMapping.get('NestedClass') as Map< - string, - VariableContainer - >; + const classMap = staticMapping.get('NestedClass') as Map; expect(classMap).to.include.keys('staticAcc1', 'staticAcc2'); let acc1Container = classMap.get('staticAcc1')! as ApexVariableContainer; let acc2Container = classMap.get('staticAcc2')! as ApexVariableContainer; expect(acc1Container.variables).to.equal(acc2Container.variables); - state = new VariableAssignmentState( - STATIC_NESTED_REASSIGNMENT3.split('|') - ); + state = new VariableAssignmentState(STATIC_NESTED_REASSIGNMENT3.split('|')); state.handle(context); acc1Container = classMap.get('staticAcc1')! as ApexVariableContainer; acc2Container = classMap.get('staticAcc2')! as ApexVariableContainer; @@ -464,8 +331,7 @@ describe('Variable assignment event', () => { describe('Find references in reference map', () => { const PARENT_REF = '0x000000'; const CHILD_REF = '0x000001'; - const PARENT_VARIABLE_BEGIN = - 'fakeTime|VARIABLE_SCOPE_BEGIN|[17]|this|NestedClass|true|false'; + const PARENT_VARIABLE_BEGIN = 'fakeTime|VARIABLE_SCOPE_BEGIN|[17]|this|NestedClass|true|false'; const CHILD_VARIABLE_ASSIGNMENT = `fakeTime|VARIABLE_ASSIGNMENT|[11]|this.Name|"MyObjectAccount"|${CHILD_REF}`; const PARENT_JSON_VARIABLE_ASSIGNMENT = `fakeTime|VARIABLE_ASSIGNMENT|[17]|this|{"a":"${CHILD_REF}"}|${PARENT_REF}`; const PARENT_VARIABLE_ASSIGNMENT = `fakeTime|VARIABLE_ASSIGNMENT|[10]|this.m|${CHILD_REF}|${PARENT_REF}`; @@ -475,34 +341,20 @@ describe('Variable assignment event', () => { // push frames on const state = new FrameEntryState(['signature']); context = new LogContext(launchRequestArgs, new ApexReplayDebug()); - context - .getFrames() - .push({ id: 0, name: 'execute_anonymous_apex' } as StackFrame); + context.getFrames().push({ id: 0, name: 'execute_anonymous_apex' } as StackFrame); expect(state.handle(context)).to.be.false; // add begin states for a local and static variable - let assignState = new VariableAssignmentState( - CHILD_VARIABLE_ASSIGNMENT.split('|') - ); + let assignState = new VariableAssignmentState(CHILD_VARIABLE_ASSIGNMENT.split('|')); assignState.handle(context); - const beginState = new VariableBeginState( - PARENT_VARIABLE_BEGIN.split('|') - ); - assignState = new VariableAssignmentState( - PARENT_JSON_VARIABLE_ASSIGNMENT.split('|') - ); + const beginState = new VariableBeginState(PARENT_VARIABLE_BEGIN.split('|')); + assignState = new VariableAssignmentState(PARENT_JSON_VARIABLE_ASSIGNMENT.split('|')); beginState.handle(context); assignState.handle(context); - assignState = new VariableAssignmentState( - PARENT_VARIABLE_ASSIGNMENT.split('|') - ); + assignState = new VariableAssignmentState(PARENT_VARIABLE_ASSIGNMENT.split('|')); assignState.handle(context); - assignState = new VariableAssignmentState( - PARENT_VARIABLE_ASSIGNMENT2.split('|') - ); + assignState = new VariableAssignmentState(PARENT_VARIABLE_ASSIGNMENT2.split('|')); assignState.handle(context); - getUriFromSignatureStub = sinon - .stub(LogContext.prototype, 'getUriFromSignature') - .returns(uriFromSignature); + getUriFromSignatureStub = sinon.stub(LogContext.prototype, 'getUriFromSignature').returns(uriFromSignature); }); afterEach(() => { @@ -511,39 +363,25 @@ describe('Variable assignment event', () => { it('Should be able to pull reference values from json in assignments', () => { expect(context.getRefsMap()).to.have.keys(PARENT_REF, CHILD_REF); - const container = context - .getRefsMap() - .get(PARENT_REF) as ApexVariableContainer; - const childRefContainer = context - .getRefsMap() - .get(CHILD_REF) as ApexVariableContainer; + const container = context.getRefsMap().get(PARENT_REF) as ApexVariableContainer; + const childRefContainer = context.getRefsMap().get(CHILD_REF) as ApexVariableContainer; expect(container.variables).to.include.keys('a'); const childParentContainer = container.variables.get('a')!; - expect(childParentContainer.variables).to.equal( - childRefContainer.variables - ); + expect(childParentContainer.variables).to.equal(childRefContainer.variables); }); it('Should be able to pull reference from assignment value', () => { expect(context.getRefsMap()).to.have.keys(PARENT_REF, CHILD_REF); - const container = context - .getRefsMap() - .get(PARENT_REF) as ApexVariableContainer; - const childRefContainer = context - .getRefsMap() - .get(CHILD_REF) as ApexVariableContainer; + const container = context.getRefsMap().get(PARENT_REF) as ApexVariableContainer; + const childRefContainer = context.getRefsMap().get(CHILD_REF) as ApexVariableContainer; expect(container.variables).to.include.keys('m'); const childParentContainer = container.variables.get('m')!; - expect(childParentContainer.variables).to.equal( - childRefContainer.variables - ); + expect(childParentContainer.variables).to.equal(childRefContainer.variables); }); it('Should change both variable containers if they share a common reference', () => { expect(context.getRefsMap()).to.have.keys(PARENT_REF, CHILD_REF); - const container = context - .getRefsMap() - .get(PARENT_REF) as ApexVariableContainer; + const container = context.getRefsMap().get(PARENT_REF) as ApexVariableContainer; expect(container.variables).to.include.keys('m'); const mContainer = container.variables.get('m')! as ApexVariableContainer; expect(container.variables).to.include.keys('n'); @@ -555,12 +393,8 @@ describe('Variable assignment event', () => { state.handle(context); expect(mContainer.variables).to.include.keys('Name'); expect(nContainer.variables).to.include.keys('Name'); - const nSubContainer = nContainer.variables.get( - 'Name' - ) as ApexVariableContainer; - const mSubContainer = mContainer.variables.get( - 'Name' - ) as ApexVariableContainer; + const nSubContainer = nContainer.variables.get('Name') as ApexVariableContainer; + const mSubContainer = mContainer.variables.get('Name') as ApexVariableContainer; expect(mSubContainer.value).to.equal("'both are updated'"); expect(nSubContainer.value).to.equal("'both are updated'"); }); @@ -572,31 +406,24 @@ describe('Variable assignment event', () => { const DUMMY_REF3 = '0x00000002'; const MAP_VALUE = '{"1":{"a1":"0x3cc65531","m2":"0x25ba7599","s1":"MyObject.s2"},"2":{"a1":"0x603ac3f0","m2":"0x594a2142","s1":"MyObject.s2"}}'; - const MAP_BEGIN = - '00:55:54.84 (116142294)|VARIABLE_SCOPE_BEGIN|[24]|amap|Map|true|false'; + const MAP_BEGIN = '00:55:54.84 (116142294)|VARIABLE_SCOPE_BEGIN|[24]|amap|Map|true|false'; const MAP_ASSIGNMENT = `00:55:54.84 (116191871)|VARIABLE_ASSIGNMENT|[24]|amap|${MAP_VALUE}|${DUMMY_REF}`; const LIST_VALUE = '[{"a1":"0x2f9c0fba","m2":"0xdc12056","s1":"MyObject.s2"},{"a1":"0xcdd88c9","m2":"0x6f90123a","s1":"MyObject.s2"}]'; - const LIST_BEGIN = - '09:43:08.67 (106919036)|VARIABLE_SCOPE_BEGIN|[30]|alist|List|true|false'; + const LIST_BEGIN = '09:43:08.67 (106919036)|VARIABLE_SCOPE_BEGIN|[30]|alist|List|true|false'; const LIST_ASSIGNMENT = `09:43:08.67 (107017879)|VARIABLE_ASSIGNMENT|[30]|alist|${LIST_VALUE}|${DUMMY_REF2}`; const SET_VALUE = '[{"a1":"0x40dd809d","m2":"0x71c42b4c","s1":"MyObject.s2"},{"a1":"0x46867f90","m2":"0x4f675045","s1":"MyObject.s2"}]'; - const SET_BEGIN = - '09:43:08.67 (107041268)|VARIABLE_SCOPE_BEGIN|[30]|aset|Set|true|false'; + const SET_BEGIN = '09:43:08.67 (107041268)|VARIABLE_SCOPE_BEGIN|[30]|aset|Set|true|false'; const SET_ASSIGNMENT = `09:43:08.67 (107119928)|VARIABLE_ASSIGNMENT|[30]|aset|${SET_VALUE}|${DUMMY_REF3}`; beforeEach(() => { // push frames on const state = new FrameEntryState(['signature']); context = new LogContext(launchRequestArgs, new ApexReplayDebug()); - context - .getFrames() - .push({ id: 0, name: 'execute_anonymous_apex' } as StackFrame); + context.getFrames().push({ id: 0, name: 'execute_anonymous_apex' } as StackFrame); expect(state.handle(context)).to.be.false; - getUriFromSignatureStub = sinon - .stub(LogContext.prototype, 'getUriFromSignature') - .returns(uriFromSignature); + getUriFromSignatureStub = sinon.stub(LogContext.prototype, 'getUriFromSignature').returns(uriFromSignature); }); afterEach(() => { @@ -608,9 +435,7 @@ describe('Variable assignment event', () => { begin.handle(context); const assign = new VariableAssignmentState(MAP_ASSIGNMENT.split('|')); assign.handle(context); - const frameInfo = context - .getFrameHandler() - .get(context.getTopFrame()!.id); + const frameInfo = context.getFrameHandler().get(context.getTopFrame()!.id); expect(frameInfo.locals).to.include.keys('amap'); const container = frameInfo.locals.get('amap') as ApexVariableContainer; expect(container.value).to.equal(MAP_VALUE); @@ -623,9 +448,7 @@ describe('Variable assignment event', () => { begin.handle(context); const assign = new VariableAssignmentState(LIST_ASSIGNMENT.split('|')); assign.handle(context); - const frameInfo = context - .getFrameHandler() - .get(context.getTopFrame()!.id); + const frameInfo = context.getFrameHandler().get(context.getTopFrame()!.id); expect(frameInfo.locals).to.include.keys('alist'); const container = frameInfo.locals.get('alist') as ApexVariableContainer; expect(container.value).to.equal(LIST_VALUE); @@ -638,9 +461,7 @@ describe('Variable assignment event', () => { begin.handle(context); const assign = new VariableAssignmentState(SET_ASSIGNMENT.split('|')); assign.handle(context); - const frameInfo = context - .getFrameHandler() - .get(context.getTopFrame()!.id); + const frameInfo = context.getFrameHandler().get(context.getTopFrame()!.id); expect(frameInfo.locals).to.include.keys('aset'); const container = frameInfo.locals.get('aset') as ApexVariableContainer; expect(container.value).to.equal(SET_VALUE); diff --git a/packages/salesforcedx-apex-replay-debugger/test/unit/states/variableBeginState.test.ts b/packages/salesforcedx-apex-replay-debugger/test/unit/states/variableBeginState.test.ts index c4326f7457..a7d82a2d83 100644 --- a/packages/salesforcedx-apex-replay-debugger/test/unit/states/variableBeginState.test.ts +++ b/packages/salesforcedx-apex-replay-debugger/test/unit/states/variableBeginState.test.ts @@ -9,11 +9,7 @@ import { StackFrame } from '@vscode/debugadapter'; import { expect } from 'chai'; import * as sinon from 'sinon'; import Uri from 'vscode-uri'; -import { - ApexReplayDebug, - ApexVariable, - LaunchRequestArguments -} from '../../../src/adapter/apexReplayDebug'; +import { ApexReplayDebug, ApexVariable, LaunchRequestArguments } from '../../../src/adapter/apexReplayDebug'; import { LogContext } from '../../../src/core'; import { FrameEntryState, VariableBeginState } from '../../../src/states'; @@ -29,21 +25,15 @@ describe('Variable begin scope event', () => { trace: true, projectPath: undefined }; - const STATIC_VARIABLE_LOG_LINE = - 'fakeTime|VARIABLE_SCOPE_BEGIN|[38]|fakeClass.staticInteger|Integer|false|true'; - const LOCAL_VARIABLE_LOG_LINE = - 'fakeTime|VARIABLE_SCOPE_BEGIN|[38]|localInteger|Integer|false|false'; + const STATIC_VARIABLE_LOG_LINE = 'fakeTime|VARIABLE_SCOPE_BEGIN|[38]|fakeClass.staticInteger|Integer|false|true'; + const LOCAL_VARIABLE_LOG_LINE = 'fakeTime|VARIABLE_SCOPE_BEGIN|[38]|localInteger|Integer|false|false'; let map: Map>; beforeEach(() => { map = new Map>(); map.set('fakeClass', new Map()); - getUriFromSignatureStub = sinon - .stub(LogContext.prototype, 'getUriFromSignature') - .returns(uriFromSignature); - getStaticMapStub = sinon - .stub(LogContext.prototype, 'getStaticVariablesClassMap') - .returns(map); + getUriFromSignatureStub = sinon.stub(LogContext.prototype, 'getUriFromSignature').returns(uriFromSignature); + getStaticMapStub = sinon.stub(LogContext.prototype, 'getStaticVariablesClassMap').returns(map); }); afterEach(() => { @@ -52,30 +42,20 @@ describe('Variable begin scope event', () => { }); it('Should add static variable to frame', () => { - const entryState = new VariableBeginState( - STATIC_VARIABLE_LOG_LINE.split('|') - ); + const entryState = new VariableBeginState(STATIC_VARIABLE_LOG_LINE.split('|')); const context = new LogContext(launchRequestArgs, new ApexReplayDebug()); - context - .getFrames() - .push({ id: 0, name: 'execute_anonymous_apex' } as StackFrame); + context.getFrames().push({ id: 0, name: 'execute_anonymous_apex' } as StackFrame); expect(entryState.handle(context)).to.be.false; expect(context.getStaticVariablesClassMap().has('fakeClass')).to.be.true; - expect( - context.getStaticVariablesClassMap().get('fakeClass')!.size - ).to.equal(1); - expect(context.getStaticVariablesClassMap().get('fakeClass')).to.have.key( - 'staticInteger' - ); + expect(context.getStaticVariablesClassMap().get('fakeClass')!.size).to.equal(1); + expect(context.getStaticVariablesClassMap().get('fakeClass')).to.have.key('staticInteger'); }); it('Should add local variable to frame', () => { const state = new FrameEntryState(['signature']); const context = new LogContext(launchRequestArgs, new ApexReplayDebug()); - context - .getFrames() - .push({ id: 0, name: 'execute_anonymous_apex' } as StackFrame); + context.getFrames().push({ id: 0, name: 'execute_anonymous_apex' } as StackFrame); expect(state.handle(context)).to.be.false; @@ -92,9 +72,7 @@ describe('Variable begin scope event', () => { sourceReference: 0 } } as StackFrame); - const entryState = new VariableBeginState( - LOCAL_VARIABLE_LOG_LINE.split('|') - ); + const entryState = new VariableBeginState(LOCAL_VARIABLE_LOG_LINE.split('|')); expect(entryState.handle(context)).to.be.false; const id = context.getTopFrame()!.id; const frameInfo = context.getFrameHandler().get(id); @@ -107,21 +85,13 @@ describe('Variable begin scope event', () => { }); it('Should create class entry in static variable map when class has not been seen before', () => { - const entryState = new VariableBeginState( - STATIC_VARIABLE_LOG_LINE.split('|') - ); + const entryState = new VariableBeginState(STATIC_VARIABLE_LOG_LINE.split('|')); const context = new LogContext(launchRequestArgs, new ApexReplayDebug()); - context - .getFrames() - .push({ id: 0, name: 'execute_anonymous_apex' } as StackFrame); + context.getFrames().push({ id: 0, name: 'execute_anonymous_apex' } as StackFrame); expect(entryState.handle(context)).to.be.false; expect(context.getStaticVariablesClassMap().has('fakeClass')).to.be.true; - expect( - context.getStaticVariablesClassMap().get('fakeClass')!.size - ).to.equal(1); - expect(context.getStaticVariablesClassMap().get('fakeClass')).to.have.key( - 'staticInteger' - ); + expect(context.getStaticVariablesClassMap().get('fakeClass')!.size).to.equal(1); + expect(context.getStaticVariablesClassMap().get('fakeClass')).to.have.key('staticInteger'); }); }); diff --git a/packages/salesforcedx-sobjects-faux-generator/.eslintignore b/packages/salesforcedx-sobjects-faux-generator/.eslintignore deleted file mode 100644 index 50252d2f09..0000000000 --- a/packages/salesforcedx-sobjects-faux-generator/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -scripts/** -coverage/** diff --git a/packages/salesforcedx-sobjects-faux-generator/.eslintrc.json b/packages/salesforcedx-sobjects-faux-generator/.eslintrc.json deleted file mode 100644 index a8b986b195..0000000000 --- a/packages/salesforcedx-sobjects-faux-generator/.eslintrc.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "root": true, - "extends": ["../../config/base-eslintrc.json", "./fix-these-rules.json"], - "overrides": [ - { - "files": ["./src/**/*.ts", "./test/**/*.ts"], - "parserOptions": { - "project": "./tsconfig.json" - } - } - ] -} diff --git a/packages/salesforcedx-sobjects-faux-generator/fix-these-rules.json b/packages/salesforcedx-sobjects-faux-generator/fix-these-rules.json deleted file mode 100644 index 2fcdab4856..0000000000 --- a/packages/salesforcedx-sobjects-faux-generator/fix-these-rules.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "rules": { - "prefer-arrow/prefer-arrow-functions": ["error", {}], - "@typescript-eslint/no-misused-promises": "warn", - "@typescript-eslint/no-unsafe-argument": "warn", - "@typescript-eslint/no-unsafe-assignment": "warn", - "@typescript-eslint/no-unsafe-call": "warn", - "@typescript-eslint/no-unsafe-member-access": "warn", - "@typescript-eslint/no-unsafe-return": "warn", - "@typescript-eslint/prefer-for-of": "warn", - "@typescript-eslint/require-await": "warn", - "@typescript-eslint/unbound-method": "warn" - } -} diff --git a/packages/salesforcedx-sobjects-faux-generator/package.json b/packages/salesforcedx-sobjects-faux-generator/package.json index 7451ba1091..bda8fe5ed9 100644 --- a/packages/salesforcedx-sobjects-faux-generator/package.json +++ b/packages/salesforcedx-sobjects-faux-generator/package.json @@ -6,7 +6,7 @@ "publisher": "salesforce", "license": "BSD-3-Clause", "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" }, "main": "out/src", "dependencies": { @@ -19,32 +19,22 @@ "@types/chai": "4.3.3", "@types/jest": "^29.5.5", "@types/mocha": "^5", - "@types/node": "^18.11.9", + "@types/node": "^20.0.0", "@types/rimraf": "^3.0.2", "@types/shelljs": "0.7.4", "@types/sinon": "^2.3.7", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", "chai": "^4.0.2", "cross-env": "5.2.0", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest": "27.5.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", "jest": "^29.7.0", "jest-junit": "14.0.1", "mocha": "^10", "mocha-junit-reporter": "^1.23.3", "mocha-multi-reporters": "^1.1.7", - "prettier": "3.0.3", + "prettier": "3.3.3", "sinon": "^13.0.1", "ts-jest": "^29.1.1", "ts-node": "^10.9.1", - "typescript": "^5.2.2" + "typescript": "^5.6.2" }, "scripts": { "compile": "tsc -p ./", diff --git a/packages/salesforcedx-sobjects-faux-generator/src/describe/sObjectDescribe.ts b/packages/salesforcedx-sobjects-faux-generator/src/describe/sObjectDescribe.ts index 79df6c02ce..feda03a570 100644 --- a/packages/salesforcedx-sobjects-faux-generator/src/describe/sObjectDescribe.ts +++ b/packages/salesforcedx-sobjects-faux-generator/src/describe/sObjectDescribe.ts @@ -5,11 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - DescribeGlobalResult, - DescribeSObjectResult, - Field -} from '@jsforce/jsforce-node'; +import { DescribeGlobalResult, DescribeSObjectResult, Field } from '@jsforce/jsforce-node'; import { Connection } from '@salesforce/core-bundle'; import { CLIENT_ID } from '../constants'; import { BatchRequest, BatchResponse, SObject } from '../types'; @@ -34,8 +30,7 @@ export class SObjectDescribe { * @returns Promise containing the sobject names and 'custom' classification */ public async describeGlobal(): Promise { - const allDescriptions: DescribeGlobalResult = - await this.connection.describeGlobal(); + const allDescriptions: DescribeGlobalResult = await this.connection.describeGlobal(); const requestedDescriptions = allDescriptions.sobjects.map(sobject => { return { name: sobject.name, custom: sobject.custom }; }); @@ -47,22 +42,12 @@ export class SObjectDescribe { } public buildSObjectDescribeURL(sObjectName: string): string { - const urlElements = [ - this.getVersion(), - this.sobjectsPart, - sObjectName, - 'describe' - ]; + const urlElements = [this.getVersion(), this.sobjectsPart, sObjectName, 'describe']; return urlElements.join('/'); } public buildBatchRequestURL(): string { - const batchUrlElements = [ - this.connection.instanceUrl, - this.servicesPath, - this.getVersion(), - this.batchPart - ]; + const batchUrlElements = [this.connection.instanceUrl, this.servicesPath, this.getVersion(), this.batchPart]; return batchUrlElements.join('/'); } @@ -91,9 +76,7 @@ export class SObjectDescribe { }) as unknown as BatchResponse; } - public async describeSObjectBatchRequest( - types: string[] - ): Promise { + public async describeSObjectBatchRequest(types: string[]): Promise { try { const batchRequest = this.buildBatchRequestBody(types); const batchResponse = await this.runRequest(batchRequest); @@ -139,21 +122,10 @@ export class SObjectDescribe { * @param describeSObject full metadata of an sobject, as returned by the jsforce's sobject/describe api * @returns SObject containing a subset of DescribeSObjectResult information */ -export const toMinimalSObject = ( - describeSObject: DescribeSObjectResult -): SObject => { +export const toMinimalSObject = (describeSObject: DescribeSObjectResult): SObject => { return { - fields: describeSObject.fields - ? describeSObject.fields.map(toMinimalSObjectField) - : [], - ...pick( - describeSObject, - 'label', - 'childRelationships', - 'custom', - 'name', - 'queryable' - ) + fields: describeSObject.fields ? describeSObject.fields.map(toMinimalSObjectField) : [], + ...pick(describeSObject, 'label', 'childRelationships', 'custom', 'name', 'queryable') }; }; diff --git a/packages/salesforcedx-sobjects-faux-generator/src/generator/declarationGenerator.ts b/packages/salesforcedx-sobjects-faux-generator/src/generator/declarationGenerator.ts index 64e758c644..4532741b69 100644 --- a/packages/salesforcedx-sobjects-faux-generator/src/generator/declarationGenerator.ts +++ b/packages/salesforcedx-sobjects-faux-generator/src/generator/declarationGenerator.ts @@ -4,12 +4,7 @@ * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - ChildRelationship, - FieldDeclaration, - SObject, - SObjectDefinition -} from '../types'; +import { ChildRelationship, FieldDeclaration, SObject, SObjectDefinition } from '../types'; import { SObjectField } from '../types/describe'; export const MODIFIER = 'global'; @@ -109,16 +104,11 @@ export class DeclarationGenerator { } private getTargetType(describeType: string): string { - const gentype = DeclarationGenerator.typeMapping.get( - describeType - ) as string; + const gentype = DeclarationGenerator.typeMapping.get(describeType) as string; return gentype ? gentype : this.capitalize(describeType); } - private getReferenceName( - name: string, - relationshipName?: string | null - ): string { + private getReferenceName(name: string, relationshipName?: string | null): string { return relationshipName ? relationshipName : this.stripId(name); } @@ -162,10 +152,7 @@ export class DeclarationGenerator { { modifier: MODIFIER, name, - type: - field.referenceTo && field.referenceTo.length > 1 - ? 'SObject' - : `${field.referenceTo.join()}` + type: field.referenceTo && field.referenceTo.length > 1 ? 'SObject' : `${field.referenceTo.join()}` }, comment ? { comment } : {} ) diff --git a/packages/salesforcedx-sobjects-faux-generator/src/generator/fauxClassGenerator.ts b/packages/salesforcedx-sobjects-faux-generator/src/generator/fauxClassGenerator.ts index f47b257bfc..e83c278914 100644 --- a/packages/salesforcedx-sobjects-faux-generator/src/generator/fauxClassGenerator.ts +++ b/packages/salesforcedx-sobjects-faux-generator/src/generator/fauxClassGenerator.ts @@ -11,13 +11,7 @@ import * as path from 'path'; import { mkdir, rm } from 'shelljs'; import { SOBJECTS_DIR } from '../constants'; import { nls } from '../messages'; -import { - FieldDeclaration, - SObjectCategory, - SObjectDefinition, - SObjectGenerator, - SObjectRefreshOutput -} from '../types'; +import { FieldDeclaration, SObjectCategory, SObjectDefinition, SObjectGenerator, SObjectRefreshOutput } from '../types'; import { DeclarationGenerator, MODIFIER } from './declarationGenerator'; export const INDENT = ' '; @@ -34,68 +28,43 @@ export class FauxClassGenerator implements SObjectGenerator { this.relativePath = relativePath; this.declGenerator = new DeclarationGenerator(); - if ( - selector !== SObjectCategory.STANDARD && - selector !== SObjectCategory.CUSTOM - ) { + if (selector !== SObjectCategory.STANDARD && selector !== SObjectCategory.CUSTOM) { throw nls.localize('unsupported_sobject_category', String(selector)); } } private static fieldDeclToString(decl: FieldDeclaration): string { - return `${FauxClassGenerator.commentToString(decl.comment)}${INDENT}${ - decl.modifier - } ${decl.type} ${decl.name};`; + return `${FauxClassGenerator.commentToString(decl.comment)}${INDENT}${decl.modifier} ${decl.type} ${decl.name};`; } // VisibleForTesting public static commentToString(comment?: string): string { // for some reasons if the comment is on a single line the help context shows the last '*/' - return comment - ? `${INDENT}/* ${comment.replace( - /(\/\*+\/)|(\/\*+)|(\*+\/)/g, - '' - )}${EOL}${INDENT}*/${EOL}` - : ''; + return comment ? `${INDENT}/* ${comment.replace(/(\/\*+\/)|(\/\*+)|(\*+\/)/g, '')}${EOL}${INDENT}*/${EOL}` : ''; } public generate(output: SObjectRefreshOutput): void { - const outputFolderPath = path.join( - output.sfdxPath, - ...REL_BASE_FOLDER, - this.relativePath - ); + const outputFolderPath = path.join(output.sfdxPath, ...REL_BASE_FOLDER, this.relativePath); if (!this.resetOutputFolder(outputFolderPath)) { throw nls.localize('no_sobject_output_folder_text', outputFolderPath); } - const sobjects = - this.sobjectSelector === SObjectCategory.STANDARD - ? output.getStandard() - : output.getCustom(); + const sobjects = this.sobjectSelector === SObjectCategory.STANDARD ? output.getStandard() : output.getCustom(); for (const sobj of sobjects) { if (sobj.name) { - const sobjDefinition = this.declGenerator.generateSObjectDefinition( - sobj - ); + const sobjDefinition = this.declGenerator.generateSObjectDefinition(sobj); this.generateFauxClass(outputFolderPath, sobjDefinition); } } } // VisibleForTesting - public generateFauxClass( - folderPath: string, - definition: SObjectDefinition - ): string { + public generateFauxClass(folderPath: string, definition: SObjectDefinition): string { if (!fs.existsSync(folderPath)) { fs.mkdirSync(folderPath); } - const fauxClassPath = path.join( - folderPath, - `${definition.name}${APEX_CLASS_EXTENSION}` - ); + const fauxClassPath = path.join(folderPath, `${definition.name}${APEX_CLASS_EXTENSION}`); fs.writeFileSync(fauxClassPath, this.generateFauxClassText(definition), { mode: 0o444 }); @@ -117,9 +86,7 @@ export class FauxClassGenerator implements SObjectGenerator { }); const classDeclaration = `${MODIFIER} class ${className} {${EOL}`; - const declarationLines = declarations - .map(FauxClassGenerator.fieldDeclToString) - .join(`${EOL}`); + const declarationLines = declarations.map(FauxClassGenerator.fieldDeclToString).join(`${EOL}`); const classConstructor = `${INDENT}${MODIFIER} ${className} () ${EOL} {${EOL} }${EOL}`; const generatedClass = `${nls.localize( diff --git a/packages/salesforcedx-sobjects-faux-generator/src/generator/soqlMetadataGenerator.ts b/packages/salesforcedx-sobjects-faux-generator/src/generator/soqlMetadataGenerator.ts index 530da1b34a..479a794b1b 100644 --- a/packages/salesforcedx-sobjects-faux-generator/src/generator/soqlMetadataGenerator.ts +++ b/packages/salesforcedx-sobjects-faux-generator/src/generator/soqlMetadataGenerator.ts @@ -8,19 +8,10 @@ import { TOOLS } from '@salesforce/salesforcedx-utils-vscode'; import * as fs from 'fs'; import * as path from 'path'; import { mkdir, rm } from 'shelljs'; -import { - CUSTOMOBJECTS_DIR, - SOQLMETADATA_DIR, - STANDARDOBJECTS_DIR -} from '../constants'; +import { CUSTOMOBJECTS_DIR, SOQLMETADATA_DIR, STANDARDOBJECTS_DIR } from '../constants'; import { SObjectShortDescription } from '../describe'; import { nls } from '../messages'; -import { - SObject, - SObjectCategory, - SObjectGenerator, - SObjectRefreshOutput -} from '../types'; +import { SObject, SObjectCategory, SObjectGenerator, SObjectRefreshOutput } from '../types'; const BASE_FOLDER = [TOOLS, SOQLMETADATA_DIR]; @@ -44,10 +35,7 @@ export class SOQLMetadataGenerator implements SObjectGenerator { } } - private generateTypesNames( - folderPath: string, - typeNames: SObjectShortDescription[] - ): void { + private generateTypesNames(folderPath: string, typeNames: SObjectShortDescription[]): void { if (!fs.existsSync(folderPath)) { fs.mkdirSync(folderPath, { recursive: true }); } @@ -60,10 +48,7 @@ export class SOQLMetadataGenerator implements SObjectGenerator { }); } - private generateMetadataForSObject( - folderPath: string, - sobject: SObject - ): void { + private generateMetadataForSObject(folderPath: string, sobject: SObject): void { if (!fs.existsSync(folderPath)) { fs.mkdirSync(folderPath); } @@ -78,23 +63,14 @@ export class SOQLMetadataGenerator implements SObjectGenerator { }); } - private async resetOutputFolder( - outputFolder: string, - category: SObjectCategory - ): Promise { + private async resetOutputFolder(outputFolder: string, category: SObjectCategory): Promise { const customsFolder = path.join(outputFolder, CUSTOMOBJECTS_DIR); const standardsFolder = path.join(outputFolder, STANDARDOBJECTS_DIR); - if ( - [SObjectCategory.ALL, SObjectCategory.STANDARD].includes(category) && - fs.existsSync(standardsFolder) - ) { + if ([SObjectCategory.ALL, SObjectCategory.STANDARD].includes(category) && fs.existsSync(standardsFolder)) { rm('-rf', standardsFolder); } - if ( - [SObjectCategory.ALL, SObjectCategory.CUSTOM].includes(category) && - fs.existsSync(customsFolder) - ) { + if ([SObjectCategory.ALL, SObjectCategory.CUSTOM].includes(category) && fs.existsSync(customsFolder)) { rm('-rf', customsFolder); } diff --git a/packages/salesforcedx-sobjects-faux-generator/src/generator/typingGenerator.ts b/packages/salesforcedx-sobjects-faux-generator/src/generator/typingGenerator.ts index d245c3764e..41de2e8f55 100644 --- a/packages/salesforcedx-sobjects-faux-generator/src/generator/typingGenerator.ts +++ b/packages/salesforcedx-sobjects-faux-generator/src/generator/typingGenerator.ts @@ -7,13 +7,7 @@ import * as fs from 'fs'; import { EOL } from 'os'; import * as path from 'path'; -import { - FieldDeclaration, - SObject, - SObjectDefinition, - SObjectGenerator, - SObjectRefreshOutput -} from '../types'; +import { FieldDeclaration, SObject, SObjectDefinition, SObjectGenerator, SObjectRefreshOutput } from '../types'; import { DeclarationGenerator } from './declarationGenerator'; export const TYPESCRIPT_TYPE_EXT = '.d.ts'; @@ -28,10 +22,7 @@ export class TypingGenerator implements SObjectGenerator { public generate(output: SObjectRefreshOutput): void { const typingsFolderPath = path.join(output.sfdxPath, ...TYPING_PATH); - this.generateTypes( - [...output.getStandard(), ...output.getCustom()], - typingsFolderPath - ); + this.generateTypes([...output.getStandard(), ...output.getCustom()], typingsFolderPath); } public generateTypes(sobjects: SObject[], targetFolder: string): void { @@ -41,22 +32,14 @@ export class TypingGenerator implements SObjectGenerator { for (const sobj of sobjects) { if (sobj.name) { - const sobjDefinition = this.declGenerator.generateSObjectDefinition( - sobj - ); + const sobjDefinition = this.declGenerator.generateSObjectDefinition(sobj); this.generateType(targetFolder, sobjDefinition); } } } - public generateType( - folderPath: string, - definition: SObjectDefinition - ): string { - const typingPath = path.join( - folderPath, - `${definition.name}${TYPESCRIPT_TYPE_EXT}` - ); + public generateType(folderPath: string, definition: SObjectDefinition): string { + const typingPath = path.join(folderPath, `${definition.name}${TYPESCRIPT_TYPE_EXT}`); if (fs.existsSync(typingPath)) { fs.unlinkSync(typingPath); } @@ -91,11 +74,7 @@ export class TypingGenerator implements SObjectGenerator { } private isCollectionType(fieldType: string): boolean { - return ( - fieldType.startsWith('List<') || - fieldType.startsWith('Set<') || - fieldType.startsWith('Map<') - ); + return fieldType.startsWith('List<') || fieldType.startsWith('Set<') || fieldType.startsWith('Map<'); } private convertDeclaration(objName: string, decl: FieldDeclaration): string { diff --git a/packages/salesforcedx-sobjects-faux-generator/src/index.ts b/packages/salesforcedx-sobjects-faux-generator/src/index.ts index 0f9406035e..6b0f5cf03d 100644 --- a/packages/salesforcedx-sobjects-faux-generator/src/index.ts +++ b/packages/salesforcedx-sobjects-faux-generator/src/index.ts @@ -4,13 +4,7 @@ * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -export { - CLIENT_ID, - SOBJECTS_DIR, - STANDARDOBJECTS_DIR, - CUSTOMOBJECTS_DIR, - SOQLMETADATA_DIR -} from './constants'; +export { CLIENT_ID, SOBJECTS_DIR, STANDARDOBJECTS_DIR, CUSTOMOBJECTS_DIR, SOQLMETADATA_DIR } from './constants'; export { SObjectTransformer, SObjectTransformerFactory } from './transformer'; export * from './types'; export * from './describe'; diff --git a/packages/salesforcedx-sobjects-faux-generator/src/messages/i18n.ja.ts b/packages/salesforcedx-sobjects-faux-generator/src/messages/i18n.ja.ts index b023dea9f1..105809edf8 100644 --- a/packages/salesforcedx-sobjects-faux-generator/src/messages/i18n.ja.ts +++ b/packages/salesforcedx-sobjects-faux-generator/src/messages/i18n.ja.ts @@ -17,15 +17,11 @@ */ export const messages = { faux_generation_cancelled_text: '疑似クラスの作成がキャンセルされました', - failure_fetching_sobjects_list_text: - '組織から sObject のリストの取得に失敗しました。%s', + failure_fetching_sobjects_list_text: '組織から sObject のリストの取得に失敗しました。%s', failure_in_sobject_describe_text: 'sObject の記述に失敗しました。%s', - no_sobject_output_folder_text: - '利用できる出力フォルダ %s がありません。このフォルダを作成し再度更新してください。', - fetched_sobjects_length_text: - 'デフォルトの組織から %s %s sObject を取得しました。\n', - no_generate_if_not_in_project: - 'SFDX プロジェクトを開いていない場合、sObject の擬似クラスを生成できません。%s', + no_sobject_output_folder_text: '利用できる出力フォルダ %s がありません。このフォルダを作成し再度更新してください。', + fetched_sobjects_length_text: 'デフォルトの組織から %s %s sObject を取得しました。\n', + no_generate_if_not_in_project: 'SFDX プロジェクトを開いていない場合、sObject の擬似クラスを生成できません。%s', class_header_generated_comment: `// This file is generated as an Apex representation of the // corresponding sObject and its fields. // This read-only file is used by the Apex Language Server to diff --git a/packages/salesforcedx-sobjects-faux-generator/src/messages/i18n.ts b/packages/salesforcedx-sobjects-faux-generator/src/messages/i18n.ts index f0a3f2f05e..5376487c3f 100644 --- a/packages/salesforcedx-sobjects-faux-generator/src/messages/i18n.ts +++ b/packages/salesforcedx-sobjects-faux-generator/src/messages/i18n.ts @@ -17,16 +17,12 @@ */ export const messages = { faux_generation_cancelled_text: 'Faux class generation canceled', - failure_fetching_sobjects_list_text: - 'Failure fetching list of sObjects from org %s', + failure_fetching_sobjects_list_text: 'Failure fetching list of sObjects from org %s', failure_in_sobject_describe_text: 'Failure performing sObject describe %s', - no_sobject_output_folder_text: - 'No output folder available %s. Please create this folder and refresh again', + no_sobject_output_folder_text: 'No output folder available %s. Please create this folder and refresh again', processed_sobjects_length_text: 'Processed %s %s sObjects\n', - unsupported_sobject_category: - 'SObject category cannot be used to generate metadata %s', - no_generate_if_not_in_project: - 'Unable to process sObjects when not in a SFDX Project %s', + unsupported_sobject_category: 'SObject category cannot be used to generate metadata %s', + no_generate_if_not_in_project: 'Unable to process sObjects when not in a SFDX Project %s', class_header_generated_comment: `// This file is generated as an Apex representation of the // corresponding sObject and its fields. // This read-only file is used by the Apex Language Server to diff --git a/packages/salesforcedx-sobjects-faux-generator/src/messages/index.ts b/packages/salesforcedx-sobjects-faux-generator/src/messages/index.ts index 778631a45e..d849f122a2 100644 --- a/packages/salesforcedx-sobjects-faux-generator/src/messages/index.ts +++ b/packages/salesforcedx-sobjects-faux-generator/src/messages/index.ts @@ -29,9 +29,5 @@ const loadMessageBundle = (config?: Config): Message => { }; export const nls = new Localization( - loadMessageBundle( - process.env.VSCODE_NLS_CONFIG - ? JSON.parse(process.env.VSCODE_NLS_CONFIG!) - : undefined - ) + loadMessageBundle(process.env.VSCODE_NLS_CONFIG ? JSON.parse(process.env.VSCODE_NLS_CONFIG!) : undefined) ); diff --git a/packages/salesforcedx-sobjects-faux-generator/src/messages/localization.ts b/packages/salesforcedx-sobjects-faux-generator/src/messages/localization.ts index a3c9203a97..d483055e2b 100644 --- a/packages/salesforcedx-sobjects-faux-generator/src/messages/localization.ts +++ b/packages/salesforcedx-sobjects-faux-generator/src/messages/localization.ts @@ -64,9 +64,7 @@ export class Message implements LocalizationProvider { const expectedNumArgs = possibleLabel.split('%s').length - 1; if (args.length !== expectedNumArgs) { // just log it, we might want to hide some in some languges on purpose - console.log( - `Arguments do not match for label '${label}', got ${args.length} but want ${expectedNumArgs}` - ); + console.log(`Arguments do not match for label '${label}', got ${args.length} but want ${expectedNumArgs}`); } args.unshift(possibleLabel); diff --git a/packages/salesforcedx-sobjects-faux-generator/src/retriever/index.ts b/packages/salesforcedx-sobjects-faux-generator/src/retriever/index.ts index 358c492cb0..43dcee0ab8 100644 --- a/packages/salesforcedx-sobjects-faux-generator/src/retriever/index.ts +++ b/packages/salesforcedx-sobjects-faux-generator/src/retriever/index.ts @@ -6,7 +6,4 @@ */ export { MinObjectRetriever } from './minObjectRetriever'; -export { - OrgObjectRetriever, - OrgObjectDetailRetriever -} from './orgObjectRetriever'; +export { OrgObjectRetriever, OrgObjectDetailRetriever } from './orgObjectRetriever'; diff --git a/packages/salesforcedx-sobjects-faux-generator/src/retriever/minObjectRetriever.ts b/packages/salesforcedx-sobjects-faux-generator/src/retriever/minObjectRetriever.ts index 20b2fadb17..8d5fbf4d8c 100644 --- a/packages/salesforcedx-sobjects-faux-generator/src/retriever/minObjectRetriever.ts +++ b/packages/salesforcedx-sobjects-faux-generator/src/retriever/minObjectRetriever.ts @@ -7,11 +7,7 @@ import * as minSObjectsFromFile from '../../src/data/minSObjects.json'; import { SObjectShortDescription } from '../describe'; -import { - SObject, - SObjectDefinitionRetriever, - SObjectRefreshOutput -} from '../types'; +import { SObject, SObjectDefinitionRetriever, SObjectRefreshOutput } from '../types'; type minSObjectsFileFormat = { typeNames: SObjectShortDescription[]; diff --git a/packages/salesforcedx-sobjects-faux-generator/src/retriever/orgObjectRetriever.ts b/packages/salesforcedx-sobjects-faux-generator/src/retriever/orgObjectRetriever.ts index e46439c2f4..63e13e0a4a 100644 --- a/packages/salesforcedx-sobjects-faux-generator/src/retriever/orgObjectRetriever.ts +++ b/packages/salesforcedx-sobjects-faux-generator/src/retriever/orgObjectRetriever.ts @@ -6,18 +6,10 @@ */ import { Connection } from '@salesforce/core-bundle'; -import { - SObjectDescribe, - SObjectSelector, - SObjectShortDescription -} from '../describe'; +import { SObjectDescribe, SObjectSelector, SObjectShortDescription } from '../describe'; import { nls } from '../messages'; -import { - SObject, - SObjectDefinitionRetriever, - SObjectRefreshOutput -} from '../types'; +import { SObject, SObjectDefinitionRetriever, SObjectRefreshOutput } from '../types'; export class OrgObjectRetriever implements SObjectDefinitionRetriever { private describer: SObjectDescribe; @@ -32,10 +24,7 @@ export class OrgObjectRetriever implements SObjectDefinitionRetriever { sobjects = await this.describer.describeGlobal(); } catch (e) { const err = JSON.parse(e); - output.setError( - nls.localize('failure_fetching_sobjects_list_text', err.message), - err.stack - ); + output.setError(nls.localize('failure_fetching_sobjects_list_text', err.message), err.stack); return; } output.addTypeNames(sobjects); @@ -57,9 +46,7 @@ export class OrgObjectDetailRetriever implements SObjectDefinitionRetriever { try { fetchedSObjects = await this.describer.fetchObjects(retrieveTypes); } catch (errorMessage) { - output.setError( - nls.localize('failure_in_sobject_describe_text', errorMessage) - ); + output.setError(nls.localize('failure_in_sobject_describe_text', errorMessage)); return; } diff --git a/packages/salesforcedx-sobjects-faux-generator/src/transformer/sobjectTransformer.ts b/packages/salesforcedx-sobjects-faux-generator/src/transformer/sobjectTransformer.ts index 5188b3410f..fe2fac80c7 100644 --- a/packages/salesforcedx-sobjects-faux-generator/src/transformer/sobjectTransformer.ts +++ b/packages/salesforcedx-sobjects-faux-generator/src/transformer/sobjectTransformer.ts @@ -7,14 +7,7 @@ import { projectPaths } from '@salesforce/salesforcedx-utils-vscode'; import { EventEmitter } from 'events'; import * as fs from 'fs'; -import { - ERROR_EVENT, - EXIT_EVENT, - FAILURE_CODE, - STDERR_EVENT, - STDOUT_EVENT, - SUCCESS_CODE -} from '../constants'; +import { ERROR_EVENT, EXIT_EVENT, FAILURE_CODE, STDERR_EVENT, STDOUT_EVENT, SUCCESS_CODE } from '../constants'; import { SObjectShortDescription } from '../describe'; import { nls } from '../messages'; import { @@ -60,9 +53,7 @@ export class SObjectTransformer { const pathToStateFolder = projectPaths.stateFolder(); if (!fs.existsSync(pathToStateFolder)) { - return this.errorExit( - nls.localize('no_generate_if_not_in_project', pathToStateFolder) - ); + return this.errorExit(nls.localize('no_generate_if_not_in_project', pathToStateFolder)); } const output: SObjectRefreshData = this.initializeData(pathToStateFolder); @@ -140,19 +131,13 @@ export class SObjectTransformer { } private didCancel(): boolean { - if ( - this.cancellationToken && - this.cancellationToken.isCancellationRequested - ) { + if (this.cancellationToken && this.cancellationToken.isCancellationRequested) { return true; } return false; } - private errorExit( - message: string, - stack?: string - ): Promise { + private errorExit(message: string, stack?: string): Promise { this.emitter.emit(STDERR_EVENT, `${message}\n`); this.emitter.emit(ERROR_EVENT, new Error(message)); this.emitter.emit(EXIT_EVENT, FAILURE_CODE); @@ -173,14 +158,7 @@ export class SObjectTransformer { private logSObjects(sobjectKind: string, processedLength: number) { if (processedLength > 0) { - this.emitter.emit( - STDOUT_EVENT, - nls.localize( - 'processed_sobjects_length_text', - processedLength, - sobjectKind - ) - ); + this.emitter.emit(STDOUT_EVENT, nls.localize('processed_sobjects_length_text', processedLength, sobjectKind)); } } } diff --git a/packages/salesforcedx-sobjects-faux-generator/src/transformer/transformerFactory.ts b/packages/salesforcedx-sobjects-faux-generator/src/transformer/transformerFactory.ts index 0ae05ccb54..bf7fdc5bdc 100644 --- a/packages/salesforcedx-sobjects-faux-generator/src/transformer/transformerFactory.ts +++ b/packages/salesforcedx-sobjects-faux-generator/src/transformer/transformerFactory.ts @@ -5,26 +5,14 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ import { AuthInfo, Connection, SfProject } from '@salesforce/core-bundle'; -import { - ConfigUtil, - WorkspaceContextUtil -} from '@salesforce/salesforcedx-utils-vscode'; +import { ConfigUtil, WorkspaceContextUtil } from '@salesforce/salesforcedx-utils-vscode'; import { EventEmitter } from 'events'; import { CUSTOMOBJECTS_DIR, STANDARDOBJECTS_DIR } from '../constants'; import { SObjectSelector, SObjectShortDescription } from '../describe'; import { FauxClassGenerator, TypingGenerator } from '../generator'; import { SOQLMetadataGenerator } from '../generator/soqlMetadataGenerator'; -import { - MinObjectRetriever, - OrgObjectDetailRetriever, - OrgObjectRetriever -} from '../retriever'; -import { - SObjectCategory, - SObjectDefinitionRetriever, - SObjectGenerator, - SObjectRefreshSource -} from '../types'; +import { MinObjectRetriever, OrgObjectDetailRetriever, OrgObjectRetriever } from '../retriever'; +import { SObjectCategory, SObjectDefinitionRetriever, SObjectGenerator, SObjectRefreshSource } from '../types'; import { SObjectTransformer } from './sobjectTransformer'; export type CancellationToken = { @@ -40,14 +28,8 @@ export class SObjectTransformerFactory { ): Promise { const retrievers: SObjectDefinitionRetriever[] = []; const generators: SObjectGenerator[] = []; - const standardGenerator = new FauxClassGenerator( - SObjectCategory.STANDARD, - STANDARDOBJECTS_DIR - ); - const customGenerator = new FauxClassGenerator( - SObjectCategory.CUSTOM, - CUSTOMOBJECTS_DIR - ); + const standardGenerator = new FauxClassGenerator(SObjectCategory.STANDARD, STANDARDOBJECTS_DIR); + const customGenerator = new FauxClassGenerator(SObjectCategory.CUSTOM, CUSTOMOBJECTS_DIR); if (source === SObjectRefreshSource.StartupMin) { retrievers.push(new MinObjectRetriever()); @@ -57,23 +39,14 @@ export class SObjectTransformerFactory { retrievers.push( new OrgObjectRetriever(connection), - new OrgObjectDetailRetriever( - connection, - new GeneralSObjectSelector(category, source) - ) + new OrgObjectDetailRetriever(connection, new GeneralSObjectSelector(category, source)) ); - if ( - category === SObjectCategory.STANDARD || - category === SObjectCategory.ALL - ) { + if (category === SObjectCategory.STANDARD || category === SObjectCategory.ALL) { generators.push(standardGenerator); } - if ( - category === SObjectCategory.CUSTOM || - category === SObjectCategory.ALL - ) { + if (category === SObjectCategory.CUSTOM || category === SObjectCategory.ALL) { generators.push(customGenerator); } } @@ -81,24 +54,17 @@ export class SObjectTransformerFactory { generators.push(new TypingGenerator()); generators.push(new SOQLMetadataGenerator(category)); - return new SObjectTransformer( - emitter, - retrievers, - generators, - cancellationToken - ); + return new SObjectTransformer(emitter, retrievers, generators, cancellationToken); } public static async createConnection(): Promise { - const userApiVersionOverride = - await ConfigUtil.getUserConfiguredApiVersion(); + const userApiVersionOverride = await ConfigUtil.getUserConfiguredApiVersion(); const workspaceContextUtil = WorkspaceContextUtil.getInstance(); const connection = await workspaceContextUtil.getConnection(); const connectionForSourceApiVersion = await Connection.create({ authInfo: await AuthInfo.create({ username: connection.getUsername() }) }); - const sourceApiVersion = - await SObjectTransformerFactory.getSourceApiVersion(); + const sourceApiVersion = await SObjectTransformerFactory.getSourceApiVersion(); // precedence user override > project config > connection default connectionForSourceApiVersion.setApiVersion( userApiVersionOverride || sourceApiVersion || connection.getApiVersion() @@ -128,20 +94,14 @@ export class GeneralSObjectSelector implements SObjectSelector { } public select(sobject: SObjectShortDescription): boolean { - const isCustomObject = - sobject.custom === true && this.category === SObjectCategory.CUSTOM; - const isStandardObject = - sobject.custom === false && this.category === SObjectCategory.STANDARD; + const isCustomObject = sobject.custom === true && this.category === SObjectCategory.CUSTOM; + const isStandardObject = sobject.custom === false && this.category === SObjectCategory.STANDARD; - if ( - this.category === SObjectCategory.ALL && - this.source === SObjectRefreshSource.Manual - ) { + if (this.category === SObjectCategory.ALL && this.source === SObjectRefreshSource.Manual) { return true; } else if ( this.category === SObjectCategory.ALL && - (this.source === SObjectRefreshSource.StartupMin || - this.source === SObjectRefreshSource.Startup) && + (this.source === SObjectRefreshSource.StartupMin || this.source === SObjectRefreshSource.Startup) && this.isRequiredSObject(sobject.name) ) { return true; diff --git a/packages/salesforcedx-sobjects-faux-generator/src/types/describe.ts b/packages/salesforcedx-sobjects-faux-generator/src/types/describe.ts index da9d64ba6b..b0ad4cc341 100644 --- a/packages/salesforcedx-sobjects-faux-generator/src/types/describe.ts +++ b/packages/salesforcedx-sobjects-faux-generator/src/types/describe.ts @@ -28,10 +28,7 @@ export type SObjectField = Pick< | 'type' >; -export type SObject = Pick< - DescribeSObjectResult, - 'childRelationships' | 'label' | 'custom' | 'name' | 'queryable' -> & { +export type SObject = Pick & { fields: SObjectField[]; }; diff --git a/packages/salesforcedx-sobjects-faux-generator/src/types/index.ts b/packages/salesforcedx-sobjects-faux-generator/src/types/index.ts index 1e86ed80a2..d85c97aceb 100644 --- a/packages/salesforcedx-sobjects-faux-generator/src/types/index.ts +++ b/packages/salesforcedx-sobjects-faux-generator/src/types/index.ts @@ -5,13 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -export { - BatchRequest, - BatchResponse, - ChildRelationship, - SObject, - SObjectField -} from './describe'; +export { BatchRequest, BatchResponse, ChildRelationship, SObject, SObjectField } from './describe'; export { FieldDeclaration, SObjectCategory, diff --git a/packages/salesforcedx-sobjects-faux-generator/test/.eslintrc.json b/packages/salesforcedx-sobjects-faux-generator/test/.eslintrc.json deleted file mode 100644 index f2b99a417d..0000000000 --- a/packages/salesforcedx-sobjects-faux-generator/test/.eslintrc.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": [ - "../.eslintrc.json", - "../../../config/common-test-lint-rules.json" - ] -} diff --git a/packages/salesforcedx-sobjects-faux-generator/test/integration/mockData.ts b/packages/salesforcedx-sobjects-faux-generator/test/integration/mockData.ts index 1cec13c412..5f281d17ae 100644 --- a/packages/salesforcedx-sobjects-faux-generator/test/integration/mockData.ts +++ b/packages/salesforcedx-sobjects-faux-generator/test/integration/mockData.ts @@ -109,8 +109,7 @@ export const mockAPIResponse = { updateable: false, urls: { rowTemplate: '/services/data/v50.0/sobjects/ApexPageInfo/{ID}', - defaultValues: - '/services/data/v50.0/sobjects/ApexPageInfo/defaultValues?recordTypeId&fields', + defaultValues: '/services/data/v50.0/sobjects/ApexPageInfo/defaultValues?recordTypeId&fields', describe: '/services/data/v50.0/sobjects/ApexPageInfo/describe', sobject: '/services/data/v50.0/sobjects/ApexPageInfo' } diff --git a/packages/salesforcedx-sobjects-faux-generator/test/integration/sObjectDescribe.test.ts b/packages/salesforcedx-sobjects-faux-generator/test/integration/sObjectDescribe.test.ts index 655ba1d680..5943760fd1 100644 --- a/packages/salesforcedx-sobjects-faux-generator/test/integration/sObjectDescribe.test.ts +++ b/packages/salesforcedx-sobjects-faux-generator/test/integration/sObjectDescribe.test.ts @@ -58,16 +58,12 @@ describe('Fetch sObjects', () => { afterEach(() => env.restore()); it('Should throw exception when describeGlobal fails', async () => { - describeGlobalStub.throws( - new Error('Unexpected error when running describeGlobal') - ); + describeGlobalStub.throws(new Error('Unexpected error when running describeGlobal')); try { await sobjectdescribe.describeGlobal(); fail('test should have failed with an api exception'); } catch (e) { - expect(e.message).contains( - 'Unexpected error when running describeGlobal' - ); + expect(e.message).contains('Unexpected error when running describeGlobal'); } }); @@ -92,9 +88,7 @@ describe('Fetch sObjects', () => { }); it('Should build the sobject describe url', () => { - expect(sobjectdescribe.buildSObjectDescribeURL('testObject')).to.equal( - 'v50.0/sobjects/testObject/describe' - ); + expect(sobjectdescribe.buildSObjectDescribeURL('testObject')).to.equal('v50.0/sobjects/testObject/describe'); }); it('Should build the batch request url', async () => { @@ -145,9 +139,7 @@ describe('Fetch sObjects', () => { const sobjectTypes = ['ApexPageInfo']; env.stub(connection, 'request').resolves(mockAPIResponse); - const batchResponse = await sobjectdescribe.describeSObjectBatchRequest( - sobjectTypes - ); + const batchResponse = await sobjectdescribe.describeSObjectBatchRequest(sobjectTypes); expect(batchResponse.length).to.be.equal(1); expect(batchResponse[0]).to.deep.equal(mockMinimizedResponseResult); @@ -159,9 +151,7 @@ describe('Fetch sObjects', () => { results: undefined }); - const batchResponse = await sobjectdescribe.describeSObjectBatchRequest( - sobjectTypes - ); + const batchResponse = await sobjectdescribe.describeSObjectBatchRequest(sobjectTypes); expect(batchResponse.length).to.be.equal(0); }); @@ -170,9 +160,7 @@ describe('Fetch sObjects', () => { const sobjectTypes = ['ApexPageInfo']; env.stub(connection, 'request').resolves({}); - const batchResponse = await sobjectdescribe.describeSObjectBatchRequest( - sobjectTypes - ); + const batchResponse = await sobjectdescribe.describeSObjectBatchRequest(sobjectTypes); expect(batchResponse.length).to.be.equal(0); }); diff --git a/packages/salesforcedx-sobjects-faux-generator/test/integration/sobjectTransformer.test.ts b/packages/salesforcedx-sobjects-faux-generator/test/integration/sobjectTransformer.test.ts index 71d2db93b8..a79515a235 100644 --- a/packages/salesforcedx-sobjects-faux-generator/test/integration/sobjectTransformer.test.ts +++ b/packages/salesforcedx-sobjects-faux-generator/test/integration/sobjectTransformer.test.ts @@ -15,14 +15,7 @@ import * as os from 'os'; import * as path from 'path'; import { createSandbox } from 'sinon'; import { SObjectTransformer } from '../../src'; -import { - ERROR_EVENT, - EXIT_EVENT, - FAILURE_CODE, - STDERR_EVENT, - STDOUT_EVENT, - SUCCESS_CODE -} from '../../src/constants'; +import { ERROR_EVENT, EXIT_EVENT, FAILURE_CODE, STDERR_EVENT, STDOUT_EVENT, SUCCESS_CODE } from '../../src/constants'; import { nls } from '../../src/messages'; import { MinObjectRetriever } from '../../src/retriever'; import { CancellationTokenSource } from './integrationTestUtil'; @@ -127,20 +120,13 @@ describe('Transform sobject definitions', () => { it('Should fail if outside a DX project', async () => { env.stub(fs, 'existsSync').returns(false); - const transformer = new SObjectTransformer( - emitter, - [], - [], - cancellationTokenSource.token - ); + const transformer = new SObjectTransformer(emitter, [], [], cancellationTokenSource.token); try { await transformer.transform(); fail('transformer should have thrown an error'); } catch ({ error }) { - expect(error.message).to.contain( - nls.localize('no_generate_if_not_in_project', '') - ); + expect(error.message).to.contain(nls.localize('no_generate_if_not_in_project', '')); return; } }); @@ -149,12 +135,7 @@ describe('Transform sobject definitions', () => { env.stub(fs, 'existsSync').returns(true); env.stub(MinObjectRetriever.prototype, 'retrieve').returns([]); - const transformer = new SObjectTransformer( - emitter, - [new MinObjectRetriever()], - [], - cancellationTokenSource.token - ); + const transformer = new SObjectTransformer(emitter, [new MinObjectRetriever()], [], cancellationTokenSource.token); cancellationTokenSource.cancel(); const result = await transformer.transform(); @@ -200,12 +181,7 @@ describe('Transform sobject definitions', () => { it('Should emit an exit event with code success code 0 on success', async () => { let exitCode = FAILURE_CODE; - const transformer = new SObjectTransformer( - emitter, - [], - [], - cancellationTokenSource.token - ); + const transformer = new SObjectTransformer(emitter, [], [], cancellationTokenSource.token); emitter.addListener(EXIT_EVENT, (data: number) => { exitCode = data; }); @@ -248,9 +224,7 @@ describe('Transform sobject definitions', () => { expect(result.error).to.be.undefined; expect(result.data.standardObjects).to.eql(1); - expect(stdoutInfo).to.contain( - nls.localize('processed_sobjects_length_text', 1, 'Standard') - ); + expect(stdoutInfo).to.contain(nls.localize('processed_sobjects_length_text', 1, 'Standard')); }); it('Should log the number of custom objects processed on success', async () => { @@ -286,9 +260,7 @@ describe('Transform sobject definitions', () => { expect(result.error).to.be.undefined; expect(result.data.customObjects).to.eql(1); - expect(stdoutInfo).to.contain( - nls.localize('processed_sobjects_length_text', 1, 'Custom') - ); + expect(stdoutInfo).to.contain(nls.localize('processed_sobjects_length_text', 1, 'Custom')); }); }); }); diff --git a/packages/salesforcedx-sobjects-faux-generator/test/jest/generator/fauxClassGenerator.test.ts b/packages/salesforcedx-sobjects-faux-generator/test/jest/generator/fauxClassGenerator.test.ts index 96d175ce19..cff6aae03f 100644 --- a/packages/salesforcedx-sobjects-faux-generator/test/jest/generator/fauxClassGenerator.test.ts +++ b/packages/salesforcedx-sobjects-faux-generator/test/jest/generator/fauxClassGenerator.test.ts @@ -6,10 +6,10 @@ */ import { TOOLS } from '@salesforce/salesforcedx-utils-vscode'; import { EOL } from 'os'; -import {join} from 'path'; +import { join } from 'path'; import { SObjectCategory, SObjectRefreshOutput, SOBJECTS_DIR } from '../../../src'; import { FauxClassGenerator } from '../../../src/generator'; -import {DeclarationGenerator} from '../../../src/generator/declarationGenerator'; +import { DeclarationGenerator } from '../../../src/generator/declarationGenerator'; import { INDENT } from '../../../src/generator/fauxClassGenerator'; jest.mock('../../../src/generator/declarationGenerator'); @@ -32,7 +32,6 @@ describe('FauxClassGenerator Unit Tests.', () => { }); describe('commentToString()', () => { - it('Should return empty string for empty input', () => { const empty = ''; const actual = FauxClassGenerator.commentToString(empty); @@ -55,11 +54,8 @@ describe('FauxClassGenerator Unit Tests.', () => { let expectedSecondComment = `${INDENT}/* More complex ${EOL}`; expectedSecondComment += `**************this is a test **************${EOL}`; expectedSecondComment += `${EOL}${INDENT}*/${EOL}`; - const parseSecondComment = FauxClassGenerator.commentToString( - secondComment - ); + const parseSecondComment = FauxClassGenerator.commentToString(secondComment); expect(expectedSecondComment).toEqual(parseSecondComment); - }); it('Should parse a comment with spaces.', () => { @@ -69,7 +65,6 @@ describe('FauxClassGenerator Unit Tests.', () => { const parseThirdComment = FauxClassGenerator.commentToString(thirdComment); expect(expectedThirdComment).toEqual(parseThirdComment); }); - }); describe('generate()', () => { @@ -83,7 +78,9 @@ describe('FauxClassGenerator Unit Tests.', () => { let generateFauxClassMock: jest.SpyInstance; beforeEach(() => { - resetOutputFolderMock = jest.spyOn((FauxClassGenerator.prototype as any), 'resetOutputFolder').mockReturnValue(true); + resetOutputFolderMock = jest + .spyOn(FauxClassGenerator.prototype as any, 'resetOutputFolder') + .mockReturnValue(true); generateFauxClassMock = jest.spyOn(FauxClassGenerator.prototype, 'generateFauxClass'); getStandardMock = jest.fn(); getCustomMock = jest.fn(); @@ -104,7 +101,7 @@ describe('FauxClassGenerator Unit Tests.', () => { }); it('Should process standard sobjects.', () => { - const fakeSObject = {name: 'fake'}; + const fakeSObject = { name: 'fake' }; const fakeSobjectDef = 'look at me the sobject'; getStandardMock.mockReturnValue([fakeSObject]); (declarationGeneratorMocked.prototype.generateSObjectDefinition as any).mockReturnValue(fakeSobjectDef as any); @@ -120,7 +117,7 @@ describe('FauxClassGenerator Unit Tests.', () => { }); it('Should process custom sobjects.', () => { - const fakeSObject = {name: 'fake'}; + const fakeSObject = { name: 'fake' }; const fakeSobjectDef = 'look at me the sobject'; getCustomMock.mockReturnValue([fakeSObject]); (declarationGeneratorMocked.prototype.generateSObjectDefinition as any).mockReturnValue(fakeSobjectDef as any); diff --git a/packages/salesforcedx-sobjects-faux-generator/test/unit/fauxClassGenerator.test.ts b/packages/salesforcedx-sobjects-faux-generator/test/unit/fauxClassGenerator.test.ts index a46b8376f7..a191cc839b 100644 --- a/packages/salesforcedx-sobjects-faux-generator/test/unit/fauxClassGenerator.test.ts +++ b/packages/salesforcedx-sobjects-faux-generator/test/unit/fauxClassGenerator.test.ts @@ -50,15 +50,12 @@ describe('SObject faux class generator', () => { classPath = gen.generateFauxClass(sobjectFolder, JSON.parse(sobject1)); expect(fs.existsSync(classPath)); const classText = fs.readFileSync(classPath, 'utf8'); - expect(classText).to.include( - nls.localize('class_header_generated_comment') - ); + expect(classText).to.include(nls.localize('class_header_generated_comment')); }); it('Should generate a faux class with field inline comments', async () => { const gen = getGenerator(); - const customDef = - declGenerator.generateSObjectDefinition(minimalCustomSObject); + const customDef = declGenerator.generateSObjectDefinition(minimalCustomSObject); const classContent = gen.generateFauxClassText(customDef); let standardFieldComment = ` /* Please add a unique name${EOL}`; @@ -111,9 +108,7 @@ describe('SObject faux class generator', () => { const fieldsString = fields.join(','); const sobject1 = `${fieldsHeader}${fieldsString}${closeHeader}`; - const objDef = declGenerator.generateSObjectDefinition( - JSON.parse(sobject1) - ); + const objDef = declGenerator.generateSObjectDefinition(JSON.parse(sobject1)); const sobjectFolder = process.cwd(); const gen = getGenerator(); @@ -151,9 +146,7 @@ describe('SObject faux class generator', () => { const fieldsString = fields.join(','); const sobject1 = `${fieldsHeader}${fieldsString}${closeHeader}`; - const objDef = declGenerator.generateSObjectDefinition( - JSON.parse(sobject1) - ); + const objDef = declGenerator.generateSObjectDefinition(JSON.parse(sobject1)); const sobjectFolder = process.cwd(); const gen = getGenerator(); @@ -168,19 +161,11 @@ describe('SObject faux class generator', () => { }); it('Should create a a valid class with a field and relationship', async () => { - const field1 = - '{"name": "StringField", "type": "string", "referenceTo": []}'; - const relation1 = - '{"name": "Account__c", "referenceTo": ["Account"], "relationshipName": "Account__r"}'; + const field1 = '{"name": "StringField", "type": "string", "referenceTo": []}'; + const relation1 = '{"name": "Account__c", "referenceTo": ["Account"], "relationshipName": "Account__r"}'; const sobject1: string = - '{ "name": "Custom__c", "fields": [ ' + - field1 + - ',' + - relation1 + - ' ], "childRelationships": [] }'; - const objDef = declGenerator.generateSObjectDefinition( - JSON.parse(sobject1) - ); + '{ "name": "Custom__c", "fields": [ ' + field1 + ',' + relation1 + ' ], "childRelationships": [] }'; + const objDef = declGenerator.generateSObjectDefinition(JSON.parse(sobject1)); const sobjectFolder = process.cwd(); const gen = getGenerator(); @@ -193,19 +178,11 @@ describe('SObject faux class generator', () => { }); it('Should create a valid class with child relationship', async () => { - const field1 = - '{"name": "StringField", "type": "string", "referenceTo": []}'; - const childRelation1 = - '{"childSObject": "Case", "relationshipName": "Case__r"}'; + const field1 = '{"name": "StringField", "type": "string", "referenceTo": []}'; + const childRelation1 = '{"childSObject": "Case", "relationshipName": "Case__r"}'; const sobject1: string = - '{ "name": "Custom__c", "fields": [ ' + - field1 + - ' ], "childRelationships": [' + - childRelation1 + - '] }'; - const objDef = declGenerator.generateSObjectDefinition( - JSON.parse(sobject1) - ); + '{ "name": "Custom__c", "fields": [ ' + field1 + ' ], "childRelationships": [' + childRelation1 + '] }'; + const objDef = declGenerator.generateSObjectDefinition(JSON.parse(sobject1)); const sobjectFolder = process.cwd(); const gen = getGenerator(); classPath = gen.generateFauxClass(sobjectFolder, objDef); @@ -215,15 +192,9 @@ describe('SObject faux class generator', () => { }); it('Should create a valid field name for a child relationship that is missing the relationshipName', async () => { - const childRelation1 = - '{"childSObject": "Case", "field": "RelatedCaseId", "relationshipName": null}'; - const sobject1: string = - '{ "name": "Custom__c", "childRelationships": [' + - childRelation1 + - '] }'; - const objDef = declGenerator.generateSObjectDefinition( - JSON.parse(sobject1) - ); + const childRelation1 = '{"childSObject": "Case", "field": "RelatedCaseId", "relationshipName": null}'; + const sobject1: string = '{ "name": "Custom__c", "childRelationships": [' + childRelation1 + '] }'; + const objDef = declGenerator.generateSObjectDefinition(JSON.parse(sobject1)); const sobjectFolder = process.cwd(); const gen = getGenerator(); classPath = gen.generateFauxClass(sobjectFolder, objDef); @@ -235,20 +206,12 @@ describe('SObject faux class generator', () => { // seems odd, but this can happen due to the childRelationships that don't have a relationshipName it('Should create a class that has no duplicate field names', async () => { - const childRelation1 = - '{"childSObject": "Case", "relationshipName": "Reference"}'; - const childRelation2 = - '{"childSObject": "Account", "field": "ReferenceId", "relationshipName": null}'; + const childRelation1 = '{"childSObject": "Case", "relationshipName": "Reference"}'; + const childRelation2 = '{"childSObject": "Account", "field": "ReferenceId", "relationshipName": null}'; const sobject1: string = - '{ "name": "Custom__c", "childRelationships": [' + - childRelation2 + - ',' + - childRelation1 + - '] }'; - const objDef = declGenerator.generateSObjectDefinition( - JSON.parse(sobject1) - ); + '{ "name": "Custom__c", "childRelationships": [' + childRelation2 + ',' + childRelation1 + '] }'; + const objDef = declGenerator.generateSObjectDefinition(JSON.parse(sobject1)); const sobjectFolder = process.cwd(); const gen = getGenerator(); classPath = gen.generateFauxClass(sobjectFolder, objDef); @@ -259,16 +222,12 @@ describe('SObject faux class generator', () => { }); it('Should create a valid field reference to another SObject when missing the relationshipName', async () => { - const childRelation1 = - '{"childSObject": "Account", "field": "ReferenceId", "relationshipName": null}'; - const field1 = - '{"name": "AccountFieldId", "type": "string", "referenceTo": ["Account"], "relationshipName": null}'; + const childRelation1 = '{"childSObject": "Account", "field": "ReferenceId", "relationshipName": null}'; + const field1 = '{"name": "AccountFieldId", "type": "string", "referenceTo": ["Account"], "relationshipName": null}'; const header = '{ "name": "Custom__c", "childRelationships": ['; const fieldHeader = '"fields": ['; const sobject1 = `${header}${childRelation1}],${fieldHeader}${field1}]}`; - const objDef = declGenerator.generateSObjectDefinition( - JSON.parse(sobject1) - ); + const objDef = declGenerator.generateSObjectDefinition(JSON.parse(sobject1)); const sobjectFolder = process.cwd(); const gen = getGenerator(); classPath = gen.generateFauxClass(sobjectFolder, objDef); @@ -285,9 +244,7 @@ describe('SObject faux class generator', () => { const header = '{ "name": "Custom__c", "childRelationships": []'; const fieldHeader = '"fields": ['; const sobject1 = `${header},${fieldHeader}${field1}]}`; - const objDef = declGenerator.generateSObjectDefinition( - JSON.parse(sobject1) - ); + const objDef = declGenerator.generateSObjectDefinition(JSON.parse(sobject1)); const sobjectFolder = process.cwd(); const gen = getGenerator(); classPath = gen.generateFauxClass(sobjectFolder, objDef); @@ -304,16 +261,12 @@ describe('SObject faux class generator', () => { // Note, currently __x (ExternalObject) is not handled by describe (REST or Cli), but is handled by SDD it('Should create a valid class for a metadata object with EntityDefinition relationship target', async () => { - const header = - '{ "name": "Custom__mdt", "childRelationships": [], "fields": ['; + const header = '{ "name": "Custom__mdt", "childRelationships": [], "fields": ['; const field1 = '{"name": "MDRef__c", "type": "reference", "referenceTo": [], "relationshipName": null, "extraTypeInfo": "externallookup"}'; - const field2 = - '{"name": "StringField", "type": "string", "referenceTo": []}'; + const field2 = '{"name": "StringField", "type": "string", "referenceTo": []}'; const sobject1 = `${header}${field1},${field2}]}`; - const objDef = declGenerator.generateSObjectDefinition( - JSON.parse(sobject1) - ); + const objDef = declGenerator.generateSObjectDefinition(JSON.parse(sobject1)); const sobjectFolder = process.cwd(); const gen = getGenerator(); classPath = gen.generateFauxClass(sobjectFolder, objDef); @@ -323,16 +276,11 @@ describe('SObject faux class generator', () => { }); it('Should create a valid class for a metadata object with a __mdt target', async () => { - const header = - '{ "name": "Custom__mdt", "childRelationships": [], "fields": ['; - const field1 = - '{"name": "MDRef__r", "type": "reference", "referenceTo": ["XX_mdt"], "relationshipName": null}'; - const field2 = - '{"name": "StringField", "type": "string", "referenceTo": []}'; + const header = '{ "name": "Custom__mdt", "childRelationships": [], "fields": ['; + const field1 = '{"name": "MDRef__r", "type": "reference", "referenceTo": ["XX_mdt"], "relationshipName": null}'; + const field2 = '{"name": "StringField", "type": "string", "referenceTo": []}'; const sobject1 = `${header}${field1},${field2}]}`; - const objDef = declGenerator.generateSObjectDefinition( - JSON.parse(sobject1) - ); + const objDef = declGenerator.generateSObjectDefinition(JSON.parse(sobject1)); const sobjectFolder = process.cwd(); const gen = getGenerator(); classPath = gen.generateFauxClass(sobjectFolder, objDef); @@ -352,9 +300,7 @@ describe('SObject faux class generator', () => { const fieldsString = fields.join(','); const sobject1 = `${fieldsHeader}${fieldsString}${closeHeader}`; - const objDef = declGenerator.generateSObjectDefinition( - JSON.parse(sobject1) - ); + const objDef = declGenerator.generateSObjectDefinition(JSON.parse(sobject1)); const sobjectFolder = process.cwd(); const gen = getGenerator(); @@ -384,10 +330,7 @@ describe('SObject faux class generator', () => { }); it('Should remove standardObjects folder when category is STANDARD', () => { - const gen = new FauxClassGenerator( - SObjectCategory.STANDARD, - STANDARDOBJECTS_DIR - ); + const gen = new FauxClassGenerator(SObjectCategory.STANDARD, STANDARDOBJECTS_DIR); const output: SObjectRefreshOutput = { sfdxPath, addTypeNames: () => {}, @@ -405,10 +348,7 @@ describe('SObject faux class generator', () => { }); it('Should remove customObjects folder when category is CUSTOM', () => { - const gen = new FauxClassGenerator( - SObjectCategory.CUSTOM, - CUSTOMOBJECTS_DIR - ); + const gen = new FauxClassGenerator(SObjectCategory.CUSTOM, CUSTOMOBJECTS_DIR); const output: SObjectRefreshOutput = { sfdxPath, addTypeNames: () => {}, diff --git a/packages/salesforcedx-sobjects-faux-generator/test/unit/sObjectMockData.ts b/packages/salesforcedx-sobjects-faux-generator/test/unit/sObjectMockData.ts index c7cb067380..b40b7eaa70 100644 --- a/packages/salesforcedx-sobjects-faux-generator/test/unit/sObjectMockData.ts +++ b/packages/salesforcedx-sobjects-faux-generator/test/unit/sObjectMockData.ts @@ -786,8 +786,7 @@ export const apiCustomSObject: DescribeSObjectResult = { highScaleNumber: false, htmlFormatted: false, idLookup: false, - inlineHelpText: - 'User field expected value. If using a regex you can test it ...', + inlineHelpText: 'User field expected value. If using a regex you can test it ...', label: 'Field Value', length: 255, mask: null, @@ -895,8 +894,7 @@ export const apiCustomSObject: DescribeSObjectResult = { name: 'Master', recordTypeId: '0120000000000xxxxx', urls: { - layout: - '/services/data/v46.0/sobjects/Test_Object__c/describe/layouts/0120000000000xxxxx' + layout: '/services/data/v46.0/sobjects/Test_Object__c/describe/layouts/0120000000000xxxxx' } } ], @@ -930,15 +928,12 @@ export const apiCustomSObject: DescribeSObjectResult = { undeletable: true, updateable: true, urls: { - compactLayouts: - '/services/data/v46.0/sobjects/Test_Object__c/describe/compactLayouts', + compactLayouts: '/services/data/v46.0/sobjects/Test_Object__c/describe/compactLayouts', rowTemplate: '/services/data/v46.0/sobjects/Test_Object__c/{ID}', - approvalLayouts: - '/services/data/v46.0/sobjects/Test_Object__c/describe/approvalLayouts', + approvalLayouts: '/services/data/v46.0/sobjects/Test_Object__c/describe/approvalLayouts', uiDetailTemplate: 'https://na96.salesforce.com/{ID}', uiEditTemplate: 'https://na96.salesforce.com/{ID}/e', - defaultValues: - '/services/data/v46.0/sobjects/Test_Object__c/defaultValues?recordTypeId&fields', + defaultValues: '/services/data/v46.0/sobjects/Test_Object__c/defaultValues?recordTypeId&fields', describe: '/services/data/v46.0/sobjects/Test_Object__c/describe', uiNewRecord: 'https://na96.salesforce.com/a07/e', quickActions: '/services/data/v46.0/sobjects/Test_Object__c/quickActions', @@ -1201,8 +1196,7 @@ export const minimalCustomSObject: SObject = { extraTypeInfo: null, filterable: true, groupable: true, - inlineHelpText: - 'User field expected value. If using a regex you can test it ...', + inlineHelpText: 'User field expected value. If using a regex you can test it ...', label: 'Field Value', name: 'Field_Value__c', nillable: false, diff --git a/packages/salesforcedx-sobjects-faux-generator/test/unit/sobjectSelector.test.ts b/packages/salesforcedx-sobjects-faux-generator/test/unit/sobjectSelector.test.ts index 296ac5a9a1..ca6da8bdee 100644 --- a/packages/salesforcedx-sobjects-faux-generator/test/unit/sobjectSelector.test.ts +++ b/packages/salesforcedx-sobjects-faux-generator/test/unit/sobjectSelector.test.ts @@ -28,14 +28,9 @@ const SOBJECTS_DESCRIBE_SAMPLE = { describe('Select sObjects', () => { it('Should return only custom sobjects for MANUAL', () => { - const selector = new GeneralSObjectSelector( - SObjectCategory.CUSTOM, - SObjectRefreshSource.Manual - ); + const selector = new GeneralSObjectSelector(SObjectCategory.CUSTOM, SObjectRefreshSource.Manual); - const results = SOBJECTS_DESCRIBE_SAMPLE.sobjects.filter(s => - selector.select(s) - ); + const results = SOBJECTS_DESCRIBE_SAMPLE.sobjects.filter(s => selector.select(s)); expect(results.length).to.eql(3); expect(results).to.deep.equal([ @@ -46,14 +41,9 @@ describe('Select sObjects', () => { }); it('Should return only standard sobjects for MANUAL', () => { - const selector = new GeneralSObjectSelector( - SObjectCategory.STANDARD, - SObjectRefreshSource.Manual - ); + const selector = new GeneralSObjectSelector(SObjectCategory.STANDARD, SObjectRefreshSource.Manual); - const results = SOBJECTS_DESCRIBE_SAMPLE.sobjects.filter(s => - selector.select(s) - ); + const results = SOBJECTS_DESCRIBE_SAMPLE.sobjects.filter(s => selector.select(s)); expect(results.length).to.eql(4); expect(results).to.deep.equal([ @@ -65,14 +55,9 @@ describe('Select sObjects', () => { }); it('Should filter out sobjects if category is CUSTOM & source MANUAL', () => { - const selector = new GeneralSObjectSelector( - SObjectCategory.CUSTOM, - SObjectRefreshSource.Manual - ); + const selector = new GeneralSObjectSelector(SObjectCategory.CUSTOM, SObjectRefreshSource.Manual); - const results = SOBJECTS_DESCRIBE_SAMPLE.sobjects.filter(s => - selector.select(s) - ); + const results = SOBJECTS_DESCRIBE_SAMPLE.sobjects.filter(s => selector.select(s)); expect(results.length).to.eql(3); expect(results).to.deep.equal([ @@ -83,14 +68,9 @@ describe('Select sObjects', () => { }); it('Should filter out sobjects if category is STANDARD & source MANUAL', () => { - const selector = new GeneralSObjectSelector( - SObjectCategory.STANDARD, - SObjectRefreshSource.Manual - ); + const selector = new GeneralSObjectSelector(SObjectCategory.STANDARD, SObjectRefreshSource.Manual); - const results = SOBJECTS_DESCRIBE_SAMPLE.sobjects.filter(s => - selector.select(s) - ); + const results = SOBJECTS_DESCRIBE_SAMPLE.sobjects.filter(s => selector.select(s)); expect(results.length).to.eql(4); expect(results).to.deep.equal([ @@ -102,14 +82,9 @@ describe('Select sObjects', () => { }); it('Should filter out associated sobjects if category is ALL & source is Startup', () => { - const selector = new GeneralSObjectSelector( - SObjectCategory.ALL, - SObjectRefreshSource.Startup - ); + const selector = new GeneralSObjectSelector(SObjectCategory.ALL, SObjectRefreshSource.Startup); - const results = SOBJECTS_DESCRIBE_SAMPLE.sobjects.filter(s => - selector.select(s) - ); + const results = SOBJECTS_DESCRIBE_SAMPLE.sobjects.filter(s => selector.select(s)); expect(results.length).to.eql(7); expect(results).to.deep.equal([ @@ -124,14 +99,9 @@ describe('Select sObjects', () => { }); it('Should filter out sobjects if category is ALL & source is StartupMin', () => { - const selector = new GeneralSObjectSelector( - SObjectCategory.ALL, - SObjectRefreshSource.Startup - ); - - const results = SOBJECTS_DESCRIBE_SAMPLE.sobjects.filter(s => - selector.select(s) - ); + const selector = new GeneralSObjectSelector(SObjectCategory.ALL, SObjectRefreshSource.Startup); + + const results = SOBJECTS_DESCRIBE_SAMPLE.sobjects.filter(s => selector.select(s)); expect(results.length).to.eql(7); expect(results).to.deep.equal([ diff --git a/packages/salesforcedx-sobjects-faux-generator/test/unit/soqlMetadataGenerator.test.ts b/packages/salesforcedx-sobjects-faux-generator/test/unit/soqlMetadataGenerator.test.ts index 8c0dae9d4d..6cb2ac69fb 100644 --- a/packages/salesforcedx-sobjects-faux-generator/test/unit/soqlMetadataGenerator.test.ts +++ b/packages/salesforcedx-sobjects-faux-generator/test/unit/soqlMetadataGenerator.test.ts @@ -10,19 +10,11 @@ import * as fs from 'fs'; import { userInfo } from 'os'; import { join } from 'path'; import { rm } from 'shelljs'; -import { - CUSTOMOBJECTS_DIR, - SOQLMETADATA_DIR, - STANDARDOBJECTS_DIR -} from '../../src/constants'; +import { CUSTOMOBJECTS_DIR, SOQLMETADATA_DIR, STANDARDOBJECTS_DIR } from '../../src/constants'; import { SObjectShortDescription } from '../../src/describe'; import { SOQLMetadataGenerator } from '../../src/generator/soqlMetadataGenerator'; import { MinObjectRetriever } from '../../src/retriever'; -import { - SObject, - SObjectCategory, - SObjectRefreshOutput -} from '../../src/types'; +import { SObject, SObjectCategory, SObjectRefreshOutput } from '../../src/types'; const expect = chai.expect; @@ -98,7 +90,7 @@ class TestSObjectRefreshOutput implements SObjectRefreshOutput { private custom: SObject[] = []; public error: { message?: string; stack?: string } = {}; - public constructor(public sfdxPath: string) { } + public constructor(public sfdxPath: string) {} public addTypeNames(sobjShort: SObjectShortDescription[]): void { this.typeNames.push(...sobjShort); diff --git a/packages/salesforcedx-sobjects-faux-generator/test/unit/typingGenerator.test.ts b/packages/salesforcedx-sobjects-faux-generator/test/unit/typingGenerator.test.ts index bf79e928ce..6d6c5e1c40 100644 --- a/packages/salesforcedx-sobjects-faux-generator/test/unit/typingGenerator.test.ts +++ b/packages/salesforcedx-sobjects-faux-generator/test/unit/typingGenerator.test.ts @@ -32,9 +32,7 @@ describe('SObject Javacript type declaration generator', () => { const closeHeader = ' ], "childRelationships": [] }'; const sobject1 = `${fieldsHeader}${closeHeader}`; - const objDef = declGenerator.generateSObjectDefinition( - JSON.parse(sobject1) - ); + const objDef = declGenerator.generateSObjectDefinition(JSON.parse(sobject1)); const sobjectFolder = process.cwd(); const gen = new TypingGenerator(); @@ -69,9 +67,7 @@ describe('SObject Javacript type declaration generator', () => { const fieldsString = fields.join(','); const sobject1 = `${fieldsHeader}${fieldsString}${closeHeader}`; - const objDef = declGenerator.generateSObjectDefinition( - JSON.parse(sobject1) - ); + const objDef = declGenerator.generateSObjectDefinition(JSON.parse(sobject1)); const sobjectFolder = process.cwd(); const gen = new TypingGenerator(); @@ -118,9 +114,7 @@ describe('SObject Javacript type declaration generator', () => { expect(typeText).to.include('const PicklistField:string;'); expect(typeText).to.include('export default PicklistField;'); - expect(typeText).to.include( - '@salesforce/schema/Custom__c.MultipicklistField' - ); + expect(typeText).to.include('@salesforce/schema/Custom__c.MultipicklistField'); expect(typeText).to.include('const MultipicklistField:string;'); expect(typeText).to.include('export default MultipicklistField;'); @@ -155,9 +149,7 @@ describe('SObject Javacript type declaration generator', () => { const fieldsString = fields.join(','); const sobject1 = `${fieldsHeader}${fieldsString}${closeHeader}`; - const objDef = declGenerator.generateSObjectDefinition( - JSON.parse(sobject1) - ); + const objDef = declGenerator.generateSObjectDefinition(JSON.parse(sobject1)); const sobjectFolder = process.cwd(); const gen = new TypingGenerator(); @@ -172,19 +164,11 @@ describe('SObject Javacript type declaration generator', () => { }); it('Should create a declaration file with a field and relationship', async () => { - const field1 = - '{"name": "StringField", "type": "string", "referenceTo": []}'; - const relation1 = - '{"name": "Account__c", "referenceTo": ["Account"], "relationshipName": "Account__r"}'; + const field1 = '{"name": "StringField", "type": "string", "referenceTo": []}'; + const relation1 = '{"name": "Account__c", "referenceTo": ["Account"], "relationshipName": "Account__r"}'; const sobject1: string = - '{ "name": "Custom__c", "fields": [ ' + - field1 + - ',' + - relation1 + - ' ], "childRelationships": [] }'; - const objDef = declGenerator.generateSObjectDefinition( - JSON.parse(sobject1) - ); + '{ "name": "Custom__c", "fields": [ ' + field1 + ',' + relation1 + ' ], "childRelationships": [] }'; + const objDef = declGenerator.generateSObjectDefinition(JSON.parse(sobject1)); const sobjectFolder = process.cwd(); const gen = new TypingGenerator(); @@ -210,9 +194,7 @@ describe('SObject Javacript type declaration generator', () => { const header = '{ "name": "Custom__c", "childRelationships": []'; const fieldHeader = '"fields": ['; const sobject1 = `${header},${fieldHeader}${field1}]}`; - const objDef = declGenerator.generateSObjectDefinition( - JSON.parse(sobject1) - ); + const objDef = declGenerator.generateSObjectDefinition(JSON.parse(sobject1)); const sobjectFolder = process.cwd(); const gen = new TypingGenerator(); @@ -225,16 +207,12 @@ describe('SObject Javacript type declaration generator', () => { }); it('Should create a valid declaration file for a metadata object with EntityDefinition relationship target', async () => { - const header = - '{ "name": "Custom__mdt", "childRelationships": [], "fields": ['; + const header = '{ "name": "Custom__mdt", "childRelationships": [], "fields": ['; const field1 = '{"name": "MDRef__c", "type": "reference", "referenceTo": [], "relationshipName": null, "extraTypeInfo": "externallookup"}'; - const field2 = - '{"name": "StringField", "type": "string", "referenceTo": []}'; + const field2 = '{"name": "StringField", "type": "string", "referenceTo": []}'; const sobject1 = `${header}${field1},${field2}]}`; - const objDef = declGenerator.generateSObjectDefinition( - JSON.parse(sobject1) - ); + const objDef = declGenerator.generateSObjectDefinition(JSON.parse(sobject1)); const sobjectFolder = process.cwd(); const gen = new TypingGenerator(); typePath = gen.generateType(sobjectFolder, objDef); @@ -246,16 +224,11 @@ describe('SObject Javacript type declaration generator', () => { }); it('Should create a valid declaration file for a metadata object with a __mdt target', async () => { - const header = - '{ "name": "Custom__mdt", "childRelationships": [], "fields": ['; - const field1 = - '{"name": "MDRef__r", "type": "reference", "referenceTo": ["XX_mdt"], "relationshipName": null}'; - const field2 = - '{"name": "StringField", "type": "string", "referenceTo": []}'; + const header = '{ "name": "Custom__mdt", "childRelationships": [], "fields": ['; + const field1 = '{"name": "MDRef__r", "type": "reference", "referenceTo": ["XX_mdt"], "relationshipName": null}'; + const field2 = '{"name": "StringField", "type": "string", "referenceTo": []}'; const sobject1 = `${header}${field1},${field2}]}`; - const objDef = declGenerator.generateSObjectDefinition( - JSON.parse(sobject1) - ); + const objDef = declGenerator.generateSObjectDefinition(JSON.parse(sobject1)); const sobjectFolder = process.cwd(); const gen = new TypingGenerator(); typePath = gen.generateType(sobjectFolder, objDef); @@ -277,24 +250,18 @@ describe('SObject Javacript type declaration generator', () => { const fieldsString = fields.join(','); const sobject1 = `${fieldsHeader}${fieldsString}${closeHeader}`; - const objDef = declGenerator.generateSObjectDefinition( - JSON.parse(sobject1) - ); + const objDef = declGenerator.generateSObjectDefinition(JSON.parse(sobject1)); const sobjectFolder = process.cwd(); const gen = new TypingGenerator(); typePath = gen.generateType(sobjectFolder, objDef); expect(fs.existsSync(typePath)); const typeText = fs.readFileSync(typePath, 'utf8'); - expect(typeText).to.include( - 'declare module "@salesforce/schema/PE1__e.StringField" ' - ); + expect(typeText).to.include('declare module "@salesforce/schema/PE1__e.StringField" '); expect(typeText).to.include('const StringField:string;'); expect(typeText).to.include('export default StringField;'); - expect(typeText).to.include( - 'declare module "@salesforce/schema/PE1__e.DoubleField"' - ); + expect(typeText).to.include('declare module "@salesforce/schema/PE1__e.DoubleField"'); expect(typeText).to.include('const DoubleField:number;'); expect(typeText).to.include('export default DoubleField;'); }); diff --git a/packages/salesforcedx-test-utils-vscode/.eslintrc.json b/packages/salesforcedx-test-utils-vscode/.eslintrc.json deleted file mode 100644 index a8b986b195..0000000000 --- a/packages/salesforcedx-test-utils-vscode/.eslintrc.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "root": true, - "extends": ["../../config/base-eslintrc.json", "./fix-these-rules.json"], - "overrides": [ - { - "files": ["./src/**/*.ts", "./test/**/*.ts"], - "parserOptions": { - "project": "./tsconfig.json" - } - } - ] -} diff --git a/packages/salesforcedx-test-utils-vscode/fix-these-rules.json b/packages/salesforcedx-test-utils-vscode/fix-these-rules.json deleted file mode 100644 index 60974d257f..0000000000 --- a/packages/salesforcedx-test-utils-vscode/fix-these-rules.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "rules": { - "prefer-arrow/prefer-arrow-functions": ["error", {}], - "@typescript-eslint/no-unsafe-member-access": "warn", - "@typescript-eslint/no-unsafe-assignment": "warn", - "@typescript-eslint/no-unsafe-return": "warn", - "@typescript-eslint/no-unsafe-call": "warn", - "@typescript-eslint/no-unsafe-argument": "warn" - } -} diff --git a/packages/salesforcedx-test-utils-vscode/package.json b/packages/salesforcedx-test-utils-vscode/package.json index c880379710..6ec113d4a6 100644 --- a/packages/salesforcedx-test-utils-vscode/package.json +++ b/packages/salesforcedx-test-utils-vscode/package.json @@ -16,35 +16,25 @@ "@types/chai": "4.3.3", "@types/glob": "^7.2.0", "@types/mocha": "^2.2.38", - "@types/node": "^18.11.9", + "@types/node": "^20.0.0", "@types/shelljs": "0.7.9", "@types/sinon": "^2.3.7", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", "chai": "^4.0.2", "decache": "^4.1.0", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest": "27.5.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", "glob": "^8.0.3", "mocha": "^10", "mocha-junit-reporter": "^1.23.3", "mocha-multi-reporters": "^1.1.7", "mock-spawn": "0.2.6", "nyc": "^15.1.0", - "prettier": "3.0.3", + "prettier": "3.3.3", "request-light": "^0.7.0", "sinon": "^13.0.1", "source-map-support": "^0.4.15", - "typescript": "^5.2.2" + "typescript": "^5.6.2" }, "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" }, "scripts": { "clean": "shx rm -rf node_modules && shx rm -rf out", diff --git a/packages/salesforcedx-test-utils-vscode/src/orgUtils.ts b/packages/salesforcedx-test-utils-vscode/src/orgUtils.ts index 98152024c7..7f1406c4e3 100644 --- a/packages/salesforcedx-test-utils-vscode/src/orgUtils.ts +++ b/packages/salesforcedx-test-utils-vscode/src/orgUtils.ts @@ -5,11 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - CliCommandExecutor, - CommandOutput, - SfCommandBuilder -} from '@salesforce/salesforcedx-utils-vscode'; +import { CliCommandExecutor, CommandOutput, SfCommandBuilder } from '@salesforce/salesforcedx-utils-vscode'; import * as fs from 'fs'; import * as path from 'path'; import { cp } from 'shelljs'; @@ -19,11 +15,7 @@ import { Uri } from 'vscode'; // Used only for CI purposes. Must call delete if you call create export const generateSFProject = async (projectName: string): Promise => { const execution = new CliCommandExecutor( - new SfCommandBuilder() - .withArg('project:generate') - .withFlag('--name', projectName) - .withJson() - .build(), + new SfCommandBuilder().withArg('project:generate').withFlag('--name', projectName).withJson().build(), { cwd: process.cwd() } ).execute(); const cmdOutput = new CommandOutput(); @@ -31,15 +23,8 @@ export const generateSFProject = async (projectName: string): Promise => { return Promise.resolve(); }; -export const createScratchOrg = async ( - projectName: string -): Promise => { - const scratchDefFilePath = path.join( - process.cwd(), - projectName, - 'config', - 'project-scratch-def.json' - ); +export const createScratchOrg = async (projectName: string): Promise => { + const scratchDefFilePath = path.join(process.cwd(), projectName, 'config', 'project-scratch-def.json'); const execution = new CliCommandExecutor( new SfCommandBuilder() .withArg('org:create:scratch') @@ -55,10 +40,7 @@ export const createScratchOrg = async ( return Promise.resolve(username); }; -export const deleteScratchOrg = async ( - projectName: string, - username: string -): Promise => { +export const deleteScratchOrg = async (projectName: string, username: string): Promise => { const execution = new CliCommandExecutor( new SfCommandBuilder() .withArg('org:delete:scratch') @@ -73,25 +55,11 @@ export const deleteScratchOrg = async ( return Promise.resolve(result); }; -export const pushSource = async ( - sourceFolder: string, - projectName: string, - username: string -): Promise => { - const targetFolder = path.join( - process.cwd(), - projectName, - 'force-app', - 'main', - 'default' - ); +export const pushSource = async (sourceFolder: string, projectName: string, username: string): Promise => { + const targetFolder = path.join(process.cwd(), projectName, 'force-app', 'main', 'default'); cp('-R', sourceFolder, targetFolder); const execution = new CliCommandExecutor( - new SfCommandBuilder() - .withArg('project:deploy:start') - .withFlag('--target-org', username) - .withJson() - .build(), + new SfCommandBuilder().withArg('project:deploy:start').withFlag('--target-org', username).withJson().build(), { cwd: path.join(process.cwd(), projectName) } ).execute(); const cmdOutput = new CommandOutput(); @@ -100,16 +68,9 @@ export const pushSource = async ( return Promise.resolve(source); }; -export const pullSource = async ( - projectName: string, - username: string -): Promise => { +export const pullSource = async (projectName: string, username: string): Promise => { const execution = new CliCommandExecutor( - new SfCommandBuilder() - .withArg('project:retrieve:start') - .withFlag('--target-org', username) - .withJson() - .build(), + new SfCommandBuilder().withArg('project:retrieve:start').withFlag('--target-org', username).withJson().build(), { cwd: path.join(process.cwd(), projectName) } ).execute(); const cmdOutput = new CommandOutput(); @@ -118,19 +79,13 @@ export const pullSource = async ( return Promise.resolve(source); }; -export const createPermissionSet = async ( - permissionSetName: string, - username: string -): Promise => { +export const createPermissionSet = async (permissionSetName: string, username: string): Promise => { const execution = new CliCommandExecutor( new SfCommandBuilder() .withArg('data:create:record') .withFlag('--sobject', 'PermissionSet') .withFlag('--target-org', username) - .withFlag( - '--values', - 'Name=' + permissionSetName + ' Label="Give FLS Read"' - ) + .withFlag('--values', 'Name=' + permissionSetName + ' Label="Give FLS Read"') .withJson() .build(), { cwd: process.cwd() } @@ -154,12 +109,7 @@ export const createFieldPermissions = async ( .withFlag('--target-org', username) .withFlag( '--values', - util.format( - 'ParentId=%s SobjectType=%s Field=%s PermissionsRead=true', - permissionSetId, - sobjectType, - fieldName - ) + util.format('ParentId=%s SobjectType=%s Field=%s PermissionsRead=true', permissionSetId, sobjectType, fieldName) ) .withJson() .build(), @@ -170,10 +120,7 @@ export const createFieldPermissions = async ( return Promise.resolve(); }; -export const assignPermissionSet = async ( - permissionSetName: string, - username: string -): Promise => { +export const assignPermissionSet = async (permissionSetName: string, username: string): Promise => { const execution = new CliCommandExecutor( new SfCommandBuilder() .withArg('org:assign:permset') @@ -188,16 +135,8 @@ export const assignPermissionSet = async ( return Promise.resolve(); }; -export const addFeatureToScratchOrgConfig = ( - projectName: string, - feature: string -): void => { - const scratchDefFilePath = path.join( - process.cwd(), - projectName, - 'config', - 'project-scratch-def.json' - ); +export const addFeatureToScratchOrgConfig = (projectName: string, feature: string): void => { + const scratchDefFilePath = path.join(process.cwd(), projectName, 'config', 'project-scratch-def.json'); const config = JSON.parse(fs.readFileSync(scratchDefFilePath).toString()); if (config) { let featuresList = config.features || ''; diff --git a/packages/salesforcedx-test-utils-vscode/src/testrunner.ts b/packages/salesforcedx-test-utils-vscode/src/testrunner.ts index 79fa81241a..e011a9c89f 100644 --- a/packages/salesforcedx-test-utils-vscode/src/testrunner.ts +++ b/packages/salesforcedx-test-utils-vscode/src/testrunner.ts @@ -34,14 +34,8 @@ const configure = (mochaOpts: any, xmlOutputDirectory: string): void => { mochaOpts.reporter = 'mocha-multi-reporters'; } if (!mochaOpts.reporterOptions) { - const junitOutputFileLocation = paths.join( - xmlOutputDirectory, - 'junit-custom-vscodeIntegrationTests.xml' - ); - const xunitOutputFileLocation = paths.join( - xmlOutputDirectory, - 'xunit-vscodeIntegrationTests.xml' - ); + const junitOutputFileLocation = paths.join(xmlOutputDirectory, 'junit-custom-vscodeIntegrationTests.xml'); + const xunitOutputFileLocation = paths.join(xmlOutputDirectory, 'xunit-vscodeIntegrationTests.xml'); console.log('Output locations for reporters: ', { junitOutputFileLocation, @@ -68,13 +62,8 @@ const run = (testsRoot: any, clb: any): any => { if (testFilePath) { const { name: testFileBasenameNoExtension } = paths.parse(testFilePath); const testFilePathSegments = testFilePath.split(paths.sep); - const packagesDirIndex = testFilePathSegments.findIndex( - s => s === 'packages' - ); - testsRoot = paths.join( - ...testFilePathSegments.slice(0, packagesDirIndex + 2), - 'out/test' - ); + const packagesDirIndex = testFilePathSegments.findIndex(s => s === 'packages'); + testsRoot = paths.join(...testFilePathSegments.slice(0, packagesDirIndex + 2), 'out/test'); if (!/^win32/.test(process.platform)) { testsRoot = paths.join('/', testsRoot); } @@ -86,10 +75,10 @@ const run = (testsRoot: any, clb: any): any => { require('source-map-support').install(); // Glob test files - glob( + void glob( testGlobPath ? testGlobPath : '**/**.test.js', { cwd: testsRoot }, - (error, files): any => { + (error: Error | null, files: string[]): any => { if (error) { const msg = error instanceof Error ? error.message : typeof error === 'string' ? error : 'Unknown error'; console.error(msg); @@ -97,26 +86,21 @@ const run = (testsRoot: any, clb: any): any => { } try { // Fill into Mocha - files.forEach( - (f): Mocha => { - return mocha.addFile(paths.join(testsRoot, f)); - } - ); + files.forEach((f: string): Mocha => { + return mocha.addFile(paths.join(testsRoot, f)); + }); // Run the tests let failureCount = 0; mocha - .run((failures: any) => { + .run((failures: number) => { process.on('exit', () => { - console.log( - `Existing test process, code should be ${failureCount}` - ); + console.log(`Existing test process, code should be ${failureCount}`); process.exit(failures); // exit with non-zero status if there were failures }); }) - .on('fail', (test: any, err: any): void => { - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions - console.log(`Failure in test '${test}': ${err}`); + .on('fail', (test: Mocha.ITest, err: Error): void => { + console.log(`Failure in test '${test.title}': ${err.message}`); failureCount++; }) .on('end', (): void => { @@ -124,7 +108,7 @@ const run = (testsRoot: any, clb: any): any => { clb(undefined, failureCount); }); } catch (err) { - console.error('An error occured: ' + err); + console.error(`An error occured: ${err}`); return clb(err); } } diff --git a/packages/salesforcedx-test-utils-vscode/tsconfig.json b/packages/salesforcedx-test-utils-vscode/tsconfig.json index 9db6052b41..ec01ef6cb0 100644 --- a/packages/salesforcedx-test-utils-vscode/tsconfig.json +++ b/packages/salesforcedx-test-utils-vscode/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.common.json", "compilerOptions": { "rootDir": ".", - "outDir": "out", + "outDir": "out" }, - "exclude": [ - "node_modules", - "out" - ], + "exclude": ["node_modules", "out", "src/testrunner.ts"], "references": [ { "path": "../salesforcedx-utils-vscode" diff --git a/packages/salesforcedx-utils-vscode/.eslintrc.json b/packages/salesforcedx-utils-vscode/.eslintrc.json deleted file mode 100644 index a8b986b195..0000000000 --- a/packages/salesforcedx-utils-vscode/.eslintrc.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "root": true, - "extends": ["../../config/base-eslintrc.json", "./fix-these-rules.json"], - "overrides": [ - { - "files": ["./src/**/*.ts", "./test/**/*.ts"], - "parserOptions": { - "project": "./tsconfig.json" - } - } - ] -} diff --git a/packages/salesforcedx-utils-vscode/fix-these-rules.json b/packages/salesforcedx-utils-vscode/fix-these-rules.json deleted file mode 100644 index 16f0445677..0000000000 --- a/packages/salesforcedx-utils-vscode/fix-these-rules.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "rules": { - "prefer-arrow/prefer-arrow-functions": ["error", {}], - "@typescript-eslint/no-floating-promises": "warn", - "@typescript-eslint/no-misused-promises": "warn", - "@typescript-eslint/no-unsafe-argument": "warn", - "@typescript-eslint/no-unsafe-assignment": "warn", - "@typescript-eslint/no-unsafe-call": "warn", - "@typescript-eslint/no-unsafe-member-access": "warn", - "@typescript-eslint/no-unsafe-return": "warn", - "@typescript-eslint/require-await": "warn" - } -} diff --git a/packages/salesforcedx-utils-vscode/package.json b/packages/salesforcedx-utils-vscode/package.json index b56dcfb477..70b5ecc17d 100644 --- a/packages/salesforcedx-utils-vscode/package.json +++ b/packages/salesforcedx-utils-vscode/package.json @@ -22,27 +22,18 @@ "devDependencies": { "@types/cross-spawn": "6.0.0", "@types/jest": "^29.5.5", - "@types/node": "^18.11.9", + "@types/node": "^20.0.0", "@types/shelljs": "0.7.9", - "@types/vscode": "^1.86.0", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest": "27.5.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", + "@types/vscode": "^1.90.0", + "eslint-plugin-jest": "28.9.0", "jest": "^29.7.0", - "prettier": "3.0.3", + "prettier": "3.3.3", "shelljs": "0.8.5", "ts-jest": "^29.1.1", - "typescript": "^5.2.2" + "typescript": "^5.6.2" }, "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" }, "scripts": { "compile": "tsc -p ./", diff --git a/packages/salesforcedx-utils-vscode/src/cli/commandBuilder.ts b/packages/salesforcedx-utils-vscode/src/cli/commandBuilder.ts index 8aa2bd9c91..e37a263a89 100644 --- a/packages/salesforcedx-utils-vscode/src/cli/commandBuilder.ts +++ b/packages/salesforcedx-utils-vscode/src/cli/commandBuilder.ts @@ -19,9 +19,7 @@ export class Command { } public toString(): string { - return this.description - ? this.description - : `${this.command} ${this.args.join(' ')}`; + return this.description ? this.description : `${this.command} ${this.args.join(' ')}`; } public toCommand(): string { diff --git a/packages/salesforcedx-utils-vscode/src/cli/commandExecutor.ts b/packages/salesforcedx-utils-vscode/src/cli/commandExecutor.ts index 2adb16ae9d..ca70a47004 100644 --- a/packages/salesforcedx-utils-vscode/src/cli/commandExecutor.ts +++ b/packages/salesforcedx-utils-vscode/src/cli/commandExecutor.ts @@ -29,10 +29,7 @@ export class GlobalCliEnvironment { } export class CliCommandExecutor { - protected static patchEnv( - options: SpawnOptions, - baseEnvironment: Map - ): SpawnOptions { + protected static patchEnv(options: SpawnOptions, baseEnvironment: Map): SpawnOptions { // start with current process environment const env = Object.create(null); @@ -61,31 +58,16 @@ export class CliCommandExecutor { private readonly command: Command; private readonly options: SpawnOptions; - public constructor( - command: Command, - options: SpawnOptions, - inheritGlobalEnvironmentVariables = true - ) { + public constructor(command: Command, options: SpawnOptions, inheritGlobalEnvironmentVariables = true) { this.command = command; this.options = inheritGlobalEnvironmentVariables - ? CliCommandExecutor.patchEnv( - options, - GlobalCliEnvironment.environmentVariables - ) + ? CliCommandExecutor.patchEnv(options, GlobalCliEnvironment.environmentVariables) : options; } public execute(cancellationToken?: CancellationToken): CliCommandExecution { - const childProcess = cross_spawn( - this.command.command, - this.command.args, - this.options - ); - return new CliCommandExecution( - this.command, - childProcess, - cancellationToken - ); + const childProcess = cross_spawn(this.command.command, this.command.args, this.options); + return new CliCommandExecution(this.command, childProcess, cancellationToken); } } @@ -96,9 +78,7 @@ export class CompositeCliCommandExecutor { this.command = commands; } - public execute( - cancellationToken?: CancellationToken - ): CompositeCliCommandExecution { + public execute(cancellationToken?: CancellationToken): CompositeCliCommandExecution { return new CompositeCliCommandExecution(this.command, cancellationToken); } } @@ -174,7 +154,7 @@ export class CompositeCliCommandExecution implements CommandExecution { public failureExit(e?: {}) { if (e) { - // eslint-disable-next-line @typescript-eslint/no-base-to-string, @typescript-eslint/restrict-template-expressions + // eslint-disable-next-line @typescript-eslint/restrict-template-expressions this.stderr.next(`${e}${os.EOL}`); } this.exitSubject.next(1); @@ -191,11 +171,7 @@ export class CliCommandExecution implements CommandExecution { private readonly childProcessPid: number; - constructor( - command: Command, - childProcess: ChildProcess, - cancellationToken?: CancellationToken - ) { + constructor(command: Command, childProcess: ChildProcess, cancellationToken?: CancellationToken) { this.command = command; this.cancellationToken = cancellationToken; diff --git a/packages/salesforcedx-utils-vscode/src/cli/commandOutput.ts b/packages/salesforcedx-utils-vscode/src/cli/commandOutput.ts index 6005d822d8..2c5613babb 100644 --- a/packages/salesforcedx-utils-vscode/src/cli/commandOutput.ts +++ b/packages/salesforcedx-utils-vscode/src/cli/commandOutput.ts @@ -21,26 +21,22 @@ export class CommandOutput { this.stderrBuffer += realData.toString(); }); - return new Promise( - (resolve: (result: string) => void, reject: (reason: string) => void) => { - execution.processExitSubject.subscribe(data => { - if (data !== undefined && String(data) === '0') { - return resolve(stripAnsiInJson(this.stdoutBuffer, hasJsonEnabled)); - } else { - // Is the command is sf cli - if so, just use stdoutBuffer before stderrBuffer - if (execution.command.command === 'sf') { - return reject( - stripAnsiInJson(this.stdoutBuffer, hasJsonEnabled) || - stripAnsiInJson(this.stderrBuffer, hasJsonEnabled) - ); - } + return new Promise((resolve: (result: string) => void, reject: (reason: string) => void) => { + execution.processExitSubject.subscribe(data => { + if (data !== undefined && String(data) === '0') { + return resolve(stripAnsiInJson(this.stdoutBuffer, hasJsonEnabled)); + } else { + // Is the command is sf cli - if so, just use stdoutBuffer before stderrBuffer + if (execution.command.command === 'sf') { return reject( - stripAnsiInJson(this.stderrBuffer, hasJsonEnabled) || - stripAnsiInJson(this.stdoutBuffer, hasJsonEnabled) + stripAnsiInJson(this.stdoutBuffer, hasJsonEnabled) || stripAnsiInJson(this.stderrBuffer, hasJsonEnabled) ); } - }); - } - ); + return reject( + stripAnsiInJson(this.stderrBuffer, hasJsonEnabled) || stripAnsiInJson(this.stdoutBuffer, hasJsonEnabled) + ); + } + }); + }); } } diff --git a/packages/salesforcedx-utils-vscode/src/cli/configGet.ts b/packages/salesforcedx-utils-vscode/src/cli/configGet.ts index cb07e0f319..33f5b8b7c0 100644 --- a/packages/salesforcedx-utils-vscode/src/cli/configGet.ts +++ b/packages/salesforcedx-utils-vscode/src/cli/configGet.ts @@ -15,19 +15,13 @@ export const CONFIG_GET_COMMAND = 'config:get'; * NOTE: This code is deprecated in favor of using ConfigUtil.ts */ export class ConfigGet { - public async getConfig( - projectPath: string, - ...keys: string[] - ): Promise> { + public async getConfig(projectPath: string, ...keys: string[]): Promise> { const commandBuilder = new SfCommandBuilder().withArg(CONFIG_GET_COMMAND); keys.forEach(key => commandBuilder.withArg(key)); - const execution = new CliCommandExecutor( - commandBuilder.withJson().build(), - { - cwd: projectPath - } - ).execute(); + const execution = new CliCommandExecutor(commandBuilder.withJson().build(), { + cwd: projectPath + }).execute(); const cmdOutput = new CommandOutput(); const result = await cmdOutput.getCmdResult(execution); diff --git a/packages/salesforcedx-utils-vscode/src/cli/index.ts b/packages/salesforcedx-utils-vscode/src/cli/index.ts index 1cb3ef0a5b..ea2d4f0591 100644 --- a/packages/salesforcedx-utils-vscode/src/cli/index.ts +++ b/packages/salesforcedx-utils-vscode/src/cli/index.ts @@ -25,24 +25,12 @@ export { GlobalCliEnvironment } from './commandExecutor'; export { CommandOutput } from './commandOutput'; -export { - DiffErrorResponse, - DiffResultParser, - DiffSuccessResponse -} from './diffResultParser'; +export { DiffErrorResponse, DiffResultParser, DiffSuccessResponse } from './diffResultParser'; export { ConfigGet } from './configGet'; export { LocalCommandExecution } from './localCommandExecutor'; -export { - OrgCreateErrorResult, - OrgCreateResultParser, - OrgCreateSuccessResult -} from './orgCreateResultParser'; +export { OrgCreateErrorResult, OrgCreateResultParser, OrgCreateSuccessResult } from './orgCreateResultParser'; export { OrgDisplay, OrgInfo } from './orgDisplay'; -export { - OrgOpenContainerResultParser, - OrgOpenErrorResult, - OrgOpenSuccessResult -} from './orgOpenContainerResultParser'; +export { OrgOpenContainerResultParser, OrgOpenErrorResult, OrgOpenSuccessResult } from './orgOpenContainerResultParser'; export { ProjectRetrieveStartResultParser, ProjectRetrieveStartResult diff --git a/packages/salesforcedx-utils-vscode/src/cli/localCommandExecutor.ts b/packages/salesforcedx-utils-vscode/src/cli/localCommandExecutor.ts index b64d57c1be..a9e526d947 100644 --- a/packages/salesforcedx-utils-vscode/src/cli/localCommandExecutor.ts +++ b/packages/salesforcedx-utils-vscode/src/cli/localCommandExecutor.ts @@ -31,21 +31,9 @@ export class LocalCommandExecution implements CommandExecution { constructor(command: Command) { this.command = command; - this.processExitSubject = Observable.fromEvent( - this.cmdEmitter, - LocalCommandExecution.EXIT_EVENT - ) ; - this.processErrorSubject = Observable.fromEvent( - this.cmdEmitter, - LocalCommandExecution.ERROR_EVENT - ) ; - this.stdoutSubject = Observable.fromEvent( - this.cmdEmitter, - LocalCommandExecution.STDOUT_EVENT - ) ; - this.stderrSubject = Observable.fromEvent( - this.cmdEmitter, - LocalCommandExecution.STDERR_EVENT - ) ; + this.processExitSubject = Observable.fromEvent(this.cmdEmitter, LocalCommandExecution.EXIT_EVENT); + this.processErrorSubject = Observable.fromEvent(this.cmdEmitter, LocalCommandExecution.ERROR_EVENT); + this.stdoutSubject = Observable.fromEvent(this.cmdEmitter, LocalCommandExecution.STDOUT_EVENT); + this.stderrSubject = Observable.fromEvent(this.cmdEmitter, LocalCommandExecution.STDERR_EVENT); } } diff --git a/packages/salesforcedx-utils-vscode/src/cli/orgDisplay.ts b/packages/salesforcedx-utils-vscode/src/cli/orgDisplay.ts index eba89d3b17..8a6d32410a 100644 --- a/packages/salesforcedx-utils-vscode/src/cli/orgDisplay.ts +++ b/packages/salesforcedx-utils-vscode/src/cli/orgDisplay.ts @@ -27,10 +27,9 @@ export type OrgInfo = { export class OrgDisplay { public async getOrgInfo(projectPath: string): Promise { - const execution = new CliCommandExecutor( - new SfCommandBuilder().withArg(ORG_DISPLAY_COMMAND).withJson().build(), - { cwd: projectPath } - ).execute(); + const execution = new CliCommandExecutor(new SfCommandBuilder().withArg(ORG_DISPLAY_COMMAND).withJson().build(), { + cwd: projectPath + }).execute(); const cmdOutput = new CommandOutput(); const result = await cmdOutput.getCmdResult(execution); diff --git a/packages/salesforcedx-utils-vscode/src/cli/orgOpenContainerResultParser.ts b/packages/salesforcedx-utils-vscode/src/cli/orgOpenContainerResultParser.ts index fbd04bcb80..a33997d768 100644 --- a/packages/salesforcedx-utils-vscode/src/cli/orgOpenContainerResultParser.ts +++ b/packages/salesforcedx-utils-vscode/src/cli/orgOpenContainerResultParser.ts @@ -29,10 +29,7 @@ export class OrgOpenContainerResultParser { constructor(stdout: string) { try { - const sanitized = stdout.substring( - stdout.indexOf('{'), - stdout.lastIndexOf('}') + 1 - ); + const sanitized = stdout.substring(stdout.indexOf('{'), stdout.lastIndexOf('}') + 1); this.response = JSON.parse(sanitized); } catch (e) { const err = new Error('Error parsing org open result'); diff --git a/packages/salesforcedx-utils-vscode/src/cli/parsers/projectDeployStartResultParser.ts b/packages/salesforcedx-utils-vscode/src/cli/parsers/projectDeployStartResultParser.ts index 2c68f97bff..1da1729124 100644 --- a/packages/salesforcedx-utils-vscode/src/cli/parsers/projectDeployStartResultParser.ts +++ b/packages/salesforcedx-utils-vscode/src/cli/parsers/projectDeployStartResultParser.ts @@ -55,10 +55,7 @@ export class ProjectDeployStartResultParser { name: this.response.name ?? 'DeployFailed', status: this.response.status, ...(files && { - files: files.filter( - (file: { state: string }) => - file.state === 'Failed' || file.state === 'Conflict' - ) + files: files.filter((file: { state: string }) => file.state === 'Failed' || file.state === 'Conflict') }) } as ProjectDeployStartErrorResponse; } @@ -79,8 +76,6 @@ export class ProjectDeployStartResultParser { } public hasConflicts(): boolean { - return ( - this.response.status === 1 && this.response.name === CONFLICT_ERROR_NAME - ); + return this.response.status === 1 && this.response.name === CONFLICT_ERROR_NAME; } } diff --git a/packages/salesforcedx-utils-vscode/src/cli/parsers/projectRetrieveStartResultParser.ts b/packages/salesforcedx-utils-vscode/src/cli/parsers/projectRetrieveStartResultParser.ts index 4a8998d735..1601086b91 100644 --- a/packages/salesforcedx-utils-vscode/src/cli/parsers/projectRetrieveStartResultParser.ts +++ b/packages/salesforcedx-utils-vscode/src/cli/parsers/projectRetrieveStartResultParser.ts @@ -56,10 +56,7 @@ export class ProjectRetrieveStartResultParser { name: this.response.name ?? 'RetrieveFailed', status: this.response.status, ...(files && { - files: files.filter( - (file: { state: string }) => - file.state === 'Failed' || file.state === 'Conflict' - ) + files: files.filter((file: { state: string }) => file.state === 'Failed' || file.state === 'Conflict') }) } as ProjectRetrieveStartErrorResponse; } @@ -80,8 +77,6 @@ export class ProjectRetrieveStartResultParser { } public hasConflicts(): boolean { - return ( - this.response.status === 1 && this.response.name === CONFLICT_ERROR_NAME - ); + return this.response.status === 1 && this.response.name === CONFLICT_ERROR_NAME; } } diff --git a/packages/salesforcedx-utils-vscode/src/commands/channelService.ts b/packages/salesforcedx-utils-vscode/src/commands/channelService.ts index a8fcedb5fe..4f969dffe2 100644 --- a/packages/salesforcedx-utils-vscode/src/commands/channelService.ts +++ b/packages/salesforcedx-utils-vscode/src/commands/channelService.ts @@ -29,12 +29,8 @@ export class ChannelService { public streamCommandOutput(execution: CommandExecution) { this.streamCommandStartStop(execution); - execution.stderrSubject.subscribe(data => - this.channel.append(stripAnsi(data.toString())) - ); - execution.stdoutSubject.subscribe(data => - this.channel.append(stripAnsi(data.toString())) - ); + execution.stderrSubject.subscribe(data => this.channel.append(stripAnsi(data.toString()))); + execution.stdoutSubject.subscribe(data => this.channel.append(stripAnsi(data.toString()))); } public streamCommandStartStop(execution: CommandExecution) { @@ -51,9 +47,7 @@ export class ChannelService { this.showCommandWithTimestamp(execution.command.toCommand()); this.channel.append(' '); if (data !== undefined && data !== null) { - this.channel.appendLine( - nls.localize('channel_end_with_exit_code', data.toString()) - ); + this.channel.appendLine(nls.localize('channel_end_with_exit_code', data.toString())); } else { this.channel.appendLine(nls.localize('channel_end')); } @@ -66,13 +60,9 @@ export class ChannelService { this.channel.append(' '); if (data !== undefined) { if (/sfdx.*ENOENT/.test(data.message)) { - this.channel.appendLine( - nls.localize('channel_end_with_sfdx_not_found') - ); + this.channel.appendLine(nls.localize('channel_end_with_sfdx_not_found')); } else { - this.channel.appendLine( - nls.localize('channel_end_with_error', data.message) - ); + this.channel.appendLine(nls.localize('channel_end_with_error', data.message)); } } else { this.channel.appendLine(nls.localize('channel_end')); diff --git a/packages/salesforcedx-utils-vscode/src/commands/commandletExecutors.ts b/packages/salesforcedx-utils-vscode/src/commands/commandletExecutors.ts index e703d63559..18da764e3a 100644 --- a/packages/salesforcedx-utils-vscode/src/commands/commandletExecutors.ts +++ b/packages/salesforcedx-utils-vscode/src/commands/commandletExecutors.ts @@ -4,11 +4,7 @@ * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - Properties, - Measurements, - TelemetryData -} from '@salesforce/vscode-service-provider'; +import { Properties, Measurements, TelemetryData } from '@salesforce/vscode-service-provider'; import * as vscode from 'vscode'; import { CliCommandExecutor, Command, CommandExecution } from '../cli'; import { TelemetryBuilder, TelemetryService } from '../index'; @@ -23,11 +19,8 @@ export abstract class SfCommandletExecutor implements CommandletExecutor { private outputChannel?: vscode.OutputChannel; protected showChannelOutput = true; protected executionCwd = getRootWorkspacePath(); - protected onDidFinishExecutionEventEmitter = new vscode.EventEmitter< - [number, number] - >(); - public readonly onDidFinishExecution: vscode.Event<[number, number]> = - this.onDidFinishExecutionEventEmitter.event; + protected onDidFinishExecutionEventEmitter = new vscode.EventEmitter<[number, number]>(); + public readonly onDidFinishExecution: vscode.Event<[number, number]> = this.onDidFinishExecutionEventEmitter.event; constructor(outputChannel?: vscode.OutputChannel) { this.outputChannel = outputChannel; @@ -46,11 +39,7 @@ export abstract class SfCommandletExecutor implements CommandletExecutor { channel.showChannelOutput(); } } - notificationService.reportCommandExecutionStatus( - execution, - channel, - cancellationToken - ); + notificationService.reportCommandExecutionStatus(execution, channel, cancellationToken); ProgressNotification.show(execution, cancellationTokenSource); } @@ -60,12 +49,7 @@ export abstract class SfCommandletExecutor implements CommandletExecutor { properties?: Properties, measurements?: Measurements ) { - TelemetryService.getInstance().sendCommandEvent( - logName, - hrstart, - properties, - measurements - ); + TelemetryService.getInstance().sendCommandEvent(logName, hrstart, properties, measurements); } public execute(response: ContinueResponse): void { @@ -83,34 +67,23 @@ export abstract class SfCommandletExecutor implements CommandletExecutor { }); execution.processExitSubject.subscribe(exitCode => { - const telemetryData = this.getTelemetryData( - exitCode === 0, - response, - output - ); + const telemetryData = this.getTelemetryData(exitCode === 0, response, output); let properties; let measurements; if (telemetryData) { properties = telemetryData.properties; measurements = telemetryData.measurements; } - this.logMetric( - execution.command.logName, - startTime, - properties, - measurements - ); + this.logMetric(execution.command.logName, startTime, properties, measurements); this.onDidFinishExecutionEventEmitter.fire(startTime); }); this.attachExecution(execution, cancellationTokenSource, cancellationToken); } protected getTelemetryData( - /* eslint-disable @typescript-eslint/no-unused-vars */ success: boolean, response: ContinueResponse, output: string - /* eslint-enable @typescript-eslint/no-unused-vars */ ): TelemetryData | undefined { return; } @@ -118,9 +91,7 @@ export abstract class SfCommandletExecutor implements CommandletExecutor { public abstract build(data: T): Command; } -export abstract class LibraryCommandletExecutor - implements CommandletExecutor -{ +export abstract class LibraryCommandletExecutor implements CommandletExecutor { protected cancellable: boolean = false; private cancelled: boolean = false; private readonly executionName: string; @@ -134,11 +105,7 @@ export abstract class LibraryCommandletExecutor * @param logName Name for logging purposes such as telemetry. * @param outputChannel VS Code output channel to report execution status to. */ - constructor( - executionName: string, - logName: string, - outputChannel: vscode.OutputChannel - ) { + constructor(executionName: string, logName: string, outputChannel: vscode.OutputChannel) { this.executionName = executionName; this.logName = logName; this.outputChannel = outputChannel; @@ -167,9 +134,7 @@ export abstract class LibraryCommandletExecutor channelService.clear(); } - channelService.showCommandWithTimestamp( - `${nls.localize('channel_starting_message')}${this.executionName}\n` - ); + channelService.showCommandWithTimestamp(`${nls.localize('channel_starting_message')}${this.executionName}\n`); try { const success = await vscode.window.withProgress( @@ -183,19 +148,12 @@ export abstract class LibraryCommandletExecutor this.cancelled = true; notificationService.showCanceledExecution(this.executionName); - telemetryService.sendCommandEvent( - `${this.logName}_cancelled`, - startTime, - properties, - measurements - ); + telemetryService.sendCommandEvent(`${this.logName}_cancelled`, startTime, properties, measurements); }); return this.run(response, progress, token); } ); - channelService.showCommandWithTimestamp( - `${nls.localize('channel_end')} ${this.executionName}` - ); + channelService.showCommandWithTimestamp(`${nls.localize('channel_end')} ${this.executionName}`); if (this.showChannelOutput) { channelService.showChannelOutput(); @@ -203,9 +161,7 @@ export abstract class LibraryCommandletExecutor if (!this.cancelled) { if (success) { - notificationService - .showSuccessfulExecution(this.executionName, channelService) - .catch(e => console.error(e)); + notificationService.showSuccessfulExecution(this.executionName, channelService).catch(e => console.error(e)); } else { notificationService.showFailedExecution(this.executionName); } @@ -213,12 +169,7 @@ export abstract class LibraryCommandletExecutor this.telemetry.addProperty('success', String(success)); const { properties, measurements } = this.telemetry.build(); - telemetryService.sendCommandEvent( - this.logName, - startTime, - properties, - measurements - ); + telemetryService.sendCommandEvent(this.logName, startTime, properties, measurements); } catch (e) { if (e instanceof Error) { telemetryService.sendException( diff --git a/packages/salesforcedx-utils-vscode/src/commands/notificationService.ts b/packages/salesforcedx-utils-vscode/src/commands/notificationService.ts index 6b7ebd9fd4..2299b6c5ee 100644 --- a/packages/salesforcedx-utils-vscode/src/commands/notificationService.ts +++ b/packages/salesforcedx-utils-vscode/src/commands/notificationService.ts @@ -29,31 +29,19 @@ export class NotificationService { // Prefer these over directly calling the vscode.show* functions // We can expand these to be facades that gather analytics of failures. - public showErrorMessage( - message: string, - ...items: string[] - ): Thenable { + public showErrorMessage(message: string, ...items: string[]): Thenable { return vscode.window.showErrorMessage(message, ...items); } - public showInformationMessage( - message: string, - ...items: string[] - ): Thenable { + public showInformationMessage(message: string, ...items: string[]): Thenable { return vscode.window.showInformationMessage(message, ...items); } - public showWarningMessage( - message: string, - ...items: string[] - ): Thenable { + public showWarningMessage(message: string, ...items: string[]): Thenable { return vscode.window.showWarningMessage(message, ...items); } - public showWarningModal( - message: string, - ...items: string[] - ): Thenable { + public showWarningModal(message: string, ...items: string[]): Thenable { return vscode.window.showWarningMessage(message, { modal: true }, ...items); } @@ -66,12 +54,12 @@ export class NotificationService { this.reportExecutionStatus( execution.command.toString(), channelService, - (execution.processExitSubject as any) as Observable, + execution.processExitSubject as any as Observable, cancellationToken ); this.reportExecutionError( execution.command.toString(), - (execution.processErrorSubject as any) as Observable + execution.processErrorSubject as any as Observable ); } @@ -96,34 +84,21 @@ export class NotificationService { } public showFailedExecution(executionName: string) { - this.showErrorMessage( - nls.localize('notification_unsuccessful_execution_text', executionName) - ); + this.showErrorMessage(nls.localize('notification_unsuccessful_execution_text', executionName)); } public showCanceledExecution(executionName: string) { - this.showWarningMessage( - nls.localize('notification_canceled_execution_text', executionName) - ); + this.showWarningMessage(nls.localize('notification_canceled_execution_text', executionName)); } public async showSuccessfulExecution(executionName: string, channelService: ChannelService | undefined) { - const message = nls.localize( - 'notification_successful_execution_text', - executionName - ); + const message = nls.localize('notification_successful_execution_text', executionName); const coreConfigurationName = vscode.workspace.getConfiguration(SFDX_CORE_CONFIGURATION_NAME); const showCLISuccessMsg = coreConfigurationName.get('show-cli-success-msg', true); if (showCLISuccessMsg) { const showButtonText = nls.localize('notification_show_button_text'); - const showOnlyStatusBarButtonText = nls.localize( - 'notification_show_in_status_bar_button_text' - ); - const selection = await this.showInformationMessage( - message, - showButtonText, - showOnlyStatusBarButtonText - ); + const showOnlyStatusBarButtonText = nls.localize('notification_show_in_status_bar_button_text'); + const selection = await this.showInformationMessage(message, showButtonText, showOnlyStatusBarButtonText); if (selection) { if (selection === showButtonText && channelService) { channelService.showChannelOutput(); @@ -136,14 +111,9 @@ export class NotificationService { } } - public reportExecutionError( - executionName: string, - observable: Observable - ) { + public reportExecutionError(executionName: string, observable: Observable) { observable.subscribe(async () => { - this.showErrorMessage( - nls.localize('notification_unsuccessful_execution_text', executionName) - ); + this.showErrorMessage(nls.localize('notification_unsuccessful_execution_text', executionName)); }); } } diff --git a/packages/salesforcedx-utils-vscode/src/commands/parameterGatherers.ts b/packages/salesforcedx-utils-vscode/src/commands/parameterGatherers.ts index 1040b034c1..09adc4dd66 100644 --- a/packages/salesforcedx-utils-vscode/src/commands/parameterGatherers.ts +++ b/packages/salesforcedx-utils-vscode/src/commands/parameterGatherers.ts @@ -16,9 +16,7 @@ export class CompositeParametersGatherer implements ParametersGatherer { for (const gatherer of this.gatherers) { const input = await gatherer.gather(); if (input.type === 'CONTINUE') { - Object.keys(input.data).map( - key => (aggregatedData[key] = input.data[key]) - ); + Object.keys(input.data).map(key => (aggregatedData[key] = input.data[key])); } else { return { type: 'CANCEL' diff --git a/packages/salesforcedx-utils-vscode/src/commands/postconditionCheckers.ts b/packages/salesforcedx-utils-vscode/src/commands/postconditionCheckers.ts index 77627c2310..1a37810bb2 100644 --- a/packages/salesforcedx-utils-vscode/src/commands/postconditionCheckers.ts +++ b/packages/salesforcedx-utils-vscode/src/commands/postconditionCheckers.ts @@ -4,16 +4,10 @@ * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - CancelResponse, - ContinueResponse, - PostconditionChecker -} from '../types'; +import { CancelResponse, ContinueResponse, PostconditionChecker } from '../types'; export class EmptyPostChecker implements PostconditionChecker { - public async check( - inputs: ContinueResponse | CancelResponse - ): Promise | CancelResponse> { + public async check(inputs: ContinueResponse | CancelResponse): Promise | CancelResponse> { return inputs; } } diff --git a/packages/salesforcedx-utils-vscode/src/commands/preconditionCheckers.ts b/packages/salesforcedx-utils-vscode/src/commands/preconditionCheckers.ts index e805e8a61b..3fd937a5b2 100644 --- a/packages/salesforcedx-utils-vscode/src/commands/preconditionCheckers.ts +++ b/packages/salesforcedx-utils-vscode/src/commands/preconditionCheckers.ts @@ -15,20 +15,11 @@ import { getRootWorkspacePath, hasRootWorkspace } from '../workspaces'; import { notificationService } from './index'; export class IsSalesforceProjectOpened implements Predicate { - // eslint-disable-next-line @typescript-eslint/no-unused-vars public apply(item: typeof workspace): PredicateResponse { if (!hasRootWorkspace()) { - return PredicateResponse.of( - false, - nls.localize('predicates_no_folder_opened_text') - ); - } else if ( - !fs.existsSync(path.join(getRootWorkspacePath(), SFDX_PROJECT_FILE)) - ) { - return PredicateResponse.of( - false, - nls.localize('predicates_no_salesforce_project_found_text') - ); + return PredicateResponse.of(false, nls.localize('predicates_no_folder_opened_text')); + } else if (!fs.existsSync(path.join(getRootWorkspacePath(), SFDX_PROJECT_FILE))) { + return PredicateResponse.of(false, nls.localize('predicates_no_salesforce_project_found_text')); } else { return PredicateResponse.true(); } diff --git a/packages/salesforcedx-utils-vscode/src/commands/sfCommandlet.ts b/packages/salesforcedx-utils-vscode/src/commands/sfCommandlet.ts index 608fc73e48..3b8b94e4a7 100644 --- a/packages/salesforcedx-utils-vscode/src/commands/sfCommandlet.ts +++ b/packages/salesforcedx-utils-vscode/src/commands/sfCommandlet.ts @@ -5,12 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ import * as vscode from 'vscode'; -import { - CommandletExecutor, - ParametersGatherer, - PostconditionChecker, - PreconditionChecker -} from '../types'; +import { CommandletExecutor, ParametersGatherer, PostconditionChecker, PreconditionChecker } from '../types'; import { notificationService } from './index'; import { EmptyPostChecker } from './postconditionCheckers'; diff --git a/packages/salesforcedx-utils-vscode/src/config/configUtil.ts b/packages/salesforcedx-utils-vscode/src/config/configUtil.ts index 26ca5e19b6..1e279b3ab0 100644 --- a/packages/salesforcedx-utils-vscode/src/config/configUtil.ts +++ b/packages/salesforcedx-utils-vscode/src/config/configUtil.ts @@ -5,19 +5,9 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - Config, - ConfigAggregator, - Org, - OrgConfigProperties, - StateAggregator -} from '@salesforce/core-bundle'; +import { Config, ConfigAggregator, Org, OrgConfigProperties, StateAggregator } from '@salesforce/core-bundle'; import { workspaceUtils } from '..'; -import { - SF_CONFIG_DISABLE_TELEMETRY, - TARGET_DEV_HUB_KEY, - TARGET_ORG_KEY -} from '../constants'; +import { SF_CONFIG_DISABLE_TELEMETRY, TARGET_DEV_HUB_KEY, TARGET_ORG_KEY } from '../constants'; import { ConfigAggregatorProvider } from '../providers'; import { TelemetryService } from '../services/telemetry'; @@ -29,8 +19,7 @@ export enum ConfigSource { export class ConfigUtil { public static async getConfigSource(key: string): Promise { - const configAggregator = - await ConfigAggregatorProvider.getInstance().getConfigAggregator(); + const configAggregator = await ConfigAggregatorProvider.getInstance().getConfigAggregator(); const configSource = configAggregator.getLocation(key); switch (configSource) { case ConfigAggregator.Location.LOCAL: @@ -49,23 +38,16 @@ export class ConfigUtil { * override the API version that is otherwise gotten from the authenticated * Org in some cases, such as when deploying metadata. */ - public static async getUserConfiguredApiVersion(): Promise< - string | undefined - > { - const configAggregator = - await ConfigAggregatorProvider.getInstance().getConfigAggregator(); - const apiVersion = configAggregator.getPropertyValue( - OrgConfigProperties.ORG_API_VERSION - ); + public static async getUserConfiguredApiVersion(): Promise { + const configAggregator = await ConfigAggregatorProvider.getInstance().getConfigAggregator(); + const apiVersion = configAggregator.getPropertyValue(OrgConfigProperties.ORG_API_VERSION); return apiVersion ? String(apiVersion) : undefined; } public static async getTargetOrgOrAlias(): Promise { try { - const configAggregator = - await ConfigAggregatorProvider.getInstance().getConfigAggregator(); - const targetOrgOrAlias = - configAggregator.getPropertyValue(TARGET_ORG_KEY); + const configAggregator = await ConfigAggregatorProvider.getInstance().getConfigAggregator(); + const targetOrgOrAlias = configAggregator.getPropertyValue(TARGET_ORG_KEY); if (!targetOrgOrAlias) { return undefined; } @@ -74,49 +56,36 @@ export class ConfigUtil { } catch (err) { console.error(err); if (err instanceof Error) { - TelemetryService.getInstance().sendException( - 'get_target_org_alias', - err.message - ); + TelemetryService.getInstance().sendException('get_target_org_alias', err.message); } throw err; } } public static async isGlobalTargetOrg(): Promise { - const configSource: ConfigSource = - await ConfigUtil.getConfigSource(TARGET_ORG_KEY); + const configSource: ConfigSource = await ConfigUtil.getConfigSource(TARGET_ORG_KEY); return configSource === ConfigSource.Global; } public static async getTemplatesDirectory(): Promise { - const configAggregator = - await ConfigAggregatorProvider.getInstance().getConfigAggregator(); - const templatesDirectory = configAggregator.getPropertyValue( - OrgConfigProperties.ORG_CUSTOM_METADATA_TEMPLATES - ); + const configAggregator = await ConfigAggregatorProvider.getInstance().getConfigAggregator(); + const templatesDirectory = configAggregator.getPropertyValue(OrgConfigProperties.ORG_CUSTOM_METADATA_TEMPLATES); return templatesDirectory ? String(templatesDirectory) : undefined; } public static async isTelemetryDisabled(): Promise { - const configAggregator = - await ConfigAggregatorProvider.getInstance().getConfigAggregator(); - const isTelemetryDisabled = configAggregator.getPropertyValue( - SF_CONFIG_DISABLE_TELEMETRY - ); + const configAggregator = await ConfigAggregatorProvider.getInstance().getConfigAggregator(); + const isTelemetryDisabled = configAggregator.getPropertyValue(SF_CONFIG_DISABLE_TELEMETRY); return isTelemetryDisabled === 'true'; } public static async getTargetDevHubOrAlias(): Promise { - const configAggregator = - await ConfigAggregatorProvider.getInstance().getConfigAggregator(); + const configAggregator = await ConfigAggregatorProvider.getInstance().getConfigAggregator(); const targetDevHub = configAggregator.getPropertyValue(TARGET_DEV_HUB_KEY); return targetDevHub ? String(targetDevHub) : undefined; } - public static async getGlobalTargetDevHubOrAlias(): Promise< - string | undefined - > { + public static async getGlobalTargetDevHubOrAlias(): Promise { const globalConfig = await Config.create({ isGlobal: true }); const globalTargetDevHub = globalConfig.get(TARGET_DEV_HUB_KEY); @@ -189,9 +158,7 @@ export class ConfigUtil { } } - public static async setTargetOrgOrAlias( - usernameOrAlias: string - ): Promise { + public static async setTargetOrgOrAlias(usernameOrAlias: string): Promise { const originalDirectory = process.cwd(); // In order to correctly setup Config, the process directory needs to be set to the current workspace directory const workspacePath = workspaceUtils.getRootWorkspacePath(); diff --git a/packages/salesforcedx-utils-vscode/src/context/workspaceContextUtil.ts b/packages/salesforcedx-utils-vscode/src/context/workspaceContextUtil.ts index 3176ce2c77..3b85069094 100644 --- a/packages/salesforcedx-utils-vscode/src/context/workspaceContextUtil.ts +++ b/packages/salesforcedx-utils-vscode/src/context/workspaceContextUtil.ts @@ -39,19 +39,14 @@ export class WorkspaceContextUtil { const bindedHandler = () => this.handleCliConfigChange(); const cliConfigPath = projectPaths.salesforceProjectConfig(); - this.cliConfigWatcher = - vscode.workspace.createFileSystemWatcher(cliConfigPath); + this.cliConfigWatcher = vscode.workspace.createFileSystemWatcher(cliConfigPath); this.cliConfigWatcher.onDidChange(bindedHandler); this.cliConfigWatcher.onDidCreate(bindedHandler); this.cliConfigWatcher.onDidDelete(bindedHandler); } public async initialize(extensionContext: vscode.ExtensionContext) { - extensionContext.subscriptions.push( - this.cliConfigWatcher, - this.onOrgChangeEmitter, - this.cliConfigWatcher - ); + extensionContext.subscriptions.push(this.cliConfigWatcher, this.onOrgChangeEmitter, this.cliConfigWatcher); await this.handleCliConfigChange(); } @@ -91,18 +86,14 @@ export class WorkspaceContextUtil { if (targetOrgOrAlias) { this._username = await ConfigUtil.getUsernameFor(targetOrgOrAlias); - this._alias = - targetOrgOrAlias !== this._username ? targetOrgOrAlias : undefined; + this._alias = targetOrgOrAlias !== this._username ? targetOrgOrAlias : undefined; try { const connection = await this.getConnection(); this._orgId = connection?.getAuthInfoFields().orgId; } catch (error: unknown) { this._orgId = ''; if (error instanceof Error) { - console.log( - 'There was an problem getting the orgId of the default org: ', - error - ); + console.log('There was an problem getting the orgId of the default org: ', error); TelemetryService.getInstance().sendException( WORKSPACE_CONTEXT_ORG_ID_ERROR, `name: ${error.name}, message: ${error.message}` diff --git a/packages/salesforcedx-utils-vscode/src/date/format.ts b/packages/salesforcedx-utils-vscode/src/date/format.ts index b287767616..d7f2700566 100644 --- a/packages/salesforcedx-utils-vscode/src/date/format.ts +++ b/packages/salesforcedx-utils-vscode/src/date/format.ts @@ -5,7 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import {format} from 'util'; +import { format } from 'util'; export const getYYYYMMddHHmmssDateFormat = (localUTCDate: Date): string => { const month2Digit = makeDoubleDigit(localUTCDate.getMonth() + 1); diff --git a/packages/salesforcedx-utils-vscode/src/helpers/activationTracker.ts b/packages/salesforcedx-utils-vscode/src/helpers/activationTracker.ts index 95f99cb51b..516b1fce1b 100644 --- a/packages/salesforcedx-utils-vscode/src/helpers/activationTracker.ts +++ b/packages/salesforcedx-utils-vscode/src/helpers/activationTracker.ts @@ -14,10 +14,7 @@ export class ActivationTracker { private telemetryService: TelemetryServiceInterface; private _activationInfo: ActivationInfo; - constructor( - extensionContext: ExtensionContext, - telemetryService: TelemetryServiceInterface - ) { + constructor(extensionContext: ExtensionContext, telemetryService: TelemetryServiceInterface) { this.extensionContext = extensionContext; this.telemetryService = telemetryService; this._activationInfo = { @@ -30,26 +27,18 @@ export class ActivationTracker { async markActivationStop(activationEndDate?: Date): Promise { // capture date and elapsed HR time const activateEndDate = activationEndDate ?? new Date(); - const hrEnd = this.telemetryService.getEndHRTime( - this._activationInfo.startActivateHrTime - ); + const hrEnd = this.telemetryService.getEndHRTime(this._activationInfo.startActivateHrTime); // getting extension info. This may take up to 10 seconds, as log record creation might be lagging from // this code. All needed data have been captured for telemetry, so a wait here should have no effect // on quality of telemetry data const extensionInfo = await getExtensionInfo(this.extensionContext); let extensionActivationTime = -1; - if ( - extensionInfo?.loadStartDate && - activateEndDate.getTime() >= extensionInfo.loadStartDate.getTime() - ) { + if (extensionInfo?.loadStartDate && activateEndDate.getTime() >= extensionInfo.loadStartDate.getTime()) { // subtract activateEndDate from loadStartDate to get the time spent loading the extension if loadStartDate is not undefined - extensionActivationTime = - activateEndDate.getTime() - extensionInfo.loadStartDate.getTime(); + extensionActivationTime = activateEndDate.getTime() - extensionInfo.loadStartDate.getTime(); } if (extensionActivationTime < 0) { - this.telemetryService.sendExtensionActivationEvent( - this._activationInfo.startActivateHrTime - ); + this.telemetryService.sendExtensionActivationEvent(this._activationInfo.startActivateHrTime); } else { this._activationInfo = { ...this._activationInfo, diff --git a/packages/salesforcedx-utils-vscode/src/helpers/activationTrackerUtils.ts b/packages/salesforcedx-utils-vscode/src/helpers/activationTrackerUtils.ts index 8b6f463d22..42ad8e214c 100644 --- a/packages/salesforcedx-utils-vscode/src/helpers/activationTrackerUtils.ts +++ b/packages/salesforcedx-utils-vscode/src/helpers/activationTrackerUtils.ts @@ -33,8 +33,7 @@ const activationRecordRegExp = // capturing group regex for parsing current session log start records // 2024-01-16 15:18:17.014 [info] Extension host with pid 3574 started -const sessionStartRecordRegExp = - /.*?Extension host with pid\s?(?[0-9]+?)\s+?started/; +const sessionStartRecordRegExp = /.*?Extension host with pid\s?(?[0-9]+?)\s+?started/; export const isProcessAlive = (pid: string): boolean => { try { @@ -67,9 +66,7 @@ export const readExtensionHostLog = async (logUri: Uri): Promise => { * @example * const logUri = getExtensionHostLogLocation(extensionContext); */ -export const getExtensionHostLogLocation = ( - extensionContext: ExtensionContext -): Uri | undefined => { +export const getExtensionHostLogLocation = (extensionContext: ExtensionContext): Uri | undefined => { const logUri = extensionContext.logUri; const targetDir = 'exthost'; const parts = logUri.fsPath.split(sep); @@ -101,17 +98,14 @@ export const getExtensionHostLogActivationRecords = async ( // find the last entry for the beginning of extensions being loaded due to the // same extension host log file being used across sessions. const lastExtensionLoadStart = extHostLogLines.reduce( - (lastIndex, log, currentIndex) => - sessionStartRecordRegExp.test(log) ? currentIndex : lastIndex, + (lastIndex, log, currentIndex) => (sessionStartRecordRegExp.test(log) ? currentIndex : lastIndex), -1 ); if (lastExtensionLoadStart === -1) { return undefined; } - const sessionStartMatches = sessionStartRecordRegExp.exec( - extHostLogLines[lastExtensionLoadStart] - )!; + const sessionStartMatches = sessionStartRecordRegExp.exec(extHostLogLines[lastExtensionLoadStart])!; const { pid } = sessionStartMatches.groups as { pid: string; @@ -128,36 +122,27 @@ export const getExtensionHostLogActivationRecords = async ( const filtered = extHostLogLines.slice(lastExtensionLoadStart).filter(log => { return log.includes('ExtensionService#_doActivateExtension'); }); - const reduced = filtered.reduce( - (result: Record, log: string) => { - const matches = activationRecordRegExp.exec(log.trim()); - if (!matches) { - return result; - } - const { - dateTimeStr, - level, - eventName, - extensionId, - properties: propertiesString - } = matches.groups as RegexGroups; - const dateTime = new Date(dateTimeStr); - - const propertiesParts = propertiesString.split(', '); - const properties = propertiesParts.reduce( - (props: Record, propertyPart: string) => { - const [key, value] = propertyPart.split(': '); - return { ...props, [key]: value }; - }, - {} as Record - ); - return { - ...result, - [extensionId]: { dateTime, level, eventName, properties } - }; - }, - {} - ); + const reduced = filtered.reduce((result: Record, log: string) => { + const matches = activationRecordRegExp.exec(log.trim()); + if (!matches) { + return result; + } + const { dateTimeStr, level, eventName, extensionId, properties: propertiesString } = matches.groups as RegexGroups; + const dateTime = new Date(dateTimeStr); + + const propertiesParts = propertiesString.split(', '); + const properties = propertiesParts.reduce( + (props: Record, propertyPart: string) => { + const [key, value] = propertyPart.split(': '); + return { ...props, [key]: value }; + }, + {} as Record + ); + return { + ...result, + [extensionId]: { dateTime, level, eventName, properties } + }; + }, {}); return reduced; }; @@ -169,11 +154,8 @@ export const getExtensionHostLogActivationRecords = async ( * @param extensionContext * @returns instance of ExtensionsInfo */ -export const getExtensionsInfo = async ( - extensionContext: ExtensionContext -): Promise => { - const activationRecords = - await getExtensionHostLogActivationRecords(extensionContext); +export const getExtensionsInfo = async (extensionContext: ExtensionContext): Promise => { + const activationRecords = await getExtensionHostLogActivationRecords(extensionContext); if (!activationRecords) { return undefined; } diff --git a/packages/salesforcedx-utils-vscode/src/helpers/index.ts b/packages/salesforcedx-utils-vscode/src/helpers/index.ts index bc61189813..a6f7a2e980 100644 --- a/packages/salesforcedx-utils-vscode/src/helpers/index.ts +++ b/packages/salesforcedx-utils-vscode/src/helpers/index.ts @@ -16,23 +16,7 @@ export { export * from './extensionUris'; export { TraceFlags } from './traceFlags'; export { TraceFlagsRemover } from './traceFlagsRemover'; -export { - asyncFilter, - extractJsonObject, - getMessageFromError, - isNullOrUndefined, - fileUtils -} from './utils'; -export { - isAlphaNumSpaceString, - isAlphaNumString, - isInteger, - isIntegerInRange, - isRecordIdFormat -} from './validations'; +export { asyncFilter, extractJsonObject, getMessageFromError, isNullOrUndefined, fileUtils } from './utils'; +export { isAlphaNumSpaceString, isAlphaNumString, isInteger, isIntegerInRange, isRecordIdFormat } from './validations'; export { isSFContainerMode } from './env'; -export { - ActivationTracker -} from './activationTracker'; - - +export { ActivationTracker } from './activationTracker'; diff --git a/packages/salesforcedx-utils-vscode/src/helpers/paths.ts b/packages/salesforcedx-utils-vscode/src/helpers/paths.ts index 3b7ea97480..4d8d931325 100644 --- a/packages/salesforcedx-utils-vscode/src/helpers/paths.ts +++ b/packages/salesforcedx-utils-vscode/src/helpers/paths.ts @@ -32,13 +32,7 @@ export const ensureDirectoryExists = (filePath: string): void => { }; export const getTestResultsFolder = (vscodePath: string, testType: string) => { - const pathToTestResultsFolder = path.join( - vscodePath, - Global.STATE_FOLDER, - TOOLS, - TEST_RESULTS, - testType - ); + const pathToTestResultsFolder = path.join(vscodePath, Global.STATE_FOLDER, TOOLS, TEST_RESULTS, testType); ensureDirectoryExists(pathToTestResultsFolder); return pathToTestResultsFolder; @@ -51,10 +45,7 @@ export const getTestResultsFolder = (vscodePath: string, testType: string) => { * @param packageDirs Package directory paths * @returns Relative path for the project */ -export const getRelativeProjectPath = ( - fsPath: string = '', - packageDirs: string[] -) => { +export const getRelativeProjectPath = (fsPath: string = '', packageDirs: string[]) => { let packageDirIndex; for (let packageDir of packageDirs) { if (!packageDir.startsWith(path.sep)) { @@ -72,10 +63,7 @@ export const getRelativeProjectPath = ( return packageDirIndex !== -1 ? fsPath.slice(packageDirIndex) : fsPath; }; -export const fileExtensionsMatch = ( - sourceUri: vscode.Uri, - targetExtension: string -): boolean => { +export const fileExtensionsMatch = (sourceUri: vscode.Uri, targetExtension: string): boolean => { const extension = sourceUri.path.split('.').pop()?.toLowerCase(); return extension === targetExtension.toLowerCase(); }; @@ -88,21 +76,12 @@ const stateFolder = (): string => { const metadataFolder = (): string => { const username = WorkspaceContextUtil.getInstance().username; - const pathToMetadataFolder = path.join( - projectPaths.stateFolder(), - ORGS, - String(username), - METADATA - ); + const pathToMetadataFolder = path.join(projectPaths.stateFolder(), ORGS, String(username), METADATA); return pathToMetadataFolder; }; const apexTestResultsFolder = (): string => { - const pathToApexTestResultsFolder = path.join( - toolsFolder(), - TEST_RESULTS, - APEX - ); + const pathToApexTestResultsFolder = path.join(toolsFolder(), TEST_RESULTS, APEX); return pathToApexTestResultsFolder; }; @@ -127,10 +106,7 @@ const debugLogsFolder = (): string => { }; const salesforceProjectConfig = (): string => { - const pathToSalesforceProjectConfig = path.join( - projectPaths.stateFolder(), - SFDX_CONFIG_FILE - ); + const pathToSalesforceProjectConfig = path.join(projectPaths.stateFolder(), SFDX_CONFIG_FILE); return pathToSalesforceProjectConfig; }; @@ -144,10 +120,7 @@ const relativeStateFolder = (): string => { }; const relativeToolsFolder = (): string => { - const relativePathToToolsFolder = path.join( - projectPaths.relativeStateFolder(), - TOOLS - ); + const relativePathToToolsFolder = path.join(projectPaths.relativeStateFolder(), TOOLS); return relativePathToToolsFolder; }; diff --git a/packages/salesforcedx-utils-vscode/src/helpers/traceFlags.ts b/packages/salesforcedx-utils-vscode/src/helpers/traceFlags.ts index f45f2b26b1..fd0b8f4650 100644 --- a/packages/salesforcedx-utils-vscode/src/helpers/traceFlags.ts +++ b/packages/salesforcedx-utils-vscode/src/helpers/traceFlags.ts @@ -57,18 +57,14 @@ export class TraceFlags { } const expirationDate = this.calculateExpirationDate( - traceFlag.ExpirationDate - ? new Date(traceFlag.ExpirationDate) - : new Date() + traceFlag.ExpirationDate ? new Date(traceFlag.ExpirationDate) : new Date() ); return await this.updateTraceFlag(traceFlag.Id, expirationDate); } else { // create a debug level const debugLevelId = await this.createDebugLevel(); if (!debugLevelId) { - throw new Error( - nls.localize('trace_flags_failed_to_create_debug_level') - ); + throw new Error(nls.localize('trace_flags_failed_to_create_debug_level')); } // create a trace flag @@ -87,10 +83,7 @@ export class TraceFlags { ApexCode: 'FINEST', Visualforce: 'FINER' }; - const result = (await this.connection.tooling.update( - 'DebugLevel', - debugLevel - )) as DataRecordResult; + const result = (await this.connection.tooling.update('DebugLevel', debugLevel)) as DataRecordResult; return result.success; } @@ -102,26 +95,17 @@ export class TraceFlags { ApexCode: 'FINEST', Visualforce: 'FINER' }; - const result = (await this.connection.tooling.create( - 'DebugLevel', - debugLevel - )) as DataRecordResult; + const result = (await this.connection.tooling.create('DebugLevel', debugLevel)) as DataRecordResult; return result.success && result.id ? result.id : undefined; } - private async updateTraceFlag( - id: string, - expirationDate: Date - ): Promise { + private async updateTraceFlag(id: string, expirationDate: Date): Promise { const traceFlag = { Id: id, StartDate: Date.now(), ExpirationDate: expirationDate.toUTCString() }; - const result = (await this.connection.tooling.update( - 'TraceFlag', - traceFlag - )) as DataRecordResult; + const result = (await this.connection.tooling.update('TraceFlag', traceFlag)) as DataRecordResult; return result.success; } @@ -138,15 +122,10 @@ export class TraceFlags { ExpirationDate: expirationDate.toUTCString() }; - const result = (await this.connection.tooling.create( - 'TraceFlag', - traceFlag - )) as DataRecordResult; + const result = (await this.connection.tooling.create('TraceFlag', traceFlag)) as DataRecordResult; if (result.success && result.id) { - TraceFlagsRemover.getInstance(this.connection).addNewTraceFlagId( - result.id - ); + TraceFlagsRemover.getInstance(this.connection).addNewTraceFlagId(result.id); return result.id; } else { return undefined; @@ -155,18 +134,12 @@ export class TraceFlags { private isValidDateLength(expirationDate: Date) { const currDate = new Date().valueOf(); - return ( - expirationDate.getTime() - currDate > - this.LOG_TIMER_LENGTH_MINUTES * this.MILLISECONDS_PER_MINUTE - ); + return expirationDate.getTime() - currDate > this.LOG_TIMER_LENGTH_MINUTES * this.MILLISECONDS_PER_MINUTE; } private calculateExpirationDate(expirationDate: Date): Date { if (!this.isValidDateLength(expirationDate)) { - expirationDate = new Date( - Date.now() + - this.LOG_TIMER_LENGTH_MINUTES * this.MILLISECONDS_PER_MINUTE - ); + expirationDate = new Date(Date.now() + this.LOG_TIMER_LENGTH_MINUTES * this.MILLISECONDS_PER_MINUTE); } return expirationDate; } @@ -181,16 +154,13 @@ export class TraceFlags { return userResult.records[0]; } - private async getTraceFlagForUser( - userId: string - ): Promise { + private async getTraceFlagForUser(userId: string): Promise { const traceFlagQuery = ` SELECT id, logtype, startdate, expirationdate, debuglevelid, debuglevel.apexcode, debuglevel.visualforce FROM TraceFlag WHERE logtype='DEVELOPER_LOG' AND TracedEntityId='${userId}' `; - const traceFlagResult = - await this.connection.tooling.query(traceFlagQuery); + const traceFlagResult = await this.connection.tooling.query(traceFlagQuery); if (traceFlagResult.totalSize > 0) { return traceFlagResult.records[0]; diff --git a/packages/salesforcedx-utils-vscode/src/helpers/utils.ts b/packages/salesforcedx-utils-vscode/src/helpers/utils.ts index bd06998380..2894e269f7 100644 --- a/packages/salesforcedx-utils-vscode/src/helpers/utils.ts +++ b/packages/salesforcedx-utils-vscode/src/helpers/utils.ts @@ -51,10 +51,7 @@ export const flushFilePath = (filePath: string): string => { // check if the native path is the same case insensitive and then case sensitive // so that condition can be reported via telemetry - if ( - filePath !== nativePath && - filePath.toLowerCase() === nativePath.toLowerCase() - ) { + if (filePath !== nativePath && filePath.toLowerCase() === nativePath.toLowerCase()) { telemetryService.sendEventData('FilePathCaseMismatch', { originalPath: basename(filePath), nativePath: basename(nativePath) @@ -71,10 +68,7 @@ export const flushFilePaths = (filePaths: string[]): string[] => { return filePaths; }; -export const asyncFilter = async ( - arr: T[], - callback: (value: T, index: number, array: T[]) => unknown -) => { +export const asyncFilter = async (arr: T[], callback: (value: T, index: number, array: T[]) => unknown) => { const results = await Promise.all(arr.map(callback)); return arr.filter((_v, index) => results[index]); diff --git a/packages/salesforcedx-utils-vscode/src/helpers/validations.ts b/packages/salesforcedx-utils-vscode/src/helpers/validations.ts index 4e19de5d9c..c34b4ac264 100644 --- a/packages/salesforcedx-utils-vscode/src/helpers/validations.ts +++ b/packages/salesforcedx-utils-vscode/src/helpers/validations.ts @@ -5,17 +5,10 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ export const isInteger = (value: string | undefined): boolean => { - return ( - value !== undefined && - !/\D/.test(value) && - Number.isSafeInteger(Number.parseInt(value, 10)) - ); + return value !== undefined && !/\D/.test(value) && Number.isSafeInteger(Number.parseInt(value, 10)); }; -export const isIntegerInRange = ( - value: string | undefined, - range: [number, number] -): boolean => { +export const isIntegerInRange = (value: string | undefined, range: [number, number]): boolean => { return ( value !== undefined && isInteger(value) && @@ -29,11 +22,7 @@ export const isAlphaNumString = (value: string | undefined): boolean => { }; export const isRecordIdFormat = (value: string = '', prefix: string): boolean => { - return ( - isAlphaNumString(value) && - value.startsWith(prefix) && - (value.length === 15 || value.length === 18) - ); + return isAlphaNumString(value) && value.startsWith(prefix) && (value.length === 15 || value.length === 18); }; export const isAlphaNumSpaceString = (value: string | undefined): boolean => { diff --git a/packages/salesforcedx-utils-vscode/src/i18n/localization.ts b/packages/salesforcedx-utils-vscode/src/i18n/localization.ts index 14b5cc843a..652f780ddb 100644 --- a/packages/salesforcedx-utils-vscode/src/i18n/localization.ts +++ b/packages/salesforcedx-utils-vscode/src/i18n/localization.ts @@ -66,9 +66,7 @@ export class Message implements LocalizationProvider { const expectedNumArgs = possibleLabel.split('%s').length - 1; if (args.length !== expectedNumArgs) { // just log it, we might want to hide some in some languges on purpose - console.log( - `Arguments do not match for label '${label}', got ${args.length} but want ${expectedNumArgs}` - ); + console.log(`Arguments do not match for label '${label}', got ${args.length} but want ${expectedNumArgs}`); } args.unshift(possibleLabel); diff --git a/packages/salesforcedx-utils-vscode/src/index.ts b/packages/salesforcedx-utils-vscode/src/index.ts index c35a4398fd..0afd077b87 100644 --- a/packages/salesforcedx-utils-vscode/src/index.ts +++ b/packages/salesforcedx-utils-vscode/src/index.ts @@ -6,19 +6,10 @@ */ export * from './commands'; -export { - CompositeParametersGatherer, - EmptyParametersGatherer -} from './commands/parameterGatherers'; +export { CompositeParametersGatherer, EmptyParametersGatherer } from './commands/parameterGatherers'; export { EmptyPostChecker } from './commands/postconditionCheckers'; -export { - EmptyPreChecker, - SfWorkspaceChecker -} from './commands/preconditionCheckers'; -export { - SfCommandletExecutor, - LibraryCommandletExecutor -} from './commands/commandletExecutors'; +export { EmptyPreChecker, SfWorkspaceChecker } from './commands/preconditionCheckers'; +export { SfCommandletExecutor, LibraryCommandletExecutor } from './commands/commandletExecutors'; export { SfCommandlet } from './commands/sfCommandlet'; export { ConfigSource, ConfigUtil } from './config/configUtil'; export { @@ -28,24 +19,13 @@ export { SFDX_LWC_EXTENSION_NAME, TELEMETRY_GLOBAL_USER_ID } from './constants'; -export { - OrgUserInfo, - WorkspaceContextUtil -} from './context/workspaceContextUtil'; -export { - TelemetryService, - TelemetryBuilder -} from './services/telemetry'; +export { OrgUserInfo, WorkspaceContextUtil } from './context/workspaceContextUtil'; +export { TelemetryService, TelemetryBuilder } from './services/telemetry'; export { isInternalHost } from './telemetry/utils/isInternal'; export * from './helpers'; export { TraceFlags } from './helpers/traceFlags'; export { AppInsights } from './telemetry/reporters/appInsights'; -export { - hasRootWorkspace, - getRootWorkspace, - getRootWorkspacePath, - workspaceUtils -} from './workspaces'; +export { hasRootWorkspace, getRootWorkspace, getRootWorkspacePath, workspaceUtils } from './workspaces'; export * from './cli'; export * from './cli/commandExecutor'; export * from './i18n'; diff --git a/packages/salesforcedx-utils-vscode/src/messages/i18n.ja.ts b/packages/salesforcedx-utils-vscode/src/messages/i18n.ja.ts index c453904103..aa95acfd6a 100644 --- a/packages/salesforcedx-utils-vscode/src/messages/i18n.ja.ts +++ b/packages/salesforcedx-utils-vscode/src/messages/i18n.ja.ts @@ -16,8 +16,7 @@ * If omitted, we will assume _message. */ export const messages = { - sfdx_cli_not_found: - 'Salesforce CLI がインストールされていません。[%s](%s) からインストールしてください。', + sfdx_cli_not_found: 'Salesforce CLI がインストールされていません。[%s](%s) からインストールしてください。', telemetry_legal_dialog_message: 'VS Code の Salesforce 拡張機能が製品の改善のために、利用状況、ユーザ環境、クラッシュレポートを収集することに同意しました。[オプトアウトの方法について参照する](%s)。', telemetry_legal_dialog_button_text: 'さらに表示', diff --git a/packages/salesforcedx-utils-vscode/src/messages/i18n.ts b/packages/salesforcedx-utils-vscode/src/messages/i18n.ts index a8e917c53b..e3b7cd6b47 100644 --- a/packages/salesforcedx-utils-vscode/src/messages/i18n.ts +++ b/packages/salesforcedx-utils-vscode/src/messages/i18n.ts @@ -16,8 +16,7 @@ * If omitted, we will assume _message. */ export const messages = { - sfdx_cli_not_found: - 'Salesforce CLI is not installed. Install it from [%s](%s)', + sfdx_cli_not_found: 'Salesforce CLI is not installed. Install it from [%s](%s)', telemetry_legal_dialog_message: 'You agree that Salesforce Extensions for VS Code may collect usage information, user environment, and crash reports for product improvements. Learn how to [opt out](%s).', telemetry_legal_dialog_button_text: 'Read more', @@ -31,8 +30,7 @@ export const messages = { error_no_target_org: 'No default org is set. Run "SFDX: Create a Default Scratch Org" or "SFDX: Authorize an Org" to set one.', - cannot_determine_workspace: - 'Unable to determine workspace folders for workspace', + cannot_determine_workspace: 'Unable to determine workspace folders for workspace', channel_name: 'Salesforce CLI', channel_starting_message: 'Starting ', @@ -41,8 +39,7 @@ export const messages = { 'Salesforce CLI is not installed. Install it from https://developer.salesforce.com/tools/salesforcecli', channel_end_with_error: 'ended with error %s', channel_end: 'ended', - predicates_no_folder_opened_text: - 'No folder opened. Open a Salesforce DX project in VS Code.', + predicates_no_folder_opened_text: 'No folder opened. Open a Salesforce DX project in VS Code.', predicates_no_salesforce_project_found_text: 'No sfdx-project.json found in the root directory of your open project. Open a Salesforce DX project in VS Code.', trace_flags_unknown_user: 'Unknown user', diff --git a/packages/salesforcedx-utils-vscode/src/output/table.ts b/packages/salesforcedx-utils-vscode/src/output/table.ts index a52bc2d057..1ac681d6b6 100644 --- a/packages/salesforcedx-utils-vscode/src/output/table.ts +++ b/packages/salesforcedx-utils-vscode/src/output/table.ts @@ -35,12 +35,7 @@ export class Table { const width = maxColWidths.get(col.key); if (width) { const isLastCol = index === arr.length - 1; - columnHeader += this.fillColumn( - col.label || col.key, - width, - COLUMN_FILLER, - isLastCol - ); + columnHeader += this.fillColumn(col.label || col.key, width, COLUMN_FILLER, isLastCol); headerSeparator += this.fillColumn('', width, HEADER_FILLER, isLastCol); } }); @@ -59,12 +54,7 @@ export class Table { const cellWidth = maxColWidths.get(col.key); if (cellWidth) { if (lineIndex === 0) { - outputRow += this.fillColumn( - line, - cellWidth, - COLUMN_FILLER, - isLastCol - ); + outputRow += this.fillColumn(line, cellWidth, COLUMN_FILLER, isLastCol); } else { // If the cell is multiline, add an additional line to the table // and pad it to the beginning of the current column @@ -100,9 +90,7 @@ export class Table { // if a cell is multiline, find the line that's the longest const longestLineWidth = cell .split('\n') - .reduce((maxLine, line) => - line.length > maxLine.length ? line : maxLine - ).length; + .reduce((maxLine, line) => (line.length > maxLine.length ? line : maxLine)).length; if (longestLineWidth > maxColWidth) { maxColWidths.set(col.key, longestLineWidth); } @@ -111,12 +99,7 @@ export class Table { return maxColWidths; } - private fillColumn( - label: string, - width: number, - filler: string, - isLastCol: boolean - ): string { + private fillColumn(label: string, width: number, filler: string, isLastCol: boolean): string { let filled = label; for (let i = 0; i < width - label.length; i++) { filled += filler; diff --git a/packages/salesforcedx-utils-vscode/src/providers/sourceTrackingProvider.ts b/packages/salesforcedx-utils-vscode/src/providers/sourceTrackingProvider.ts index be1f369d27..dfa3c9903c 100644 --- a/packages/salesforcedx-utils-vscode/src/providers/sourceTrackingProvider.ts +++ b/packages/salesforcedx-utils-vscode/src/providers/sourceTrackingProvider.ts @@ -6,10 +6,7 @@ */ import { Connection, Org, SfProject } from '@salesforce/core-bundle'; -import { - SourceTracking, - SourceTrackingOptions -} from '@salesforce/source-tracking-bundle'; +import { SourceTracking, SourceTrackingOptions } from '@salesforce/source-tracking-bundle'; /* * The SourceTrackingProvider class is used to instantiate @@ -31,10 +28,7 @@ export class SourceTrackingProvider { this.sourceTrackers = new Map(); } - public async getSourceTracker( - projectPath: string, - connection: Connection - ): Promise { + public async getSourceTracker(projectPath: string, connection: Connection): Promise { const username = connection.getUsername(); const key = projectPath + username; let sourceTracker = this.sourceTrackers.get(key); @@ -54,10 +48,7 @@ export class SourceTrackingProvider { * is no need to call process.chdir here as has been done in VSCE * with other core types like Config and ConfigAggregator. */ - private async createSourceTracking( - projectPath: string, - connection: Connection - ): Promise { + private async createSourceTracking(projectPath: string, connection: Connection): Promise { const project = await SfProject.resolve(projectPath); const org = await Org.create({ connection }); const options: SourceTrackingOptions = { diff --git a/packages/salesforcedx-utils-vscode/src/services/index.ts b/packages/salesforcedx-utils-vscode/src/services/index.ts index 4d798a124c..1a6f317a08 100644 --- a/packages/salesforcedx-utils-vscode/src/services/index.ts +++ b/packages/salesforcedx-utils-vscode/src/services/index.ts @@ -5,10 +5,5 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -export { - SourceTrackingType, - SourceTrackingService -} from './sourceTrackingService'; -export { - UserService -} from './userService'; +export { SourceTrackingType, SourceTrackingService } from './sourceTrackingService'; +export { UserService } from './userService'; diff --git a/packages/salesforcedx-utils-vscode/src/services/sourceTrackingService.ts b/packages/salesforcedx-utils-vscode/src/services/sourceTrackingService.ts index 182a7fc38d..4e7711138f 100644 --- a/packages/salesforcedx-utils-vscode/src/services/sourceTrackingService.ts +++ b/packages/salesforcedx-utils-vscode/src/services/sourceTrackingService.ts @@ -21,34 +21,23 @@ export class SourceTrackingService { * Gets the Source Tracking instance for this project * from the Source Tracking Provider. */ - public static async getSourceTracking( - projectPath: string, - connection: Connection - ): Promise { + public static async getSourceTracking(projectPath: string, connection: Connection): Promise { const provider = SourceTrackingProvider.getInstance(); const tracker = provider.getSourceTracker(projectPath, connection); return tracker; } - public static async updateSourceTrackingAfterRetrieve( - sourceTracking: SourceTracking, - result: RetrieveResult - ) { + public static async updateSourceTrackingAfterRetrieve(sourceTracking: SourceTracking, result: RetrieveResult) { await sourceTracking.updateTrackingFromRetrieve(result); } - public static async getSourceStatusSummary({ - local = true, - remote = true - }): Promise { + public static async getSourceStatusSummary({ local = true, remote = true }): Promise { const sourceTracking = await this.getSourceTrackingForCurrentProject(); const statusResponse = await sourceTracking.getStatus({ local, remote }); - const sourceStatusSummary: SourceStatusSummary = new SourceStatusSummary( - statusResponse - ); + const sourceStatusSummary: SourceStatusSummary = new SourceStatusSummary(statusResponse); return sourceStatusSummary.format(); } @@ -57,10 +46,7 @@ export class SourceTrackingService { const workspaceContext = WorkspaceContextUtil.getInstance(); const connection = await workspaceContext.getConnection(); const sourceTrackingProvider = SourceTrackingProvider.getInstance(); - const sourceTracking = await sourceTrackingProvider.getSourceTracker( - rootWorkspacePath, - connection - ); + const sourceTracking = await sourceTrackingProvider.getSourceTracker(rootWorkspacePath, connection); return sourceTracking; } } @@ -91,9 +77,7 @@ export class SourceStatusSummary { constructor(private statusOutputRows: StatusOutputRow[]) {} public format(): string { - const statusResults = this.statusOutputRows.map(row => - this.resultConverter(row) - ); + const statusResults = this.statusOutputRows.map(row => this.resultConverter(row)); if (statusResults.length === 0) { return nls.localize('no_local_or_remote_changes_found'); @@ -126,18 +110,12 @@ export class SourceStatusSummary { }; }; - private static originMap = new Map< - StatusOutputRow['origin'], - StatusResult['origin'] - >([ + private static originMap = new Map([ ['local', 'Local'], ['remote', 'Remote'] ]); - private static stateMap = new Map< - StatusOutputRow['state'], - StatusResult['actualState'] - >([ + private static stateMap = new Map([ ['delete', 'Deleted'], ['add', 'Add'], ['modify', 'Changed'], @@ -165,23 +143,15 @@ class StatusResultsTable { ]; private columns = this.statusResults.some(result => result.ignored) - ? [ - { label: nls.localize('ignored'), key: 'ignored' }, - ...StatusResultsTable.baseColumns - ] + ? [{ label: nls.localize('ignored'), key: 'ignored' }, ...StatusResultsTable.baseColumns] : StatusResultsTable.baseColumns; constructor(private statusResults: StatusResult[]) {} public value(): string { - this.statusResults.forEach(statusResult => - this.convertToTableRow(statusResult) - ); - - const table: string = new Table().createTable( - this.statusResults as unknown as Row[], - this.columns - ); + this.statusResults.forEach(statusResult => this.convertToTableRow(statusResult)); + + const table: string = new Table().createTable(this.statusResults as unknown as Row[], this.columns); return table; } diff --git a/packages/salesforcedx-utils-vscode/src/services/telemetry.ts b/packages/salesforcedx-utils-vscode/src/services/telemetry.ts index da4e8c0b17..02e61ff92c 100644 --- a/packages/salesforcedx-utils-vscode/src/services/telemetry.ts +++ b/packages/salesforcedx-utils-vscode/src/services/telemetry.ts @@ -20,16 +20,12 @@ import { SFDX_CORE_EXTENSION_NAME, SFDX_EXTENSION_PACK_NAME } from '../constants'; -import { - disableCLITelemetry, - isCLITelemetryAllowed -} from '../telemetry/cliConfiguration'; +import { disableCLITelemetry, isCLITelemetryAllowed } from '../telemetry/cliConfiguration'; import { determineReporters } from '../telemetry/reporters/determineReporters'; import { TelemetryReporterConfig } from '../telemetry/reporters/telemetryReporterConfig'; import { isInternalHost } from '../telemetry/utils/isInternal'; import { UserService } from './userService'; - type CommandMetric = { extensionName: string; commandName: string; @@ -105,10 +101,12 @@ export class TelemetryService implements TelemetryServiceInterface { * Initialize Telemetry Service during extension activation. * @param extensionContext extension context */ - public async initializeService( - extensionContext: ExtensionContext - ): Promise { - const { name, version, aiKey } = extensionContext.extension.packageJSON as { name: string; version: string; aiKey: string }; + public async initializeService(extensionContext: ExtensionContext): Promise { + const { name, version, aiKey } = extensionContext.extension.packageJSON as { + name: string; + version: string; + aiKey: string; + }; if (!name) { console.log('Extension name is not defined in package.json'); } @@ -124,9 +122,7 @@ export class TelemetryService implements TelemetryServiceInterface { this.checkCliTelemetry() .then(cliEnabled => { - this.setCliTelemetryEnabled( - this.isTelemetryExtensionConfigurationEnabled() && cliEnabled - ); + this.setCliTelemetryEnabled(this.isTelemetryExtensionConfigurationEnabled() && cliEnabled); }) .catch(error => { console.log('Error initializing telemetry service: ' + error); @@ -156,9 +152,7 @@ export class TelemetryService implements TelemetryServiceInterface { * exported only for unit test */ public getTelemetryReporterName(): string { - return this.extensionName.startsWith(SFDX_EXTENSION_PACK_NAME) - ? SFDX_EXTENSION_PACK_NAME - : this.extensionName; + return this.extensionName.startsWith(SFDX_EXTENSION_PACK_NAME) ? SFDX_EXTENSION_PACK_NAME : this.extensionName; } public getReporters(): TelemetryReporter[] { @@ -166,9 +160,7 @@ export class TelemetryService implements TelemetryServiceInterface { } public async isTelemetryEnabled(): Promise { - return this.isInternal - ? true - : (this.isTelemetryExtensionConfigurationEnabled() && await this.checkCliTelemetry()); + return this.isInternal ? true : this.isTelemetryExtensionConfigurationEnabled() && (await this.checkCliTelemetry()); } public async checkCliTelemetry(): Promise { @@ -181,12 +173,8 @@ export class TelemetryService implements TelemetryServiceInterface { public isTelemetryExtensionConfigurationEnabled(): boolean { return ( - workspace - .getConfiguration('telemetry') - .get('enableTelemetry', true) && - workspace - .getConfiguration(SFDX_CORE_CONFIGURATION_NAME) - .get('telemetry.enabled', true) + workspace.getConfiguration('telemetry').get('enableTelemetry', true) && + workspace.getConfiguration(SFDX_CORE_CONFIGURATION_NAME).get('telemetry.enabled', true) ); } @@ -199,25 +187,12 @@ export class TelemetryService implements TelemetryServiceInterface { public sendActivationEventInfo(activationInfo: ActivationInfo) { const telemetryBuilder = new TelemetryBuilder(); const telemetryData = telemetryBuilder - .addProperty( - 'activateStartDate', - activationInfo.activateStartDate?.toISOString() - ) - .addProperty( - 'activateEndDate', - activationInfo.activateEndDate?.toISOString() - ) + .addProperty('activateStartDate', activationInfo.activateStartDate?.toISOString()) + .addProperty('activateEndDate', activationInfo.activateEndDate?.toISOString()) .addProperty('loadStartDate', activationInfo.loadStartDate?.toISOString()) - .addMeasurement( - 'extensionActivationTime', - activationInfo.extensionActivationTime - ) + .addMeasurement('extensionActivationTime', activationInfo.extensionActivationTime) .build(); - this.sendExtensionActivationEvent( - activationInfo.startActivateHrTime, - activationInfo.markEndTime, - telemetryData - ); + this.sendExtensionActivationEvent(activationInfo.startActivateHrTime, activationInfo.markEndTime, telemetryData); } public sendExtensionActivationEvent( @@ -237,11 +212,7 @@ export class TelemetryService implements TelemetryServiceInterface { this.validateTelemetry(() => { this.reporters.forEach(reporter => { - reporter.sendTelemetryEvent( - 'activationEvent', - properties, - measurements - ); + reporter.sendTelemetryEvent('activationEvent', properties, measurements); }); }); } @@ -278,11 +249,7 @@ export class TelemetryService implements TelemetryServiceInterface { } } this.reporters.forEach(reporter => { - reporter.sendTelemetryEvent( - 'commandExecution', - aggregatedProps, - aggregatedMeasurements - ); + reporter.sendTelemetryEvent('commandExecution', aggregatedProps, aggregatedMeasurements); }); } }); @@ -296,12 +263,12 @@ export class TelemetryService implements TelemetryServiceInterface { } catch (error) { console.log( 'There was an error sending an exception report to: ' + - typeof reporter + - ' ' + - 'name: ' + - name + - ' message: ' + - message + typeof reporter + + ' ' + + 'name: ' + + name + + ' message: ' + + message ); } }); diff --git a/packages/salesforcedx-utils-vscode/src/services/userService.ts b/packages/salesforcedx-utils-vscode/src/services/userService.ts index 6b9cb397d8..7dbe5c01d5 100644 --- a/packages/salesforcedx-utils-vscode/src/services/userService.ts +++ b/packages/salesforcedx-utils-vscode/src/services/userService.ts @@ -14,13 +14,9 @@ export class UserService { private static getRandomUserId = (): string => randomBytes(20).toString('hex'); private static async executeCliTelemetry(): Promise { - const command = new SfCommandBuilder() - .withArg('telemetry') - .withJson() - .build(); + const command = new SfCommandBuilder().withArg('telemetry').withJson().build(); const workspacePath = workspaceUtils.getRootWorkspacePath(); - const execution = new CliCommandExecutor(command, { cwd: workspacePath } - ).execute(); + const execution = new CliCommandExecutor(command, { cwd: workspacePath }).execute(); const cmdOutput = new CommandOutput(); const result = cmdOutput.getCmdResult(execution); return result; @@ -30,9 +26,7 @@ export class UserService { // Defining UserId in globalState and using the same in appInsights reporter. // Assigns cliId to UserId when it's undefined in global state. // cliId is undefined when cli-telemetry variable disable-telemetry is true. - let globalStateUserId = extensionContext?.globalState.get< - string | undefined - >(TELEMETRY_GLOBAL_USER_ID); + let globalStateUserId = extensionContext?.globalState.get(TELEMETRY_GLOBAL_USER_ID); if (globalStateUserId) { return globalStateUserId; @@ -46,18 +40,12 @@ export class UserService { return cmdResult?.result?.cliId ?? this.getRandomUserId(); }) .catch(error => { - console.log( - `Error: ${error} occurred in retrieving cliId, generating user-id ..` - ); + console.log(`Error: ${error} occurred in retrieving cliId, generating user-id ..`); return this.getRandomUserId(); }); // If the random UserId value is used here it will be unique per extension. - await extensionContext?.globalState.update( - TELEMETRY_GLOBAL_USER_ID, - globalStateUserId - ); + await extensionContext?.globalState.update(TELEMETRY_GLOBAL_USER_ID, globalStateUserId); return globalStateUserId; } - } diff --git a/packages/salesforcedx-utils-vscode/src/settings/settingsService.ts b/packages/salesforcedx-utils-vscode/src/settings/settingsService.ts index d6db1e4a0f..51f9f76239 100644 --- a/packages/salesforcedx-utils-vscode/src/settings/settingsService.ts +++ b/packages/salesforcedx-utils-vscode/src/settings/settingsService.ts @@ -5,12 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ import * as vscode from 'vscode'; -import { - ADVANCED, - SETTING_CLEAR_OUTPUT_TAB, - SFDX_CORE_CONFIGURATION_NAME, - TRUE -} from '../constants'; +import { ADVANCED, SETTING_CLEAR_OUTPUT_TAB, SFDX_CORE_CONFIGURATION_NAME, TRUE } from '../constants'; export enum AdvancedSettings { LOCAL_TELEMETRY_LOGGING = 'localTelemetryLogging' @@ -23,14 +18,7 @@ export class SettingsService { .get(SETTING_CLEAR_OUTPUT_TAB, false); } - public static isAdvancedSettingEnabledFor( - extensionName: string, - advancedSetting: AdvancedSettings - ): boolean { - return ( - vscode.workspace - .getConfiguration() - .get(`${extensionName}.${ADVANCED}.${advancedSetting}`) === TRUE - ); + public static isAdvancedSettingEnabledFor(extensionName: string, advancedSetting: AdvancedSettings): boolean { + return vscode.workspace.getConfiguration().get(`${extensionName}.${ADVANCED}.${advancedSetting}`) === TRUE; } } diff --git a/packages/salesforcedx-utils-vscode/src/telemetry/cliConfiguration.ts b/packages/salesforcedx-utils-vscode/src/telemetry/cliConfiguration.ts index e3bf87ae82..cabd3b0e95 100644 --- a/packages/salesforcedx-utils-vscode/src/telemetry/cliConfiguration.ts +++ b/packages/salesforcedx-utils-vscode/src/telemetry/cliConfiguration.ts @@ -11,10 +11,7 @@ import { ConfigUtil } from '../config/configUtil'; export const ENV_SF_DISABLE_TELEMETRY = 'SF_DISABLE_TELEMETRY'; export const disableCLITelemetry = () => { - GlobalCliEnvironment.environmentVariables.set( - ENV_SF_DISABLE_TELEMETRY, - 'true' - ); + GlobalCliEnvironment.environmentVariables.set(ENV_SF_DISABLE_TELEMETRY, 'true'); }; export const isCLITelemetryAllowed = async (): Promise => { diff --git a/packages/salesforcedx-utils-vscode/src/telemetry/reporters/appInsights.ts b/packages/salesforcedx-utils-vscode/src/telemetry/reporters/appInsights.ts index cdba57af91..00faa2e362 100644 --- a/packages/salesforcedx-utils-vscode/src/telemetry/reporters/appInsights.ts +++ b/packages/salesforcedx-utils-vscode/src/telemetry/reporters/appInsights.ts @@ -38,21 +38,13 @@ export class AppInsights extends Disposable implements TelemetryReporter { } this.setTelemetryTag(); this.updateUserOptIn(key); - this.toDispose.push( - workspace.onDidChangeConfiguration(() => this.updateUserOptIn(key)) - ); + this.toDispose.push(workspace.onDidChangeConfiguration(() => this.updateUserOptIn(key))); } private updateUserOptIn(key: string): void { const config = workspace.getConfiguration(AppInsights.TELEMETRY_CONFIG_ID); - if ( - this.userOptIn !== - config.get(AppInsights.TELEMETRY_CONFIG_ENABLED_ID, true) - ) { - this.userOptIn = config.get( - AppInsights.TELEMETRY_CONFIG_ENABLED_ID, - true - ); + if (this.userOptIn !== config.get(AppInsights.TELEMETRY_CONFIG_ENABLED_ID, true)) { + this.userOptIn = config.get(AppInsights.TELEMETRY_CONFIG_ENABLED_ID, true); if (this.userOptIn) { this.createAppInsightsClient(key); } else { @@ -86,28 +78,20 @@ export class AppInsights extends Disposable implements TelemetryReporter { if (this.uniqueUserMetrics && env) { this.appInsightsClient.context.tags['ai.user.id'] = this.userId; this.appInsightsClient.context.tags['ai.session.id'] = env.sessionId; - this.appInsightsClient.context.tags['ai.cloud.roleInstance'] = - 'DEPRECATED'; + this.appInsightsClient.context.tags['ai.cloud.roleInstance'] = 'DEPRECATED'; } // check if it's an Asimov key to change the endpoint if (key && key.indexOf('AIF-') === 0) { - this.appInsightsClient.config.endpointUrl = - 'https://vortex.data.microsoft.com/collect/v1'; + this.appInsightsClient.config.endpointUrl = 'https://vortex.data.microsoft.com/collect/v1'; } } private getCommonProperties(): CommonProperties { const commonProperties: CommonProperties = { 'common.os': os.platform(), - 'common.platformversion': (os.release() || '').replace( - /^(\d+)(\.\d+)?(\.\d+)?(.*)/, - '$1$2$3' - ), - 'common.systemmemory': `${( - os.totalmem() / - (1024 * 1024 * 1024) - ).toFixed(2)} GB`, + 'common.platformversion': (os.release() || '').replace(/^(\d+)(\.\d+)?(\.\d+)?(.*)/, '$1$2$3'), + 'common.systemmemory': `${(os.totalmem() / (1024 * 1024 * 1024)).toFixed(2)} GB`, 'common.extname': this.extensionId, 'common.extversion': this.extensionVersion }; @@ -131,14 +115,14 @@ export class AppInsights extends Disposable implements TelemetryReporter { private getInternalProperties(): InternalProperties { return { - 'sfInternal.hostname': os.hostname(), - 'sfInternal.username': os.userInfo().username + 'sfInternal.hostname': os.hostname(), + 'sfInternal.username': os.userInfo().username }; } private aggregateLoggingProperties() { const commonProperties = this.getCommonProperties(); - return isInternalHost() ? {...commonProperties,...this.getInternalProperties() } : commonProperties; + return isInternalHost() ? { ...commonProperties, ...this.getInternalProperties() } : commonProperties; } public sendTelemetryEvent( @@ -205,8 +189,7 @@ export class AppInsights extends Disposable implements TelemetryReporter { */ private setTelemetryTag(): void { const config = workspace.getConfiguration(); - this.telemetryTag = - config?.get('salesforcedx-vscode-core.telemetry-tag') || undefined; + this.telemetryTag = config?.get('salesforcedx-vscode-core.telemetry-tag') || undefined; } /** @@ -219,8 +202,6 @@ export class AppInsights extends Disposable implements TelemetryReporter { private applyTelemetryTag(properties: { [key: string]: string }): { [key: string]: string; } { - return this.telemetryTag - ? { ...properties, telemetryTag: this.telemetryTag } - : properties; + return this.telemetryTag ? { ...properties, telemetryTag: this.telemetryTag } : properties; } } diff --git a/packages/salesforcedx-utils-vscode/src/telemetry/reporters/determineReporters.ts b/packages/salesforcedx-utils-vscode/src/telemetry/reporters/determineReporters.ts index 13615d8485..285bda9c71 100644 --- a/packages/salesforcedx-utils-vscode/src/telemetry/reporters/determineReporters.ts +++ b/packages/salesforcedx-utils-vscode/src/telemetry/reporters/determineReporters.ts @@ -13,10 +13,10 @@ import { TelemetryFile } from './telemetryFile'; import { TelemetryReporterConfig } from './telemetryReporterConfig'; export const determineReporters = (config: TelemetryReporterConfig) => { - const {extName, version, aiKey, userId, reporterName, isDevMode} = config; + const { extName, version, aiKey, userId, reporterName, isDevMode } = config; const reporters: TelemetryReporter[] = []; - if(isDevMode) { + if (isDevMode) { addDevModeReporter(reporters, extName); } else { addAppInsightsReporter(reporters, reporterName, version, aiKey, userId); @@ -26,39 +26,32 @@ export const determineReporters = (config: TelemetryReporterConfig) => { }; const addDevModeReporter = (reporters: TelemetryReporter[], extName: string) => { - if(isLocalLogging(extName)) { + if (isLocalLogging(extName)) { // The new TelemetryFile reporter is run in Dev mode, and only // requires the advanced setting to be set re: configuration. reporters.push(new TelemetryFile(extName)); } }; -const addAppInsightsReporter = (reporters: TelemetryReporter[], reporterName: string, version: string, aiKey: string, userId: string) => { +const addAppInsightsReporter = ( + reporters: TelemetryReporter[], + reporterName: string, + version: string, + aiKey: string, + userId: string +) => { console.log('adding AppInsights reporter.'); - reporters.push( - new AppInsights( - reporterName, - version, - aiKey, - userId, - true - ) - ); + reporters.push(new AppInsights(reporterName, version, aiKey, userId, true)); }; /* -* Assuming this fs streaming is more efficient than the appendFile technique that -* the new TelemetryFile reporter uses, I am keeping the logic in place for which -* reporter is used when. The original log stream functionality only worked under -* the same conditions as the AppInsights capabilities, but with additional configuration. -*/ + * Assuming this fs streaming is more efficient than the appendFile technique that + * the new TelemetryFile reporter uses, I am keeping the logic in place for which + * reporter is used when. The original log stream functionality only worked under + * the same conditions as the AppInsights capabilities, but with additional configuration. + */ const addLogstreamReporter = (reporters: TelemetryReporter[], extName: string) => { - if(LogStreamConfig.isEnabledFor(extName)) { - reporters.push( - new LogStream( - extName, - LogStreamConfig.logFilePath() - ) - ); + if (LogStreamConfig.isEnabledFor(extName)) { + reporters.push(new LogStream(extName, LogStreamConfig.logFilePath())); } }; diff --git a/packages/salesforcedx-utils-vscode/src/telemetry/reporters/logStream.ts b/packages/salesforcedx-utils-vscode/src/telemetry/reporters/logStream.ts index 8ac299e6c7..b4768692f2 100644 --- a/packages/salesforcedx-utils-vscode/src/telemetry/reporters/logStream.ts +++ b/packages/salesforcedx-utils-vscode/src/telemetry/reporters/logStream.ts @@ -70,9 +70,7 @@ export class LogStream extends Disposable implements TelemetryReporter { ): void { const orgId = WorkspaceContextUtil.getInstance().orgId || ''; const properties = { orgId }; - console.log( - 'LogStream.sendExceptionEvent - exceptionMessage: ' + exceptionMessage - ); + console.log('LogStream.sendExceptionEvent - exceptionMessage: ' + exceptionMessage); if (this.stream) { this.stream.write( diff --git a/packages/salesforcedx-utils-vscode/src/telemetry/reporters/logStreamConfig.ts b/packages/salesforcedx-utils-vscode/src/telemetry/reporters/logStreamConfig.ts index 1be210282d..ae538249d2 100644 --- a/packages/salesforcedx-utils-vscode/src/telemetry/reporters/logStreamConfig.ts +++ b/packages/salesforcedx-utils-vscode/src/telemetry/reporters/logStreamConfig.ts @@ -24,10 +24,6 @@ export class LogStreamConfig { */ public static isEnabledFor(extensionName: string): boolean | '' { const vsCodeLogLevelTrace = process.env['VSCODE_LOG_LEVEL'] === 'trace'; - return !!( - LogStreamConfig.logFilePath() && - extensionName && - vsCodeLogLevelTrace - ); + return !!(LogStreamConfig.logFilePath() && extensionName && vsCodeLogLevelTrace); } } diff --git a/packages/salesforcedx-utils-vscode/src/telemetry/reporters/telemetryFile.ts b/packages/salesforcedx-utils-vscode/src/telemetry/reporters/telemetryFile.ts index 7cfb2f4f9a..f37d76a8ff 100644 --- a/packages/salesforcedx-utils-vscode/src/telemetry/reporters/telemetryFile.ts +++ b/packages/salesforcedx-utils-vscode/src/telemetry/reporters/telemetryFile.ts @@ -67,16 +67,10 @@ export class TelemetryFile implements TelemetryReporter { ) { const timestamp = new Date().toISOString(); - await fs.promises.appendFile( - this.filePath, - JSON.stringify({ timestamp, command, data }, null, 2) + ',' - ); + await fs.promises.appendFile(this.filePath, JSON.stringify({ timestamp, command, data }, null, 2) + ','); } private logFilePathFor(extensionId: string): string { - return path.join( - getRootWorkspacePath(), - `${extensionId}-${LOCAL_TELEMETRY_FILE}` - ); + return path.join(getRootWorkspacePath(), `${extensionId}-${LOCAL_TELEMETRY_FILE}`); } } diff --git a/packages/salesforcedx-utils-vscode/src/types/index.ts b/packages/salesforcedx-utils-vscode/src/types/index.ts index f5d32625fc..f188b5560d 100644 --- a/packages/salesforcedx-utils-vscode/src/types/index.ts +++ b/packages/salesforcedx-utils-vscode/src/types/index.ts @@ -26,9 +26,7 @@ export type PreconditionChecker = { }; export type PostconditionChecker = { - check( - inputs: ContinueResponse | CancelResponse - ): Promise | CancelResponse>; + check(inputs: ContinueResponse | CancelResponse): Promise | CancelResponse>; }; // Input gathering diff --git a/packages/salesforcedx-utils-vscode/src/workspaces/index.ts b/packages/salesforcedx-utils-vscode/src/workspaces/index.ts index 757069c9b0..fa966c21e1 100644 --- a/packages/salesforcedx-utils-vscode/src/workspaces/index.ts +++ b/packages/salesforcedx-utils-vscode/src/workspaces/index.ts @@ -5,10 +5,6 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -export { - hasRootWorkspace, - getRootWorkspace, - getRootWorkspacePath -} from './rootWorkspace'; +export { hasRootWorkspace, getRootWorkspace, getRootWorkspacePath } from './rootWorkspace'; export { workspaceUtils } from './workspaceUtils'; diff --git a/packages/salesforcedx-utils-vscode/src/workspaces/rootWorkspace.ts b/packages/salesforcedx-utils-vscode/src/workspaces/rootWorkspace.ts index 1a575ca3b4..e50cc799c0 100644 --- a/packages/salesforcedx-utils-vscode/src/workspaces/rootWorkspace.ts +++ b/packages/salesforcedx-utils-vscode/src/workspaces/rootWorkspace.ts @@ -13,9 +13,7 @@ export const hasRootWorkspace = (ws: typeof workspace = workspace) => { }; export const getRootWorkspace = (): WorkspaceFolder => { - return hasRootWorkspace() - ? workspace.workspaceFolders![0] - : ({} as WorkspaceFolder); + return hasRootWorkspace() ? workspace.workspaceFolders![0] : ({} as WorkspaceFolder); }; export const getRootWorkspacePath = (): string => { diff --git a/packages/salesforcedx-utils-vscode/src/workspaces/workspaceUtils.ts b/packages/salesforcedx-utils-vscode/src/workspaces/workspaceUtils.ts index 718d4b571a..df1c9453b9 100644 --- a/packages/salesforcedx-utils-vscode/src/workspaces/workspaceUtils.ts +++ b/packages/salesforcedx-utils-vscode/src/workspaces/workspaceUtils.ts @@ -12,9 +12,7 @@ const hasRootWorkspace = (ws: typeof workspace = workspace) => { }; const getRootWorkspace = (): WorkspaceFolder => { - return hasRootWorkspace() - ? workspace.workspaceFolders![0] - : ({} as WorkspaceFolder); + return hasRootWorkspace() ? workspace.workspaceFolders![0] : ({} as WorkspaceFolder); }; const getRootWorkspacePath = (): string => { diff --git a/packages/salesforcedx-utils-vscode/test/.eslintrc.json b/packages/salesforcedx-utils-vscode/test/.eslintrc.json deleted file mode 100644 index f2b99a417d..0000000000 --- a/packages/salesforcedx-utils-vscode/test/.eslintrc.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": [ - "../.eslintrc.json", - "../../../config/common-test-lint-rules.json" - ] -} diff --git a/packages/salesforcedx-utils-vscode/test/jest/cli/orgDisplay.test.ts b/packages/salesforcedx-utils-vscode/test/jest/cli/orgDisplay.test.ts index 64e4f626d0..13c518fab1 100644 --- a/packages/salesforcedx-utils-vscode/test/jest/cli/orgDisplay.test.ts +++ b/packages/salesforcedx-utils-vscode/test/jest/cli/orgDisplay.test.ts @@ -7,11 +7,7 @@ import { SfCommandBuilder } from '../../../src/cli/commandBuilder'; import { CliCommandExecutor } from '../../../src/cli/commandExecutor'; import { CommandOutput } from '../../../src/cli/commandOutput'; -import { - ORG_DISPLAY_COMMAND, - OrgDisplay, - OrgInfo -} from '../../../src/cli/orgDisplay'; +import { ORG_DISPLAY_COMMAND, OrgDisplay, OrgInfo } from '../../../src/cli/orgDisplay'; jest.mock('../../../src/cli/commandExecutor'); jest.mock('../../../src/cli/commandBuilder'); @@ -52,9 +48,7 @@ describe('orgDisplay Unit Tests.', () => { withJson: jest.fn().mockReturnThis(), build: jest.fn().mockReturnValue(fakeCommandOuput) }); - (sfCommandBuilderMock.prototype.withJson as any).mockReturnValue( - SfCommandBuilder.prototype - ); + (sfCommandBuilderMock.prototype.withJson as any).mockReturnValue(SfCommandBuilder.prototype); (commandOutputMock.prototype.getCmdResult as any).mockResolvedValue( JSON.stringify({ result: fakeOrgInfo @@ -71,9 +65,7 @@ describe('orgDisplay Unit Tests.', () => { expect(sfCommandBuilderMock).toHaveBeenCalled(); const mockSfCommandBuilder = sfCommandBuilderMock.mock.instances[0]; expect(mockSfCommandBuilder.withArg).toHaveBeenCalledTimes(1); - expect(mockSfCommandBuilder.withArg).toHaveBeenCalledWith( - ORG_DISPLAY_COMMAND - ); + expect(mockSfCommandBuilder.withArg).toHaveBeenCalledWith(ORG_DISPLAY_COMMAND); expect(cliCommandExecutorMock).toHaveBeenCalledWith(fakeCommandOuput, { cwd: fakeProjectPath @@ -88,9 +80,7 @@ describe('orgDisplay Unit Tests.', () => { it('Should reject if fails to parse orgInfo.', () => { const badJson = '{so:not:value:json}'; - (commandOutputMock.prototype.getCmdResult as any).mockResolvedValue( - badJson - ); + (commandOutputMock.prototype.getCmdResult as any).mockResolvedValue(badJson); const orgDisplay = new OrgDisplay(); // tslint:disable-next-line:no-floating-promises diff --git a/packages/salesforcedx-utils-vscode/test/jest/config/configUtil.test.ts b/packages/salesforcedx-utils-vscode/test/jest/config/configUtil.test.ts index f60aaa867f..651894f28e 100644 --- a/packages/salesforcedx-utils-vscode/test/jest/config/configUtil.test.ts +++ b/packages/salesforcedx-utils-vscode/test/jest/config/configUtil.test.ts @@ -26,12 +26,8 @@ describe('testing setTargetOrgOrAlias and private method setUsernameOrAlias', () let stateAggregatorClearInstanceMock: jest.SpyInstance; beforeEach(() => { - workspacePathStub = jest - .spyOn(workspaceUtils, 'getRootWorkspacePath') - .mockReturnValue(fakeWorkspace); - originalDirectoryStub = jest - .spyOn(process, 'cwd') - .mockReturnValue(fakeOriginalDirectory); + workspacePathStub = jest.spyOn(workspaceUtils, 'getRootWorkspacePath').mockReturnValue(fakeWorkspace); + originalDirectoryStub = jest.spyOn(process, 'cwd').mockReturnValue(fakeOriginalDirectory); setMock = jest.fn(); writeMock = jest.fn(); configStub = jest.spyOn(Config, 'create'); @@ -41,10 +37,7 @@ describe('testing setTargetOrgOrAlias and private method setUsernameOrAlias', () mockConfigAggregatorProvider = jest .spyOn(ConfigAggregatorProvider, 'getInstance') .mockReturnValue(mockConfigAggregatorProviderInstance as any); - stateAggregatorClearInstanceMock = jest.spyOn( - StateAggregator, - 'clearInstance' - ); + stateAggregatorClearInstanceMock = jest.spyOn(StateAggregator, 'clearInstance'); }); it('should set provided username or alias as default configs', async () => { @@ -71,17 +64,12 @@ describe('testing setTargetOrgOrAlias and private method setUsernameOrAlias', () expect(setMock).toHaveBeenCalledWith(TARGET_ORG_KEY, username); expect(writeMock).toHaveBeenCalled(); expect(mockConfigAggregatorProvider).toHaveBeenCalled(); - expect( - mockConfigAggregatorProviderInstance.reloadConfigAggregators - ).toHaveBeenCalled(); + expect(mockConfigAggregatorProviderInstance.reloadConfigAggregators).toHaveBeenCalled(); expect(stateAggregatorClearInstanceMock).toHaveBeenCalled(); const writeCallOrder = writeMock.mock.invocationCallOrder[0]; - const reloadCallOrder = - mockConfigAggregatorProviderInstance.reloadConfigAggregators.mock - .invocationCallOrder[0]; - const clearInstanceCallOrder = - stateAggregatorClearInstanceMock.mock.invocationCallOrder[0]; + const reloadCallOrder = mockConfigAggregatorProviderInstance.reloadConfigAggregators.mock.invocationCallOrder[0]; + const clearInstanceCallOrder = stateAggregatorClearInstanceMock.mock.invocationCallOrder[0]; expect(writeCallOrder).toBeLessThan(reloadCallOrder); expect(reloadCallOrder).toBeLessThan(clearInstanceCallOrder); @@ -105,12 +93,8 @@ describe('testing unsetTargetOrg', () => { let stateAggregatorClearInstanceMock: jest.SpyInstance; beforeEach(() => { - workspacePathStub = jest - .spyOn(workspaceUtils, 'getRootWorkspacePath') - .mockReturnValue(fakeWorkspace); - originalDirectoryStub = jest - .spyOn(process, 'cwd') - .mockReturnValue(fakeOriginalDirectory); + workspacePathStub = jest.spyOn(workspaceUtils, 'getRootWorkspacePath').mockReturnValue(fakeWorkspace); + originalDirectoryStub = jest.spyOn(process, 'cwd').mockReturnValue(fakeOriginalDirectory); unsetMock = jest.fn(); writeMock = jest.fn(); configStub = jest.spyOn(Config, 'create'); @@ -119,10 +103,7 @@ describe('testing unsetTargetOrg', () => { mockConfigAggregatorProvider = jest .spyOn(ConfigAggregatorProvider, 'getInstance') .mockReturnValue(mockConfigAggregatorProviderInstance as any); - stateAggregatorClearInstanceMock = jest.spyOn( - StateAggregator, - 'clearInstance' - ); + stateAggregatorClearInstanceMock = jest.spyOn(StateAggregator, 'clearInstance'); }); it('should unset provided username or alias', async () => { @@ -130,9 +111,7 @@ describe('testing unsetTargetOrg', () => { expect(unsetMock).toHaveBeenCalledWith(TARGET_ORG_KEY); expect(writeMock).toHaveBeenCalled(); expect(mockConfigAggregatorProvider).toHaveBeenCalled(); - expect( - mockConfigAggregatorProviderInstance.reloadConfigAggregators - ).toHaveBeenCalled(); + expect(mockConfigAggregatorProviderInstance.reloadConfigAggregators).toHaveBeenCalled(); expect(stateAggregatorClearInstanceMock).toHaveBeenCalled(); }); diff --git a/packages/salesforcedx-utils-vscode/test/jest/context/workspaceContextUtil.test.ts b/packages/salesforcedx-utils-vscode/test/jest/context/workspaceContextUtil.test.ts index de555a6966..2ca6459882 100644 --- a/packages/salesforcedx-utils-vscode/test/jest/context/workspaceContextUtil.test.ts +++ b/packages/salesforcedx-utils-vscode/test/jest/context/workspaceContextUtil.test.ts @@ -5,13 +5,9 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { AuthInfo, Connection, EnvVars, StateAggregator } from '@salesforce/core-bundle'; +import { AuthInfo, Connection, StateAggregator } from '@salesforce/core-bundle'; import * as vscode from 'vscode'; -import { - ConfigAggregatorProvider, - TelemetryService, - WorkspaceContextUtil -} from '../../../src'; +import { ConfigAggregatorProvider, TelemetryService, WorkspaceContextUtil } from '../../../src'; import { ConfigUtil } from '../../../src/config/configUtil'; import { WORKSPACE_CONTEXT_ORG_ID_ERROR } from '../../../src/context/workspaceContextUtil'; import { nls } from '../../../src/messages'; @@ -33,7 +29,7 @@ jest.mock('@salesforce/core-bundle', () => { }; }), - SfError: class{}, + SfError: class {}, StateAggregator: { clearInstance: jest.fn() @@ -46,8 +42,7 @@ jest.mock('@salesforce/core-bundle', () => { Connection: { create: jest.fn() }, - envVars: - { + envVars: { getNumber: jest.fn() } }; @@ -87,31 +82,19 @@ describe('WorkspaceContextUtil', () => { onDidCreate: jest.fn(), onDidDelete: jest.fn() }; - reloadConfigAggregatorsMock = jest.spyOn( - ConfigAggregatorProvider.prototype, - 'reloadConfigAggregators' - ); - stateAggregatorClearInstanceMock = jest.spyOn( - StateAggregator, - 'clearInstance' - ); + reloadConfigAggregatorsMock = jest.spyOn(ConfigAggregatorProvider.prototype, 'reloadConfigAggregators'); + stateAggregatorClearInstanceMock = jest.spyOn(StateAggregator, 'clearInstance'); - mockFileSystemWatcher = - mockedVSCode.workspace.createFileSystemWatcher.mockReturnValue( - mockWatcher as any - ); + mockFileSystemWatcher = mockedVSCode.workspace.createFileSystemWatcher.mockReturnValue(mockWatcher as any); - getUsernameOrAliasStub = - configUtilMock.getTargetOrgOrAlias.mockResolvedValue(testAlias); + getUsernameOrAliasStub = configUtilMock.getTargetOrgOrAlias.mockResolvedValue(testAlias); getUsernameStub = configUtilMock.getUsernameFor.mockResolvedValue(testUser); workspaceContextUtil = WorkspaceContextUtil.getInstance(true); getConnectionMock = jest.spyOn(workspaceContextUtil, 'getConnection'); - sendExceptionMock = jest - .spyOn(TelemetryService.prototype, 'sendException') - .mockReturnValue(undefined); + sendExceptionMock = jest.spyOn(TelemetryService.prototype, 'sendException').mockReturnValue(undefined); await workspaceContextUtil.initialize(context); workspaceContextUtil._username = testUser; @@ -120,17 +103,12 @@ describe('WorkspaceContextUtil', () => { it('test for the constructor', () => { expect(workspaceContextUtil).toHaveProperty('sessionConnections'); expect(workspaceContextUtil).toHaveProperty('onOrgChangeEmitter'); - expect(workspaceContextUtil).toHaveProperty( - 'cliConfigWatcher', - mockWatcher - ); + expect(workspaceContextUtil).toHaveProperty('cliConfigWatcher', mockWatcher); expect(mockFileSystemWatcher).toHaveBeenCalled(); }); it('should return workspace context util instance', () => { - expect(WorkspaceContextUtil.getInstance(false)).toEqual( - workspaceContextUtil - ); + expect(WorkspaceContextUtil.getInstance(false)).toEqual(workspaceContextUtil); }); it('should load the target org, alias, and orgId and clear the cache of the core types upon initialization', async () => { @@ -260,9 +238,7 @@ describe('WorkspaceContextUtil', () => { it('should return connection for the default org', async () => { authInfoMock.create.mockResolvedValue(mockAuthInfo as any); authInfoMock.create.mockResolvedValue(mockAuthInfo as any); - connectionMock.create.mockResolvedValue( - mockConnection as unknown as Promise> - ); + connectionMock.create.mockResolvedValue(mockConnection as unknown as Promise>); const connection = await workspaceContextUtil.getConnection(); expect(connectionMock.create).toHaveBeenCalledWith({ authInfo: mockAuthInfo @@ -272,9 +248,7 @@ describe('WorkspaceContextUtil', () => { it('should return a cached connection for the default org if there is one', async () => { authInfoMock.create.mockResolvedValue(mockAuthInfo as any); - connectionMock.create.mockResolvedValue( - mockConnection as unknown as Promise> - ); + connectionMock.create.mockResolvedValue(mockConnection as unknown as Promise>); await workspaceContextUtil.getConnection(); await workspaceContextUtil.getConnection(); diff --git a/packages/salesforcedx-utils-vscode/test/jest/helpers/activationTrackerClass.test.ts b/packages/salesforcedx-utils-vscode/test/jest/helpers/activationTrackerClass.test.ts index bce0326c40..42b80fec2c 100644 --- a/packages/salesforcedx-utils-vscode/test/jest/helpers/activationTrackerClass.test.ts +++ b/packages/salesforcedx-utils-vscode/test/jest/helpers/activationTrackerClass.test.ts @@ -61,10 +61,7 @@ describe('ActivationTracker', () => { await tracker.markActivationStop(); expect(tracker.activationInfo).toEqual({ - startActivateHrTime: expect.arrayContaining([ - expect.any(Number), - expect.any(Number) - ]), + startActivateHrTime: expect.arrayContaining([expect.any(Number), expect.any(Number)]), activateStartDate: expect.any(Date), activateEndDate: expect.any(Date), extensionActivationTime: expect.any(Number), @@ -72,9 +69,7 @@ describe('ActivationTracker', () => { ...mockExtensionInfo }); - expect(telemetryService.sendActivationEventInfo).toHaveBeenCalledWith( - tracker.activationInfo - ); + expect(telemetryService.sendActivationEventInfo).toHaveBeenCalledWith(tracker.activationInfo); }); it('should not sendActivationEventInfo when loadStartDate is undefined', async () => { const loadStartDate: Date | undefined = undefined; diff --git a/packages/salesforcedx-utils-vscode/test/jest/helpers/activationTrackerUtils.test.ts b/packages/salesforcedx-utils-vscode/test/jest/helpers/activationTrackerUtils.test.ts index cb52639ceb..7f29ce6fee 100644 --- a/packages/salesforcedx-utils-vscode/test/jest/helpers/activationTrackerUtils.test.ts +++ b/packages/salesforcedx-utils-vscode/test/jest/helpers/activationTrackerUtils.test.ts @@ -34,9 +34,7 @@ const fixPath = (fsPath: string): string => { describe('readExtensionHostLog', () => { it('should return log lines', async () => { - (readFile as jest.Mock).mockResolvedValue( - ['line1', 'line2', 'line3'].join(EOL) - ); + (readFile as jest.Mock).mockResolvedValue(['line1', 'line2', 'line3'].join(EOL)); (Uri.file as jest.Mock).mockReturnValue({ fsPath: fixPath('/path/to/log') }); @@ -61,9 +59,7 @@ describe('getExtensionHostLogLocation', () => { (Uri.file as jest.Mock).mockReturnValue({ fsPath: fixPath('/path/to/exthost/window1/a/b/c/some-ext.log') }); - const logUri = Uri.file( - fixPath('/path/to/exthost/window1/a/b/c/some-ext.log') - ); + const logUri = Uri.file(fixPath('/path/to/exthost/window1/a/b/c/some-ext.log')); const context = { logUri } as unknown as ExtensionContext; diff --git a/packages/salesforcedx-utils-vscode/test/jest/helpers/extensionUris.test.ts b/packages/salesforcedx-utils-vscode/test/jest/helpers/extensionUris.test.ts index f2be3ba868..29ba0634a6 100644 --- a/packages/salesforcedx-utils-vscode/test/jest/helpers/extensionUris.test.ts +++ b/packages/salesforcedx-utils-vscode/test/jest/helpers/extensionUris.test.ts @@ -22,9 +22,7 @@ describe('extensionUris Unit Tests.', () => { it('Should return extensionUri if found.', () => { (vscode.extensions.getExtension as any).mockReturnValue(fakeExtensionRef); const result = extensionUris.extensionUri(fakeExtensionName); - expect(vscode.extensions.getExtension).toHaveBeenCalledWith( - fakeExtensionName - ); + expect(vscode.extensions.getExtension).toHaveBeenCalledWith(fakeExtensionName); expect(result).toEqual(fakeExtensionRef.extensionUri); }); diff --git a/packages/salesforcedx-utils-vscode/test/jest/helpers/paths.test.ts b/packages/salesforcedx-utils-vscode/test/jest/helpers/paths.test.ts index 5bdf670cdb..5c8e88a2f2 100644 --- a/packages/salesforcedx-utils-vscode/test/jest/helpers/paths.test.ts +++ b/packages/salesforcedx-utils-vscode/test/jest/helpers/paths.test.ts @@ -7,11 +7,7 @@ import * as path from 'path'; import * as vscode from 'vscode'; import { WorkspaceContextUtil } from '../../../src'; -import { - fileExtensionsMatch, - projectPaths, - workspaceUtils -} from '../../../src/'; +import { fileExtensionsMatch, projectPaths, workspaceUtils } from '../../../src/'; import { APEX, APEX_DB, @@ -43,18 +39,13 @@ describe('test project paths', () => { const FAKE_WORKSPACE = '/here/is/a/fake/path/to/'; const FAKE_WORKSPACE_INSTANCE: any = {}; const FAKE_STATE_FOLDER = '.sfdx'; - const FAKE_PATH_TO_STATE_FOLDER = path.join( - FAKE_WORKSPACE, - FAKE_STATE_FOLDER - ); + const FAKE_PATH_TO_STATE_FOLDER = path.join(FAKE_WORKSPACE, FAKE_STATE_FOLDER); describe('test stateFolder', () => { let getRootWorkspacePathStub: jest.SpyInstance; beforeEach(() => { - getRootWorkspacePathStub = jest - .spyOn(workspaceUtils, 'getRootWorkspacePath') - .mockReturnValue(FAKE_WORKSPACE); + getRootWorkspacePathStub = jest.spyOn(workspaceUtils, 'getRootWorkspacePath').mockReturnValue(FAKE_WORKSPACE); }); it('should return a path to the state folder if the project has a root workspace', () => { @@ -72,9 +63,7 @@ describe('test project paths', () => { const FAKE_CONFIG = path.join(FAKE_WORKSPACE, SFDX_CONFIG_FILE); beforeEach(() => { - stateFolderStub = jest - .spyOn(projectPaths, 'stateFolder') - .mockReturnValue(FAKE_WORKSPACE); + stateFolderStub = jest.spyOn(projectPaths, 'stateFolder').mockReturnValue(FAKE_WORKSPACE); }); it('should be defined', () => { @@ -113,9 +102,7 @@ describe('test project paths', () => { let stateFolderStub: jest.SpyInstance; beforeEach(() => { - stateFolderStub = jest - .spyOn(projectPaths, 'stateFolder') - .mockReturnValue(FAKE_WORKSPACE); + stateFolderStub = jest.spyOn(projectPaths, 'stateFolder').mockReturnValue(FAKE_WORKSPACE); }); it('should be defined', () => { expect(projectPaths.toolsFolder).toBeDefined(); @@ -132,13 +119,9 @@ describe('test project paths', () => { let usernameStub: jest.SpyInstance; beforeEach(() => { FAKE_WORKSPACE_INSTANCE.username = 'fakeUsername'; - stateFolderStub = jest - .spyOn(projectPaths, 'stateFolder') - .mockReturnValue(FAKE_WORKSPACE); + stateFolderStub = jest.spyOn(projectPaths, 'stateFolder').mockReturnValue(FAKE_WORKSPACE); - usernameStub = jest - .spyOn(WorkspaceContextUtil, 'getInstance') - .mockReturnValue(FAKE_WORKSPACE_INSTANCE); + usernameStub = jest.spyOn(WorkspaceContextUtil, 'getInstance').mockReturnValue(FAKE_WORKSPACE_INSTANCE); }); it('should be defined', () => { expect(projectPaths.metadataFolder).toBeDefined(); @@ -147,9 +130,7 @@ describe('test project paths', () => { it('should return a path to the metadata folder based on root workspace', () => { const metadataFolder = projectPaths.metadataFolder(); const username = FAKE_WORKSPACE_INSTANCE.username; - expect(metadataFolder).toEqual( - path.join(FAKE_WORKSPACE, ORGS, username, METADATA) - ); + expect(metadataFolder).toEqual(path.join(FAKE_WORKSPACE, ORGS, username, METADATA)); }); }); @@ -157,9 +138,7 @@ describe('test project paths', () => { let stateFolderStub: jest.SpyInstance; beforeEach(() => { - stateFolderStub = jest - .spyOn(projectPaths, 'stateFolder') - .mockReturnValue(FAKE_WORKSPACE); + stateFolderStub = jest.spyOn(projectPaths, 'stateFolder').mockReturnValue(FAKE_WORKSPACE); }); it('should be defined', () => { expect(projectPaths.apexTestResultsFolder).toBeDefined(); @@ -167,9 +146,7 @@ describe('test project paths', () => { it('should return a path to the apex test results folder based on root workspace', () => { const apexTestResultsFolder = projectPaths.apexTestResultsFolder(); - expect(apexTestResultsFolder).toEqual( - path.join(FAKE_WORKSPACE, TOOLS, TEST_RESULTS, APEX) - ); + expect(apexTestResultsFolder).toEqual(path.join(FAKE_WORKSPACE, TOOLS, TEST_RESULTS, APEX)); }); }); @@ -177,20 +154,15 @@ describe('test project paths', () => { let stateFolderStub: jest.SpyInstance; beforeEach(() => { - stateFolderStub = jest - .spyOn(projectPaths, 'stateFolder') - .mockReturnValue(FAKE_WORKSPACE); + stateFolderStub = jest.spyOn(projectPaths, 'stateFolder').mockReturnValue(FAKE_WORKSPACE); }); it('should be defined', () => { expect(projectPaths.apexLanguageServerDatabase).toBeDefined(); }); it('should return a path to the apex Language Server Database folder based on root workspace', () => { - const apexLanguageServerDatabase = - projectPaths.apexLanguageServerDatabase(); - expect(apexLanguageServerDatabase).toEqual( - path.join(FAKE_WORKSPACE, TOOLS, APEX_DB) - ); + const apexLanguageServerDatabase = projectPaths.apexLanguageServerDatabase(); + expect(apexLanguageServerDatabase).toEqual(path.join(FAKE_WORKSPACE, TOOLS, APEX_DB)); }); }); @@ -198,9 +170,7 @@ describe('test project paths', () => { let stateFolderStub: jest.SpyInstance; beforeEach(() => { - stateFolderStub = jest - .spyOn(projectPaths, 'stateFolder') - .mockReturnValue(FAKE_WORKSPACE); + stateFolderStub = jest.spyOn(projectPaths, 'stateFolder').mockReturnValue(FAKE_WORKSPACE); }); it('should be defined', () => { expect(projectPaths.lwcTestResultsFolder).toBeDefined(); @@ -208,9 +178,7 @@ describe('test project paths', () => { it('should return a path to the lwc Test Results Folder based on root workspace', () => { const lwcTestResultsFolder = projectPaths.lwcTestResultsFolder(); - expect(lwcTestResultsFolder).toEqual( - path.join(FAKE_WORKSPACE, TOOLS, TEST_RESULTS, LWC) - ); + expect(lwcTestResultsFolder).toEqual(path.join(FAKE_WORKSPACE, TOOLS, TEST_RESULTS, LWC)); }); }); @@ -218,9 +186,7 @@ describe('test project paths', () => { let stateFolderStub: jest.SpyInstance; beforeEach(() => { - stateFolderStub = jest - .spyOn(projectPaths, 'stateFolder') - .mockReturnValue(FAKE_WORKSPACE); + stateFolderStub = jest.spyOn(projectPaths, 'stateFolder').mockReturnValue(FAKE_WORKSPACE); }); it('should be defined', () => { expect(projectPaths.testResultsFolder).toBeDefined(); @@ -228,9 +194,7 @@ describe('test project paths', () => { it('should return a path to the Test Results Folder based on root workspace', () => { const testResultsFolder = projectPaths.testResultsFolder(); - expect(testResultsFolder).toEqual( - path.join(FAKE_WORKSPACE, TOOLS, TEST_RESULTS) - ); + expect(testResultsFolder).toEqual(path.join(FAKE_WORKSPACE, TOOLS, TEST_RESULTS)); }); }); @@ -238,9 +202,7 @@ describe('test project paths', () => { let stateFolderStub: jest.SpyInstance; beforeEach(() => { - stateFolderStub = jest - .spyOn(projectPaths, 'stateFolder') - .mockReturnValue(FAKE_WORKSPACE); + stateFolderStub = jest.spyOn(projectPaths, 'stateFolder').mockReturnValue(FAKE_WORKSPACE); }); it('should be defined', () => { expect(projectPaths.debugLogsFolder).toBeDefined(); @@ -248,9 +210,7 @@ describe('test project paths', () => { it('should return a path to the debug Logs folder based on root workspace', () => { const debugLogsFolder = projectPaths.debugLogsFolder(); - expect(debugLogsFolder).toEqual( - path.join(FAKE_WORKSPACE, TOOLS, DEBUG, LOGS) - ); + expect(debugLogsFolder).toEqual(path.join(FAKE_WORKSPACE, TOOLS, DEBUG, LOGS)); }); }); @@ -266,18 +226,12 @@ describe('test project paths', () => { }); it('should return true if the extension of the uri given is the same as the target extension', () => { - const extensionsMatching = fileExtensionsMatch( - mockEditor.document.uri, - 'log' - ); + const extensionsMatching = fileExtensionsMatch(mockEditor.document.uri, 'log'); expect(extensionsMatching).toBeTruthy(); }); it('should return false if the extension of the uri given is not the same as the target extension', () => { - const extensionsMatching = fileExtensionsMatch( - mockEditor.document.uri, - 'txt' - ); + const extensionsMatching = fileExtensionsMatch(mockEditor.document.uri, 'txt'); expect(extensionsMatching).toBeFalsy(); }); }); diff --git a/packages/salesforcedx-utils-vscode/test/jest/helpers/utils.test.ts b/packages/salesforcedx-utils-vscode/test/jest/helpers/utils.test.ts index ab9fff64ac..665fc8203f 100644 --- a/packages/salesforcedx-utils-vscode/test/jest/helpers/utils.test.ts +++ b/packages/salesforcedx-utils-vscode/test/jest/helpers/utils.test.ts @@ -23,16 +23,12 @@ describe('utils tests', () => { it('Should throw error if argument is a simple text', () => { const invalidJson = initialValue.how; - expect(() => extractJsonObject(invalidJson)).toThrow( - 'The string "does" is not a valid JSON string.' - ); + expect(() => extractJsonObject(invalidJson)).toThrow('The string "does" is not a valid JSON string.'); }); it('Should throw error if argument is invalid JSON string', () => { const invalidJson = jsonString.substring(10); - expect(() => extractJsonObject(invalidJson)).toThrow( - `The string "${invalidJson}" is not a valid JSON string.` - ); + expect(() => extractJsonObject(invalidJson)).toThrow(`The string "${invalidJson}" is not a valid JSON string.`); }); }); describe('stripAnsiInJson', () => { @@ -73,8 +69,7 @@ describe('utils tests', () => { }); it('should handle complex JSON with ANSI codes', () => { - const input = - '{"key1": "\u001b[31mvalue1\u001b[0m", "key2": "\u001b[32mvalue2\u001b[0m"}'; + const input = '{"key1": "\u001b[31mvalue1\u001b[0m", "key2": "\u001b[32mvalue2\u001b[0m"}'; const result = stripAnsiInJson(input, true); expect(result).toBe('{"key1": "value1", "key2": "value2"}'); }); diff --git a/packages/salesforcedx-utils-vscode/test/jest/services/source-tracking/sourceTrackingService.test.ts b/packages/salesforcedx-utils-vscode/test/jest/services/source-tracking/sourceTrackingService.test.ts index 6f381b40b1..173584372d 100644 --- a/packages/salesforcedx-utils-vscode/test/jest/services/source-tracking/sourceTrackingService.test.ts +++ b/packages/salesforcedx-utils-vscode/test/jest/services/source-tracking/sourceTrackingService.test.ts @@ -23,14 +23,9 @@ describe('Source Tracking Service', () => { it('Should update an instance of SourceTracking using the retrieve result', async () => { const dummyRetrieveResult = {} as any; - await SourceTrackingService.updateSourceTrackingAfterRetrieve( - dummySourceTracking, - dummyRetrieveResult - ); + await SourceTrackingService.updateSourceTrackingAfterRetrieve(dummySourceTracking, dummyRetrieveResult); - expect(updateTrackingFromRetrieveSpy).toHaveBeenCalledWith( - dummyRetrieveResult - ); + expect(updateTrackingFromRetrieveSpy).toHaveBeenCalledWith(dummyRetrieveResult); }); }); @@ -54,10 +49,7 @@ describe('Source Tracking Service', () => { .mockReturnValue(mockWorkspaceContextUtil as any); getSourceTrackingForCurrentProjectMock = jest - .spyOn( - SourceTrackingService as any, - 'getSourceTrackingForCurrentProject' - ) + .spyOn(SourceTrackingService as any, 'getSourceTrackingForCurrentProject') .mockResolvedValue({ getStatus: getStatusMock } as any); @@ -68,9 +60,7 @@ describe('Source Tracking Service', () => { getStatusMock.mockResolvedValue(testData.statusResponse as any); // Act - const formattedOutput: string = await SourceTrackingService.getSourceStatusSummary( - {} - ); + const formattedOutput: string = await SourceTrackingService.getSourceStatusSummary({}); // Assert expect(getSourceTrackingForCurrentProjectMock).toHaveBeenCalled(); @@ -81,9 +71,7 @@ describe('Source Tracking Service', () => { it('Should return a friendly message when no changes exist', async () => { getStatusMock.mockResolvedValue(testData.noChangesResponse as any); - const formattedOutput: string = await SourceTrackingService.getSourceStatusSummary( - {} - ); + const formattedOutput: string = await SourceTrackingService.getSourceStatusSummary({}); expect(getSourceTrackingForCurrentProjectMock).toHaveBeenCalled(); expect(getStatusMock).toHaveBeenCalled(); diff --git a/packages/salesforcedx-utils-vscode/test/jest/services/source-tracking/testData.ts b/packages/salesforcedx-utils-vscode/test/jest/services/source-tracking/testData.ts index 98076453c1..86cdccc3e9 100644 --- a/packages/salesforcedx-utils-vscode/test/jest/services/source-tracking/testData.ts +++ b/packages/salesforcedx-utils-vscode/test/jest/services/source-tracking/testData.ts @@ -10,8 +10,7 @@ export const testData = { type: 'ApexClass', state: 'modify', fullName: 'CommunitiesLandingController', - filePath: - 'force-app/main/default/classes/CommunitiesLandingController.cls', + filePath: 'force-app/main/default/classes/CommunitiesLandingController.cls', origin: 'local', ignored: false, conflict: false @@ -20,8 +19,7 @@ export const testData = { type: 'ApexClass', state: 'modify', fullName: 'CommunitiesLandingControllerTest', - filePath: - 'force-app/main/default/classes/CommunitiesLandingControllerTest.cls', + filePath: 'force-app/main/default/classes/CommunitiesLandingControllerTest.cls', origin: 'local', ignored: false, conflict: false diff --git a/packages/salesforcedx-utils-vscode/test/jest/services/source-tracking/userService.test.ts b/packages/salesforcedx-utils-vscode/test/jest/services/source-tracking/userService.test.ts index ab14a6622b..fafa3a27e2 100644 --- a/packages/salesforcedx-utils-vscode/test/jest/services/source-tracking/userService.test.ts +++ b/packages/salesforcedx-utils-vscode/test/jest/services/source-tracking/userService.test.ts @@ -6,7 +6,14 @@ */ import { ExtensionContext } from 'vscode'; -import { CliCommandExecution, CliCommandExecutor, CommandOutput, SfCommandBuilder, TelemetryService, workspaceUtils } from '../../../../src'; +import { + CliCommandExecution, + CliCommandExecutor, + CommandOutput, + SfCommandBuilder, + TelemetryService, + workspaceUtils +} from '../../../../src'; import { UserService } from '../../../../src/services/userService'; describe('UserService', () => { @@ -26,7 +33,9 @@ describe('UserService', () => { beforeEach(() => { getRootWorkspacePathSpy = jest.spyOn(workspaceUtils, 'getRootWorkspacePath').mockReturnValue('abc'); executionSpy = jest.spyOn(CliCommandExecutor.prototype, 'execute').mockReturnValue(cliCommandExecution); - getCmdResultSpy = jest.spyOn(CommandOutput.prototype, 'getCmdResult').mockResolvedValue(JSON.stringify(fakeCliTelemetryData)); + getCmdResultSpy = jest + .spyOn(CommandOutput.prototype, 'getCmdResult') + .mockResolvedValue(JSON.stringify(fakeCliTelemetryData)); }); it('should return command output of sf telemetry', async () => { const fakePath = '/fine/total'; @@ -69,9 +78,8 @@ describe('UserService', () => { (telemetryService as any).extensionContext = { globalState: { get: fakeGet, update: fakeUpdate } }; // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment fakeExtensionContext = (telemetryService as any).extensionContext; - executeCliTelemetrySpy = jest.spyOn((UserService as any), 'executeCliTelemetry'); - getRandomUserIdSpy = jest.spyOn((UserService as any), 'getRandomUserId'); - + executeCliTelemetrySpy = jest.spyOn(UserService as any, 'executeCliTelemetry'); + getRandomUserIdSpy = jest.spyOn(UserService as any, 'getRandomUserId'); }); it('should return cliId when telemetryUserId is undefined in global state', async () => { diff --git a/packages/salesforcedx-utils-vscode/test/jest/settings/settingsService.test.ts b/packages/salesforcedx-utils-vscode/test/jest/settings/settingsService.test.ts index 7d61415b0c..3e965686ee 100644 --- a/packages/salesforcedx-utils-vscode/test/jest/settings/settingsService.test.ts +++ b/packages/salesforcedx-utils-vscode/test/jest/settings/settingsService.test.ts @@ -5,14 +5,8 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ import * as vscode from 'vscode'; -import { - SETTING_CLEAR_OUTPUT_TAB, - SFDX_CORE_CONFIGURATION_NAME -} from '../../../src'; -import { - AdvancedSettings, - SettingsService -} from '../../../src/settings/settingsService'; +import { SETTING_CLEAR_OUTPUT_TAB, SFDX_CORE_CONFIGURATION_NAME } from '../../../src'; +import { AdvancedSettings, SettingsService } from '../../../src/settings/settingsService'; const mockedVSCode = jest.mocked(vscode); @@ -35,13 +29,8 @@ describe('SettingsService', () => { const result = SettingsService.getEnableClearOutputBeforeEachCommand(); expect(result).toBe(true); - expect(getConfigurationMock).toHaveBeenCalledWith( - SFDX_CORE_CONFIGURATION_NAME - ); - expect(mockConfiguration.get).toHaveBeenCalledWith( - SETTING_CLEAR_OUTPUT_TAB, - false - ); + expect(getConfigurationMock).toHaveBeenCalledWith(SFDX_CORE_CONFIGURATION_NAME); + expect(mockConfiguration.get).toHaveBeenCalledWith(SETTING_CLEAR_OUTPUT_TAB, false); }); }); @@ -56,9 +45,7 @@ describe('SettingsService', () => { ); expect(getConfigurationMock).toHaveBeenCalled(); - expect(mockConfiguration.get).toHaveBeenCalledWith( - 'myExtension.advanced.localTelemetryLogging' - ); + expect(mockConfiguration.get).toHaveBeenCalledWith('myExtension.advanced.localTelemetryLogging'); expect(result).toBe(true); }); @@ -71,9 +58,7 @@ describe('SettingsService', () => { ); expect(getConfigurationMock).toHaveBeenCalledWith(); - expect(mockConfiguration.get).toHaveBeenCalledWith( - 'myExtension.advanced.localTelemetryLogging' - ); + expect(mockConfiguration.get).toHaveBeenCalledWith('myExtension.advanced.localTelemetryLogging'); expect(result).toBe(false); }); }); diff --git a/packages/salesforcedx-utils-vscode/test/jest/telemetry/reporters/appInsights.test.ts b/packages/salesforcedx-utils-vscode/test/jest/telemetry/reporters/appInsights.test.ts index c96ce1a1cc..fee482a90c 100644 --- a/packages/salesforcedx-utils-vscode/test/jest/telemetry/reporters/appInsights.test.ts +++ b/packages/salesforcedx-utils-vscode/test/jest/telemetry/reporters/appInsights.test.ts @@ -28,16 +28,12 @@ describe('AppInsights', () => { beforeEach(() => { // Arrange - getInstanceMock = jest - .spyOn(WorkspaceContextUtil, 'getInstance') - .mockReturnValue({ - orgId: dummyOrgId - } as any); + getInstanceMock = jest.spyOn(WorkspaceContextUtil, 'getInstance').mockReturnValue({ + orgId: dummyOrgId + } as any); jest.spyOn(workspace, 'getConfiguration').mockReturnValue(fakeConfig); - jest - .spyOn(AppInsights.prototype as any, 'updateUserOptIn') - .mockReturnValue(''); + jest.spyOn(AppInsights.prototype as any, 'updateUserOptIn').mockReturnValue(''); }); it('should send telemetry data to appInsightsClient.trackEvent', () => { @@ -59,10 +55,7 @@ describe('AppInsights', () => { it('should send orgId to appInsightsClient.trackException', () => { // Act - appInsights.sendExceptionEvent( - 'Dummy Exception', - 'a dummy exception occurred' - ); + appInsights.sendExceptionEvent('Dummy Exception', 'a dummy exception occurred'); // Assert expect(getInstanceMock).toHaveBeenCalledTimes(1); @@ -79,13 +72,7 @@ describe('AppInsights', () => { }; beforeEach(() => { - appInsights = new AppInsights( - fakeExtensionId, - fakeExtensionVersion, - 'aKey', - fakeUserId, - false - ); + appInsights = new AppInsights(fakeExtensionId, fakeExtensionVersion, 'aKey', fakeUserId, false); (appInsights as any).appInsightsClient = appInsightsClientMock; }); @@ -168,9 +155,7 @@ describe('AppInsights', () => { let appInsights: AppInsights; beforeEach(() => { - jest - .spyOn(os, 'hostname') - .mockReturnValue('test.internal.salesforce.com'); + jest.spyOn(os, 'hostname').mockReturnValue('test.internal.salesforce.com'); jest.spyOn(os, 'cpus').mockReturnValue([ { model: 'AMD EPYC 7763 64-Core Processor', @@ -206,7 +191,7 @@ describe('AppInsights', () => { const commonProps = appInsights['getCommonProperties'](); const internalProps = appInsights['getInternalProperties'](); const result = appInsights['aggregateLoggingProperties'](); - expect(result).toEqual({...commonProps, ...internalProps}); + expect(result).toEqual({ ...commonProps, ...internalProps }); }); it('should return common properties when is not internal user', () => { diff --git a/packages/salesforcedx-utils-vscode/test/jest/telemetry/reporters/telemetryFile.test.ts b/packages/salesforcedx-utils-vscode/test/jest/telemetry/reporters/telemetryFile.test.ts index 06eff309ba..02f38b84e7 100644 --- a/packages/salesforcedx-utils-vscode/test/jest/telemetry/reporters/telemetryFile.test.ts +++ b/packages/salesforcedx-utils-vscode/test/jest/telemetry/reporters/telemetryFile.test.ts @@ -42,11 +42,7 @@ describe('TelemetryFile', () => { const exceptionMessage = 'Test exception message'; const measurements = { metric1: 10, metric2: 20 }; - telemetryFile.sendExceptionEvent( - exceptionName, - exceptionMessage, - measurements - ); + telemetryFile.sendExceptionEvent(exceptionName, exceptionMessage, measurements); expect(writeToFileMock).toHaveBeenCalledWith(exceptionName, { exceptionMessage, @@ -66,9 +62,7 @@ describe('TelemetryFile', () => { await (telemetryFile as any).writeToFile(eventName, properties); - expect( - (fs.promises.appendFile as jest.Mock).mock.calls[0] - ).toMatchSnapshot(); + expect((fs.promises.appendFile as jest.Mock).mock.calls[0]).toMatchSnapshot(); }); }); }); diff --git a/packages/salesforcedx-utils-vscode/test/jest/telemetry/telemetry.test.ts b/packages/salesforcedx-utils-vscode/test/jest/telemetry/telemetry.test.ts index 1c7f19d124..46efb25f74 100644 --- a/packages/salesforcedx-utils-vscode/test/jest/telemetry/telemetry.test.ts +++ b/packages/salesforcedx-utils-vscode/test/jest/telemetry/telemetry.test.ts @@ -18,9 +18,7 @@ describe('Telemetry', () => { it('getInstance should return a TelemetryService instance for core extension when no name is provided', () => { const instance = TelemetryServiceProvider.getInstance(); expect(instance).toBeInstanceOf(TelemetryService); - expect( - TelemetryServiceProvider.instances.has(SFDX_CORE_EXTENSION_NAME) - ).toBeTruthy(); + expect(TelemetryServiceProvider.instances.has(SFDX_CORE_EXTENSION_NAME)).toBeTruthy(); }); it('getInstance should return the same TelemetryService instance for core extension on subsequent calls', () => { @@ -33,26 +31,21 @@ describe('Telemetry', () => { const extensionName = 'someExtension'; const instance = TelemetryServiceProvider.getInstance(extensionName); expect(instance).toBeInstanceOf(TelemetryService); - expect( - TelemetryServiceProvider.instances.has(extensionName) - ).toBeTruthy(); + expect(TelemetryServiceProvider.instances.has(extensionName)).toBeTruthy(); }); it('getInstance should return the same TelemetryService instance for a named extension on subsequent calls', () => { const extensionName = 'someExtension'; const firstInstance = TelemetryServiceProvider.getInstance(extensionName); - const secondInstance = - TelemetryServiceProvider.getInstance(extensionName); + const secondInstance = TelemetryServiceProvider.getInstance(extensionName); expect(secondInstance).toBe(firstInstance); }); it('getInstance should return different instances for different extension names', () => { const firstExtensionName = 'extensionOne'; const secondExtensionName = 'extensionTwo'; - const firstInstance = - TelemetryServiceProvider.getInstance(firstExtensionName); - const secondInstance = - TelemetryServiceProvider.getInstance(secondExtensionName); + const firstInstance = TelemetryServiceProvider.getInstance(firstExtensionName); + const secondInstance = TelemetryServiceProvider.getInstance(secondExtensionName); expect(firstInstance).not.toBe(secondInstance); }); }); @@ -60,16 +53,13 @@ describe('Telemetry', () => { describe('Telemetry Service - getInstance', () => { it('getInstance should return the core instance if no extension name provided', () => { const firstInstance = TelemetryService.getInstance(); - const secondInstance = TelemetryServiceProvider.getInstance( - SFDX_CORE_EXTENSION_NAME - ); + const secondInstance = TelemetryServiceProvider.getInstance(SFDX_CORE_EXTENSION_NAME); expect(firstInstance).toBe(secondInstance); }); it('getInstance should return the same TelemetryService instance for a named extension on subsequent calls', () => { const extensionName = 'someExtension'; const firstInstance = TelemetryService.getInstance(extensionName); - const secondInstance = - TelemetryServiceProvider.getInstance(extensionName); + const secondInstance = TelemetryServiceProvider.getInstance(extensionName); expect(secondInstance).toBe(firstInstance); }); }); @@ -97,7 +87,11 @@ describe('Telemetry', () => { it('should return true when isTelemetryExtensionConfigurationEnabled and checkCliTelemetry are true', async () => { spyIsTelemetryExtensionConfigurationEnabled.mockReturnValue(true); - changeTelemetryServiceProperty(TelemetryServiceProvider.getInstance(), 'cliAllowsTelemetryPromise', Promise.resolve(true)); + changeTelemetryServiceProperty( + TelemetryServiceProvider.getInstance(), + 'cliAllowsTelemetryPromise', + Promise.resolve(true) + ); expect(await instance.isTelemetryEnabled()).toBe(true); }); diff --git a/packages/salesforcedx-utils-vscode/test/jest/telemetry/utils/devModeUtils.test.ts b/packages/salesforcedx-utils-vscode/test/jest/telemetry/utils/devModeUtils.test.ts index f22ed4ee39..0d66f93f7e 100644 --- a/packages/salesforcedx-utils-vscode/test/jest/telemetry/utils/devModeUtils.test.ts +++ b/packages/salesforcedx-utils-vscode/test/jest/telemetry/utils/devModeUtils.test.ts @@ -12,9 +12,7 @@ describe('isLocalLogging', () => { let spySettingsService: jest.SpyInstance; beforeEach(() => { - spySettingsService = jest - .spyOn(Settings.SettingsService, 'isAdvancedSettingEnabledFor') - .mockReturnValue(false); + spySettingsService = jest.spyOn(Settings.SettingsService, 'isAdvancedSettingEnabledFor').mockReturnValue(false); }); afterEach(() => { diff --git a/packages/salesforcedx-utils/.eslintrc.json b/packages/salesforcedx-utils/.eslintrc.json deleted file mode 100644 index a8b986b195..0000000000 --- a/packages/salesforcedx-utils/.eslintrc.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "root": true, - "extends": ["../../config/base-eslintrc.json", "./fix-these-rules.json"], - "overrides": [ - { - "files": ["./src/**/*.ts", "./test/**/*.ts"], - "parserOptions": { - "project": "./tsconfig.json" - } - } - ] -} diff --git a/packages/salesforcedx-utils/fix-these-rules.json b/packages/salesforcedx-utils/fix-these-rules.json deleted file mode 100644 index 46e8cae608..0000000000 --- a/packages/salesforcedx-utils/fix-these-rules.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "rules": { - "prefer-arrow/prefer-arrow-functions": ["error", {}], - "@typescript-eslint/await-thenable": "warn", - "@typescript-eslint/no-floating-promises": "warn", - "@typescript-eslint/no-misused-promises": "warn", - "@typescript-eslint/no-unsafe-argument": "warn", - "@typescript-eslint/no-unsafe-assignment": "warn", - "@typescript-eslint/no-unsafe-call": "warn", - "@typescript-eslint/no-unsafe-member-access": "warn", - "@typescript-eslint/require-await": "warn" - } -} diff --git a/packages/salesforcedx-utils/package.json b/packages/salesforcedx-utils/package.json index ab6bdadc27..cd301d4cc8 100644 --- a/packages/salesforcedx-utils/package.json +++ b/packages/salesforcedx-utils/package.json @@ -8,7 +8,7 @@ "main": "out/src", "scripts": { "compile": "tsc -p ./", - "lint": "eslint . --ext .ts", + "lint": "eslint .", "lint:fix": "npm run lint -- --fix", "watch": "tsc -watch -p .", "clean": "shx rm -rf node_modules && shx rm -rf out && shx rm -rf coverage", @@ -24,20 +24,11 @@ }, "devDependencies": { "@types/jest": "^29.5.5", - "@types/node": "^18.11.9", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest": "27.5.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", + "@types/node": "^20.0.0", + "eslint-plugin-jest": "28.9.0", "jest": "^29.7.0", - "prettier": "3.0.3", + "prettier": "3.3.3", "ts-jest": "^29.1.1", - "typescript": "^5.2.2" + "typescript": "^5.6.2" } } diff --git a/packages/salesforcedx-utils/src/cli/cliCommandExecution.ts b/packages/salesforcedx-utils/src/cli/cliCommandExecution.ts index 51be84aae9..3f93aaca51 100644 --- a/packages/salesforcedx-utils/src/cli/cliCommandExecution.ts +++ b/packages/salesforcedx-utils/src/cli/cliCommandExecution.ts @@ -29,11 +29,7 @@ export class CliCommandExecution implements CommandExecution { private readonly childProcessPid: number; - constructor( - command: Command, - childProcess: ChildProcess, - cancellationToken?: CancellationToken - ) { + constructor(command: Command, childProcess: ChildProcess, cancellationToken?: CancellationToken) { this.command = command; this.cancellationToken = cancellationToken; @@ -45,19 +41,13 @@ export class CliCommandExecution implements CommandExecution { let timerSubscriber: Subscription | null; // Process - this.processExitSubject = Observable.fromEvent( - childProcess, - 'exit' - ); + this.processExitSubject = Observable.fromEvent(childProcess, 'exit'); this.processExitSubject.subscribe(() => { if (timerSubscriber) { timerSubscriber.unsubscribe(); } }); - this.processErrorSubject = Observable.fromEvent( - childProcess, - 'error' - ); + this.processErrorSubject = Observable.fromEvent(childProcess, 'error'); this.processErrorSubject.subscribe(() => { if (timerSubscriber) { timerSubscriber.unsubscribe(); diff --git a/packages/salesforcedx-utils/src/cli/cliCommandExecutor.ts b/packages/salesforcedx-utils/src/cli/cliCommandExecutor.ts index 96a4e123ac..7b04e63fb1 100644 --- a/packages/salesforcedx-utils/src/cli/cliCommandExecutor.ts +++ b/packages/salesforcedx-utils/src/cli/cliCommandExecutor.ts @@ -14,10 +14,7 @@ import { CancellationToken, Command } from '../types'; import { CliCommandExecution } from './cliCommandExecution'; import { GlobalCliEnvironment } from './globalCliEnvironment'; export class CliCommandExecutor { - protected static patchEnv( - options: SpawnOptions, - baseEnvironment: Map - ): SpawnOptions { + protected static patchEnv(options: SpawnOptions, baseEnvironment: Map): SpawnOptions { // start with current process environment const env = Object.create(null); @@ -45,30 +42,15 @@ export class CliCommandExecutor { private readonly command: Command; private readonly options: SpawnOptions; - public constructor( - command: Command, - options: SpawnOptions, - inheritGlobalEnvironmentVariables = true - ) { + public constructor(command: Command, options: SpawnOptions, inheritGlobalEnvironmentVariables = true) { this.command = command; this.options = inheritGlobalEnvironmentVariables - ? CliCommandExecutor.patchEnv( - options, - GlobalCliEnvironment.environmentVariables - ) + ? CliCommandExecutor.patchEnv(options, GlobalCliEnvironment.environmentVariables) : options; } public execute(cancellationToken?: CancellationToken): CliCommandExecution { - const childProcess = cross_spawn( - this.command.command, - this.command.args, - this.options - ); - return new CliCommandExecution( - this.command, - childProcess, - cancellationToken - ); + const childProcess = cross_spawn(this.command.command, this.command.args, this.options); + return new CliCommandExecution(this.command, childProcess, cancellationToken); } } diff --git a/packages/salesforcedx-utils/src/cli/cliVersionStatus.ts b/packages/salesforcedx-utils/src/cli/cliVersionStatus.ts index ceb1e998b7..d29a4d436a 100644 --- a/packages/salesforcedx-utils/src/cli/cliVersionStatus.ts +++ b/packages/salesforcedx-utils/src/cli/cliVersionStatus.ts @@ -18,7 +18,6 @@ export enum CliStatusEnum { } export class CliVersionStatus { - public getCliVersion(isSfdx: boolean): string { try { const result = execSync(`${isSfdx ? 'sfdx' : 'sf'} --version`); @@ -35,7 +34,6 @@ export class CliVersionStatus { } public validateCliInstallationAndVersion(sfdxCliVersionString: string, sfCliVersionString: string): CliStatusEnum { - // Case 1: Neither SFDX CLI nor SF CLI is installed if (semver.satisfies(sfdxCliVersionString, '0.0.0') && semver.satisfies(sfCliVersionString, '0.0.0')) { return CliStatusEnum.cliNotInstalled; @@ -53,7 +51,7 @@ export class CliVersionStatus { const minSFDXVersion = '7.193.2'; if (semver.satisfies(sfCliVersionString, '<2.0.0')) { - if (semver.satisfies(sfdxCliVersionString, (`<${minSFDXVersion}`))) { + if (semver.satisfies(sfdxCliVersionString, `<${minSFDXVersion}`)) { // Case 4: Outdated SFDX CLI version is installed return CliStatusEnum.outdatedSFDXVersion; } else { diff --git a/packages/salesforcedx-utils/src/cli/command.ts b/packages/salesforcedx-utils/src/cli/command.ts index e5c6644370..7d787d1d40 100644 --- a/packages/salesforcedx-utils/src/cli/command.ts +++ b/packages/salesforcedx-utils/src/cli/command.ts @@ -20,9 +20,7 @@ export class Command { } public toString(): string { - return this.description - ? this.description - : `${this.command} ${this.args.join(' ')}`; + return this.description ? this.description : `${this.command} ${this.args.join(' ')}`; } public toCommand(): string { diff --git a/packages/salesforcedx-utils/src/cli/commandOutput.ts b/packages/salesforcedx-utils/src/cli/commandOutput.ts index 15403e1a8d..7647c6666a 100644 --- a/packages/salesforcedx-utils/src/cli/commandOutput.ts +++ b/packages/salesforcedx-utils/src/cli/commandOutput.ts @@ -14,9 +14,7 @@ export class CommandOutput { private stderrBuffer = ''; public async getCmdResult(execution: CommandExecution): Promise { - const hasJsonEnabled = execution.command?.args?.some( - arg => arg === JSON_FLAG - ); + const hasJsonEnabled = execution.command?.args?.some(arg => arg === JSON_FLAG); execution.stdoutSubject.subscribe(realData => { this.stdoutBuffer += realData.toString(); }); @@ -24,26 +22,22 @@ export class CommandOutput { this.stderrBuffer += realData.toString(); }); - return new Promise( - (resolve: (result: string) => void, reject: (reason: string) => void) => { - execution.processExitSubject.subscribe(data => { - if (data !== undefined && String(data) === '0') { - return resolve(stripAnsiInJson(this.stdoutBuffer, hasJsonEnabled)); - } else { - // Is the command is sf cli - if so, just use stdoutBuffer before stderrBuffer - if (execution.command.command === 'sf') { - return reject( - stripAnsiInJson(this.stdoutBuffer, hasJsonEnabled) || - stripAnsiInJson(this.stderrBuffer, hasJsonEnabled) - ); - } + return new Promise((resolve: (result: string) => void, reject: (reason: string) => void) => { + execution.processExitSubject.subscribe(data => { + if (data !== undefined && String(data) === '0') { + return resolve(stripAnsiInJson(this.stdoutBuffer, hasJsonEnabled)); + } else { + // Is the command is sf cli - if so, just use stdoutBuffer before stderrBuffer + if (execution.command.command === 'sf') { return reject( - stripAnsiInJson(this.stderrBuffer, hasJsonEnabled) || - stripAnsiInJson(this.stdoutBuffer, hasJsonEnabled) + stripAnsiInJson(this.stdoutBuffer, hasJsonEnabled) || stripAnsiInJson(this.stderrBuffer, hasJsonEnabled) ); } - }); - } - ); + return reject( + stripAnsiInJson(this.stderrBuffer, hasJsonEnabled) || stripAnsiInJson(this.stdoutBuffer, hasJsonEnabled) + ); + } + }); + }); } } diff --git a/packages/salesforcedx-utils/src/cli/compositeCliCommandExecutor.ts b/packages/salesforcedx-utils/src/cli/compositeCliCommandExecutor.ts index f0d4c17c6b..a3ccc95198 100644 --- a/packages/salesforcedx-utils/src/cli/compositeCliCommandExecutor.ts +++ b/packages/salesforcedx-utils/src/cli/compositeCliCommandExecutor.ts @@ -15,9 +15,7 @@ export class CompositeCliCommandExecutor { this.command = commands; } - public execute( - cancellationToken?: CancellationToken - ): CompositeCliCommandExecution { + public execute(cancellationToken?: CancellationToken): CompositeCliCommandExecution { return new CompositeCliCommandExecution(this.command, cancellationToken); } } diff --git a/packages/salesforcedx-utils/src/cli/configGet.ts b/packages/salesforcedx-utils/src/cli/configGet.ts index 4f3a4f7eeb..198df1749b 100644 --- a/packages/salesforcedx-utils/src/cli/configGet.ts +++ b/packages/salesforcedx-utils/src/cli/configGet.ts @@ -13,19 +13,13 @@ import { SfCommandBuilder } from './sfCommandBuilder'; * NOTE: This code is deprecated in favor of using ConfigUtil.ts */ export class ConfigGet { - public async getConfig( - projectPath: string, - ...keys: string[] - ): Promise> { + public async getConfig(projectPath: string, ...keys: string[]): Promise> { const commandBuilder = new SfCommandBuilder().withArg('config:get'); keys.forEach(key => commandBuilder.withArg(key)); - const execution = new CliCommandExecutor( - commandBuilder.withJson().build(), - { - cwd: projectPath - } - ).execute(); + const execution = new CliCommandExecutor(commandBuilder.withJson().build(), { + cwd: projectPath + }).execute(); const cmdOutput = new CommandOutput(); const result = await cmdOutput.getCmdResult(execution); diff --git a/packages/salesforcedx-utils/src/cli/orgDisplay.ts b/packages/salesforcedx-utils/src/cli/orgDisplay.ts index 6d8cb8fe70..71526171f7 100644 --- a/packages/salesforcedx-utils/src/cli/orgDisplay.ts +++ b/packages/salesforcedx-utils/src/cli/orgDisplay.ts @@ -12,10 +12,9 @@ import { SfCommandBuilder } from './sfCommandBuilder'; export class OrgDisplay { public async getOrgInfo(projectPath: string): Promise { - const execution = new CliCommandExecutor( - new SfCommandBuilder().withArg('org:display').withJson().build(), - { cwd: projectPath } - ).execute(); + const execution = new CliCommandExecutor(new SfCommandBuilder().withArg('org:display').withJson().build(), { + cwd: projectPath + }).execute(); const cmdOutput = new CommandOutput(); const result = await cmdOutput.getCmdResult(execution); diff --git a/packages/salesforcedx-utils/src/helpers/ensureCurrentWorkingDirIsProjectPath.ts b/packages/salesforcedx-utils/src/helpers/ensureCurrentWorkingDirIsProjectPath.ts index bbafa32ebe..2a15509869 100644 --- a/packages/salesforcedx-utils/src/helpers/ensureCurrentWorkingDirIsProjectPath.ts +++ b/packages/salesforcedx-utils/src/helpers/ensureCurrentWorkingDirIsProjectPath.ts @@ -5,14 +5,8 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ import * as fs from 'fs'; -export const ensureCurrentWorkingDirIsProjectPath = ( - rootWorkspacePath: string -): void => { - if ( - rootWorkspacePath && - process.cwd() !== rootWorkspacePath && - fs.existsSync(rootWorkspacePath) - ) { +export const ensureCurrentWorkingDirIsProjectPath = (rootWorkspacePath: string): void => { + if (rootWorkspacePath && process.cwd() !== rootWorkspacePath && fs.existsSync(rootWorkspacePath)) { process.chdir(rootWorkspacePath); } }; diff --git a/packages/salesforcedx-utils/src/i18n/message.ts b/packages/salesforcedx-utils/src/i18n/message.ts index ceeb23ffc2..25c302791b 100644 --- a/packages/salesforcedx-utils/src/i18n/message.ts +++ b/packages/salesforcedx-utils/src/i18n/message.ts @@ -37,9 +37,7 @@ export class Message implements LocalizationProvider { const expectedNumArgs = possibleLabel.split('%s').length - 1; if (args.length !== expectedNumArgs) { // just log it, we might want to hide some in some languages on purpose - console.log( - `Arguments do not match for label '${label}', got ${args.length} but want ${expectedNumArgs}` - ); + console.log(`Arguments do not match for label '${label}', got ${args.length} but want ${expectedNumArgs}`); // remove the extra args if (args.length > expectedNumArgs) { labelArgs = args.slice(0, -(args.length - expectedNumArgs)); diff --git a/packages/salesforcedx-utils/src/requestService/requestService.ts b/packages/salesforcedx-utils/src/requestService/requestService.ts index c2518adcc9..cddab35404 100644 --- a/packages/salesforcedx-utils/src/requestService/requestService.ts +++ b/packages/salesforcedx-utils/src/requestService/requestService.ts @@ -110,9 +110,7 @@ export class RequestService { } const urlElements = [this.instanceUrl, command.getCommandUrl()]; const queryString = command.getQueryString(); - const requestUrl = !queryString - ? urlElements.join('/') - : urlElements.join('/').concat('?', queryString); + const requestUrl = !queryString ? urlElements.join('/') : urlElements.join('/').concat('?', queryString); const requestBody = command.getRequest(); const options: XHROptions = { type: restHttpMethodEnum, @@ -122,9 +120,7 @@ export class RequestService { 'Content-Type': 'application/json;charset=utf-8', Accept: 'application/json', Authorization: `OAuth ${this.accessToken}`, - 'Content-Length': requestBody - ? String(Buffer.byteLength(requestBody, 'utf-8')) - : '0', + 'Content-Length': requestBody ? String(Buffer.byteLength(requestBody, 'utf-8')) : '0', 'Sforce-Call-Options': `client=${CLIENT_ID}` }, data: requestBody diff --git a/packages/salesforcedx-utils/test/.eslintrc.json b/packages/salesforcedx-utils/test/.eslintrc.json deleted file mode 100644 index f2b99a417d..0000000000 --- a/packages/salesforcedx-utils/test/.eslintrc.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": [ - "../.eslintrc.json", - "../../../config/common-test-lint-rules.json" - ] -} diff --git a/packages/salesforcedx-utils/test/jest/cli/cliCommandExecution.test.ts b/packages/salesforcedx-utils/test/jest/cli/cliCommandExecution.test.ts index bbfda08292..3b330fadf9 100644 --- a/packages/salesforcedx-utils/test/jest/cli/cliCommandExecution.test.ts +++ b/packages/salesforcedx-utils/test/jest/cli/cliCommandExecution.test.ts @@ -57,32 +57,19 @@ describe('CliCommandExecution Unit Tests.', () => { }); it('Should be able to create an instance.', () => { - const cliCommandExecution = new CliCommandExecution( - testCommand, - testChildProcess - ); + const cliCommandExecution = new CliCommandExecution(testCommand, testChildProcess); expect(cliCommandExecution).toBeInstanceOf(CliCommandExecution); expect(fromEventSpy).toHaveBeenCalledTimes(4); expect(fromEventSpy.mock.calls[0]).toEqual([testChildProcess, 'exit']); expect(fromEventSpy.mock.calls[1]).toEqual([testChildProcess, 'error']); - expect(fromEventSpy.mock.calls[2]).toEqual([ - testChildProcess.stdout, - 'data' - ]); - expect(fromEventSpy.mock.calls[3]).toEqual([ - testChildProcess.stderr, - 'data' - ]); + expect(fromEventSpy.mock.calls[2]).toEqual([testChildProcess.stdout, 'data']); + expect(fromEventSpy.mock.calls[3]).toEqual([testChildProcess.stderr, 'data']); expect(subscribeSpy).toHaveBeenCalledTimes(2); }); it('Should be able to create an instance with cancelation token.', () => { - const cliCommandExecution = new CliCommandExecution( - testCommand, - testChildProcess, - testCancelationToken - ); + const cliCommandExecution = new CliCommandExecution(testCommand, testChildProcess, testCancelationToken); expect(cliCommandExecution).toBeInstanceOf(CliCommandExecution); expect(subscribeSpy).toHaveBeenCalledTimes(3); expect(intervalSpy).toHaveBeenCalledWith(CANCELLATION_INTERVAL); @@ -90,11 +77,7 @@ describe('CliCommandExecution Unit Tests.', () => { describe('Subscribe handlers.', () => { it('Should call timer unsubscribe on exit.', () => { - const cliCommandExecution = new CliCommandExecution( - testCommand, - testChildProcess, - testCancelationToken - ); + const cliCommandExecution = new CliCommandExecution(testCommand, testChildProcess, testCancelationToken); expect(cliCommandExecution).toBeDefined(); const exitSubscribeHandler = subscribeSpy.mock.calls[0][0]; exitSubscribeHandler(); @@ -102,11 +85,7 @@ describe('CliCommandExecution Unit Tests.', () => { }); it('Should call timer unsubscribe on error.', () => { - const cliCommandExecution = new CliCommandExecution( - testCommand, - testChildProcess, - testCancelationToken - ); + const cliCommandExecution = new CliCommandExecution(testCommand, testChildProcess, testCancelationToken); expect(cliCommandExecution).toBeDefined(); const exitSubscribeHandler = subscribeSpy.mock.calls[1][0]; exitSubscribeHandler(); @@ -118,31 +97,19 @@ describe('CliCommandExecution Unit Tests.', () => { it('Should fail to create if child has no pid.', () => { testChildProcess.pid = undefined; expect(() => { - new CliCommandExecution( - testCommand, - testChildProcess, - testCancelationToken - ); + new CliCommandExecution(testCommand, testChildProcess, testCancelationToken); }).toThrowError(NO_PID_ERROR); }); it('Should fail to create if child has no stdout.', () => { testChildProcess.stdout = undefined; expect(() => { - new CliCommandExecution( - testCommand, - testChildProcess, - testCancelationToken - ); + new CliCommandExecution(testCommand, testChildProcess, testCancelationToken); }).toThrowError(NO_STDOUT_ERROR); }); it('Should fail to create if child has no stderr.', () => { testChildProcess.stderr = undefined; expect(() => { - new CliCommandExecution( - testCommand, - testChildProcess, - testCancelationToken - ); + new CliCommandExecution(testCommand, testChildProcess, testCancelationToken); }).toThrowError(NO_STDERR_ERROR); }); }); @@ -155,11 +122,7 @@ describe('CliCommandExecution Unit Tests.', () => { }); it('Should be able to successfully kill child process.', async () => { testCancelationToken.isCancellationRequested = true; - const cliCommandExecution = new CliCommandExecution( - testCommand, - testChildProcess, - testCancelationToken - ); + const cliCommandExecution = new CliCommandExecution(testCommand, testChildProcess, testCancelationToken); expect(cliCommandExecution).toBeInstanceOf(CliCommandExecution); expect(subscribeSpy).toHaveBeenCalledTimes(3); const timoutHandler = subscribeSpy.mock.calls[2][0]; @@ -182,11 +145,7 @@ describe('CliCommandExecution Unit Tests.', () => { it('Should log if fails to kill child process.', () => { const killError = new Error('Failed to kill'); testCancelationToken.isCancellationRequested = true; - const cliCommandExecution = new CliCommandExecution( - testCommand, - testChildProcess, - testCancelationToken - ); + const cliCommandExecution = new CliCommandExecution(testCommand, testChildProcess, testCancelationToken); expect(cliCommandExecution).toBeInstanceOf(CliCommandExecution); expect(subscribeSpy).toHaveBeenCalledTimes(3); const timoutHandler = subscribeSpy.mock.calls[2][0]; diff --git a/packages/salesforcedx-utils/test/jest/cli/cliCommandExecutor.test.ts b/packages/salesforcedx-utils/test/jest/cli/cliCommandExecutor.test.ts index b2875e75eb..f9be53a918 100644 --- a/packages/salesforcedx-utils/test/jest/cli/cliCommandExecutor.test.ts +++ b/packages/salesforcedx-utils/test/jest/cli/cliCommandExecutor.test.ts @@ -35,20 +35,12 @@ describe('CliCommandExecutor Unit Tests.', () => { }); it('Should be able to create an instance.', () => { - const cliCommandExecutor = new CliCommandExecutor( - fakeCommand, - options, - false - ); + const cliCommandExecutor = new CliCommandExecutor(fakeCommand, options, false); expect(cliCommandExecutor).toBeInstanceOf(CliCommandExecutor); }); it('Should be able to include global env.', () => { - const cliCommandExecutor = new CliCommandExecutor( - fakeCommand, - options, - true - ); + const cliCommandExecutor = new CliCommandExecutor(fakeCommand, options, true); const populatedOptions = (cliCommandExecutor as any).options; expect(populatedOptions.env).toEqual( expect.objectContaining({ @@ -63,21 +55,9 @@ describe('CliCommandExecutor Unit Tests.', () => { it('Should be able to execute the command.', () => { const fakeChildProcess = {}; crossSpawnMocked.mockReturnValue(fakeChildProcess as any); - const cliCommandExecutor = new CliCommandExecutor( - fakeCommand, - options, - false - ); + const cliCommandExecutor = new CliCommandExecutor(fakeCommand, options, false); cliCommandExecutor.execute(); - expect(crossSpawnMocked).toHaveBeenCalledWith( - fakeCommand.command, - fakeCommand.args, - options - ); - expect(CliCommandExecutorMock).toHaveBeenCalledWith( - fakeCommand, - fakeChildProcess, - undefined - ); + expect(crossSpawnMocked).toHaveBeenCalledWith(fakeCommand.command, fakeCommand.args, options); + expect(CliCommandExecutorMock).toHaveBeenCalledWith(fakeCommand, fakeChildProcess, undefined); }); }); diff --git a/packages/salesforcedx-utils/test/jest/cli/cliVersionStatus.test.ts b/packages/salesforcedx-utils/test/jest/cli/cliVersionStatus.test.ts index 89fb7664ef..1c76a6ad01 100644 --- a/packages/salesforcedx-utils/test/jest/cli/cliVersionStatus.test.ts +++ b/packages/salesforcedx-utils/test/jest/cli/cliVersionStatus.test.ts @@ -9,7 +9,6 @@ import * as child_process from 'child_process'; import { CliStatusEnum, CliVersionStatus } from '../../../src/cli/cliVersionStatus'; describe('CliVersionStatus unit tests.', () => { - const sfV2_string = '@salesforce/cli/2.15.9 darwin-arm64 node-v18.17.1'; const sfdxV7_valid_string = 'sfdx-cli/7.209.6 win32-x64 node-v18.15.0'; const sfV1_string = '@salesforce/cli/1.87.0 darwin-arm64 node-v18.17.1'; @@ -28,15 +27,12 @@ describe('CliVersionStatus unit tests.', () => { Test cases that produce a result for getSfdxCliVersion() and getSfCliVersion() */ describe('Test cases that produce a result for getSfdxCliVersion() and getSfCliVersion()', () => { - const fakeExecution = Buffer.from('fake result'); const fakeResult = 'fake result'; let executeSpy: jest.SpyInstance; beforeEach(() => { - executeSpy = jest - .spyOn(child_process, 'execSync') - .mockReturnValue(fakeExecution); + executeSpy = jest.spyOn(child_process, 'execSync').mockReturnValue(fakeExecution); }); it('getSfdxCliVersion() - can get a result', async () => { @@ -58,16 +54,13 @@ describe('CliVersionStatus unit tests.', () => { Test cases that throw an error for getSfdxCliVersion() and getSfCliVersion() */ describe('Test cases that throw an error for getSfdxCliVersion() and getSfCliVersion()', () => { - const cliNotFound = 'No CLI'; let executeSpy: jest.SpyInstance; beforeEach(() => { - executeSpy = jest - .spyOn(child_process, 'execSync') - .mockImplementationOnce(() => { - throw new Error('simulate exception in execSync()'); - }); + executeSpy = jest.spyOn(child_process, 'execSync').mockImplementationOnce(() => { + throw new Error('simulate exception in execSync()'); + }); }); it('getSfdxCliVersion() - throws error', async () => { @@ -184,4 +177,4 @@ describe('CliVersionStatus unit tests.', () => { expect(result).toStrictEqual(CliStatusEnum.SFv2); }); }); -}); \ No newline at end of file +}); diff --git a/packages/salesforcedx-utils/test/jest/cli/commandBuilder.test.ts b/packages/salesforcedx-utils/test/jest/cli/commandBuilder.test.ts index b714c1b46b..489e6a2ffe 100644 --- a/packages/salesforcedx-utils/test/jest/cli/commandBuilder.test.ts +++ b/packages/salesforcedx-utils/test/jest/cli/commandBuilder.test.ts @@ -26,9 +26,7 @@ describe('CommandBuild unit tests', () => { }); it('Should be able to set description.', () => { - const testCommand = commandBuilderInst - .withDescription(testDescription) - .build(); + const testCommand = commandBuilderInst.withDescription(testDescription).build(); expect(testCommand.description).toEqual(testDescription); }); @@ -69,9 +67,7 @@ describe('CommandBuild unit tests', () => { .build(); expect(testCommand.description).toEqual(testDescription); expect(testCommand.args).toContain(testArg); - expect(testCommand.args).toEqual( - expect.arrayContaining([testFlag, testFlagValue]) - ); + expect(testCommand.args).toEqual(expect.arrayContaining([testFlag, testFlagValue])); expect(testCommand.args).toEqual(expect.arrayContaining([JSON_FLAG])); expect(testCommand.logName).toEqual(testLogName); }); diff --git a/packages/salesforcedx-utils/test/jest/cli/commandOutput.test.ts b/packages/salesforcedx-utils/test/jest/cli/commandOutput.test.ts index 8134e3c854..26d3e42440 100644 --- a/packages/salesforcedx-utils/test/jest/cli/commandOutput.test.ts +++ b/packages/salesforcedx-utils/test/jest/cli/commandOutput.test.ts @@ -16,7 +16,7 @@ describe('CommandOutput Unit Tests.', () => { let result: Promise; // It's a pain to unit test Observables. Open to exploring other options. - // eslint-disable-next-line @typescript-eslint/no-explicit-any + let fakeExecution: any; beforeEach(() => { fakeExecution = { @@ -40,8 +40,7 @@ describe('CommandOutput Unit Tests.', () => { expect(fakeExecution.stdoutSubject.subscribe).toHaveBeenCalled(); expect(fakeExecution.stderrSubject.subscribe).toHaveBeenCalled(); expect(fakeExecution.processExitSubject.subscribe).toHaveBeenCalled(); - const exitCallback = - fakeExecution.processExitSubject.subscribe.mock.calls[0][0]; + const exitCallback = fakeExecution.processExitSubject.subscribe.mock.calls[0][0]; // Call the exit callback with a 0 response to indicate success exitCallback(successCode); result.then(outValue => { @@ -50,14 +49,11 @@ describe('CommandOutput Unit Tests.', () => { }); it('Should have data from stdout on success.', async () => { - const stdoutCallback = - fakeExecution.stdoutSubject.subscribe.mock.calls[0][0]; + const stdoutCallback = fakeExecution.stdoutSubject.subscribe.mock.calls[0][0]; stdoutCallback(goodOutput); - const stderrCallback = - fakeExecution.stderrSubject.subscribe.mock.calls[0][0]; + const stderrCallback = fakeExecution.stderrSubject.subscribe.mock.calls[0][0]; stderrCallback(badOutput); - const exitCallback = - fakeExecution.processExitSubject.subscribe.mock.calls[0][0]; + const exitCallback = fakeExecution.processExitSubject.subscribe.mock.calls[0][0]; // Call the exit callback with a 0 response to indicate success exitCallback(successCode); result.then(outValue => { @@ -66,13 +62,11 @@ describe('CommandOutput Unit Tests.', () => { }); it('Should process multiple calls to stdout.', async () => { - const stdoutCallback = - fakeExecution.stdoutSubject.subscribe.mock.calls[0][0]; + const stdoutCallback = fakeExecution.stdoutSubject.subscribe.mock.calls[0][0]; stdoutCallback(goodOutput); stdoutCallback(goodOutput); stdoutCallback(goodOutput); - const exitCallback = - fakeExecution.processExitSubject.subscribe.mock.calls[0][0]; + const exitCallback = fakeExecution.processExitSubject.subscribe.mock.calls[0][0]; // Call the exit callback with a 0 response to indicate success exitCallback(successCode); result.then(outValue => { @@ -82,14 +76,11 @@ describe('CommandOutput Unit Tests.', () => { it('Should have data from stderr on failure for not command sf.', async () => { fakeExecution.command.command = 'notsf'; - const stdoutCallback = - fakeExecution.stdoutSubject.subscribe.mock.calls[0][0]; + const stdoutCallback = fakeExecution.stdoutSubject.subscribe.mock.calls[0][0]; stdoutCallback(goodOutput); - const stderrCallback = - fakeExecution.stderrSubject.subscribe.mock.calls[0][0]; + const stderrCallback = fakeExecution.stderrSubject.subscribe.mock.calls[0][0]; stderrCallback(badOutput); - const exitCallback = - fakeExecution.processExitSubject.subscribe.mock.calls[0][0]; + const exitCallback = fakeExecution.processExitSubject.subscribe.mock.calls[0][0]; // Call the exit callback with a 1 response to indicate failure exitCallback(failCode); result.catch(outValue => { @@ -99,11 +90,9 @@ describe('CommandOutput Unit Tests.', () => { it('Should have data from stdout on failure if there is no stderr when command not sf.', async () => { fakeExecution.command.command = 'notsf'; - const stdoutCallback = - fakeExecution.stdoutSubject.subscribe.mock.calls[0][0]; + const stdoutCallback = fakeExecution.stdoutSubject.subscribe.mock.calls[0][0]; stdoutCallback(goodOutput); - const exitCallback = - fakeExecution.processExitSubject.subscribe.mock.calls[0][0]; + const exitCallback = fakeExecution.processExitSubject.subscribe.mock.calls[0][0]; // Call the exit callback with a 1 response to indicate failure exitCallback(failCode); result.catch(outValue => { @@ -111,14 +100,11 @@ describe('CommandOutput Unit Tests.', () => { }); }); it('Should have data from stdout on failure for sf command.', async () => { - const stdoutCallback = - fakeExecution.stdoutSubject.subscribe.mock.calls[0][0]; + const stdoutCallback = fakeExecution.stdoutSubject.subscribe.mock.calls[0][0]; stdoutCallback(badOutput); - const stderrCallback = - fakeExecution.stderrSubject.subscribe.mock.calls[0][0]; + const stderrCallback = fakeExecution.stderrSubject.subscribe.mock.calls[0][0]; stderrCallback(goodOutput); - const exitCallback = - fakeExecution.processExitSubject.subscribe.mock.calls[0][0]; + const exitCallback = fakeExecution.processExitSubject.subscribe.mock.calls[0][0]; // Call the exit callback with a 1 response to indicate failure exitCallback(failCode); result.catch(outValue => { @@ -127,11 +113,9 @@ describe('CommandOutput Unit Tests.', () => { }); it('Should have data from stderr on failure if there is no stdout when sf command.', async () => { - const stderrCallback = - fakeExecution.stderrSubject.subscribe.mock.calls[0][0]; + const stderrCallback = fakeExecution.stderrSubject.subscribe.mock.calls[0][0]; stderrCallback(badOutput); - const exitCallback = - fakeExecution.processExitSubject.subscribe.mock.calls[0][0]; + const exitCallback = fakeExecution.processExitSubject.subscribe.mock.calls[0][0]; // Call the exit callback with a 1 response to indicate failure exitCallback(failCode); result.catch(outValue => { diff --git a/packages/salesforcedx-utils/test/jest/cli/configGet.test.ts b/packages/salesforcedx-utils/test/jest/cli/configGet.test.ts index 1eb74c7074..985143529d 100644 --- a/packages/salesforcedx-utils/test/jest/cli/configGet.test.ts +++ b/packages/salesforcedx-utils/test/jest/cli/configGet.test.ts @@ -12,7 +12,7 @@ describe('OrgGet unit tests.', () => { totally: 'fake' }; // configGet expect and array with named keys which does not play nice in TS land - // eslint-disable-next-line @typescript-eslint/no-explicit-any + const configMap: any = [ { key: 'config1', value: 'true' }, { key: 'target-dev-hub', value: 'test@test.com' }, @@ -28,12 +28,8 @@ describe('OrgGet unit tests.', () => { let executeSpy: jest.SpyInstance; let getCmdResultSpy: jest.SpyInstance; beforeEach(() => { - executeSpy = jest - .spyOn(CliCommandExecutor.prototype, 'execute') - .mockReturnValue(fakeExecution as any); - getCmdResultSpy = jest - .spyOn(CommandOutput.prototype, 'getCmdResult') - .mockResolvedValue(fakeResult); + executeSpy = jest.spyOn(CliCommandExecutor.prototype, 'execute').mockReturnValue(fakeExecution as any); + getCmdResultSpy = jest.spyOn(CommandOutput.prototype, 'getCmdResult').mockResolvedValue(fakeResult); }); it('Should create instance.', () => { @@ -68,9 +64,7 @@ describe('OrgGet unit tests.', () => { getCmdResultSpy.mockResolvedValue(partialJson); const configGet = new ConfigGet(); // Unexpected token error is thrown b/c json can not be parsed. - expect(configGet.getConfig(fakePath)).rejects.toThrowError( - /Unexpected token/ - ); + expect(configGet.getConfig(fakePath)).rejects.toThrowError(/Unexpected token/); }); }); }); diff --git a/packages/salesforcedx-utils/test/jest/cli/orgDisplay.test.ts b/packages/salesforcedx-utils/test/jest/cli/orgDisplay.test.ts index b7a75ca938..15ac2ebf36 100644 --- a/packages/salesforcedx-utils/test/jest/cli/orgDisplay.test.ts +++ b/packages/salesforcedx-utils/test/jest/cli/orgDisplay.test.ts @@ -21,12 +21,8 @@ describe('OrgDisplay unit tests.', () => { let executeSpy: jest.SpyInstance; let getCmdResultSpy: jest.SpyInstance; beforeEach(() => { - executeSpy = jest - .spyOn(CliCommandExecutor.prototype, 'execute') - .mockReturnValue(fakeExecution as any); - getCmdResultSpy = jest - .spyOn(CommandOutput.prototype, 'getCmdResult') - .mockResolvedValue(fakeResult); + executeSpy = jest.spyOn(CliCommandExecutor.prototype, 'execute').mockReturnValue(fakeExecution as any); + getCmdResultSpy = jest.spyOn(CommandOutput.prototype, 'getCmdResult').mockResolvedValue(fakeResult); }); it('Should create instance.', () => { diff --git a/packages/salesforcedx-utils/test/jest/helpers/ensureCurrentWorkingDirIsProjectPath.test.ts b/packages/salesforcedx-utils/test/jest/helpers/ensureCurrentWorkingDirIsProjectPath.test.ts index 2cb62148e2..0c26f4cf69 100644 --- a/packages/salesforcedx-utils/test/jest/helpers/ensureCurrentWorkingDirIsProjectPath.test.ts +++ b/packages/salesforcedx-utils/test/jest/helpers/ensureCurrentWorkingDirIsProjectPath.test.ts @@ -17,9 +17,7 @@ describe('ensureCurrentWorkingDirIsProjectPath', () => { beforeEach(() => { fsExistsSyncSpy = jest.spyOn(fs, 'existsSync'); processCwdSpy = jest.spyOn(process, 'cwd'); - processChDirSpy = jest - .spyOn(process, 'chdir') - .mockImplementation(jest.fn()); + processChDirSpy = jest.spyOn(process, 'chdir').mockImplementation(jest.fn()); }); it('should change the processes current working directory to the project directory', async () => { diff --git a/packages/salesforcedx-utils/test/jest/i18n/localization.test.ts b/packages/salesforcedx-utils/test/jest/i18n/localization.test.ts index 2d89f7aa82..4ebb2c6881 100644 --- a/packages/salesforcedx-utils/test/jest/i18n/localization.test.ts +++ b/packages/salesforcedx-utils/test/jest/i18n/localization.test.ts @@ -12,9 +12,7 @@ describe('Localization Unit Tests.', () => { let delegateLocalizeSpy: jest.SpyInstance; beforeEach(() => { - delegateLocalizeSpy = jest - .spyOn(Message.prototype, 'localize') - .mockReturnValue(localizaedValue); + delegateLocalizeSpy = jest.spyOn(Message.prototype, 'localize').mockReturnValue(localizaedValue); }); it('Should be able to create an instance.', () => { const fakeMessage = new Message(fakeMessages, undefined); @@ -28,11 +26,6 @@ describe('Localization Unit Tests.', () => { const localization = new Localization(fakeMessage); const result = localization.localize('fakeLabel', 1, true, 'fake'); expect(result).toEqual(localizaedValue); - expect(delegateLocalizeSpy).toHaveBeenCalledWith( - 'fakeLabel', - 1, - true, - 'fake' - ); + expect(delegateLocalizeSpy).toHaveBeenCalledWith('fakeLabel', 1, true, 'fake'); }); }); diff --git a/packages/salesforcedx-utils/test/jest/requestService/requestService.test.ts b/packages/salesforcedx-utils/test/jest/requestService/requestService.test.ts index 0dccdfd71a..94dade7603 100644 --- a/packages/salesforcedx-utils/test/jest/requestService/requestService.test.ts +++ b/packages/salesforcedx-utils/test/jest/requestService/requestService.test.ts @@ -13,11 +13,7 @@ import { ENV_SF_TARGET_ORG, ENV_SF_ORG_INSTANCE_URL } from '../../../src/constants'; -import { - BaseCommand, - RequestService, - RestHttpMethodEnum -} from '../../../src/requestService'; +import { BaseCommand, RequestService, RestHttpMethodEnum } from '../../../src/requestService'; jest.mock('request-light'); // This ensures that typscript understands the mocked module @@ -54,9 +50,7 @@ describe('RequestService unit tests.', () => { it('Should have default timeout.', () => { const requestService = new RequestService(); - expect(requestService.connectionTimeoutMs).toEqual( - DEFAULT_CONNECTION_TIMEOUT_MS - ); + expect(requestService.connectionTimeoutMs).toEqual(DEFAULT_CONNECTION_TIMEOUT_MS); }); describe('getEnvVars()', () => { @@ -95,9 +89,7 @@ describe('RequestService unit tests.', () => { let sendRequestMock: jest.SpyInstance; beforeEach(() => { - sendRequestMock = jest - .spyOn(RequestService.prototype, 'sendRequest') - .mockName('sendRequestMock'); + sendRequestMock = jest.spyOn(RequestService.prototype, 'sendRequest').mockName('sendRequestMock'); requestServiceInst = new RequestService(); requestServiceInst.proxyUrl = testProxyUrl; requestServiceInst.instanceUrl = testInstanceUrl; @@ -115,10 +107,7 @@ describe('RequestService unit tests.', () => { expect(result).toEqual(fakeResponse.responseText); expect(sendRequestMock).toHaveBeenCalled(); expect(sendRequestMock.mock.calls[0]).toMatchSnapshot(); - expect(mockedRequestLight.configure).toHaveBeenCalledWith( - testProxyUrl, - true - ); + expect(mockedRequestLight.configure).toHaveBeenCalledWith(testProxyUrl, true); }); it('Should include proxy authorization info if defined.', async () => { @@ -138,19 +127,14 @@ describe('RequestService unit tests.', () => { // have getRequest return nothing to exercise that path. jest.spyOn(queryCommand, 'getRequest').mockReturnValue(undefined); - const result = await requestServiceInst.execute( - queryCommand, - RestHttpMethodEnum.Get - ); + const result = await requestServiceInst.execute(queryCommand, RestHttpMethodEnum.Get); expect(result).toEqual(fakeResponse.responseText); expect(sendRequestMock.mock.calls[0]).toMatchSnapshot(); }); it('Should reject on error.', async () => { sendRequestMock.mockRejectedValue(fakeResponse); - expect(requestServiceInst.execute(testCommand)).rejects.toMatch( - fakeResponse.responseText - ); + expect(requestServiceInst.execute(testCommand)).rejects.toMatch(fakeResponse.responseText); }); }); diff --git a/packages/salesforcedx-visualforce-language-server/.eslintrc.json b/packages/salesforcedx-visualforce-language-server/.eslintrc.json deleted file mode 100644 index a8b986b195..0000000000 --- a/packages/salesforcedx-visualforce-language-server/.eslintrc.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "root": true, - "extends": ["../../config/base-eslintrc.json", "./fix-these-rules.json"], - "overrides": [ - { - "files": ["./src/**/*.ts", "./test/**/*.ts"], - "parserOptions": { - "project": "./tsconfig.json" - } - } - ] -} diff --git a/packages/salesforcedx-visualforce-language-server/fix-these-rules.json b/packages/salesforcedx-visualforce-language-server/fix-these-rules.json deleted file mode 100644 index bc660cea16..0000000000 --- a/packages/salesforcedx-visualforce-language-server/fix-these-rules.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "rules": { - "prefer-arrow/prefer-arrow-functions": ["error", {}], - "@typescript-eslint/no-unsafe-assignment": "warn", - "@typescript-eslint/no-misused-promises": "warn", - "@typescript-eslint/no-unsafe-argument": "warn", - "@typescript-eslint/no-unsafe-member-access": "warn", - "@typescript-eslint/no-duplicate-type-constituents": "warn", - "@typescript-eslint/no-floating-promises": "warn", - "guard-for-in": "warn", - "@typescript-eslint/no-unsafe-return": "warn", - "no-useless-escape": "warn", - "@typescript-eslint/no-unsafe-call": "warn", - "no-prototype-builtins": "warn", - "@typescript-eslint/no-unsafe-enum-comparison": "warn", - "@typescript-eslint/prefer-for-of": "warn" - } -} diff --git a/packages/salesforcedx-visualforce-language-server/package.json b/packages/salesforcedx-visualforce-language-server/package.json index 1f3dc39f36..77819ca683 100644 --- a/packages/salesforcedx-visualforce-language-server/package.json +++ b/packages/salesforcedx-visualforce-language-server/package.json @@ -5,11 +5,11 @@ "publisher": "salesforce", "license": "BSD-3-Clause", "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" }, "dependencies": { "@salesforce/salesforcedx-visualforce-markup-language-server": "62.5.0", - "typescript": "^5.2.2", + "typescript": "^5.6.2", "vscode-css-languageservice": "2.1.9", "vscode-languageserver": "5.2.1", "vscode-languageserver-protocol": "3.14.1", @@ -18,17 +18,8 @@ "vscode-uri": "1.0.1" }, "devDependencies": { - "@types/node": "^18.11.9", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", - "prettier": "3.0.3", + "@types/node": "^20.0.0", + "prettier": "3.3.3", "shx": "0.3.4" }, "scripts": { diff --git a/packages/salesforcedx-visualforce-language-server/src/languageModelCache.ts b/packages/salesforcedx-visualforce-language-server/src/languageModelCache.ts index 196d3e91b7..fd58ea0b13 100644 --- a/packages/salesforcedx-visualforce-language-server/src/languageModelCache.ts +++ b/packages/salesforcedx-visualforce-language-server/src/languageModelCache.ts @@ -1,4 +1,3 @@ -/* eslint-disable header/header */ /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See OSSREADME.json in the project root for license information. @@ -48,11 +47,7 @@ export const getLanguageModelCache = ( const version = document.version; const languageId = document.languageId; const languageModelInfo = languageModels[document.uri]; - if ( - languageModelInfo && - languageModelInfo.version === version && - languageModelInfo.languageId === languageId - ) { + if (languageModelInfo && languageModelInfo.version === version && languageModelInfo.languageId === languageId) { languageModelInfo.cTime = Date.now(); return languageModelInfo.languageModel; } diff --git a/packages/salesforcedx-visualforce-language-server/src/modes/cssMode.ts b/packages/salesforcedx-visualforce-language-server/src/modes/cssMode.ts index ba2a78fdf1..283dab2f92 100644 --- a/packages/salesforcedx-visualforce-language-server/src/modes/cssMode.ts +++ b/packages/salesforcedx-visualforce-language-server/src/modes/cssMode.ts @@ -1,4 +1,3 @@ -/* eslint-disable header/header */ /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See OSSREADME.json in the project root for license information. @@ -7,21 +6,14 @@ import { getCSSLanguageService, Stylesheet } from 'vscode-css-languageservice'; import { Position, TextDocument } from 'vscode-languageserver-types'; -import { - getLanguageModelCache, - LanguageModelCache -} from '../languageModelCache'; +import { getLanguageModelCache, LanguageModelCache } from '../languageModelCache'; import { CSS_STYLE_RULE, HTMLDocumentRegions } from './embeddedSupport'; import { ColorInformation, LanguageMode, Settings } from './languageModes'; -export const getCSSMode = ( - documentRegions: LanguageModelCache -): LanguageMode => { +export const getCSSMode = (documentRegions: LanguageModelCache): LanguageMode => { const cssLanguageService = getCSSLanguageService(); - const embeddedCSSDocuments = getLanguageModelCache( - 10, - 60, - document => documentRegions.get(document).getEmbeddedDocument('css') + const embeddedCSSDocuments = getLanguageModelCache(10, 60, document => + documentRegions.get(document).getEmbeddedDocument('css') ); const cssStylesheets = getLanguageModelCache(10, 60, document => cssLanguageService.parseStylesheet(document) @@ -36,35 +28,19 @@ export const getCSSMode = ( }, doValidation: (document: TextDocument, settings: Settings) => { const embedded = embeddedCSSDocuments.get(document); - return cssLanguageService.doValidation( - embedded, - cssStylesheets.get(embedded), - settings && settings.css - ); + return cssLanguageService.doValidation(embedded, cssStylesheets.get(embedded), settings && settings.css); }, doComplete: (document: TextDocument, position: Position) => { const embedded = embeddedCSSDocuments.get(document); - return cssLanguageService.doComplete( - embedded, - position, - cssStylesheets.get(embedded) - ); + return cssLanguageService.doComplete(embedded, position, cssStylesheets.get(embedded)); }, doHover: (document: TextDocument, position: Position) => { const embedded = embeddedCSSDocuments.get(document); - return cssLanguageService.doHover( - embedded, - position, - cssStylesheets.get(embedded) - ); + return cssLanguageService.doHover(embedded, position, cssStylesheets.get(embedded)); }, findDocumentHighlight: (document: TextDocument, position: Position) => { const embedded = embeddedCSSDocuments.get(document); - return cssLanguageService.findDocumentHighlights( - embedded, - position, - cssStylesheets.get(embedded) - ); + return cssLanguageService.findDocumentHighlights(embedded, position, cssStylesheets.get(embedded)); }, findDocumentSymbols: (document: TextDocument) => { const embedded = embeddedCSSDocuments.get(document); @@ -74,34 +50,19 @@ export const getCSSMode = ( }, findDefinition: (document: TextDocument, position: Position) => { const embedded = embeddedCSSDocuments.get(document); - return cssLanguageService.findDefinition( - embedded, - position, - cssStylesheets.get(embedded) - ); + return cssLanguageService.findDefinition(embedded, position, cssStylesheets.get(embedded)); }, findReferences: (document: TextDocument, position: Position) => { const embedded = embeddedCSSDocuments.get(document); - return cssLanguageService.findReferences( - embedded, - position, - cssStylesheets.get(embedded) - ); + return cssLanguageService.findReferences(embedded, position, cssStylesheets.get(embedded)); }, findDocumentColors: (document: TextDocument) => { const embedded = embeddedCSSDocuments.get(document); - return cssLanguageService.findDocumentColors( - embedded, - cssStylesheets.get(embedded) - ); + return cssLanguageService.findDocumentColors(embedded, cssStylesheets.get(embedded)); }, getColorPresentations: (document: TextDocument, colorInfo: ColorInformation) => { const embedded = embeddedCSSDocuments.get(document); - return cssLanguageService.getColorPresentations( - embedded, - cssStylesheets.get(embedded), - colorInfo - ); + return cssLanguageService.getColorPresentations(embedded, cssStylesheets.get(embedded), colorInfo); }, onDocumentRemoved: (document: TextDocument) => { embeddedCSSDocuments.onDocumentRemoved(document); diff --git a/packages/salesforcedx-visualforce-language-server/src/modes/embeddedSupport.ts b/packages/salesforcedx-visualforce-language-server/src/modes/embeddedSupport.ts index d801f9e624..a3dc406731 100644 --- a/packages/salesforcedx-visualforce-language-server/src/modes/embeddedSupport.ts +++ b/packages/salesforcedx-visualforce-language-server/src/modes/embeddedSupport.ts @@ -1,4 +1,3 @@ -/* eslint-disable header/header */ /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See OSSREADME.json in the project root for license information. @@ -21,10 +20,7 @@ export type LanguageRange = Range & { }; export type HTMLDocumentRegions = { - getEmbeddedDocument( - languageId: string, - ignoreAttributeValues?: boolean - ): TextDocument; + getEmbeddedDocument(languageId: string, ignoreAttributeValues?: boolean): TextDocument; getLanguageRanges(range: Range): LanguageRange[]; getLanguageAtPosition(position: Position): string; getLanguagesInDocument(): string[]; @@ -40,10 +36,7 @@ type EmbeddedRegion = { attributeValue?: boolean; }; -export const getDocumentRegions = ( - languageService: LanguageService, - document: TextDocument -): HTMLDocumentRegions => { +export const getDocumentRegions = (languageService: LanguageService, document: TextDocument): HTMLDocumentRegions => { const regions: EmbeddedRegion[] = []; const scanner = languageService.createScanner(document.getText()); let lastTagName: string; @@ -77,24 +70,14 @@ export const getDocumentRegions = ( lastAttributeName = scanner.getTokenText(); break; case TokenType.AttributeValue: - if ( - lastAttributeName === 'src' && - lastTagName.toLowerCase() === 'script' - ) { + if (lastAttributeName === 'src' && lastTagName.toLowerCase() === 'script') { let value = scanner.getTokenText(); if (value[0] === "'" || value[0] === '"') { value = value.substr(1, value.length - 1); } importedScripts.push(value); - } else if ( - lastAttributeName === 'type' && - lastTagName.toLowerCase() === 'script' - ) { - if ( - /["'](module|(text|application)\/(java|ecma)script)["']/.test( - scanner.getTokenText() - ) - ) { + } else if (lastAttributeName === 'type' && lastTagName.toLowerCase() === 'script') { + if (/["'](module|(text|application)\/(java|ecma)script)["']/.test(scanner.getTokenText())) { languageIdFromType = 'javascript'; } else { languageIdFromType = void 0; @@ -123,27 +106,19 @@ export const getDocumentRegions = ( token = scanner.scan(); } return { - getLanguageRanges: (range: Range) => - getLanguageRanges(document, regions, range), + getLanguageRanges: (range: Range) => getLanguageRanges(document, regions, range), getEmbeddedDocument: (languageId: string, ignoreAttributeValues: boolean) => getEmbeddedDocument(document, regions, languageId, ignoreAttributeValues), - getLanguageAtPosition: (position: Position) => - getLanguageAtPosition(document, regions, position), + getLanguageAtPosition: (position: Position) => getLanguageAtPosition(document, regions, position), getLanguagesInDocument: () => getLanguagesInDocument(document, regions), getImportedScripts: () => importedScripts }; }; -const getLanguageRanges = ( - document: TextDocument, - regions: EmbeddedRegion[], - range: Range -): LanguageRange[] => { +const getLanguageRanges = (document: TextDocument, regions: EmbeddedRegion[], range: Range): LanguageRange[] => { const result: LanguageRange[] = []; let currentPos = range ? range.start : Position.create(0, 0); let currentOffset = range ? document.offsetAt(range.start) : 0; - const endOffset = range - ? document.offsetAt(range.end) - : document.getText().length; + const endOffset = range ? document.offsetAt(range.end) : document.getText().length; for (const region of regions) { if (region.end > currentOffset && region.start < endOffset) { const start = Math.max(region.start, currentOffset); @@ -180,10 +155,7 @@ const getLanguageRanges = ( return result; }; -const getLanguagesInDocument = ( - document: TextDocument, - regions: EmbeddedRegion[] -): string[] => { +const getLanguagesInDocument = (document: TextDocument, regions: EmbeddedRegion[]): string[] => { const result = []; for (const region of regions) { if (region.languageId && result.indexOf(region.languageId) === -1) { @@ -197,11 +169,7 @@ const getLanguagesInDocument = ( return result; }; -const getLanguageAtPosition = ( - document: TextDocument, - regions: EmbeddedRegion[], - position: Position -): string => { +const getLanguageAtPosition = (document: TextDocument, regions: EmbeddedRegion[], position: Position): string => { const offset = document.offsetAt(position); for (const region of regions) { if (region.start <= offset) { @@ -226,37 +194,15 @@ const getEmbeddedDocument = ( let result = ''; let lastSuffix = ''; for (const c of contents) { - if ( - c.languageId === languageId && - (!ignoreAttributeValues || !c.attributeValue) - ) { - result = substituteWithWhitespace( - result, - currentPos, - c.start, - oldContent, - lastSuffix, - getPrefix(c) - ); + if (c.languageId === languageId && (!ignoreAttributeValues || !c.attributeValue)) { + result = substituteWithWhitespace(result, currentPos, c.start, oldContent, lastSuffix, getPrefix(c)); result += oldContent.substring(c.start, c.end); currentPos = c.end; lastSuffix = getSuffix(c); } } - result = substituteWithWhitespace( - result, - currentPos, - oldContent.length, - oldContent, - lastSuffix, - '' - ); - return TextDocument.create( - document.uri, - languageId, - document.version, - result - ); + result = substituteWithWhitespace(result, currentPos, oldContent.length, oldContent, lastSuffix, ''); + return TextDocument.create(document.uri, languageId, document.version, result); }; const getPrefix = (c: EmbeddedRegion) => { diff --git a/packages/salesforcedx-visualforce-language-server/src/modes/formatting.ts b/packages/salesforcedx-visualforce-language-server/src/modes/formatting.ts index c09a658c56..ca291b00ed 100644 --- a/packages/salesforcedx-visualforce-language-server/src/modes/formatting.ts +++ b/packages/salesforcedx-visualforce-language-server/src/modes/formatting.ts @@ -1,17 +1,10 @@ -/* eslint-disable header/header */ /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See OSSREADME.json in the project root for license information. *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { - FormattingOptions, - Position, - Range, - TextDocument, - TextEdit -} from 'vscode-languageserver-types'; +import { FormattingOptions, Position, Range, TextDocument, TextEdit } from 'vscode-languageserver-types'; import { pushAll } from '../utils/arrays'; import { applyEdits } from '../utils/edits'; import { isEOL } from '../utils/strings'; @@ -30,22 +23,13 @@ export const format = ( const endPos = formatRange.end; let endOffset = document.offsetAt(endPos); const content = document.getText(); - if ( - endPos.character === 0 && - endPos.line > 0 && - endOffset !== content.length - ) { + if (endPos.character === 0 && endPos.line > 0 && endOffset !== content.length) { // if selection ends after a new line, exclude that new line - const prevLineStart = document.offsetAt( - Position.create(endPos.line - 1, 0) - ); + const prevLineStart = document.offsetAt(Position.create(endPos.line - 1, 0)); while (isEOL(content, endOffset - 1) && endOffset > prevLineStart) { endOffset--; } - formatRange = Range.create( - formatRange.start, - document.positionAt(endOffset) - ); + formatRange = Range.create(formatRange.start, document.positionAt(endOffset)); } // run the html formatter on the full range and pass the result content to the embedded formatters. @@ -62,12 +46,7 @@ export const format = ( while (i < allRanges.length && allRanges[i].mode.getId() !== 'html') { const range = allRanges[i]; if (!range.attributeValue && range.mode.format) { - const edits = range.mode.format( - document, - Range.create(startPos, range.end), - formattingOptions, - settings - ); + const edits = range.mode.format(document, Range.create(startPos, range.end), formattingOptions, settings); pushAll(result, edits); } startPos = range.end; @@ -81,12 +60,7 @@ export const format = ( // perform a html format and apply changes to a new document const htmlMode = languageModes.getMode('html'); - const htmlEdits = htmlMode.format( - document, - formatRange, - formattingOptions, - settings - ); + const htmlEdits = htmlMode.format(document, formatRange, formattingOptions, settings); const htmlFormattedContent = applyEdits(document, htmlEdits); const newDocument = TextDocument.create( document.uri + '.tmp', @@ -96,29 +70,18 @@ export const format = ( ); try { // run embedded formatters on html formatted content: - formatters see correct initial indent - const afterFormatRangeLength = - document.getText().length - document.offsetAt(formatRange.end); // length of unchanged content after replace range + const afterFormatRangeLength = document.getText().length - document.offsetAt(formatRange.end); // length of unchanged content after replace range const newFormatRange = Range.create( formatRange.start, - newDocument.positionAt( - htmlFormattedContent.length - afterFormatRangeLength - ) - ); - const embeddedRanges = languageModes.getModesInRange( - newDocument, - newFormatRange + newDocument.positionAt(htmlFormattedContent.length - afterFormatRangeLength) ); + const embeddedRanges = languageModes.getModesInRange(newDocument, newFormatRange); const embeddedEdits: TextEdit[] = []; for (const r of embeddedRanges) { const mode = r.mode; - if ( - mode && - mode.format && - enabledModes[mode.getId()] && - !r.attributeValue - ) { + if (mode && mode.format && enabledModes[mode.getId()] && !r.attributeValue) { const edits = mode.format(newDocument, r, formattingOptions, settings); for (const edit of edits) { embeddedEdits.push(edit); diff --git a/packages/salesforcedx-visualforce-language-server/src/modes/htmlMode.ts b/packages/salesforcedx-visualforce-language-server/src/modes/htmlMode.ts index b7fb84a121..d9f6f7f7a3 100644 --- a/packages/salesforcedx-visualforce-language-server/src/modes/htmlMode.ts +++ b/packages/salesforcedx-visualforce-language-server/src/modes/htmlMode.ts @@ -1,4 +1,3 @@ -/* eslint-disable header/header */ /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See OSSREADME.json in the project root for license information. @@ -16,9 +15,7 @@ import { Position, Range, TextDocument } from 'vscode-languageserver-types'; import { getLanguageModelCache } from '../languageModelCache'; import { LanguageMode, Settings } from './languageModes'; -export const getHTMLMode = ( - htmlLanguageService: HTMLLanguageService -): LanguageMode => { +export const getHTMLMode = (htmlLanguageService: HTMLLanguageService): LanguageMode => { let globalSettings: Settings = {}; const htmlDocuments = getLanguageModelCache(10, 60, document => htmlLanguageService.parseHTMLDocument(document) @@ -30,52 +27,25 @@ export const getHTMLMode = ( configure: (options: any) => { globalSettings = options; }, - doComplete: ( - document: TextDocument, - position: Position, - settings: Settings = globalSettings - ) => { - const options = - settings && settings.visualforce && settings.visualforce.suggest; - const doAutoComplete = - settings && - settings.visualforce && - settings.visualforce.autoClosingTags; + doComplete: (document: TextDocument, position: Position, settings: Settings = globalSettings) => { + const options = settings && settings.visualforce && settings.visualforce.suggest; + const doAutoComplete = settings && settings.visualforce && settings.visualforce.autoClosingTags; if (doAutoComplete) { options.hideAutoCompleteProposals = true; } - return htmlLanguageService.doComplete( - document, - position, - htmlDocuments.get(document), - options - ); + return htmlLanguageService.doComplete(document, position, htmlDocuments.get(document), options); }, doHover: (document: TextDocument, position: Position) => { - return htmlLanguageService.doHover( - document, - position, - htmlDocuments.get(document) - ); + return htmlLanguageService.doHover(document, position, htmlDocuments.get(document)); }, findDocumentHighlight: (document: TextDocument, position: Position) => { - return htmlLanguageService.findDocumentHighlights( - document, - position, - htmlDocuments.get(document) - ); + return htmlLanguageService.findDocumentHighlights(document, position, htmlDocuments.get(document)); }, - findDocumentLinks: ( - document: TextDocument, - documentContext: DocumentContext - ) => { + findDocumentLinks: (document: TextDocument, documentContext: DocumentContext) => { return htmlLanguageService.findDocumentLinks(document, documentContext); }, findDocumentSymbols: (document: TextDocument) => { - return htmlLanguageService.findDocumentSymbols( - document, - htmlDocuments.get(document) - ); + return htmlLanguageService.findDocumentSymbols(document, htmlDocuments.get(document)); }, format: ( document: TextDocument, @@ -83,16 +53,14 @@ export const getHTMLMode = ( formatParams: FormattingOptions, settings: Settings = globalSettings ) => { - let formatSettings: HTMLFormatConfiguration = - settings && settings.visualforce && settings.visualforce.format; + let formatSettings: HTMLFormatConfiguration = settings && settings.visualforce && settings.visualforce.format; if (formatSettings) { formatSettings = merge(formatSettings, {}); } else { formatSettings = {}; } if (formatSettings.contentUnformatted) { - formatSettings.contentUnformatted = - formatSettings.contentUnformatted + ',script'; + formatSettings.contentUnformatted = formatSettings.contentUnformatted + ',script'; } else { formatSettings.contentUnformatted = 'script'; } @@ -103,11 +71,7 @@ export const getHTMLMode = ( const offset = document.offsetAt(position); const text = document.getText(); if (offset > 0 && text.charAt(offset - 1).match(/[>\/]/g)) { - return htmlLanguageService.doTagComplete( - document, - position, - htmlDocuments.get(document) - ); + return htmlLanguageService.doTagComplete(document, position, htmlDocuments.get(document)); } return null; }, diff --git a/packages/salesforcedx-visualforce-language-server/src/modes/javascriptMode.ts b/packages/salesforcedx-visualforce-language-server/src/modes/javascriptMode.ts index 657dc81b88..85fcb593e9 100644 --- a/packages/salesforcedx-visualforce-language-server/src/modes/javascriptMode.ts +++ b/packages/salesforcedx-visualforce-language-server/src/modes/javascriptMode.ts @@ -1,4 +1,3 @@ -/* eslint-disable header/header */ /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See OSSREADME.json in the project root for license information. @@ -43,25 +42,15 @@ import { TextDocument, TextEdit } from 'vscode-languageserver-types'; -import { - getLanguageModelCache, - LanguageModelCache -} from '../languageModelCache'; -import { - getWordAtText, - isWhitespaceOnly, - repeat, - startsWith -} from '../utils/strings'; +import { getLanguageModelCache, LanguageModelCache } from '../languageModelCache'; +import { getWordAtText, isWhitespaceOnly, repeat, startsWith } from '../utils/strings'; import { HTMLDocumentRegions } from './embeddedSupport'; import { LanguageMode, Settings } from './languageModes'; const FILE_NAME = 'vscode://javascript/1'; // the same 'file' is used for all contents const JS_WORD_REGEX = /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g; -export const getJavascriptMode = ( - documentRegions: LanguageModelCache -): LanguageMode => { +export const getJavascriptMode = (documentRegions: LanguageModelCache): LanguageMode => { const jsDocuments = getLanguageModelCache(10, 60, document => documentRegions.get(document).getEmbeddedDocument('javascript') ); @@ -76,11 +65,7 @@ export const getJavascriptMode = ( let currentTextDocument: TextDocument; let scriptFileVersion = 0; const updateCurrentTextDocument = (doc: TextDocument) => { - if ( - !currentTextDocument || - doc.uri !== currentTextDocument.uri || - doc.version !== currentTextDocument.version - ) { + if (!currentTextDocument || doc.uri !== currentTextDocument.uri || doc.version !== currentTextDocument.version) { currentTextDocument = jsDocuments.get(doc); scriptFileVersion++; } @@ -131,32 +116,24 @@ export const getJavascriptMode = ( configure: (options: any) => { globalSettings = options; }, - doValidation: (document: TextDocument): Diagnostic[] =>{ + doValidation: (document: TextDocument): Diagnostic[] => { updateCurrentTextDocument(document); - const syntaxDiagnostics = jsLanguageService.getSyntacticDiagnostics( - FILE_NAME - ); - const semanticDiagnostics = jsLanguageService.getSemanticDiagnostics( - FILE_NAME - ); - return syntaxDiagnostics.concat(semanticDiagnostics).map( - (diag): Diagnostic => { - return { - range: convertRange(currentTextDocument, diag), - severity: DiagnosticSeverity.Error, - message: flattenDiagnosticMessageText(diag.messageText, '\n') - }; - } - ); + const syntaxDiagnostics = jsLanguageService.getSyntacticDiagnostics(FILE_NAME); + const semanticDiagnostics = jsLanguageService.getSemanticDiagnostics(FILE_NAME); + return syntaxDiagnostics.concat(semanticDiagnostics).map((diag): Diagnostic => { + return { + range: convertRange(currentTextDocument, diag), + severity: DiagnosticSeverity.Error, + message: flattenDiagnosticMessageText(diag.messageText, '\n') + }; + }); }, doComplete: (document: TextDocument, position: Position): CompletionList => { updateCurrentTextDocument(document); const offset = currentTextDocument.offsetAt(position); - const completions = jsLanguageService.getCompletionsAtPosition( - FILE_NAME, - offset, - { includeExternalModuleExports: false } - ); + const completions = jsLanguageService.getCompletionsAtPosition(FILE_NAME, offset, { + includeExternalModuleExports: false + }); if (!completions) { return { isIncomplete: false, items: [] }; } @@ -204,10 +181,7 @@ export const getJavascriptMode = ( }, doHover: (document: TextDocument, position: Position): Hover => { updateCurrentTextDocument(document); - const info = jsLanguageService.getQuickInfoAtPosition( - FILE_NAME, - currentTextDocument.offsetAt(position) - ); + const info = jsLanguageService.getQuickInfoAtPosition(FILE_NAME, currentTextDocument.offsetAt(position)); if (info) { const contents = displayPartsToString(info.displayParts); return { @@ -247,9 +221,7 @@ export const getJavascriptMode = ( signature.label += label; signature.parameters.push(parameter); if (i < a.length - 1) { - signature.label += displayPartsToString( - item.separatorDisplayParts - ); + signature.label += displayPartsToString(item.separatorDisplayParts); } }); signature.label += displayPartsToString(item.suffixDisplayParts); @@ -259,26 +231,18 @@ export const getJavascriptMode = ( } return null; }, - findDocumentHighlight: ( - document: TextDocument, - position: Position - ): DocumentHighlight[] => { + findDocumentHighlight: (document: TextDocument, position: Position): DocumentHighlight[] => { updateCurrentTextDocument(document); - const highlights = jsLanguageService.getDocumentHighlights( - FILE_NAME, - currentTextDocument.offsetAt(position), - [document.uri] - ); + const highlights = jsLanguageService.getDocumentHighlights(FILE_NAME, currentTextDocument.offsetAt(position), [ + document.uri + ]); if (highlights.length > 0) { // Only one file to search above so there should only be one result return highlights[0].highlightSpans.map(entry => { return { range: convertRange(currentTextDocument, entry.textSpan), - kind: - entry.kind === 'writtenReference' - ? DocumentHighlightKind.Write - : DocumentHighlightKind.Text + kind: entry.kind === 'writtenReference' ? DocumentHighlightKind.Write : DocumentHighlightKind.Text }; }); } @@ -290,10 +254,7 @@ export const getJavascriptMode = ( if (items) { const result: SymbolInformation[] = []; const existing = {}; - const collectSymbols = ( - item: NavigationBarItem, - containerLabel?: string - ) => { + const collectSymbols = (item: NavigationBarItem, containerLabel?: string) => { const sig = item.text + item.kind + item.spans[0].start; if (item.kind !== 'script' && !existing[sig]) { const symbol: SymbolInformation = { @@ -324,10 +285,7 @@ export const getJavascriptMode = ( }, findDefinition: (document: TextDocument, position: Position): Definition => { updateCurrentTextDocument(document); - const definition = jsLanguageService.getDefinitionAtPosition( - FILE_NAME, - currentTextDocument.offsetAt(position) - ); + const definition = jsLanguageService.getDefinitionAtPosition(FILE_NAME, currentTextDocument.offsetAt(position)); if (definition) { return definition .filter(d => d.fileName === FILE_NAME) @@ -342,10 +300,7 @@ export const getJavascriptMode = ( }, findReferences: (document: TextDocument, position: Position): Location[] => { updateCurrentTextDocument(document); - const references = jsLanguageService.getReferencesAtPosition( - FILE_NAME, - currentTextDocument.offsetAt(position) - ); + const references = jsLanguageService.getReferencesAtPosition(FILE_NAME, currentTextDocument.offsetAt(position)); if (references) { return references .filter(d => d.fileName === FILE_NAME) @@ -364,54 +319,28 @@ export const getJavascriptMode = ( formatParams: FormattingOptions, settings: Settings = globalSettings ): TextEdit[] => { - currentTextDocument = documentRegions - .get(document) - .getEmbeddedDocument('javascript', true); + currentTextDocument = documentRegions.get(document).getEmbeddedDocument('javascript', true); scriptFileVersion++; - const formatterSettings = - settings && settings.javascript && settings.javascript.format; + const formatterSettings = settings && settings.javascript && settings.javascript.format; - const initialIndentLevel = computeInitialIndent( - document, - range, - formatParams - ); - const formatSettings = convertOptions( - formatParams, - formatterSettings, - initialIndentLevel + 1 - ); + const initialIndentLevel = computeInitialIndent(document, range, formatParams); + const formatSettings = convertOptions(formatParams, formatterSettings, initialIndentLevel + 1); const start = currentTextDocument.offsetAt(range.start); let end = currentTextDocument.offsetAt(range.end); let lastLineRange = null; if ( range.end.character === 0 || - isWhitespaceOnly( - currentTextDocument - .getText() - .substr(end - range.end.character, range.end.character) - ) + isWhitespaceOnly(currentTextDocument.getText().substr(end - range.end.character, range.end.character)) ) { end -= range.end.character; - lastLineRange = Range.create( - Position.create(range.end.line, 0), - range.end - ); + lastLineRange = Range.create(Position.create(range.end.line, 0), range.end); } - const edits = jsLanguageService.getFormattingEditsForRange( - FILE_NAME, - start, - end, - formatSettings - ); + const edits = jsLanguageService.getFormattingEditsForRange(FILE_NAME, start, end, formatSettings); if (edits) { const result = []; for (const edit of edits) { - if ( - edit.span.start >= start && - edit.span.start + edit.span.length <= end - ) { + if (edit.span.start >= start && edit.span.start + edit.span.length <= end) { result.push({ range: convertRange(currentTextDocument, edit.span), newText: edit.newText @@ -438,10 +367,7 @@ export const getJavascriptMode = ( }; }; -const convertRange = ( - document: TextDocument, - span: { start: number; length: number } -): Range => { +const convertRange = (document: TextDocument, span: { start: number; length: number }): Range => { const startPosition = document.positionAt(span.start); const endPosition = document.positionAt(span.start + span.length); return Range.create(startPosition, endPosition); @@ -519,9 +445,7 @@ const convertOptions = ( IndentStyle: IndentStyle.Smart, NewLineCharacter: '\n', BaseIndentSize: options.tabSize * initialIndentLevel, - InsertSpaceAfterCommaDelimiter: Boolean( - !formatSettings || formatSettings.insertSpaceAfterCommaDelimiter - ), + InsertSpaceAfterCommaDelimiter: Boolean(!formatSettings || formatSettings.insertSpaceAfterCommaDelimiter), InsertSpaceAfterSemicolonInForStatements: Boolean( !formatSettings || formatSettings.insertSpaceAfterSemicolonInForStatements ), @@ -529,28 +453,22 @@ const convertOptions = ( !formatSettings || formatSettings.insertSpaceBeforeAndAfterBinaryOperators ), InsertSpaceAfterKeywordsInControlFlowStatements: Boolean( - !formatSettings || - formatSettings.insertSpaceAfterKeywordsInControlFlowStatements + !formatSettings || formatSettings.insertSpaceAfterKeywordsInControlFlowStatements ), InsertSpaceAfterFunctionKeywordForAnonymousFunctions: Boolean( - !formatSettings || - formatSettings.insertSpaceAfterFunctionKeywordForAnonymousFunctions + !formatSettings || formatSettings.insertSpaceAfterFunctionKeywordForAnonymousFunctions ), InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: Boolean( - formatSettings && - formatSettings.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis + formatSettings && formatSettings.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis ), InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: Boolean( - formatSettings && - formatSettings.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets + formatSettings && formatSettings.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets ), InsertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: Boolean( - formatSettings && - formatSettings.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces + formatSettings && formatSettings.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces ), InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: Boolean( - formatSettings && - formatSettings.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces + formatSettings && formatSettings.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces ), PlaceOpenBraceOnNewLineForControlBlocks: Boolean( formatSettings && formatSettings.placeOpenBraceOnNewLineForFunctions @@ -561,11 +479,7 @@ const convertOptions = ( }; }; -const computeInitialIndent = ( - document: TextDocument, - range: Range, - options: FormattingOptions -) => { +const computeInitialIndent = (document: TextDocument, range: Range, options: FormattingOptions) => { const lineStart = document.offsetAt(Position.create(range.start.line, 0)); const content = document.getText(); diff --git a/packages/salesforcedx-visualforce-language-server/src/modes/languageModes.ts b/packages/salesforcedx-visualforce-language-server/src/modes/languageModes.ts index 3e268ebea2..5388338d84 100644 --- a/packages/salesforcedx-visualforce-language-server/src/modes/languageModes.ts +++ b/packages/salesforcedx-visualforce-language-server/src/modes/languageModes.ts @@ -1,4 +1,3 @@ -/* eslint-disable header/header */ /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See OSSREADME.json in the project root for license information. @@ -10,10 +9,7 @@ import { DocumentContext, getLanguageService as getHTMLLanguageService } from '@salesforce/salesforcedx-visualforce-markup-language-server'; -import { - ColorInformation, - ColorPresentation -} from 'vscode-languageserver-protocol'; +import { ColorInformation, ColorPresentation } from 'vscode-languageserver-protocol'; import { CompletionItem, CompletionList, @@ -32,10 +28,7 @@ import { TextEdit } from 'vscode-languageserver-types'; -import { - getLanguageModelCache, - LanguageModelCache -} from '../languageModelCache'; +import { getLanguageModelCache, LanguageModelCache } from '../languageModelCache'; import { getCSSMode } from './cssMode'; import { getDocumentRegions, HTMLDocumentRegions } from './embeddedSupport'; import { getHTMLMode } from './htmlMode'; @@ -58,39 +51,18 @@ export type SettingProvider = { export type LanguageMode = { configure?: (options: Settings) => void; doValidation?: (document: TextDocument, settings?: Settings) => Diagnostic[]; - doComplete?: ( - document: TextDocument, - position: Position, - settings?: Settings - ) => CompletionList; + doComplete?: (document: TextDocument, position: Position, settings?: Settings) => CompletionList; doResolve?: (document: TextDocument, item: CompletionItem) => CompletionItem; doHover?: (document: TextDocument, position: Position) => Hover; - doSignatureHelp?: ( - document: TextDocument, - position: Position - ) => SignatureHelp; - findDocumentHighlight?: ( - document: TextDocument, - position: Position - ) => DocumentHighlight[]; + doSignatureHelp?: (document: TextDocument, position: Position) => SignatureHelp; + findDocumentHighlight?: (document: TextDocument, position: Position) => DocumentHighlight[]; findDocumentSymbols?: (document: TextDocument) => SymbolInformation[]; - findDocumentLinks?: ( - document: TextDocument, - documentContext: DocumentContext - ) => DocumentLink[]; + findDocumentLinks?: (document: TextDocument, documentContext: DocumentContext) => DocumentLink[]; findDefinition?: (document: TextDocument, position: Position) => Definition; findReferences?: (document: TextDocument, position: Position) => Location[]; - format?: ( - document: TextDocument, - range: Range, - options: FormattingOptions, - settings: Settings - ) => TextEdit[]; + format?: (document: TextDocument, range: Range, options: FormattingOptions, settings: Settings) => TextEdit[]; findDocumentColors?: (document: TextDocument) => ColorInformation[]; - getColorPresentations?: ( - document: TextDocument, - colorInfo: ColorInformation - ) => ColorPresentation[]; + getColorPresentations?: (document: TextDocument, colorInfo: ColorInformation) => ColorPresentation[]; doAutoClose?: (document: TextDocument, position: Position) => string; getId(); dispose(): void; @@ -112,14 +84,10 @@ export type LanguageModeRange = Range & { attributeValue?: boolean; }; -export const getLanguageModes = (supportedLanguages: { - [languageId: string]: boolean; -}): LanguageModes => { +export const getLanguageModes = (supportedLanguages: { [languageId: string]: boolean }): LanguageModes => { const htmlLanguageService = getHTMLLanguageService(); - const documentRegions = getLanguageModelCache( - 10, - 60, - document => getDocumentRegions(htmlLanguageService, document) + const documentRegions = getLanguageModelCache(10, 60, document => + getDocumentRegions(htmlLanguageService, document) ); let modelCaches: LanguageModelCache[] = []; @@ -134,22 +102,14 @@ export const getLanguageModes = (supportedLanguages: { modes['javascript'] = getJavascriptMode(documentRegions); } return { - getModeAtPosition: ( - document: TextDocument, - position: Position - ): LanguageMode => { - const languageId = documentRegions - .get(document) - .getLanguageAtPosition(position); + getModeAtPosition: (document: TextDocument, position: Position): LanguageMode => { + const languageId = documentRegions.get(document).getLanguageAtPosition(position); if (languageId) { return modes[languageId]; } return null; }, - getModesInRange: ( - document: TextDocument, - range: Range - ): LanguageModeRange[] => { + getModesInRange: (document: TextDocument, range: Range): LanguageModeRange[] => { return documentRegions .get(document) .getLanguageRanges(range) @@ -164,9 +124,7 @@ export const getLanguageModes = (supportedLanguages: { }, getAllModesInDocument: (document: TextDocument): LanguageMode[] => { const result = []; - for (const languageId of documentRegions - .get(document) - .getLanguagesInDocument()) { + for (const languageId of documentRegions.get(document).getLanguagesInDocument()) { const mode = modes[languageId]; if (mode) { result.push(mode); diff --git a/packages/salesforcedx-visualforce-language-server/src/utils/arrays.ts b/packages/salesforcedx-visualforce-language-server/src/utils/arrays.ts index 2e792872b5..a6af34f85c 100644 --- a/packages/salesforcedx-visualforce-language-server/src/utils/arrays.ts +++ b/packages/salesforcedx-visualforce-language-server/src/utils/arrays.ts @@ -1,4 +1,3 @@ -/* eslint-disable header/header */ /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See OSSREADME.json in the project root for license information. diff --git a/packages/salesforcedx-visualforce-language-server/src/utils/edits.ts b/packages/salesforcedx-visualforce-language-server/src/utils/edits.ts index 9d8484e025..9c048a2d7b 100644 --- a/packages/salesforcedx-visualforce-language-server/src/utils/edits.ts +++ b/packages/salesforcedx-visualforce-language-server/src/utils/edits.ts @@ -1,4 +1,3 @@ -/* eslint-disable header/header */ /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See OSSREADME.json in the project root for license information. @@ -19,10 +18,7 @@ export const applyEdits = (document: TextDocument, edits: TextEdit[]): string => sortedEdits.forEach(e => { const startOffset = document.offsetAt(e.range.start); const endOffset = document.offsetAt(e.range.end); - text = - text.substring(0, startOffset) + - e.newText + - text.substring(endOffset, text.length); + text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length); }); return text; }; diff --git a/packages/salesforcedx-visualforce-language-server/src/utils/strings.ts b/packages/salesforcedx-visualforce-language-server/src/utils/strings.ts index 2011976920..955bb64ca4 100644 --- a/packages/salesforcedx-visualforce-language-server/src/utils/strings.ts +++ b/packages/salesforcedx-visualforce-language-server/src/utils/strings.ts @@ -1,4 +1,3 @@ -/* eslint-disable header/header */ /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See OSSREADME.json in the project root for license information. diff --git a/packages/salesforcedx-visualforce-language-server/src/visualforceServer.ts b/packages/salesforcedx-visualforce-language-server/src/visualforceServer.ts index c4053c99d5..72c06295aa 100644 --- a/packages/salesforcedx-visualforce-language-server/src/visualforceServer.ts +++ b/packages/salesforcedx-visualforce-language-server/src/visualforceServer.ts @@ -1,4 +1,3 @@ -/* eslint-disable header/header */ /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See OSSREADME.json in the project root for license information. @@ -29,32 +28,19 @@ import { // eslint-disable-next-line @typescript-eslint/no-unused-vars ServerCapabilities as CPServerCapabilities } from 'vscode-languageserver-protocol'; -import { - ConfigurationParams, - ConfigurationRequest -} from 'vscode-languageserver-protocol'; -import { - Diagnostic, - DocumentLink, - SymbolInformation, - TextDocument -} from 'vscode-languageserver-types'; +import { ConfigurationParams, ConfigurationRequest } from 'vscode-languageserver-protocol'; +import { Diagnostic, DocumentLink, SymbolInformation, TextDocument } from 'vscode-languageserver-types'; import * as nls from 'vscode-nls'; import uri from 'vscode-uri'; import { format } from './modes/formatting'; -import { - getLanguageModes, - LanguageModes, - Settings -} from './modes/languageModes'; +import { getLanguageModes, LanguageModes, Settings } from './modes/languageModes'; import { pushAll } from './utils/arrays'; nls.config(process.env['VSCODE_NLS_CONFIG']); namespace TagCloseRequest { - export const type: RequestType = - new RequestType('html/tag'); + export const type: RequestType = new RequestType('html/tag'); } // Create a connection for the server @@ -84,10 +70,7 @@ documents.onDidClose(e => { delete documentSettings[e.document.uri]; }); -const getDocumentSettings = ( - textDocument: TextDocument, - needsDocumentSettings: () => boolean -): Thenable => { +const getDocumentSettings = (textDocument: TextDocument, needsDocumentSettings: () => boolean): Thenable => { if (scopedSettingsSupport && needsDocumentSettings()) { let promise = documentSettings[textDocument.uri]; if (!promise) { @@ -117,9 +100,7 @@ connection.onInitialize((params: InitializeParams): InitializeResult => { workspacePath = params.rootPath; languageModes = getLanguageModes( - initializationOptions - ? initializationOptions.embeddedLanguages - : { css: true, javascript: true } + initializationOptions ? initializationOptions.embeddedLanguages : { css: true, javascript: true } ); documents.onDidClose(e => { languageModes.onDocumentRemoved(e.document); @@ -136,17 +117,8 @@ connection.onInitialize((params: InitializeParams): InitializeResult => { return !!c; }; - clientSnippetSupport = hasClientCapability( - 'textDocument', - 'completion', - 'completionItem', - 'snippetSupport' - ); - clientDynamicRegisterSupport = hasClientCapability( - 'workspace', - 'symbol', - 'dynamicRegistration' - ); + clientSnippetSupport = hasClientCapability('textDocument', 'completion', 'completionItem', 'snippetSupport'); + clientDynamicRegisterSupport = hasClientCapability('workspace', 'symbol', 'dynamicRegistration'); scopedSettingsSupport = hasClientCapability('workspace', 'configuration'); const capabilities: ServerCapabilities = { // Tell the client that the server works in FULL text document sync mode @@ -194,13 +166,8 @@ connection.onDidChangeConfiguration(change => { globalSettings.visualforce.format.enable; if (enableFormatter) { if (!formatterRegistration) { - const documentSelector: DocumentSelector = [ - { language: 'visualforce', scheme: 'file' } - ]; - formatterRegistration = connection.client.register( - DocumentRangeFormattingRequest.type, - { documentSelector } - ); + const documentSelector: DocumentSelector = [{ language: 'visualforce', scheme: 'file' }]; + formatterRegistration = connection.client.register(DocumentRangeFormattingRequest.type, { documentSelector }); } } else if (formatterRegistration) { formatterRegistration.then(r => r.dispose()); @@ -243,12 +210,8 @@ const triggerValidation = (textDocument: TextDocument): void => { }, validationDelayMs); }; -const isValidationEnabled = ( - languageId: string, - settings: Settings = globalSettings -) => { - const validationSettings = - settings && settings.visualforce && settings.visualforce.validate; +const isValidationEnabled = (languageId: string, settings: Settings = globalSettings) => { + const validationSettings = settings && settings.visualforce && settings.visualforce.validate; if (validationSettings) { return ( (languageId === 'css' && validationSettings.styles !== false) || @@ -262,9 +225,7 @@ const validateTextDocument = async (textDocument: TextDocument) => { const diagnostics: Diagnostic[] = []; if (textDocument.languageId === 'html') { const modes = languageModes.getAllModesInDocument(textDocument); - const settings = await getDocumentSettings(textDocument, () => - modes.some(m => !!m.doValidation) - ); + const settings = await getDocumentSettings(textDocument, () => modes.some(m => !!m.doValidation)); modes.forEach(mode => { if (mode.doValidation && isValidationEnabled(mode.getId(), settings)) { pushAll(diagnostics, mode.doValidation(textDocument, settings)); @@ -276,10 +237,7 @@ const validateTextDocument = async (textDocument: TextDocument) => { connection.onCompletion(async textDocumentPosition => { const document = documents.get(textDocumentPosition.textDocument.uri); - const mode = languageModes.getModeAtPosition( - document, - textDocumentPosition.position - ); + const mode = languageModes.getModeAtPosition(document, textDocumentPosition.position); if (mode && mode.doComplete) { if (mode.getId() !== 'html') { connection.telemetry.logEvent({ @@ -287,10 +245,7 @@ connection.onCompletion(async textDocumentPosition => { value: { languageId: mode.getId() } }); } - const settings = await getDocumentSettings( - document, - () => mode.doComplete.length > 2 - ); + const settings = await getDocumentSettings(document, () => mode.doComplete.length > 2); return mode.doComplete(document, textDocumentPosition.position, settings); } return { isIncomplete: true, items: [] }; @@ -310,10 +265,7 @@ connection.onCompletionResolve(item => { connection.onHover(textDocumentPosition => { const document = documents.get(textDocumentPosition.textDocument.uri); - const mode = languageModes.getModeAtPosition( - document, - textDocumentPosition.position - ); + const mode = languageModes.getModeAtPosition(document, textDocumentPosition.position); if (mode && mode.doHover) { return mode.doHover(document, textDocumentPosition.position); } @@ -322,25 +274,16 @@ connection.onHover(textDocumentPosition => { connection.onDocumentHighlight(documentHighlightParams => { const document = documents.get(documentHighlightParams.textDocument.uri); - const mode = languageModes.getModeAtPosition( - document, - documentHighlightParams.position - ); + const mode = languageModes.getModeAtPosition(document, documentHighlightParams.position); if (mode && mode.findDocumentHighlight) { - return mode.findDocumentHighlight( - document, - documentHighlightParams.position - ); + return mode.findDocumentHighlight(document, documentHighlightParams.position); } return []; }); connection.onDefinition(definitionParams => { const document = documents.get(definitionParams.textDocument.uri); - const mode = languageModes.getModeAtPosition( - document, - definitionParams.position - ); + const mode = languageModes.getModeAtPosition(document, definitionParams.position); if (mode && mode.findDefinition) { return mode.findDefinition(document, definitionParams.position); } @@ -349,10 +292,7 @@ connection.onDefinition(definitionParams => { connection.onReferences(referenceParams => { const document = documents.get(referenceParams.textDocument.uri); - const mode = languageModes.getModeAtPosition( - document, - referenceParams.position - ); + const mode = languageModes.getModeAtPosition(document, referenceParams.position); if (mode && mode.findReferences) { return mode.findReferences(document, referenceParams.position); } @@ -361,10 +301,7 @@ connection.onReferences(referenceParams => { connection.onSignatureHelp(signatureHelpParms => { const document = documents.get(signatureHelpParms.textDocument.uri); - const mode = languageModes.getModeAtPosition( - document, - signatureHelpParms.position - ); + const mode = languageModes.getModeAtPosition(document, signatureHelpParms.position); if (mode && mode.doSignatureHelp) { return mode.doSignatureHelp(document, signatureHelpParms.position); } @@ -378,24 +315,13 @@ connection.onDocumentRangeFormatting(async formatParams => { settings = globalSettings; } const unformattedTags: string = - (settings && - settings.visualforce && - settings.visualforce.format && - settings.visualforce.format.unformatted) || - ''; + (settings && settings.visualforce && settings.visualforce.format && settings.visualforce.format.unformatted) || ''; const enabledModes = { css: !unformattedTags.match(/\bstyle\b/), javascript: !unformattedTags.match(/\bscript\b/) }; - return format( - languageModes, - document, - formatParams.range, - formatParams.options, - settings, - enabledModes - ); + return format(languageModes, document, formatParams.range, formatParams.options, settings, enabledModes); }); connection.onDocumentLinks(documentLinkParam => { @@ -460,10 +386,7 @@ connection.onRequest(TagCloseRequest.type, params => { if (document) { const pos = params.position; if (pos.character > 0) { - const mode = languageModes.getModeAtPosition( - document, - Position.create(pos.line, pos.character - 1) - ); + const mode = languageModes.getModeAtPosition(document, Position.create(pos.line, pos.character - 1)); if (mode && mode.doAutoClose) { return mode.doAutoClose(document, pos); } diff --git a/packages/salesforcedx-visualforce-language-server/test/.eslintrc.json b/packages/salesforcedx-visualforce-language-server/test/.eslintrc.json deleted file mode 100644 index f2b99a417d..0000000000 --- a/packages/salesforcedx-visualforce-language-server/test/.eslintrc.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": [ - "../.eslintrc.json", - "../../../config/common-test-lint-rules.json" - ] -} diff --git a/packages/salesforcedx-visualforce-language-server/test/unit/embedded.test.ts b/packages/salesforcedx-visualforce-language-server/test/unit/embedded.test.ts index 2d04d07c56..c548386817 100644 --- a/packages/salesforcedx-visualforce-language-server/test/unit/embedded.test.ts +++ b/packages/salesforcedx-visualforce-language-server/test/unit/embedded.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable header/header */ /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See OSSREADME.json in the project root for license information. @@ -17,40 +16,20 @@ describe('HTML Embedded Support', () => { const offset = value.indexOf('|'); value = value.substr(0, offset) + value.substr(offset + 1); - const document = TextDocument.create( - 'test://test/test.html', - 'html', - 0, - value - ); + const document = TextDocument.create('test://test/test.html', 'html', 0, value); const position = document.positionAt(offset); - const docRegions = embeddedSupport.getDocumentRegions( - htmlLanguageService, - document - ); + const docRegions = embeddedSupport.getDocumentRegions(htmlLanguageService, document); const languageId = docRegions.getLanguageAtPosition(position); assert.equal(languageId, expectedLanguageId); }; - const assertEmbeddedLanguageContent = ( - value: string, - languageId: string, - expectedContent: string - ): void => { - const document = TextDocument.create( - 'test://test/test.html', - 'html', - 0, - value - ); + const assertEmbeddedLanguageContent = (value: string, languageId: string, expectedContent: string): void => { + const document = TextDocument.create('test://test/test.html', 'html', 0, value); - const docRegions = embeddedSupport.getDocumentRegions( - htmlLanguageService, - document - ); + const docRegions = embeddedSupport.getDocumentRegions(htmlLanguageService, document); const content = docRegions.getEmbeddedDocument(languageId); assert.equal(content.getText(), expectedContent); }; @@ -88,11 +67,7 @@ describe('HTML Embedded Support', () => { }); it('Should handle embedded styles', () => { - assertEmbeddedLanguageContent( - '', - 'css', - ' foo { } ' - ); + assertEmbeddedLanguageContent('', 'css', ' foo { } '); assertEmbeddedLanguageContent( '', 'css', @@ -109,16 +84,8 @@ describe('HTML Embedded Support', () => { '\n \n foo { } \n \n\n' ); - assertEmbeddedLanguageContent( - '
', - 'css', - ' __{color: red} ' - ); - assertEmbeddedLanguageContent( - '
', - 'css', - ' __{color:red} ' - ); + assertEmbeddedLanguageContent('
', 'css', ' __{color: red} '); + assertEmbeddedLanguageContent('
', 'css', ' __{color:red} '); }); it('Should handle script tag', () => { @@ -130,57 +97,24 @@ describe('HTML Embedded Support', () => { assertLanguageId('', 'javascript'); assertLanguageId('', - 'javascript' - ); - assertLanguageId( - '', - 'javascript' - ); - assertLanguageId( - '', - 'javascript' - ); - assertLanguageId( - '', - 'javascript' - ); - assertLanguageId( - '', - void 0 - ); - assertLanguageId( - "", - 'javascript' - ); + assertLanguageId('', 'javascript'); + assertLanguageId('', 'javascript'); + assertLanguageId('', 'javascript'); + assertLanguageId('', 'javascript'); + assertLanguageId('', void 0); + assertLanguageId("", 'javascript'); }); it('Should handle script tag in attribute', () => { assertLanguageId('
', 'html'); assertLanguageId('
', 'html'); - assertLanguageId( - '
', - 'javascript' - ); - assertLanguageId( - '
', - 'javascript' - ); - assertLanguageId( - '
', - 'javascript' - ); + assertLanguageId('
', 'javascript'); + assertLanguageId('
', 'javascript'); + assertLanguageId('
', 'javascript'); assertLanguageId('
', 'html'); assertLanguageId('
', 'html'); - assertLanguageId( - '
', - 'javascript' - ); - assertLanguageId( - '
', - 'javascript' - ); + assertLanguageId('
', 'javascript'); + assertLanguageId('
', 'javascript'); assertLanguageId('
', 'html'); assertLanguageId('
', 'html'); diff --git a/packages/salesforcedx-visualforce-language-server/test/unit/formatting.test.ts b/packages/salesforcedx-visualforce-language-server/test/unit/formatting.test.ts index 4737972d0b..fdb11964df 100644 --- a/packages/salesforcedx-visualforce-language-server/test/unit/formatting.test.ts +++ b/packages/salesforcedx-visualforce-language-server/test/unit/formatting.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable header/header */ /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See OSSREADME.json in the project root for license information. @@ -9,16 +8,10 @@ import * as assert from 'assert'; import * as fs from 'fs'; import * as path from 'path'; -import { - FormattingOptions, - Range, - TextDocument, - TextEdit -} from 'vscode-languageserver-types'; +import { FormattingOptions, Range, TextDocument, TextEdit } from 'vscode-languageserver-types'; import { format } from '../../src/modes/formatting'; import { getLanguageModes } from '../../src/modes/languageModes'; - describe('HTML Embedded Formatting', () => { beforeAll(() => { jest.useFakeTimers(); @@ -44,38 +37,21 @@ describe('HTML Embedded Formatting', () => { let rangeStartOffset = value.indexOf('|'); let rangeEndOffset; if (rangeStartOffset !== -1) { - value = - value.substr(0, rangeStartOffset) + value.substr(rangeStartOffset + 1); + value = value.substr(0, rangeStartOffset) + value.substr(rangeStartOffset + 1); rangeEndOffset = value.indexOf('|'); - value = - value.substr(0, rangeEndOffset) + value.substr(rangeEndOffset + 1); + value = value.substr(0, rangeEndOffset) + value.substr(rangeEndOffset + 1); } else { rangeStartOffset = 0; rangeEndOffset = value.length; } - const document = TextDocument.create( - 'test://test/test.html', - 'html', - 0, - value - ); - const range = Range.create( - document.positionAt(rangeStartOffset), - document.positionAt(rangeEndOffset) - ); + const document = TextDocument.create('test://test/test.html', 'html', 0, value); + const range = Range.create(document.positionAt(rangeStartOffset), document.positionAt(rangeEndOffset)); if (!formatOptions) { formatOptions = FormattingOptions.create(2, true); } - const result = format( - languageModes, - document, - range, - formatOptions, - void 0, - { css: true, javascript: true } - ); + const result = format(languageModes, document, range, formatOptions, void 0, { css: true, javascript: true }); const actual = applyEdits(document, result); assert.equal(actual, expected, message); @@ -86,29 +62,16 @@ describe('HTML Embedded Formatting', () => { expectedPath: string, options?: any, formatOptions?: FormattingOptions - ): void => { - const input = fs - .readFileSync(path.join(__dirname, 'fixtures', 'inputs', fixtureName)) - .toString(); - const expected = fs - .readFileSync(path.join(__dirname, 'fixtures', 'expected', expectedPath)) - .toString(); + ): void => { + const input = fs.readFileSync(path.join(__dirname, 'fixtures', 'inputs', fixtureName)).toString(); + const expected = fs.readFileSync(path.join(__dirname, 'fixtures', 'expected', expectedPath)).toString(); assertFormat(input, expected, options, formatOptions, expectedPath); }; it('Should handle HTML only', () => { - assertFormat( - '

Hello

', - '\n\n\n

Hello

\n\n\n' - ); - assertFormat( - '|

Hello

|', - '\n\n\n

Hello

\n\n\n' - ); - assertFormat( - '|

Hello

|', - '\n

Hello

\n' - ); + assertFormat('

Hello

', '\n\n\n

Hello

\n\n\n'); + assertFormat('|

Hello

|', '\n\n\n

Hello

\n\n\n'); + assertFormat('|

Hello

|', '\n

Hello

\n'); }); it('Should handle HTML & Scripts', () => { @@ -140,18 +103,8 @@ describe('HTML Embedded Formatting', () => { it('HTML & Scripts - Fixtures', () => { assertFormatWithFixture('19813.html', '19813.html'); - assertFormatWithFixture( - '19813.html', - '19813-4spaces.html', - void 0, - FormattingOptions.create(4, true) - ); - assertFormatWithFixture( - '19813.html', - '19813-tab.html', - void 0, - FormattingOptions.create(1, false) - ); + assertFormatWithFixture('19813.html', '19813-4spaces.html', void 0, FormattingOptions.create(4, true)); + assertFormatWithFixture('19813.html', '19813-tab.html', void 0, FormattingOptions.create(1, false)); assertFormatWithFixture('21634.html', '21634.html'); }); @@ -189,11 +142,7 @@ describe('HTML Embedded Formatting', () => { '\n\n\n

Hello

\n\n\n\n', options ); - assertFormat( - '|

Hello

|', - '\n

Hello

\n', - options - ); + assertFormat('|

Hello

|', '\n

Hello

\n', options); assertFormat( '', '\n\n\n \n\n\n\n', @@ -223,8 +172,7 @@ describe('HTML Embedded Formatting', () => { const applyEdits = (document: TextDocument, edits: TextEdit[]): string => { let text = document.getText(); const sortedEdits = edits.sort((a, b) => { - const startDiff = - document.offsetAt(b.range.start) - document.offsetAt(a.range.start); + const startDiff = document.offsetAt(b.range.start) - document.offsetAt(a.range.start); if (startDiff === 0) { return document.offsetAt(b.range.end) - document.offsetAt(a.range.end); } @@ -236,10 +184,7 @@ const applyEdits = (document: TextDocument, edits: TextEdit[]): string => { const endOffset = document.offsetAt(e.range.end); assert.ok(startOffset <= endOffset); assert.ok(endOffset <= lastOffset); - text = - text.substring(0, startOffset) + - e.newText + - text.substring(endOffset, text.length); + text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length); lastOffset = startOffset; }); return text; diff --git a/packages/salesforcedx-visualforce-language-server/test/unit/javascriptMode.test.ts b/packages/salesforcedx-visualforce-language-server/test/unit/javascriptMode.test.ts index 7e79b32d8e..d623123dbc 100644 --- a/packages/salesforcedx-visualforce-language-server/test/unit/javascriptMode.test.ts +++ b/packages/salesforcedx-visualforce-language-server/test/unit/javascriptMode.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable header/header */ /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See OSSREADME.json in the project root for license information. @@ -19,16 +18,9 @@ describe('HTML Javascript Support', () => { const offset = value.indexOf('|'); value = value.substr(0, offset) + value.substr(offset + 1); - const document = TextDocument.create( - 'test://test/test.html', - 'html', - 0, - value - ); + const document = TextDocument.create('test://test/test.html', 'html', 0, value); - const documentRegions = getLanguageModelCache< - embeddedSupport.HTMLDocumentRegions - >(10, 60, doc => + const documentRegions = getLanguageModelCache(10, 60, doc => embeddedSupport.getDocumentRegions(htmlLanguageService, doc) ); @@ -40,10 +32,7 @@ describe('HTML Javascript Support', () => { const actualLabels = list.items.map(c => c.label).sort(); for (const expected of expectedProposals) { - assert.ok( - actualLabels.indexOf(expected) !== -1, - 'Not found:' + expected + ' is ' + actualLabels.join(', ') - ); + assert.ok(actualLabels.indexOf(expected) !== -1, 'Not found:' + expected + ' is ' + actualLabels.join(', ')); } }; diff --git a/packages/salesforcedx-visualforce-language-server/test/unit/words.test.ts b/packages/salesforcedx-visualforce-language-server/test/unit/words.test.ts index 4e936bcc3e..1a503a92f8 100644 --- a/packages/salesforcedx-visualforce-language-server/test/unit/words.test.ts +++ b/packages/salesforcedx-visualforce-language-server/test/unit/words.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable header/header */ /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See OSSREADME.json in the project root for license information. diff --git a/packages/salesforcedx-visualforce-markup-language-server/.eslintignore b/packages/salesforcedx-visualforce-markup-language-server/.eslintignore deleted file mode 100644 index 39f8bdd3b0..0000000000 --- a/packages/salesforcedx-visualforce-markup-language-server/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -src/** diff --git a/packages/salesforcedx-visualforce-markup-language-server/.eslintrc.json b/packages/salesforcedx-visualforce-markup-language-server/.eslintrc.json deleted file mode 100644 index a8b986b195..0000000000 --- a/packages/salesforcedx-visualforce-markup-language-server/.eslintrc.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "root": true, - "extends": ["../../config/base-eslintrc.json", "./fix-these-rules.json"], - "overrides": [ - { - "files": ["./src/**/*.ts", "./test/**/*.ts"], - "parserOptions": { - "project": "./tsconfig.json" - } - } - ] -} diff --git a/packages/salesforcedx-visualforce-markup-language-server/fix-these-rules.json b/packages/salesforcedx-visualforce-markup-language-server/fix-these-rules.json deleted file mode 100644 index bd3e726c8d..0000000000 --- a/packages/salesforcedx-visualforce-markup-language-server/fix-these-rules.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "rules": { - "prefer-arrow/prefer-arrow-functions": ["error", {}], - "@typescript-eslint/no-floating-promises": "warn" - } -} diff --git a/packages/salesforcedx-visualforce-markup-language-server/package.json b/packages/salesforcedx-visualforce-markup-language-server/package.json index addaa1f198..3369353bf8 100644 --- a/packages/salesforcedx-visualforce-markup-language-server/package.json +++ b/packages/salesforcedx-visualforce-markup-language-server/package.json @@ -5,7 +5,7 @@ "publisher": "salesforce", "license": "BSD-3-Clause", "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" }, "activationEvents": [ "onView:never" @@ -15,24 +15,15 @@ "devDependencies": { "@types/chai": "4.3.3", "@types/mocha": "^2.2.38", - "@types/node": "^18.11.9", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", + "@types/node": "^20.0.0", "chai": "^4.0.2", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest": "27.5.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", + "eslint-plugin-jest": "28.9.0", "mocha": "^10", "mocha-junit-reporter": "^1.23.3", "mocha-multi-reporters": "^1.1.7", - "prettier": "3.0.3", + "prettier": "3.3.3", "shx": "0.3.4", - "typescript": "^5.2.2" + "typescript": "^5.6.2" }, "dependencies": { "vscode-languageserver-types": "3.4.0", diff --git a/packages/salesforcedx-visualforce-markup-language-server/test/.eslintrc.json b/packages/salesforcedx-visualforce-markup-language-server/test/.eslintrc.json deleted file mode 100644 index f2b99a417d..0000000000 --- a/packages/salesforcedx-visualforce-markup-language-server/test/.eslintrc.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": [ - "../.eslintrc.json", - "../../../config/common-test-lint-rules.json" - ] -} diff --git a/packages/salesforcedx-visualforce-markup-language-server/test/unit/completion.test.ts b/packages/salesforcedx-visualforce-markup-language-server/test/unit/completion.test.ts index f85229da5d..f89f9177ee 100644 --- a/packages/salesforcedx-visualforce-markup-language-server/test/unit/completion.test.ts +++ b/packages/salesforcedx-visualforce-markup-language-server/test/unit/completion.test.ts @@ -7,11 +7,7 @@ import * as assert from 'assert'; import { expect } from 'chai'; -import { - CompletionItemKind, - CompletionList, - TextDocument -} from 'vscode-languageserver-types'; +import { CompletionItemKind, CompletionList, TextDocument } from 'vscode-languageserver-types'; import * as htmlLanguageService from '../../src/htmlLanguageService'; import { applyEdits } from './textEditSupport'; @@ -34,20 +30,14 @@ describe('HTML Completion', () => { return completion.label === expected.label; }); if (expected.notAvailable) { - assert.equal( - matches.length, - 0, - expected.label + ' should not existing is results' - ); + assert.equal(matches.length, 0, expected.label + ' should not existing is results'); return; } assert.equal( matches.length, 1, - expected.label + - ' should only existing once: Actual: ' + - completions.items.map(c => c.label).join(', ') + expected.label + ' should only existing once: Actual: ' + completions.items.map(c => c.label).join(', ') ); const match = matches[0]; if (expected.documentation) { @@ -71,12 +61,7 @@ describe('HTML Completion', () => { const ls = htmlLanguageService.getLanguageService(); - const document = TextDocument.create( - 'test://test/test.page', - 'visualforce', - 0, - value - ); + const document = TextDocument.create('test://test/test.page', 'visualforce', 0, value); const position = document.positionAt(offset); const vfDoc = ls.parseHTMLDocument(document); const list = ls.doComplete(document, position, vfDoc, settings); @@ -97,12 +82,7 @@ describe('HTML Completion', () => { const ls = htmlLanguageService.getLanguageService(); - const document = TextDocument.create( - 'test://test/test.page', - 'visualforce', - 0, - value - ); + const document = TextDocument.create('test://test/test.page', 'visualforce', 0, value); const position = document.positionAt(offset); const vfDoc = ls.parseHTMLDocument(document); const actual = ls.doTagComplete(document, position, vfDoc); @@ -247,9 +227,7 @@ describe('HTML Completion', () => { ] }), testCompletionFor('
', { items: [ @@ -345,24 +321,19 @@ describe('HTML Completion', () => { testCompletionFor(' ' }] }), - testCompletionFor( - '
\n
\n
\n \n <|\n
\n
', - { - items: [ - { - label: 'span', - resultText: - '
\n
\n
\n \n \n
' - }, - - { - label: '/div', - resultText: - '
\n
\n
\n \n
\n
\n
' - } - ] - } - ), + testCompletionFor('
\n
\n
\n \n <|\n
\n
', { + items: [ + { + label: 'span', + resultText: '
\n
\n
\n \n \n
' + }, + + { + label: '/div', + resultText: '
\n
\n
\n \n
\n
\n
' + } + ] + }), testCompletionFor('
', { items: [ { @@ -446,18 +417,14 @@ describe('HTML Completion', () => { it('Handlebar Completion', testDone => { run( [ - testCompletionFor( - '', - { - items: [ - { - label: 'div', - resultText: - '' - } - ] - } - ) + testCompletionFor('', { + items: [ + { + label: 'div', + resultText: '' + } + ] + }) ], testDone ); @@ -536,20 +503,14 @@ describe('HTML Completion', () => { testCompletionFor( '<|', { - items: [ - { label: 'ion-checkbox', notAvailable: true }, - { label: 'div' } - ] + items: [{ label: 'ion-checkbox', notAvailable: true }, { label: 'div' }] }, { html5: true, ionic: false, angular1: false } ), testCompletionFor( ' ', { - items: [ - { label: 'ng-model', notAvailable: true }, - { label: 'type' } - ] + items: [{ label: 'ng-model', notAvailable: true }, { label: 'type' }] }, { html5: true, ionic: false, angular1: false } ) @@ -577,12 +538,7 @@ describe('HTML Completion', () => { const ls = htmlLanguageService.getLanguageService(); - const document = TextDocument.create( - 'test://test/test.page', - 'visualforce', - 0, - value - ); + const document = TextDocument.create('test://test/test.page', 'visualforce', 0, value); const position = document.positionAt(offset); const vfDoc = ls.parseHTMLDocument(document); const list = ls.doComplete(document, position, vfDoc); @@ -621,6 +577,7 @@ describe('HTML Completion', () => { }); seenNamespaces.forEach((value, name) => { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions expect(value, `namespace ${name} was not seen`).to.be.true; }); }); diff --git a/packages/salesforcedx-visualforce-markup-language-server/test/unit/formatter.test.ts b/packages/salesforcedx-visualforce-markup-language-server/test/unit/formatter.test.ts index 2d7d3e6f01..29f47ffcfc 100644 --- a/packages/salesforcedx-visualforce-markup-language-server/test/unit/formatter.test.ts +++ b/packages/salesforcedx-visualforce-markup-language-server/test/unit/formatter.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable header/header */ /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See OSSREADME.json in the project root for license information. @@ -11,11 +10,7 @@ import { getLanguageService } from '../../src/htmlLanguageService'; import { applyEdits } from './textEditSupport'; describe('JSON Formatter', () => { - const format = ( - unformatted: string, - expected: string, - insertSpaces = true - ) => { + const format = (unformatted: string, expected: string, insertSpaces = true) => { let range: Range = null; const uri = 'test://test.html'; @@ -51,53 +46,25 @@ describe('JSON Formatter', () => { }); it('range', () => { - const content = [ - '
', - ' ||', - '
' - ].join('\n'); - - const expected = [ - '
', - ' ', - '
' - ].join('\n'); + const content = ['
', ' ||', '
'].join('\n'); + + const expected = ['
', ' ', '
'].join('\n'); format(content, expected); }); it('range 2', () => { - const content = [ - '
', - ' ||', - ' ', - '
' - ].join('\n'); - - const expected = [ - '
', - ' ', - ' ', - '
' - ].join('\n'); + const content = ['
', ' ||', ' ', '
'].join('\n'); + + const expected = ['
', ' ', ' ', '
'].join('\n'); format(content, expected); }); it('range 3', () => { - const content = [ - '
', - ' || ', - ' ', - '
' - ].join('\n'); - - const expected = [ - '
', - ' ', - ' ', - '
' - ].join('\n'); + const content = ['
', ' || ', ' ', '
'].join('\n'); + + const expected = ['
', ' ', ' ', '
'].join('\n'); format(content, expected); }); @@ -110,53 +77,25 @@ describe('JSON Formatter', () => { }); it('range with indent', () => { - const content = [ - '
', - ' |', - ' |', - '
' - ].join('\n'); - - const expected = [ - '
', - ' ', - ' ', - '
' - ].join('\n'); + const content = ['
', ' |', ' |', '
'].join('\n'); + + const expected = ['
', ' ', ' ', '
'].join('\n'); format(content, expected); }); it('range with indent 2', () => { - const content = [ - '
', - '| ', - ' |', - '
' - ].join('\n'); - - const expected = [ - '
', - ' ', - ' ', - '
' - ].join('\n'); + const content = ['
', '| ', ' |', '
'].join('\n'); + + const expected = ['
', ' ', ' ', '
'].join('\n'); format(content, expected); }); it('range with indent 3', () => { - const content = [ - '
', - '
|', - '
' - ].join('\n'); - - const expected = [ - '
', - '
', - '
' - ].join('\n'); + const content = ['
', '
|', '
'].join('\n'); + + const expected = ['
', '
', '
'].join('\n'); format(content, expected); }); diff --git a/packages/salesforcedx-visualforce-markup-language-server/test/unit/highlighting.test.ts b/packages/salesforcedx-visualforce-markup-language-server/test/unit/highlighting.test.ts index f1fbcb63a2..3cf9688ca8 100644 --- a/packages/salesforcedx-visualforce-markup-language-server/test/unit/highlighting.test.ts +++ b/packages/salesforcedx-visualforce-markup-language-server/test/unit/highlighting.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable header/header */ /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See OSSREADME.json in the project root for license information. @@ -10,20 +9,11 @@ import { TextDocument } from 'vscode-languageserver-types'; import * as htmlLanguageService from '../../src/htmlLanguageService'; describe('HTML Highlighting', () => { - const assertHighlights = ( - value: string, - expectedMatches: number[], - elementName: string - ): void => { + const assertHighlights = (value: string, expectedMatches: number[], elementName: string): void => { const offset = value.indexOf('|'); value = value.substr(0, offset) + value.substr(offset + 1); - const document = TextDocument.create( - 'test://test/test.html', - 'html', - 0, - value - ); + const document = TextDocument.create('test://test/test.html', 'html', 0, value); const position = document.positionAt(offset); const ls = htmlLanguageService.getLanguageService(); @@ -37,13 +27,7 @@ describe('HTML Highlighting', () => { const actualEndOffset = document.offsetAt(highlights[i].range.end); assert.equal(actualEndOffset, expectedMatches[i] + elementName.length); - assert.equal( - document - .getText() - .substring(actualStartOffset, actualEndOffset) - .toLowerCase(), - elementName - ); + assert.equal(document.getText().substring(actualStartOffset, actualEndOffset).toLowerCase(), elementName); } }; diff --git a/packages/salesforcedx-visualforce-markup-language-server/test/unit/hover.test.ts b/packages/salesforcedx-visualforce-markup-language-server/test/unit/hover.test.ts index 4ac9f4163d..252ae92856 100644 --- a/packages/salesforcedx-visualforce-markup-language-server/test/unit/hover.test.ts +++ b/packages/salesforcedx-visualforce-markup-language-server/test/unit/hover.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable header/header */ /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See OSSREADME.json in the project root for license information. @@ -10,20 +9,11 @@ import { TextDocument } from 'vscode-languageserver-types'; import * as htmlLanguageService from '../../src/htmlLanguageService'; describe('HTML Hover', () => { - const assertHover = ( - value: string, - expectedHoverLabel: string, - expectedHoverOffset - ): void => { + const assertHover = (value: string, expectedHoverLabel: string, expectedHoverOffset): void => { const offset = value.indexOf('|'); value = value.substr(0, offset) + value.substr(offset + 1); - const document = TextDocument.create( - 'test://test/test.html', - 'html', - 0, - value - ); + const document = TextDocument.create('test://test/test.html', 'html', 0, value); const position = document.positionAt(offset); const ls = htmlLanguageService.getLanguageService(); @@ -31,10 +21,7 @@ describe('HTML Hover', () => { const hover = ls.doHover(document, position, htmlDoc); assert.equal(hover && hover.contents[0].value, expectedHoverLabel); - assert.equal( - hover && document.offsetAt(hover.range.start), - expectedHoverOffset - ); + assert.equal(hover && document.offsetAt(hover.range.start), expectedHoverOffset); }; it('Single', () => { diff --git a/packages/salesforcedx-visualforce-markup-language-server/test/unit/links.test.ts b/packages/salesforcedx-visualforce-markup-language-server/test/unit/links.test.ts index c1ee25ab9c..6b445b96f3 100644 --- a/packages/salesforcedx-visualforce-markup-language-server/test/unit/links.test.ts +++ b/packages/salesforcedx-visualforce-markup-language-server/test/unit/links.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable header/header */ /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See OSSREADME.json in the project root for license information. @@ -11,9 +10,7 @@ import { TextDocument } from 'vscode-languageserver-types'; import * as htmlLanguageService from '../../src/htmlLanguageService'; describe('HTML Link Detection', () => { - const getDocumentContext = ( - documentUrl: string - ): htmlLanguageService.DocumentContext => { + const getDocumentContext = (documentUrl: string): htmlLanguageService.DocumentContext => { return { resolveReference: (ref, base) => { if (base) { @@ -24,37 +21,17 @@ describe('HTML Link Detection', () => { }; }; - const testLinkCreation = ( - modelUrl: string, - tokenContent: string, - expected: string - ): void => { - const document = TextDocument.create( - modelUrl, - 'html', - 0, - `` - ); + const testLinkCreation = (modelUrl: string, tokenContent: string, expected: string): void => { + const document = TextDocument.create(modelUrl, 'html', 0, ``); const ls = htmlLanguageService.getLanguageService(); const links = ls.findDocumentLinks(document, getDocumentContext(modelUrl)); assert.equal(links[0] && links[0].target, expected); }; - const testLinkDetection = ( - value: string, - expectedLinks: { offset: number; target: string }[] - ): void => { - const document = TextDocument.create( - 'test://test/test.html', - 'html', - 0, - value - ); + const testLinkDetection = (value: string, expectedLinks: { offset: number; target: string }[]): void => { + const document = TextDocument.create('test://test/test.html', 'html', 0, value); const ls = htmlLanguageService.getLanguageService(); - const links = ls.findDocumentLinks( - document, - getDocumentContext(document.uri) - ); + const links = ls.findDocumentLinks(document, getDocumentContext(document.uri)); assert.deepEqual( links.map(l => ({ offset: l.range.start.character, target: l.target })), expectedLinks @@ -70,87 +47,39 @@ describe('HTML Link Detection', () => { 'file:///C:\\Alex\\src\\path\\to\\file.txt', 'file:///C:\\Alex\\src\\path\\to\\file.txt' ); - testLinkCreation( - 'http://model/1', - 'http://www.microsoft.com/', - 'http://www.microsoft.com/' - ); - testLinkCreation( - 'http://model/1', - 'https://www.microsoft.com/', - 'https://www.microsoft.com/' - ); - testLinkCreation( - 'http://model/1', - '//www.microsoft.com/', - 'http://www.microsoft.com/' - ); + testLinkCreation('http://model/1', 'http://www.microsoft.com/', 'http://www.microsoft.com/'); + testLinkCreation('http://model/1', 'https://www.microsoft.com/', 'https://www.microsoft.com/'); + testLinkCreation('http://model/1', '//www.microsoft.com/', 'http://www.microsoft.com/'); testLinkCreation('http://model/x/1', 'a.js', 'http://model/x/a.js'); testLinkCreation('http://model/x/1', './a2.js', 'http://model/x/a2.js'); testLinkCreation('http://model/x/1', '/b.js', 'http://model/b.js'); testLinkCreation('http://model/x/y/1', '../../c.js', 'http://model/c.js'); - testLinkCreation( - 'file:///C:/Alex/src/path/to/file.txt', - 'javascript:void;', - null - ); - testLinkCreation( - 'file:///C:/Alex/src/path/to/file.txt', - ' \tjavascript:alert(7);', - null - ); - testLinkCreation( - 'file:///C:/Alex/src/path/to/file.txt', - ' #relative', - null - ); + testLinkCreation('file:///C:/Alex/src/path/to/file.txt', 'javascript:void;', null); + testLinkCreation('file:///C:/Alex/src/path/to/file.txt', ' \tjavascript:alert(7);', null); + testLinkCreation('file:///C:/Alex/src/path/to/file.txt', ' #relative', null); testLinkCreation( 'file:///C:/Alex/src/path/to/file.txt', 'file:///C:\\Alex\\src\\path\\to\\file.txt', 'file:///C:\\Alex\\src\\path\\to\\file.txt' ); - testLinkCreation( - 'file:///C:/Alex/src/path/to/file.txt', - 'http://www.microsoft.com/', - 'http://www.microsoft.com/' - ); + testLinkCreation('file:///C:/Alex/src/path/to/file.txt', 'http://www.microsoft.com/', 'http://www.microsoft.com/'); testLinkCreation( 'file:///C:/Alex/src/path/to/file.txt', 'https://www.microsoft.com/', 'https://www.microsoft.com/' ); - testLinkCreation( - 'file:///C:/Alex/src/path/to/file.txt', - ' //www.microsoft.com/', - 'http://www.microsoft.com/' - ); - testLinkCreation( - 'file:///C:/Alex/src/path/to/file.txt', - 'a.js', - 'file:///C:/Alex/src/path/to/a.js' - ); - testLinkCreation( - 'file:///C:/Alex/src/path/to/file.txt', - '/a.js', - 'file:///a.js' - ); + testLinkCreation('file:///C:/Alex/src/path/to/file.txt', ' //www.microsoft.com/', 'http://www.microsoft.com/'); + testLinkCreation('file:///C:/Alex/src/path/to/file.txt', 'a.js', 'file:///C:/Alex/src/path/to/a.js'); + testLinkCreation('file:///C:/Alex/src/path/to/file.txt', '/a.js', 'file:///a.js'); testLinkCreation( 'https://www.test.com/path/to/file.txt', 'file:///C:\\Alex\\src\\path\\to\\file.txt', 'file:///C:\\Alex\\src\\path\\to\\file.txt' ); - testLinkCreation( - 'https://www.test.com/path/to/file.txt', - '//www.microsoft.com/', - 'https://www.microsoft.com/' - ); - testLinkCreation( - 'https://www.test.com/path/to/file.txt', - '//www.microsoft.com/', - 'https://www.microsoft.com/' - ); + testLinkCreation('https://www.test.com/path/to/file.txt', '//www.microsoft.com/', 'https://www.microsoft.com/'); + testLinkCreation('https://www.test.com/path/to/file.txt', '//www.microsoft.com/', 'https://www.microsoft.com/'); // invalid uris are ignored testLinkCreation('https://www.test.com/path/to/file.txt', '%', null); @@ -164,28 +93,19 @@ describe('HTML Link Detection', () => { }); it('Link detection', () => { - testLinkDetection('', [ - { offset: 10, target: 'test://test/foo.png' } - ]); - testLinkDetection('', [ - { offset: 9, target: 'http://server/foo.html' } - ]); + testLinkDetection('', [{ offset: 10, target: 'test://test/foo.png' }]); + testLinkDetection('', [{ offset: 9, target: 'http://server/foo.html' }]); testLinkDetection('', []); - testLinkDetection('', [ - { offset: 12, target: 'test://test/a.html' } - ]); + testLinkDetection('', [{ offset: 12, target: 'test://test/a.html' }]); testLinkDetection('', [ { offset: 18, target: 'test://test/docs/' }, { offset: 35, target: 'test://test/docs/foo.png' } ]); - testLinkDetection( - '', - [ - { offset: 18, target: 'http://www.example.com/page.html' }, - { offset: 62, target: 'http://www.example.com/foo.png' } - ] - ); + testLinkDetection('', [ + { offset: 18, target: 'http://www.example.com/page.html' }, + { offset: 62, target: 'http://www.example.com/foo.png' } + ]); }); }); diff --git a/packages/salesforcedx-visualforce-markup-language-server/test/unit/parser.test.ts b/packages/salesforcedx-visualforce-markup-language-server/test/unit/parser.test.ts index 6185172b2b..99e7545a90 100644 --- a/packages/salesforcedx-visualforce-markup-language-server/test/unit/parser.test.ts +++ b/packages/salesforcedx-visualforce-markup-language-server/test/unit/parser.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable header/header */ /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See OSSREADME.json in the project root for license information. @@ -33,11 +32,7 @@ describe('HTML Parser', () => { assert.deepEqual(document.roots.map(toJSON), expected); }; - const assertNodeBefore = ( - input: string, - offset: number, - expectedTag: string - ) => { + const assertNodeBefore = (input: string, offset: number, expectedTag: string) => { const document = parse(input); const node = document.findNodeBefore(offset); assert.equal(node ? node.tag : '', expectedTag, 'offset ' + offset); @@ -314,8 +309,7 @@ describe('HTML Parser', () => { }); it('Attributes', () => { - const str = - '
'; + const str = '
'; assertAttributes(str, [ { tag: 'div', diff --git a/packages/salesforcedx-visualforce-markup-language-server/test/unit/scanner.test.ts b/packages/salesforcedx-visualforce-markup-language-server/test/unit/scanner.test.ts index 66dbb81120..0a9148b4eb 100644 --- a/packages/salesforcedx-visualforce-markup-language-server/test/unit/scanner.test.ts +++ b/packages/salesforcedx-visualforce-markup-language-server/test/unit/scanner.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable header/header */ /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See OSSREADME.json in the project root for license information. @@ -7,12 +6,7 @@ 'use strict'; import * as assert from 'assert'; -import { - createScanner, - Scanner, - ScannerState, - TokenType -} from '../../src/parser/htmlScanner'; +import { createScanner, Scanner, ScannerState, TokenType } from '../../src/parser/htmlScanner'; describe('HTML Scanner', () => { type Token = { @@ -32,14 +26,8 @@ describe('HTML Scanner', () => { offset: scanner.getTokenOffset(), type: tokenType }; - if ( - tokenType === TokenType.StartTag || - tokenType === TokenType.EndTag - ) { - actualToken.content = t.input.substr( - scanner.getTokenOffset(), - scanner.getTokenLength() - ); + if (tokenType === TokenType.StartTag || tokenType === TokenType.EndTag) { + actualToken.content = t.input.substr(scanner.getTokenOffset(), scanner.getTokenLength()); } actual.push(actualToken); tokenType = scanner.scan(); @@ -699,8 +687,7 @@ describe('HTML Scanner', () => { it('Tag with Angular Attribute Name', () => { assertTokens([ { - input: - '', + input: '', tokens: [ { offset: 0, type: TokenType.StartTagOpen }, { offset: 1, type: TokenType.StartTag, content: 'abc' }, diff --git a/packages/salesforcedx-visualforce-markup-language-server/test/unit/symbols.test.ts b/packages/salesforcedx-visualforce-markup-language-server/test/unit/symbols.test.ts index 52c154c483..cbdf755927 100644 --- a/packages/salesforcedx-visualforce-markup-language-server/test/unit/symbols.test.ts +++ b/packages/salesforcedx-visualforce-markup-language-server/test/unit/symbols.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable header/header */ /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See OSSREADME.json in the project root for license information. @@ -6,22 +5,13 @@ 'use strict'; import { expect } from 'chai'; -import { - Location, - Range, - SymbolInformation, - SymbolKind, - TextDocument -} from 'vscode-languageserver-types'; +import { Location, Range, SymbolInformation, SymbolKind, TextDocument } from 'vscode-languageserver-types'; import * as htmlLanguageService from '../../src/htmlLanguageService'; describe('HTML Symbols', () => { const TEST_URI = 'test://test/test.html'; - const assertSymbols = ( - symbols: SymbolInformation[], - expected: SymbolInformation[] - ) => { + const assertSymbols = (symbols: SymbolInformation[], expected: SymbolInformation[]) => { expect(symbols).to.deep.equal(expected); }; @@ -59,8 +49,7 @@ describe('HTML Symbols', () => { }); it('Id and classes', () => { - const content = - '
'; + const content = '
'; const expected = [ { diff --git a/packages/salesforcedx-visualforce-markup-language-server/test/unit/textEditSupport.ts b/packages/salesforcedx-visualforce-markup-language-server/test/unit/textEditSupport.ts index 383d4bc3e5..9ba18c2768 100644 --- a/packages/salesforcedx-visualforce-markup-language-server/test/unit/textEditSupport.ts +++ b/packages/salesforcedx-visualforce-markup-language-server/test/unit/textEditSupport.ts @@ -1,4 +1,3 @@ -/* eslint-disable header/header */ /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See OSSREADME.json in the project root for license information. @@ -10,20 +9,14 @@ import { TextDocument, TextEdit } from 'vscode-languageserver-types'; export const applyEdits = (document: TextDocument, edits: TextEdit[]): string => { let text = document.getText(); - const sortedEdits = edits.sort( - (a, b) => - document.offsetAt(b.range.start) - document.offsetAt(a.range.start) - ); + const sortedEdits = edits.sort((a, b) => document.offsetAt(b.range.start) - document.offsetAt(a.range.start)); let lastOffset = text.length; sortedEdits.forEach(e => { const startOffset = document.offsetAt(e.range.start); const endOffset = document.offsetAt(e.range.end); assert.ok(startOffset <= endOffset); assert.ok(endOffset <= lastOffset); - text = - text.substring(0, startOffset) + - e.newText + - text.substring(endOffset, text.length); + text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length); lastOffset = startOffset; }); return text; diff --git a/packages/salesforcedx-vscode-apex-debugger/.eslintrc.json b/packages/salesforcedx-vscode-apex-debugger/.eslintrc.json deleted file mode 100644 index 5b59dce583..0000000000 --- a/packages/salesforcedx-vscode-apex-debugger/.eslintrc.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "root": true, - "extends": [ - "../../config/base-eslintrc.json", - "./fix-these-rules.json" - ], - "overrides": [ - { - "files": [ - "./src/**/*.ts", - "./test/**/*.ts" - ], - "parserOptions": { - "project": "./tsconfig.json" - } - } - ], - "env": { - "node": true - } -} \ No newline at end of file diff --git a/packages/salesforcedx-vscode-apex-debugger/esbuild.config.js b/packages/salesforcedx-vscode-apex-debugger/esbuild.config.js index 1419d99248..39d602b64d 100644 --- a/packages/salesforcedx-vscode-apex-debugger/esbuild.config.js +++ b/packages/salesforcedx-vscode-apex-debugger/esbuild.config.js @@ -4,24 +4,19 @@ * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -/* eslint-disable @typescript-eslint/no-var-requires */ const { build } = require('esbuild'); const esbuildPluginPino = require('esbuild-plugin-pino'); const fs = require('fs').promises; // Configure and run the build process const sharedConfig = { - bundle: true, // Bundle all dependencies into one file - format: 'cjs', // Output format (CommonJS) - platform: 'node', // Platform target (Node.js) - minify: true, // Minify the output - keepNames: true, // keepNames to get rid of - external: [ - 'vscode' - ], - plugins: [ - esbuildPluginPino({ transports: ['pino-pretty'] }) - ], + bundle: true, // Bundle all dependencies into one file + format: 'cjs', // Output format (CommonJS) + platform: 'node', // Platform target (Node.js) + minify: true, // Minify the output + keepNames: true, // keepNames to get rid of + external: ['vscode'], + plugins: [esbuildPluginPino({ transports: ['pino-pretty'] })], supported: { 'dynamic-import': false }, @@ -50,6 +45,8 @@ const destPath = './dist/transformStream.js'; entryPoints: ['./src/index.ts'], outdir: 'dist' }); -})().then(async () => { - await copyFiles(srcPath, destPath); -}).catch(() => process.exit(1)); +})() + .then(async () => { + await copyFiles(srcPath, destPath); + }) + .catch(() => process.exit(1)); diff --git a/packages/salesforcedx-vscode-apex-debugger/fix-these-rules.json b/packages/salesforcedx-vscode-apex-debugger/fix-these-rules.json deleted file mode 100644 index 43ffa95fb9..0000000000 --- a/packages/salesforcedx-vscode-apex-debugger/fix-these-rules.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "rules": { - "prefer-arrow/prefer-arrow-functions": ["error", {}], - "@typescript-eslint/no-floating-promises": "warn", - "@typescript-eslint/no-unsafe-argument": "warn", - "@typescript-eslint/no-unsafe-assignment": "warn", - "@typescript-eslint/no-unsafe-call": "warn", - "@typescript-eslint/no-unsafe-member-access": "warn", - "@typescript-eslint/require-await": "warn" - } -} diff --git a/packages/salesforcedx-vscode-apex-debugger/package.json b/packages/salesforcedx-vscode-apex-debugger/package.json index ddcf068fd5..19219395e0 100644 --- a/packages/salesforcedx-vscode-apex-debugger/package.json +++ b/packages/salesforcedx-vscode-apex-debugger/package.json @@ -18,7 +18,7 @@ "publisher": "salesforce", "license": "BSD-3-Clause", "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" }, "categories": [ "Debuggers" @@ -26,32 +26,22 @@ "dependencies": { "@salesforce/salesforcedx-apex-debugger": "62.5.0", "@salesforce/salesforcedx-utils-vscode": "62.5.0", - "@vscode/debugprotocol": "1.65.0", + "@vscode/debugprotocol": "1.68.0", "vscode-extension-telemetry": "0.0.17" }, "devDependencies": { "@salesforce/salesforcedx-test-utils-vscode": "62.5.0", "@types/chai": "4.3.3", "@types/mocha": "^5", - "@types/node": "^18.11.9", + "@types/node": "^20.0.0", "@types/sinon": "^2.3.7", - "@types/vscode": "^1.86.0", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", + "@types/vscode": "^1.90.0", "chai": "^4.0.2", "cross-env": "5.2.0", "esbuild": "^0.19.5", "esbuild-plugin-pino": "^2.1.0", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest": "27.5.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", "mocha": "^10", - "prettier": "3.0.3", + "prettier": "3.3.3", "sinon": "^13.0.1" }, "extensionDependencies": [ diff --git a/packages/salesforcedx-vscode-apex-debugger/src/adapter/debugConfigurationProvider.ts b/packages/salesforcedx-vscode-apex-debugger/src/adapter/debugConfigurationProvider.ts index 6c4f191b62..bb98d9daee 100644 --- a/packages/salesforcedx-vscode-apex-debugger/src/adapter/debugConfigurationProvider.ts +++ b/packages/salesforcedx-vscode-apex-debugger/src/adapter/debugConfigurationProvider.ts @@ -5,20 +5,12 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - DEBUGGER_LAUNCH_TYPE, - DEBUGGER_TYPE, - WorkspaceSettings -} from '@salesforce/salesforcedx-apex-debugger/out/src'; +import { DEBUGGER_LAUNCH_TYPE, DEBUGGER_TYPE, WorkspaceSettings } from '@salesforce/salesforcedx-apex-debugger/out/src'; import * as vscode from 'vscode'; import { nls } from '../messages'; -export class DebugConfigurationProvider - implements vscode.DebugConfigurationProvider -{ - private salesforceApexExtension = vscode.extensions.getExtension( - 'salesforce.salesforcedx-vscode-apex' - ); +export class DebugConfigurationProvider implements vscode.DebugConfigurationProvider { + private salesforceApexExtension = vscode.extensions.getExtension('salesforce.salesforcedx-vscode-apex'); public static getConfig(folder: vscode.WorkspaceFolder | undefined) { return { @@ -47,9 +39,7 @@ export class DebugConfigurationProvider token?: vscode.CancellationToken ): vscode.ProviderResult { return this.asyncDebugConfig(folder, config).catch(async err => { - return vscode.window - .showErrorMessage(err.message, { modal: true }) - .then(() => undefined); + return vscode.window.showErrorMessage(err.message, { modal: true }).then(() => undefined); }); } @@ -69,29 +59,21 @@ export class DebugConfigurationProvider if (config.entryPointFilter === undefined) { config.entryPointFilter = ''; } - config.salesforceProject = - config.salesforceProject || - (folder ? folder.uri.fsPath : '${workspaceRoot}'); + config.salesforceProject = config.salesforceProject || (folder ? folder.uri.fsPath : '${workspaceRoot}'); if (vscode.workspace) { const workspaceConfig = vscode.workspace.getConfiguration(); config.workspaceSettings = { proxyUrl: workspaceConfig.get('http.proxy', '') as string, - proxyStrictSSL: workspaceConfig.get( - 'http.proxyStrictSSL', - false - ) as boolean, + proxyStrictSSL: workspaceConfig.get('http.proxyStrictSSL', false) as boolean, proxyAuth: workspaceConfig.get('http.proxyAuthorization', '') as string, - connectionTimeoutMs: workspaceConfig.get( - 'salesforcedx-vscode-apex-debugger.connectionTimeoutMs' - ) + connectionTimeoutMs: workspaceConfig.get('salesforcedx-vscode-apex-debugger.connectionTimeoutMs') } as WorkspaceSettings; } if (this.salesforceApexExtension && this.salesforceApexExtension.exports) { await this.isLanguageClientReady(); - config.lineBreakpointInfo = - await this.salesforceApexExtension.exports.getLineBreakpointInfo(); + config.lineBreakpointInfo = await this.salesforceApexExtension.exports.getLineBreakpointInfo(); } return config; } @@ -102,21 +84,11 @@ export class DebugConfigurationProvider while ( this.salesforceApexExtension && this.salesforceApexExtension.exports && - !this.salesforceApexExtension.exports.languageClientUtils - .getStatus() - .isReady() && + !this.salesforceApexExtension.exports.languageClientUtils.getStatus().isReady() && !expired ) { - if ( - this.salesforceApexExtension.exports.languageClientUtils - .getStatus() - .failedToInitialize() - ) { - throw Error( - this.salesforceApexExtension.exports.languageClientUtils - .getStatus() - .getStatusMessage() - ); + if (this.salesforceApexExtension.exports.languageClientUtils.getStatus().failedToInitialize()) { + throw Error(this.salesforceApexExtension.exports.languageClientUtils.getStatus().getStatusMessage()); } await new Promise(r => setTimeout(r, 100)); diff --git a/packages/salesforcedx-vscode-apex-debugger/src/context/isvContext.ts b/packages/salesforcedx-vscode-apex-debugger/src/context/isvContext.ts index 16d3df3245..28352b8ba5 100644 --- a/packages/salesforcedx-vscode-apex-debugger/src/context/isvContext.ts +++ b/packages/salesforcedx-vscode-apex-debugger/src/context/isvContext.ts @@ -10,24 +10,12 @@ import * as vscode from 'vscode'; export const setupGlobalDefaultUserIsvAuth = async () => { const isvUtil = new IsvContextUtil(); - if ( - vscode.workspace && - vscode.workspace.workspaceFolders && - vscode.workspace.workspaceFolders[0] - ) { - const isvDebugProject = await isvUtil.setIsvDebuggerContext( - vscode.workspace.workspaceFolders[0].uri.fsPath - ); + if (vscode.workspace && vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders[0]) { + const isvDebugProject = await isvUtil.setIsvDebuggerContext(vscode.workspace.workspaceFolders[0].uri.fsPath); - await vscode.commands.executeCommand( - 'setContext', - 'sf:isv_debug_project', - isvDebugProject - ); + await vscode.commands.executeCommand('setContext', 'sf:isv_debug_project', isvDebugProject); - const isvDebugMsg = isvDebugProject - ? 'Configured ISV Project Authentication' - : 'Project is not for ISV Debugger'; + const isvDebugMsg = isvDebugProject ? 'Configured ISV Project Authentication' : 'Project is not for ISV Debugger'; console.log(isvDebugMsg); } @@ -35,13 +23,8 @@ export const setupGlobalDefaultUserIsvAuth = async () => { isvUtil.resetCliEnvironmentVars(); }; -export const registerIsvAuthWatcher = ( - extensionContext: vscode.ExtensionContext -) => { - if ( - vscode.workspace.workspaceFolders instanceof Array && - vscode.workspace.workspaceFolders.length > 0 - ) { +export const registerIsvAuthWatcher = (extensionContext: vscode.ExtensionContext) => { + if (vscode.workspace.workspaceFolders instanceof Array && vscode.workspace.workspaceFolders.length > 0) { const configPath = projectPaths.salesforceProjectConfig(); const isvAuthWatcher = vscode.workspace.createFileSystemWatcher(configPath); /* eslint-disable @typescript-eslint/no-unused-vars */ diff --git a/packages/salesforcedx-vscode-apex-debugger/src/index.ts b/packages/salesforcedx-vscode-apex-debugger/src/index.ts index 5541f4e50c..b7ea763ae3 100644 --- a/packages/salesforcedx-vscode-apex-debugger/src/index.ts +++ b/packages/salesforcedx-vscode-apex-debugger/src/index.ts @@ -24,22 +24,14 @@ import { import { DebugProtocol } from '@vscode/debugprotocol'; import * as vscode from 'vscode'; import { DebugConfigurationProvider } from './adapter/debugConfigurationProvider'; -import { - registerIsvAuthWatcher, - setupGlobalDefaultUserIsvAuth -} from './context'; +import { registerIsvAuthWatcher, setupGlobalDefaultUserIsvAuth } from './context'; import { nls } from './messages'; import { telemetryService } from './telemetry'; -const cachedExceptionBreakpoints: Map = - new Map(); -const salesforceCoreExtension = vscode.extensions.getExtension( - 'salesforce.salesforcedx-vscode-core' -); +const cachedExceptionBreakpoints: Map = new Map(); +const salesforceCoreExtension = vscode.extensions.getExtension('salesforce.salesforcedx-vscode-core'); -export const getDebuggerType = async ( - session: vscode.DebugSession -): Promise => { +export const getDebuggerType = async (session: vscode.DebugSession): Promise => { let type = session.type; if (type === LIVESHARE_DEBUGGER_TYPE) { type = await session.customRequest(LIVESHARE_DEBUG_TYPE_REQUEST); @@ -48,32 +40,30 @@ export const getDebuggerType = async ( }; const registerCommands = (): vscode.Disposable => { - const customEventHandler = vscode.debug.onDidReceiveDebugSessionCustomEvent( - async event => { - if (event && event.session) { - const type = await getDebuggerType(event.session); - if (type === DEBUGGER_TYPE && event.event === SHOW_MESSAGE_EVENT) { - const eventBody = event.body as VscodeDebuggerMessage; - if (eventBody && eventBody.type && eventBody.message) { - switch (eventBody.type as VscodeDebuggerMessageType) { - case VscodeDebuggerMessageType.Info: { - vscode.window.showInformationMessage(eventBody.message); - break; - } - case VscodeDebuggerMessageType.Warning: { - vscode.window.showWarningMessage(eventBody.message); - break; - } - case VscodeDebuggerMessageType.Error: { - vscode.window.showErrorMessage(eventBody.message); - break; - } + const customEventHandler = vscode.debug.onDidReceiveDebugSessionCustomEvent(async event => { + if (event && event.session) { + const type = await getDebuggerType(event.session); + if (type === DEBUGGER_TYPE && event.event === SHOW_MESSAGE_EVENT) { + const eventBody = event.body as VscodeDebuggerMessage; + if (eventBody && eventBody.type && eventBody.message) { + switch (eventBody.type as VscodeDebuggerMessageType) { + case VscodeDebuggerMessageType.Info: { + vscode.window.showInformationMessage(eventBody.message); + break; + } + case VscodeDebuggerMessageType.Warning: { + vscode.window.showWarningMessage(eventBody.message); + break; + } + case VscodeDebuggerMessageType.Error: { + vscode.window.showErrorMessage(eventBody.message); + break; } } } } } - ); + }); const exceptionBreakpointCmd = vscode.commands.registerCommand( 'sf.debug.exception.breakpoint', configureExceptionBreakpoint @@ -87,11 +77,7 @@ const registerCommands = (): vscode.Disposable => { }); }); - return vscode.Disposable.from( - customEventHandler, - exceptionBreakpointCmd, - startSessionHandler - ); + return vscode.Disposable.from(customEventHandler, exceptionBreakpointCmd, startSessionHandler); }; export type ExceptionBreakpointItem = vscode.QuickPickItem & { @@ -118,25 +104,19 @@ const EXCEPTION_BREAK_MODES: BreakModeItem[] = [ ]; const configureExceptionBreakpoint = async (): Promise => { - const salesforceApexExtension = vscode.extensions.getExtension( - 'salesforce.salesforcedx-vscode-apex' - ); + const salesforceApexExtension = vscode.extensions.getExtension('salesforce.salesforcedx-vscode-apex'); if (salesforceApexExtension && salesforceApexExtension.exports) { const exceptionBreakpointInfos: ExceptionBreakpointItem[] = await salesforceApexExtension.exports.getExceptionBreakpointInfo(); console.log('Retrieved exception breakpoint info from language server'); let enabledExceptionBreakpointTyperefs: string[] = []; if (vscode.debug.activeDebugSession) { - const responseBody = await vscode.debug.activeDebugSession.customRequest( - LIST_EXCEPTION_BREAKPOINTS_REQUEST - ); + const responseBody = await vscode.debug.activeDebugSession.customRequest(LIST_EXCEPTION_BREAKPOINTS_REQUEST); if (responseBody && responseBody.typerefs) { enabledExceptionBreakpointTyperefs = responseBody.typerefs; } } else { - enabledExceptionBreakpointTyperefs = Array.from( - cachedExceptionBreakpoints.keys() - ); + enabledExceptionBreakpointTyperefs = Array.from(cachedExceptionBreakpoints.keys()); } const processedBreakpointInfos = mergeExceptionBreakpointInfos( exceptionBreakpointInfos, @@ -146,29 +126,20 @@ const configureExceptionBreakpoint = async (): Promise => { placeHolder: nls.localize('select_exception_text'), matchOnDescription: true }; - const selectedException = await vscode.window.showQuickPick( - processedBreakpointInfos, - selectExceptionOptions - ); + const selectedException = await vscode.window.showQuickPick(processedBreakpointInfos, selectExceptionOptions); if (selectedException) { const selectBreakModeOptions: vscode.QuickPickOptions = { placeHolder: nls.localize('select_break_option_text'), matchOnDescription: true }; - const selectedBreakMode = await vscode.window.showQuickPick( - EXCEPTION_BREAK_MODES, - selectBreakModeOptions - ); + const selectedBreakMode = await vscode.window.showQuickPick(EXCEPTION_BREAK_MODES, selectBreakModeOptions); if (selectedBreakMode) { selectedException.breakMode = selectedBreakMode.breakMode; const args: SetExceptionBreakpointsArguments = { exceptionInfo: selectedException }; if (vscode.debug.activeDebugSession) { - await vscode.debug.activeDebugSession.customRequest( - EXCEPTION_BREAKPOINT_REQUEST, - args - ); + await vscode.debug.activeDebugSession.customRequest(EXCEPTION_BREAKPOINT_REQUEST, args); } updateExceptionBreakpointCache(selectedException); } @@ -185,9 +156,7 @@ export const mergeExceptionBreakpointInfos = ( for (let i = breakpointInfos.length - 1; i >= 0; i--) { if (enabledBreakpointTyperefs.indexOf(breakpointInfos[i].typeref) >= 0) { breakpointInfos[i].breakMode = EXCEPTION_BREAKPOINT_BREAK_MODE_ALWAYS; - breakpointInfos[i].description = `$(stop) ${nls.localize( - 'always_break_text' - )}`; + breakpointInfos[i].description = `$(stop) ${nls.localize('always_break_text')}`; processedBreakpointInfos.unshift(breakpointInfos[i]); breakpointInfos.splice(i, 1); } @@ -196,17 +165,12 @@ export const mergeExceptionBreakpointInfos = ( return processedBreakpointInfos.concat(breakpointInfos); }; -export const updateExceptionBreakpointCache = ( - selectedException: ExceptionBreakpointItem -) => { +export const updateExceptionBreakpointCache = (selectedException: ExceptionBreakpointItem) => { if ( selectedException.breakMode === EXCEPTION_BREAKPOINT_BREAK_MODE_ALWAYS && !cachedExceptionBreakpoints.has(selectedException.typeref) ) { - cachedExceptionBreakpoints.set( - selectedException.typeref, - selectedException - ); + cachedExceptionBreakpoints.set(selectedException.typeref, selectedException); } else if ( selectedException.breakMode === EXCEPTION_BREAKPOINT_BREAK_MODE_NEVER && cachedExceptionBreakpoints.has(selectedException.typeref) @@ -215,10 +179,7 @@ export const updateExceptionBreakpointCache = ( } }; -export const getExceptionBreakpointCache = (): Map< - string, - ExceptionBreakpointItem -> => { +export const getExceptionBreakpointCache = (): Map => { return cachedExceptionBreakpoints; }; @@ -244,27 +205,23 @@ const notifyDebuggerSessionFileChanged = (): void => { // NOTE: The below function is created for salesforcedx-apex-debugger to use the debugger extension as a middleman to send info to outside sources. The info is sent via events, which the debugger extension, as an event handler, is subscribed to and continuously listens for. One use case for this event handling mechanism that is currently implemented is sending telemetry to AppInsights, which is the `event.event === SEND_METRIC_EVENT` if statement block. In the future, this registerDebugHandlers() function might be used for other purposes, such as sending `console.log()` messages - salesforcedx-apex-debugger does not have access to the console in Toggle Developer Tools, and thus debug logging is currently limited to sending to the Debug Console in the bottom panel. const registerDebugHandlers = (): vscode.Disposable => { - const customEventHandler = vscode.debug.onDidReceiveDebugSessionCustomEvent( - async event => { - if (event?.session) { - const type = await getDebuggerType(event.session); - if (type !== DEBUGGER_TYPE) { - return; - } + const customEventHandler = vscode.debug.onDidReceiveDebugSessionCustomEvent(async event => { + if (event?.session) { + const type = await getDebuggerType(event.session); + if (type !== DEBUGGER_TYPE) { + return; + } - if (event.event === SEND_METRIC_EVENT && isMetric(event.body)) { - telemetryService.sendMetricEvent(event); - } + if (event.event === SEND_METRIC_EVENT && isMetric(event.body)) { + telemetryService.sendMetricEvent(event); } } - ); + }); return vscode.Disposable.from(customEventHandler); }; -export const activate = async ( - extensionContext: vscode.ExtensionContext -): Promise => { +export const activate = async (extensionContext: vscode.ExtensionContext): Promise => { console.log('Apex Debugger Extension Activated'); const extensionHRStart = process.hrtime(); const commands = registerCommands(); @@ -272,10 +229,7 @@ export const activate = async ( const fileWatchers = registerFileWatchers(); extensionContext.subscriptions.push(commands, fileWatchers, debugHandlers); extensionContext.subscriptions.push( - vscode.debug.registerDebugConfigurationProvider( - 'apex', - new DebugConfigurationProvider() - ) + vscode.debug.registerDebugConfigurationProvider('apex', new DebugConfigurationProvider()) ); if (salesforceCoreExtension && salesforceCoreExtension.exports) { @@ -289,9 +243,7 @@ export const activate = async ( await setupGlobalDefaultUserIsvAuth(); } catch (e) { console.error(e); - vscode.window.showWarningMessage( - nls.localize('isv_debug_config_environment_error') - ); + vscode.window.showWarningMessage(nls.localize('isv_debug_config_environment_error')); } } diff --git a/packages/salesforcedx-vscode-apex-debugger/src/messages/i18n.ts b/packages/salesforcedx-vscode-apex-debugger/src/messages/i18n.ts index d63041bccb..c40523161d 100644 --- a/packages/salesforcedx-vscode-apex-debugger/src/messages/i18n.ts +++ b/packages/salesforcedx-vscode-apex-debugger/src/messages/i18n.ts @@ -21,8 +21,7 @@ export const messages = { select_break_option_text: 'Select break option', always_break_text: 'Always break', never_break_text: 'Never break', - language_client_not_ready: - 'Unable to retrieve breakpoint info from language server, language server is not ready', + language_client_not_ready: 'Unable to retrieve breakpoint info from language server, language server is not ready', isv_debug_config_environment_error: 'Salesforce Extensions for VS Code encountered a problem while configuring your environment. Some features might not work. For details, click Help > Toggle Developer Tools or check the Salesforce CLI logs in ~/.sfdx/sfdx.log.' }; diff --git a/packages/salesforcedx-vscode-apex-debugger/src/messages/index.ts b/packages/salesforcedx-vscode-apex-debugger/src/messages/index.ts index 246ffa67e1..1fdb5dfd98 100644 --- a/packages/salesforcedx-vscode-apex-debugger/src/messages/index.ts +++ b/packages/salesforcedx-vscode-apex-debugger/src/messages/index.ts @@ -5,13 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - Config, - DEFAULT_LOCALE, - LOCALE_JA, - Localization, - Message -} from '@salesforce/salesforcedx-utils'; +import { Config, DEFAULT_LOCALE, LOCALE_JA, Localization, Message } from '@salesforce/salesforcedx-utils'; import { messages as enMessages } from './i18n'; import { messages as jaMessages } from './i18n.ja'; const supportedLocales = [DEFAULT_LOCALE, LOCALE_JA]; @@ -33,9 +27,5 @@ const loadMessageBundle = (config?: Config): Message => { }; export const nls = new Localization( - loadMessageBundle( - process.env.VSCODE_NLS_CONFIG - ? JSON.parse(process.env.VSCODE_NLS_CONFIG!) - : undefined - ) + loadMessageBundle(process.env.VSCODE_NLS_CONFIG ? JSON.parse(process.env.VSCODE_NLS_CONFIG!) : undefined) ); diff --git a/packages/salesforcedx-vscode-apex-debugger/src/telemetry/telemetry.ts b/packages/salesforcedx-vscode-apex-debugger/src/telemetry/telemetry.ts index 8beac23d06..0547722cfd 100644 --- a/packages/salesforcedx-vscode-apex-debugger/src/telemetry/telemetry.ts +++ b/packages/salesforcedx-vscode-apex-debugger/src/telemetry/telemetry.ts @@ -27,10 +27,7 @@ export class TelemetryService { return TelemetryService.instance; } - public initializeService( - reporters: TelemetryReporter[], - isTelemetryEnabled: boolean - ): void { + public initializeService(reporters: TelemetryReporter[], isTelemetryEnabled: boolean): void { this.isTelemetryEnabled = isTelemetryEnabled; this.reporters = reporters; } diff --git a/packages/salesforcedx-vscode-apex-debugger/test/.eslintrc.json b/packages/salesforcedx-vscode-apex-debugger/test/.eslintrc.json deleted file mode 100644 index f2b99a417d..0000000000 --- a/packages/salesforcedx-vscode-apex-debugger/test/.eslintrc.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": [ - "../.eslintrc.json", - "../../../config/common-test-lint-rules.json" - ] -} diff --git a/packages/salesforcedx-vscode-apex-debugger/test/jest/context/isvContext.test.ts b/packages/salesforcedx-vscode-apex-debugger/test/jest/context/isvContext.test.ts index b8db9dbbfc..9f9ae5dd4c 100644 --- a/packages/salesforcedx-vscode-apex-debugger/test/jest/context/isvContext.test.ts +++ b/packages/salesforcedx-vscode-apex-debugger/test/jest/context/isvContext.test.ts @@ -19,9 +19,7 @@ describe('isvContext unit test', () => { let onDidDeleteSpy: jest.SpyInstance; beforeEach(() => { - salesforceProjectConfigStub = jest - .spyOn(projectPaths, 'salesforceProjectConfig') - .mockReturnValue(fakePath); + salesforceProjectConfigStub = jest.spyOn(projectPaths, 'salesforceProjectConfig').mockReturnValue(fakePath); onDidChangeSpy = jest.fn(); onDidCreateSpy = jest.fn(); onDidDeleteSpy = jest.fn(); @@ -51,9 +49,7 @@ describe('isvContext unit test', () => { it('should watch files if workspace folders are present', () => { (vscode.workspace.workspaceFolders as any) = ['1']; registerIsvAuthWatcher(extensionContext); - expect(vscode.workspace.createFileSystemWatcher).toHaveBeenCalledWith( - fakePath - ); + expect(vscode.workspace.createFileSystemWatcher).toHaveBeenCalledWith(fakePath); expect(onDidChangeSpy).toHaveBeenCalledWith(expect.any(Function)); expect(onDidCreateSpy).toHaveBeenCalledWith(expect.any(Function)); expect(onDidDeleteSpy).toHaveBeenCalledWith(expect.any(Function)); diff --git a/packages/salesforcedx-vscode-apex-debugger/test/vscode-integration/adapter/debugConfigurationProvider.test.ts b/packages/salesforcedx-vscode-apex-debugger/test/vscode-integration/adapter/debugConfigurationProvider.test.ts index 308b85aa01..e3a9cba8ac 100644 --- a/packages/salesforcedx-vscode-apex-debugger/test/vscode-integration/adapter/debugConfigurationProvider.test.ts +++ b/packages/salesforcedx-vscode-apex-debugger/test/vscode-integration/adapter/debugConfigurationProvider.test.ts @@ -5,10 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - DEBUGGER_LAUNCH_TYPE, - DEBUGGER_TYPE -} from '@salesforce/salesforcedx-apex-debugger/out/src'; +import { DEBUGGER_LAUNCH_TYPE, DEBUGGER_TYPE } from '@salesforce/salesforcedx-apex-debugger/out/src'; import { expect } from 'chai'; import * as sinon from 'sinon'; import { DebugConfiguration, extensions, Uri, WorkspaceFolder } from 'vscode'; @@ -30,9 +27,7 @@ describe('Configuration provider', () => { let mockApexExtension: sinon.SinonStub; beforeEach(() => { - mockApexExtension = sinon - .stub(extensions, 'getExtension') - .returns(new MockApexExtension()); + mockApexExtension = sinon.stub(extensions, 'getExtension').returns(new MockApexExtension()); provider = new DebugConfigurationProvider(); getConfigSpy = sinon.spy(DebugConfigurationProvider, 'getConfig'); }); @@ -78,9 +73,7 @@ describe('Configuration provider', () => { expect(config.lineBreakpointInfo).to.not.equals(undefined); expect(mockApexExtension.calledOnce).to.be.true; } else { - expect.fail( - 'Did not get configuration information from resolveDebugConfiguration' - ); + expect.fail('Did not get configuration information from resolveDebugConfiguration'); } }); @@ -101,23 +94,17 @@ describe('Configuration provider', () => { expect(config.name).to.equals('sampleName'); expect(config.type).to.equals('sampleType'); expect(config.request).to.equals('sampleConfigType'); - expect(config.requestTypeFilter) - .to.be.an('array') - .to.include('BATCH_APEX'); + expect(config.requestTypeFilter).to.be.an('array').to.include('BATCH_APEX'); expect(config.entryPointFilter).to.equals('test/entrypoint'); expect(config.connectType).to.equals('ISV_DEBUGGER'); expect(config.salesforceProject).to.equals('project/path'); - expect(config.userIdFilter) - .to.be.an('array') - .to.deep.include('005xx7998909099'); + expect(config.userIdFilter).to.be.an('array').to.deep.include('005xx7998909099'); expect(config.trace).to.equals(true); expect(config.workspaceSettings).to.not.equals(undefined); expect(config.lineBreakpointInfo).to.not.equals(undefined); expect(mockApexExtension.calledOnce).to.be.true; } else { - expect.fail( - 'Did not get configuration information from resolveDebugConfiguration' - ); + expect.fail('Did not get configuration information from resolveDebugConfiguration'); } }); }); diff --git a/packages/salesforcedx-vscode-apex-debugger/test/vscode-integration/index.test.ts b/packages/salesforcedx-vscode-apex-debugger/test/vscode-integration/index.test.ts index fddf9851f3..c661cfa522 100644 --- a/packages/salesforcedx-vscode-apex-debugger/test/vscode-integration/index.test.ts +++ b/packages/salesforcedx-vscode-apex-debugger/test/vscode-integration/index.test.ts @@ -52,40 +52,22 @@ describe('Extension Setup', () => { ]; }); it('Should order breakpoints by enabled first', () => { - const exceptionBreakpointQuickPicks = mergeExceptionBreakpointInfos( - breakpointInfos, - ['com/salesforce/api/exception/NullPointerException'] - ); + const exceptionBreakpointQuickPicks = mergeExceptionBreakpointInfos(breakpointInfos, [ + 'com/salesforce/api/exception/NullPointerException' + ]); expect(exceptionBreakpointQuickPicks.length).to.equal(3); - expect(exceptionBreakpointQuickPicks[0].typeref).to.equal( - 'com/salesforce/api/exception/NullPointerException' - ); - expect(exceptionBreakpointQuickPicks[0].breakMode).to.equal( - EXCEPTION_BREAKPOINT_BREAK_MODE_ALWAYS - ); - expect(exceptionBreakpointQuickPicks[0].description).to.equal( - `$(stop) ${nls.localize('always_break_text')}` - ); - expect(exceptionBreakpointQuickPicks[1].typeref).to.equal( - 'barexception' - ); - expect(exceptionBreakpointQuickPicks[1].breakMode).to.equal( - EXCEPTION_BREAKPOINT_BREAK_MODE_NEVER - ); - expect(exceptionBreakpointQuickPicks[2].typeref).to.equal( - 'fooexception' - ); - expect(exceptionBreakpointQuickPicks[2].breakMode).to.equal( - EXCEPTION_BREAKPOINT_BREAK_MODE_NEVER - ); + expect(exceptionBreakpointQuickPicks[0].typeref).to.equal('com/salesforce/api/exception/NullPointerException'); + expect(exceptionBreakpointQuickPicks[0].breakMode).to.equal(EXCEPTION_BREAKPOINT_BREAK_MODE_ALWAYS); + expect(exceptionBreakpointQuickPicks[0].description).to.equal(`$(stop) ${nls.localize('always_break_text')}`); + expect(exceptionBreakpointQuickPicks[1].typeref).to.equal('barexception'); + expect(exceptionBreakpointQuickPicks[1].breakMode).to.equal(EXCEPTION_BREAKPOINT_BREAK_MODE_NEVER); + expect(exceptionBreakpointQuickPicks[2].typeref).to.equal('fooexception'); + expect(exceptionBreakpointQuickPicks[2].breakMode).to.equal(EXCEPTION_BREAKPOINT_BREAK_MODE_NEVER); }); it('Should not modify breakpoint infos if enabled breakpoints has empty typerefs', () => { - const exceptionBreakpointQuickPicks = mergeExceptionBreakpointInfos( - breakpointInfos, - [] - ); + const exceptionBreakpointQuickPicks = mergeExceptionBreakpointInfos(breakpointInfos, []); expect(exceptionBreakpointQuickPicks).to.deep.equal(breakpointInfos); }); @@ -185,9 +167,7 @@ describe('Extension Setup', () => { } }; - const realType = await getDebuggerType( - (session as any) as vscode.DebugSession - ); + const realType = await getDebuggerType(session as any as vscode.DebugSession); expect(realType).to.be.equal(DEBUGGER_TYPE); }); diff --git a/packages/salesforcedx-vscode-apex-debugger/test/vscode-integration/telemetry/telemetry.test.ts b/packages/salesforcedx-vscode-apex-debugger/test/vscode-integration/telemetry/telemetry.test.ts index e4995af96a..5eee0924e2 100644 --- a/packages/salesforcedx-vscode-apex-debugger/test/vscode-integration/telemetry/telemetry.test.ts +++ b/packages/salesforcedx-vscode-apex-debugger/test/vscode-integration/telemetry/telemetry.test.ts @@ -51,12 +51,7 @@ describe('Telemetry', () => { const expectedMeasures = { startupTime: match.number }; - assert.calledWith( - sendEvent, - 'activationEvent', - expectedProps, - match(expectedMeasures) - ); + assert.calledWith(sendEvent, 'activationEvent', expectedProps, match(expectedMeasures)); }); it('Should send correct data format on sendExtensionDeactivationEvent', async () => { diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/.eslintrc.json b/packages/salesforcedx-vscode-apex-replay-debugger/.eslintrc.json deleted file mode 100644 index 5b59dce583..0000000000 --- a/packages/salesforcedx-vscode-apex-replay-debugger/.eslintrc.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "root": true, - "extends": [ - "../../config/base-eslintrc.json", - "./fix-these-rules.json" - ], - "overrides": [ - { - "files": [ - "./src/**/*.ts", - "./test/**/*.ts" - ], - "parserOptions": { - "project": "./tsconfig.json" - } - } - ], - "env": { - "node": true - } -} \ No newline at end of file diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/esbuild.config.js b/packages/salesforcedx-vscode-apex-replay-debugger/esbuild.config.js index da9253b9ba..b8da5a8979 100644 --- a/packages/salesforcedx-vscode-apex-replay-debugger/esbuild.config.js +++ b/packages/salesforcedx-vscode-apex-replay-debugger/esbuild.config.js @@ -4,7 +4,6 @@ * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -/* eslint-disable @typescript-eslint/no-var-requires */ const { build } = require('esbuild'); const esbuildPluginPino = require('esbuild-plugin-pino'); const fs = require('fs').promises; @@ -13,16 +12,10 @@ const sharedConfig = { bundle: true, format: 'cjs', platform: 'node', - external: [ - 'vscode', - 'applicationinsights', - 'jsonpath' - ], + external: ['vscode', 'applicationinsights', 'jsonpath'], minify: true, keepNames: true, - plugins: [ - esbuildPluginPino({ transports: ['pino-pretty'] }) - ], + plugins: [esbuildPluginPino({ transports: ['pino-pretty'] })], supported: { 'dynamic-import': false }, @@ -51,6 +44,8 @@ const destPath = './dist/transformStream.js'; entryPoints: ['./src/index.ts'], outdir: 'dist' }); -})().then(async () => { - await copyFiles(srcPath, destPath); -}).catch(() => process.exit(1)); +})() + .then(async () => { + await copyFiles(srcPath, destPath); + }) + .catch(() => process.exit(1)); diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/fix-these-rules.json b/packages/salesforcedx-vscode-apex-replay-debugger/fix-these-rules.json deleted file mode 100644 index 35a79d62e3..0000000000 --- a/packages/salesforcedx-vscode-apex-replay-debugger/fix-these-rules.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "rules": { - "prefer-arrow/prefer-arrow-functions": ["error", {}], - "@typescript-eslint/await-thenable": "warn", - "@typescript-eslint/no-floating-promises": "warn", - "@typescript-eslint/no-unsafe-argument": "warn", - "@typescript-eslint/no-unsafe-assignment": "warn", - "@typescript-eslint/no-unsafe-call": "warn", - "@typescript-eslint/no-unsafe-member-access": "warn", - "@typescript-eslint/require-await": "warn", - "@typescript-eslint/unbound-method": "warn", - "@typescript-eslint/no-unsafe-return": "warn" - } -} diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/package.json b/packages/salesforcedx-vscode-apex-replay-debugger/package.json index 6d4b5e162c..460175850a 100644 --- a/packages/salesforcedx-vscode-apex-replay-debugger/package.json +++ b/packages/salesforcedx-vscode-apex-replay-debugger/package.json @@ -18,7 +18,7 @@ "publisher": "salesforce", "license": "BSD-3-Clause", "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" }, "categories": [ "Debuggers" @@ -39,25 +39,15 @@ "@types/async-lock": "0.0.20", "@types/chai": "4.3.3", "@types/mocha": "^5", - "@types/node": "^18.11.9", + "@types/node": "^20.0.0", "@types/sinon": "^2.3.7", - "@types/vscode": "^1.86.0", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", + "@types/vscode": "^1.90.0", "chai": "^4.0.2", "cross-env": "5.2.0", "esbuild": "^0.19.5", "esbuild-plugin-pino": "^2.1.0", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest": "27.5.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", "mocha": "^10", - "prettier": "3.0.3", + "prettier": "3.3.3", "sinon": "^13.0.1" }, "extensionDependencies": [ diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/src/activation/getDialogStartingPath.ts b/packages/salesforcedx-vscode-apex-replay-debugger/src/activation/getDialogStartingPath.ts index dedd607ced..7cd8df6274 100644 --- a/packages/salesforcedx-vscode-apex-replay-debugger/src/activation/getDialogStartingPath.ts +++ b/packages/salesforcedx-vscode-apex-replay-debugger/src/activation/getDialogStartingPath.ts @@ -6,16 +6,11 @@ */ import { LAST_OPENED_LOG_FOLDER_KEY } from '@salesforce/salesforcedx-apex-replay-debugger/out/src/constants'; -import { - projectPaths, - workspaceUtils -} from '@salesforce/salesforcedx-utils-vscode'; +import { projectPaths, workspaceUtils } from '@salesforce/salesforcedx-utils-vscode'; import { existsSync } from 'fs'; import * as vscode from 'vscode'; -export const getDialogStartingPath = ( - extContext: vscode.ExtensionContext -): vscode.Uri | undefined => { +export const getDialogStartingPath = (extContext: vscode.ExtensionContext): vscode.Uri | undefined => { if (workspaceUtils.hasRootWorkspace()) { // If the user has already selected a document through getLogFileName then // use that path if it still exists. @@ -39,12 +34,8 @@ export const getDialogStartingPath = ( } }; -const getLastOpenedLogFolder = ( - extContext: vscode.ExtensionContext -): string | undefined => { - const pathToLastOpenedLogFolder = extContext.workspaceState.get( - LAST_OPENED_LOG_FOLDER_KEY - ); +const getLastOpenedLogFolder = (extContext: vscode.ExtensionContext): string | undefined => { + const pathToLastOpenedLogFolder = extContext.workspaceState.get(LAST_OPENED_LOG_FOLDER_KEY); return pathToLastOpenedLogFolder; }; diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/src/adapter/debugConfigurationProvider.ts b/packages/salesforcedx-vscode-apex-replay-debugger/src/adapter/debugConfigurationProvider.ts index 2c6b58bc50..d57262c55d 100644 --- a/packages/salesforcedx-vscode-apex-replay-debugger/src/adapter/debugConfigurationProvider.ts +++ b/packages/salesforcedx-vscode-apex-replay-debugger/src/adapter/debugConfigurationProvider.ts @@ -5,19 +5,12 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - DEBUGGER_LAUNCH_TYPE, - DEBUGGER_TYPE -} from '@salesforce/salesforcedx-apex-replay-debugger/out/src/constants'; +import { DEBUGGER_LAUNCH_TYPE, DEBUGGER_TYPE } from '@salesforce/salesforcedx-apex-replay-debugger/out/src/constants'; import * as vscode from 'vscode'; import { nls } from '../messages'; -export class DebugConfigurationProvider - implements vscode.DebugConfigurationProvider -{ - private salesforceApexExtension = vscode.extensions.getExtension( - 'salesforce.salesforcedx-vscode-apex' - ); +export class DebugConfigurationProvider implements vscode.DebugConfigurationProvider { + private salesforceApexExtension = vscode.extensions.getExtension('salesforce.salesforcedx-vscode-apex'); public static getConfig(logFile?: string, stopOnEntry: boolean = true) { return { name: nls.localize('config_name_text'), @@ -29,32 +22,24 @@ export class DebugConfigurationProvider } as vscode.DebugConfiguration; } - /* eslint-disable @typescript-eslint/no-unused-vars */ public provideDebugConfigurations( folder: vscode.WorkspaceFolder | undefined, token?: vscode.CancellationToken - /* eslint-enable @typescript-eslint/no-unused-vars */ ): vscode.ProviderResult { return [DebugConfigurationProvider.getConfig()]; } - /* eslint-disable @typescript-eslint/no-unused-vars */ public resolveDebugConfiguration( folder: vscode.WorkspaceFolder | undefined, config: vscode.DebugConfiguration, token?: vscode.CancellationToken - /* eslint-enable @typescript-eslint/no-unused-vars */ ): vscode.ProviderResult { return this.asyncDebugConfig(config).catch(async err => { - return vscode.window - .showErrorMessage(err.message, { modal: true }) - .then(() => undefined); + return vscode.window.showErrorMessage(err.message, { modal: true }).then(() => undefined); }); } - private async asyncDebugConfig( - config: vscode.DebugConfiguration - ): Promise { + private async asyncDebugConfig(config: vscode.DebugConfiguration): Promise { config.name = config.name || nls.localize('config_name_text'); config.type = config.type || DEBUGGER_TYPE; config.request = config.request || DEBUGGER_LAUNCH_TYPE; @@ -66,18 +51,13 @@ export class DebugConfigurationProvider config.trace = true; } - if ( - vscode.workspace && - vscode.workspace.workspaceFolders && - vscode.workspace.workspaceFolders[0] - ) { + if (vscode.workspace && vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders[0]) { config.projectPath = vscode.workspace.workspaceFolders[0].uri.fsPath; } if (this.salesforceApexExtension && this.salesforceApexExtension.exports) { await this.isLanguageClientReady(); - config.lineBreakpointInfo = - await this.salesforceApexExtension.exports.getLineBreakpointInfo(); + config.lineBreakpointInfo = await this.salesforceApexExtension.exports.getLineBreakpointInfo(); } return config; } @@ -88,21 +68,11 @@ export class DebugConfigurationProvider while ( this.salesforceApexExtension && this.salesforceApexExtension.exports && - !this.salesforceApexExtension.exports.languageClientUtils - .getStatus() - .isReady() && + !this.salesforceApexExtension.exports.languageClientUtils.getStatus().isReady() && !expired ) { - if ( - this.salesforceApexExtension.exports.languageClientUtils - .getStatus() - .failedToInitialize() - ) { - throw Error( - this.salesforceApexExtension.exports.languageClientUtils - .getStatus() - .getStatusMessage() - ); + if (this.salesforceApexExtension.exports.languageClientUtils.getStatus().failedToInitialize()) { + throw Error(this.salesforceApexExtension.exports.languageClientUtils.getStatus().getStatusMessage()); } await new Promise(r => setTimeout(r, 100)); diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/src/breakpoints/checkpointService.ts b/packages/salesforcedx-vscode-apex-replay-debugger/src/breakpoints/checkpointService.ts index b96d76e69c..f5491e5ed4 100644 --- a/packages/salesforcedx-vscode-apex-replay-debugger/src/breakpoints/checkpointService.ts +++ b/packages/salesforcedx-vscode-apex-replay-debugger/src/breakpoints/checkpointService.ts @@ -5,10 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ import { breakpointUtil } from '@salesforce/salesforcedx-apex-replay-debugger/out/src/breakpoints'; -import { - ActionScriptEnum, - OrgInfoError -} from '@salesforce/salesforcedx-apex-replay-debugger/out/src/commands'; +import { ActionScriptEnum, OrgInfoError } from '@salesforce/salesforcedx-apex-replay-debugger/out/src/commands'; import { CHECKPOINT, CHECKPOINTS_LOCK_STRING, @@ -16,20 +13,9 @@ import { MAX_ALLOWED_CHECKPOINTS, OVERLAY_ACTION_DELETE_URL } from '@salesforce/salesforcedx-apex-replay-debugger/out/src/constants'; -import { - OrgDisplay, - OrgInfo, - RequestService, - RestHttpMethodEnum -} from '@salesforce/salesforcedx-utils'; +import { OrgDisplay, OrgInfo, RequestService, RestHttpMethodEnum } from '@salesforce/salesforcedx-utils'; import * as vscode from 'vscode'; -import { - Event, - EventEmitter, - TreeDataProvider, - TreeItem, - TreeItemCollapsibleState -} from 'vscode'; +import { Event, EventEmitter, TreeDataProvider, TreeItem, TreeItemCollapsibleState } from 'vscode'; import { ApexExecutionOverlayActionCommand, ApexExecutionOverlayFailureResult, @@ -45,11 +31,7 @@ import { QueryExistingOverlayActionIdsCommand, QueryOverlayActionIdsSuccessResult } from '../commands/queryExistingOverlayActionIdsCommand'; -import { - retrieveLineBreakpointInfo, - VSCodeWindowTypeEnum, - writeToDebuggerOutputWindow -} from '../index'; +import { retrieveLineBreakpointInfo, VSCodeWindowTypeEnum, writeToDebuggerOutputWindow } from '../index'; import { nls } from '../messages'; import { telemetryService } from '../telemetry'; @@ -74,14 +56,12 @@ export type ApexExecutionOverlayAction = { export class CheckpointService implements TreeDataProvider { private static instance: CheckpointService; private checkpoints: CheckpointNode[]; - private _onDidChangeTreeData: EventEmitter = - new EventEmitter(); + private _onDidChangeTreeData: EventEmitter = new EventEmitter(); private myRequestService: RequestService; private orgInfo!: OrgInfo; private salesforceProject: string | null = null; - public readonly onDidChangeTreeData: Event = - this._onDidChangeTreeData.event; + public readonly onDidChangeTreeData: Event = this._onDidChangeTreeData.event; public constructor() { this.checkpoints = []; @@ -93,25 +73,14 @@ export class CheckpointService implements TreeDataProvider { } public async retrieveOrgInfo(): Promise { - if ( - vscode.workspace.workspaceFolders && - vscode.workspace.workspaceFolders[0] - ) { + if (vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders[0]) { this.salesforceProject = vscode.workspace.workspaceFolders[0].uri.fsPath; try { - this.orgInfo = await new OrgDisplay().getOrgInfo( - this.salesforceProject - ); + this.orgInfo = await new OrgDisplay().getOrgInfo(this.salesforceProject); } catch (error) { const result = JSON.parse(error) as OrgInfoError; - const errorMessage = `${nls.localize( - 'unable_to_retrieve_org_info' - )} : ${result.message}`; - writeToDebuggerOutputWindow( - errorMessage, - true, - VSCodeWindowTypeEnum.Error - ); + const errorMessage = `${nls.localize('unable_to_retrieve_org_info')} : ${result.message}`; + writeToDebuggerOutputWindow(errorMessage, true, VSCodeWindowTypeEnum.Error); return false; } this.myRequestService.instanceUrl = this.orgInfo.instanceUrl; @@ -119,11 +88,7 @@ export class CheckpointService implements TreeDataProvider { return true; } else { const errorMessage = nls.localize('cannot_determine_workspace'); - writeToDebuggerOutputWindow( - errorMessage, - true, - VSCodeWindowTypeEnum.Error - ); + writeToDebuggerOutputWindow(errorMessage, true, VSCodeWindowTypeEnum.Error); return false; } } @@ -156,15 +121,8 @@ export class CheckpointService implements TreeDataProvider { } const fiveOrLess = numEnabledCheckpoints <= MAX_ALLOWED_CHECKPOINTS; if (!fiveOrLess && displayError) { - const errorMessage = nls.localize( - 'up_to_five_checkpoints', - numEnabledCheckpoints - ); - writeToDebuggerOutputWindow( - errorMessage, - true, - VSCodeWindowTypeEnum.Error - ); + const errorMessage = nls.localize('up_to_five_checkpoints', numEnabledCheckpoints); + writeToDebuggerOutputWindow(errorMessage, true, VSCodeWindowTypeEnum.Error); } return fiveOrLess; } @@ -179,11 +137,7 @@ export class CheckpointService implements TreeDataProvider { const oneOrMore = numEnabledCheckpoints > 0; if (!oneOrMore && displayError) { const errorMessage = nls.localize('no_enabled_checkpoints'); - writeToDebuggerOutputWindow( - errorMessage, - true, - VSCodeWindowTypeEnum.Warning - ); + writeToDebuggerOutputWindow(errorMessage, true, VSCodeWindowTypeEnum.Warning); } return oneOrMore; } @@ -207,9 +161,7 @@ export class CheckpointService implements TreeDataProvider { return cpNode; } - public returnCheckpointNodeIfAlreadyExists( - breakpointIdInput: string - ): CheckpointNode | undefined { + public returnCheckpointNodeIfAlreadyExists(breakpointIdInput: string): CheckpointNode | undefined { for (const cp of this.checkpoints) { if (breakpointIdInput === cp.getBreakpointId()) { return cp; @@ -229,13 +181,9 @@ export class CheckpointService implements TreeDataProvider { } } - public async executeCreateApexExecutionOverlayActionCommand( - theNode: CheckpointNode - ): Promise { + public async executeCreateApexExecutionOverlayActionCommand(theNode: CheckpointNode): Promise { // create the overlay action - const overlayActionCommand = new ApexExecutionOverlayActionCommand( - theNode.createJSonStringForOverlayAction() - ); + const overlayActionCommand = new ApexExecutionOverlayActionCommand(theNode.createJSonStringForOverlayAction()); let errorString; let returnString; await this.myRequestService.execute(overlayActionCommand).then( @@ -249,9 +197,7 @@ export class CheckpointService implements TreeDataProvider { // The resturn string will be the overlay Id and will end up being // used if the node is deleted if (returnString) { - const result = JSON.parse( - returnString - ) as ApexExecutionOverlaySuccessResult; + const result = JSON.parse(returnString) as ApexExecutionOverlaySuccessResult; theNode.setActionCommandResultId(result.id); return true; } @@ -260,36 +206,20 @@ export class CheckpointService implements TreeDataProvider { // be treated as a string and reported to the user. if (errorString) { try { - const result = JSON.parse( - errorString - ) as ApexExecutionOverlayFailureResult[]; + const result = JSON.parse(errorString) as ApexExecutionOverlayFailureResult[]; if (result[0].errorCode === FIELD_INTEGRITY_EXCEPTION) { - const errorMessage = nls.localize( - 'local_source_is_out_of_sync_with_the_server' - ); - writeToDebuggerOutputWindow( - errorMessage, - true, - VSCodeWindowTypeEnum.Error - ); + const errorMessage = nls.localize('local_source_is_out_of_sync_with_the_server'); + writeToDebuggerOutputWindow(errorMessage, true, VSCodeWindowTypeEnum.Error); } else { const errorMessage = `${ result[0].message }. URI=${theNode.getCheckpointUri()}, Line=${theNode.getCheckpointLineNumber()}`; - writeToDebuggerOutputWindow( - errorMessage, - true, - VSCodeWindowTypeEnum.Error - ); + writeToDebuggerOutputWindow(errorMessage, true, VSCodeWindowTypeEnum.Error); } } catch (error) { // eslint-disable-next-line @typescript-eslint/restrict-template-expressions const errorMessage = `${errorString}. URI=${theNode.getCheckpointUri()}, Line=${theNode.getCheckpointLineNumber()}`; - writeToDebuggerOutputWindow( - errorMessage, - true, - VSCodeWindowTypeEnum.Error - ); + writeToDebuggerOutputWindow(errorMessage, true, VSCodeWindowTypeEnum.Error); } } return false; @@ -297,31 +227,23 @@ export class CheckpointService implements TreeDataProvider { // Make VS Code the source of truth for checkpoints public async clearExistingCheckpoints(): Promise { - const salesforceCoreExtension = vscode.extensions.getExtension( - 'salesforce.salesforcedx-vscode-core' - ); + const salesforceCoreExtension = vscode.extensions.getExtension('salesforce.salesforcedx-vscode-core'); if (salesforceCoreExtension && salesforceCoreExtension.exports) { - const userId = await salesforceCoreExtension.exports.getUserId( - this.salesforceProject - ); + const userId = await salesforceCoreExtension.exports.getUserId(this.salesforceProject); if (userId) { const queryCommand = new QueryExistingOverlayActionIdsCommand(userId); let errorString; let returnString; - await this.myRequestService - .execute(queryCommand, RestHttpMethodEnum.Get) - .then( - value => { - returnString = value; - }, - reason => { - errorString = reason; - } - ); + await this.myRequestService.execute(queryCommand, RestHttpMethodEnum.Get).then( + value => { + returnString = value; + }, + reason => { + errorString = reason; + } + ); if (returnString) { - const successResult = JSON.parse( - returnString - ) as QueryOverlayActionIdsSuccessResult; + const successResult = JSON.parse(returnString) as QueryOverlayActionIdsSuccessResult; if (successResult) { // If there are things to delete then create the batchRequest if (successResult.records.length > 0) { @@ -336,33 +258,24 @@ export class CheckpointService implements TreeDataProvider { const batchRequests: BatchRequests = { batchRequests: requests }; - const batchDeleteCommand = - new BatchDeleteExistingOverlayActionCommand(batchRequests); + const batchDeleteCommand = new BatchDeleteExistingOverlayActionCommand(batchRequests); let deleteError; let deleteResult; - await this.myRequestService - .execute(batchDeleteCommand, RestHttpMethodEnum.Post) - .then( - value => { - deleteResult = value; - }, - reason => { - deleteError = reason; - } - ); + await this.myRequestService.execute(batchDeleteCommand, RestHttpMethodEnum.Post).then( + value => { + deleteResult = value; + }, + reason => { + deleteError = reason; + } + ); // Parse the result if (deleteResult) { const result = JSON.parse(deleteResult) as BatchDeleteResponse; if (result.hasErrors) { - const errorMessage = nls.localize( - 'cannot_delete_existing_checkpoint' - ); - writeToDebuggerOutputWindow( - errorMessage, - true, - VSCodeWindowTypeEnum.Error - ); + const errorMessage = nls.localize('cannot_delete_existing_checkpoint'); + writeToDebuggerOutputWindow(errorMessage, true, VSCodeWindowTypeEnum.Error); } else { // no errors, return true return true; @@ -376,56 +289,30 @@ export class CheckpointService implements TreeDataProvider { 'cannot_delete_existing_checkpoint' // eslint-disable-next-line @typescript-eslint/restrict-template-expressions )} : ${deleteError}`; - writeToDebuggerOutputWindow( - errorMessage, - true, - VSCodeWindowTypeEnum.Error - ); + writeToDebuggerOutputWindow(errorMessage, true, VSCodeWindowTypeEnum.Error); return false; } } // no records to delete, just return true return true; } else { - const errorMessage = nls.localize( - 'unable_to_parse_checkpoint_query_result' - ); - writeToDebuggerOutputWindow( - errorMessage, - true, - VSCodeWindowTypeEnum.Error - ); + const errorMessage = nls.localize('unable_to_parse_checkpoint_query_result'); + writeToDebuggerOutputWindow(errorMessage, true, VSCodeWindowTypeEnum.Error); return false; } } else { - const errorMessage = `${nls.localize( - 'unable_to_query_for_existing_checkpoints' - )} Error: ${errorString}`; - writeToDebuggerOutputWindow( - errorMessage, - true, - VSCodeWindowTypeEnum.Error - ); + const errorMessage = `${nls.localize('unable_to_query_for_existing_checkpoints')} Error: ${errorString}`; + writeToDebuggerOutputWindow(errorMessage, true, VSCodeWindowTypeEnum.Error); return false; } } else { - const errorMessage = nls.localize( - 'unable_to_retrieve_active_user_for_sf_project' - ); - writeToDebuggerOutputWindow( - errorMessage, - true, - VSCodeWindowTypeEnum.Error - ); + const errorMessage = nls.localize('unable_to_retrieve_active_user_for_sf_project'); + writeToDebuggerOutputWindow(errorMessage, true, VSCodeWindowTypeEnum.Error); return false; } } else { const errorMessage = nls.localize('unable_to_load_vscode_core_extension'); - writeToDebuggerOutputWindow( - errorMessage, - true, - VSCodeWindowTypeEnum.Error - ); + writeToDebuggerOutputWindow(errorMessage, true, VSCodeWindowTypeEnum.Error); return false; } } @@ -449,52 +336,42 @@ export class CheckpointService implements TreeDataProvider { let updateError = false; // The status message isn't changing, call to localize it once and use the localized string in the // progress report. - const localizedProgressMessage = nls.localize( - 'sf_update_checkpoints_in_org' - ); + const localizedProgressMessage = nls.localize('sf_update_checkpoints_in_org'); // Wrap everything in a try/finally to ensure creatingCheckpoints gets set to false try { // The lock is necessary here to prevent the user from deleting the underlying breakpoint // attached to the checkpoint while they're being uploaded into the org. await lock.acquire(CHECKPOINTS_LOCK_STRING, async () => { - writeToDebuggerOutputWindow( - `${nls.localize('long_command_start')} ${localizedProgressMessage}` - ); + writeToDebuggerOutputWindow(`${nls.localize('long_command_start')} ${localizedProgressMessage}`); await vscode.window.withProgress( { location: vscode.ProgressLocation.Notification, title: localizedProgressMessage, cancellable: false }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars + async (progress, token) => { writeToDebuggerOutputWindow( - `${localizedProgressMessage}, ${nls.localize( - 'checkpoint_creation_status_org_info' - )}` + `${localizedProgressMessage}, ${nls.localize('checkpoint_creation_status_org_info')}` ); progress.report({ increment: 0, message: localizedProgressMessage }); - const orgInfoRetrieved: boolean = - await checkpointService.retrieveOrgInfo(); + const orgInfoRetrieved: boolean = await checkpointService.retrieveOrgInfo(); if (!orgInfoRetrieved) { updateError = true; return false; } writeToDebuggerOutputWindow( - `${localizedProgressMessage}, ${nls.localize( - 'checkpoint_creation_status_source_line_info' - )}` + `${localizedProgressMessage}, ${nls.localize('checkpoint_creation_status_source_line_info')}` ); progress.report({ increment: 20, message: localizedProgressMessage }); - const sourceLineInfoRetrieved: boolean = - await retrieveLineBreakpointInfo(); + const sourceLineInfoRetrieved: boolean = await retrieveLineBreakpointInfo(); // If we didn't get the source line information that'll be reported at that time, just return if (!sourceLineInfoRetrieved) { updateError = true; @@ -508,9 +385,7 @@ export class CheckpointService implements TreeDataProvider { } writeToDebuggerOutputWindow( - `${localizedProgressMessage}, ${nls.localize( - 'checkpoint_creation_status_setting_typeref' - )}` + `${localizedProgressMessage}, ${nls.localize('checkpoint_creation_status_setting_typeref')}` ); progress.report({ increment: 50, @@ -523,26 +398,21 @@ export class CheckpointService implements TreeDataProvider { } writeToDebuggerOutputWindow( - `${localizedProgressMessage}, ${nls.localize( - 'checkpoint_creation_status_clearing_existing_checkpoints' - )}` + `${localizedProgressMessage}, ${nls.localize('checkpoint_creation_status_clearing_existing_checkpoints')}` ); progress.report({ increment: 50, message: localizedProgressMessage }); // remove any existing checkpoints on the server - const allRemoved: boolean = - await checkpointService.clearExistingCheckpoints(); + const allRemoved: boolean = await checkpointService.clearExistingCheckpoints(); if (!allRemoved) { updateError = true; return false; } writeToDebuggerOutputWindow( - `${localizedProgressMessage}, ${nls.localize( - 'checkpoint_creation_status_uploading_checkpoints' - )}` + `${localizedProgressMessage}, ${nls.localize('checkpoint_creation_status_uploading_checkpoints')}` ); progress.report({ increment: 70, @@ -551,11 +421,7 @@ export class CheckpointService implements TreeDataProvider { // This should probably be batched but it makes dealing with errors kind of a pain for (const cpNode of checkpointService.getChildren() as CheckpointNode[]) { if (cpNode.isCheckpointEnabled()) { - if ( - !(await checkpointService.executeCreateApexExecutionOverlayActionCommand( - cpNode - )) - ) { + if (!(await checkpointService.executeCreateApexExecutionOverlayActionCommand(cpNode))) { updateError = true; } } @@ -566,17 +432,13 @@ export class CheckpointService implements TreeDataProvider { message: localizedProgressMessage }); writeToDebuggerOutputWindow( - `${localizedProgressMessage}, ${nls.localize( - 'checkpoint_creation_status_processing_complete_success' - )}` + `${localizedProgressMessage}, ${nls.localize('checkpoint_creation_status_processing_complete_success')}` ); } ); }); } finally { - writeToDebuggerOutputWindow( - `${nls.localize('long_command_end')} ${localizedProgressMessage}` - ); + writeToDebuggerOutputWindow(`${nls.localize('long_command_end')} ${localizedProgressMessage}`); let errorMsg = ''; if (updateError) { errorMsg = nls.localize( @@ -616,10 +478,7 @@ export class CheckpointNode extends BaseNode { sourceFileInput: string, checkpointOverlayActionInput: ApexExecutionOverlayAction ) { - super( - sourceFileInput + ':' + checkpointOverlayActionInput.Line, - TreeItemCollapsibleState.Expanded - ); + super(sourceFileInput + ':' + checkpointOverlayActionInput.Line, TreeItemCollapsibleState.Expanded); this.uri = uriInput; this.breakpointId = breapointIdInput; this.enabled = enabledInput; @@ -627,17 +486,11 @@ export class CheckpointNode extends BaseNode { this.actionObjectId = undefined; // Create the items that the user is going to be able to control (Type, Script, Iteration) - const cpASTNode = new CheckpointInfoActionScriptTypeNode( - this.checkpointOverlayAction - ); + const cpASTNode = new CheckpointInfoActionScriptTypeNode(this.checkpointOverlayAction); this.children.push(cpASTNode); - const cpScriptNode = new CheckpointInfoActionScriptNode( - this.checkpointOverlayAction - ); + const cpScriptNode = new CheckpointInfoActionScriptNode(this.checkpointOverlayAction); this.children.push(cpScriptNode); - const cpIterationNode = new CheckpointInfoIterationNode( - this.checkpointOverlayAction - ); + const cpIterationNode = new CheckpointInfoIterationNode(this.checkpointOverlayAction); this.children.push(cpIterationNode); } @@ -676,8 +529,7 @@ export class CheckpointNode extends BaseNode { this.enabled = enabledInput; this.uri = uriInput; this.checkpointOverlayAction.Line = checkpointOverlayActionInput.Line; - this.checkpointOverlayAction.IsDumpingHeap = - checkpointOverlayActionInput.IsDumpingHeap; + this.checkpointOverlayAction.IsDumpingHeap = checkpointOverlayActionInput.IsDumpingHeap; // Instead of just refreshing the node's overlay action, these functions // need to be called because some of the information is in their label // which needs to get updated @@ -696,9 +548,7 @@ export class CheckpointNode extends BaseNode { } } - private updateActionScriptType( - actionScriptTypeInput: ActionScriptEnum - ): void { + private updateActionScriptType(actionScriptTypeInput: ActionScriptEnum): void { for (const cpInfoNode of this.getChildren()) { if (cpInfoNode instanceof CheckpointInfoActionScriptTypeNode) { return cpInfoNode.updateActionScriptType(actionScriptTypeInput); @@ -753,9 +603,7 @@ export class CheckpointInfoNode extends BaseNode { export class CheckpointInfoActionScriptNode extends CheckpointInfoNode { private checkpointOverlayAction: ApexExecutionOverlayAction; constructor(cpOverlayActionInput: ApexExecutionOverlayAction) { - super( - EDITABLE_FIELD_LABEL_ACTION_SCRIPT + cpOverlayActionInput.ActionScript - ); + super(EDITABLE_FIELD_LABEL_ACTION_SCRIPT + cpOverlayActionInput.ActionScript); this.checkpointOverlayAction = cpOverlayActionInput; } public updateActionScript(actionScriptInput: string) { @@ -770,16 +618,12 @@ export class CheckpointInfoActionScriptNode extends CheckpointInfoNode { export class CheckpointInfoActionScriptTypeNode extends CheckpointInfoNode { private checkpointOverlayAction: ApexExecutionOverlayAction; constructor(cpOverlayActionInput: ApexExecutionOverlayAction) { - super( - EDITABLE_FIELD_LABEL_ACTION_SCRIPT_TYPE + - cpOverlayActionInput.ActionScriptType - ); + super(EDITABLE_FIELD_LABEL_ACTION_SCRIPT_TYPE + cpOverlayActionInput.ActionScriptType); this.checkpointOverlayAction = cpOverlayActionInput; } public updateActionScriptType(actionScriptTypeInput: ActionScriptEnum) { this.checkpointOverlayAction.ActionScriptType = actionScriptTypeInput; - this.label = - EDITABLE_FIELD_LABEL_ACTION_SCRIPT_TYPE + actionScriptTypeInput; + this.label = EDITABLE_FIELD_LABEL_ACTION_SCRIPT_TYPE + actionScriptTypeInput; } public getChildren(): BaseNode[] { return []; @@ -823,34 +667,18 @@ export const processBreakpointChangedForCheckpoints = async ( for (const bp of breakpointsChangedEvent.changed) { const breakpointId = bp.id; - if ( - bp.condition && - bp.condition.toLowerCase().indexOf(CHECKPOINT) >= 0 && - bp instanceof vscode.SourceBreakpoint - ) { + if (bp.condition && bp.condition.toLowerCase().indexOf(CHECKPOINT) >= 0 && bp instanceof vscode.SourceBreakpoint) { const checkpointOverlayAction = parseCheckpointInfoFromBreakpoint(bp); const uri = code2ProtocolConverter(bp.location.uri); const filename = uri.substring(uri.lastIndexOf('/') + 1); - const theNode = - checkpointService.returnCheckpointNodeIfAlreadyExists(breakpointId); + const theNode = checkpointService.returnCheckpointNodeIfAlreadyExists(breakpointId); await lock.acquire(CHECKPOINTS_LOCK_STRING, async () => { // If the node exists then update it if (theNode) { - theNode.updateCheckpoint( - bp.enabled, - uri, - filename, - checkpointOverlayAction - ); + theNode.updateCheckpoint(bp.enabled, uri, filename, checkpointOverlayAction); } else { // else if the node didn't exist then create it - checkpointService.createCheckpointNode( - breakpointId, - bp.enabled, - uri, - filename, - checkpointOverlayAction - ); + checkpointService.createCheckpointNode(breakpointId, bp.enabled, uri, filename, checkpointOverlayAction); } }); } else { @@ -862,31 +690,19 @@ export const processBreakpointChangedForCheckpoints = async ( } for (const bp of breakpointsChangedEvent.added) { - if ( - bp.condition && - bp.condition.toLowerCase().indexOf(CHECKPOINT) >= 0 && - bp instanceof vscode.SourceBreakpoint - ) { + if (bp.condition && bp.condition.toLowerCase().indexOf(CHECKPOINT) >= 0 && bp instanceof vscode.SourceBreakpoint) { await lock.acquire(CHECKPOINTS_LOCK_STRING, async () => { const breakpointId = bp.id; const checkpointOverlayAction = parseCheckpointInfoFromBreakpoint(bp); const uri = code2ProtocolConverter(bp.location.uri); const filename = uri.substring(uri.lastIndexOf('/') + 1); - checkpointService.createCheckpointNode( - breakpointId, - bp.enabled, - uri, - filename, - checkpointOverlayAction - ); + checkpointService.createCheckpointNode(breakpointId, bp.enabled, uri, filename, checkpointOverlayAction); }); } } }; -export const parseCheckpointInfoFromBreakpoint = ( - breakpoint: vscode.SourceBreakpoint -): ApexExecutionOverlayAction => { +export const parseCheckpointInfoFromBreakpoint = (breakpoint: vscode.SourceBreakpoint): ApexExecutionOverlayAction => { // declare the overlayAction with defaults const checkpointOverlayAction: ApexExecutionOverlayAction = { ActionScript: '', @@ -932,16 +748,10 @@ const setTypeRefsForEnabledCheckpoints = (): boolean => { checkpointUri, checkpointLine ); - writeToDebuggerOutputWindow( - errorMessage, - true, - VSCodeWindowTypeEnum.Error - ); + writeToDebuggerOutputWindow(errorMessage, true, VSCodeWindowTypeEnum.Error); everythingSet = false; } - const typeRef = breakpointUtil.getTopLevelTyperefForUri( - cpNode.getCheckpointUri() - ); + const typeRef = breakpointUtil.getTopLevelTyperefForUri(cpNode.getCheckpointUri()); cpNode.setCheckpointTypeRef(typeRef); } } @@ -971,11 +781,7 @@ let creatingCheckpoints = false; // checkpoints for user input SOQL or Apex. export const sfToggleCheckpoint = async () => { if (creatingCheckpoints) { - writeToDebuggerOutputWindow( - nls.localize('checkpoint_upload_in_progress'), - true, - VSCodeWindowTypeEnum.Warning - ); + writeToDebuggerOutputWindow(nls.localize('checkpoint_upload_in_progress'), true, VSCodeWindowTypeEnum.Warning); return; } const bpAdd: vscode.Breakpoint[] = []; @@ -1008,12 +814,7 @@ export const sfToggleCheckpoint = async () => { // Create a new checkpoint/breakpoint from scratch. const range = new vscode.Range(lineNumber, 0, lineNumber, 0); const location = new vscode.Location(uri, range); - const newBreakpoint = new vscode.SourceBreakpoint( - location, - true, - CHECKPOINT, - hitCondition - ); + const newBreakpoint = new vscode.SourceBreakpoint(location, true, CHECKPOINT, hitCondition); bpAdd.push(newBreakpoint); await vscode.debug.addBreakpoints(bpAdd); } @@ -1045,10 +846,7 @@ const fetchExistingBreakpointForUriAndLineNumber = ( if (bp instanceof vscode.SourceBreakpoint) { // Uri comparison doesn't work even if they're contain the same // information. toString both URIs - if ( - bp.location.uri.toString() === uriInput.toString() && - bp.location.range.start.line === lineInput - ) { + if (bp.location.uri.toString() === uriInput.toString() && bp.location.range.start.line === lineInput) { return bp; } } diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/src/channels/index.ts b/packages/salesforcedx-vscode-apex-replay-debugger/src/channels/index.ts index 7c26ab5b97..93996119ea 100644 --- a/packages/salesforcedx-vscode-apex-replay-debugger/src/channels/index.ts +++ b/packages/salesforcedx-vscode-apex-replay-debugger/src/channels/index.ts @@ -8,7 +8,5 @@ import { ChannelService } from '@salesforce/salesforcedx-utils-vscode'; import * as vscode from 'vscode'; import { nls } from '../messages'; -export const OUTPUT_CHANNEL = vscode.window.createOutputChannel( - nls.localize('channel_name') -); +export const OUTPUT_CHANNEL = vscode.window.createOutputChannel(nls.localize('channel_name')); export const channelService = new ChannelService(OUTPUT_CHANNEL); diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/src/commands/apexExecutionOverlayActionCommand.ts b/packages/salesforcedx-vscode-apex-replay-debugger/src/commands/apexExecutionOverlayActionCommand.ts index 0bcf219761..3422b3f0b2 100644 --- a/packages/salesforcedx-vscode-apex-replay-debugger/src/commands/apexExecutionOverlayActionCommand.ts +++ b/packages/salesforcedx-vscode-apex-replay-debugger/src/commands/apexExecutionOverlayActionCommand.ts @@ -26,11 +26,7 @@ export class ApexExecutionOverlayActionCommand extends BaseCommand { private readonly requestString: string | undefined; private readonly actionObjectId: string | undefined; - public constructor( - requestString?: string, - actionObjectId?: string, - queryString?: string - ) { + public constructor(requestString?: string, actionObjectId?: string, queryString?: string) { super(queryString); this.requestString = requestString; this.actionObjectId = actionObjectId; diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/src/commands/batchDeleteExistingOverlayActionsCommand.ts b/packages/salesforcedx-vscode-apex-replay-debugger/src/commands/batchDeleteExistingOverlayActionsCommand.ts index d51abc191a..95cb1c8f8b 100644 --- a/packages/salesforcedx-vscode-apex-replay-debugger/src/commands/batchDeleteExistingOverlayActionsCommand.ts +++ b/packages/salesforcedx-vscode-apex-replay-debugger/src/commands/batchDeleteExistingOverlayActionsCommand.ts @@ -6,10 +6,7 @@ */ import { COMPOSITE_BATCH_URL } from '@salesforce/salesforcedx-apex-replay-debugger/out/src/constants'; -import { - BaseCommand, - RestHttpMethodEnum -} from '@salesforce/salesforcedx-utils'; +import { BaseCommand, RestHttpMethodEnum } from '@salesforce/salesforcedx-utils'; export type BatchRequests = { batchRequests: BatchRequest[]; diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/src/commands/launchFromLogFile.ts b/packages/salesforcedx-vscode-apex-replay-debugger/src/commands/launchFromLogFile.ts index 8e3f53d190..a5c72057aa 100644 --- a/packages/salesforcedx-vscode-apex-replay-debugger/src/commands/launchFromLogFile.ts +++ b/packages/salesforcedx-vscode-apex-replay-debugger/src/commands/launchFromLogFile.ts @@ -8,15 +8,8 @@ import * as vscode from 'vscode'; import { DebugConfigurationProvider } from '../adapter/debugConfigurationProvider'; -export const launchFromLogFile = ( - logFile?: string, - stopOnEntry: boolean = true -) => { - if ( - !vscode.debug.activeDebugSession && - vscode.workspace.workspaceFolders && - vscode.workspace.workspaceFolders[0] - ) { +export const launchFromLogFile = (logFile?: string, stopOnEntry: boolean = true) => { + if (!vscode.debug.activeDebugSession && vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders[0]) { vscode.debug.startDebugging( vscode.workspace.workspaceFolders[0], DebugConfigurationProvider.getConfig(logFile, stopOnEntry) diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/src/commands/quickLaunch.ts b/packages/salesforcedx-vscode-apex-replay-debugger/src/commands/quickLaunch.ts index 6449fea221..4305a9c856 100644 --- a/packages/salesforcedx-vscode-apex-replay-debugger/src/commands/quickLaunch.ts +++ b/packages/salesforcedx-vscode-apex-replay-debugger/src/commands/quickLaunch.ts @@ -23,10 +23,7 @@ import { workspaceUtils } from '@salesforce/salesforcedx-utils-vscode'; import * as path from 'path'; -import { - checkpointService, - CheckpointService -} from '../breakpoints/checkpointService'; +import { checkpointService, CheckpointService } from '../breakpoints/checkpointService'; import { OUTPUT_CHANNEL } from '../channels'; import { workspaceContext } from '../context'; import { nls } from '../messages'; @@ -45,10 +42,7 @@ type LogFileRetrieveResult = { }; export class QuickLaunch { - public async debugTest( - testClass: string, - testName?: string - ): Promise { + public async debugTest(testClass: string, testName?: string): Promise { const connection = await workspaceContext.getConnection(); const traceFlags = new TraceFlags(connection); @@ -56,11 +50,9 @@ export class QuickLaunch { return false; } - const oneOrMoreCheckpoints = - checkpointService.hasOneOrMoreActiveCheckpoints(true); + const oneOrMoreCheckpoints = checkpointService.hasOneOrMoreActiveCheckpoints(true); if (oneOrMoreCheckpoints) { - const createCheckpointsResult = - await CheckpointService.sfCreateCheckpoints(); + const createCheckpointsResult = await CheckpointService.sfCreateCheckpoints(); if (!createCheckpointsResult) { return false; } @@ -69,10 +61,7 @@ export class QuickLaunch { const testResult = await this.runTests(connection, testClass, testName); if (testResult.success && testResult.logFileId) { - const logFileRetrieve = await this.retrieveLogFile( - connection, - testResult.logFileId - ); + const logFileRetrieve = await this.retrieveLogFile(connection, testResult.logFileId); if (logFileRetrieve.success && logFileRetrieve.filePath) { launchFromLogFile(logFileRetrieve.filePath, false); @@ -84,11 +73,7 @@ export class QuickLaunch { return false; } - private async runTests( - connection: Connection, - testClass: string, - testMethod?: string - ): Promise { + private async runTests(connection: Connection, testClass: string, testMethod?: string): Promise { const testService = new TestService(connection); try { const payload = await testService.buildSyncPayload( @@ -96,10 +81,7 @@ export class QuickLaunch { testMethod ? `${testClass}.${testMethod}` : undefined, testClass ); - const result: TestResult = (await testService.runTestSynchronous( - payload, - true - )) as TestResult; + const result: TestResult = (await testService.runTestSynchronous(payload, true)) as TestResult; if (workspaceUtils.hasRootWorkspace()) { const apexTestResultsPath = projectPaths.apexTestResultsFolder(); await testService.writeResultFiles( @@ -128,10 +110,7 @@ export class QuickLaunch { } } - private async retrieveLogFile( - connection: Connection, - logId: string - ): Promise { + private async retrieveLogFile(connection: Connection, logId: string): Promise { const logService = new LogService(connection); const outputDir = projectPaths.debugLogsFolder(); @@ -143,11 +122,7 @@ export class QuickLaunch { export class TestDebuggerExecutor extends LibraryCommandletExecutor { constructor() { - super( - nls.localize('debug_test_exec_name'), - 'debug_test_replay_debugger', - OUTPUT_CHANNEL - ); + super(nls.localize('debug_test_exec_name'), 'debug_test_replay_debugger', OUTPUT_CHANNEL); } public async run(response: ContinueResponse): Promise { @@ -164,10 +139,7 @@ export class TestDebuggerExecutor extends LibraryCommandletExecutor { } } -export const setupAndDebugTests = async ( - className: string, - methodName?: string -): Promise => { +export const setupAndDebugTests = async (className: string, methodName?: string): Promise => { const executor = new TestDebuggerExecutor(); const response = { type: 'CONTINUE', diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/src/index.ts b/packages/salesforcedx-vscode-apex-replay-debugger/src/index.ts index 53a6831a94..982b96b872 100644 --- a/packages/salesforcedx-vscode-apex-replay-debugger/src/index.ts +++ b/packages/salesforcedx-vscode-apex-replay-debugger/src/index.ts @@ -5,11 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - MetricError, - MetricGeneral, - MetricLaunch -} from '@salesforce/salesforcedx-apex-replay-debugger/out/src'; +import { MetricError, MetricGeneral, MetricLaunch } from '@salesforce/salesforcedx-apex-replay-debugger/out/src'; import { breakpointUtil } from '@salesforce/salesforcedx-apex-replay-debugger/out/src/breakpoints'; import { DEBUGGER_TYPE, @@ -46,28 +42,22 @@ export enum VSCodeWindowTypeEnum { Warning = 3 } -const salesforceCoreExtension = vscode.extensions.getExtension( - 'salesforce.salesforcedx-vscode-core' -); +const salesforceCoreExtension = vscode.extensions.getExtension('salesforce.salesforcedx-vscode-core'); const registerCommands = (): vscode.Disposable => { const dialogStartingPathUri = getDialogStartingPath(extContext); - const promptForLogCmd = vscode.commands.registerCommand( - 'extension.replay-debugger.getLogFileName', - async () => { - const fileUris: vscode.Uri[] | undefined = - await vscode.window.showOpenDialog({ - canSelectFiles: true, - canSelectFolders: false, - canSelectMany: false, - defaultUri: dialogStartingPathUri - }); - if (fileUris && fileUris.length === 1) { - updateLastOpened(extContext, fileUris[0].fsPath); - return fileUris[0].fsPath; - } + const promptForLogCmd = vscode.commands.registerCommand('extension.replay-debugger.getLogFileName', async () => { + const fileUris: vscode.Uri[] | undefined = await vscode.window.showOpenDialog({ + canSelectFiles: true, + canSelectFolders: false, + canSelectMany: false, + defaultUri: dialogStartingPathUri + }); + if (fileUris && fileUris.length === 1) { + updateLastOpened(extContext, fileUris[0].fsPath); + return fileUris[0].fsPath; } - ); + }); const launchFromLogFileCmd = vscode.commands.registerCommand( 'sf.launch.replay.debugger.logfile', (editorUri: vscode.Uri) => { @@ -95,23 +85,16 @@ const registerCommands = (): vscode.Disposable => { } ); - const launchFromLastLogFileCmd = vscode.commands.registerCommand( - 'sf.launch.replay.debugger.last.logfile', - () => { - const lastOpenedLog = - extContext.workspaceState.get(LAST_OPENED_LOG_KEY); - return launchFromLogFile(lastOpenedLog); - } - ); + const launchFromLastLogFileCmd = vscode.commands.registerCommand('sf.launch.replay.debugger.last.logfile', () => { + const lastOpenedLog = extContext.workspaceState.get(LAST_OPENED_LOG_KEY); + return launchFromLogFile(lastOpenedLog); + }); const sfCreateCheckpointsCmd = vscode.commands.registerCommand( 'sf.create.checkpoints', CheckpointService.sfCreateCheckpoints ); - const sfToggleCheckpointCmd = vscode.commands.registerCommand( - 'sf.toggle.checkpoint', - sfToggleCheckpoint - ); + const sfToggleCheckpointCmd = vscode.commands.registerCommand('sf.toggle.checkpoint', sfToggleCheckpoint); return vscode.Disposable.from( promptForLogCmd, @@ -123,20 +106,12 @@ const registerCommands = (): vscode.Disposable => { ); }; -export const updateLastOpened = ( - extensionContext: vscode.ExtensionContext, - logPath: string -) => { +export const updateLastOpened = (extensionContext: vscode.ExtensionContext, logPath: string) => { extensionContext.workspaceState.update(LAST_OPENED_LOG_KEY, logPath); - extensionContext.workspaceState.update( - LAST_OPENED_LOG_FOLDER_KEY, - path.dirname(logPath) - ); + extensionContext.workspaceState.update(LAST_OPENED_LOG_FOLDER_KEY, path.dirname(logPath)); }; -export const getDebuggerType = async ( - session: vscode.DebugSession -): Promise => { +export const getDebuggerType = async (session: vscode.DebugSession): Promise => { let type = session.type; if (type === LIVESHARE_DEBUGGER_TYPE) { type = await session.customRequest(LIVESHARE_DEBUG_TYPE_REQUEST); @@ -145,37 +120,29 @@ export const getDebuggerType = async ( }; const registerDebugHandlers = (): vscode.Disposable => { - const customEventHandler = vscode.debug.onDidReceiveDebugSessionCustomEvent( - async event => { - if (event && event.session) { - const type = await getDebuggerType(event.session); - if (type !== DEBUGGER_TYPE) { - return; - } + const customEventHandler = vscode.debug.onDidReceiveDebugSessionCustomEvent(async event => { + if (event && event.session) { + const type = await getDebuggerType(event.session); + if (type !== DEBUGGER_TYPE) { + return; + } - if (event.event === SEND_METRIC_LAUNCH_EVENT && event.body) { - const metricLaunchArgs = event.body as MetricLaunch; - telemetryService.sendLaunchEvent( - metricLaunchArgs.logSize.toString(), - metricLaunchArgs.error.subject - ); - } else if (event.event === SEND_METRIC_ERROR_EVENT && event.body) { - const metricErrorArgs = event.body as MetricError; - telemetryService.sendErrorEvent( - metricErrorArgs.subject, - metricErrorArgs.callstack - ); - } else if (event.event === SEND_METRIC_GENERAL_EVENT && event.body) { - const metricGeneralArgs = event.body as MetricGeneral; - telemetryService.sendGeneralEvent( - metricGeneralArgs.subject, - metricGeneralArgs.type, - metricGeneralArgs.qty?.toString() - ); - } + if (event.event === SEND_METRIC_LAUNCH_EVENT && event.body) { + const metricLaunchArgs = event.body as MetricLaunch; + telemetryService.sendLaunchEvent(metricLaunchArgs.logSize.toString(), metricLaunchArgs.error.subject); + } else if (event.event === SEND_METRIC_ERROR_EVENT && event.body) { + const metricErrorArgs = event.body as MetricError; + telemetryService.sendErrorEvent(metricErrorArgs.subject, metricErrorArgs.callstack); + } else if (event.event === SEND_METRIC_GENERAL_EVENT && event.body) { + const metricGeneralArgs = event.body as MetricGeneral; + telemetryService.sendGeneralEvent( + metricGeneralArgs.subject, + metricGeneralArgs.type, + metricGeneralArgs.qty?.toString() + ); } } - ); + }); return vscode.Disposable.from(customEventHandler); }; @@ -191,33 +158,22 @@ export const activate = async (extensionContext: vscode.ExtensionContext) => { 'apex-replay', new DebugConfigurationProvider() ); - const checkpointsView = vscode.window.registerTreeDataProvider( - 'sf.view.checkpoint', - checkpointService - ); - const breakpointsSub = vscode.debug.onDidChangeBreakpoints( - processBreakpointChangedForCheckpoints - ); + const checkpointsView = vscode.window.registerTreeDataProvider('sf.view.checkpoint', checkpointService); + const breakpointsSub = vscode.debug.onDidChangeBreakpoints(processBreakpointChangedForCheckpoints); // Workspace Context await workspaceContext.initialize(extensionContext); // Debug Tests command - const debugTests = vscode.commands.registerCommand( - 'sf.test.view.debugTests', - async test => { - await setupAndDebugTests(test.name); - } - ); + const debugTests = vscode.commands.registerCommand('sf.test.view.debugTests', async test => { + await setupAndDebugTests(test.name); + }); // Debug Single Test command - const debugTest = vscode.commands.registerCommand( - 'sf.test.view.debugSingleTest', - async test => { - const name = test.name.split('.'); - await setupAndDebugTests(name[0], name[1]); - } - ); + const debugTest = vscode.commands.registerCommand('sf.test.view.debugSingleTest', async test => { + const name = test.name.split('.'); + await setupAndDebugTests(name[0], name[1]); + }); extensionContext.subscriptions.push( commands, @@ -241,28 +197,13 @@ export const activate = async (extensionContext: vscode.ExtensionContext) => { }; export const retrieveLineBreakpointInfo = async (): Promise => { - const salesforceApexExtension = vscode.extensions.getExtension( - 'salesforce.salesforcedx-vscode-apex' - ); + const salesforceApexExtension = vscode.extensions.getExtension('salesforce.salesforcedx-vscode-apex'); if (salesforceApexExtension && salesforceApexExtension.exports) { let expired = false; let i = 0; - while ( - !salesforceApexExtension.exports.languageClientUtils - .getStatus() - .isReady() && - !expired - ) { - if ( - salesforceApexExtension.exports.languageClientUtils - .getStatus() - .failedToInitialize() - ) { - throw Error( - salesforceApexExtension.exports.languageClientUtils - .getStatus() - .getStatusMessage() - ); + while (!salesforceApexExtension.exports.languageClientUtils.getStatus().isReady() && !expired) { + if (salesforceApexExtension.exports.languageClientUtils.getStatus().failedToInitialize()) { + throw Error(salesforceApexExtension.exports.languageClientUtils.getStatus().getStatusMessage()); } await imposeSlightDelay(100); @@ -273,28 +214,17 @@ export const retrieveLineBreakpointInfo = async (): Promise => { } if (expired) { const errorMessage = nls.localize('language_client_not_ready'); - writeToDebuggerOutputWindow( - errorMessage, - true, - VSCodeWindowTypeEnum.Error - ); + writeToDebuggerOutputWindow(errorMessage, true, VSCodeWindowTypeEnum.Error); return false; } else { - const lineBpInfo = - await salesforceApexExtension.exports.getLineBreakpointInfo(); + const lineBpInfo = await salesforceApexExtension.exports.getLineBreakpointInfo(); if (lineBpInfo && lineBpInfo.length > 0) { console.log(nls.localize('line_breakpoint_information_success')); breakpointUtil.createMappingsFromLineBreakpointInfo(lineBpInfo); return true; } else { - const errorMessage = nls.localize( - 'no_line_breakpoint_information_for_current_project' - ); - writeToDebuggerOutputWindow( - errorMessage, - true, - VSCodeWindowTypeEnum.Error - ); + const errorMessage = nls.localize('no_line_breakpoint_information_for_current_project'); + writeToDebuggerOutputWindow(errorMessage, true, VSCodeWindowTypeEnum.Error); return true; } } diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/src/messages/i18n.ja.ts b/packages/salesforcedx-vscode-apex-replay-debugger/src/messages/i18n.ja.ts index f5b5b1f636..60b7ffde02 100644 --- a/packages/salesforcedx-vscode-apex-replay-debugger/src/messages/i18n.ja.ts +++ b/packages/salesforcedx-vscode-apex-replay-debugger/src/messages/i18n.ja.ts @@ -17,12 +17,10 @@ */ export const messages = { config_name_text: 'Apex Replay Debugger を起動', - session_language_server_error_text: - 'Apex 言語サーバは有効なブレークポイントに関する情報を提供できませんでした。', + session_language_server_error_text: 'Apex 言語サーバは有効なブレークポイントに関する情報を提供できませんでした。', up_to_five_checkpoints: '最大 5 つのうち、%s つのチェックポイントを設定しています。5 つ以下になるようチェックポイントを削除または無効化してください。', - no_enabled_checkpoints: - 'チェックポイントが 1 つも設定されていません。チェックポイントを設定し、再実行してください。', + no_enabled_checkpoints: 'チェックポイントが 1 つも設定されていません。チェックポイントを設定し、再実行してください。', checkpoints_can_only_be_on_valid_apex_source: 'チェックポイントApex ソースの有効な行に設定できます。無効なチェックポイントの位置 : URI=%s, 行=%s', local_source_is_out_of_sync_with_the_server: @@ -30,16 +28,11 @@ export const messages = { long_command_start: '開始しています', long_command_end: '終了しています', sf_update_checkpoints_in_org: 'SFDX: 組織のチェックポイントを更新', - checkpoint_creation_status_org_info: - 'ステップ 1/6: 組織の情報を取得しています。', - checkpoint_creation_status_source_line_info: - 'ステップ 2/6: ソースと行の情報を取得しています。', - checkpoint_creation_status_setting_typeref: - 'ステップ 3/6: チェックポイントに typeRef を設定しています。', - checkpoint_creation_status_clearing_existing_checkpoints: - 'ステップ 4/6: 既存のチェックポイントをクリアしています。', - checkpoint_creation_status_uploading_checkpoints: - 'ステップ 5/6: チェックポイントをアップロードしています。', + checkpoint_creation_status_org_info: 'ステップ 1/6: 組織の情報を取得しています。', + checkpoint_creation_status_source_line_info: 'ステップ 2/6: ソースと行の情報を取得しています。', + checkpoint_creation_status_setting_typeref: 'ステップ 3/6: チェックポイントに typeRef を設定しています。', + checkpoint_creation_status_clearing_existing_checkpoints: 'ステップ 4/6: 既存のチェックポイントをクリアしています。', + checkpoint_creation_status_uploading_checkpoints: 'ステップ 5/6: チェックポイントをアップロードしています。', checkpoint_creation_status_processing_complete_success: 'ステップ 6/6: チェックポイントが正常に作成されたことを確認しています。', checkpoint_upload_in_progress: @@ -47,21 +40,15 @@ export const messages = { checkpoint_upload_error_wrap_up_message: 'チェックポイントにはエラーがあります。出力されるエラーを修正し、%s を再度実行してください。', // These strings are going to be re-worked to become better, Salesforce appropriate, error messages. - cannot_determine_workspace: - 'ワークスペースのフォルダを特定できませんでした。', + cannot_determine_workspace: 'ワークスペースのフォルダを特定できませんでした。', cannot_delete_existing_checkpoint: '既存のチェックポイントを削除できません。', - unable_to_parse_checkpoint_query_result: - 'チェックポイントのクエリ結果をパースできませんでした。', - unable_to_retrieve_active_user_for_sf_project: - 'SFDX プロジェクトの有効なユーザを取得できませんでした。', - unable_to_query_for_existing_checkpoints: - '既存のチェックポイントをクエリできませんでした。', - unable_to_load_vscode_core_extension: - 'salesforce.salesforcedx-vscode-core の拡張機能を読み込めませんでした。', + unable_to_parse_checkpoint_query_result: 'チェックポイントのクエリ結果をパースできませんでした。', + unable_to_retrieve_active_user_for_sf_project: 'SFDX プロジェクトの有効なユーザを取得できませんでした。', + unable_to_query_for_existing_checkpoints: '既存のチェックポイントをクエリできませんでした。', + unable_to_load_vscode_core_extension: 'salesforce.salesforcedx-vscode-core の拡張機能を読み込めませんでした。', no_line_breakpoint_information_for_current_project: '現在のプロジェクトにはブレークポイントの情報を含む行がありません。', - line_breakpoint_information_success: - '言語サーバからブレークポイントの行を取得しました。', + line_breakpoint_information_success: '言語サーバからブレークポイントの行を取得しました。', language_client_not_ready: '言語サーバからブレークポイントの情報を取得できませんでした。言語サーバが起動していません。', unable_to_retrieve_org_info: 'OrgInfo を取得できませんでした。', @@ -69,7 +56,6 @@ export const messages = { 'デフォルトの組織が設定されていません。"SFDX: デフォルトのスクラッチ組織を作成" または "SFDX: 組織を認証" を実行し、デフォルトの組織を設定してください。', debug_test_exec_name: 'テストをデバッグ', debug_test_no_results_found: 'テスト結果が見つかりませんでした', - debug_test_no_debug_log: - 'テスト結果に関連するデバッグログが見つかりませんでした', + debug_test_no_debug_log: 'テスト結果に関連するデバッグログが見つかりませんでした', channel_name: 'Apex Replay デバッガ' }; diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/src/messages/i18n.ts b/packages/salesforcedx-vscode-apex-replay-debugger/src/messages/i18n.ts index d27f1e65e3..d8a07c3fea 100644 --- a/packages/salesforcedx-vscode-apex-replay-debugger/src/messages/i18n.ts +++ b/packages/salesforcedx-vscode-apex-replay-debugger/src/messages/i18n.ts @@ -17,12 +17,10 @@ */ export const messages = { config_name_text: 'Launch Apex Replay Debugger', - session_language_server_error_text: - 'Apex language server could not provide information about valid breakpoints.', + session_language_server_error_text: 'Apex language server could not provide information about valid breakpoints.', up_to_five_checkpoints: 'You have %s of the maximum 5 enabled checkpoints. Remove or disable checkpoints until 5 or fewer are active.', - no_enabled_checkpoints: - "You don't have any checkpoints enabled. Enable a checkpoint and try again.", + no_enabled_checkpoints: "You don't have any checkpoints enabled. Enable a checkpoint and try again.", checkpoints_can_only_be_on_valid_apex_source: 'Checkpoints can be set on a valid line of Apex source. Invalid checkpoint location: URI=%s, Line=%s', local_source_is_out_of_sync_with_the_server: @@ -30,40 +28,26 @@ export const messages = { long_command_start: 'Starting', long_command_end: 'Ending', sf_update_checkpoints_in_org: 'SFDX: Update Checkpoints in Org', - checkpoint_creation_status_org_info: - 'Step 1 of 6: Retrieving org information', - checkpoint_creation_status_source_line_info: - 'Step 2 of 6: Retrieving source and line information', - checkpoint_creation_status_setting_typeref: - 'Step 3 of 6: Setting typeRefs for checkpoints', - checkpoint_creation_status_clearing_existing_checkpoints: - 'Step 4 of 6: Clearing existing checkpoints', - checkpoint_creation_status_uploading_checkpoints: - 'Step 5 of 6: Uploading checkpoints', - checkpoint_creation_status_processing_complete_success: - 'Step 6 of 6: Confirming successful checkpoint creation', + checkpoint_creation_status_org_info: 'Step 1 of 6: Retrieving org information', + checkpoint_creation_status_source_line_info: 'Step 2 of 6: Retrieving source and line information', + checkpoint_creation_status_setting_typeref: 'Step 3 of 6: Setting typeRefs for checkpoints', + checkpoint_creation_status_clearing_existing_checkpoints: 'Step 4 of 6: Clearing existing checkpoints', + checkpoint_creation_status_uploading_checkpoints: 'Step 5 of 6: Uploading checkpoints', + checkpoint_creation_status_processing_complete_success: 'Step 6 of 6: Confirming successful checkpoint creation', checkpoint_upload_in_progress: 'A checkpoint update is currently in progress for your org. Wait for the update to complete before you add or remove checkpoints.', checkpoint_upload_error_wrap_up_message: 'Your checkpoints have errors. Fix the errors listed in the output, then run %s again.', // These strings are going to be re-worked to become better, Salesforce appropriate, error messages. - cannot_determine_workspace: - 'Unable to determine workspace folders for workspace', + cannot_determine_workspace: 'Unable to determine workspace folders for workspace', cannot_delete_existing_checkpoint: 'Cannot delete existing checkpoint', - unable_to_parse_checkpoint_query_result: - 'Unable to parse checkpoint query result', - unable_to_retrieve_active_user_for_sf_project: - 'Unable to retrieve active user for SFDX Project', - unable_to_query_for_existing_checkpoints: - 'Unable to query for existing checkpoints', - unable_to_load_vscode_core_extension: - 'unable to load salesforce.salesforcedx-vscode-core extension', - no_line_breakpoint_information_for_current_project: - 'There is no line breakpoint information for the current project', - line_breakpoint_information_success: - 'Retrieved line breakpoint info from language server', - language_client_not_ready: - 'Unable to retrieve breakpoint info from language server, language server is not ready', + unable_to_parse_checkpoint_query_result: 'Unable to parse checkpoint query result', + unable_to_retrieve_active_user_for_sf_project: 'Unable to retrieve active user for SFDX Project', + unable_to_query_for_existing_checkpoints: 'Unable to query for existing checkpoints', + unable_to_load_vscode_core_extension: 'unable to load salesforce.salesforcedx-vscode-core extension', + no_line_breakpoint_information_for_current_project: 'There is no line breakpoint information for the current project', + line_breakpoint_information_success: 'Retrieved line breakpoint info from language server', + language_client_not_ready: 'Unable to retrieve breakpoint info from language server, language server is not ready', unable_to_retrieve_org_info: 'Unable to retrieve OrgInfo', error_no_target_org: 'No default org is set. Run "SFDX: Create a Default Scratch Org" or "SFDX: Authorize an Org" to set one.', diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/src/messages/index.ts b/packages/salesforcedx-vscode-apex-replay-debugger/src/messages/index.ts index 6c7ae9dc7c..4ef06d8265 100644 --- a/packages/salesforcedx-vscode-apex-replay-debugger/src/messages/index.ts +++ b/packages/salesforcedx-vscode-apex-replay-debugger/src/messages/index.ts @@ -5,13 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - Config, - DEFAULT_LOCALE, - LOCALE_JA, - Localization, - Message -} from '@salesforce/salesforcedx-utils'; +import { Config, DEFAULT_LOCALE, LOCALE_JA, Localization, Message } from '@salesforce/salesforcedx-utils'; import { messages as enMessages } from './i18n'; import { messages as jaMessages } from './i18n.ja'; @@ -35,9 +29,5 @@ const loadMessageBundle = (config?: Config): Message => { }; export const nls = new Localization( - loadMessageBundle( - process.env.VSCODE_NLS_CONFIG - ? JSON.parse(process.env.VSCODE_NLS_CONFIG!) - : undefined - ) + loadMessageBundle(process.env.VSCODE_NLS_CONFIG ? JSON.parse(process.env.VSCODE_NLS_CONFIG!) : undefined) ); diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/src/telemetry/telemetry.ts b/packages/salesforcedx-vscode-apex-replay-debugger/src/telemetry/telemetry.ts index 4342313bc1..9cd57c597c 100644 --- a/packages/salesforcedx-vscode-apex-replay-debugger/src/telemetry/telemetry.ts +++ b/packages/salesforcedx-vscode-apex-replay-debugger/src/telemetry/telemetry.ts @@ -26,10 +26,7 @@ export class TelemetryService { return TelemetryService.instance; } - public initializeService( - reporters: TelemetryReporter[], - isTelemetryEnabled: boolean - ): void { + public initializeService(reporters: TelemetryReporter[], isTelemetryEnabled: boolean): void { this.isTelemetryEnabled = isTelemetryEnabled; this.reporters = reporters; } diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/test/.eslintrc.json b/packages/salesforcedx-vscode-apex-replay-debugger/test/.eslintrc.json deleted file mode 100644 index f2b99a417d..0000000000 --- a/packages/salesforcedx-vscode-apex-replay-debugger/test/.eslintrc.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": [ - "../.eslintrc.json", - "../../../config/common-test-lint-rules.json" - ] -} diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/test/jest/activation/getDialogStartingPath.test.ts b/packages/salesforcedx-vscode-apex-replay-debugger/test/jest/activation/getDialogStartingPath.test.ts index b7177a8302..6a3439eba8 100644 --- a/packages/salesforcedx-vscode-apex-replay-debugger/test/jest/activation/getDialogStartingPath.test.ts +++ b/packages/salesforcedx-vscode-apex-replay-debugger/test/jest/activation/getDialogStartingPath.test.ts @@ -6,10 +6,7 @@ */ import { LAST_OPENED_LOG_FOLDER_KEY } from '@salesforce/salesforcedx-apex-replay-debugger/src'; -import { - projectPaths, - workspaceUtils -} from '@salesforce/salesforcedx-utils-vscode'; +import { projectPaths, workspaceUtils } from '@salesforce/salesforcedx-utils-vscode'; import * as fs from 'fs'; import * as vscode from 'vscode'; import { getDialogStartingPath } from '../../../src/activation/getDialogStartingPath'; @@ -67,9 +64,7 @@ describe('getDialogStartingPath', () => { expect(mockGet).toHaveBeenCalledWith(LAST_OPENED_LOG_FOLDER_KEY); expect(pathExistsMock).toHaveBeenCalledWith(fakePathToDebugLogsFolder); expect(vsCodeUriMock).toHaveBeenCalledWith(fakePathToDebugLogsFolder); - expect((dialogStartingPathUri as vscode.Uri).path).toEqual( - fakePathToDebugLogsFolder - ); + expect((dialogStartingPathUri as vscode.Uri).path).toEqual(fakePathToDebugLogsFolder); }); it('Should return state folder as fallback when project log folder not present', async () => { @@ -91,9 +86,7 @@ describe('getDialogStartingPath', () => { expect(mockGet).toHaveBeenCalledWith(LAST_OPENED_LOG_FOLDER_KEY); expect(pathExistsMock).toHaveBeenCalledWith(fakePathToDebugLogsFolder); expect(vsCodeUriMock).toHaveBeenCalledWith(fakePathToStateFolder); - expect((dialogStartingPathUri as vscode.Uri).path).toEqual( - fakePathToStateFolder - ); + expect((dialogStartingPathUri as vscode.Uri).path).toEqual(fakePathToStateFolder); }); it('Should return undefined when not in a project workspace', async () => { diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/adapter/debugConfigurationProvider.test.ts b/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/adapter/debugConfigurationProvider.test.ts index a185003514..03ca2d266a 100644 --- a/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/adapter/debugConfigurationProvider.test.ts +++ b/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/adapter/debugConfigurationProvider.test.ts @@ -13,13 +13,7 @@ import { } from '@salesforce/salesforcedx-apex-replay-debugger/out/src/constants'; import { expect } from 'chai'; import * as sinon from 'sinon'; -import { - DebugConfiguration, - ExtensionContext, - extensions, - Uri, - WorkspaceFolder -} from 'vscode'; +import { DebugConfiguration, ExtensionContext, extensions, Uri, WorkspaceFolder } from 'vscode'; import { DebugConfigurationProvider } from '../../../src/adapter/debugConfigurationProvider'; import { updateLastOpened } from '../../../src/index'; import { nls } from '../../../src/messages'; @@ -40,9 +34,7 @@ describe('Configuration provider', () => { beforeEach(() => { getConfigSpy = sinon.spy(DebugConfigurationProvider, 'getConfig'); - mockApexExtension = sinon - .stub(extensions, 'getExtension') - .returns(new MockApexExtension()); + mockApexExtension = sinon.stub(extensions, 'getExtension').returns(new MockApexExtension()); provider = new DebugConfigurationProvider(); }); @@ -99,9 +91,7 @@ describe('Configuration provider', () => { expect(config.lineBreakpointInfo).to.not.equals(undefined); expect(mockApexExtension.calledOnce).to.be.true; } else { - expect.fail( - 'Did not get configuration information from resolveDebugConfiguration' - ); + expect.fail('Did not get configuration information from resolveDebugConfiguration'); } }); @@ -126,9 +116,7 @@ describe('Configuration provider', () => { expect(config.lineBreakpointInfo).to.not.equals(undefined); expect(mockApexExtension.calledOnce).to.be.true; } else { - expect.fail( - 'Did not get configuration information from resolveDebugConfiguration' - ); + expect.fail('Did not get configuration information from resolveDebugConfiguration'); } }); }); @@ -146,17 +134,8 @@ describe('extension context log path tests', () => { }; it('Should update the extension context', () => { - updateLastOpened( - (mContext as any) as ExtensionContext, - '/foo/bar/logfilename.log' - ); - expect(mementoKeys).to.have.same.members([ - `${LAST_OPENED_LOG_KEY}`, - `${LAST_OPENED_LOG_FOLDER_KEY}` - ]); - expect(mementoValues).to.have.same.members([ - '/foo/bar/logfilename.log', - '/foo/bar' - ]); + updateLastOpened(mContext as any as ExtensionContext, '/foo/bar/logfilename.log'); + expect(mementoKeys).to.have.same.members([`${LAST_OPENED_LOG_KEY}`, `${LAST_OPENED_LOG_FOLDER_KEY}`]); + expect(mementoValues).to.have.same.members(['/foo/bar/logfilename.log', '/foo/bar']); }); }); diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/checkpoints/checkpointService.test.ts b/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/checkpoints/checkpointService.test.ts index 75fca4c47f..588128bd80 100644 --- a/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/checkpoints/checkpointService.test.ts +++ b/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/checkpoints/checkpointService.test.ts @@ -6,10 +6,7 @@ */ import { ActionScriptEnum } from '@salesforce/salesforcedx-apex-replay-debugger/out/src/commands'; -import { - CHECKPOINT, - CHECKPOINTS_LOCK_STRING -} from '@salesforce/salesforcedx-apex-replay-debugger/out/src/constants'; +import { CHECKPOINT, CHECKPOINTS_LOCK_STRING } from '@salesforce/salesforcedx-apex-replay-debugger/out/src/constants'; import * as AsyncLock from 'async-lock'; import { assert, expect } from 'chai'; import * as sinon from 'sinon'; @@ -193,12 +190,7 @@ describe('Verify checkpoint callback for vscode.debug.onDidChangeBreakpoints', ( const range = new vscode.Range(lineInput - 1, 0, lineInput - 1, 0); const uri = vscode.Uri.parse(uriInput); const location = new vscode.Location(uri, range); - const breakpoint = new vscode.SourceBreakpoint( - location, - true, - CHECKPOINT, - undefined - ); + const breakpoint = new vscode.SourceBreakpoint(location, true, CHECKPOINT, undefined); bpAdd.push(breakpoint); await processBreakpointChangedForCheckpoints({ added: bpAdd, @@ -207,13 +199,9 @@ describe('Verify checkpoint callback for vscode.debug.onDidChangeBreakpoints', ( }); // Verify that a single checkpoint has been added to the checkpoint service - const theNode = checkpointService.returnCheckpointNodeIfAlreadyExists( - breakpoint.id - ); + const theNode = checkpointService.returnCheckpointNodeIfAlreadyExists(breakpoint.id); if (!theNode) { - assert.fail( - 'Should have created a single node in the checkpointService and did not.' - ); + assert.fail('Should have created a single node in the checkpointService and did not.'); } expect(lockSpy.calledOnce).to.equal(true); expect(lockSpy.getCall(0).args[0]).to.equal(CHECKPOINTS_LOCK_STRING); @@ -225,20 +213,10 @@ describe('Verify checkpoint callback for vscode.debug.onDidChangeBreakpoints', ( const range = new vscode.Range(lineInput - 1, 0, lineInput - 1, 0); const uri = vscode.Uri.parse(uriInput); const location = new vscode.Location(uri, range); - const breakpoint1 = new vscode.SourceBreakpoint( - location, - true, - CHECKPOINT, - undefined - ); + const breakpoint1 = new vscode.SourceBreakpoint(location, true, CHECKPOINT, undefined); bpAdd.push(breakpoint1); - const breakpoint2 = new vscode.SourceBreakpoint( - location, - true, - CHECKPOINT, - undefined - ); + const breakpoint2 = new vscode.SourceBreakpoint(location, true, CHECKPOINT, undefined); bpAdd.push(breakpoint2); @@ -249,24 +227,14 @@ describe('Verify checkpoint callback for vscode.debug.onDidChangeBreakpoints', ( }); // Verify that a single checkpoint has been added to the checkpoint service - const theNode1 = checkpointService.returnCheckpointNodeIfAlreadyExists( - breakpoint1.id - ); + const theNode1 = checkpointService.returnCheckpointNodeIfAlreadyExists(breakpoint1.id); if (!theNode1) { - assert.fail( - 'Should have created a node in the checkpointService with id: ' + - breakpoint1.id - ); + assert.fail('Should have created a node in the checkpointService with id: ' + breakpoint1.id); } - const theNode2 = checkpointService.returnCheckpointNodeIfAlreadyExists( - breakpoint2.id - ); + const theNode2 = checkpointService.returnCheckpointNodeIfAlreadyExists(breakpoint2.id); if (!theNode2) { - assert.fail( - 'Should have created a node in the checkpointService with id: ' + - breakpoint1.id - ); + assert.fail('Should have created a node in the checkpointService with id: ' + breakpoint1.id); } expect(lockSpy.calledTwice).to.equal(true); expect(lockSpy.getCall(0).args[0]).to.equal(CHECKPOINTS_LOCK_STRING); @@ -277,12 +245,7 @@ describe('Verify checkpoint callback for vscode.debug.onDidChangeBreakpoints', ( const range = new vscode.Range(lineInput - 1, 0, lineInput - 1, 0); const uri = vscode.Uri.parse(uriInput); const location = new vscode.Location(uri, range); - const breakpoint = new vscode.SourceBreakpoint( - location, - true, - CHECKPOINT, - undefined - ); + const breakpoint = new vscode.SourceBreakpoint(location, true, CHECKPOINT, undefined); bpAdd.push(breakpoint); await processBreakpointChangedForCheckpoints({ @@ -292,13 +255,9 @@ describe('Verify checkpoint callback for vscode.debug.onDidChangeBreakpoints', ( }); // Verify that a single checkpoint has been added to the checkpoint service - const theNode = checkpointService.returnCheckpointNodeIfAlreadyExists( - breakpoint.id - ); + const theNode = checkpointService.returnCheckpointNodeIfAlreadyExists(breakpoint.id); if (!theNode) { - assert.fail( - 'Should have created a single node in the checkpointService and did not.' - ); + assert.fail('Should have created a single node in the checkpointService and did not.'); } // Add the breakpoint to the removal list @@ -309,9 +268,7 @@ describe('Verify checkpoint callback for vscode.debug.onDidChangeBreakpoints', ( changed: bpChange }); - const deletedNote = checkpointService.returnCheckpointNodeIfAlreadyExists( - breakpoint.id - ); + const deletedNote = checkpointService.returnCheckpointNodeIfAlreadyExists(breakpoint.id); // The node should be undefined as it was deleted if (deletedNote) { assert.fail('Should have removed the checkpoint node and did not.'); @@ -326,12 +283,7 @@ describe('Verify checkpoint callback for vscode.debug.onDidChangeBreakpoints', ( const range = new vscode.Range(lineInput - 1, 0, lineInput - 1, 0); const uri = vscode.Uri.parse(uriInput); const location = new vscode.Location(uri, range); - const breakpoint = new vscode.SourceBreakpoint( - location, - true, - CHECKPOINT, - undefined - ); + const breakpoint = new vscode.SourceBreakpoint(location, true, CHECKPOINT, undefined); bpAdd.push(breakpoint); await processBreakpointChangedForCheckpoints({ @@ -341,9 +293,7 @@ describe('Verify checkpoint callback for vscode.debug.onDidChangeBreakpoints', ( }); // The first breakpoint should have no ActionScript or ActionScriptType - let theNode = checkpointService.returnCheckpointNodeIfAlreadyExists( - breakpoint.id - ); + let theNode = checkpointService.returnCheckpointNodeIfAlreadyExists(breakpoint.id); if (theNode) { expect(theNode.getActionScriptType()).to.be.equal(ActionScriptEnum.None); expect(theNode.getActionScript()).to.be.equal(''); @@ -361,9 +311,7 @@ describe('Verify checkpoint callback for vscode.debug.onDidChangeBreakpoints', ( changed: bpChange }); - theNode = checkpointService.returnCheckpointNodeIfAlreadyExists( - breakpoint.id - ); + theNode = checkpointService.returnCheckpointNodeIfAlreadyExists(breakpoint.id); if (theNode) { expect(theNode.getActionScriptType()).to.be.equal(ActionScriptEnum.Apex); expect(theNode.getActionScript()).to.be.equal(apexLogMessage); @@ -382,9 +330,7 @@ describe('Verify checkpoint callback for vscode.debug.onDidChangeBreakpoints', ( changed: bpChange }); - theNode = checkpointService.returnCheckpointNodeIfAlreadyExists( - breakpoint.id - ); + theNode = checkpointService.returnCheckpointNodeIfAlreadyExists(breakpoint.id); if (theNode) { expect(theNode.getActionScriptType()).to.be.equal(ActionScriptEnum.SOQL); expect(theNode.getActionScript()).to.be.equal(soqlLogMessage); @@ -417,12 +363,7 @@ describe('Checkpoint parsing from SourceBreakpoint', () => { const range = new vscode.Range(lineInput - 1, 0, lineInput - 1, 0); const uri = vscode.Uri.parse(uriInput); const location = new vscode.Location(uri, range); - const breakpoint = new vscode.SourceBreakpoint( - location, - true, - CHECKPOINT, - undefined - ); + const breakpoint = new vscode.SourceBreakpoint(location, true, CHECKPOINT, undefined); const overlayAction = parseCheckpointInfoFromBreakpoint(breakpoint); expect(overlayAction.ActionScript).to.be.equal(''); expect(overlayAction.ActionScriptType).to.be.equal(ActionScriptEnum.None); @@ -437,12 +378,7 @@ describe('Checkpoint parsing from SourceBreakpoint', () => { const range = new vscode.Range(lineInput - 1, 0, lineInput - 1, 0); const uri = vscode.Uri.parse(uriInput); const location = new vscode.Location(uri, range); - const breakpoint = new vscode.SourceBreakpoint( - location, - true, - CHECKPOINT, - '3' - ); + const breakpoint = new vscode.SourceBreakpoint(location, true, CHECKPOINT, '3'); const overlayAction = parseCheckpointInfoFromBreakpoint(breakpoint); expect(overlayAction.ActionScript).to.be.equal(''); expect(overlayAction.ActionScriptType).to.be.equal(ActionScriptEnum.None); @@ -457,12 +393,7 @@ describe('Checkpoint parsing from SourceBreakpoint', () => { const range = new vscode.Range(lineInput - 1, 0, lineInput - 1, 0); const uri = vscode.Uri.parse(uriInput); const location = new vscode.Location(uri, range); - const breakpoint = new vscode.SourceBreakpoint( - location, - true, - CHECKPOINT, - undefined - ); + const breakpoint = new vscode.SourceBreakpoint(location, true, CHECKPOINT, undefined); const logMessage = 'select something from something'; (breakpoint as any).logMessage = logMessage; const overlayAction = parseCheckpointInfoFromBreakpoint(breakpoint); @@ -479,12 +410,7 @@ describe('Checkpoint parsing from SourceBreakpoint', () => { const range = new vscode.Range(lineInput - 1, 0, lineInput - 1, 0); const uri = vscode.Uri.parse(uriInput); const location = new vscode.Location(uri, range); - const breakpoint = new vscode.SourceBreakpoint( - location, - true, - CHECKPOINT, - undefined - ); + const breakpoint = new vscode.SourceBreakpoint(location, true, CHECKPOINT, undefined); const logMessage = 'SomeApexClass.SomeApexStaticFunction()'; (breakpoint as any).logMessage = logMessage; const overlayAction = parseCheckpointInfoFromBreakpoint(breakpoint); @@ -511,9 +437,7 @@ describe('Verify SFDX Toggle Checkpoint callback, sfToggleCheckpoint', () => { beforeEach(() => { // These need to be stubbed in order to not require an open file in an active editor with a selection. - fetchActiveEditorUriStub = sinon - .stub(checkpointUtils, 'fetchActiveEditorUri') - .returns(uriInput); + fetchActiveEditorUriStub = sinon.stub(checkpointUtils, 'fetchActiveEditorUri').returns(uriInput); fetchActiveSelectionLineNumberStub = sinon .stub(checkpointUtils, 'fetchActiveSelectionLineNumber') .returns(lineInput - 1); @@ -542,28 +466,17 @@ describe('Verify SFDX Toggle Checkpoint callback, sfToggleCheckpoint', () => { bpArr = addBreakpointsStub.getCall(0).args[0]; expect(bpArr.length).to.be.equal(1); // The condition in the add should be a checkpoint - expect((bpArr[0] as vscode.SourceBreakpoint).condition).to.be.equal( - CHECKPOINT - ); + expect((bpArr[0] as vscode.SourceBreakpoint).condition).to.be.equal(CHECKPOINT); // Verify the uri/line information - expect( - (bpArr[0] as vscode.SourceBreakpoint).location.uri.toString() - ).to.be.equal(uriInput.toString()); - expect( - (bpArr[0] as vscode.SourceBreakpoint).location.range.start.line - ).to.be.equal(lineInput - 1); + expect((bpArr[0] as vscode.SourceBreakpoint).location.uri.toString()).to.be.equal(uriInput.toString()); + expect((bpArr[0] as vscode.SourceBreakpoint).location.range.start.line).to.be.equal(lineInput - 1); }); it('Toggle an existing non-checkpoint breakpoint recreates the breakpoint as a checkopint breakpoint', async () => { // create a non-checkpoint breakpoint which will be the existing breakpoint const range = new vscode.Range(lineInput - 1, 0, lineInput - 1, 0); const location = new vscode.Location(uriInput, range); - const breakpoint = new vscode.SourceBreakpoint( - location, - breakpointEnabled, - undefined, - undefined - ); + const breakpoint = new vscode.SourceBreakpoint(location, breakpointEnabled, undefined, undefined); // This is necessary to add an existing breakpoint to find bpAdd.push(breakpoint); await vscode.debug.addBreakpoints(bpAdd); @@ -577,25 +490,17 @@ describe('Verify SFDX Toggle Checkpoint callback, sfToggleCheckpoint', () => { expect(removeBreakpointsStub.calledOnce).to.be.equal(true); bpArr = removeBreakpointsStub.getCall(0).args[0]; expect(bpArr.length).to.be.equal(1); - expect( - breakpointsHaveSameUriAndSourceLine(breakpoint, bpArr[0]) - ).to.be.equal(true); + expect(breakpointsHaveSameUriAndSourceLine(breakpoint, bpArr[0])).to.be.equal(true); // The condition in the remove should be undefined - expect((bpArr[0] as vscode.SourceBreakpoint).condition).to.be.equal( - undefined - ); + expect((bpArr[0] as vscode.SourceBreakpoint).condition).to.be.equal(undefined); // Verify the add arguments which should be the same expect(addBreakpointsStub.calledOnce).to.be.equal(true); bpArr = addBreakpointsStub.getCall(0).args[0]; expect(bpArr.length).to.be.equal(1); - expect( - breakpointsHaveSameUriAndSourceLine(breakpoint, bpArr[0]) - ).to.be.equal(true); + expect(breakpointsHaveSameUriAndSourceLine(breakpoint, bpArr[0])).to.be.equal(true); // The condition in the add should be a checkpoint - expect((bpArr[0] as vscode.SourceBreakpoint).condition).to.be.equal( - CHECKPOINT - ); + expect((bpArr[0] as vscode.SourceBreakpoint).condition).to.be.equal(CHECKPOINT); }); it('Toggling an existing non-checkpoint breakpoint only keeps the hitCondition', async () => { @@ -603,12 +508,7 @@ describe('Verify SFDX Toggle Checkpoint callback, sfToggleCheckpoint', () => { const range = new vscode.Range(lineInput - 1, 0, lineInput - 1, 0); const location = new vscode.Location(uriInput, range); const hitCondition = '4'; - const breakpoint = new vscode.SourceBreakpoint( - location, - breakpointEnabled, - undefined, - hitCondition - ); + const breakpoint = new vscode.SourceBreakpoint(location, breakpointEnabled, undefined, hitCondition); bpAdd.push(breakpoint); await vscode.debug.addBreakpoints(bpAdd); @@ -621,25 +521,17 @@ describe('Verify SFDX Toggle Checkpoint callback, sfToggleCheckpoint', () => { expect(removeBreakpointsStub.calledOnce).to.be.equal(true); bpArr = removeBreakpointsStub.getCall(0).args[0]; expect(bpArr.length).to.be.equal(1); - expect( - breakpointsHaveSameUriAndSourceLine(breakpoint, bpArr[0]) - ).to.be.equal(true); + expect(breakpointsHaveSameUriAndSourceLine(breakpoint, bpArr[0])).to.be.equal(true); // The condition in the remove should be undefined - expect((bpArr[0] as vscode.SourceBreakpoint).condition).to.be.equal( - undefined - ); + expect((bpArr[0] as vscode.SourceBreakpoint).condition).to.be.equal(undefined); // Verify the add arguments which should be the same expect(addBreakpointsStub.calledOnce).to.be.equal(true); bpArr = addBreakpointsStub.getCall(0).args[0]; expect(bpArr.length).to.be.equal(1); - expect( - breakpointsHaveSameUriAndSourceLine(breakpoint, bpArr[0]) - ).to.be.equal(true); + expect(breakpointsHaveSameUriAndSourceLine(breakpoint, bpArr[0])).to.be.equal(true); // The condition in the add should be a checkpoint - expect((bpArr[0] as vscode.SourceBreakpoint).condition).to.be.equal( - CHECKPOINT - ); + expect((bpArr[0] as vscode.SourceBreakpoint).condition).to.be.equal(CHECKPOINT); expect(bpArr[0].hitCondition).to.be.equal(hitCondition); expect(bpArr[0].logMessage).to.be.equal(undefined); expect(bpArr[0].enabled).to.be.equal(true); @@ -649,12 +541,7 @@ describe('Verify SFDX Toggle Checkpoint callback, sfToggleCheckpoint', () => { // create a checkpoint breakpoint to remove const range = new vscode.Range(lineInput - 1, 0, lineInput - 1, 0); const location = new vscode.Location(uriInput, range); - const breakpoint = new vscode.SourceBreakpoint( - location, - breakpointEnabled, - CHECKPOINT, - undefined - ); + const breakpoint = new vscode.SourceBreakpoint(location, breakpointEnabled, CHECKPOINT, undefined); // This is necessary to add an existing breakpoint to find bpAdd.push(breakpoint); await vscode.debug.addBreakpoints(bpAdd); @@ -670,25 +557,15 @@ describe('Verify SFDX Toggle Checkpoint callback, sfToggleCheckpoint', () => { expect(removeBreakpointsStub.calledOnce).to.be.equal(true); bpArr = removeBreakpointsStub.getCall(0).args[0]; expect(bpArr.length).to.be.equal(1); - expect( - breakpointsHaveSameUriAndSourceLine(breakpoint, bpArr[0]) - ).to.be.equal(true); + expect(breakpointsHaveSameUriAndSourceLine(breakpoint, bpArr[0])).to.be.equal(true); // The condition in the remove should be undefined - expect((bpArr[0] as vscode.SourceBreakpoint).condition).to.be.equal( - CHECKPOINT - ); + expect((bpArr[0] as vscode.SourceBreakpoint).condition).to.be.equal(CHECKPOINT); }); }); -const breakpointsHaveSameUriAndSourceLine = ( - bp1: vscode.Breakpoint, - bp2: vscode.Breakpoint -): boolean => { +const breakpointsHaveSameUriAndSourceLine = (bp1: vscode.Breakpoint, bp2: vscode.Breakpoint): boolean => { // both breakpoints are source breakpoints - if ( - bp1 instanceof vscode.SourceBreakpoint && - bp2 instanceof vscode.SourceBreakpoint - ) { + if (bp1 instanceof vscode.SourceBreakpoint && bp2 instanceof vscode.SourceBreakpoint) { // effectively, the breakpoints are equal of the uri and source lines match if ( bp1.location.uri.toString() === bp2.location.uri.toString() && @@ -712,9 +589,7 @@ const clearOutCheckpoints = () => { // array of BaseNode and if we want to get at the methods on an actual // CheckpointNode we have to do verify the instance. if (checkpoint instanceof CheckpointNode) { - checkpointService.deleteCheckpointNodeIfExists( - checkpoint.getBreakpointId() - ); + checkpointService.deleteCheckpointNodeIfExists(checkpoint.getBreakpointId()); } } }; diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/commands/apexExecutionOverlayActionCommand.test.ts b/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/commands/apexExecutionOverlayActionCommand.test.ts index afd8b0ef85..fe2a040d2c 100644 --- a/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/commands/apexExecutionOverlayActionCommand.test.ts +++ b/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/commands/apexExecutionOverlayActionCommand.test.ts @@ -40,13 +40,9 @@ describe('ApexExecutionOverlayAction basic class tests', () => { }); it('Should should create requestUrl with actionId on the API Path ', async () => { - overlayActionCommand = new ApexExecutionOverlayActionCommand( - requestString, - actionObjectId - ); + overlayActionCommand = new ApexExecutionOverlayActionCommand(requestString, actionObjectId); expect(overlayActionCommand.getCommandUrl()).to.equal( - 'services/data/v43.0/tooling/sobjects/ApexExecutionOverlayAction/' + - actionObjectId + 'services/data/v43.0/tooling/sobjects/ApexExecutionOverlayAction/' + actionObjectId ); expect(overlayActionCommand.getQueryString()).to.equal(undefined); expect(overlayActionCommand.getRequest()).to.equal(requestString); @@ -59,18 +55,15 @@ describe('ApexExecutionOverlayAction command', () => { let overlayActionCommand: ApexExecutionOverlayActionCommand; const actionObjectId = '1doxx000000FAKE'; - const expectedPostUrl = - 'https://www.salesforce.com/services/data/v43.0/tooling/sobjects/ApexExecutionOverlayAction'; + const expectedPostUrl = 'https://www.salesforce.com/services/data/v43.0/tooling/sobjects/ApexExecutionOverlayAction'; const expectedDeleteUrl = - 'https://www.salesforce.com/services/data/v43.0/tooling/sobjects/ApexExecutionOverlayAction/' + - actionObjectId; + 'https://www.salesforce.com/services/data/v43.0/tooling/sobjects/ApexExecutionOverlayAction/' + actionObjectId; const requestService = new RequestService(); const requestString = '{"ActionScript":"","ActionScriptType":"None","ExecutableEntityName":"MyFakeClassOrTrigger","IsDumpingHeap":true,"Iteration":1,"Line":25}'; const reseponseFieldIntegrityError = '[{"message":"Some error message, does not really matter, only the error code matters","errorCode":"FIELD_INTEGRITY_EXCEPTION","fields":[]}]'; - const responseSuccess = - '{"id":"1doxx000000FAKE","success":true,"errors":[],"warnings":[]}'; + const responseSuccess = '{"id":"1doxx000000FAKE","success":true,"errors":[],"warnings":[]}'; beforeEach(() => { requestService.instanceUrl = 'https://www.salesforce.com'; @@ -83,14 +76,12 @@ describe('ApexExecutionOverlayAction command', () => { it('ApexExecutionOverlayActionCommand POST REST call with parse-able success result', async () => { overlayActionCommand = new ApexExecutionOverlayActionCommand(requestString); - sendRequestSpy = sinon - .stub(RequestService.prototype, 'sendRequest') - .returns( - Promise.resolve({ - status: 200, - responseText: responseSuccess - } as XHRResponse) - ); + sendRequestSpy = sinon.stub(RequestService.prototype, 'sendRequest').returns( + Promise.resolve({ + status: 200, + responseText: responseSuccess + } as XHRResponse) + ); // The expected options needs to contain the request body, url and RestHttpMethodEnum.Post const expectedOptions: XHROptions = createExpectedXHROptions( @@ -105,23 +96,19 @@ describe('ApexExecutionOverlayAction command', () => { expect(sendRequestSpy.getCall(0).args[0]).to.deep.equal(expectedOptions); // parse the returnString and verify the ID and success boolean - const response = JSON.parse( - returnString - ) as ApexExecutionOverlaySuccessResult; + const response = JSON.parse(returnString) as ApexExecutionOverlaySuccessResult; expect(response.id).to.equal(actionObjectId); expect(response.success).to.equal(true); }); it('ApexExecutionOverlayActionCommand POST REST call with parse-able FIELD_INTEGRITY_EXCEPTION result', async () => { overlayActionCommand = new ApexExecutionOverlayActionCommand(requestString); - sendRequestSpy = sinon - .stub(RequestService.prototype, 'sendRequest') - .returns( - Promise.resolve({ - status: 200, - responseText: reseponseFieldIntegrityError - } as XHRResponse) - ); + sendRequestSpy = sinon.stub(RequestService.prototype, 'sendRequest').returns( + Promise.resolve({ + status: 200, + responseText: reseponseFieldIntegrityError + } as XHRResponse) + ); // The expected options needs to contain the request body, url and RestHttpMethodEnum.Post const expectedOptions: XHROptions = createExpectedXHROptions( requestString, @@ -136,26 +123,19 @@ describe('ApexExecutionOverlayAction command', () => { // parse the returnString and verify the ID and success boolean // note: the return value is an array of ApexExecutionOverlayFailureResult - const result = JSON.parse( - returnString - ) as ApexExecutionOverlayFailureResult[]; + const result = JSON.parse(returnString) as ApexExecutionOverlayFailureResult[]; // Verify that the error code can be parses out expect(result[0].errorCode).to.equal(FIELD_INTEGRITY_EXCEPTION); }); it('ApexExecutionOverlayActionCommand DELETE REST call', async () => { - overlayActionCommand = new ApexExecutionOverlayActionCommand( - requestString, - actionObjectId + overlayActionCommand = new ApexExecutionOverlayActionCommand(requestString, actionObjectId); + sendRequestSpy = sinon.stub(RequestService.prototype, 'sendRequest').returns( + Promise.resolve({ + status: 200, + responseText: '' // Upon a successful delete, nothing is returned + } as XHRResponse) ); - sendRequestSpy = sinon - .stub(RequestService.prototype, 'sendRequest') - .returns( - Promise.resolve({ - status: 200, - responseText: '' // Upon a successful delete, nothing is returned - } as XHRResponse) - ); // The expected options needs to contain the request body, url and RestHttpMethodEnum.Post const expectedOptions: XHROptions = createExpectedXHROptions( requestString, @@ -163,10 +143,7 @@ describe('ApexExecutionOverlayAction command', () => { RestHttpMethodEnum.Delete ); - await requestService.execute( - overlayActionCommand, - RestHttpMethodEnum.Delete - ); + await requestService.execute(overlayActionCommand, RestHttpMethodEnum.Delete); expect(sendRequestSpy.calledOnce).to.equal(true); expect(sendRequestSpy.getCall(0).args[0]).to.deep.equal(expectedOptions); @@ -187,9 +164,7 @@ export const createExpectedXHROptions = ( 'Content-Type': 'application/json;charset=utf-8', Accept: 'application/json', Authorization: 'OAuth 123', - 'Content-Length': requestBody - ? String(Buffer.byteLength(requestBody, 'utf-8')) - : '0', + 'Content-Length': requestBody ? String(Buffer.byteLength(requestBody, 'utf-8')) : '0', 'Sforce-Call-Options': `client=${CLIENT_ID}` }, data: requestBody diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/commands/batchDeleteExistingOverlayActionsCommand.test.ts b/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/commands/batchDeleteExistingOverlayActionsCommand.test.ts index eb0942a6eb..af1dbfe123 100644 --- a/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/commands/batchDeleteExistingOverlayActionsCommand.test.ts +++ b/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/commands/batchDeleteExistingOverlayActionsCommand.test.ts @@ -9,10 +9,7 @@ import { INVALID_CROSS_REFERENCE_KEY, OVERLAY_ACTION_DELETE_URL } from '@salesforce/salesforcedx-apex-replay-debugger/out/src/constants'; -import { - RequestService, - RestHttpMethodEnum -} from '@salesforce/salesforcedx-utils'; +import { RequestService, RestHttpMethodEnum } from '@salesforce/salesforcedx-utils'; import { expect } from 'chai'; import { XHROptions, XHRResponse } from 'request-light'; import * as sinon from 'sinon'; @@ -28,8 +25,7 @@ let sendRequestSpy: sinon.SinonStub; let batchDeleteCommand: BatchDeleteExistingOverlayActionCommand; const requestService = new RequestService(); const tempApexExecutionOverlayId = '1doxx00000FAKE'; -const expectedBatchUrl = - 'https://www.salesforce.com/services/data/v43.0/tooling/composite/batch'; +const expectedBatchUrl = 'https://www.salesforce.com/services/data/v43.0/tooling/composite/batch'; const requestBody = '{"batchRequests":[{"method":"DELETE","url":"services/data/v43.0/tooling/sobjects/ApexExecutionOverlayAction/1doxx00000FAKE0"},{"method":"DELETE","url":"services/data/v43.0/tooling/sobjects/ApexExecutionOverlayAction/1doxx00000FAKE1"},{"method":"DELETE","url":"services/data/v43.0/tooling/sobjects/ApexExecutionOverlayAction/1doxx00000FAKE2"},{"method":"DELETE","url":"services/data/v43.0/tooling/sobjects/ApexExecutionOverlayAction/1doxx00000FAKE3"},{"method":"DELETE","url":"services/data/v43.0/tooling/sobjects/ApexExecutionOverlayAction/1doxx00000FAKE4"}]}'; const responseNoErrors = @@ -52,19 +48,14 @@ it('BatchDeleteExistingOverlayActionCommand POST REST call with non-error result for (let i = 0; i < 5; i++) { const request: BatchRequest = { method: RestHttpMethodEnum.Delete, - url: - 'services/data/v43.0/tooling/sobjects/ApexExecutionOverlayAction/' + - tempApexExecutionOverlayId + - i + url: 'services/data/v43.0/tooling/sobjects/ApexExecutionOverlayAction/' + tempApexExecutionOverlayId + i }; requests.push(request); } const batchRequests: BatchRequests = { batchRequests: requests }; - batchDeleteCommand = new BatchDeleteExistingOverlayActionCommand( - batchRequests - ); + batchDeleteCommand = new BatchDeleteExistingOverlayActionCommand(batchRequests); sendRequestSpy = sinon.stub(RequestService.prototype, 'sendRequest').returns( Promise.resolve({ @@ -74,16 +65,9 @@ it('BatchDeleteExistingOverlayActionCommand POST REST call with non-error result ); // The expected options needs to contain the request body, url and RestHttpMethodEnum.Post - const expectedOptions: XHROptions = createExpectedXHROptions( - requestBody, - expectedBatchUrl, - RestHttpMethodEnum.Post - ); + const expectedOptions: XHROptions = createExpectedXHROptions(requestBody, expectedBatchUrl, RestHttpMethodEnum.Post); - const returnString = await requestService.execute( - batchDeleteCommand, - RestHttpMethodEnum.Post - ); + const returnString = await requestService.execute(batchDeleteCommand, RestHttpMethodEnum.Post); expect(sendRequestSpy.calledOnce).to.equal(true); expect(sendRequestSpy.getCall(0).args[0]).to.deep.equal(expectedOptions); @@ -109,9 +93,7 @@ it('BatchDeleteExistingOverlayActionCommand POST REST call with error result', a const batchRequests: BatchRequests = { batchRequests: requests }; - batchDeleteCommand = new BatchDeleteExistingOverlayActionCommand( - batchRequests - ); + batchDeleteCommand = new BatchDeleteExistingOverlayActionCommand(batchRequests); sendRequestSpy = sinon.stub(RequestService.prototype, 'sendRequest').returns( Promise.resolve({ @@ -121,16 +103,9 @@ it('BatchDeleteExistingOverlayActionCommand POST REST call with error result', a ); // The expected options needs to contain the request body, url and RestHttpMethodEnum.Post - const expectedOptions: XHROptions = createExpectedXHROptions( - requestBody, - expectedBatchUrl, - RestHttpMethodEnum.Post - ); + const expectedOptions: XHROptions = createExpectedXHROptions(requestBody, expectedBatchUrl, RestHttpMethodEnum.Post); - const returnString = await requestService.execute( - batchDeleteCommand, - RestHttpMethodEnum.Post - ); + const returnString = await requestService.execute(batchDeleteCommand, RestHttpMethodEnum.Post); expect(sendRequestSpy.calledOnce).to.equal(true); expect(sendRequestSpy.getCall(0).args[0]).to.deep.equal(expectedOptions); @@ -142,7 +117,5 @@ it('BatchDeleteExistingOverlayActionCommand POST REST call with error result', a const response = JSON.parse(returnString) as BatchDeleteResponse; expect(response.hasErrors).to.equal(true); expect(response.results.length).to.equal(5); - expect(response.results[2].result![0].errorCode).to.be.equal( - INVALID_CROSS_REFERENCE_KEY - ); + expect(response.results[2].result![0].errorCode).to.be.equal(INVALID_CROSS_REFERENCE_KEY); }); diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/commands/queryExistingOverlayActionIdsCommand.test.ts b/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/commands/queryExistingOverlayActionIdsCommand.test.ts index 4814fbda6f..36e5b08d0e 100644 --- a/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/commands/queryExistingOverlayActionIdsCommand.test.ts +++ b/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/commands/queryExistingOverlayActionIdsCommand.test.ts @@ -5,10 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - RequestService, - RestHttpMethodEnum -} from '@salesforce/salesforcedx-utils'; +import { RequestService, RestHttpMethodEnum } from '@salesforce/salesforcedx-utils'; import { expect } from 'chai'; import { XHROptions, XHRResponse } from 'request-light'; import * as sinon from 'sinon'; @@ -42,17 +39,13 @@ describe('QueryExistingOverlayActionIdsCommand command', () => { }); it('QueryExistingOverlayActionIdsCommand GET REST call with parse-able success result, no action objects', async () => { - queryOverlayActionCommand = new QueryExistingOverlayActionIdsCommand( - userId + queryOverlayActionCommand = new QueryExistingOverlayActionIdsCommand(userId); + sendRequestSpy = sinon.stub(RequestService.prototype, 'sendRequest').returns( + Promise.resolve({ + status: 200, + responseText: responseSuccessEmpty + } as XHRResponse) ); - sendRequestSpy = sinon - .stub(RequestService.prototype, 'sendRequest') - .returns( - Promise.resolve({ - status: 200, - responseText: responseSuccessEmpty - } as XHRResponse) - ); // The expected options needs to contain the request body, url and RestHttpMethodEnum.Post const expectedOptions: XHROptions = createExpectedXHROptions( @@ -61,33 +54,24 @@ describe('QueryExistingOverlayActionIdsCommand command', () => { RestHttpMethodEnum.Get ); - const returnString = await requestService.execute( - queryOverlayActionCommand, - RestHttpMethodEnum.Get - ); + const returnString = await requestService.execute(queryOverlayActionCommand, RestHttpMethodEnum.Get); expect(sendRequestSpy.calledOnce).to.equal(true); expect(sendRequestSpy.getCall(0).args[0]).to.deep.equal(expectedOptions); // parse the returnString and verify the size is 0 and the records list is empty - const response = JSON.parse( - returnString - ) as QueryOverlayActionIdsSuccessResult; + const response = JSON.parse(returnString) as QueryOverlayActionIdsSuccessResult; expect(response.size).to.equal(0); expect(response.records.length).to.equal(0); }); it('QueryExistingOverlayActionIdsCommand GET REST call with parse-able success result, 5 action objects', async () => { - queryOverlayActionCommand = new QueryExistingOverlayActionIdsCommand( - userId + queryOverlayActionCommand = new QueryExistingOverlayActionIdsCommand(userId); + sendRequestSpy = sinon.stub(RequestService.prototype, 'sendRequest').returns( + Promise.resolve({ + status: 200, + responseText: responseSuccessFiveActions + } as XHRResponse) ); - sendRequestSpy = sinon - .stub(RequestService.prototype, 'sendRequest') - .returns( - Promise.resolve({ - status: 200, - responseText: responseSuccessFiveActions - } as XHRResponse) - ); // The expected options needs to contain the request body, url and RestHttpMethodEnum.Post const expectedOptions: XHROptions = createExpectedXHROptions( @@ -96,18 +80,13 @@ describe('QueryExistingOverlayActionIdsCommand command', () => { RestHttpMethodEnum.Get ); - const returnString = await requestService.execute( - queryOverlayActionCommand, - RestHttpMethodEnum.Get - ); + const returnString = await requestService.execute(queryOverlayActionCommand, RestHttpMethodEnum.Get); expect(sendRequestSpy.calledOnce).to.equal(true); expect(sendRequestSpy.getCall(0).args[0]).to.deep.equal(expectedOptions); // parse the returnString and verify the size is 5 and there are 5 records in the list - const response = JSON.parse( - returnString - ) as QueryOverlayActionIdsSuccessResult; + const response = JSON.parse(returnString) as QueryOverlayActionIdsSuccessResult; expect(response.size).to.equal(5); expect(response.records.length).to.equal(5); }); diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/commands/quickLaunch.test.ts b/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/commands/quickLaunch.test.ts index 8e4d54828d..3d38ac8d68 100644 --- a/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/commands/quickLaunch.test.ts +++ b/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/commands/quickLaunch.test.ts @@ -6,10 +6,7 @@ */ import { LogService, TestService } from '@salesforce/apex-node-bundle'; -import { - TestLevel, - TestResult -} from '@salesforce/apex-node-bundle/lib/src/tests/types'; +import { TestLevel, TestResult } from '@salesforce/apex-node-bundle/lib/src/tests/types'; import { AuthInfo, ConfigAggregator, Connection } from '@salesforce/core-bundle'; import { MockTestOrgData, TestContext } from '@salesforce/core-bundle'; import { @@ -52,11 +49,9 @@ describe('Quick launch apex tests', () => { beforeEach(async () => { settingStub = sb.stub(); - sb.stub(vscode.workspace, 'getConfiguration') - .withArgs(SFDX_CORE_CONFIGURATION_NAME) - .returns({ - get: settingStub - }); + sb.stub(vscode.workspace, 'getConfiguration').withArgs(SFDX_CORE_CONFIGURATION_NAME).returns({ + get: settingStub + }); $$.setConfigStubContents('AuthInfoConfig', { contents: await testData.getConfig() }); @@ -65,9 +60,7 @@ describe('Quick launch apex tests', () => { username: testData.username }) }); - sb.stub(ConfigAggregator.prototype, 'getPropertyValue') - .withArgs('target-org') - .returns(testData.username); + sb.stub(ConfigAggregator.prototype, 'getPropertyValue').withArgs('target-org').returns(testData.username); notificationServiceStub = sb.stub(notificationService, 'showErrorMessage'); sb.stub(workspaceContext, 'getConnection').returns(mockConnection); testServiceStub = sb @@ -76,10 +69,7 @@ describe('Quick launch apex tests', () => { buildPayloadStub = sb.stub(TestService.prototype, 'buildSyncPayload'); writeResultFilesStub = sb.stub(TestService.prototype, 'writeResultFiles'); createCheckpointStub = sb.stub(CheckpointService, 'sfCreateCheckpoints'); - oneOrMoreActiveCheckpointsStub = sb.stub( - CheckpointService.prototype, - 'hasOneOrMoreActiveCheckpoints' - ); + oneOrMoreActiveCheckpointsStub = sb.stub(CheckpointService.prototype, 'hasOneOrMoreActiveCheckpoints'); testDebuggerExec = new TestDebuggerExecutor(); }); @@ -95,9 +85,7 @@ describe('Quick launch apex tests', () => { tests: [{ className: 'MyClass' }], testLevel: 'RunSpecifiedTests' }); - traceFlagsStub = sb - .stub(TraceFlags.prototype, 'ensureTraceFlags') - .returns(true); + traceFlagsStub = sb.stub(TraceFlags.prototype, 'ensureTraceFlags').returns(true); sb.stub(projectPaths, 'debugLogsFolder').returns(LOG_DIR); logServiceStub = sb.stub(LogService.prototype, 'getLogs').resolves([]); launcherStub = sb.stub(launcher, 'launchFromLogFile'); @@ -134,11 +122,7 @@ describe('Quick launch apex tests', () => { expect(launcherArgs[0]).to.equal(path.join('logs', 'abcd.log')); expect(launcherArgs[1]).to.equal(false); expect(buildPayloadStub.called).to.be.true; - expect(buildPayloadStub.args[0]).to.eql([ - TestLevel.RunSpecifiedTests, - undefined, - 'MyClass' - ]); + expect(buildPayloadStub.args[0]).to.eql([TestLevel.RunSpecifiedTests, undefined, 'MyClass']); expect(writeResultFilesStub.called).to.equal(true); const writeResultFilesArgs = writeResultFilesStub.getCall(0).args; expect(writeResultFilesArgs[0]).to.eql({ @@ -159,9 +143,7 @@ describe('Quick launch apex tests', () => { tests: [{ className: 'MyClass' }], testLevel: 'RunSpecifiedTests' }); - traceFlagsStub = sb - .stub(TraceFlags.prototype, 'ensureTraceFlags') - .returns(true); + traceFlagsStub = sb.stub(TraceFlags.prototype, 'ensureTraceFlags').returns(true); sb.stub(projectPaths, 'debugLogsFolder').returns(LOG_DIR); logServiceStub = sb.stub(LogService.prototype, 'getLogs').resolves([]); launcherStub = sb.stub(launcher, 'launchFromLogFile'); @@ -198,11 +180,7 @@ describe('Quick launch apex tests', () => { expect(launcherArgs[0]).to.equal(path.join('logs', 'abcd.log')); expect(launcherArgs[1]).to.equal(false); expect(buildPayloadStub.called).to.be.true; - expect(buildPayloadStub.args[0]).to.eql([ - TestLevel.RunSpecifiedTests, - undefined, - 'MyClass' - ]); + expect(buildPayloadStub.args[0]).to.eql([TestLevel.RunSpecifiedTests, undefined, 'MyClass']); expect(writeResultFilesStub.called).to.equal(true); const writeResultFilesArgs = writeResultFilesStub.getCall(0).args; expect(writeResultFilesArgs[0]).to.eql({ @@ -223,9 +201,7 @@ describe('Quick launch apex tests', () => { tests: [{ className: 'MyClass' }], testLevel: 'RunSpecifiedTests' }); - traceFlagsStub = sb - .stub(TraceFlags.prototype, 'ensureTraceFlags') - .returns(true); + traceFlagsStub = sb.stub(TraceFlags.prototype, 'ensureTraceFlags').returns(true); sb.stub(projectPaths, 'debugLogsFolder').returns(LOG_DIR); logServiceStub = sb.stub(LogService.prototype, 'getLogs').resolves([]); launcherStub = sb.stub(launcher, 'launchFromLogFile'); @@ -253,9 +229,7 @@ describe('Quick launch apex tests', () => { tests: [{ className: 'MyClass', testMethods: ['testSomeCode'] }], testLevel: 'RunSpecifiedTests' }); - traceFlagsStub = sb - .stub(TraceFlags.prototype, 'ensureTraceFlags') - .returns(true); + traceFlagsStub = sb.stub(TraceFlags.prototype, 'ensureTraceFlags').returns(true); sb.stub(projectPaths, 'debugLogsFolder').returns(LOG_DIR); logServiceStub = sb.stub(LogService.prototype, 'getLogs').resolves([]); launcherStub = sb.stub(launcher, 'launchFromLogFile'); @@ -271,11 +245,7 @@ describe('Quick launch apex tests', () => { expect(oneOrMoreActiveCheckpointsStub.called).to.equal(true); expect(createCheckpointStub.called).to.equal(true); expect(buildPayloadStub.called).to.be.true; - expect(buildPayloadStub.args[0]).to.eql([ - TestLevel.RunSpecifiedTests, - 'MyClass.testSomeCode', - 'MyClass' - ]); + expect(buildPayloadStub.args[0]).to.eql([TestLevel.RunSpecifiedTests, 'MyClass.testSomeCode', 'MyClass']); expect(testServiceStub.called).to.equal(true); const { args } = testServiceStub.getCall(0); expect(args[0]).to.eql({ @@ -319,9 +289,7 @@ describe('Quick launch apex tests', () => { tests: [{ className: 'MyClass', testMethods: ['testSomeCode'] }], testLevel: 'RunSpecifiedTests' }); - traceFlagsStub = sb - .stub(TraceFlags.prototype, 'ensureTraceFlags') - .returns(true); + traceFlagsStub = sb.stub(TraceFlags.prototype, 'ensureTraceFlags').returns(true); testServiceStub.resolves({} as TestResult); sb.stub(projectPaths, 'debugLogsFolder').returns(LOG_DIR); logServiceStub = sb.stub(LogService.prototype, 'getLogs').resolves([]); @@ -338,11 +306,7 @@ describe('Quick launch apex tests', () => { expect(oneOrMoreActiveCheckpointsStub.called).to.equal(true); expect(createCheckpointStub.called).to.equal(true); expect(buildPayloadStub.called).to.be.true; - expect(buildPayloadStub.args[0]).to.eql([ - TestLevel.RunSpecifiedTests, - 'MyClass.testSomeCode', - 'MyClass' - ]); + expect(buildPayloadStub.args[0]).to.eql([TestLevel.RunSpecifiedTests, 'MyClass.testSomeCode', 'MyClass']); expect(testServiceStub.called).to.equal(true); const { args } = testServiceStub.getCall(0); expect(args[0]).to.eql({ @@ -363,9 +327,7 @@ describe('Quick launch apex tests', () => { // Seems that there are two different error msgs: // On Windows: "Cannot read property 'length' of undefined" // On Mac: "Cannot read properties of undefined (reading 'length')" - expect(notificationArgs[0].startsWith('Cannot read propert')).to.equal( - true - ); + expect(notificationArgs[0].startsWith('Cannot read propert')).to.equal(true); expect(notificationArgs[0]).to.contain('undefined'); expect(notificationArgs[0]).to.contain('length'); expect(writeResultFilesStub.called).to.equal(true); @@ -382,9 +344,7 @@ describe('Quick launch apex tests', () => { tests: [{ className: 'MyClass', testMethods: ['testSomeCode'] }], testLevel: 'RunSpecifiedTests' }); - traceFlagsStub = sb - .stub(TraceFlags.prototype, 'ensureTraceFlags') - .returns(true); + traceFlagsStub = sb.stub(TraceFlags.prototype, 'ensureTraceFlags').returns(true); testServiceStub.resolves({ tests: [] }); const response: ContinueResponse = { @@ -398,11 +358,7 @@ describe('Quick launch apex tests', () => { expect(oneOrMoreActiveCheckpointsStub.called).to.equal(true); expect(createCheckpointStub.called).to.equal(true); expect(buildPayloadStub.called).to.be.true; - expect(buildPayloadStub.args[0]).to.eql([ - TestLevel.RunSpecifiedTests, - 'MyClass.testSomeCode', - 'MyClass' - ]); + expect(buildPayloadStub.args[0]).to.eql([TestLevel.RunSpecifiedTests, 'MyClass.testSomeCode', 'MyClass']); expect(testServiceStub.called).to.equal(true); const { args } = testServiceStub.getCall(0); expect(args[0]).to.eql({ @@ -417,9 +373,7 @@ describe('Quick launch apex tests', () => { expect(notificationServiceStub.called).to.equal(true); const notificationArgs = notificationServiceStub.getCall(0).args; - expect(notificationArgs[0]).to.equal( - nls.localize('debug_test_no_results_found') - ); + expect(notificationArgs[0]).to.equal(nls.localize('debug_test_no_results_found')); expect(writeResultFilesStub.called).to.equal(true); const writeResultFilesArgs = writeResultFilesStub.getCall(0).args; expect(writeResultFilesArgs[0]).to.eql({ @@ -436,9 +390,7 @@ describe('Quick launch apex tests', () => { tests: [{ className: 'MyClass', testMethods: ['testSomeCode'] }], testLevel: 'RunSpecifiedTests' }); - traceFlagsStub = sb - .stub(TraceFlags.prototype, 'ensureTraceFlags') - .returns(true); + traceFlagsStub = sb.stub(TraceFlags.prototype, 'ensureTraceFlags').returns(true); testServiceStub.resolves({ tests: [{}] }); const response: ContinueResponse = { @@ -452,11 +404,7 @@ describe('Quick launch apex tests', () => { expect(oneOrMoreActiveCheckpointsStub.called).to.equal(true); expect(createCheckpointStub.called).to.equal(true); expect(buildPayloadStub.called).to.be.true; - expect(buildPayloadStub.args[0]).to.eql([ - TestLevel.RunSpecifiedTests, - 'MyClass.testSomeCode', - 'MyClass' - ]); + expect(buildPayloadStub.args[0]).to.eql([TestLevel.RunSpecifiedTests, 'MyClass.testSomeCode', 'MyClass']); expect(testServiceStub.called).to.equal(true); const { args } = testServiceStub.getCall(0); expect(args[0]).to.eql({ @@ -471,9 +419,7 @@ describe('Quick launch apex tests', () => { expect(notificationServiceStub.called).to.equal(true); const notificationArgs = notificationServiceStub.getCall(0).args; - expect(notificationArgs[0]).to.equal( - nls.localize('debug_test_no_debug_log') - ); + expect(notificationArgs[0]).to.equal(nls.localize('debug_test_no_debug_log')); expect(writeResultFilesStub.called).to.equal(true); const writeResultFilesArgs = writeResultFilesStub.getCall(0).args; expect(writeResultFilesArgs[0]).to.eql({ diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/index.test.ts b/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/index.test.ts index 36909b62ee..d11e5c9c82 100644 --- a/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/index.test.ts +++ b/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/index.test.ts @@ -23,9 +23,7 @@ describe('Extension Setup', () => { } }; - const realType = await getDebuggerType( - (session as any) as vscode.DebugSession - ); + const realType = await getDebuggerType(session as any as vscode.DebugSession); expect(realType).to.be.equal(DEBUGGER_TYPE); }); diff --git a/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/telemetry/telemetry.test.ts b/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/telemetry/telemetry.test.ts index a0bb0015fe..e69d61bf37 100644 --- a/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/telemetry/telemetry.test.ts +++ b/packages/salesforcedx-vscode-apex-replay-debugger/test/vscode-integration/telemetry/telemetry.test.ts @@ -52,12 +52,7 @@ describe('Telemetry', () => { const expectedMeasures = { startupTime: match.number }; - assert.calledWith( - sendEvent, - 'activationEvent', - expectedProps, - match(expectedMeasures) - ); + assert.calledWith(sendEvent, 'activationEvent', expectedProps, match(expectedMeasures)); }); it('Should send correct data format on sendExtensionDeactivationEvent', async () => { diff --git a/packages/salesforcedx-vscode-apex/.eslintrc.json b/packages/salesforcedx-vscode-apex/.eslintrc.json deleted file mode 100644 index 5b59dce583..0000000000 --- a/packages/salesforcedx-vscode-apex/.eslintrc.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "root": true, - "extends": [ - "../../config/base-eslintrc.json", - "./fix-these-rules.json" - ], - "overrides": [ - { - "files": [ - "./src/**/*.ts", - "./test/**/*.ts" - ], - "parserOptions": { - "project": "./tsconfig.json" - } - } - ], - "env": { - "node": true - } -} \ No newline at end of file diff --git a/packages/salesforcedx-vscode-apex/esbuild.config.js b/packages/salesforcedx-vscode-apex/esbuild.config.js index 62023332f6..755d3a1e47 100644 --- a/packages/salesforcedx-vscode-apex/esbuild.config.js +++ b/packages/salesforcedx-vscode-apex/esbuild.config.js @@ -4,7 +4,6 @@ * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -/* eslint-disable @typescript-eslint/no-var-requires */ const { build } = require('esbuild'); const esbuildPluginPino = require('esbuild-plugin-pino'); const fs = require('fs').promises; @@ -13,16 +12,9 @@ const sharedConfig = { bundle: true, format: 'cjs', platform: 'node', - external: [ - 'vscode', - 'applicationinsights', - 'shelljs', - 'jsonpath' - ], + external: ['vscode', 'applicationinsights', 'shelljs', 'jsonpath'], keepNames: true, - plugins: [ - esbuildPluginPino({ transports: ['pino-pretty'] }) - ], + plugins: [esbuildPluginPino({ transports: ['pino-pretty'] })], minify: true, supported: { 'dynamic-import': false @@ -52,6 +44,8 @@ const destPath = './dist/transformStream.js'; entryPoints: ['./src/index.ts'], outdir: 'dist' }); -})().then(async () => { - await copyFiles(srcPath, destPath); -}).catch(() => process.exit(1)); +})() + .then(async () => { + await copyFiles(srcPath, destPath); + }) + .catch(() => process.exit(1)); diff --git a/packages/salesforcedx-vscode-apex/fix-these-rules.json b/packages/salesforcedx-vscode-apex/fix-these-rules.json deleted file mode 100644 index b8953183ad..0000000000 --- a/packages/salesforcedx-vscode-apex/fix-these-rules.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "rules": { - "prefer-arrow/prefer-arrow-functions": ["error", {}], - "@typescript-eslint/await-thenable": "warn", - "@typescript-eslint/no-floating-promises": "warn", - "@typescript-eslint/no-misused-promises": "warn", - "@typescript-eslint/no-unsafe-argument": "warn", - "@typescript-eslint/no-unsafe-assignment": "warn", - "@typescript-eslint/no-unsafe-call": "warn", - "@typescript-eslint/no-unsafe-member-access": "warn", - "@typescript-eslint/no-unsafe-return": "warn", - "@typescript-eslint/require-await": "warn", - "@typescript-eslint/unbound-method": "warn" - } -} diff --git a/packages/salesforcedx-vscode-apex/package.json b/packages/salesforcedx-vscode-apex/package.json index 7bd7c78b8f..347fcd9cd3 100644 --- a/packages/salesforcedx-vscode-apex/package.json +++ b/packages/salesforcedx-vscode-apex/package.json @@ -18,7 +18,7 @@ "publisher": "salesforce", "license": "BSD-3-Clause", "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" }, "categories": [ "Programming Languages" @@ -40,28 +40,18 @@ "@salesforce/ts-sinon": "1.4.0", "@types/chai": "4.3.3", "@types/mocha": "^5", - "@types/node": "^18.11.9", + "@types/node": "^20.0.0", "@types/shelljs": "^0.7.8", "@types/sinon": "^2.3.7", - "@types/vscode": "^1.86.0", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", + "@types/vscode": "^1.90.0", "chai": "^4.0.2", "cross-env": "5.2.0", "esbuild": "^0.19.5", "esbuild-plugin-pino": "^2.1.0", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest": "27.5.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", "mocha": "^10", - "prettier": "3.0.3", + "prettier": "3.3.3", "sinon": "^13.0.1", - "typescript": "^5.2.2", + "typescript": "^5.6.2", "vscode-extension-telemetry": "0.0.17" }, "extensionDependencies": [ diff --git a/packages/salesforcedx-vscode-apex/src/apexErrorHandler.ts b/packages/salesforcedx-vscode-apex/src/apexErrorHandler.ts index 3c74544665..f24ecd50ff 100644 --- a/packages/salesforcedx-vscode-apex/src/apexErrorHandler.ts +++ b/packages/salesforcedx-vscode-apex/src/apexErrorHandler.ts @@ -44,9 +44,7 @@ export class ApexErrorHandler extends EventEmitter implements ErrorHandler { this.emit('restarting', this.restarts.length); return { action: CloseAction.Restart }; } else { - const diff = - this.restarts[this.restarts.length - 1] - - this.restarts[this.restarts.length - 5]; + const diff = this.restarts[this.restarts.length - 1] - this.restarts[this.restarts.length - 5]; // 3 minutes if (diff <= 3 * 60 * 1000) { this.emit('startFailed', this.restarts.length); diff --git a/packages/salesforcedx-vscode-apex/src/apexLspStatusBarItem.ts b/packages/salesforcedx-vscode-apex/src/apexLspStatusBarItem.ts index a2244ad39f..a041708d7f 100644 --- a/packages/salesforcedx-vscode-apex/src/apexLspStatusBarItem.ts +++ b/packages/salesforcedx-vscode-apex/src/apexLspStatusBarItem.ts @@ -13,24 +13,22 @@ export default class ApexLSPStatusBarItem implements vscode.Disposable { private diagnostics: vscode.DiagnosticCollection; constructor() { - this.languageStatusItem = vscode.languages.createLanguageStatusItem( - 'ApexLSPLanguageStatusItem', - { language: 'apex', scheme: 'file' } - ); + this.languageStatusItem = vscode.languages.createLanguageStatusItem('ApexLSPLanguageStatusItem', { + language: 'apex', + scheme: 'file' + }); this.diagnostics = vscode.languages.createDiagnosticCollection('apex'); this.indexing(); } public indexing() { this.languageStatusItem.text = nls.localize('apex_language_server_loading'); - this.languageStatusItem.severity = - vscode.LanguageStatusSeverity.Information; + this.languageStatusItem.severity = vscode.LanguageStatusSeverity.Information; } public ready() { this.languageStatusItem.text = nls.localize('apex_language_server_loaded'); - this.languageStatusItem.severity = - vscode.LanguageStatusSeverity.Information; + this.languageStatusItem.severity = vscode.LanguageStatusSeverity.Information; // clear any errors that were there this.diagnostics.set(vscode.Uri.file('/ApexLSP'), []); } @@ -40,11 +38,7 @@ export default class ApexLSPStatusBarItem implements vscode.Disposable { this.languageStatusItem.severity = vscode.LanguageStatusSeverity.Error; const position = new vscode.Position(0, 0); this.diagnostics.set(vscode.Uri.file('/ApexLSP'), [ - new vscode.Diagnostic( - new vscode.Range(position, position), - msg, - vscode.DiagnosticSeverity.Error - ) + new vscode.Diagnostic(new vscode.Range(position, position), msg, vscode.DiagnosticSeverity.Error) ]); // TODO W- add 'command' to statusItem to allow action to be taken } diff --git a/packages/salesforcedx-vscode-apex/src/channels/index.ts b/packages/salesforcedx-vscode-apex/src/channels/index.ts index 7c26ab5b97..93996119ea 100644 --- a/packages/salesforcedx-vscode-apex/src/channels/index.ts +++ b/packages/salesforcedx-vscode-apex/src/channels/index.ts @@ -8,7 +8,5 @@ import { ChannelService } from '@salesforce/salesforcedx-utils-vscode'; import * as vscode from 'vscode'; import { nls } from '../messages'; -export const OUTPUT_CHANNEL = vscode.window.createOutputChannel( - nls.localize('channel_name') -); +export const OUTPUT_CHANNEL = vscode.window.createOutputChannel(nls.localize('channel_name')); export const channelService = new ChannelService(OUTPUT_CHANNEL); diff --git a/packages/salesforcedx-vscode-apex/src/codecoverage/colorizer.ts b/packages/salesforcedx-vscode-apex/src/codecoverage/colorizer.ts index d565a608c3..e02a686d28 100644 --- a/packages/salesforcedx-vscode-apex/src/codecoverage/colorizer.ts +++ b/packages/salesforcedx-vscode-apex/src/codecoverage/colorizer.ts @@ -6,35 +6,19 @@ */ import { CodeCoverageResult } from '@salesforce/apex-node-bundle'; -import { - SFDX_FOLDER, - projectPaths -} from '@salesforce/salesforcedx-utils-vscode'; +import { SFDX_FOLDER, projectPaths } from '@salesforce/salesforcedx-utils-vscode'; import { existsSync, readFileSync } from 'fs'; import { join, extname, basename } from 'path'; -import { - Range, - TextDocument, - TextEditor, - TextLine, - window, - workspace -} from 'vscode'; +import { Range, TextDocument, TextEditor, TextLine, window, workspace } from 'vscode'; import { channelService } from '../channels'; import { IS_CLS_OR_TRIGGER, IS_TEST_REG_EXP } from '../constants'; import { nls } from '../messages'; -import { - coveredLinesDecorationType, - uncoveredLinesDecorationType -} from './decorations'; +import { coveredLinesDecorationType, uncoveredLinesDecorationType } from './decorations'; import { StatusBarToggle } from './statusBarToggle'; export const pathToApexTestResultsFolder = projectPaths.apexTestResultsFolder(); -export const getLineRange = ( - document: TextDocument, - lineNumber: number -): Range => { +export const getLineRange = (document: TextDocument, lineNumber: number): Range => { let adjustedLineNumber: number; let firstLine: TextLine; try { @@ -75,25 +59,15 @@ const getTestRunId = (): string => { const getCoverageData = (): CoverageItem[] | CodeCoverageResult[] => { const testRunId = getTestRunId(); - const testResultFilePath = join( - pathToApexTestResultsFolder, - `test-result-${testRunId}.json` - ); + const testResultFilePath = join(pathToApexTestResultsFolder, `test-result-${testRunId}.json`); if (!existsSync(testResultFilePath)) { - throw new Error( - nls.localize('colorizer_no_code_coverage_on_test_results', testRunId) - ); + throw new Error(nls.localize('colorizer_no_code_coverage_on_test_results', testRunId)); } const testResultOutput = readFileSync(testResultFilePath, 'utf8'); const testResult = JSON.parse(testResultOutput); - if ( - testResult.coverage === undefined && - testResult.codecoverage === undefined - ) { - throw new Error( - nls.localize('colorizer_no_code_coverage_on_test_results', testRunId) - ); + if (testResult.coverage === undefined && testResult.codecoverage === undefined) { + throw new Error(nls.localize('colorizer_no_code_coverage_on_test_results', testRunId)); } return testResult.codecoverage || testResult.coverage.coverage; @@ -161,10 +135,7 @@ export class CodeCoverageHandler { private handleCoverageException(e: Error) { const disableWarning: boolean = workspace .getConfiguration() - .get( - 'salesforcedx-vscode-apex.disable-warnings-for-missing-coverage', - false - ); + .get('salesforcedx-vscode-apex.disable-warnings-for-missing-coverage', false); if (disableWarning) { channelService.appendLine(e.message); } else { @@ -194,23 +165,13 @@ const applyCoverageToSource = ( ) { const codeCovArray = getCoverageData() as { name: string }[]; const apexMemberName = getApexMemberName(document.uri.fsPath); - const codeCovItem = codeCovArray.find( - covItem => covItem.name === apexMemberName - ); + const codeCovItem = codeCovArray.find(covItem => covItem.name === apexMemberName); if (!codeCovItem) { - throw new Error( - nls.localize( - 'colorizer_no_code_coverage_current_file', - document.uri.fsPath - ) - ); + throw new Error(nls.localize('colorizer_no_code_coverage_current_file', document.uri.fsPath)); } - if ( - Reflect.has(codeCovItem, 'lines') && - !Reflect.has(codeCovItem, 'uncoveredLines') - ) { + if (Reflect.has(codeCovItem, 'lines') && !Reflect.has(codeCovItem, 'uncoveredLines')) { const covItem = codeCovItem as CoverageItem; for (const key in covItem.lines) { if (covItem.lines[key] === 1) { @@ -221,12 +182,8 @@ const applyCoverageToSource = ( } } else { const covResult = codeCovItem as CodeCoverageResult; - coveredLines = covResult.coveredLines.map(cov => - getLineRange(document, Number(cov)) - ); - uncoveredLines = covResult.uncoveredLines.map(uncov => - getLineRange(document, Number(uncov)) - ); + coveredLines = covResult.coveredLines.map(cov => getLineRange(document, Number(cov))); + uncoveredLines = covResult.uncoveredLines.map(uncov => getLineRange(document, Number(uncov))); } } return { coveredLines, uncoveredLines }; diff --git a/packages/salesforcedx-vscode-apex/src/codecoverage/decorations.ts b/packages/salesforcedx-vscode-apex/src/codecoverage/decorations.ts index e00f689e03..be6834075e 100644 --- a/packages/salesforcedx-vscode-apex/src/codecoverage/decorations.ts +++ b/packages/salesforcedx-vscode-apex/src/codecoverage/decorations.ts @@ -10,17 +10,14 @@ import { window } from 'vscode'; const lime = (opacity: number): string => `rgba(45, 121, 11, ${opacity})`; const red = (opacity: number): string => `rgba(253, 72, 73, ${opacity})`; -export const coveredLinesDecorationType = window.createTextEditorDecorationType( - { - backgroundColor: lime(0.5), - borderRadius: '.2em', - overviewRulerColor: lime(0.5) - } -); +export const coveredLinesDecorationType = window.createTextEditorDecorationType({ + backgroundColor: lime(0.5), + borderRadius: '.2em', + overviewRulerColor: lime(0.5) +}); -export const uncoveredLinesDecorationType = - window.createTextEditorDecorationType({ - backgroundColor: red(0.5), - borderRadius: '.2em', - overviewRulerColor: red(0.5) - }); +export const uncoveredLinesDecorationType = window.createTextEditorDecorationType({ + backgroundColor: red(0.5), + borderRadius: '.2em', + overviewRulerColor: red(0.5) +}); diff --git a/packages/salesforcedx-vscode-apex/src/codecoverage/statusBarToggle.ts b/packages/salesforcedx-vscode-apex/src/codecoverage/statusBarToggle.ts index 16e42bd30c..43b981b91d 100644 --- a/packages/salesforcedx-vscode-apex/src/codecoverage/statusBarToggle.ts +++ b/packages/salesforcedx-vscode-apex/src/codecoverage/statusBarToggle.ts @@ -12,9 +12,7 @@ export class StatusBarToggle implements Disposable { private static readonly toggleCodeCovCommand = 'sf.apex.toggle.colorizer'; private static readonly showIcon = '$(three-bars)'; private static readonly hideIcon = '$(tasklist)'; - private static readonly toolTip = nls.localize( - 'colorizer_statusbar_hover_text' - ); + private static readonly toolTip = nls.localize('colorizer_statusbar_hover_text'); private isEnabled: boolean; private statusBarItem: StatusBarItem; diff --git a/packages/salesforcedx-vscode-apex/src/commands/anonApexExecute.ts b/packages/salesforcedx-vscode-apex/src/commands/anonApexExecute.ts index 8fce94d552..a2ed2f9d26 100644 --- a/packages/salesforcedx-vscode-apex/src/commands/anonApexExecute.ts +++ b/packages/salesforcedx-vscode-apex/src/commands/anonApexExecute.ts @@ -4,10 +4,7 @@ * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - ExecuteAnonymousResponse, - ExecuteService -} from '@salesforce/apex-node-bundle'; +import { ExecuteAnonymousResponse, ExecuteService } from '@salesforce/apex-node-bundle'; import { Connection } from '@salesforce/core-bundle'; import { CancelResponse, @@ -34,12 +31,8 @@ type ApexExecuteParameters = { selection?: vscode.Range; }; -export class AnonApexGatherer - implements ParametersGatherer -{ - public gather(): Promise< - CancelResponse | ContinueResponse - > { +export class AnonApexGatherer implements ParametersGatherer { + public gather(): Promise> { if (hasRootWorkspace()) { const editor = vscode.window.activeTextEditor; if (!editor) { @@ -47,17 +40,11 @@ export class AnonApexGatherer } const document = editor.document; - if ( - !editor.selection.isEmpty || - document.isUntitled || - document.isDirty - ) { + if (!editor.selection.isEmpty || document.isUntitled || document.isDirty) { return Promise.resolve({ type: 'CONTINUE', data: { - apexCode: !editor.selection.isEmpty - ? document.getText(editor.selection) - : document.getText(), + apexCode: !editor.selection.isEmpty ? document.getText(editor.selection) : document.getText(), selection: !editor.selection.isEmpty ? new vscode.Range(editor.selection.start, editor.selection.end) : undefined @@ -75,24 +62,17 @@ export class AnonApexGatherer } export class AnonApexLibraryExecuteExecutor extends LibraryCommandletExecutor { - public static diagnostics = - vscode.languages.createDiagnosticCollection('apex-errors'); + public static diagnostics = vscode.languages.createDiagnosticCollection('apex-errors'); private isDebugging: boolean; constructor(isDebugging: boolean) { - super( - nls.localize('apex_execute_text'), - 'apex_execute_library', - OUTPUT_CHANNEL - ); + super(nls.localize('apex_execute_text'), 'apex_execute_library', OUTPUT_CHANNEL); this.isDebugging = isDebugging; } - public async run( - response: ContinueResponse - ): Promise { + public async run(response: ContinueResponse): Promise { const connection = await workspaceContext.getConnection(); if (this.isDebugging) { if (!(await this.setUpTraceFlags(connection))) { @@ -126,11 +106,7 @@ export class AnonApexLibraryExecuteExecutor extends LibraryCommandletExecutor { + private async launchReplayDebugger(logs?: string | undefined): Promise { const logFilePath = this.getLogFilePath(); if (!this.saveLogFile(logFilePath, logs)) { return false; } - await vscode.commands.executeCommand( - 'sf.launch.replay.debugger.logfile.path', - logFilePath - ); + await vscode.commands.executeCommand('sf.launch.replay.debugger.logfile.path', logFilePath); return true; } @@ -197,16 +168,11 @@ export class AnonApexLibraryExecuteExecutor extends LibraryCommandletExecutor 0 ? line - 1 : 0, - column > 0 ? column - 1 : 0 - ); + const pos = new vscode.Position(line > 0 ? line - 1 : 0, column > 0 ? column - 1 : 0); return new vscode.Range(pos, pos); } } diff --git a/packages/salesforcedx-vscode-apex/src/commands/apexLogGet.ts b/packages/salesforcedx-vscode-apex/src/commands/apexLogGet.ts index 15df1fb88f..758153375c 100644 --- a/packages/salesforcedx-vscode-apex/src/commands/apexLogGet.ts +++ b/packages/salesforcedx-vscode-apex/src/commands/apexLogGet.ts @@ -33,12 +33,8 @@ export type ApexDebugLogIdStartTime = { startTime: string; }; -export class LogFileSelector - implements ParametersGatherer -{ - public async gather(): Promise< - CancelResponse | ContinueResponse - > { +export class LogFileSelector implements ParametersGatherer { + public async gather(): Promise> { const cancellationTokenSource = new vscode.CancellationTokenSource(); const logInfos = await this.getLogRecords(); @@ -46,10 +42,7 @@ export class LogFileSelector const logItems = logInfos.map(logInfo => { const icon = '$(file-text) '; const localUTCDate = new Date(logInfo.StartTime); - const localDateFormatted = localUTCDate.toLocaleDateString( - undefined, - optionYYYYMMddHHmmss - ); + const localDateFormatted = localUTCDate.toLocaleDateString(undefined, optionYYYYMMddHHmmss); return { id: logInfo.Id, @@ -107,16 +100,10 @@ export class ApexLibraryGetLogsExecutor extends LibraryCommandletExecutor<{ id: string; }> { constructor() { - super( - nls.localize('apex_log_get_text'), - 'apex_log_get_library', - OUTPUT_CHANNEL - ); + super(nls.localize('apex_log_get_text'), 'apex_log_get_library', OUTPUT_CHANNEL); } - public async run( - response: ContinueResponse<{ id: string }> - ): Promise { + public async run(response: ContinueResponse<{ id: string }>): Promise { const connection = await workspaceContext.getConnection(); const logService = new LogService(connection); const { id: logId } = response.data; @@ -137,7 +124,6 @@ export class ApexLibraryGetLogsExecutor extends LibraryCommandletExecutor<{ } } -// eslint-disable-next-line @typescript-eslint/no-unused-vars export const apexLogGet = async (explorerDir?: any) => { const commandlet = new SfCommandlet( new SfWorkspaceChecker(), diff --git a/packages/salesforcedx-vscode-apex/src/commands/apexTestRun.ts b/packages/salesforcedx-vscode-apex/src/commands/apexTestRun.ts index e806910bc9..3ee22cf374 100644 --- a/packages/salesforcedx-vscode-apex/src/commands/apexTestRun.ts +++ b/packages/salesforcedx-vscode-apex/src/commands/apexTestRun.ts @@ -24,27 +24,12 @@ import { SfWorkspaceChecker } from '@salesforce/salesforcedx-utils-vscode'; import { getTestResultsFolder } from '@salesforce/salesforcedx-utils-vscode'; -import { - CancelResponse, - ContinueResponse, - ParametersGatherer -} from '@salesforce/salesforcedx-utils-vscode'; +import { CancelResponse, ContinueResponse, ParametersGatherer } from '@salesforce/salesforcedx-utils-vscode'; import { readFileSync } from 'fs'; import { basename } from 'path'; -import { - languages, - workspace, - window, - CancellationToken, - QuickPickItem, - Uri -} from 'vscode'; +import { languages, workspace, window, CancellationToken, QuickPickItem, Uri } from 'vscode'; import { channelService, OUTPUT_CHANNEL } from '../channels'; -import { - APEX_CLASS_EXT, - APEX_TESTSUITE_EXT, - IS_TEST_REG_EXP -} from '../constants'; +import { APEX_CLASS_EXT, APEX_TESTSUITE_EXT, IS_TEST_REG_EXP } from '../constants'; import { workspaceContext } from '../context'; import { nls } from '../messages'; import * as settings from '../settings'; @@ -59,17 +44,10 @@ export type ApexTestQuickPickItem = QuickPickItem & { type: TestType; }; -export class TestsSelector - implements ParametersGatherer -{ - public async gather(): Promise< - CancelResponse | ContinueResponse - > { +export class TestsSelector implements ParametersGatherer { + public async gather(): Promise> { const { testSuites, apexClasses } = ( - await workspace.findFiles( - `{**/*${APEX_TESTSUITE_EXT},**/*${APEX_CLASS_EXT}}`, - SFDX_FOLDER - ) + await workspace.findFiles(`{**/*${APEX_TESTSUITE_EXT},**/*${APEX_CLASS_EXT}}`, SFDX_FOLDER) ) .sort((a, b) => a.fsPath.localeCompare(b.fsPath)) .reduce( @@ -94,9 +72,7 @@ export class TestsSelector fileItems.push({ label: nls.localize('apex_test_run_all_local_test_label'), - description: nls.localize( - 'apex_test_run_all_local_tests_description_text' - ), + description: nls.localize('apex_test_run_all_local_tests_description_text'), type: TestType.AllLocal }); @@ -121,12 +97,8 @@ export class TestsSelector }) ); - const selection = (await window.showQuickPick( - fileItems - )) as ApexTestQuickPickItem; - return selection - ? { type: 'CONTINUE', data: selection } - : { type: 'CANCEL' }; + const selection = (await window.showQuickPick(fileItems)) as ApexTestQuickPickItem; + return selection ? { type: 'CONTINUE', data: selection } : { type: 'CANCEL' }; } } @@ -141,15 +113,10 @@ const getTempFolder = (): string => { export class ApexLibraryTestRunExecutor extends LibraryCommandletExecutor { protected cancellable: boolean = true; - public static diagnostics = - languages.createDiagnosticCollection('apex-errors'); + public static diagnostics = languages.createDiagnosticCollection('apex-errors'); constructor() { - super( - nls.localize('apex_test_run_text'), - 'apex_test_run_library', - OUTPUT_CHANNEL - ); + super(nls.localize('apex_test_run_text'), 'apex_test_run_library', OUTPUT_CHANNEL); } public async run( @@ -169,19 +136,10 @@ export class ApexLibraryTestRunExecutor extends LibraryCommandletExecutor = { report: value => { - if ( - value.type === 'StreamingClientProgress' || - value.type === 'FormatTestResultProgress' - ) { + if (value.type === 'StreamingClientProgress' || value.type === 'FormatTestResultProgress') { progress?.report({ message: value.message }); } } @@ -233,10 +188,6 @@ const workspaceChecker = new SfWorkspaceChecker(); const parameterGatherer = new TestsSelector(); export const apexTestRun = async () => { - const commandlet = new SfCommandlet( - workspaceChecker, - parameterGatherer, - new ApexLibraryTestRunExecutor() - ); + const commandlet = new SfCommandlet(workspaceChecker, parameterGatherer, new ApexLibraryTestRunExecutor()); await commandlet.run(); }; diff --git a/packages/salesforcedx-vscode-apex/src/commands/apexTestRunCodeAction.ts b/packages/salesforcedx-vscode-apex/src/commands/apexTestRunCodeAction.ts index 405a3f7e15..3bde217fa3 100644 --- a/packages/salesforcedx-vscode-apex/src/commands/apexTestRunCodeAction.ts +++ b/packages/salesforcedx-vscode-apex/src/commands/apexTestRunCodeAction.ts @@ -40,19 +40,10 @@ export class ApexLibraryTestRunExecutor extends LibraryCommandletExecutor<{}> { private codeCoverage: boolean = false; private outputDir: string; - public static diagnostics = - vscode.languages.createDiagnosticCollection('apex-errors'); - - constructor( - tests: string[], - outputDir = getTempFolder(), - codeCoverage = settings.retrieveTestCodeCoverage() - ) { - super( - nls.localize('apex_test_run_text'), - 'apex_test_run_code_action_library', - OUTPUT_CHANNEL - ); + public static diagnostics = vscode.languages.createDiagnosticCollection('apex-errors'); + + constructor(tests: string[], outputDir = getTempFolder(), codeCoverage = settings.retrieveTestCodeCoverage()) { + super(nls.localize('apex_test_run_text'), 'apex_test_run_code_action_library', OUTPUT_CHANNEL); this.tests = tests; this.outputDir = outputDir; this.codeCoverage = codeCoverage; @@ -68,17 +59,11 @@ export class ApexLibraryTestRunExecutor extends LibraryCommandletExecutor<{}> { ): Promise { const connection = await workspaceContext.getConnection(); const testService = new TestService(connection); - const payload = await testService.buildAsyncPayload( - TestLevel.RunSpecifiedTests, - this.tests.join() - ); + const payload = await testService.buildAsyncPayload(TestLevel.RunSpecifiedTests, this.tests.join()); const progressReporter: Progress = { report: value => { - if ( - value.type === 'StreamingClientProgress' || - value.type === 'FormatTestResultProgress' - ) { + if (value.type === 'StreamingClientProgress' || value.type === 'FormatTestResultProgress') { progress?.report({ message: value.message }); } } @@ -124,34 +109,23 @@ export class ApexLibraryTestRunExecutor extends LibraryCommandletExecutor<{}> { testsWithDiagnostics.forEach(test => { const diagnostic = test.diagnostic as ApexDiagnostic; - const componentPath = correlatedArtifacts.get( - test.apexClass.fullName ?? test.apexClass.name - ); + const componentPath = correlatedArtifacts.get(test.apexClass.fullName ?? test.apexClass.name); if (componentPath) { const vscDiagnostic: vscode.Diagnostic = { message: `${diagnostic.exceptionMessage}\n${diagnostic.exceptionStackTrace}`, severity: vscode.DiagnosticSeverity.Error, source: componentPath, - range: this.getZeroBasedRange( - diagnostic.lineNumber ?? 1, - diagnostic.columnNumber ?? 1 - ) + range: this.getZeroBasedRange(diagnostic.lineNumber ?? 1, diagnostic.columnNumber ?? 1) }; - ApexLibraryTestRunExecutor.diagnostics.set( - vscode.Uri.file(componentPath), - [vscDiagnostic] - ); + ApexLibraryTestRunExecutor.diagnostics.set(vscode.Uri.file(componentPath), [vscDiagnostic]); } }); } private getZeroBasedRange(line: number, column: number): vscode.Range { - const pos = new vscode.Position( - line > 0 ? line - 1 : 0, - column > 0 ? column - 1 : 0 - ); + const pos = new vscode.Position(line > 0 ? line - 1 : 0, column > 0 ? column - 1 : 0); return new vscode.Range(pos, pos); } @@ -170,18 +144,13 @@ export class ApexLibraryTestRunExecutor extends LibraryCommandletExecutor<{}> { correlatedArtifacts.set(testName, 'unknown'); } - const workspaceFolder = vscode.workspace.workspaceFolders - ? vscode.workspace.workspaceFolders[0] - : undefined; + const workspaceFolder = vscode.workspace.workspaceFolders ? vscode.workspace.workspaceFolders[0] : undefined; if (!workspaceFolder) { return correlatedArtifacts; } const patterns = packageDirectories.map(pkgDir => { - const relativePath = path.relative( - workspaceFolder.uri.fsPath, - pkgDir.fullPath - ); + const relativePath = path.relative(workspaceFolder.uri.fsPath, pkgDir.fullPath); return `${relativePath}/**/*.cls`; }); @@ -192,10 +161,9 @@ export class ApexLibraryTestRunExecutor extends LibraryCommandletExecutor<{}> { const filesWithDuplicates = (await Promise.all(findFilesPromises)).flat(); // Remove duplicates - const files = Array.from( - new Set(filesWithDuplicates.map(file => file.toString())) - ) - .map(filePath => vscode.Uri.parse(filePath)); + const files = Array.from(new Set(filesWithDuplicates.map(file => file.toString()))).map(filePath => + vscode.Uri.parse(filePath) + ); // Iterate over each file found for (const file of files) { @@ -213,20 +181,13 @@ export class ApexLibraryTestRunExecutor extends LibraryCommandletExecutor<{}> { const apexTestRunCodeAction = async (tests: string[]) => { const testRunExecutor = new ApexLibraryTestRunExecutor(tests); - const commandlet = new SfCommandlet( - new SfWorkspaceChecker(), - new EmptyParametersGatherer(), - testRunExecutor - ); + const commandlet = new SfCommandlet(new SfWorkspaceChecker(), new EmptyParametersGatherer(), testRunExecutor); await commandlet.run(); }; const getTempFolder = (): string => { if (vscode.workspace && vscode.workspace.workspaceFolders) { - const apexDir = getTestResultsFolder( - vscode.workspace.workspaceFolders[0].uri.fsPath, - 'apex' - ); + const apexDir = getTestResultsFolder(vscode.workspace.workspaceFolders[0].uri.fsPath, 'apex'); return apexDir; } else { throw new Error(nls.localize('cannot_determine_workspace')); @@ -248,9 +209,7 @@ export const apexTestClassRunCodeActionDelegate = (testClass: string) => { // evaluate test class param: if not provided, apply cached value // exported for testability -export const resolveTestClassParam = async ( - testClass: string -): Promise => { +export const resolveTestClassParam = async (testClass: string): Promise => { if (isEmpty(testClass)) { // value not provided for re-run invocations // apply cached value, if available @@ -268,9 +227,7 @@ export const apexTestClassRunCodeAction = async (testClass: string) => { testClass = await resolveTestClassParam(testClass); if (isEmpty(testClass)) { // test param not provided: show error and terminate - void notificationService.showErrorMessage( - nls.localize('apex_test_run_codeAction_no_class_test_param_text') - ); + void notificationService.showErrorMessage(nls.localize('apex_test_run_codeAction_no_class_test_param_text')); return; } @@ -291,9 +248,7 @@ export const apexDebugMethodRunCodeActionDelegate = (testMethod: string) => { // evaluate test method param: if not provided, apply cached value // exported for testability -export const resolveTestMethodParam = async ( - testMethod: string -): Promise => { +export const resolveTestMethodParam = async (testMethod: string): Promise => { if (isEmpty(testMethod)) { // value not provided for re-run invocations // apply cached value, if available @@ -312,9 +267,7 @@ export const apexTestMethodRunCodeAction = async (testMethod: string) => { testMethod = await resolveTestMethodParam(testMethod); if (isEmpty(testMethod)) { // test param not provided: show error and terminate - void notificationService.showErrorMessage( - nls.localize('apex_test_run_codeAction_no_method_test_param_text') - ); + void notificationService.showErrorMessage(nls.localize('apex_test_run_codeAction_no_method_test_param_text')); return; } diff --git a/packages/salesforcedx-vscode-apex/src/commands/apexTestSuite.ts b/packages/salesforcedx-vscode-apex/src/commands/apexTestSuite.ts index 259ada3d34..97d036b744 100644 --- a/packages/salesforcedx-vscode-apex/src/commands/apexTestSuite.ts +++ b/packages/salesforcedx-vscode-apex/src/commands/apexTestSuite.ts @@ -22,19 +22,12 @@ import { OUTPUT_CHANNEL } from '../channels'; import { APEX_CLASS_EXT, IS_TEST_REG_EXP } from '../constants'; import { workspaceContext } from '../context'; import { nls } from '../messages'; -import { - ApexLibraryTestRunExecutor, - ApexTestQuickPickItem, - TestType -} from './apexTestRun'; +import { ApexLibraryTestRunExecutor, ApexTestQuickPickItem, TestType } from './apexTestRun'; export type ApexTestSuiteOptions = { suitename: string; tests: string[] }; const listApexClassItems = async (): Promise => { - const apexClasses = await vscode.workspace.findFiles( - `**/*${APEX_CLASS_EXT}`, - SFDX_FOLDER - ); + const apexClasses = await vscode.workspace.findFiles(`**/*${APEX_CLASS_EXT}`, SFDX_FOLDER); const apexClassItems = apexClasses .filter(apexClass => { const fileContent = readFileSync(apexClass.fsPath).toString(); @@ -67,46 +60,29 @@ const listApexTestSuiteItems = async (): Promise => { return quickPickItems; }; -export class TestSuiteSelector - implements ParametersGatherer -{ - public async gather(): Promise< - CancelResponse | ContinueResponse - > { +export class TestSuiteSelector implements ParametersGatherer { + public async gather(): Promise> { const quickPickItems = await listApexTestSuiteItems(); - const testSuiteName = (await vscode.window.showQuickPick( - quickPickItems - )) as ApexTestQuickPickItem; + const testSuiteName = (await vscode.window.showQuickPick(quickPickItems)) as ApexTestQuickPickItem; - return testSuiteName - ? { type: 'CONTINUE', data: testSuiteName } - : { type: 'CANCEL' }; + return testSuiteName ? { type: 'CONTINUE', data: testSuiteName } : { type: 'CANCEL' }; } } -export class TestSuiteBuilder - implements ParametersGatherer -{ - public async gather(): Promise< - CancelResponse | ContinueResponse - > { +export class TestSuiteBuilder implements ParametersGatherer { + public async gather(): Promise> { const quickPickItems = await listApexTestSuiteItems(); - const testSuiteName = (await vscode.window.showQuickPick( - quickPickItems - )) as ApexTestQuickPickItem; + const testSuiteName = (await vscode.window.showQuickPick(quickPickItems)) as ApexTestQuickPickItem; if (testSuiteName) { const apexClassItems = await listApexClassItems(); - const apexClassSelection = (await vscode.window.showQuickPick( - apexClassItems, - { canPickMany: true } - )) as ApexTestQuickPickItem[]; - const apexClassNames = apexClassSelection?.map( - selection => selection.label - ); + const apexClassSelection = (await vscode.window.showQuickPick(apexClassItems, { + canPickMany: true + })) as ApexTestQuickPickItem[]; + const apexClassNames = apexClassSelection?.map(selection => selection.label); return apexClassSelection ? { @@ -119,12 +95,8 @@ export class TestSuiteBuilder } } -export class TestSuiteCreator - implements ParametersGatherer -{ - public async gather(): Promise< - CancelResponse | ContinueResponse - > { +export class TestSuiteCreator implements ParametersGatherer { + public async gather(): Promise> { const testSuiteInput = { prompt: 'Enter desired Apex test suite name:' } as vscode.InputBoxOptions; @@ -133,13 +105,10 @@ export class TestSuiteCreator if (testSuiteName) { const apexClassItems = await listApexClassItems(); - const apexClassSelection = (await vscode.window.showQuickPick( - apexClassItems, - { canPickMany: true } - )) as ApexTestQuickPickItem[]; - const apexClassNames = apexClassSelection?.map( - selection => selection.label - ); + const apexClassSelection = (await vscode.window.showQuickPick(apexClassItems, { + canPickMany: true + })) as ApexTestQuickPickItem[]; + const apexClassNames = apexClassSelection?.map(selection => selection.label); return apexClassSelection ? { @@ -153,20 +122,13 @@ export class TestSuiteCreator } export class ApexLibraryTestSuiteBuilder extends LibraryCommandletExecutor { - public static diagnostics = - vscode.languages.createDiagnosticCollection('apex-errors'); + public static diagnostics = vscode.languages.createDiagnosticCollection('apex-errors'); constructor() { - super( - nls.localize('apex_test_suite_build_text'), - 'apex_test_suite_build_library', - OUTPUT_CHANNEL - ); + super(nls.localize('apex_test_suite_build_text'), 'apex_test_suite_build_library', OUTPUT_CHANNEL); } - public async run( - response: ContinueResponse - ): Promise { + public async run(response: ContinueResponse): Promise { const connection = await workspaceContext.getConnection(); const testService = new TestService(connection); await testService.buildSuite(response.data.suitename, response.data.tests); @@ -180,28 +142,16 @@ const testSuiteCreator = new TestSuiteCreator(); const testSuiteBuilder = new TestSuiteBuilder(); export const apexTestSuiteAdd = async () => { - const commandlet = new SfCommandlet( - workspaceChecker, - testSuiteBuilder, - new ApexLibraryTestSuiteBuilder() - ); + const commandlet = new SfCommandlet(workspaceChecker, testSuiteBuilder, new ApexLibraryTestSuiteBuilder()); await commandlet.run(); }; export const apexTestSuiteCreate = async () => { - const commandlet = new SfCommandlet( - workspaceChecker, - testSuiteCreator, - new ApexLibraryTestSuiteBuilder() - ); + const commandlet = new SfCommandlet(workspaceChecker, testSuiteCreator, new ApexLibraryTestSuiteBuilder()); await commandlet.run(); }; export const apexTestSuiteRun = async () => { - const commandlet = new SfCommandlet( - workspaceChecker, - testSuiteSelector, - new ApexLibraryTestRunExecutor() - ); + const commandlet = new SfCommandlet(workspaceChecker, testSuiteSelector, new ApexLibraryTestRunExecutor()); await commandlet.run(); }; diff --git a/packages/salesforcedx-vscode-apex/src/commands/index.ts b/packages/salesforcedx-vscode-apex/src/commands/index.ts index 78200ed4a4..e5676db8a8 100644 --- a/packages/salesforcedx-vscode-apex/src/commands/index.ts +++ b/packages/salesforcedx-vscode-apex/src/commands/index.ts @@ -16,9 +16,5 @@ export { apexTestMethodRunCodeAction, apexTestMethodRunCodeActionDelegate } from './apexTestRunCodeAction'; -export { - apexTestSuiteAdd, - apexTestSuiteCreate, - apexTestSuiteRun -} from './apexTestSuite'; +export { apexTestSuiteAdd, apexTestSuiteCreate, apexTestSuiteRun } from './apexTestSuite'; export { launchApexReplayDebuggerWithCurrentFile } from './launchApexReplayDebuggerWithCurrentFile'; diff --git a/packages/salesforcedx-vscode-apex/src/commands/launchApexReplayDebuggerWithCurrentFile.ts b/packages/salesforcedx-vscode-apex/src/commands/launchApexReplayDebuggerWithCurrentFile.ts index a357967f56..66e3408aff 100644 --- a/packages/salesforcedx-vscode-apex/src/commands/launchApexReplayDebuggerWithCurrentFile.ts +++ b/packages/salesforcedx-vscode-apex/src/commands/launchApexReplayDebuggerWithCurrentFile.ts @@ -24,17 +24,13 @@ import { anonApexDebug } from './anonApexExecute'; export const launchApexReplayDebuggerWithCurrentFile = async () => { const editor = vscode.window.activeTextEditor; if (!editor) { - void notificationService.showErrorMessage( - nls.localize('unable_to_locate_editor') - ); + void notificationService.showErrorMessage(nls.localize('unable_to_locate_editor')); return; } const sourceUri = editor.document.uri; if (!sourceUri) { - void notificationService.showErrorMessage( - nls.localize('unable_to_locate_document') - ); + void notificationService.showErrorMessage(nls.localize('unable_to_locate_document')); return; } @@ -54,9 +50,7 @@ export const launchApexReplayDebuggerWithCurrentFile = async () => { return; } - void notificationService.showErrorMessage( - nls.localize('launch_apex_replay_debugger_unsupported_file') - ); + void notificationService.showErrorMessage(nls.localize('launch_apex_replay_debugger_unsupported_file')); }; const isLogFile = (sourceUri: vscode.Uri): boolean => { @@ -73,9 +67,7 @@ const launchReplayDebuggerLogFile = async (sourceUri: vscode.Uri) => { }); }; -const getApexTestClassName = async ( - sourceUri: vscode.Uri -): Promise => { +const getApexTestClassName = async (sourceUri: vscode.Uri): Promise => { if (!sourceUri) { return undefined; } @@ -110,9 +102,7 @@ const launchApexReplayDebugger = async (apexTestClassName: string) => { export class AnonApexLaunchReplayDebuggerExecutor extends SfCommandletExecutor<{}> { public build(): Command { - return new CommandBuilder( - nls.localize('launch_apex_replay_debugger_with_selected_file') - ) + return new CommandBuilder(nls.localize('launch_apex_replay_debugger_with_selected_file')) .withLogName('launch_apex_replay_debugger_with_selected_file') .build(); } diff --git a/packages/salesforcedx-vscode-apex/src/constants.ts b/packages/salesforcedx-vscode-apex/src/constants.ts index 045d6b1c73..874bdc0ea8 100644 --- a/packages/salesforcedx-vscode-apex/src/constants.ts +++ b/packages/salesforcedx-vscode-apex/src/constants.ts @@ -13,8 +13,7 @@ export const DEBUGGER_EXCEPTION_BREAKPOINTS = 'debugger/exceptionBreakpoints'; const startPos = new vscode.Position(0, 0); const endPos = new vscode.Position(0, 1); export const APEX_GROUP_RANGE = new vscode.Range(startPos, endPos); -export const SET_JAVA_DOC_LINK = - 'https://developer.salesforce.com/tools/vscode/en/vscode-desktop/java-setup'; +export const SET_JAVA_DOC_LINK = 'https://developer.salesforce.com/tools/vscode/en/vscode-desktop/java-setup'; export const SFDX_APEX_CONFIGURATION_NAME = 'salesforcedx-vscode-apex'; export const APEX_EXTENSION_NAME = 'salesforcedx-vscode-apex'; export const VSCODE_APEX_EXTENSION_NAME = `salesforce.${APEX_EXTENSION_NAME}`; diff --git a/packages/salesforcedx-vscode-apex/src/embeddedSoql/soqlCompletion.ts b/packages/salesforcedx-vscode-apex/src/embeddedSoql/soqlCompletion.ts index f3cec303ba..24c43e9e55 100644 --- a/packages/salesforcedx-vscode-apex/src/embeddedSoql/soqlCompletion.ts +++ b/packages/salesforcedx-vscode-apex/src/embeddedSoql/soqlCompletion.ts @@ -4,16 +4,7 @@ * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - commands, - CompletionItem, - CompletionList, - EndOfLine, - Position, - TextDocument, - Uri, - workspace -} from 'vscode'; +import { commands, CompletionItem, CompletionList, EndOfLine, Position, TextDocument, Uri, workspace } from 'vscode'; import ProtocolCompletionItem from 'vscode-languageclient/lib/common/protocolCompletionItem'; import { Middleware } from 'vscode-languageclient/node'; @@ -29,31 +20,16 @@ workspace.registerTextDocumentContentProvider('embedded-soql', { } }); -const insideSOQLBlock = ( - apexItems: ProtocolCompletionItem[] -): { queryText: string; location: any } | undefined => { - const soqlItem = apexItems.find( - i => i.label === SOQL_SPECIAL_COMPLETION_ITEM_LABEL - ); - return soqlItem - ? { queryText: soqlItem.detail as string, location: soqlItem.data } - : undefined; +const insideSOQLBlock = (apexItems: ProtocolCompletionItem[]): { queryText: string; location: any } | undefined => { + const soqlItem = apexItems.find(i => i.label === SOQL_SPECIAL_COMPLETION_ITEM_LABEL); + return soqlItem ? { queryText: soqlItem.detail as string, location: soqlItem.data } : undefined; }; -const insideApexBindingExpression = ( - document: TextDocument, - soqlQuery: string, - position: Position -): boolean => { +const insideApexBindingExpression = (document: TextDocument, soqlQuery: string, position: Position): boolean => { // Simple heuristic to detect when cursor is on a binding expression // (which might have been missed by Apex LSP) - const rangeAtCursor = document.getWordRangeAtPosition( - position, - /[:(_.\w)]+/ - ); - const wordAtCursor = rangeAtCursor - ? document.getText(rangeAtCursor) - : undefined; + const rangeAtCursor = document.getWordRangeAtPosition(position, /[:(_.\w)]+/); + const wordAtCursor = rangeAtCursor ? document.getText(rangeAtCursor) : undefined; return !!wordAtCursor && wordAtCursor.startsWith(':'); }; @@ -77,15 +53,12 @@ const getSOQLVirtualContent = ( ' ' + soqlBlock.queryText + ' ' + - blankedContent.slice( - soqlBlock.location.startIndex + soqlBlock.queryText.length + 2 - ); + blankedContent.slice(soqlBlock.location.startIndex + soqlBlock.queryText.length + 2); return content; }; export const soqlMiddleware: Middleware = { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore provideCompletionItem: async (document, position, context, token, next) => { const apexCompletionItems = await next(document, position, context, token); @@ -95,24 +68,14 @@ export const soqlMiddleware: Middleware = { const items: ProtocolCompletionItem[] = Array.isArray(apexCompletionItems) ? (apexCompletionItems as ProtocolCompletionItem[]) - : ((apexCompletionItems ) - .items as ProtocolCompletionItem[]); + : (apexCompletionItems.items as ProtocolCompletionItem[]); const soqlBlock = insideSOQLBlock(items); if (soqlBlock) { - if ( - !insideApexBindingExpression(document, soqlBlock.queryText, position) - ) { - return await doSOQLCompletion( - document, - position.with({ character: position.character }), - context, - soqlBlock - ); + if (!insideApexBindingExpression(document, soqlBlock.queryText, position)) { + return await doSOQLCompletion(document, position.with({ character: position.character }), context, soqlBlock); } else { - return items.filter( - i => i.label !== SOQL_SPECIAL_COMPLETION_ITEM_LABEL - ); + return items.filter(i => i.label !== SOQL_SPECIAL_COMPLETION_ITEM_LABEL); } } else return apexCompletionItems; } @@ -125,10 +88,7 @@ const doSOQLCompletion = async ( soqlBlock: any ): Promise> => { const originalUri = document.uri.path; - virtualDocumentContents.set( - originalUri, - getSOQLVirtualContent(document, position, soqlBlock) - ); + virtualDocumentContents.set(originalUri, getSOQLVirtualContent(document, position, soqlBlock)); const vdocUriString = `embedded-soql://soql/${originalUri}.soql`; const vdocUri = Uri.parse(vdocUriString); diff --git a/packages/salesforcedx-vscode-apex/src/index.ts b/packages/salesforcedx-vscode-apex/src/index.ts index 62ed5a7c4a..457ac3d69a 100644 --- a/packages/salesforcedx-vscode-apex/src/index.ts +++ b/packages/salesforcedx-vscode-apex/src/index.ts @@ -5,10 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - getTestResultsFolder, - ActivationTracker -} from '@salesforce/salesforcedx-utils-vscode'; +import { getTestResultsFolder, ActivationTracker } from '@salesforce/salesforcedx-utils-vscode'; import * as path from 'path'; import * as vscode from 'vscode'; import { ApexLanguageClient } from './apexLanguageClient'; @@ -59,28 +56,17 @@ export const activate = async (extensionContext: vscode.ExtensionContext) => { // Telemetry await telemetryService.initializeService(extensionContext); - const activationTracker = new ActivationTracker( - extensionContext, - telemetryService - ); + const activationTracker = new ActivationTracker(extensionContext, telemetryService); const languageServerStatusBarItem = new ApexLSPStatusBarItem(); const testOutlineProvider = getTestOutlineProvider(); if (vscode.workspace && vscode.workspace.workspaceFolders) { - const apexDirPath = getTestResultsFolder( - vscode.workspace.workspaceFolders[0].uri.fsPath, - 'apex' - ); + const apexDirPath = getTestResultsFolder(vscode.workspace.workspaceFolders[0].uri.fsPath, 'apex'); const testResultOutput = path.join(apexDirPath, '*.json'); - const testResultFileWatcher = - vscode.workspace.createFileSystemWatcher(testResultOutput); - testResultFileWatcher.onDidCreate(uri => - testOutlineProvider.onResultFileCreate(apexDirPath, uri.fsPath) - ); - testResultFileWatcher.onDidChange(uri => - testOutlineProvider.onResultFileCreate(apexDirPath, uri.fsPath) - ); + const testResultFileWatcher = vscode.workspace.createFileSystemWatcher(testResultOutput); + testResultFileWatcher.onDidCreate(uri => testOutlineProvider.onResultFileCreate(apexDirPath, uri.fsPath)); + testResultFileWatcher.onDidChange(uri => testOutlineProvider.onResultFileCreate(apexDirPath, uri.fsPath)); extensionContext.subscriptions.push(testResultFileWatcher); } else { @@ -123,9 +109,8 @@ const registerCommands = (): vscode.Disposable => { // Colorize code coverage const statusBarToggle = new StatusBarToggle(); const colorizer = new CodeCoverage(statusBarToggle); - const apexToggleColorizerCmd = vscode.commands.registerCommand( - 'sf.apex.toggle.colorizer', - () => colorizer.toggleCoverage() + const apexToggleColorizerCmd = vscode.commands.registerCommand('sf.apex.toggle.colorizer', () => + colorizer.toggleCoverage() ); // Customer-facing commands @@ -137,10 +122,7 @@ const registerCommands = (): vscode.Disposable => { 'sf.apex.test.last.class.run', apexTestClassRunCodeAction ); - const apexTestClassRunCmd = vscode.commands.registerCommand( - 'sf.apex.test.class.run', - apexTestClassRunCodeAction - ); + const apexTestClassRunCmd = vscode.commands.registerCommand('sf.apex.test.class.run', apexTestClassRunCodeAction); const apexTestMethodRunDelegateCmd = vscode.commands.registerCommand( 'sf.apex.test.method.run.delegate', apexTestMethodRunCodeActionDelegate @@ -153,59 +135,28 @@ const registerCommands = (): vscode.Disposable => { 'sf.apex.debug.method.run.delegate', apexDebugMethodRunCodeActionDelegate ); - const anonApexRunDelegateCmd = vscode.commands.registerCommand( - 'sf.anon.apex.run.delegate', - anonApexExecute - ); - const anonApexDebugDelegateCmd = vscode.commands.registerCommand( - 'sf.anon.apex.debug.delegate', - anonApexDebug - ); - const apexLogGetCmd = vscode.commands.registerCommand( - 'sf.apex.log.get', - apexLogGet - ); + const anonApexRunDelegateCmd = vscode.commands.registerCommand('sf.anon.apex.run.delegate', anonApexExecute); + const anonApexDebugDelegateCmd = vscode.commands.registerCommand('sf.anon.apex.debug.delegate', anonApexDebug); + const apexLogGetCmd = vscode.commands.registerCommand('sf.apex.log.get', apexLogGet); const apexTestLastMethodRunCmd = vscode.commands.registerCommand( 'sf.apex.test.last.method.run', apexTestMethodRunCodeAction ); - const apexTestMethodRunCmd = vscode.commands.registerCommand( - 'sf.apex.test.method.run', - apexTestMethodRunCodeAction - ); - const apexTestSuiteCreateCmd = vscode.commands.registerCommand( - 'sf.apex.test.suite.create', - apexTestSuiteCreate - ); - const apexTestSuiteRunCmd = vscode.commands.registerCommand( - 'sf.apex.test.suite.run', - apexTestSuiteRun - ); - const apexTestSuiteAddCmd = vscode.commands.registerCommand( - 'sf.apex.test.suite.add', - apexTestSuiteAdd - ); - const apexTestRunCmd = vscode.commands.registerCommand( - 'sf.apex.test.run', - apexTestRun - ); - const anonApexExecuteDocumentCmd = vscode.commands.registerCommand( - 'sf.anon.apex.execute.document', - anonApexExecute - ); - const anonApexDebugDocumentCmd = vscode.commands.registerCommand( - 'sf.apex.debug.document', - anonApexDebug - ); + const apexTestMethodRunCmd = vscode.commands.registerCommand('sf.apex.test.method.run', apexTestMethodRunCodeAction); + const apexTestSuiteCreateCmd = vscode.commands.registerCommand('sf.apex.test.suite.create', apexTestSuiteCreate); + const apexTestSuiteRunCmd = vscode.commands.registerCommand('sf.apex.test.suite.run', apexTestSuiteRun); + const apexTestSuiteAddCmd = vscode.commands.registerCommand('sf.apex.test.suite.add', apexTestSuiteAdd); + const apexTestRunCmd = vscode.commands.registerCommand('sf.apex.test.run', apexTestRun); + const anonApexExecuteDocumentCmd = vscode.commands.registerCommand('sf.anon.apex.execute.document', anonApexExecute); + const anonApexDebugDocumentCmd = vscode.commands.registerCommand('sf.apex.debug.document', anonApexDebug); const anonApexExecuteSelectionCmd = vscode.commands.registerCommand( 'sf.anon.apex.execute.selection', anonApexExecute ); - const launchApexReplayDebuggerWithCurrentFileCmd = - vscode.commands.registerCommand( - 'sf.launch.apex.replay.debugger.with.current.file', - launchApexReplayDebuggerWithCurrentFile - ); + const launchApexReplayDebuggerWithCurrentFileCmd = vscode.commands.registerCommand( + 'sf.launch.apex.replay.debugger.with.current.file', + launchApexReplayDebuggerWithCurrentFile + ); return vscode.Disposable.from( anonApexDebugDelegateCmd, @@ -239,64 +190,49 @@ const registerTestView = (): vscode.Disposable => { // Test View const testViewItems = new Array(); - const testProvider = vscode.window.registerTreeDataProvider( - testOutlineProvider.getId(), - testOutlineProvider - ); + const testProvider = vscode.window.registerTreeDataProvider(testOutlineProvider.getId(), testOutlineProvider); testViewItems.push(testProvider); // Run Test Button on Test View command testViewItems.push( - vscode.commands.registerCommand(`${testOutlineProvider.getId()}.run`, () => - testRunner.runAllApexTests() - ) + vscode.commands.registerCommand(`${testOutlineProvider.getId()}.run`, () => testRunner.runAllApexTests()) ); // Show Error Message command testViewItems.push( - vscode.commands.registerCommand( - `${testOutlineProvider.getId()}.showError`, - (test: TestNode) => testRunner.showErrorMessage(test) + vscode.commands.registerCommand(`${testOutlineProvider.getId()}.showError`, (test: TestNode) => + testRunner.showErrorMessage(test) ) ); // Show Definition command testViewItems.push( - vscode.commands.registerCommand( - `${testOutlineProvider.getId()}.goToDefinition`, - (test: TestNode) => testRunner.showErrorMessage(test) + vscode.commands.registerCommand(`${testOutlineProvider.getId()}.goToDefinition`, (test: TestNode) => + testRunner.showErrorMessage(test) ) ); // Run Class Tests command testViewItems.push( - vscode.commands.registerCommand( - `${testOutlineProvider.getId()}.runClassTests`, - (test: TestNode) => - testRunner.runApexTests([test.name], TestRunType.Class) + vscode.commands.registerCommand(`${testOutlineProvider.getId()}.runClassTests`, (test: TestNode) => + testRunner.runApexTests([test.name], TestRunType.Class) ) ); // Run Single Test command testViewItems.push( - vscode.commands.registerCommand( - `${testOutlineProvider.getId()}.runSingleTest`, - (test: TestNode) => - testRunner.runApexTests([test.name], TestRunType.Method) + vscode.commands.registerCommand(`${testOutlineProvider.getId()}.runSingleTest`, (test: TestNode) => + testRunner.runApexTests([test.name], TestRunType.Method) ) ); // Refresh Test View command testViewItems.push( - vscode.commands.registerCommand( - `${testOutlineProvider.getId()}.refresh`, - () => { - if (languageClientUtils.getStatus().isReady()) { - return testOutlineProvider.refresh(); - } + vscode.commands.registerCommand(`${testOutlineProvider.getId()}.refresh`, () => { + if (languageClientUtils.getStatus().isReady()) { + return testOutlineProvider.refresh(); } - ) + }) ); // Collapse All Apex Tests command testViewItems.push( - vscode.commands.registerCommand( - `${testOutlineProvider.getId()}.collapseAll`, - () => testOutlineProvider.collapseAll() + vscode.commands.registerCommand(`${testOutlineProvider.getId()}.collapseAll`, () => + testOutlineProvider.collapseAll() ) ); @@ -317,9 +253,7 @@ const createLanguageClient = async ( // Initialize Apex language server try { const langClientHRStart = process.hrtime(); - languageClientUtils.setClientInstance( - await languageServer.createLanguageServer(extensionContext) - ); + languageClientUtils.setClientInstance(await languageServer.createLanguageServer(extensionContext)); const languageClient = languageClientUtils.getClientInstance(); @@ -327,21 +261,14 @@ const createLanguageClient = async ( languageClient.errorHandler?.addListener('error', (message: string) => { languageServerStatusBarItem.error(message); }); - languageClient.errorHandler?.addListener( - 'restarting', - (count: number) => { - languageServerStatusBarItem.error( - nls - .localize('apex_language_server_quit_and_restarting') - .replace('$N', `${count}`) - ); - } - ); - languageClient.errorHandler?.addListener('startFailed', () => { + languageClient.errorHandler?.addListener('restarting', (count: number) => { languageServerStatusBarItem.error( - nls.localize('apex_language_server_failed_activate') + nls.localize('apex_language_server_quit_and_restarting').replace('$N', `${count}`) ); }); + languageClient.errorHandler?.addListener('startFailed', () => { + languageServerStatusBarItem.error(nls.localize('apex_language_server_failed_activate')); + }); // TODO: the client should not be undefined. We should refactor the code to // so there is no question as to whether the client is defined or not. @@ -351,25 +278,15 @@ const createLanguageClient = async ( telemetryService.sendEventData('apexLSPStartup', undefined, { activationTime: startTime }); - await indexerDoneHandler( - retrieveEnableSyncInitJobs(), - languageClient, - languageServerStatusBarItem - ); - extensionContext.subscriptions.push( - languageClientUtils.getClientInstance()! - ); + await indexerDoneHandler(retrieveEnableSyncInitJobs(), languageClient, languageServerStatusBarItem); + extensionContext.subscriptions.push(languageClientUtils.getClientInstance()!); } else { languageClientUtils.setStatus( ClientStatus.Error, - `${nls.localize( - 'apex_language_server_failed_activate' - )} - ${nls.localize('unknown')}` + `${nls.localize('apex_language_server_failed_activate')} - ${nls.localize('unknown')}` ); languageServerStatusBarItem.error( - `${nls.localize( - 'apex_language_server_failed_activate' - )} - ${nls.localize('unknown')}` + `${nls.localize('apex_language_server_failed_activate')} - ${nls.localize('unknown')}` ); } } catch (e) { @@ -379,20 +296,11 @@ const createLanguageClient = async ( } else if (e instanceof Error) { errorMessage = e.message ?? nls.localize('unknown_error'); } - if ( - errorMessage.includes( - nls.localize('wrong_java_version_text', SET_JAVA_DOC_LINK) - ) - ) { + if (errorMessage.includes(nls.localize('wrong_java_version_text', SET_JAVA_DOC_LINK))) { errorMessage = nls.localize('wrong_java_version_short'); } languageClientUtils.setStatus(ClientStatus.Error, errorMessage); - languageServerStatusBarItem.error( - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions - `${nls.localize( - 'apex_language_server_failed_activate' - )} - ${errorMessage}` - ); + languageServerStatusBarItem.error(`${nls.localize('apex_language_server_failed_activate')} - ${errorMessage}`); } }; @@ -408,16 +316,10 @@ export const indexerDoneHandler = async ( // Language client will get notified once async init jobs are done languageClientUtils.setStatus(ClientStatus.Indexing, ''); languageClient.onNotification(API.doneIndexing, () => { - void extensionUtils.setClientReady( - languageClient, - languageServerStatusBarItem - ); + void extensionUtils.setClientReady(languageClient, languageServerStatusBarItem); }); } else { // indexer must be running at the point - await extensionUtils.setClientReady( - languageClient, - languageServerStatusBarItem - ); + await extensionUtils.setClientReady(languageClient, languageServerStatusBarItem); } }; diff --git a/packages/salesforcedx-vscode-apex/src/languageServer.ts b/packages/salesforcedx-vscode-apex/src/languageServer.ts index 2944958df9..b92c54a24b 100644 --- a/packages/salesforcedx-vscode-apex/src/languageServer.ts +++ b/packages/salesforcedx-vscode-apex/src/languageServer.ts @@ -7,11 +7,7 @@ import * as path from 'path'; import * as vscode from 'vscode'; -import { - Executable, - LanguageClientOptions, - RevealOutputChannelOn -} from 'vscode-languageclient/node'; +import { Executable, LanguageClientOptions, RevealOutputChannelOn } from 'vscode-languageclient/node'; import { ApexErrorHandler } from './apexErrorHandler'; import { ApexLanguageClient } from './apexLanguageClient'; import { LSP_ERR, UBER_JAR_NAME } from './constants'; @@ -23,10 +19,8 @@ import { getTelemetryService } from './telemetry/telemetry'; const JDWP_DEBUG_PORT = 2739; const APEX_LANGUAGE_SERVER_MAIN = 'apex.jorje.lsp.ApexLanguageServerLauncher'; -const SUSPEND_LANGUAGE_SERVER_STARTUP = - process.env.SUSPEND_LANGUAGE_SERVER_STARTUP === 'true'; -const LANGUAGE_SERVER_LOG_LEVEL = - process.env.LANGUAGE_SERVER_LOG_LEVEL ?? 'ERROR'; +const SUSPEND_LANGUAGE_SERVER_STARTUP = process.env.SUSPEND_LANGUAGE_SERVER_STARTUP === 'true'; +const LANGUAGE_SERVER_LOG_LEVEL = process.env.LANGUAGE_SERVER_LOG_LEVEL ?? 'ERROR'; // eslint-disable-next-line no-var declare var v8debug: any; @@ -35,10 +29,7 @@ const startedInDebugMode = (): boolean => { if (args) { return args.some( (arg: any) => - /^--debug=?/.test(arg) || - /^--debug-brk=?/.test(arg) || - /^--inspect=?/.test(arg) || - /^--inspect-brk=?/.test(arg) + /^--debug=?/.test(arg) || /^--debug-brk=?/.test(arg) || /^--inspect=?/.test(arg) || /^--inspect-brk=?/.test(arg) ); } return false; @@ -46,9 +37,7 @@ const startedInDebugMode = (): boolean => { const DEBUG = typeof v8debug === 'object' || startedInDebugMode(); -const createServer = async ( - extensionContext: vscode.ExtensionContext -): Promise => { +const createServer = async (extensionContext: vscode.ExtensionContext): Promise => { const telemetryService = await getTelemetryService(); try { const requirementsData = await requirements.resolveRequirements(); @@ -57,19 +46,14 @@ const createServer = async ( extensionContext.extension.packageJSON.languageServerDir, UBER_JAR_NAME ); - const javaExecutable = path.resolve( - `${requirementsData.java_home}/bin/java` - ); + const javaExecutable = path.resolve(`${requirementsData.java_home}/bin/java`); const jvmMaxHeap = requirementsData.java_memory; const enableSemanticErrors: boolean = vscode.workspace .getConfiguration() .get('salesforcedx-vscode-apex.enable-semantic-errors', false); const enableCompletionStatistics: boolean = vscode.workspace .getConfiguration() - .get( - 'salesforcedx-vscode-apex.advanced.enable-completion-statistics', - false - ); + .get('salesforcedx-vscode-apex.advanced.enable-completion-statistics', false); const args: string[] = [ '-cp', @@ -91,14 +75,13 @@ const createServer = async ( args.push( '-Dtrace.protocol=false', `-Dapex.lsp.root.log.level=${LANGUAGE_SERVER_LOG_LEVEL}`, - `-agentlib:jdwp=transport=dt_socket,server=y,suspend=${SUSPEND_LANGUAGE_SERVER_STARTUP ? 'y' : 'n' + `-agentlib:jdwp=transport=dt_socket,server=y,suspend=${ + SUSPEND_LANGUAGE_SERVER_STARTUP ? 'y' : 'n' },address=*:${JDWP_DEBUG_PORT},quiet=y` ); if (process.env.YOURKIT_PROFILER_AGENT) { if (SUSPEND_LANGUAGE_SERVER_STARTUP) { - throw new Error( - 'Cannot suspend language server startup with profiler agent enabled.' - ); + throw new Error('Cannot suspend language server startup with profiler agent enabled.'); } args.push(`-agentpath:${process.env.YOURKIT_PROFILER_AGENT}`); } @@ -135,21 +118,12 @@ const protocol2CodeConverter = (value: string) => { return vscode.Uri.parse(value); }; -export const createLanguageServer = async ( - extensionContext: vscode.ExtensionContext -): Promise => { +export const createLanguageServer = async (extensionContext: vscode.ExtensionContext): Promise => { const telemetryService = await getTelemetryService(); const server = await createServer(extensionContext); - const client = new ApexLanguageClient( - 'apex', - nls.localize('client_name'), - server, - buildClientOptions() - ); - - client.onTelemetry(data => - telemetryService.sendEventData('apexLSPLog', data.properties, data.measures) - ); + const client = new ApexLanguageClient('apex', nls.localize('client_name'), server, buildClientOptions()); + + client.onTelemetry(data => telemetryService.sendEventData('apexLSPLog', data.properties, data.measures)); return client; }; diff --git a/packages/salesforcedx-vscode-apex/src/languageServerOrphanHandler.ts b/packages/salesforcedx-vscode-apex/src/languageServerOrphanHandler.ts index ac24218df0..f9c9c4fbbc 100644 --- a/packages/salesforcedx-vscode-apex/src/languageServerOrphanHandler.ts +++ b/packages/salesforcedx-vscode-apex/src/languageServerOrphanHandler.ts @@ -25,8 +25,7 @@ export const COMMAND = nls.localize('process_command'); // these messages contain replaceable parameters, cannot localize yet export const CONFIRM = 'terminate_processes_confirm'; -export const TERMINATE_ORPHANED_PROCESSES = - 'terminate_orphaned_language_server_instances'; +export const TERMINATE_ORPHANED_PROCESSES = 'terminate_orphaned_language_server_instances'; export const TERMINATED_PROCESS = 'terminated_orphaned_process'; export const TERMINATE_FAILED = 'terminate_failed'; @@ -50,11 +49,7 @@ const resolveAnyFoundOrphanLanguageServers = async (): Promise => { showTerminationFailed(processInfo, err); telemetryService.sendException( APEX_LSP_ORPHAN, - typeof err === 'string' - ? err - : err?.message - ? err.message - : 'unknown' + typeof err === 'string' ? err : err?.message ? err.message : 'unknown' ); } } @@ -72,9 +67,7 @@ const resolveAnyFoundOrphanLanguageServers = async (): Promise => { * @param orphanedProcesses * @returns boolean */ -const getResolutionForOrphanProcesses = async ( - orphanedProcesses: ProcessDetail[] -): Promise => { +const getResolutionForOrphanProcesses = async (orphanedProcesses: ProcessDetail[]): Promise => { const orphanedCount = orphanedProcesses.length; if (orphanedCount === 0) { @@ -90,10 +83,7 @@ const getResolutionForOrphanProcesses = async ( SHOW_PROCESSES_BTN )) ?? DISMISSED_DEFAULT; - if ( - requestsTermination(choice) && - (await terminationConfirmation(orphanedCount)) - ) { + if (requestsTermination(choice) && (await terminationConfirmation(orphanedCount))) { return true; } else if (showProcesses(choice)) { showOrphansInChannel(orphanedProcesses); @@ -117,7 +107,7 @@ const showOrphansInChannel = (orphanedProcesses: ProcessDetail[]) => { command: processInfo.command.length <= 70 ? processInfo.command - : processInfo.command.match(/.{1,70}/g)?.join('\n') ?? '' + : (processInfo.command.match(/.{1,70}/g)?.join('\n') ?? '') }; }); @@ -130,14 +120,8 @@ const showOrphansInChannel = (orphanedProcesses: ProcessDetail[]) => { channelService.appendLine(tableString); }; -const terminationConfirmation = async ( - orphanedCount: number -): Promise => { - const choice = await vscode.window.showWarningMessage( - nls.localize(CONFIRM, orphanedCount), - YES, - CANCEL - ); +const terminationConfirmation = async (orphanedCount: number): Promise => { + const choice = await vscode.window.showWarningMessage(nls.localize(CONFIRM, orphanedCount), YES, CANCEL); return choice === YES; }; @@ -150,15 +134,11 @@ const showProcesses = (choice: string): boolean => { }; const showProcessTerminated = (processDetail: ProcessDetail): void => { - channelService.appendLine( - nls.localize(TERMINATED_PROCESS, processDetail.pid) - ); + channelService.appendLine(nls.localize(TERMINATED_PROCESS, processDetail.pid)); }; const showTerminationFailed = (processInfo: ProcessDetail, err: any): void => { - channelService.appendLine( - nls.localize(TERMINATE_FAILED, processInfo.pid, err.message) - ); + channelService.appendLine(nls.localize(TERMINATE_FAILED, processInfo.pid, err.message)); }; export const languageServerOrphanHandler = { diff --git a/packages/salesforcedx-vscode-apex/src/languageUtils/extensionUtils.ts b/packages/salesforcedx-vscode-apex/src/languageUtils/extensionUtils.ts index 31554b8133..266e1b7351 100644 --- a/packages/salesforcedx-vscode-apex/src/languageUtils/extensionUtils.ts +++ b/packages/salesforcedx-vscode-apex/src/languageUtils/extensionUtils.ts @@ -7,10 +7,7 @@ import { ApexLanguageClient } from '../apexLanguageClient'; import ApexLSPStatusBarItem from '../apexLspStatusBarItem'; import { getTestOutlineProvider } from '../views/testOutlineProvider'; -import { - ClientStatus, - languageClientUtils -} from './index'; +import { ClientStatus, languageClientUtils } from './index'; const setClientReady = async ( languageClient: ApexLanguageClient, diff --git a/packages/salesforcedx-vscode-apex/src/languageUtils/languageClientUtils.ts b/packages/salesforcedx-vscode-apex/src/languageUtils/languageClientUtils.ts index 77fd11c59c..6d89dde113 100644 --- a/packages/salesforcedx-vscode-apex/src/languageUtils/languageClientUtils.ts +++ b/packages/salesforcedx-vscode-apex/src/languageUtils/languageClientUtils.ts @@ -5,15 +5,8 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ import { ApexLanguageClient } from '../apexLanguageClient'; -import { - DEBUGGER_EXCEPTION_BREAKPOINTS, - DEBUGGER_LINE_BREAKPOINTS -} from '../constants'; -import { - ApexLSPConverter, - ApexTestMethod, - LSPApexTestMethod -} from '../views/lspConverter'; +import { DEBUGGER_EXCEPTION_BREAKPOINTS, DEBUGGER_LINE_BREAKPOINTS } from '../constants'; +import { ApexLSPConverter, ApexTestMethod, LSPApexTestMethod } from '../views/lspConverter'; export class LanguageClientUtils { private static instance: LanguageClientUtils; @@ -95,9 +88,7 @@ export const getApexTests = async (): Promise => { const ret = new Array(); const languageClient = LanguageClientUtils.getInstance().getClientInstance(); if (languageClient) { - response = (await languageClient.sendRequest( - 'test/getTestMethods' - )); + response = await languageClient.sendRequest('test/getTestMethods'); } for (const requestInfo of response) { ret.push(ApexLSPConverter.toApexTestMethod(requestInfo)); diff --git a/packages/salesforcedx-vscode-apex/src/languageUtils/languageServerUtils.ts b/packages/salesforcedx-vscode-apex/src/languageUtils/languageServerUtils.ts index c3441f24d2..08168ca859 100644 --- a/packages/salesforcedx-vscode-apex/src/languageUtils/languageServerUtils.ts +++ b/packages/salesforcedx-vscode-apex/src/languageUtils/languageServerUtils.ts @@ -7,11 +7,7 @@ import { execSync } from 'child_process'; import { SIGKILL } from 'constants'; -import { - APEX_LSP_ORPHAN, - POWERSHELL_NOT_FOUND, - UBER_JAR_NAME -} from '../constants'; +import { APEX_LSP_ORPHAN, POWERSHELL_NOT_FOUND, UBER_JAR_NAME } from '../constants'; import { getTelemetryService } from '../telemetry/telemetry'; export type ProcessDetail = { @@ -45,12 +41,7 @@ const findAndCheckOrphanedProcesses = async (): Promise => { const command = commandParts.join(' '); return { pid, ppid, command, orphaned: false }; }) - .filter( - processInfo => - !['ps', 'grep', 'Get-CimInstance'].some(c => - processInfo.command.includes(c) - ) - ) + .filter(processInfo => !['ps', 'grep', 'Get-CimInstance'].some(c => processInfo.command.includes(c))) .filter(processInfo => processInfo.command.includes(UBER_JAR_NAME)); if (processes.length === 0) { diff --git a/packages/salesforcedx-vscode-apex/src/messages/i18n.ja.ts b/packages/salesforcedx-vscode-apex/src/messages/i18n.ja.ts index a0a78c4db8..3c6437a8e5 100644 --- a/packages/salesforcedx-vscode-apex/src/messages/i18n.ja.ts +++ b/packages/salesforcedx-vscode-apex/src/messages/i18n.ja.ts @@ -20,10 +20,8 @@ export const messages = { apex_execute_runtime_success: '正常に実行されました。', apex_execute_text: '匿名 Apex を実行', apex_execute_unexpected_error: '予期せぬエラー', - apex_language_server_failed_activate: - 'Apex 言語サーバを有効化できませんでした。', - cannot_determine_workspace: - 'ワークスペースのフォルダを特定できませんでした。', + apex_language_server_failed_activate: 'Apex 言語サーバを有効化できませんでした。', + cannot_determine_workspace: 'ワークスペースのフォルダを特定できませんでした。', channel_name: 'Apex', client_name: 'Apex 言語サーバ', colorizer_no_code_coverage_on_project: @@ -35,18 +33,15 @@ export const messages = { colorizer_no_code_coverage_current_file: 'このファイルでコードカバレッジの情報が見つかりませんでした。ユーザまたはワークスペースの設定で、"salesforcedx-vscode-core.retrieve-test-code-coverage" を true に設定してください。次に、このファイルを含むApex テストを実行してください。Apex テストのサイドバーまたは、ファイル内の テストの実行 または すべてのテストの実行 のコードレンズを使用してテストを実行できます。', colorizer_statusbar_hover_text: 'Apex コードカバレッジを強調表示', - anon_apex_execute_document_text: - 'SFDX: エディタの内容で匿名 Apex コードを実行', - anon_apex_execute_selection_text: - 'SFDX: 現在選択されているテキストで匿名 Apex コードを実行', + anon_apex_execute_document_text: 'SFDX: エディタの内容で匿名 Apex コードを実行', + anon_apex_execute_selection_text: 'SFDX: 現在選択されているテキストで匿名 Apex コードを実行', apex_log_get_text: 'SFDX: Apex デバッグログを取得', apex_log_get_no_logs_text: 'Apex デバッグログが見つかりませんでした。', apex_log_get_pick_log_text: '取得する Apex デバッグログを選択', apex_log_list_text: 'Apex デバッグログを取得しています', apex_test_run_all_test_label: 'すべてのテスト', apex_test_run_all_local_test_label: 'すべてのローカルのテスト', - apex_test_run_all_tests_description_text: - '現在の組織にあるすべてのテストを実行', + apex_test_run_all_tests_description_text: '現在の組織にあるすべてのテストを実行', apex_test_run_all_local_tests_description_text: 'インストールされた管理パッケージに含まれるテストを除き、現在の組織にあるすべてのテストを実行', apex_test_run_codeAction_description_text: 'Apex テストを実行', @@ -69,17 +64,14 @@ export const messages = { 'ローカルの Java ランタイム (%s) はサポートされていません。VS Code の設定の salesforcedx-vscode-apex.java.home に現在のプロジェクト以外のランタイムのパスを設定してください。詳細については、[Java 設定](%s) を参照してください。', source_jdk_home_env_var_text: '環境変数 JDK_HOME', source_java_home_env_var_text: '環境変数 JAVA_HOME', - source_java_home_setting_text: - 'VS Code の設定で定義される salesforcedx-vscode-apex.java.home の設定', + source_java_home_setting_text: 'VS Code の設定で定義される salesforcedx-vscode-apex.java.home の設定', source_missing_text: '指定されたフォルダ %s は存在しません。Salesforce Apex 拡張機能の設定方法についての詳細は、[Java 設定](%s) を参照してください。', wrong_java_version_text: 'サポートされていない Java のバージョンが検出されました。拡張機能を実行するには、[Java 11](https://www.oracle.com/technetwork/java/javase/downloads/jdk11-downloads-5066655.html)、[Java 17](https://www.oracle.com/java/technologies/downloads/#java17)、または [Java 21](https://www.oracle.com/java/technologies/downloads/#java21) をダウンロードし、インストールしてください。詳細については、[Java バージョンを設定する](%s) を参照してください。', apex_test_suite_build_text: 'SFDX: Apex テストスイートを作成', - unable_to_locate_editor: - 'ソースファイルに対してのみこのコマンドを実行できます。', - unable_to_locate_document: - 'ソースファイルに対してのみこのコマンドを実行できます。', + unable_to_locate_editor: 'ソースファイルに対してのみこのコマンドを実行できます。', + unable_to_locate_document: 'ソースファイルに対してのみこのコマンドを実行できます。', launch_apex_replay_debugger_unsupported_file: '匿名 Apex ファイル、Apex テストファイル、または Apex デバッグログファイルに対してのみこのコマンドを実行できます。' }; diff --git a/packages/salesforcedx-vscode-apex/src/messages/i18n.ts b/packages/salesforcedx-vscode-apex/src/messages/i18n.ts index 705cf7740f..768543dda1 100644 --- a/packages/salesforcedx-vscode-apex/src/messages/i18n.ts +++ b/packages/salesforcedx-vscode-apex/src/messages/i18n.ts @@ -20,15 +20,11 @@ export const messages = { apex_execute_runtime_success: 'Executed successfully.', apex_execute_text: 'Execute Anonymous Apex', apex_execute_unexpected_error: 'Unexpected error', - apex_language_server_loading: - 'Indexing Apex files. Hold tight, almost ready… $(sync~spin)', + apex_language_server_loading: 'Indexing Apex files. Hold tight, almost ready… $(sync~spin)', apex_language_server_loaded: 'Indexing complete $(check)', - apex_language_server_failed_activate: - 'Unable to activate the Apex Language Server', - apex_language_server_quit_and_restarting: - 'Apex Language Server has stopped. Restarting… %d of 5', - cannot_determine_workspace: - 'Unable to determine workspace folders for workspace', + apex_language_server_failed_activate: 'Unable to activate the Apex Language Server', + apex_language_server_quit_and_restarting: 'Apex Language Server has stopped. Restarting… %d of 5', + cannot_determine_workspace: 'Unable to determine workspace folders for workspace', channel_name: 'Apex', client_name: 'Apex Language Server', colorizer_no_code_coverage_on_project: @@ -40,10 +36,8 @@ export const messages = { colorizer_no_code_coverage_current_file: 'No code coverage information was found for file %s. Set "salesforcedx-vscode-core.retrieve-test-code-coverage": true in your user or workspace settings. Then, run Apex tests that include methods in this file. You can run tests from the Apex Tests sidebar or using the Run Tests or Run All Tests code lens within the file.', colorizer_statusbar_hover_text: 'Highlight Apex Code Coverage', - anon_apex_execute_document_text: - 'SFDX: Execute Anonymous Apex with Editor Contents', - anon_apex_execute_selection_text: - 'SFDX: Execute Anonymous Apex with Currently Selected Text', + anon_apex_execute_document_text: 'SFDX: Execute Anonymous Apex with Editor Contents', + anon_apex_execute_selection_text: 'SFDX: Execute Anonymous Apex with Currently Selected Text', apex_log_get_text: 'SFDX: Get Apex Debug Logs', apex_log_get_no_logs_text: 'No Apex debug logs were found', apex_log_get_pick_log_text: 'Pick an Apex debug log to get', @@ -70,15 +64,13 @@ export const messages = { 'Local Java runtime (%s) is unsupported. Set the salesforcedx-vscode-apex.java.home VS Code setting to a runtime outside of the current project. For more information, go to [Set Your Java Version](%s).', source_java_home_env_var_text: 'The JAVA_HOME environment variable', source_jdk_home_env_var_text: 'The JDK_HOME environment variable', - source_java_home_setting_text: - 'The salesforcedx-vscode-apex.java.home setting defined in VS Code settings', + source_java_home_setting_text: 'The salesforcedx-vscode-apex.java.home setting defined in VS Code settings', source_missing_text: '%s points to a missing folder. For information on how to setup the Salesforce Apex extension, see [Set Your Java Version](%s).', wrong_java_version_text: 'An unsupported Java version was detected. Download and install [Java 11](https://www.oracle.com/technetwork/java/javase/downloads/jdk11-downloads-5066655.html), [Java 17](https://www.oracle.com/java/technologies/downloads/#java17) or [Java 21](https://www.oracle.com/java/technologies/downloads/#java21) to run the extensions. For more information, see [Set Your Java Version](%s).', wrong_java_version_short: 'Unsupported Java version', - java_version_check_command_failed: - 'Running java command %s failed with error: %s', + java_version_check_command_failed: 'Running java command %s failed with error: %s', apex_test_suite_build_text: 'SFDX: Build Apex Test Suite', unable_to_locate_editor: 'You can run this command only on a source file.', unable_to_locate_document: 'You can run this command only on a source file.', @@ -88,10 +80,8 @@ export const messages = { 'Found %d orphaned Apex Language Server processes.\nWould you like to terminate them?', terminate_processes: 'Terminate Processes', terminate_show_processes: 'Show Processes', - terminate_failed: - 'Failed to terminate Apex Language Server process PID: %d: %s', - terminated_orphaned_process: - 'Terminated Apex Language Server process PID: %d', + terminate_failed: 'Failed to terminate Apex Language Server process PID: %d: %s', + terminated_orphaned_process: 'Terminated Apex Language Server process PID: %d', terminated_orphaned_processes: 'Terminated %d orphaned processes.', unknown_error: 'Unknown error', process_id: 'Process ID', diff --git a/packages/salesforcedx-vscode-apex/src/messages/index.ts b/packages/salesforcedx-vscode-apex/src/messages/index.ts index 75fca52b38..310a56f9f9 100644 --- a/packages/salesforcedx-vscode-apex/src/messages/index.ts +++ b/packages/salesforcedx-vscode-apex/src/messages/index.ts @@ -5,13 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - Config, - DEFAULT_LOCALE, - LOCALE_JA, - Localization, - Message -} from '@salesforce/salesforcedx-utils-vscode'; +import { Config, DEFAULT_LOCALE, LOCALE_JA, Localization, Message } from '@salesforce/salesforcedx-utils-vscode'; import { messages as enMessages } from './i18n'; import { messages as jaMessages } from './i18n.ja'; const supportedLocales = [DEFAULT_LOCALE, LOCALE_JA]; @@ -33,9 +27,5 @@ const loadMessageBundle = (config?: Config): Message => { }; export const nls = new Localization( - loadMessageBundle( - process.env.VSCODE_NLS_CONFIG - ? JSON.parse(process.env.VSCODE_NLS_CONFIG!) - : undefined - ) + loadMessageBundle(process.env.VSCODE_NLS_CONFIG ? JSON.parse(process.env.VSCODE_NLS_CONFIG!) : undefined) ); diff --git a/packages/salesforcedx-vscode-apex/src/requirements.ts b/packages/salesforcedx-vscode-apex/src/requirements.ts index cb432ec500..7660881763 100644 --- a/packages/salesforcedx-vscode-apex/src/requirements.ts +++ b/packages/salesforcedx-vscode-apex/src/requirements.ts @@ -33,9 +33,7 @@ export type RequirementsData = { */ export const resolveRequirements = async (): Promise => { const javaHome = await checkJavaRuntime(); - const javaMemory: number | null = workspace - .getConfiguration() - .get(JAVA_MEMORY_KEY, null); + const javaMemory: number | null = workspace.getConfiguration().get(JAVA_MEMORY_KEY, null); await checkJavaVersion(javaHome); return Promise.resolve({ java_home: javaHome, @@ -65,14 +63,10 @@ const checkJavaRuntime = async (): Promise => { javaHome = expandHomeDir(javaHome) as string; if (isLocal(javaHome)) { // prevent injecting malicious code from unknown repositories - return reject( - nls.localize('java_runtime_local_text', javaHome, SET_JAVA_DOC_LINK) - ); + return reject(nls.localize('java_runtime_local_text', javaHome, SET_JAVA_DOC_LINK)); } if (!fs.existsSync(javaHome)) { - return reject( - nls.localize('source_missing_text', source, SET_JAVA_DOC_LINK) - ); + return reject(nls.localize('source_missing_text', source, SET_JAVA_DOC_LINK)); } return resolve(javaHome); } @@ -80,9 +74,7 @@ const checkJavaRuntime = async (): Promise => { // Last resort, try to automatically detect findJavaHome((err: Error, home: string) => { if (err) { - return reject( - nls.localize('java_runtime_missing_text', SET_JAVA_DOC_LINK) - ); + return reject(nls.localize('java_runtime_missing_text', SET_JAVA_DOC_LINK)); } else { return resolve(home); } @@ -106,11 +98,7 @@ export const checkJavaVersion = async (javaHome: string): Promise => { cp.execFile(cmdFile, commandOptions, {}, (error, stdout, stderr) => { if (error) { reject( - nls.localize( - 'java_version_check_command_failed', - `${cmdFile} ${commandOptions.join(' ')}`, - error.message - ) + nls.localize('java_version_check_command_failed', `${cmdFile} ${commandOptions.join(' ')}`, error.message) ); } if (!/java\.version\s*=\s*(?:11|17|21)/g.test(stderr)) { diff --git a/packages/salesforcedx-vscode-apex/src/settings.ts b/packages/salesforcedx-vscode-apex/src/settings.ts index 03b550062c..cbf58c5d2f 100644 --- a/packages/salesforcedx-vscode-apex/src/settings.ts +++ b/packages/salesforcedx-vscode-apex/src/settings.ts @@ -15,7 +15,5 @@ export const retrieveTestCodeCoverage = (): boolean => { }; export const retrieveEnableSyncInitJobs = (): boolean => { - return vscode.workspace - .getConfiguration() - .get('salesforcedx-vscode-apex.wait-init-jobs', true); + return vscode.workspace.getConfiguration().get('salesforcedx-vscode-apex.wait-init-jobs', true); }; diff --git a/packages/salesforcedx-vscode-apex/src/testRunCache/apexTestRunCacheService.ts b/packages/salesforcedx-vscode-apex/src/testRunCache/apexTestRunCacheService.ts index 7e47e57d01..7c9e53bd4b 100644 --- a/packages/salesforcedx-vscode-apex/src/testRunCache/apexTestRunCacheService.ts +++ b/packages/salesforcedx-vscode-apex/src/testRunCache/apexTestRunCacheService.ts @@ -52,22 +52,14 @@ class ApexTestRunCacheService { public async setCachedClassTestParam(test: string) { // enable then run 'last executed' command so command // added to 'recently used' - await vscode.commands.executeCommand( - 'setContext', - 'sf:has_cached_test_class', - true - ); + await vscode.commands.executeCommand('setContext', 'sf:has_cached_test_class', true); this.lastClassTestParam = test; } public async setCachedMethodTestParam(test: string) { // enable then run 'last executed' command so command // added to 'recently used' - await vscode.commands.executeCommand( - 'setContext', - 'sf:has_cached_test_method', - true - ); + await vscode.commands.executeCommand('setContext', 'sf:has_cached_test_method', true); this.lastMethodTestParam = test; } } diff --git a/packages/salesforcedx-vscode-apex/src/views/icons/iconHelpers.ts b/packages/salesforcedx-vscode-apex/src/views/icons/iconHelpers.ts index 9fe3f6860f..90f36a1501 100644 --- a/packages/salesforcedx-vscode-apex/src/views/icons/iconHelpers.ts +++ b/packages/salesforcedx-vscode-apex/src/views/icons/iconHelpers.ts @@ -15,9 +15,7 @@ import { iconKey, ICONS } from './IconsEnum'; * @returns The Uri to the icon image. */ const getIconPath = (key: iconKey) => { - const baseExtensionPath = extensionUris.extensionUri( - VSCODE_APEX_EXTENSION_NAME - ); + const baseExtensionPath = extensionUris.extensionUri(VSCODE_APEX_EXTENSION_NAME); const iconUri = extensionUris.join(baseExtensionPath, ICONS[key]); return iconUri; }; diff --git a/packages/salesforcedx-vscode-apex/src/views/lspConverter.ts b/packages/salesforcedx-vscode-apex/src/views/lspConverter.ts index e204d7dd95..ac4b4be794 100644 --- a/packages/salesforcedx-vscode-apex/src/views/lspConverter.ts +++ b/packages/salesforcedx-vscode-apex/src/views/lspConverter.ts @@ -29,9 +29,7 @@ export type ApexTestMethod = { }; export class ApexLSPConverter { - public static toApexTestMethod( - requestInfo: LSPApexTestMethod - ): ApexTestMethod { + public static toApexTestMethod(requestInfo: LSPApexTestMethod): ApexTestMethod { const testLocation = ApexLSPConverter.toLocation(requestInfo.location); const retInfo = { methodName: requestInfo.methodName, diff --git a/packages/salesforcedx-vscode-apex/src/views/testDataAccessObjects.ts b/packages/salesforcedx-vscode-apex/src/views/testDataAccessObjects.ts index eb988df86e..a2aa4b163d 100644 --- a/packages/salesforcedx-vscode-apex/src/views/testDataAccessObjects.ts +++ b/packages/salesforcedx-vscode-apex/src/views/testDataAccessObjects.ts @@ -38,12 +38,9 @@ export class TestSummarizer { summString = summString + 'Skipped: ' + summary.skipped + '\n'; summString = summString + 'Pass Rate: ' + summary.passRate + '\n'; summString = summString + 'Fail Rate: ' + summary.failRate + '\n'; - summString = - summString + 'Test Start Time: ' + summary.testStartTime + '\n'; - summString = - summString + 'Test Execution Time: ' + summary.testExecutionTime + '\n'; - summString = - summString + 'Test Total Time: ' + summary.testTotalTime + '\n'; + summString = summString + 'Test Start Time: ' + summary.testStartTime + '\n'; + summString = summString + 'Test Execution Time: ' + summary.testExecutionTime + '\n'; + summString = summString + 'Test Total Time: ' + summary.testTotalTime + '\n'; summString = summString + 'Command Time: ' + summary.commandTime + '\n'; summString = summString + 'Hostname: ' + summary.hostname + '\n'; summString = summString + 'Org Id: ' + summary.orgId + '\n'; diff --git a/packages/salesforcedx-vscode-apex/src/views/testOutlineProvider.ts b/packages/salesforcedx-vscode-apex/src/views/testOutlineProvider.ts index 1e2534b316..6d1cd7bf6d 100644 --- a/packages/salesforcedx-vscode-apex/src/views/testOutlineProvider.ts +++ b/packages/salesforcedx-vscode-apex/src/views/testOutlineProvider.ts @@ -8,13 +8,7 @@ import { TestResult } from '@salesforce/apex-node-bundle'; import { readFileSync } from 'fs'; import * as path from 'path'; import * as vscode from 'vscode'; -import { - APEX_GROUP_RANGE, - APEX_TESTS, - FAIL_RESULT, - PASS_RESULT, - SKIP_RESULT -} from '../constants'; +import { APEX_GROUP_RANGE, APEX_TESTS, FAIL_RESULT, PASS_RESULT, SKIP_RESULT } from '../constants'; import { getApexTests, languageClientUtils } from '../languageUtils'; import { nls } from '../messages'; import { IconsEnum, iconHelpers } from './icons'; @@ -32,11 +26,10 @@ const TEST_RUN_ID_FILE = 'test-run-id.txt'; const TEST_RESULT_JSON_FILE = 'test-result.json'; const BASE_ID = 'sf.test.view'; -export class ApexTestOutlineProvider - implements vscode.TreeDataProvider -{ - private onDidChangeTestData: vscode.EventEmitter = - new vscode.EventEmitter(); +export class ApexTestOutlineProvider implements vscode.TreeDataProvider { + private onDidChangeTestData: vscode.EventEmitter = new vscode.EventEmitter< + TestNode | undefined + >(); public onDidChangeTreeData = this.onDidChangeTestData.event; private apexTestMap: Map = new Map(); @@ -76,9 +69,7 @@ export class ApexTestOutlineProvider const languageClientStatus = languageClientUtils.getStatus(); if (!languageClientStatus.isReady()) { if (languageClientStatus.failedToInitialize()) { - void vscode.window.showInformationMessage( - languageClientStatus.getStatusMessage() - ); + void vscode.window.showInformationMessage(languageClientStatus.getStatusMessage()); return new Array(); } message = LOADING_MESSAGE; @@ -125,15 +116,10 @@ export class ApexTestOutlineProvider } public async collapseAll(): Promise { - return vscode.commands.executeCommand( - `workbench.actions.treeView.${this.getId()}.collapseAll` - ); + return vscode.commands.executeCommand(`workbench.actions.treeView.${this.getId()}.collapseAll`); } - public async onResultFileCreate( - apexTestPath: string, - testResultFile: string - ) { + public async onResultFileCreate(apexTestPath: string, testResultFile: string) { const testRunIdFile = path.join(apexTestPath, TEST_RUN_ID_FILE); const testRunId = readFileSync(testRunIdFile).toString(); const testResultFilePath = path.join( @@ -155,10 +141,7 @@ export class ApexTestOutlineProvider this.testIndex.clear(); if (this.apexTestInfo) { this.apexTestInfo.forEach(testMethod => { - this.testIndex.set( - testMethod.location.uri.toString(), - testMethod.definingType - ); + this.testIndex.set(testMethod.location.uri.toString(), testMethod.definingType); }); } } @@ -171,14 +154,9 @@ export class ApexTestOutlineProvider this.rootNode.children = new Array(); if (this.apexTestInfo) { this.apexTestInfo.forEach(test => { - let apexGroup = this.apexTestMap.get( - test.definingType - ) as ApexTestGroupNode; + let apexGroup = this.apexTestMap.get(test.definingType) as ApexTestGroupNode; if (!apexGroup) { - const groupLocation = new vscode.Location( - test.location.uri, - APEX_GROUP_RANGE - ); + const groupLocation = new vscode.Location(test.location.uri, APEX_GROUP_RANGE); apexGroup = new ApexTestGroupNode(test.definingType, groupLocation); this.apexTestMap.set(test.definingType, apexGroup); } @@ -187,10 +165,7 @@ export class ApexTestOutlineProvider apexTest.name = apexGroup.label + '.' + apexTest.label; this.apexTestMap.set(apexTest.name, apexTest); apexGroup.children.push(apexTest); - if ( - this.rootNode && - !(this.rootNode.children.indexOf(apexGroup) >= 0) - ) { + if (this.rootNode && !(this.rootNode.children.indexOf(apexGroup) >= 0)) { this.rootNode.children.push(apexGroup); } this.testStrings.add(apexGroup.name); @@ -213,13 +188,9 @@ export class ApexTestOutlineProvider const groups = new Set(); for (const test of testResult.tests) { const { name, namespacePrefix } = test.apexClass; - const apexGroupName = namespacePrefix - ? `${namespacePrefix}.${name}` - : name; + const apexGroupName = namespacePrefix ? `${namespacePrefix}.${name}` : name; - const apexGroupNode = this.apexTestMap.get( - apexGroupName - ) as ApexTestGroupNode; + const apexGroupNode = this.apexTestMap.get(apexGroupName) as ApexTestGroupNode; if (apexGroupNode) { groups.add(apexGroupNode); @@ -251,11 +222,7 @@ export abstract class TestNode extends vscode.TreeItem { public name: string; public location: vscode.Location | null; - constructor( - label: string, - collapsibleState: vscode.TreeItemCollapsibleState, - location: vscode.Location | null - ) { + constructor(label: string, collapsibleState: vscode.TreeItemCollapsibleState, location: vscode.Location | null) { super(label, collapsibleState); this.location = location; this.description = label; diff --git a/packages/salesforcedx-vscode-apex/src/views/testRunner.ts b/packages/salesforcedx-vscode-apex/src/views/testRunner.ts index eddf5bd7ee..1813f24cfc 100644 --- a/packages/salesforcedx-vscode-apex/src/views/testRunner.ts +++ b/packages/salesforcedx-vscode-apex/src/views/testRunner.ts @@ -19,12 +19,7 @@ import { languageClientUtils } from '../languageUtils'; import { nls } from '../messages'; import * as settings from '../settings'; import { apexTestRunCacheService } from '../testRunCache'; -import { - ApexTestGroupNode, - ApexTestNode, - ApexTestOutlineProvider, - TestNode -} from './testOutlineProvider'; +import { ApexTestGroupNode, ApexTestNode, ApexTestOutlineProvider, TestNode } from './testOutlineProvider'; export enum TestRunType { All, @@ -35,10 +30,7 @@ export enum TestRunType { export class ApexTestRunner { private testOutline: ApexTestOutlineProvider; private eventsEmitter: events.EventEmitter; - constructor( - testOutline: ApexTestOutlineProvider, - eventsEmitter?: events.EventEmitter - ) { + constructor(testOutline: ApexTestOutlineProvider, eventsEmitter?: events.EventEmitter) { this.testOutline = testOutline; this.eventsEmitter = eventsEmitter || new events.EventEmitter(); this.eventsEmitter.on('sf:update_selection', this.updateSelection); @@ -49,9 +41,7 @@ export class ApexTestRunner { let position: vscode.Range | number = test.location!.range; if (testNode instanceof ApexTestGroupNode) { if (test.contextValue === 'apexTestGroup_Fail') { - const failedTest = test.children.find( - testCase => testCase.contextValue === 'apexTest_Fail' - ); + const failedTest = test.children.find(testCase => testCase.contextValue === 'apexTest_Fail'); if (failedTest) { testNode = failedTest; } @@ -61,14 +51,7 @@ export class ApexTestRunner { const errorMessage = testNode.errorMessage; if (errorMessage && errorMessage !== '') { const stackTrace = testNode.stackTrace; - position = - parseInt( - stackTrace.substring( - stackTrace.indexOf('line') + 4, - stackTrace.indexOf(',') - ), - 10 - ) - 1; // Remove one because vscode location is zero based + position = parseInt(stackTrace.substring(stackTrace.indexOf('line') + 4, stackTrace.indexOf(',')), 10) - 1; // Remove one because vscode location is zero based channelService.appendLine('-----------------------------------------'); channelService.appendLine(stackTrace); channelService.appendLine(errorMessage); @@ -92,10 +75,7 @@ export class ApexTestRunner { editor.revealRange(index); // Show selection } else { const line = editor.document.lineAt(index); - const startPos = new vscode.Position( - line.lineNumber, - line.firstNonWhitespaceCharacterIndex - ); + const startPos = new vscode.Position(line.lineNumber, line.firstNonWhitespaceCharacterIndex); editor.selection = new vscode.Selection(startPos, line.range.end); editor.revealRange(line.range); // Show selection } @@ -104,10 +84,7 @@ export class ApexTestRunner { public getTempFolder(): string { if (vscode.workspace && vscode.workspace.workspaceFolders) { - const apexDir = getTestResultsFolder( - vscode.workspace.workspaceFolders[0].uri.fsPath, - 'apex' - ); + const apexDir = getTestResultsFolder(vscode.workspace.workspaceFolders[0].uri.fsPath, 'apex'); return apexDir; } else { throw new Error(nls.localize('cannot_determine_workspace')); diff --git a/packages/salesforcedx-vscode-apex/test/.eslintrc.json b/packages/salesforcedx-vscode-apex/test/.eslintrc.json deleted file mode 100644 index f2b99a417d..0000000000 --- a/packages/salesforcedx-vscode-apex/test/.eslintrc.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": [ - "../.eslintrc.json", - "../../../config/common-test-lint-rules.json" - ] -} diff --git a/packages/salesforcedx-vscode-apex/test/jest/index.test.ts b/packages/salesforcedx-vscode-apex/test/jest/index.test.ts index 674c5b8373..4218bb1670 100644 --- a/packages/salesforcedx-vscode-apex/test/jest/index.test.ts +++ b/packages/salesforcedx-vscode-apex/test/jest/index.test.ts @@ -26,52 +26,31 @@ describe('indexDoneHandler', () => { const apexLSPStatusBarItemMock = jest.mocked(ApexLSPStatusBarItem); beforeEach(() => { - setStatusSpy = jest - .spyOn(languageClientUtils, 'setStatus') - .mockReturnValue(); + setStatusSpy = jest.spyOn(languageClientUtils, 'setStatus').mockReturnValue(); mockLanguageClient = { onNotification: jest.fn() }; onNotificationSpy = jest.spyOn(mockLanguageClient, 'onNotification'); - setClientReadySpy = jest - .spyOn(extensionUtils, 'setClientReady') - .mockResolvedValue(); + setClientReadySpy = jest.spyOn(extensionUtils, 'setClientReady').mockResolvedValue(); }); it('should call languageClientUtils.setStatus and set up event listener when enableSyncInitJobs is false', async () => { const languageServerStatusBarItem = new ApexLSPStatusBarItem(); - await index.indexerDoneHandler( - false, - mockLanguageClient, - languageServerStatusBarItem - ); + await index.indexerDoneHandler(false, mockLanguageClient, languageServerStatusBarItem); expect(setStatusSpy).toHaveBeenCalledWith(1, ''); - expect(onNotificationSpy).toHaveBeenCalledWith( - API.doneIndexing, - expect.any(Function) - ); + expect(onNotificationSpy).toHaveBeenCalledWith(API.doneIndexing, expect.any(Function)); expect(apexLSPStatusBarItemMock).toHaveBeenCalledTimes(1); const mockCallback = onNotificationSpy.mock.calls[0][1]; await mockCallback(); - expect(setClientReadySpy).toHaveBeenCalledWith( - mockLanguageClient, - languageServerStatusBarItem - ); + expect(setClientReadySpy).toHaveBeenCalledWith(mockLanguageClient, languageServerStatusBarItem); }); it('should call setClientReady when enableSyncInitJobs is true', async () => { const languageServerStatusBarItem = new ApexLSPStatusBarItem(); - await index.indexerDoneHandler( - true, - mockLanguageClient, - languageServerStatusBarItem - ); - expect(setClientReadySpy).toHaveBeenCalledWith( - mockLanguageClient, - languageServerStatusBarItem - ); + await index.indexerDoneHandler(true, mockLanguageClient, languageServerStatusBarItem); + expect(setClientReadySpy).toHaveBeenCalledWith(mockLanguageClient, languageServerStatusBarItem); expect(apexLSPStatusBarItemMock).toHaveBeenCalledTimes(1); }); }); diff --git a/packages/salesforcedx-vscode-apex/test/jest/languageUtils/extensionUtils.test.ts b/packages/salesforcedx-vscode-apex/test/jest/languageUtils/extensionUtils.test.ts index 0f7d99d3e7..6e408f19e6 100644 --- a/packages/salesforcedx-vscode-apex/test/jest/languageUtils/extensionUtils.test.ts +++ b/packages/salesforcedx-vscode-apex/test/jest/languageUtils/extensionUtils.test.ts @@ -30,29 +30,19 @@ describe('extensionUtils Unit Tests.', () => { .mockReturnValue(mockTestOutlineProviderInst as any); languageServerStatusBarItem = new ApexLSPStatusBarItem(); - refreshSpy = jest - .spyOn(mockTestOutlineProviderInst, 'refresh') - .mockResolvedValue(); + refreshSpy = jest.spyOn(mockTestOutlineProviderInst, 'refresh').mockResolvedValue(); readySpy = jest.spyOn(languageServerStatusBarItem, 'ready'); - setStatusSpy = jest - .spyOn(languageClientUtils, 'setStatus') - .mockReturnValue(); + setStatusSpy = jest.spyOn(languageClientUtils, 'setStatus').mockReturnValue(); mockLanguageClient = { errorHandler: { serviceHasStartedSuccessfully: jest.fn() } }; - serviceHasStartedSuccessfullySpy = jest.spyOn( - mockLanguageClient.errorHandler, - 'serviceHasStartedSuccessfully' - ); + serviceHasStartedSuccessfullySpy = jest.spyOn(mockLanguageClient.errorHandler, 'serviceHasStartedSuccessfully'); }); it('should be executed as expected', async () => { - await extensionUtils.setClientReady( - mockLanguageClient, - languageServerStatusBarItem - ); + await extensionUtils.setClientReady(mockLanguageClient, languageServerStatusBarItem); expect(getTestOutlineProviderSpy).toHaveBeenCalled(); expect(refreshSpy).toHaveBeenCalled(); expect(readySpy).toHaveBeenCalled(); diff --git a/packages/salesforcedx-vscode-apex/test/jest/languageUtils/languageClientUtils.test.ts b/packages/salesforcedx-vscode-apex/test/jest/languageUtils/languageClientUtils.test.ts index 98435f0f91..7a5a6064fb 100644 --- a/packages/salesforcedx-vscode-apex/test/jest/languageUtils/languageClientUtils.test.ts +++ b/packages/salesforcedx-vscode-apex/test/jest/languageUtils/languageClientUtils.test.ts @@ -20,7 +20,7 @@ describe('LanguageClientUtils', () => { }); it('Should return correct initial status', async () => { - const clientStatus = languageClientUtils.getStatus() ; + const clientStatus = languageClientUtils.getStatus(); expect(clientStatus.isReady()).to.equal(false); expect(clientStatus.isIndexing()).to.equal(false); @@ -30,7 +30,7 @@ describe('LanguageClientUtils', () => { it('Should return ready status', async () => { languageClientUtils.setStatus(ClientStatus.Ready, 'Apex client is ready'); - const clientStatus = languageClientUtils.getStatus() ; + const clientStatus = languageClientUtils.getStatus(); expect(clientStatus.isReady()).to.equal(true); expect(clientStatus.isIndexing()).to.equal(false); @@ -39,11 +39,8 @@ describe('LanguageClientUtils', () => { }); it('Should return indexing status', async () => { - languageClientUtils.setStatus( - ClientStatus.Indexing, - 'Apex client is indexing' - ); - const clientStatus = languageClientUtils.getStatus() ; + languageClientUtils.setStatus(ClientStatus.Indexing, 'Apex client is indexing'); + const clientStatus = languageClientUtils.getStatus(); expect(clientStatus.isReady()).to.equal(false); expect(clientStatus.isIndexing()).to.equal(true); @@ -52,17 +49,12 @@ describe('LanguageClientUtils', () => { }); it('Should return error status', async () => { - languageClientUtils.setStatus( - ClientStatus.Error, - 'Java version is misconfigured' - ); - const clientStatus = languageClientUtils.getStatus() ; + languageClientUtils.setStatus(ClientStatus.Error, 'Java version is misconfigured'); + const clientStatus = languageClientUtils.getStatus(); expect(clientStatus.isReady()).to.equal(false); expect(clientStatus.isIndexing()).to.equal(false); expect(clientStatus.failedToInitialize()).to.equal(true); - expect(clientStatus.getStatusMessage()).to.equal( - 'Java version is misconfigured' - ); + expect(clientStatus.getStatusMessage()).to.equal('Java version is misconfigured'); }); }); diff --git a/packages/salesforcedx-vscode-apex/test/jest/languageUtils/requirements.test.ts b/packages/salesforcedx-vscode-apex/test/jest/languageUtils/requirements.test.ts index ef12470287..41a11a9a73 100644 --- a/packages/salesforcedx-vscode-apex/test/jest/languageUtils/requirements.test.ts +++ b/packages/salesforcedx-vscode-apex/test/jest/languageUtils/requirements.test.ts @@ -14,11 +14,7 @@ import { createSandbox, SinonSandbox, SinonStub } from 'sinon'; import * as vscode from 'vscode'; import { SET_JAVA_DOC_LINK } from '../../../src/constants'; import { nls } from '../../../src/messages'; -import { - checkJavaVersion, - JAVA_HOME_KEY, - resolveRequirements -} from '../../../src/requirements'; +import { checkJavaVersion, JAVA_HOME_KEY, resolveRequirements } from '../../../src/requirements'; const jdk = 'openjdk1.8.0.302_8.56.0.22_x64'; const runtimePath = `~/java_home/real/jdk/${jdk}`; @@ -67,9 +63,7 @@ describe('Java Requirements Test', () => { await checkJavaVersion('~/java_home'); fail('Should have thrown when the Java version is not supported'); } catch (err) { - expect(err).to.equal( - nls.localize('wrong_java_version_text', SET_JAVA_DOC_LINK) - ); + expect(err).to.equal(nls.localize('wrong_java_version_text', SET_JAVA_DOC_LINK)); } }); @@ -79,9 +73,7 @@ describe('Java Requirements Test', () => { const result = await checkJavaVersion('~/java_home'); expect(result).to.equal(true); } catch (err) { - fail( - `Should not have thrown when the Java version is 11. The error was: ${err}` - ); + fail(`Should not have thrown when the Java version is 11. The error was: ${err}`); } }); @@ -91,9 +83,7 @@ describe('Java Requirements Test', () => { const result = await checkJavaVersion('~/java_home'); expect(result).to.equal(true); } catch (err) { - fail( - `Should not have thrown when the Java version is 17. The error was: ${err}` - ); + fail(`Should not have thrown when the Java version is 17. The error was: ${err}`); } }); @@ -103,11 +93,8 @@ describe('Java Requirements Test', () => { const result = await checkJavaVersion('~/java_home'); expect(result).to.equal(true); } catch (err) { - fail( - `Should not have thrown when the Java version is 21. The error was: ${err}` - ); + fail(`Should not have thrown when the Java version is 21. The error was: ${err}`); } - }); it('Should not support Java 20', async () => { execFileStub.yields('', '', 'java.version = 20.0.0'); @@ -115,9 +102,7 @@ describe('Java Requirements Test', () => { await checkJavaVersion('~/java_home'); fail('Should have thrown when the Java version is not supported'); } catch (err) { - expect(err).to.equal( - nls.localize('wrong_java_version_text', SET_JAVA_DOC_LINK) - ); + expect(err).to.equal(nls.localize('wrong_java_version_text', SET_JAVA_DOC_LINK)); } }); diff --git a/packages/salesforcedx-vscode-apex/test/jest/settings.test.ts b/packages/salesforcedx-vscode-apex/test/jest/settings.test.ts index d8694d213f..19284b0f46 100644 --- a/packages/salesforcedx-vscode-apex/test/jest/settings.test.ts +++ b/packages/salesforcedx-vscode-apex/test/jest/settings.test.ts @@ -6,10 +6,7 @@ */ import { SFDX_CORE_CONFIGURATION_NAME } from '@salesforce/salesforcedx-utils-vscode'; import * as vscode from 'vscode'; -import { - retrieveEnableSyncInitJobs, - retrieveTestCodeCoverage -} from '../../src/settings'; +import { retrieveEnableSyncInitJobs, retrieveTestCodeCoverage } from '../../src/settings'; describe('settings Unit Tests.', () => { const vscodeMocked = jest.mocked(vscode); @@ -17,10 +14,7 @@ describe('settings Unit Tests.', () => { let getFn: jest.Mock; beforeEach(() => { - getConfigurationMock = jest.spyOn( - vscodeMocked.workspace, - 'getConfiguration' - ); + getConfigurationMock = jest.spyOn(vscodeMocked.workspace, 'getConfiguration'); getFn = jest.fn(); }); @@ -32,9 +26,7 @@ describe('settings Unit Tests.', () => { const result = retrieveTestCodeCoverage(); expect(result).toBe(false); - expect(getConfigurationMock).toHaveBeenCalledWith( - SFDX_CORE_CONFIGURATION_NAME - ); + expect(getConfigurationMock).toHaveBeenCalledWith(SFDX_CORE_CONFIGURATION_NAME); expect(getFn).toHaveBeenCalledWith('retrieve-test-code-coverage', false); }); @@ -46,9 +38,6 @@ describe('settings Unit Tests.', () => { const result = retrieveEnableSyncInitJobs(); expect(result).toBe(true); expect(getConfigurationMock).toHaveBeenCalledWith(); - expect(getFn).toHaveBeenCalledWith( - 'salesforcedx-vscode-apex.wait-init-jobs', - true - ); + expect(getFn).toHaveBeenCalledWith('salesforcedx-vscode-apex.wait-init-jobs', true); }); }); diff --git a/packages/salesforcedx-vscode-apex/test/jest/telemetry/mockTelemetryService.ts b/packages/salesforcedx-vscode-apex/test/jest/telemetry/mockTelemetryService.ts index 0680eb343f..39a58d809b 100644 --- a/packages/salesforcedx-vscode-apex/test/jest/telemetry/mockTelemetryService.ts +++ b/packages/salesforcedx-vscode-apex/test/jest/telemetry/mockTelemetryService.ts @@ -5,14 +5,26 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ import { TelemetryService } from '@salesforce/salesforcedx-utils-vscode'; -import { TelemetryServiceInterface, ActivationInfo, TelemetryData, Properties, Measurements, TelemetryReporter } from '@salesforce/vscode-service-provider'; +import { + TelemetryServiceInterface, + ActivationInfo, + TelemetryData, + Properties, + Measurements, + TelemetryReporter +} from '@salesforce/vscode-service-provider'; import { ExtensionContext, ExtensionMode } from 'vscode'; export class MockTelemetryService extends TelemetryService implements TelemetryServiceInterface { initializeService(extensionContext: ExtensionContext): Promise { return Promise.resolve(); } - initializeServiceWithAttributes(name: string, apiKey?: string, version?: string, extensionMode?: ExtensionMode): Promise { + initializeServiceWithAttributes( + name: string, + apiKey?: string, + version?: string, + extensionMode?: ExtensionMode + ): Promise { return Promise.resolve(); } getReporters(): TelemetryReporter[] { @@ -39,7 +51,12 @@ export class MockTelemetryService extends TelemetryService implements TelemetryS sendExtensionDeactivationEvent(): void { // No-op implementation } - sendCommandEvent(commandName?: string, hrstart?: [number, number], properties?: Properties, measurements?: Measurements): void { + sendCommandEvent( + commandName?: string, + hrstart?: [number, number], + properties?: Properties, + measurements?: Measurements + ): void { // No-op implementation } sendException(name: string, message: string): void { diff --git a/packages/salesforcedx-vscode-apex/test/jest/views/icons/iconHelpers.test.ts b/packages/salesforcedx-vscode-apex/test/jest/views/icons/iconHelpers.test.ts index f743f73820..aa6cdb1e83 100644 --- a/packages/salesforcedx-vscode-apex/test/jest/views/icons/iconHelpers.test.ts +++ b/packages/salesforcedx-vscode-apex/test/jest/views/icons/iconHelpers.test.ts @@ -14,23 +14,14 @@ describe('iconHelpers Unit Tests.', () => { const fakeUri = { filePath: '/some/place/apexy' }; const fakeIconUri = { filePath: '/all/the/way/to/the/icon.svg' }; beforeEach(() => { - jest - .spyOn(extensionUris, 'extensionUri') - .mockReturnValue((fakeUri as unknown) as vscode.Uri); - jest - .spyOn(extensionUris, 'join') - .mockReturnValue((fakeIconUri as unknown) as vscode.Uri); + jest.spyOn(extensionUris, 'extensionUri').mockReturnValue(fakeUri as unknown as vscode.Uri); + jest.spyOn(extensionUris, 'join').mockReturnValue(fakeIconUri as unknown as vscode.Uri); }); it('Should return the path for enum value.', () => { const iconUri = iconHelpers.getIconPath(IconsEnum.LIGHT_BLUE_BUTTON); - expect(extensionUris.extensionUri).toHaveBeenCalledWith( - VSCODE_APEX_EXTENSION_NAME - ); - expect(extensionUris.join).toHaveBeenCalledWith( - fakeUri, - ICONS[IconsEnum.LIGHT_BLUE_BUTTON] - ); + expect(extensionUris.extensionUri).toHaveBeenCalledWith(VSCODE_APEX_EXTENSION_NAME); + expect(extensionUris.join).toHaveBeenCalledWith(fakeUri, ICONS[IconsEnum.LIGHT_BLUE_BUTTON]); expect(iconUri).toEqual(fakeIconUri); }); }); diff --git a/packages/salesforcedx-vscode-apex/test/jest/views/testOutlineProvider.test.ts b/packages/salesforcedx-vscode-apex/test/jest/views/testOutlineProvider.test.ts index 2bf5717c2e..04c1e40458 100644 --- a/packages/salesforcedx-vscode-apex/test/jest/views/testOutlineProvider.test.ts +++ b/packages/salesforcedx-vscode-apex/test/jest/views/testOutlineProvider.test.ts @@ -17,9 +17,7 @@ describe('testOutlineProvider Unit Tests.', () => { beforeEach(() => { // testOutlineProvider has a hidden dependency on iconHelpers.getIconPath that needs to be mocked // for our purposes, the return value has no bearing on what we're testing - jest - .spyOn(iconHelpers, 'getIconPath') - .mockReturnValue(vscode.Uri.parse('https://salesforce.com')); + jest.spyOn(iconHelpers, 'getIconPath').mockReturnValue(vscode.Uri.parse('https://salesforce.com')); commandMock = jest.spyOn(vscodeMocked.commands, 'executeCommand'); }); @@ -35,8 +33,6 @@ describe('testOutlineProvider Unit Tests.', () => { expect(commandMock.mock.calls.length).toBe(1); expect(commandMock.mock.calls[0].length).toBe(1); - expect(commandMock.mock.calls[0][0]).toBe( - `workbench.actions.treeView.${provider.getId()}.collapseAll` - ); + expect(commandMock.mock.calls[0][0]).toBe(`workbench.actions.treeView.${provider.getId()}.collapseAll`); }); }); diff --git a/packages/salesforcedx-vscode-apex/test/vscode-integration/apexLspJarContents.test.ts b/packages/salesforcedx-vscode-apex/test/vscode-integration/apexLspJarContents.test.ts index ec5c560ec9..f3aab7feb3 100644 --- a/packages/salesforcedx-vscode-apex/test/vscode-integration/apexLspJarContents.test.ts +++ b/packages/salesforcedx-vscode-apex/test/vscode-integration/apexLspJarContents.test.ts @@ -12,7 +12,6 @@ import * as path from 'path'; import * as shell from 'shelljs'; describe('Apex LSP Jar Contents', () => { - it('should not contain perm-guarded apex classes', () => { shell.config.execPath = process.execPath; const apexJarPath = path.join(__dirname, '..', '..', 'apex-jorje-lsp.jar'); diff --git a/packages/salesforcedx-vscode-apex/test/vscode-integration/codecoverage/colorizer.test.ts b/packages/salesforcedx-vscode-apex/test/vscode-integration/codecoverage/colorizer.test.ts index 0c5854083a..97d8810cf2 100644 --- a/packages/salesforcedx-vscode-apex/test/vscode-integration/codecoverage/colorizer.test.ts +++ b/packages/salesforcedx-vscode-apex/test/vscode-integration/codecoverage/colorizer.test.ts @@ -7,10 +7,7 @@ import { expect } from 'chai'; import { Range, RelativePattern, Uri, window, workspace } from 'vscode'; -import { - CodeCoverageHandler, - getLineRange -} from '../../../src/codecoverage/colorizer'; +import { CodeCoverageHandler, getLineRange } from '../../../src/codecoverage/colorizer'; import { StatusBarToggle } from '../../../src/codecoverage/statusBarToggle'; describe('Code coverage colorizer', () => { @@ -18,14 +15,8 @@ describe('Code coverage colorizer', () => { beforeEach(async () => { testCoverage = await workspace.findFiles( - new RelativePattern( - workspace.workspaceFolders![0], - '**/DemoController.cls' - ), - new RelativePattern( - workspace.workspaceFolders![0], - '**/DemoControllerTest.cls' - ) + new RelativePattern(workspace.workspaceFolders![0], '**/DemoController.cls'), + new RelativePattern(workspace.workspaceFolders![0], '**/DemoControllerTest.cls') ); }); diff --git a/packages/salesforcedx-vscode-apex/test/vscode-integration/commands/apexExecute.test.ts b/packages/salesforcedx-vscode-apex/test/vscode-integration/commands/apexExecute.test.ts index 7157e8081d..dc9c8becb8 100644 --- a/packages/salesforcedx-vscode-apex/test/vscode-integration/commands/apexExecute.test.ts +++ b/packages/salesforcedx-vscode-apex/test/vscode-integration/commands/apexExecute.test.ts @@ -20,10 +20,7 @@ import * as path from 'path'; import { createSandbox, SinonSandbox, SinonSpy, SinonStub } from 'sinon'; import * as vscode from 'vscode'; import { channelService } from '../../../src/channels'; -import { - AnonApexGatherer, - AnonApexLibraryExecuteExecutor -} from '../../../src/commands/anonApexExecute'; +import { AnonApexGatherer, AnonApexLibraryExecuteExecutor } from '../../../src/commands/anonApexExecute'; import { workspaceContext } from '../../../src/context'; import { nls } from '../../../src/messages'; @@ -41,11 +38,9 @@ describe('Apex Execute', () => { beforeEach(async () => { sb = createSandbox(); settingStub = sb.stub(); - sb.stub(vscode.workspace, 'getConfiguration') - .withArgs(SFDX_CORE_CONFIGURATION_NAME) - .returns({ - get: settingStub - }); + sb.stub(vscode.workspace, 'getConfiguration').withArgs(SFDX_CORE_CONFIGURATION_NAME).returns({ + get: settingStub + }); $$.setConfigStubContents('AuthInfoConfig', { contents: await testData.getConfig() }); @@ -54,14 +49,10 @@ describe('Apex Execute', () => { username: testData.username }) }); - sb.stub(ConfigAggregator.prototype, 'getPropertyValue') - .withArgs('target-org') - .returns(testData.username); + sb.stub(ConfigAggregator.prototype, 'getPropertyValue').withArgs('target-org').returns(testData.username); sb.stub(workspaceContext, 'getConnection').returns(mockConnection); - traceFlagsStub = sb - .stub(TraceFlags.prototype, 'ensureTraceFlags') - .returns(true); + traceFlagsStub = sb.stub(TraceFlags.prototype, 'ensureTraceFlags').returns(true); sb.stub(vscode.window, 'activeTextEditor').get(() => ({ document: { @@ -83,11 +74,7 @@ describe('Apex Execute', () => { describe('AnonApexGatherer', async () => { it('should return the selected file to execute anonymous apex', async () => { - const fileName = path.join( - projectPaths.stateFolder(), - 'tools', - 'tempApex.input' - ); + const fileName = path.join(projectPaths.stateFolder(), 'tools', 'tempApex.input'); const mockActiveTextEditor = { document: { uri: { fsPath: fileName }, @@ -109,11 +96,7 @@ describe('Apex Execute', () => { it('should return the text in file if file has not been created yet', async () => { const text = 'System.assert(true);'; - const fileName = path.join( - projectPaths.stateFolder(), - 'tools', - 'tempApex.input' - ); + const fileName = path.join(projectPaths.stateFolder(), 'tools', 'tempApex.input'); const mockActiveTextEditor = { document: { uri: { fsPath: fileName }, @@ -172,17 +155,9 @@ describe('Apex Execute', () => { beforeEach(() => { outputStub = sb.stub(channelService, 'appendLine'); - showChannelOutputStub = sb.spy( - ChannelService.prototype, - 'showChannelOutput' - ); - setDiagnosticStub = sb.stub( - AnonApexLibraryExecuteExecutor.diagnostics, - 'set' - ); - debugLogsfolder = sb - .stub(projectPaths, 'debugLogsFolder') - .returns('.sfdx/tools/debug/logs'); + showChannelOutputStub = sb.spy(ChannelService.prototype, 'showChannelOutput'); + setDiagnosticStub = sb.stub(AnonApexLibraryExecuteExecutor.diagnostics, 'set'); + debugLogsfolder = sb.stub(projectPaths, 'debugLogsFolder').returns('.sfdx/tools/debug/logs'); }); it('should format result correctly for a successful execution', async () => { @@ -203,12 +178,8 @@ describe('Apex Execute', () => { }; const expectedOutput = `${nls.localize( 'apex_execute_compile_success' - )}\n${nls.localize('apex_execute_runtime_success')}\n\n${ - execAnonResponse.logs - }`; - sb.stub(ExecuteService.prototype, 'executeAnonymous').resolves( - execAnonResponse - ); + )}\n${nls.localize('apex_execute_runtime_success')}\n\n${execAnonResponse.logs}`; + sb.stub(ExecuteService.prototype, 'executeAnonymous').resolves(execAnonResponse); await executor.run({ type: 'CONTINUE', data: {} }); expect(showChannelOutputStub.notCalled).to.be.true; @@ -232,9 +203,7 @@ describe('Apex Execute', () => { ] }; const expectedOutput = `Error: Line: ${execAnonResponse.diagnostic[0].lineNumber}, Column: ${execAnonResponse.diagnostic[0].columnNumber}\nError: ${execAnonResponse.diagnostic[0].compileProblem}\n`; - sb.stub(ExecuteService.prototype, 'executeAnonymous').resolves( - execAnonResponse - ); + sb.stub(ExecuteService.prototype, 'executeAnonymous').resolves(execAnonResponse); await executor.run({ type: 'CONTINUE', data: {} }); expect(showChannelOutputStub.notCalled).to.be.true; @@ -257,16 +226,11 @@ describe('Apex Execute', () => { } ] }; - const { exceptionMessage, exceptionStackTrace } = - execAnonResponse.diagnostic[0]; + const { exceptionMessage, exceptionStackTrace } = execAnonResponse.diagnostic[0]; const expectedOutput = `${nls.localize( 'apex_execute_compile_success' - )}\nError: ${exceptionMessage}\nError: ${exceptionStackTrace}\n\n${ - execAnonResponse.logs - }`; - sb.stub(ExecuteService.prototype, 'executeAnonymous').resolves( - execAnonResponse - ); + )}\nError: ${exceptionMessage}\nError: ${exceptionStackTrace}\n\n${execAnonResponse.logs}`; + sb.stub(ExecuteService.prototype, 'executeAnonymous').resolves(execAnonResponse); await executor.run({ type: 'CONTINUE', data: {} }); expect(showChannelOutputStub.notCalled).to.be.true; @@ -289,9 +253,7 @@ describe('Apex Execute', () => { } ] }; - sb.stub(ExecuteService.prototype, 'executeAnonymous').resolves( - execAnonResponse - ); + sb.stub(ExecuteService.prototype, 'executeAnonymous').resolves(execAnonResponse); const expectedDiagnostic = { message: execAnonResponse.diagnostic[0].exceptionMessage, @@ -304,16 +266,11 @@ describe('Apex Execute', () => { type: 'CONTINUE', data: { fileName: file, - selection: new vscode.Range( - new vscode.Position(3, 1), - new vscode.Position(3, 22) - ) + selection: new vscode.Range(new vscode.Position(3, 1), new vscode.Position(3, 22)) } }); - expect(setDiagnosticStub.firstCall.args[1]).to.deep.equal([ - expectedDiagnostic - ]); + expect(setDiagnosticStub.firstCall.args[1]).to.deep.equal([expectedDiagnostic]); }); }); @@ -339,20 +296,12 @@ describe('Apex Execute', () => { let executeStub: SinonStub; beforeEach(() => { - setDiagnosticStub = sb.stub( - AnonApexLibraryExecuteExecutor.diagnostics, - 'set' - ); - executeStub = sb - .stub(ExecuteService.prototype, 'executeAnonymous') - .resolves(defaultResponse); + setDiagnosticStub = sb.stub(AnonApexLibraryExecuteExecutor.diagnostics, 'set'); + executeStub = sb.stub(ExecuteService.prototype, 'executeAnonymous').resolves(defaultResponse); }); it('should clear diagnostics before setting new ones', async () => { - const clearStub = sb.stub( - AnonApexLibraryExecuteExecutor.diagnostics, - 'clear' - ); + const clearStub = sb.stub(AnonApexLibraryExecuteExecutor.diagnostics, 'clear'); await executor.run({ data: { fileName: file }, type: 'CONTINUE' }); @@ -371,9 +320,7 @@ describe('Apex Execute', () => { expect(setDiagnosticStub.calledOnce).to.be.true; expect(setDiagnosticStub.firstCall.args[0].path).to.deep.equal(file); - expect(setDiagnosticStub.firstCall.args[1]).to.deep.equal([ - expectedDiagnostic - ]); + expect(setDiagnosticStub.firstCall.args[1]).to.deep.equal([expectedDiagnostic]); }); it('should set compile problem as message if present', async () => { @@ -400,9 +347,7 @@ describe('Apex Execute', () => { expect(setDiagnosticStub.calledOnce).to.be.true; expect(setDiagnosticStub.firstCall.args[0].path).to.deep.equal(file); - expect(setDiagnosticStub.firstCall.args[1]).to.deep.equal([ - expectedDiagnostic - ]); + expect(setDiagnosticStub.firstCall.args[1]).to.deep.equal([expectedDiagnostic]); }); it('should set exception message as message if compile problem not present', async () => { @@ -428,9 +373,7 @@ describe('Apex Execute', () => { expect(setDiagnosticStub.calledOnce).to.be.true; expect(setDiagnosticStub.firstCall.args[0].path).to.deep.equal(file); - expect(setDiagnosticStub.firstCall.args[1]).to.deep.equal([ - expectedDiagnostic - ]); + expect(setDiagnosticStub.firstCall.args[1]).to.deep.equal([expectedDiagnostic]); }); it('should set exception message as message if compile problem empty string', async () => { @@ -457,9 +400,7 @@ describe('Apex Execute', () => { expect(setDiagnosticStub.calledOnce).to.be.true; expect(setDiagnosticStub.firstCall.args[0].path).to.deep.equal(file); - expect(setDiagnosticStub.firstCall.args[1]).to.deep.equal([ - expectedDiagnostic - ]); + expect(setDiagnosticStub.firstCall.args[1]).to.deep.equal([expectedDiagnostic]); }); it('should set unexpected message as message if compile problem and exception message empty strings', async () => { @@ -486,9 +427,7 @@ describe('Apex Execute', () => { expect(setDiagnosticStub.calledOnce).to.be.true; expect(setDiagnosticStub.firstCall.args[0].path).to.deep.equal(file); - expect(setDiagnosticStub.firstCall.args[1]).to.deep.equal([ - expectedDiagnostic - ]); + expect(setDiagnosticStub.firstCall.args[1]).to.deep.equal([expectedDiagnostic]); }); }); @@ -500,14 +439,8 @@ describe('Apex Execute', () => { beforeEach(() => { outputStub = sb.stub(channelService, 'appendLine'); - showChannelOutputStub = sb.spy( - ChannelService.prototype, - 'showChannelOutput' - ); - setDiagnosticStub = sb.stub( - AnonApexLibraryExecuteExecutor.diagnostics, - 'set' - ); + showChannelOutputStub = sb.spy(ChannelService.prototype, 'showChannelOutput'); + setDiagnosticStub = sb.stub(AnonApexLibraryExecuteExecutor.diagnostics, 'set'); }); it('should set up trace flags and run the Apex replay debugger when AnonApexLibraryExecuteExecutor(true) runs', async () => { @@ -528,12 +461,8 @@ describe('Apex Execute', () => { }; const expectedOutput = `${nls.localize( 'apex_execute_compile_success' - )}\n${nls.localize('apex_execute_runtime_success')}\n\n${ - execAnonResponse.logs - }`; - sb.stub(ExecuteService.prototype, 'executeAnonymous').resolves( - execAnonResponse - ); + )}\n${nls.localize('apex_execute_runtime_success')}\n\n${execAnonResponse.logs}`; + sb.stub(ExecuteService.prototype, 'executeAnonymous').resolves(execAnonResponse); await executor.run({ type: 'CONTINUE', data: {} }); @@ -559,12 +488,8 @@ describe('Apex Execute', () => { }; const expectedOutput = `${nls.localize( 'apex_execute_compile_success' - )}\n${nls.localize('apex_execute_runtime_success')}\n\n${ - execAnonResponse.logs - }`; - sb.stub(ExecuteService.prototype, 'executeAnonymous').resolves( - execAnonResponse - ); + )}\n${nls.localize('apex_execute_runtime_success')}\n\n${execAnonResponse.logs}`; + sb.stub(ExecuteService.prototype, 'executeAnonymous').resolves(execAnonResponse); await executor.run({ type: 'CONTINUE', data: {} }); diff --git a/packages/salesforcedx-vscode-apex/test/vscode-integration/commands/apexLogGet.test.ts b/packages/salesforcedx-vscode-apex/test/vscode-integration/commands/apexLogGet.test.ts index d171155ad4..d7d8060628 100644 --- a/packages/salesforcedx-vscode-apex/test/vscode-integration/commands/apexLogGet.test.ts +++ b/packages/salesforcedx-vscode-apex/test/vscode-integration/commands/apexLogGet.test.ts @@ -9,10 +9,7 @@ import { expect } from 'chai'; import * as sinon from 'sinon'; import { createSandbox, SinonSandbox } from 'sinon'; import * as vscode from 'vscode'; -import { - ApexDebugLogObject, - LogFileSelector -} from '../../../src/commands/apexLogGet'; +import { ApexDebugLogObject, LogFileSelector } from '../../../src/commands/apexLogGet'; // tslint:disable:no-unused-expression describe('Apex Log Get Logging', () => { @@ -71,9 +68,7 @@ describe('Apex Log Get Logging', () => { .resolves(logInfos.slice(0, 1)) .resolves(logInfos); - showQuickPickStub = sb - .stub(vscode.window, 'showQuickPick') - .returns(logInfos[0]); + showQuickPickStub = sb.stub(vscode.window, 'showQuickPick').returns(logInfos[0]); }); afterEach(() => { diff --git a/packages/salesforcedx-vscode-apex/test/vscode-integration/commands/apexTestRun.test.ts b/packages/salesforcedx-vscode-apex/test/vscode-integration/commands/apexTestRun.test.ts index 205517c536..68720c75fc 100644 --- a/packages/salesforcedx-vscode-apex/test/vscode-integration/commands/apexTestRun.test.ts +++ b/packages/salesforcedx-vscode-apex/test/vscode-integration/commands/apexTestRun.test.ts @@ -68,11 +68,7 @@ describe('Apex Library Test Run Executor', async () => { cancellationToken ); expect(buildPayloadStub.called).to.be.true; - expect(buildPayloadStub.args[0]).to.eql([ - 'RunSpecifiedTests', - undefined, - 'testClass' - ]); + expect(buildPayloadStub.args[0]).to.eql(['RunSpecifiedTests', undefined, 'testClass']); assert.calledOnce(runTestStub); assert.calledWith( runTestStub, @@ -104,12 +100,7 @@ describe('Apex Library Test Run Executor', async () => { ); expect(buildPayloadStub.called).to.be.true; - expect(buildPayloadStub.args[0]).to.eql([ - 'RunSpecifiedTests', - undefined, - undefined, - 'testSuite' - ]); + expect(buildPayloadStub.args[0]).to.eql(['RunSpecifiedTests', undefined, undefined, 'testSuite']); assert.calledOnce(runTestStub); assert.calledWith( runTestStub, @@ -133,14 +124,7 @@ describe('Apex Library Test Run Executor', async () => { ); assert.calledOnce(runTestStub); - assert.calledWith( - runTestStub, - { testLevel: TestLevel.RunLocalTests }, - true, - false, - match.any, - cancellationToken - ); + assert.calledWith(runTestStub, { testLevel: TestLevel.RunLocalTests }, true, false, match.any, cancellationToken); }); it('should run test with correct parameters for all tests', async () => { @@ -167,31 +151,29 @@ describe('Apex Library Test Run Executor', async () => { it('should report progress', async () => { const apexLibExecutor = new ApexLibraryTestRunExecutor(); - runTestStub.callsFake( - (payload, codecoverage, exitEarly, progressReporter, token) => { - progressReporter.report({ - type: 'StreamingClientProgress', - value: 'streamingTransportUp', - message: 'Listening for streaming state changes...' - }); - progressReporter.report({ - type: 'StreamingClientProgress', - value: 'streamingProcessingTestRun', - message: 'Processing test run 707500000000000001', - testRunId: '707500000000000001' - }); - progressReporter.report({ - type: 'FormatTestResultProgress', - value: 'retrievingTestRunSummary', - message: 'Retrieving test run summary record' - }); - progressReporter.report({ - type: 'FormatTestResultProgress', - value: 'queryingForAggregateCodeCoverage', - message: 'Querying for aggregate code coverage results' - }); - } - ); + runTestStub.callsFake((payload, codecoverage, exitEarly, progressReporter, token) => { + progressReporter.report({ + type: 'StreamingClientProgress', + value: 'streamingTransportUp', + message: 'Listening for streaming state changes...' + }); + progressReporter.report({ + type: 'StreamingClientProgress', + value: 'streamingProcessingTestRun', + message: 'Processing test run 707500000000000001', + testRunId: '707500000000000001' + }); + progressReporter.report({ + type: 'FormatTestResultProgress', + value: 'retrievingTestRunSummary', + message: 'Retrieving test run summary record' + }); + progressReporter.report({ + type: 'FormatTestResultProgress', + value: 'queryingForAggregateCodeCoverage', + message: 'Querying for aggregate code coverage results' + }); + }); await apexLibExecutor.run( { @@ -253,26 +235,17 @@ describe('Apex Library Test Run Executor', async () => { expect(result.type).to.equal('CONTINUE'); expect(quickPickStub.getCall(0).args.length).to.equal(1); - const fileItems: ApexTestQuickPickItem[] = - quickPickStub.getCall(0).args[0]; + const fileItems: ApexTestQuickPickItem[] = quickPickStub.getCall(0).args[0]; expect(fileItems.length).to.equal(4); expect(fileItems[0].label).to.equal('DemoSuite'); expect(fileItems[0].type).to.equal(TestType.Suite); expect(fileItems[3].label).to.equal('DemoControllerTests'); expect(fileItems[3].type).to.equal(TestType.Class); - expect(fileItems[1].label).to.equal( - nls.localize('apex_test_run_all_local_test_label') - ); - expect(fileItems[1].description).to.equal( - nls.localize('apex_test_run_all_local_tests_description_text') - ); + expect(fileItems[1].label).to.equal(nls.localize('apex_test_run_all_local_test_label')); + expect(fileItems[1].description).to.equal(nls.localize('apex_test_run_all_local_tests_description_text')); expect(fileItems[1].type).to.equal(TestType.AllLocal); - expect(fileItems[2].label).to.equal( - nls.localize('apex_test_run_all_test_label') - ); - expect(fileItems[2].description).to.equal( - nls.localize('apex_test_run_all_tests_description_text') - ); + expect(fileItems[2].label).to.equal(nls.localize('apex_test_run_all_test_label')); + expect(fileItems[2].description).to.equal(nls.localize('apex_test_run_all_tests_description_text')); expect(fileItems[2].type).to.equal(TestType.All); }); }); diff --git a/packages/salesforcedx-vscode-apex/test/vscode-integration/commands/apexTestRunCodeAction.test.ts b/packages/salesforcedx-vscode-apex/test/vscode-integration/commands/apexTestRunCodeAction.test.ts index bc0c2da829..5ade9c35b4 100644 --- a/packages/salesforcedx-vscode-apex/test/vscode-integration/commands/apexTestRunCodeAction.test.ts +++ b/packages/salesforcedx-vscode-apex/test/vscode-integration/commands/apexTestRunCodeAction.test.ts @@ -5,27 +5,14 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - ApexTestResultOutcome, - HumanReporter, - TestLevel, - TestResult, - TestService -} from '@salesforce/apex-node-bundle'; +import { ApexTestResultOutcome, HumanReporter, TestLevel, TestResult, TestService } from '@salesforce/apex-node-bundle'; import { SfProject } from '@salesforce/core-bundle'; import * as pathUtils from '@salesforce/salesforcedx-utils-vscode'; import { ComponentSet } from '@salesforce/source-deploy-retrieve-bundle'; import { expect } from 'chai'; import { join } from 'path'; import { assert, createSandbox, match, SinonStub } from 'sinon'; -import { - CancellationToken, - DiagnosticSeverity, - EventEmitter, - Progress, - Range, - Uri -} from 'vscode'; +import { CancellationToken, DiagnosticSeverity, EventEmitter, Progress, Range, Uri } from 'vscode'; import { ApexLibraryTestRunExecutor, resolveTestClassParam, @@ -129,8 +116,7 @@ describe('Apex Test Run - Code Action', () => { fullName: 'TestClass.testMethod', diagnostic: { exceptionMessage: 'System.AssertException: Assertion Failed', - exceptionStackTrace: - 'System.AssertException: Assertion Failed Col: 18 Line: 2', + exceptionStackTrace: 'System.AssertException: Assertion Failed Col: 18 Line: 2', compileProblem: '', lineNumber: 6, columnNumber: 1, @@ -157,8 +143,7 @@ describe('Apex Test Run - Code Action', () => { fullName: 'TestClassTwo.testMethodTwo', diagnostic: { exceptionMessage: 'System.AssertException: Assertion Failed', - exceptionStackTrace: - 'System.AssertException: Assertion Failed Col: 15 Line: 3', + exceptionStackTrace: 'System.AssertException: Assertion Failed Col: 15 Line: 3', compileProblem: '', lineNumber: 3, columnNumber: 15, @@ -234,20 +219,13 @@ describe('Apex Test Run - Code Action', () => { let buildPayloadStub: SinonStub; let writeResultFilesStub: SinonStub; const defaultPackageDir = 'default/package/dir'; - const componentPath = join( - defaultPackageDir, - 'main', - 'default', - 'TestClass.cls' - ); + const componentPath = join(defaultPackageDir, 'main', 'default', 'TestClass.cls'); let reportStub: SinonStub; let progress: Progress; let cancellationTokenEventEmitter; let cancellationToken: CancellationToken; beforeEach(() => { - runTestStub = sb - .stub(TestService.prototype, 'runTestAsynchronous') - .resolves(passingResult); + runTestStub = sb.stub(TestService.prototype, 'runTestAsynchronous').resolves(passingResult); sb.stub(workspaceContext, 'getConnection'); buildPayloadStub = sb.stub(TestService.prototype, 'buildAsyncPayload'); sb.stub(HumanReporter.prototype, 'format'); @@ -285,18 +263,11 @@ describe('Apex Test Run - Code Action', () => { tests: [{ className: 'testClass', testMethods: ['oneTest'] }], testLevel: TestLevel.RunSpecifiedTests }); - const apexLibExecutor = new ApexLibraryTestRunExecutor( - ['testClass.oneTest'], - 'path/to/dir', - true - ); + const apexLibExecutor = new ApexLibraryTestRunExecutor(['testClass.oneTest'], 'path/to/dir', true); await apexLibExecutor.run(undefined, progress, cancellationToken); expect(buildPayloadStub.called).to.be.true; - expect(buildPayloadStub.args[0]).to.eql([ - 'RunSpecifiedTests', - 'testClass.oneTest' - ]); + expect(buildPayloadStub.args[0]).to.eql(['RunSpecifiedTests', 'testClass.oneTest']); assert.calledOnce(runTestStub); assert.calledWith( runTestStub, @@ -327,10 +298,7 @@ describe('Apex Test Run - Code Action', () => { await apexLibExecutor.run(undefined, progress, cancellationToken); expect(buildPayloadStub.called).to.be.true; - expect(buildPayloadStub.args[0]).to.eql([ - 'RunSpecifiedTests', - 'testClass.oneTest,testClass.twoTest' - ]); + expect(buildPayloadStub.args[0]).to.eql(['RunSpecifiedTests', 'testClass.oneTest,testClass.twoTest']); assert.calledOnce(runTestStub); assert.calledWith( runTestStub, @@ -353,18 +321,11 @@ describe('Apex Test Run - Code Action', () => { tests: [{ className: 'testClass' }], testLevel: TestLevel.RunSpecifiedTests }); - const apexLibExecutor = new ApexLibraryTestRunExecutor( - ['testClass'], - 'path/to/dir', - true - ); + const apexLibExecutor = new ApexLibraryTestRunExecutor(['testClass'], 'path/to/dir', true); await apexLibExecutor.run(undefined, progress, cancellationToken); expect(buildPayloadStub.called).to.be.true; - expect(buildPayloadStub.args[0]).to.eql([ - 'RunSpecifiedTests', - 'testClass' - ]); + expect(buildPayloadStub.args[0]).to.eql(['RunSpecifiedTests', 'testClass']); assert.calledOnce(runTestStub); assert.calledWith( runTestStub, @@ -384,18 +345,11 @@ describe('Apex Test Run - Code Action', () => { tests: [{ className: 'testClass' }, { className: 'secondTestClass' }], testLevel: TestLevel.RunSpecifiedTests }); - const apexLibExecutor = new ApexLibraryTestRunExecutor( - ['testClass', 'secondTestClass'], - 'path/to/dir', - false - ); + const apexLibExecutor = new ApexLibraryTestRunExecutor(['testClass', 'secondTestClass'], 'path/to/dir', false); await apexLibExecutor.run(undefined, progress, cancellationToken); expect(buildPayloadStub.called).to.be.true; - expect(buildPayloadStub.args[0]).to.eql([ - 'RunSpecifiedTests', - 'testClass,secondTestClass' - ]); + expect(buildPayloadStub.args[0]).to.eql(['RunSpecifiedTests', 'testClass,secondTestClass']); assert.calledOnce(runTestStub); assert.calledWith( runTestStub, @@ -420,11 +374,7 @@ describe('Apex Test Run - Code Action', () => { ], testLevel: TestLevel.RunSpecifiedTests }); - const apexLibExecutor = new ApexLibraryTestRunExecutor( - ['testClass', 'secondTestClass'], - 'path/to/dir', - false - ); + const apexLibExecutor = new ApexLibraryTestRunExecutor(['testClass', 'secondTestClass'], 'path/to/dir', false); runTestStub.callsFake( // eslint-disable-next-line @typescript-eslint/no-unused-vars (payload, codecoverage, exitEarly, progressReporter, token) => { @@ -470,20 +420,12 @@ describe('Apex Test Run - Code Action', () => { }); it('should return if cancellation is requested', async () => { - const apexLibExecutor = new ApexLibraryTestRunExecutor( - ['testClass', 'secondTestClass'], - 'path/to/dir', - false - ); + const apexLibExecutor = new ApexLibraryTestRunExecutor(['testClass', 'secondTestClass'], 'path/to/dir', false); runTestStub.callsFake(() => { cancellationToken.isCancellationRequested = true; }); - const result = await apexLibExecutor.run( - undefined, - progress, - cancellationToken - ); + const result = await apexLibExecutor.run(undefined, progress, cancellationToken); assert.calledOnce(runTestStub); assert.notCalled(writeResultFilesStub); @@ -492,21 +434,11 @@ describe('Apex Test Run - Code Action', () => { }); describe('Report Diagnostics', () => { - const executor = new ApexLibraryTestRunExecutor( - ['TestClass', 'TestClassTwo'], - 'path/to/dir', - false - ); + const executor = new ApexLibraryTestRunExecutor(['TestClass', 'TestClassTwo'], 'path/to/dir', false); const defaultPackageDir = 'default/package/dir'; - const componentPath = join( - defaultPackageDir, - 'main', - 'default', - 'TestClass.cls' - ); + const componentPath = join(defaultPackageDir, 'main', 'default', 'TestClass.cls'); const diagnostics = testResult.tests.map(() => { - const { exceptionMessage, exceptionStackTrace } = - testResult.tests[0].diagnostic!; + const { exceptionMessage, exceptionStackTrace } = testResult.tests[0].diagnostic!; return { message: `${exceptionMessage}\n${exceptionStackTrace}`, severity: DiagnosticSeverity.Error, @@ -536,13 +468,8 @@ describe('Apex Test Run - Code Action', () => { }; } }); - setDiagnosticStub = sb.stub( - ApexLibraryTestRunExecutor.diagnostics, - 'set' - ); - runTestStub = sb - .stub(TestService.prototype, 'runTestAsynchronous') - .resolves(testResult); + setDiagnosticStub = sb.stub(ApexLibraryTestRunExecutor.diagnostics, 'set'); + runTestStub = sb.stub(TestService.prototype, 'runTestAsynchronous').resolves(testResult); sb.stub(pathUtils, 'getTestResultsFolder'); }); @@ -551,10 +478,7 @@ describe('Apex Test Run - Code Action', () => { }); it('should clear diagnostics before setting new ones', async () => { - const clearStub = sb.stub( - ApexLibraryTestRunExecutor.diagnostics, - 'clear' - ); + const clearStub = sb.stub(ApexLibraryTestRunExecutor.diagnostics, 'clear'); await executor.run(); expect(clearStub.calledBefore(setDiagnosticStub)).to.be.true; @@ -563,25 +487,13 @@ describe('Apex Test Run - Code Action', () => { it('should set all diagnostic properties correctly', async () => { await executor.run(); - expect( - setDiagnosticStub.calledWith(Uri.file(defaultPackageDir), [ - diagnostics[0] - ]) - ); + expect(setDiagnosticStub.calledWith(Uri.file(defaultPackageDir), [diagnostics[0]])); }); it('should set multiple diagnostics correctly', async () => { await executor.run(); - expect( - setDiagnosticStub.calledWith(Uri.file(defaultPackageDir), [ - diagnostics[0] - ]) - ); - expect( - setDiagnosticStub.calledWith(Uri.file(defaultPackageDir), [ - diagnostics[1] - ]) - ); + expect(setDiagnosticStub.calledWith(Uri.file(defaultPackageDir), [diagnostics[0]])); + expect(setDiagnosticStub.calledWith(Uri.file(defaultPackageDir), [diagnostics[1]])); }); it('should not set diagnostic if filepath was not found', async () => { diff --git a/packages/salesforcedx-vscode-apex/test/vscode-integration/commands/apexTestSuite.test.ts b/packages/salesforcedx-vscode-apex/test/vscode-integration/commands/apexTestSuite.test.ts index 6479080374..8e329434d7 100644 --- a/packages/salesforcedx-vscode-apex/test/vscode-integration/commands/apexTestSuite.test.ts +++ b/packages/salesforcedx-vscode-apex/test/vscode-integration/commands/apexTestSuite.test.ts @@ -10,10 +10,7 @@ import { ContinueResponse } from '@salesforce/salesforcedx-utils-vscode'; import { expect } from 'chai'; import { createSandbox } from 'sinon'; import * as vscode from 'vscode'; -import { - ApexTestQuickPickItem, - TestType -} from '../../../src/commands/apexTestRun'; +import { ApexTestQuickPickItem, TestType } from '../../../src/commands/apexTestRun'; import { ApexTestSuiteOptions, TestSuiteBuilder, diff --git a/packages/salesforcedx-vscode-apex/test/vscode-integration/commands/launchApexReplayDebuggerWithCurrentFile.test.ts b/packages/salesforcedx-vscode-apex/test/vscode-integration/commands/launchApexReplayDebuggerWithCurrentFile.test.ts index 89096a1850..b3d1c0d96e 100644 --- a/packages/salesforcedx-vscode-apex/test/vscode-integration/commands/launchApexReplayDebuggerWithCurrentFile.test.ts +++ b/packages/salesforcedx-vscode-apex/test/vscode-integration/commands/launchApexReplayDebuggerWithCurrentFile.test.ts @@ -5,11 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ import { TestContext } from '@salesforce/core-bundle'; -import { - fileUtils, - notificationService, - SfCommandlet -} from '@salesforce/salesforcedx-utils-vscode'; +import { fileUtils, notificationService, SfCommandlet } from '@salesforce/salesforcedx-utils-vscode'; import { expect } from 'chai'; import { createSandbox, SinonStub } from 'sinon'; import * as vscode from 'vscode'; @@ -32,17 +28,12 @@ describe('Launch Replay Debugger', () => { it('should return an error when the editor is not found', async () => { sb.stub(vscode.window, 'activeTextEditor').get(() => undefined); - const showErrorMessageStub = sb.stub( - notificationService, - 'showErrorMessage' - ); + const showErrorMessageStub = sb.stub(notificationService, 'showErrorMessage'); await launchApexReplayDebuggerWithCurrentFile(); expect(showErrorMessageStub.called).to.equal(true); - expect( - showErrorMessageStub.calledWith(nls.localize('unable_to_locate_editor')) - ).to.equal(true); + expect(showErrorMessageStub.calledWith(nls.localize('unable_to_locate_editor'))).to.equal(true); }); it("should return an error when the document's URI is not found", async () => { @@ -52,17 +43,12 @@ describe('Launch Replay Debugger', () => { } })); - const showErrorMessageStub = sb.stub( - notificationService, - 'showErrorMessage' - ); + const showErrorMessageStub = sb.stub(notificationService, 'showErrorMessage'); await launchApexReplayDebuggerWithCurrentFile(); expect(showErrorMessageStub.called).to.equal(true); - expect( - showErrorMessageStub.calledWith(nls.localize('unable_to_locate_document')) - ).to.equal(true); + expect(showErrorMessageStub.calledWith(nls.localize('unable_to_locate_document'))).to.equal(true); }); it('should return an error when not a log file, not an anon apex file, and not an apex test class', async () => { @@ -72,27 +58,20 @@ describe('Launch Replay Debugger', () => { } })); - const showErrorMessageStub = sb.stub( - notificationService, - 'showErrorMessage' - ); + const showErrorMessageStub = sb.stub(notificationService, 'showErrorMessage'); sb.stub(ApexTestOutlineProvider.prototype, 'refresh').returns(undefined); - sb.stub(ApexTestOutlineProvider.prototype, 'getTestClassName').returns( - undefined - ); + sb.stub(ApexTestOutlineProvider.prototype, 'getTestClassName').returns(undefined); flushFilePathStub.returns(undefined); await launchApexReplayDebuggerWithCurrentFile(); expect(showErrorMessageStub.called).to.equal(true); - expect( - showErrorMessageStub.calledWith( - nls.localize('launch_apex_replay_debugger_unsupported_file') - ) - ).to.equal(true); + expect(showErrorMessageStub.calledWith(nls.localize('launch_apex_replay_debugger_unsupported_file'))).to.equal( + true + ); }); it('should call executeCommand() if file is a log file', async () => { @@ -102,16 +81,12 @@ describe('Launch Replay Debugger', () => { } })); - const executeCommandSpy = sb - .stub(vscode.commands, 'executeCommand') - .resolves(true); + const executeCommandSpy = sb.stub(vscode.commands, 'executeCommand').resolves(true); await launchApexReplayDebuggerWithCurrentFile(); expect(executeCommandSpy.called).to.equal(true); - expect( - executeCommandSpy.calledWith('sf.launch.replay.debugger.logfile') - ).to.equal(true); + expect(executeCommandSpy.calledWith('sf.launch.replay.debugger.logfile')).to.equal(true); }); it('should call SfCommandlet.run() if file is an anon apex file', async () => { @@ -137,23 +112,17 @@ describe('Launch Replay Debugger', () => { sb.stub(ApexTestOutlineProvider.prototype, 'refresh').returns(undefined); - sb.stub(ApexTestOutlineProvider.prototype, 'getTestClassName').returns( - 'foo.cls' - ); + sb.stub(ApexTestOutlineProvider.prototype, 'getTestClassName').returns('foo.cls'); sb.stub(SfCommandlet.prototype, 'run').returns(undefined); flushFilePathStub.returns('foo.cls'); - const executeCommandSpy = sb - .stub(vscode.commands, 'executeCommand') - .resolves(true); + const executeCommandSpy = sb.stub(vscode.commands, 'executeCommand').resolves(true); await launchApexReplayDebuggerWithCurrentFile(); expect(executeCommandSpy.called).to.equal(true); - expect(executeCommandSpy.calledWith('sf.test.view.debugTests')).to.equal( - true - ); + expect(executeCommandSpy.calledWith('sf.test.view.debugTests')).to.equal(true); }); }); diff --git a/packages/salesforcedx-vscode-apex/test/vscode-integration/embeddedSoql/soqlCompletion.test.ts b/packages/salesforcedx-vscode-apex/test/vscode-integration/embeddedSoql/soqlCompletion.test.ts index 3017c28090..cfa685e0e0 100644 --- a/packages/salesforcedx-vscode-apex/test/vscode-integration/embeddedSoql/soqlCompletion.test.ts +++ b/packages/salesforcedx-vscode-apex/test/vscode-integration/embeddedSoql/soqlCompletion.test.ts @@ -24,10 +24,7 @@ import { workspace } from 'vscode'; -import { - CancellationToken, - ProvideCompletionItemsSignature -} from 'vscode-languageclient'; +import { CancellationToken, ProvideCompletionItemsSignature } from 'vscode-languageclient'; import ProtocolCompletionItem from 'vscode-languageclient/lib/common/protocolCompletionItem'; import { soqlMiddleware } from '../../../src/embeddedSoql'; @@ -39,24 +36,15 @@ type JavaApexLocation = { line: number; column: number; }; -const createApexLSPSpecialSOQLCompletionItem = ( - soqlText: string, - location: JavaApexLocation -): CompletionItem => { +const createApexLSPSpecialSOQLCompletionItem = (soqlText: string, location: JavaApexLocation): CompletionItem => { const item = new ProtocolCompletionItem(SOQL_SPECIAL_COMPLETION_ITEM_LABEL); item.kind = CompletionItemKind.Snippet; item.detail = soqlText; item.data = location; return item; }; -const FAKE_APEX_COMPLETION_ITEM = new CompletionItem( - 'ApexCompletionItem', - CompletionItemKind.Class -); -const FAKE_SOQL_COMPLETION_ITEM = new CompletionItem( - 'SoqlCompletionItem', - CompletionItemKind.Class -); +const FAKE_APEX_COMPLETION_ITEM = new CompletionItem('ApexCompletionItem', CompletionItemKind.Class); +const FAKE_SOQL_COMPLETION_ITEM = new CompletionItem('SoqlCompletionItem', CompletionItemKind.Class); describe('Test embedded SOQL middleware to forward to SOQL LSP for code-completion', () => { let sandbox: sinon.SinonSandbox; @@ -77,9 +65,7 @@ describe('Test embedded SOQL middleware to forward to SOQL LSP for code-completi const executeCommandSpy = sandbox.spy(commands, 'executeCommand'); const { doc, position } = await prepareFile('class Test { | }'); tempDoc = doc.uri; - const items = await invokeSoqlMiddleware(doc, position, [ - FAKE_APEX_COMPLETION_ITEM - ]); + const items = await invokeSoqlMiddleware(doc, position, [FAKE_APEX_COMPLETION_ITEM]); expect(items.length).to.equal(1); // eslint-disable-next-line @typescript-eslint/no-unused-expressions @@ -89,22 +75,12 @@ describe('Test embedded SOQL middleware to forward to SOQL LSP for code-completi describe('When inside SOQL block', () => { it('Should drop Apex LSP items, invoke SOQL completion and return SOQL LSP items', async () => { - const lines: string[] = [ - 'class Test {', - ' private Account[] account = [SELECT Id |];', - '}' - ]; - const soqlOnlyLines: string[] = [ - ' ', - ' SELECT Id | ', - ' ' - ]; + const lines: string[] = ['class Test {', ' private Account[] account = [SELECT Id |];', '}']; + const soqlOnlyLines: string[] = [' ', ' SELECT Id | ', ' ']; const apexCode = lines.join('\n'); const soqlCode = soqlOnlyLines.join('\n'); - const executeCommandSpy = sandbox - .stub(commands, 'executeCommand') - .returns([FAKE_SOQL_COMPLETION_ITEM]); + const executeCommandSpy = sandbox.stub(commands, 'executeCommand').returns([FAKE_SOQL_COMPLETION_ITEM]); const { doc, position } = await prepareFile(apexCode); tempDoc = doc.uri; @@ -124,8 +100,7 @@ describe('Test embedded SOQL middleware to forward to SOQL LSP for code-completi expect(items.length).to.equal(1); expect(items[0]).to.equal(FAKE_SOQL_COMPLETION_ITEM); const virtualDocUri = executeCommandSpy.lastCall.args[1]; - const soqlVirtualDoc = - await vscode.workspace.openTextDocument(virtualDocUri); + const soqlVirtualDoc = await vscode.workspace.openTextDocument(virtualDocUri); expect(soqlVirtualDoc.getText()).to.equal(soqlCode.replace('|', '')); }); }); @@ -148,13 +123,7 @@ const invokeSoqlMiddleware = async ( const finalItems: ProtocolCompletionItem[] = []; if (soqlMiddleware.provideCompletionItem) { - const soqlItems = await soqlMiddleware.provideCompletionItem( - doc, - position, - context, - token, - apexLSPCompletionFn - ); + const soqlItems = await soqlMiddleware.provideCompletionItem(doc, position, context, token, apexLSPCompletionFn); const items: ProtocolCompletionItem[] = Array.isArray(soqlItems) ? (soqlItems as ProtocolCompletionItem[]) @@ -165,26 +134,19 @@ const invokeSoqlMiddleware = async ( return finalItems; }; -const prepareFile = async ( - text: string -): Promise<{ doc: TextDocument; position: Position }> => { +const prepareFile = async (text: string): Promise<{ doc: TextDocument; position: Position }> => { const position = getCursorPosition(text); const finalText = text.replace('|', ''); const encoder = new TextEncoder(); const workspacePath = workspace.workspaceFolders![0].uri.fsPath; - const fileUri = Uri.file( - path.join(workspacePath, `test_embeddedSoql_${generateRandomInt()}.cls`) - ); + const fileUri = Uri.file(path.join(workspacePath, `test_embeddedSoql_${generateRandomInt()}.cls`)); await workspace.fs.writeFile(fileUri, encoder.encode(finalText)); return { doc: await activate(fileUri), position }; }; -const getCursorPosition = ( - text: string, - cursorChar: string = '|' -): Position => { +const getCursorPosition = (text: string, cursorChar: string = '|'): Position => { for (const [line, lineText] of text.split('\n').entries()) { const column = lineText.indexOf(cursorChar); if (column >= 0) return new Position(line, column); diff --git a/packages/salesforcedx-vscode-apex/test/vscode-integration/javaConfiguration.test.ts b/packages/salesforcedx-vscode-apex/test/vscode-integration/javaConfiguration.test.ts index 9a382756da..5b22731fe6 100644 --- a/packages/salesforcedx-vscode-apex/test/vscode-integration/javaConfiguration.test.ts +++ b/packages/salesforcedx-vscode-apex/test/vscode-integration/javaConfiguration.test.ts @@ -14,15 +14,10 @@ import * as vscode from 'vscode'; import { JAVA_HOME_KEY, JAVA_MEMORY_KEY } from '../../src/requirements'; describe('Java Configuration Test', () => { - it('The jar should be signed', () => { shell.config.execPath = process.execPath; const apexJarPath = path.join(__dirname, '..', '..', 'apex-jorje-lsp.jar'); - expect( - shell - .exec(`jarsigner -verify ${apexJarPath}`) - .stdout.includes('jar verified') - ).to.be.true; + expect(shell.exec(`jarsigner -verify ${apexJarPath}`).stdout.includes('jar verified')).to.be.true; }); it('Should have java.home section', () => { diff --git a/packages/salesforcedx-vscode-apex/test/vscode-integration/languageClient.test.ts b/packages/salesforcedx-vscode-apex/test/vscode-integration/languageClient.test.ts index 8863701f14..78d6e42697 100644 --- a/packages/salesforcedx-vscode-apex/test/vscode-integration/languageClient.test.ts +++ b/packages/salesforcedx-vscode-apex/test/vscode-integration/languageClient.test.ts @@ -13,10 +13,7 @@ import { createSandbox, SinonStub } from 'sinon'; import * as vscode from 'vscode'; import { Uri } from 'vscode'; import { RevealOutputChannelOn } from 'vscode-languageclient'; -import { - buildClientOptions, - code2ProtocolConverter -} from '../../src/languageServer'; +import { buildClientOptions, code2ProtocolConverter } from '../../src/languageServer'; describe('Apex Language Server Client', () => { describe('Should properly handle sending URI to server on Windows', () => { @@ -32,12 +29,8 @@ describe('Apex Language Server Client', () => { }); it('Should only replace first :', () => { - const actual = code2ProtocolConverter( - Uri.parse('file:///c%3A/path/to/file/with%20%3A%20in%20name') - ); - expect(actual).to.be.eql( - 'file:///c:/path/to/file/with%20%3A%20in%20name' - ); + const actual = code2ProtocolConverter(Uri.parse('file:///c%3A/path/to/file/with%20%3A%20in%20name')); + expect(actual).to.be.eql('file:///c:/path/to/file/with%20%3A%20in%20name'); }); }); @@ -54,9 +47,7 @@ describe('Apex Language Server Client', () => { }); it('Should not replace first :', () => { - const actual = code2ProtocolConverter( - Uri.parse('file:///path/to/file/with%20%3A%20in%20name') - ); + const actual = code2ProtocolConverter(Uri.parse('file:///path/to/file/with%20%3A%20in%20name')); expect(actual).to.be.eql('file:///path/to/file/with%20%3A%20in%20name'); }); }); @@ -68,17 +59,13 @@ describe('Apex Language Server Client', () => { afterEach(() => sandbox.restore()); it('should enable it when SOQL extension is present', () => { - sandbox - .stub(vscode.extensions, 'getExtension') - .withArgs('salesforce.salesforcedx-vscode-soql') - .returns({}); + sandbox.stub(vscode.extensions, 'getExtension').withArgs('salesforce.salesforcedx-vscode-soql').returns({}); const clientOptions = buildClientOptions(); expect(clientOptions.middleware).not.to.be.undefined; expect(clientOptions.initializationOptions).not.to.be.undefined; - expect(clientOptions.initializationOptions.enableEmbeddedSoqlCompletion) - .to.be.true; + expect(clientOptions.initializationOptions.enableEmbeddedSoqlCompletion).to.be.true; }); it('should disable it when SOQL extension is present', () => { @@ -91,8 +78,7 @@ describe('Apex Language Server Client', () => { expect(clientOptions.middleware).to.be.undefined; expect(clientOptions.initializationOptions).not.to.be.undefined; - expect(clientOptions.initializationOptions.enableEmbeddedSoqlCompletion) - .to.be.false; + expect(clientOptions.initializationOptions.enableEmbeddedSoqlCompletion).to.be.false; }); }); @@ -103,16 +89,11 @@ describe('Apex Language Server Client', () => { afterEach(() => sandbox.restore()); it('should never reveal output channel', () => { - sandbox - .stub(vscode.extensions, 'getExtension') - .withArgs('salesforce.salesforcedx-vscode-soql') - .returns({}); + sandbox.stub(vscode.extensions, 'getExtension').withArgs('salesforce.salesforcedx-vscode-soql').returns({}); const clientOptions = buildClientOptions(); - expect(clientOptions.revealOutputChannelOn).to.equal( - RevealOutputChannelOn.Never - ); + expect(clientOptions.revealOutputChannelOn).to.equal(RevealOutputChannelOn.Never); }); }); diff --git a/packages/salesforcedx-vscode-apex/test/vscode-integration/settings.test.ts b/packages/salesforcedx-vscode-apex/test/vscode-integration/settings.test.ts index f8de8ea972..e233a75c2c 100644 --- a/packages/salesforcedx-vscode-apex/test/vscode-integration/settings.test.ts +++ b/packages/salesforcedx-vscode-apex/test/vscode-integration/settings.test.ts @@ -17,12 +17,9 @@ describe('Settings', () => { beforeEach(() => { settingStub = sandbox.stub(); - sandbox - .stub(vscode.workspace, 'getConfiguration') - .withArgs(SFDX_CORE_CONFIGURATION_NAME) - .returns({ - get: settingStub - }); + sandbox.stub(vscode.workspace, 'getConfiguration').withArgs(SFDX_CORE_CONFIGURATION_NAME).returns({ + get: settingStub + }); }); afterEach(() => sandbox.restore()); diff --git a/packages/salesforcedx-vscode-apex/test/vscode-integration/views/testDataUtil.ts b/packages/salesforcedx-vscode-apex/test/vscode-integration/views/testDataUtil.ts index 6b4ee56109..fdc96b2d0d 100644 --- a/packages/salesforcedx-vscode-apex/test/vscode-integration/views/testDataUtil.ts +++ b/packages/salesforcedx-vscode-apex/test/vscode-integration/views/testDataUtil.ts @@ -19,10 +19,7 @@ export const generateApexTestMethod = (namespace?: string): ApexTestMethod[] => const endPos = new vscode.Position(line, 5); const file = `/bogus/path/to/${fileName}.cls`; const uri = vscode.Uri.file(file); - const location = new vscode.Location( - uri, - new vscode.Range(startPos, endPos) - ); + const location = new vscode.Location(uri, new vscode.Range(startPos, endPos)); const testInfo: ApexTestMethod = { methodName, definingType, diff --git a/packages/salesforcedx-vscode-apex/test/vscode-integration/views/testJSONOutputs.ts b/packages/salesforcedx-vscode-apex/test/vscode-integration/views/testJSONOutputs.ts index ad7641aec9..8a2f5bfd66 100644 --- a/packages/salesforcedx-vscode-apex/test/vscode-integration/views/testJSONOutputs.ts +++ b/packages/salesforcedx-vscode-apex/test/vscode-integration/views/testJSONOutputs.ts @@ -4,10 +4,7 @@ * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - ApexTestResultData, - ApexTestResultOutcome -} from '@salesforce/apex-node-bundle'; +import { ApexTestResultData, ApexTestResultOutcome } from '@salesforce/apex-node-bundle'; import * as vscode from 'vscode'; import { FAIL_RESULT, PASS_RESULT } from '../../../src/constants'; @@ -132,10 +129,7 @@ export const apexLibMultipleResult = { const startPos = new vscode.Position(2, 0); const endPos = new vscode.Position(2, 5); -const location = new vscode.Location( - vscode.Uri.file('path/to/file0'), - new vscode.Range(startPos, endPos) -); +const location = new vscode.Location(vscode.Uri.file('path/to/file0'), new vscode.Range(startPos, endPos)); const definingType = 'file0'; export const apexLibTestInfo = [ { methodName: 'test0', definingType, location }, diff --git a/packages/salesforcedx-vscode-apex/test/vscode-integration/views/testNamespacedOutputs.ts b/packages/salesforcedx-vscode-apex/test/vscode-integration/views/testNamespacedOutputs.ts index 5c42c84a0a..9bb35f6bfa 100644 --- a/packages/salesforcedx-vscode-apex/test/vscode-integration/views/testNamespacedOutputs.ts +++ b/packages/salesforcedx-vscode-apex/test/vscode-integration/views/testNamespacedOutputs.ts @@ -4,15 +4,9 @@ * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - ApexTestResultData, - ApexTestResultOutcome -} from '@salesforce/apex-node-bundle'; +import { ApexTestResultData, ApexTestResultOutcome } from '@salesforce/apex-node-bundle'; import * as vscode from 'vscode'; -import { - apexLibMultipleSummary, - apexLibOneFileSummary -} from './testJSONOutputs'; +import { apexLibMultipleSummary, apexLibOneFileSummary } from './testJSONOutputs'; const apexLibClass = { id: 'fakeId', @@ -95,10 +89,7 @@ export const apexLibMultipleNsResult = { const startPos = new vscode.Position(2, 0); const endPos = new vscode.Position(2, 5); -const location = new vscode.Location( - vscode.Uri.file('path/to/file0'), - new vscode.Range(startPos, endPos) -); +const location = new vscode.Location(vscode.Uri.file('path/to/file0'), new vscode.Range(startPos, endPos)); const definingType = 'tester.file0'; export const apexLibNsTestInfo = [ { methodName: 'test0', definingType, location }, diff --git a/packages/salesforcedx-vscode-apex/test/vscode-integration/views/testOutline.test.ts b/packages/salesforcedx-vscode-apex/test/vscode-integration/views/testOutline.test.ts index 712ba33c40..944af25627 100644 --- a/packages/salesforcedx-vscode-apex/test/vscode-integration/views/testOutline.test.ts +++ b/packages/salesforcedx-vscode-apex/test/vscode-integration/views/testOutline.test.ts @@ -12,32 +12,16 @@ import * as events from 'events'; import * as fs from 'fs'; import { createSandbox, SinonSandbox, SinonSpy, SinonStub } from 'sinon'; import * as vscode from 'vscode'; -import { - APEX_GROUP_RANGE, - APEX_TESTS, - FAIL_RESULT, - PASS_RESULT -} from '../../../src/constants'; -import { - ClientStatus, - LanguageClientUtils -} from '../../../src/languageUtils/languageClientUtils'; +import { APEX_GROUP_RANGE, APEX_TESTS, FAIL_RESULT, PASS_RESULT } from '../../../src/constants'; +import { ClientStatus, LanguageClientUtils } from '../../../src/languageUtils/languageClientUtils'; import { nls } from '../../../src/messages'; import * as settings from '../../../src/settings'; import { apexTestRunCacheService } from '../../../src/testRunCache'; import { ApexTestMethod } from '../../../src/views/lspConverter'; -import { - ApexTestGroupNode, - ApexTestNode, - ApexTestOutlineProvider -} from '../../../src/views/testOutlineProvider'; +import { ApexTestGroupNode, ApexTestNode, ApexTestOutlineProvider } from '../../../src/views/testOutlineProvider'; import { ApexTestRunner, TestRunType } from '../../../src/views/testRunner'; import { generateApexTestMethod } from './testDataUtil'; -import { - apexLibMultipleResult, - apexLibOneFileResult, - apexLibTestInfo -} from './testJSONOutputs'; +import { apexLibMultipleResult, apexLibOneFileResult, apexLibTestInfo } from './testJSONOutputs'; const NO_TESTS_DESCRIPTION = nls.localize('test_view_no_tests_description'); @@ -96,9 +80,7 @@ describe('TestView', () => { await apexTestRunCacheService.setCachedClassTestParam(''); await apexTestRunCacheService.setCachedMethodTestParam(''); await testRunner.runApexTests([`${testMethod}`], TestRunType.Method); - expect(apexTestRunCacheService.getLastMethodTestParam()).to.eq( - testMethod - ); + expect(apexTestRunCacheService.getLastMethodTestParam()).to.eq(testMethod); // the test class value should remain unchanged expect(apexTestRunCacheService.getLastClassTestParam()).to.eq(''); }); @@ -106,16 +88,12 @@ describe('TestView', () => { await testRunner.runApexTests([`${testClass}`], TestRunType.Class); expect(apexTestRunCacheService.getLastClassTestParam()).to.eq(testClass); // the test method value should remain unchanged - expect(apexTestRunCacheService.getLastMethodTestParam()).to.eq( - testMethod - ); + expect(apexTestRunCacheService.getLastMethodTestParam()).to.eq(testMethod); }); it('Should not change last run class or method when all tests are selected', async () => { await testRunner.runApexTests([`${testRunAll}`], TestRunType.All); expect(apexTestRunCacheService.getLastClassTestParam()).to.eq(testClass); - expect(apexTestRunCacheService.getLastMethodTestParam()).to.eq( - testMethod - ); + expect(apexTestRunCacheService.getLastMethodTestParam()).to.eq(testMethod); }); }); @@ -124,9 +102,7 @@ describe('TestView', () => { testOutline = new ApexTestOutlineProvider(null); const expected = new ApexTestGroupNode(APEX_TESTS, null); expected.description = NO_TESTS_DESCRIPTION; - expect(testOutline.getHead()).to.deep.equal( - new ApexTestGroupNode(APEX_TESTS, null) - ); + expect(testOutline.getHead()).to.deep.equal(new ApexTestGroupNode(APEX_TESTS, null)); }); it('Should create one test and one class', () => { @@ -136,21 +112,15 @@ describe('TestView', () => { expect(testOutline.getHead().children.length).to.equal(1); const testChildGroup = testOutline.getHead().children[0]; expect(testChildGroup).instanceof(ApexTestGroupNode); - const groupLocation = new vscode.Location( - apexTestInfo[0].location.uri, - APEX_GROUP_RANGE - ); + const groupLocation = new vscode.Location(apexTestInfo[0].location.uri, APEX_GROUP_RANGE); expect(testChildGroup.location).to.deep.equal(groupLocation); expect(testChildGroup.name).to.equal(apexTestInfo[0].definingType); expect(testChildGroup.children.length).to.equal(1); const testChild = testChildGroup.children[0]; - const fullName = - apexTestInfo[0].definingType + '.' + apexTestInfo[0].methodName; + const fullName = apexTestInfo[0].definingType + '.' + apexTestInfo[0].methodName; expect(testChild.name).to.deep.equal(fullName); expect(testChild.location).to.deep.equal(apexTestInfo[0].location); - expect( - testOutline.getTestClassName(apexTestInfo[0].location.uri) - ).to.equal(apexTestInfo[0].definingType); + expect(testOutline.getTestClassName(apexTestInfo[0].location.uri)).to.equal(apexTestInfo[0].definingType); } }); @@ -165,10 +135,7 @@ describe('TestView', () => { const testInfo2 = apexTestInfo[i]; expect(testChildGroup.children.length).to.equal(2); // Each group has two children expect(testChildGroup.name).to.equal(testInfo1.definingType); - const groupLocation = new vscode.Location( - testInfo1.location.uri, - APEX_GROUP_RANGE - ); + const groupLocation = new vscode.Location(testInfo1.location.uri, APEX_GROUP_RANGE); expect(testChildGroup.location).to.deep.equal(groupLocation); // Check child test const test1 = testChildGroup.children[0]; @@ -181,12 +148,8 @@ describe('TestView', () => { expect(test2.location).to.deep.equal(testInfo2.location); i++; - expect(testOutline.getTestClassName(testInfo1.location.uri)).to.equal( - testInfo1.definingType - ); - expect(testOutline.getTestClassName(testInfo2.location.uri)).to.equal( - testInfo2.definingType - ); + expect(testOutline.getTestClassName(testInfo1.location.uri)).to.equal(testInfo1.definingType); + expect(testOutline.getTestClassName(testInfo2.location.uri)).to.equal(testInfo2.definingType); } } }); @@ -220,21 +183,9 @@ describe('TestView', () => { } ]); - expect( - testOutline.getTestClassName( - vscode.Uri.file('/force-app/test/Test1.cls') - ) - ).to.equal('Test1'); - expect( - testOutline.getTestClassName( - vscode.Uri.file('/force-app/test/Test2.cls') - ) - ).to.equal('Test2'); - expect( - testOutline.getTestClassName( - vscode.Uri.file('/force-app/test/Test3.cls') - ) - ).to.be.undefined; + expect(testOutline.getTestClassName(vscode.Uri.file('/force-app/test/Test1.cls'))).to.equal('Test1'); + expect(testOutline.getTestClassName(vscode.Uri.file('/force-app/test/Test2.cls'))).to.equal('Test2'); + expect(testOutline.getTestClassName(vscode.Uri.file('/force-app/test/Test3.cls'))).to.be.undefined; }); }); @@ -262,8 +213,7 @@ describe('TestView', () => { testOutline = new ApexTestOutlineProvider(apexTestInfo.slice(0, 1)); testOutline.updateTestResults('oneFilePass'); - const testGroupNode = testOutline.getHead() - .children[0] as ApexTestGroupNode; + const testGroupNode = testOutline.getHead().children[0] as ApexTestGroupNode; expect(testGroupNode.passing).to.equal(1); const testNode = testGroupNode.children[0] as ApexTestNode; expect(testNode.outcome).to.equal(PASS_RESULT); @@ -282,17 +232,11 @@ describe('TestView', () => { expect(groupNode.failing).to.eql(1); expect(groupNode.children[0].name).to.equal('file0.test0'); - expect((groupNode.children[0] as ApexTestNode).outcome).to.equal( - PASS_RESULT - ); + expect((groupNode.children[0] as ApexTestNode).outcome).to.equal(PASS_RESULT); expect(groupNode.children[1].name).to.equal('file0.test1'); - expect((groupNode.children[1] as ApexTestNode).outcome).to.equal( - FAIL_RESULT - ); + expect((groupNode.children[1] as ApexTestNode).outcome).to.equal(FAIL_RESULT); expect(groupNode.children[2].name).to.equal('file0.test2'); - expect((groupNode.children[2] as ApexTestNode).outcome).to.equal( - PASS_RESULT - ); + expect((groupNode.children[2] as ApexTestNode).outcome).to.equal(PASS_RESULT); }); }); @@ -329,10 +273,7 @@ describe('TestView', () => { await testRunner.showErrorMessage(testNode); // make sure we emit the update_selection event with the correct position - expect(eventEmitterStub.getCall(0).args).to.be.deep.equal([ - 'sf:update_selection', - testRange - ]); + expect(eventEmitterStub.getCall(0).args).to.be.deep.equal(['sf:update_selection', testRange]); }); it('Should go to error if a test has one', async () => { @@ -343,10 +284,7 @@ describe('TestView', () => { await testRunner.showErrorMessage(testNode); - expect(eventEmitterStub.getCall(0).args).to.be.deep.equal([ - 'sf:update_selection', - lineFailure - 1 - ]); + expect(eventEmitterStub.getCall(0).args).to.be.deep.equal(['sf:update_selection', lineFailure - 1]); }); it('Should go to error of first failing test in a failed test class', async () => { @@ -355,10 +293,7 @@ describe('TestView', () => { await testRunner.showErrorMessage(testClass); - expect(eventEmitterStub.getCall(0).args).to.be.deep.equal([ - 'sf:update_selection', - lineFailure - 1 - ]); + expect(eventEmitterStub.getCall(0).args).to.be.deep.equal(['sf:update_selection', lineFailure - 1]); }); }); }); diff --git a/packages/salesforcedx-vscode-apex/test/vscode-integration/views/testOutlineNamespace.test.ts b/packages/salesforcedx-vscode-apex/test/vscode-integration/views/testOutlineNamespace.test.ts index 5fbdad1687..8d202ca78b 100644 --- a/packages/salesforcedx-vscode-apex/test/vscode-integration/views/testOutlineNamespace.test.ts +++ b/packages/salesforcedx-vscode-apex/test/vscode-integration/views/testOutlineNamespace.test.ts @@ -10,59 +10,33 @@ import * as events from 'events'; import * as fs from 'fs'; import { createSandbox, SinonSandbox, SinonStub } from 'sinon'; import * as vscode from 'vscode'; -import { - APEX_GROUP_RANGE, - APEX_TESTS, - FAIL_RESULT, - PASS_RESULT -} from '../../../src/constants'; +import { APEX_GROUP_RANGE, APEX_TESTS, FAIL_RESULT, PASS_RESULT } from '../../../src/constants'; import { ApexTestMethod } from '../../../src/views/lspConverter'; -import { - ApexTestGroupNode, - ApexTestNode, - ApexTestOutlineProvider -} from '../../../src/views/testOutlineProvider'; +import { ApexTestGroupNode, ApexTestNode, ApexTestOutlineProvider } from '../../../src/views/testOutlineProvider'; import { ApexTestRunner } from '../../../src/views/testRunner'; import { generateApexTestMethod } from './testDataUtil'; -import { - apexLibMultipleNsResult, - apexLibNsResult, - apexLibNsTestInfo -} from './testNamespacedOutputs'; +import { apexLibMultipleNsResult, apexLibNsResult, apexLibNsTestInfo } from './testNamespacedOutputs'; describe('Test View with namespace', () => { let testOutline: ApexTestOutlineProvider; - const apexNamespacedTestInfo: ApexTestMethod[] = - generateApexTestMethod('tester'); + const apexNamespacedTestInfo: ApexTestMethod[] = generateApexTestMethod('tester'); describe('Get Tests and Create Tree', () => { it('Should create one test and one class when using namespace', () => { - testOutline = new ApexTestOutlineProvider( - apexNamespacedTestInfo.slice(0, 1) - ); + testOutline = new ApexTestOutlineProvider(apexNamespacedTestInfo.slice(0, 1)); if (testOutline.getHead()) { expect(testOutline.getHead().name).to.equal(APEX_TESTS); expect(testOutline.getHead().children.length).to.equal(1); const testChildGroup = testOutline.getHead().children[0]; expect(testChildGroup).instanceof(ApexTestGroupNode); - const groupLocation = new vscode.Location( - apexNamespacedTestInfo[0].location.uri, - APEX_GROUP_RANGE - ); + const groupLocation = new vscode.Location(apexNamespacedTestInfo[0].location.uri, APEX_GROUP_RANGE); expect(testChildGroup.location).to.deep.equal(groupLocation); - expect(testChildGroup.name).to.equal( - apexNamespacedTestInfo[0].definingType - ); + expect(testChildGroup.name).to.equal(apexNamespacedTestInfo[0].definingType); expect(testChildGroup.children.length).to.equal(1); const testChild = testChildGroup.children[0]; - const fullName = - apexNamespacedTestInfo[0].definingType + - '.' + - apexNamespacedTestInfo[0].methodName; + const fullName = apexNamespacedTestInfo[0].definingType + '.' + apexNamespacedTestInfo[0].methodName; expect(testChild.name).to.deep.equal(fullName); - expect(testChild.location).to.deep.equal( - apexNamespacedTestInfo[0].location - ); + expect(testChild.location).to.deep.equal(apexNamespacedTestInfo[0].location); } }); @@ -77,10 +51,7 @@ describe('Test View with namespace', () => { const testInfo2 = apexNamespacedTestInfo[i]; expect(testChildGroup.children.length).to.equal(2); // Each group has two children expect(testChildGroup.name).to.equal(testInfo1.definingType); - const groupLocation = new vscode.Location( - testInfo1.location.uri, - APEX_GROUP_RANGE - ); + const groupLocation = new vscode.Location(testInfo1.location.uri, APEX_GROUP_RANGE); expect(testChildGroup.location).to.deep.equal(groupLocation); // Check child test const test1 = testChildGroup.children[0]; @@ -124,12 +95,9 @@ describe('Test View with namespace', () => { parseJSONStub.callsFake(() => { return apexLibNsResult; }); - testOutline = new ApexTestOutlineProvider( - apexNamespacedTestInfo.slice(0, 1) - ); + testOutline = new ApexTestOutlineProvider(apexNamespacedTestInfo.slice(0, 1)); testOutline.updateTestResults('oneFilePass'); - const testGroupNode = testOutline.getHead() - .children[0] as ApexTestGroupNode; + const testGroupNode = testOutline.getHead().children[0] as ApexTestGroupNode; expect(testGroupNode.passing).to.equal(1); const testNode = testGroupNode.children[0] as ApexTestNode; expect(testNode.outcome).to.equal(PASS_RESULT); @@ -148,17 +116,11 @@ describe('Test View with namespace', () => { expect(groupNode.failing).to.eql(1); expect(groupNode.children[0].name).to.equal('tester.file0.test0'); - expect((groupNode.children[0] as ApexTestNode).outcome).to.equal( - PASS_RESULT - ); + expect((groupNode.children[0] as ApexTestNode).outcome).to.equal(PASS_RESULT); expect(groupNode.children[1].name).to.equal('tester.file0.test1'); - expect((groupNode.children[1] as ApexTestNode).outcome).to.equal( - FAIL_RESULT - ); + expect((groupNode.children[1] as ApexTestNode).outcome).to.equal(FAIL_RESULT); expect(groupNode.children[2].name).to.equal('tester.file0.test2'); - expect((groupNode.children[2] as ApexTestNode).outcome).to.equal( - PASS_RESULT - ); + expect((groupNode.children[2] as ApexTestNode).outcome).to.equal(PASS_RESULT); }); }); @@ -194,36 +156,24 @@ describe('Test View with namespace', () => { }); it('Should go to definition if a test does not have an error message', async () => { - const testNode = new ApexTestNode( - 'sampleTest', - apexNamespacedTestInfo[0].location - ); + const testNode = new ApexTestNode('sampleTest', apexNamespacedTestInfo[0].location); const testRange = testNode.location!.range; await testRunner.showErrorMessage(testNode); // make sure we emit the update_selection event with the correct position - expect(eventEmitterStub.getCall(0).args).to.be.deep.equal([ - 'sf:update_selection', - testRange - ]); + expect(eventEmitterStub.getCall(0).args).to.be.deep.equal(['sf:update_selection', testRange]); }); it('Should go to error if a test has one', async () => { const lineFailure = 22; - const testNode = new ApexTestNode( - 'failedTest', - apexNamespacedTestInfo[0].location - ); + const testNode = new ApexTestNode('failedTest', apexNamespacedTestInfo[0].location); testNode.errorMessage = 'System.AssertException: Assertion Failed'; testNode.stackTrace = `Class.fakeClass.test0: line ${lineFailure}, column 1`; await testRunner.showErrorMessage(testNode); - expect(eventEmitterStub.getCall(0).args).to.be.deep.equal([ - 'sf:update_selection', - lineFailure - 1 - ]); + expect(eventEmitterStub.getCall(0).args).to.be.deep.equal(['sf:update_selection', lineFailure - 1]); }); it('Should go to error of first failing test in a failed test class', async () => { @@ -232,10 +182,7 @@ describe('Test View with namespace', () => { await testRunner.showErrorMessage(testClass); - expect(eventEmitterStub.getCall(0).args).to.be.deep.equal([ - 'sf:update_selection', - lineFailure - 1 - ]); + expect(eventEmitterStub.getCall(0).args).to.be.deep.equal(['sf:update_selection', lineFailure - 1]); }); }); }); diff --git a/packages/salesforcedx-vscode-core/.eslintrc.json b/packages/salesforcedx-vscode-core/.eslintrc.json deleted file mode 100644 index 5b59dce583..0000000000 --- a/packages/salesforcedx-vscode-core/.eslintrc.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "root": true, - "extends": [ - "../../config/base-eslintrc.json", - "./fix-these-rules.json" - ], - "overrides": [ - { - "files": [ - "./src/**/*.ts", - "./test/**/*.ts" - ], - "parserOptions": { - "project": "./tsconfig.json" - } - } - ], - "env": { - "node": true - } -} \ No newline at end of file diff --git a/packages/salesforcedx-vscode-core/esbuild.config.js b/packages/salesforcedx-vscode-core/esbuild.config.js index 9eaa0bcbc9..f8f024abdb 100644 --- a/packages/salesforcedx-vscode-core/esbuild.config.js +++ b/packages/salesforcedx-vscode-core/esbuild.config.js @@ -4,7 +4,6 @@ * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -/* eslint-disable @typescript-eslint/no-var-requires */ const { build } = require('esbuild'); const esbuildPluginPino = require('esbuild-plugin-pino'); const fs = require('fs'); @@ -13,16 +12,10 @@ const sharedConfig = { bundle: true, format: 'cjs', platform: 'node', - external: [ - 'vscode', - 'applicationinsights', - 'shelljs' - ], + external: ['vscode', 'applicationinsights', 'shelljs'], minify: true, keepNames: true, - plugins: [ - esbuildPluginPino({ transports: ['pino-pretty'] }) - ], + plugins: [esbuildPluginPino({ transports: ['pino-pretty'] })], supported: { 'dynamic-import': false }, diff --git a/packages/salesforcedx-vscode-core/fix-these-rules.json b/packages/salesforcedx-vscode-core/fix-these-rules.json deleted file mode 100644 index b8953183ad..0000000000 --- a/packages/salesforcedx-vscode-core/fix-these-rules.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "rules": { - "prefer-arrow/prefer-arrow-functions": ["error", {}], - "@typescript-eslint/await-thenable": "warn", - "@typescript-eslint/no-floating-promises": "warn", - "@typescript-eslint/no-misused-promises": "warn", - "@typescript-eslint/no-unsafe-argument": "warn", - "@typescript-eslint/no-unsafe-assignment": "warn", - "@typescript-eslint/no-unsafe-call": "warn", - "@typescript-eslint/no-unsafe-member-access": "warn", - "@typescript-eslint/no-unsafe-return": "warn", - "@typescript-eslint/require-await": "warn", - "@typescript-eslint/unbound-method": "warn" - } -} diff --git a/packages/salesforcedx-vscode-core/package.json b/packages/salesforcedx-vscode-core/package.json index 8abdd6bc32..7596ce631c 100644 --- a/packages/salesforcedx-vscode-core/package.json +++ b/packages/salesforcedx-vscode-core/package.json @@ -18,7 +18,7 @@ "publisher": "salesforce", "license": "BSD-3-Clause", "engines": { - "vscode": "^1.86.0" + "vscode": "^1.90.0" }, "categories": [ "Other" @@ -48,26 +48,16 @@ "@types/glob": "^7.2.0", "@types/jest": "^29.5.5", "@types/mocha": "^5", - "@types/node": "^18.11.9", + "@types/node": "^20.0.0", "@types/proxyquire": "1.3.28", "@types/shelljs": "^0.7.8", "@types/sinon": "^2.3.7", - "@types/vscode": "^1.86.0", + "@types/vscode": "^1.90.0", "@types/yeoman-assert": "^3.1.1", - "@typescript-eslint/eslint-plugin": "6.9.0", - "@typescript-eslint/parser": "6.9.0", "chai": "^4.0.2", "cross-env": "5.2.0", "esbuild": "^0.19.5", "esbuild-plugin-pino": "^2.1.0", - "eslint": "8.52.0", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.29.0", - "eslint-plugin-jest": "27.5.0", - "eslint-plugin-jest-formatting": "3.1.0", - "eslint-plugin-jsdoc": "46.8.2", - "eslint-plugin-prefer-arrow": "1.2.3", "jest": "^29.7.0", "jest-junit": "14.0.1", "mocha": "^10", @@ -75,11 +65,11 @@ "mocha-multi-reporters": "^1.1.7", "mock-spawn": "0.2.6", "nyc": "^15", - "prettier": "3.0.3", + "prettier": "3.3.3", "proxyquire": "2.1.3", "sinon": "^13.0.1", "ts-jest": "^29.1.1", - "typescript": "^5.2.2", + "typescript": "^5.6.2", "yeoman-assert": "^3.1.1" }, "packaging": { diff --git a/packages/salesforcedx-vscode-core/src/channels/index.ts b/packages/salesforcedx-vscode-core/src/channels/index.ts index b4cc65f478..6ca2b68aea 100644 --- a/packages/salesforcedx-vscode-core/src/channels/index.ts +++ b/packages/salesforcedx-vscode-core/src/channels/index.ts @@ -8,7 +8,5 @@ import { ChannelService } from '@salesforce/salesforcedx-utils-vscode'; import * as vscode from 'vscode'; import { nls } from '../messages'; -export const OUTPUT_CHANNEL = vscode.window.createOutputChannel( - nls.localize('channel_name') -); +export const OUTPUT_CHANNEL = vscode.window.createOutputChannel(nls.localize('channel_name')); export const channelService = new ChannelService(OUTPUT_CHANNEL); diff --git a/packages/salesforcedx-vscode-core/src/commands/aliasList.ts b/packages/salesforcedx-vscode-core/src/commands/aliasList.ts index 4784ab9b16..e2eefd6718 100644 --- a/packages/salesforcedx-vscode-core/src/commands/aliasList.ts +++ b/packages/salesforcedx-vscode-core/src/commands/aliasList.ts @@ -5,17 +5,9 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - Command, - SfCommandBuilder -} from '@salesforce/salesforcedx-utils-vscode'; +import { Command, SfCommandBuilder } from '@salesforce/salesforcedx-utils-vscode'; import { nls } from '../messages'; -import { - EmptyParametersGatherer, - SfCommandlet, - SfCommandletExecutor, - SfWorkspaceChecker -} from './util'; +import { EmptyParametersGatherer, SfCommandlet, SfCommandletExecutor, SfWorkspaceChecker } from './util'; export class AliasList extends SfCommandletExecutor<{}> { // eslint-disable-next-line @typescript-eslint/no-unused-vars @@ -31,11 +23,7 @@ export class AliasList extends SfCommandletExecutor<{}> { const workspaceChecker = new SfWorkspaceChecker(); const parameterGatherer = new EmptyParametersGatherer(); const executor = new AliasList(); -const commandlet = new SfCommandlet( - workspaceChecker, - parameterGatherer, - executor -); +const commandlet = new SfCommandlet(workspaceChecker, parameterGatherer, executor); export const aliasList = async (): Promise => { await commandlet.run(); diff --git a/packages/salesforcedx-vscode-core/src/commands/auth/authParamsGatherer.ts b/packages/salesforcedx-vscode-core/src/commands/auth/authParamsGatherer.ts index a128312e4e..67032507b7 100644 --- a/packages/salesforcedx-vscode-core/src/commands/auth/authParamsGatherer.ts +++ b/packages/salesforcedx-vscode-core/src/commands/auth/authParamsGatherer.ts @@ -5,11 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - CancelResponse, - ContinueResponse, - ParametersGatherer -} from '@salesforce/salesforcedx-utils-vscode'; +import { CancelResponse, ContinueResponse, ParametersGatherer } from '@salesforce/salesforcedx-utils-vscode'; import * as vscode from 'vscode'; import { nls } from '../../messages'; @@ -56,17 +52,11 @@ const inputAccessToken = async (): Promise => { const accessToken = await vscode.window.showInputBox({ value: '', prompt: nls.localize('parameter_gatherer_enter_session_id'), - placeHolder: nls.localize( - 'parameter_gatherer_enter_session_id_placeholder' - ), + placeHolder: nls.localize('parameter_gatherer_enter_session_id_placeholder'), password: true, ignoreFocusOut: true, validateInput: text => { - return text && text.length > 0 - ? null - : nls.localize( - 'parameter_gatherer_enter_session_id_diagnostic_message' - ); + return text && text.length > 0 ? null : nls.localize('parameter_gatherer_enter_session_id_diagnostic_message'); } }); return accessToken; @@ -103,11 +93,7 @@ export class AuthParamsGatherer implements ParametersGatherer { public async getQuickPickItems(): Promise { const projectUrl = await this.getProjectLoginUrl(); - const items: vscode.QuickPickItem[] = [ - this.orgTypes.production, - this.orgTypes.sandbox, - this.orgTypes.custom - ]; + const items: vscode.QuickPickItem[] = [this.orgTypes.production, this.orgTypes.sandbox, this.orgTypes.custom]; if (projectUrl) { const { project } = this.orgTypes; project.detail = `${nls.localize('auth_project_detail')} (${projectUrl})`; @@ -116,9 +102,7 @@ export class AuthParamsGatherer implements ParametersGatherer { return items; } - public async gather(): Promise< - CancelResponse | ContinueResponse - > { + public async gather(): Promise> { const quickPickItems = await this.getQuickPickItems(); const selection = await vscode.window.showQuickPick(quickPickItems); if (!selection) { @@ -162,12 +146,8 @@ export class AuthParamsGatherer implements ParametersGatherer { } } -export class AccessTokenParamsGatherer - implements ParametersGatherer -{ - public async gather(): Promise< - CancelResponse | ContinueResponse - > { +export class AccessTokenParamsGatherer implements ParametersGatherer { + public async gather(): Promise> { const instanceUrl = await inputInstanceUrl(); if (instanceUrl === undefined) { return { type: 'CANCEL' }; @@ -194,26 +174,17 @@ export class AccessTokenParamsGatherer } } -export class ScratchOrgLogoutParamsGatherer - implements ParametersGatherer -{ +export class ScratchOrgLogoutParamsGatherer implements ParametersGatherer { public constructor( public readonly username: string, public readonly alias?: string ) {} public async gather(): Promise> { - const prompt = nls.localize( - 'org_logout_scratch_prompt', - this.alias || this.username - ); + const prompt = nls.localize('org_logout_scratch_prompt', this.alias || this.username); const logoutResponse = nls.localize('org_logout_scratch_logout'); - const confirm = await vscode.window.showInformationMessage( - prompt, - { modal: true }, - ...[logoutResponse] - ); + const confirm = await vscode.window.showInformationMessage(prompt, { modal: true }, ...[logoutResponse]); if (confirm !== logoutResponse) { return { type: 'CANCEL' }; } diff --git a/packages/salesforcedx-vscode-core/src/commands/auth/orgLoginAccessToken.ts b/packages/salesforcedx-vscode-core/src/commands/auth/orgLoginAccessToken.ts index 3d0121dd34..80696e5713 100644 --- a/packages/salesforcedx-vscode-core/src/commands/auth/orgLoginAccessToken.ts +++ b/packages/salesforcedx-vscode-core/src/commands/auth/orgLoginAccessToken.ts @@ -12,18 +12,11 @@ import * as vscode from 'vscode'; import { channelService, OUTPUT_CHANNEL } from '../../channels/index'; import { nls } from '../../messages'; import { SfCommandlet, SfWorkspaceChecker } from '../util'; -import { - AccessTokenParams, - AccessTokenParamsGatherer -} from './authParamsGatherer'; +import { AccessTokenParams, AccessTokenParamsGatherer } from './authParamsGatherer'; export class OrgLoginAccessTokenExecutor extends LibraryCommandletExecutor { constructor() { - super( - nls.localize('org_login_access_token_text'), - 'org_login_access_token', - OUTPUT_CHANNEL - ); + super(nls.localize('org_login_access_token_text'), 'org_login_access_token', OUTPUT_CHANNEL); } /* eslint-disable @typescript-eslint/no-unused-vars */ @@ -50,9 +43,7 @@ export class OrgLoginAccessTokenExecutor extends LibraryCommandletExecutor { - const commandlet = new SfCommandlet( - workspaceChecker, - parameterGatherer, - new OrgLoginAccessTokenExecutor() - ); + const commandlet = new SfCommandlet(workspaceChecker, parameterGatherer, new OrgLoginAccessTokenExecutor()); await commandlet.run(); }; diff --git a/packages/salesforcedx-vscode-core/src/commands/auth/orgLoginWeb.ts b/packages/salesforcedx-vscode-core/src/commands/auth/orgLoginWeb.ts index daa32a959d..3bb8d44469 100644 --- a/packages/salesforcedx-vscode-core/src/commands/auth/orgLoginWeb.ts +++ b/packages/salesforcedx-vscode-core/src/commands/auth/orgLoginWeb.ts @@ -5,16 +5,10 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - Command, - SfCommandBuilder -} from '@salesforce/salesforcedx-utils-vscode'; +import { Command, SfCommandBuilder } from '@salesforce/salesforcedx-utils-vscode'; import { CommandOutput } from '@salesforce/salesforcedx-utils-vscode'; import { CliCommandExecutor } from '@salesforce/salesforcedx-utils-vscode'; -import { - ContinueResponse, - isSFContainerMode -} from '@salesforce/salesforcedx-utils-vscode'; +import { ContinueResponse, isSFContainerMode } from '@salesforce/salesforcedx-utils-vscode'; import { EOL } from 'os'; import { Observable } from 'rxjs/Observable'; import * as vscode from 'vscode'; @@ -23,19 +17,11 @@ import { channelService } from '../../channels/index'; import { CLI } from '../../constants'; import { nls } from '../../messages'; import { isDemoMode, isProdOrg } from '../../modes/demo-mode'; -import { - notificationService, - ProgressNotification -} from '../../notifications/index'; +import { notificationService, ProgressNotification } from '../../notifications/index'; import { taskViewService } from '../../statuses/index'; import { telemetryService } from '../../telemetry'; import { workspaceUtils } from '../../util'; -import { - DemoModePromptGatherer, - SfCommandlet, - SfCommandletExecutor, - SfWorkspaceChecker -} from '../util'; +import { DemoModePromptGatherer, SfCommandlet, SfCommandletExecutor, SfWorkspaceChecker } from '../util'; import { AuthParams, AuthParamsGatherer } from './authParamsGatherer'; import { OrgLogoutAll } from './orgLogout'; @@ -52,9 +38,7 @@ export class OrgLoginWebContainerExecutor extends SfCommandletExecutor { protected showChannelOutput = false; public build(data: AuthParams): Command { - const command = new SfCommandBuilder().withDescription( - nls.localize('org_login_web_authorize_org_text') - ); + const command = new SfCommandBuilder().withDescription(nls.localize('org_login_web_authorize_org_text')); command .withArg(CLI.ORG_LOGIN_WEB) @@ -193,9 +168,7 @@ export abstract class AuthDemoModeExecutor extends SfCommandletExecutor { if (isProdOrg(JSON.parse(result))) { await promptLogOutForProdOrg(); } else { - await notificationService.showSuccessfulExecution( - execution.command.toString() - ); + await notificationService.showSuccessfulExecution(execution.command.toString()); } return Promise.resolve(); } catch (err) { @@ -242,10 +215,6 @@ export const createOrgLoginWebExecutor = (): SfCommandletExecutor<{}> => { }; export const orgLoginWeb = async (): Promise => { - const commandlet = new SfCommandlet( - workspaceChecker, - parameterGatherer, - createOrgLoginWebExecutor() - ); + const commandlet = new SfCommandlet(workspaceChecker, parameterGatherer, createOrgLoginWebExecutor()); await commandlet.run(); }; diff --git a/packages/salesforcedx-vscode-core/src/commands/auth/orgLoginWebDevHub.ts b/packages/salesforcedx-vscode-core/src/commands/auth/orgLoginWebDevHub.ts index f6331f2295..a05496c12e 100644 --- a/packages/salesforcedx-vscode-core/src/commands/auth/orgLoginWebDevHub.ts +++ b/packages/salesforcedx-vscode-core/src/commands/auth/orgLoginWebDevHub.ts @@ -5,10 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - Command, - SfCommandBuilder -} from '@salesforce/salesforcedx-utils-vscode'; +import { Command, SfCommandBuilder } from '@salesforce/salesforcedx-utils-vscode'; import { CancelResponse, ContinueResponse, @@ -19,22 +16,13 @@ import * as vscode from 'vscode'; import { CLI } from '../../constants'; import { nls } from '../../messages'; import { isDemoMode } from '../../modes/demo-mode'; -import { - SfCommandlet, - SfCommandletExecutor, - SfWorkspaceChecker -} from '../util'; +import { SfCommandlet, SfCommandletExecutor, SfWorkspaceChecker } from '../util'; import { DEFAULT_ALIAS } from './authParamsGatherer'; -import { - AuthDemoModeExecutor, - OrgLoginWebContainerExecutor -} from './orgLoginWeb'; +import { AuthDemoModeExecutor, OrgLoginWebContainerExecutor } from './orgLoginWeb'; export class OrgLoginWebDevHubContainerExecutor extends OrgLoginWebContainerExecutor { public build(data: AuthDevHubParams): Command { - const command = new SfCommandBuilder().withDescription( - nls.localize('org_login_web_authorize_dev_hub_text') - ); + const command = new SfCommandBuilder().withDescription(nls.localize('org_login_web_authorize_dev_hub_text')); command .withArg(CLI.ORG_LOGIN_DEVICE) @@ -51,9 +39,7 @@ export class OrgLoginWebDevHubExecutor extends SfCommandletExecutor<{}> { protected showChannelOutput = false; public build(data: AuthDevHubParams): Command { - const command = new SfCommandBuilder().withDescription( - nls.localize('org_login_web_authorize_dev_hub_text') - ); + const command = new SfCommandBuilder().withDescription(nls.localize('org_login_web_authorize_dev_hub_text')); command .withArg(CLI.ORG_LOGIN_WEB) @@ -78,12 +64,8 @@ export class OrgLoginWebDevHubDemoModeExecutor extends AuthDemoModeExecutor<{}> } } -export class AuthDevHubParamsGatherer - implements ParametersGatherer -{ - public async gather(): Promise< - CancelResponse | ContinueResponse - > { +export class AuthDevHubParamsGatherer implements ParametersGatherer { + public async gather(): Promise> { const aliasInputOptions = { prompt: nls.localize('parameter_gatherer_enter_alias_name'), placeHolder: DEFAULT_ALIAS @@ -121,10 +103,6 @@ export const createAuthDevHubExecutor = (): SfCommandletExecutor<{}> => { }; export const orgLoginWebDevHub = async () => { - const commandlet = new SfCommandlet( - workspaceChecker, - parameterGatherer, - createAuthDevHubExecutor() - ); + const commandlet = new SfCommandlet(workspaceChecker, parameterGatherer, createAuthDevHubExecutor()); await commandlet.run(); }; diff --git a/packages/salesforcedx-vscode-core/src/commands/auth/orgLogout.ts b/packages/salesforcedx-vscode-core/src/commands/auth/orgLogout.ts index 33115bb65f..bf4ff1d446 100644 --- a/packages/salesforcedx-vscode-core/src/commands/auth/orgLogout.ts +++ b/packages/salesforcedx-vscode-core/src/commands/auth/orgLogout.ts @@ -50,11 +50,7 @@ export class OrgLogoutAll extends SfCommandletExecutor<{}> { const workspaceChecker = new SfWorkspaceChecker(); const parameterGatherer = new EmptyParametersGatherer(); const executor = new OrgLogoutAll(); -const commandlet = new SfCommandlet( - workspaceChecker, - parameterGatherer, - executor -); +const commandlet = new SfCommandlet(workspaceChecker, parameterGatherer, executor); export const orgLogoutAll = async () => { await commandlet.run(); @@ -62,11 +58,7 @@ export const orgLogoutAll = async () => { export class OrgLogoutDefault extends LibraryCommandletExecutor { constructor() { - super( - nls.localize('org_logout_default_text'), - 'org_logout_default', - OUTPUT_CHANNEL - ); + super(nls.localize('org_logout_default_text'), 'org_logout_default', OUTPUT_CHANNEL); } /* eslint-disable @typescript-eslint/no-unused-vars */ @@ -82,10 +74,7 @@ export class OrgLogoutDefault extends LibraryCommandletExecutor { try { await removeUsername(response.data); } catch (e) { - telemetryService.sendException( - 'org_logout_default', - `Error: name = ${e.name} message = ${e.message}` - ); + telemetryService.sendException('org_logout_default', `Error: name = ${e.name} message = ${e.message}`); return false; } return true; @@ -102,16 +91,12 @@ export const orgLogoutDefault = async () => { // https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_logout.htm const logoutCommandlet = new SfCommandlet( new SfWorkspaceChecker(), - isScratch - ? new ScratchOrgLogoutParamsGatherer(username, alias) - : new SimpleGatherer(username), + isScratch ? new ScratchOrgLogoutParamsGatherer(username, alias) : new SimpleGatherer(username), new OrgLogoutDefault() ); await logoutCommandlet.run(); } else { - void notificationService.showInformationMessage( - nls.localize('org_logout_no_default_org') - ); + void notificationService.showInformationMessage(nls.localize('org_logout_no_default_org')); } }; diff --git a/packages/salesforcedx-vscode-core/src/commands/baseDeployRetrieve.ts b/packages/salesforcedx-vscode-core/src/commands/baseDeployRetrieve.ts index 0cf8f0ac1b..5b867f87ab 100644 --- a/packages/salesforcedx-vscode-core/src/commands/baseDeployRetrieve.ts +++ b/packages/salesforcedx-vscode-core/src/commands/baseDeployRetrieve.ts @@ -21,10 +21,7 @@ import { MetadataApiRetrieve, RetrieveResult } from '@salesforce/source-deploy-retrieve-bundle'; -import { - ComponentStatus, - RequestStatus -} from '@salesforce/source-deploy-retrieve-bundle/lib/src/client/types'; +import { ComponentStatus, RequestStatus } from '@salesforce/source-deploy-retrieve-bundle/lib/src/client/types'; import { join } from 'path'; import * as vscode from 'vscode'; import { channelService, OUTPUT_CHANNEL } from '../channels'; @@ -36,20 +33,13 @@ import { nls } from '../messages'; import { SalesforcePackageDirectories } from '../salesforceProject'; import { componentSetUtils } from '../services/sdr/componentSetUtils'; import { DeployQueue, salesforceCoreSettings } from '../settings'; -import { - createComponentCount, - formatException, - SfCommandletExecutor -} from './util'; +import { createComponentCount, formatException, SfCommandletExecutor } from './util'; type DeployRetrieveResult = DeployResult | RetrieveResult; type DeployRetrieveOperation = MetadataApiDeploy | MetadataApiRetrieve; -export abstract class DeployRetrieveExecutor< - T -> extends LibraryCommandletExecutor { - public static errorCollection = - vscode.languages.createDiagnosticCollection('deploy-errors'); +export abstract class DeployRetrieveExecutor extends LibraryCommandletExecutor { + public static errorCollection = vscode.languages.createDiagnosticCollection('deploy-errors'); protected cancellable: boolean = true; constructor(executionName: string, logName: string) { @@ -71,19 +61,13 @@ export abstract class DeployRetrieveExecutor< await componentSetUtils.setApiVersion(components); await componentSetUtils.setSourceApiVersion(components); - this.telemetry.addProperty( - TELEMETRY_METADATA_COUNT, - JSON.stringify(createComponentCount(components)) - ); + this.telemetry.addProperty(TELEMETRY_METADATA_COUNT, JSON.stringify(createComponentCount(components))); result = await this.doOperation(components, token); const status = result?.response.status; - return ( - status === RequestStatus.Succeeded || - status === RequestStatus.SucceededPartial - ); + return status === RequestStatus.Succeeded || status === RequestStatus.SucceededPartial; } catch (e) { throw formatException(e); } finally { @@ -91,10 +75,7 @@ export abstract class DeployRetrieveExecutor< } } - protected setupCancellation( - operation: DeployRetrieveOperation | undefined, - token?: vscode.CancellationToken - ) { + protected setupCancellation(operation: DeployRetrieveOperation | undefined, token?: vscode.CancellationToken) { if (token && operation) { token.onCancellationRequested(async () => { await operation.cancel(); @@ -102,16 +83,12 @@ export abstract class DeployRetrieveExecutor< } } - protected abstract getComponents( - response: ContinueResponse - ): Promise; + protected abstract getComponents(response: ContinueResponse): Promise; protected abstract doOperation( components: ComponentSet, token?: vscode.CancellationToken ): Promise; - protected abstract postOperation( - result: DeployRetrieveResult | undefined - ): Promise; + protected abstract postOperation(result: DeployRetrieveResult | undefined): Promise; } export abstract class DeployExecutor extends DeployRetrieveExecutor { @@ -122,13 +99,9 @@ export abstract class DeployExecutor extends DeployRetrieveExecutor { const projectPath = getRootWorkspacePath(); const connection = await WorkspaceContext.getInstance().getConnection(); components.projectDirectory = projectPath; - const sourceTrackingEnabled = - salesforceCoreSettings.getEnableSourceTrackingForDeployAndRetrieve(); + const sourceTrackingEnabled = salesforceCoreSettings.getEnableSourceTrackingForDeployAndRetrieve(); if (sourceTrackingEnabled) { - const sourceTracking = await SourceTrackingService.getSourceTracking( - projectPath, - connection - ); + const sourceTracking = await SourceTrackingService.getSourceTracking(projectPath, connection); await sourceTracking.ensureLocalTracking(); } @@ -141,27 +114,19 @@ export abstract class DeployExecutor extends DeployRetrieveExecutor { return operation.pollStatus(); } - protected async postOperation( - result: DeployResult | undefined - ): Promise { + protected async postOperation(result: DeployResult | undefined): Promise { try { if (result) { // Update Persistent Storage for the files that were deployed - PersistentStorageService.getInstance().setPropertiesForFilesDeploy( - result - ); + PersistentStorageService.getInstance().setPropertiesForFilesDeploy(result); - const relativePackageDirs = - await SalesforcePackageDirectories.getPackageDirectoryPaths(); + const relativePackageDirs = await SalesforcePackageDirectories.getPackageDirectoryPaths(); const output = this.createOutput(result, relativePackageDirs); channelService.appendLine(output); const success = result.response.status === RequestStatus.Succeeded; if (!success) { - this.unsuccessfulOperationHandler( - result, - DeployRetrieveExecutor.errorCollection - ); + this.unsuccessfulOperationHandler(result, DeployRetrieveExecutor.errorCollection); } else { DeployRetrieveExecutor.errorCollection.clear(); SfCommandletExecutor.errorCollection.clear(); @@ -172,24 +137,15 @@ export abstract class DeployExecutor extends DeployRetrieveExecutor { } } - protected unsuccessfulOperationHandler( - result: DeployResult, - errorCollection: any - ) { + protected unsuccessfulOperationHandler(result: DeployResult, errorCollection: any) { handleDeployDiagnostics(result, errorCollection); } - private createOutput( - result: DeployResult, - relativePackageDirs: string[] - ): string { + private createOutput(result: DeployResult, relativePackageDirs: string[]): string { const table = new Table(); const rowsWithRelativePaths = result.getFileResponses().map(response => { - response.filePath = getRelativeProjectPath( - response.filePath, - relativePackageDirs - ); + response.filePath = getRelativeProjectPath(response.filePath, relativePackageDirs); return response; }) as unknown as Row[]; @@ -236,22 +192,15 @@ export abstract class RetrieveExecutor extends DeployRetrieveExecutor { ): Promise { const projectPath = getRootWorkspacePath(); const connection = await WorkspaceContext.getInstance().getConnection(); - const sourceTrackingEnabled = - salesforceCoreSettings.getEnableSourceTrackingForDeployAndRetrieve(); + const sourceTrackingEnabled = salesforceCoreSettings.getEnableSourceTrackingForDeployAndRetrieve(); if (sourceTrackingEnabled) { const orgType = await workspaceContextUtils.getWorkspaceOrgType(); if (orgType === workspaceContextUtils.OrgType.SourceTracked) { - this.sourceTracking = await SourceTrackingService.getSourceTracking( - projectPath, - connection - ); + this.sourceTracking = await SourceTrackingService.getSourceTracking(projectPath, connection); } } - const defaultOutput = join( - projectPath, - (await SalesforcePackageDirectories.getDefaultPackageDir()) ?? '' - ); + const defaultOutput = join(projectPath, (await SalesforcePackageDirectories.getDefaultPackageDir()) ?? ''); const operation = await components.retrieve({ usernameOrConnection: connection, @@ -265,52 +214,34 @@ export abstract class RetrieveExecutor extends DeployRetrieveExecutor { const result: RetrieveResult = await operation.pollStatus(); if (sourceTrackingEnabled) { const status = result?.response?.status; - if ( - (status === RequestStatus.Succeeded || - status === RequestStatus.SucceededPartial) && - this.sourceTracking - ) { - await SourceTrackingService.updateSourceTrackingAfterRetrieve( - this.sourceTracking, - result - ); + if ((status === RequestStatus.Succeeded || status === RequestStatus.SucceededPartial) && this.sourceTracking) { + await SourceTrackingService.updateSourceTrackingAfterRetrieve(this.sourceTracking, result); } } return result; } - protected async postOperation( - result: RetrieveResult | undefined - ): Promise { + protected async postOperation(result: RetrieveResult | undefined): Promise { if (result) { DeployRetrieveExecutor.errorCollection.clear(); SfCommandletExecutor.errorCollection.clear(); - const relativePackageDirs = - await SalesforcePackageDirectories.getPackageDirectoryPaths(); + const relativePackageDirs = await SalesforcePackageDirectories.getPackageDirectoryPaths(); const output = this.createOutput(result, relativePackageDirs); channelService.appendLine(output); if (result?.response?.fileProperties !== undefined) { - PersistentStorageService.getInstance().setPropertiesForFilesRetrieve( - result.response.fileProperties - ); + PersistentStorageService.getInstance().setPropertiesForFilesRetrieve(result.response.fileProperties); } } } - private createOutput( - result: RetrieveResult, - relativePackageDirs: string[] - ): string { + private createOutput(result: RetrieveResult, relativePackageDirs: string[]): string { const successes: Row[] = []; const failures: Row[] = []; for (const response of result.getFileResponses()) { const asRow = response as unknown as Row; - response.filePath = getRelativeProjectPath( - response.filePath, - relativePackageDirs - ); + response.filePath = getRelativeProjectPath(response.filePath, relativePackageDirs); if (response.state !== ComponentStatus.Failed) { successes.push(asRow); } else { diff --git a/packages/salesforcedx-vscode-core/src/commands/configList.ts b/packages/salesforcedx-vscode-core/src/commands/configList.ts index 7b99f768ff..bfc3790c79 100644 --- a/packages/salesforcedx-vscode-core/src/commands/configList.ts +++ b/packages/salesforcedx-vscode-core/src/commands/configList.ts @@ -5,17 +5,9 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - Command, - SfCommandBuilder -} from '@salesforce/salesforcedx-utils-vscode'; +import { Command, SfCommandBuilder } from '@salesforce/salesforcedx-utils-vscode'; import { nls } from '../messages'; -import { - EmptyParametersGatherer, - SfCommandlet, - SfCommandletExecutor, - SfWorkspaceChecker -} from './util'; +import { EmptyParametersGatherer, SfCommandlet, SfCommandletExecutor, SfWorkspaceChecker } from './util'; export class ConfigList extends SfCommandletExecutor<{}> { // eslint-disable-next-line @typescript-eslint/no-unused-vars @@ -31,11 +23,7 @@ export class ConfigList extends SfCommandletExecutor<{}> { const workspaceChecker = new SfWorkspaceChecker(); const parameterGatherer = new EmptyParametersGatherer(); const executor = new ConfigList(); -const commandlet = new SfCommandlet( - workspaceChecker, - parameterGatherer, - executor -); +const commandlet = new SfCommandlet(workspaceChecker, parameterGatherer, executor); export const configList = async (): Promise => { await commandlet.run(); diff --git a/packages/salesforcedx-vscode-core/src/commands/configSet.ts b/packages/salesforcedx-vscode-core/src/commands/configSet.ts index c4b5401f39..bca30d5efa 100644 --- a/packages/salesforcedx-vscode-core/src/commands/configSet.ts +++ b/packages/salesforcedx-vscode-core/src/commands/configSet.ts @@ -21,11 +21,7 @@ import { TARGET_ORG_KEY } from '../constants'; import { nls } from '../messages'; -import { - EmptyParametersGatherer, - SfCommandlet, - SfWorkspaceChecker -} from './util'; +import { EmptyParametersGatherer, SfCommandlet, SfWorkspaceChecker } from './util'; export class ConfigSetExecutor extends LibraryCommandletExecutor<{}> { private usernameOrAlias: string; @@ -33,11 +29,7 @@ export class ConfigSetExecutor extends LibraryCommandletExecutor<{}> { private outputTableRow: Row = {}; constructor(usernameOrAlias: string) { - super( - nls.localize(CONFIG_SET_EXECUTOR), - CONFIG_SET_EXECUTOR, - OUTPUT_CHANNEL - ); + super(nls.localize(CONFIG_SET_EXECUTOR), CONFIG_SET_EXECUTOR, OUTPUT_CHANNEL); this.usernameOrAlias = `${usernameOrAlias}`.split(',')[0]; } @@ -86,10 +78,6 @@ const workspaceChecker = new SfWorkspaceChecker(); const parameterGatherer = new EmptyParametersGatherer(); export const configSet = async (usernameOrAlias: string): Promise => { - const commandlet = new SfCommandlet( - workspaceChecker, - parameterGatherer, - new ConfigSetExecutor(usernameOrAlias) - ); + const commandlet = new SfCommandlet(workspaceChecker, parameterGatherer, new ConfigSetExecutor(usernameOrAlias)); await commandlet.run(); }; diff --git a/packages/salesforcedx-vscode-core/src/commands/dataQuery.ts b/packages/salesforcedx-vscode-core/src/commands/dataQuery.ts index 04885c8938..d1787f37b5 100644 --- a/packages/salesforcedx-vscode-core/src/commands/dataQuery.ts +++ b/packages/salesforcedx-vscode-core/src/commands/dataQuery.ts @@ -5,15 +5,8 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - Command, - SfCommandBuilder -} from '@salesforce/salesforcedx-utils-vscode'; -import { - CancelResponse, - ContinueResponse, - ParametersGatherer -} from '@salesforce/salesforcedx-utils-vscode'; +import { Command, SfCommandBuilder } from '@salesforce/salesforcedx-utils-vscode'; +import { CancelResponse, ContinueResponse, ParametersGatherer } from '@salesforce/salesforcedx-utils-vscode'; import * as vscode from 'vscode'; import { nls } from '../messages'; import { SfCommandlet, SfCommandletExecutor, SfWorkspaceChecker } from './util'; @@ -26,20 +19,14 @@ class DataQueryExecutor extends SfCommandletExecutor<{}> { .withFlag('--query', `${data.query}`) .withLogName('data_soql_query'); if (data.api === ApiType.Tooling) { - command = command - .withArg('--use-tooling-api') - .withLogName('data_soql_query_tooling'); + command = command.withArg('--use-tooling-api').withLogName('data_soql_query_tooling'); } return command.build(); } } -export class GetQueryAndApiInputs - implements ParametersGatherer -{ - public async gather(): Promise< - CancelResponse | ContinueResponse - > { +export class GetQueryAndApiInputs implements ParametersGatherer { + public async gather(): Promise> { const editor = await vscode.window.activeTextEditor; let query; @@ -84,9 +71,7 @@ export class GetQueryAndApiInputs const apiItems = [restApi, toolingApi]; const selection = await vscode.window.showQuickPick(apiItems); - return selection - ? { type: 'CONTINUE', data: { query, api: selection.api } } - : { type: 'CANCEL' }; + return selection ? { type: 'CONTINUE', data: { query, api: selection.api } } : { type: 'CANCEL' }; } } @@ -105,10 +90,6 @@ const workspaceChecker = new SfWorkspaceChecker(); // eslint-disable-next-line @typescript-eslint/no-unused-vars export const dataQuery = (explorerDir?: any): void => { const parameterGatherer = new GetQueryAndApiInputs(); - const commandlet = new SfCommandlet( - workspaceChecker, - parameterGatherer, - new DataQueryExecutor() - ); + const commandlet = new SfCommandlet(workspaceChecker, parameterGatherer, new DataQueryExecutor()); void commandlet.run(); }; diff --git a/packages/salesforcedx-vscode-core/src/commands/debuggerStop.ts b/packages/salesforcedx-vscode-core/src/commands/debuggerStop.ts index e9dc3038f8..b982189361 100644 --- a/packages/salesforcedx-vscode-core/src/commands/debuggerStop.ts +++ b/packages/salesforcedx-vscode-core/src/commands/debuggerStop.ts @@ -5,28 +5,15 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - CliCommandExecutor, - Command, - CommandOutput, - SfCommandBuilder -} from '@salesforce/salesforcedx-utils-vscode'; -import { - ContinueResponse, - ParametersGatherer -} from '@salesforce/salesforcedx-utils-vscode'; +import { CliCommandExecutor, Command, CommandOutput, SfCommandBuilder } from '@salesforce/salesforcedx-utils-vscode'; +import { ContinueResponse, ParametersGatherer } from '@salesforce/salesforcedx-utils-vscode'; import * as vscode from 'vscode'; import { channelService } from '../channels'; import { nls } from '../messages'; import { notificationService, ProgressNotification } from '../notifications'; import { taskViewService } from '../statuses'; import { workspaceUtils } from '../util'; -import { - EmptyParametersGatherer, - SfCommandlet, - SfCommandletExecutor, - SfWorkspaceChecker -} from './util'; +import { EmptyParametersGatherer, SfCommandlet, SfCommandletExecutor, SfWorkspaceChecker } from './util'; type QueryResponse = { status: number; @@ -76,10 +63,7 @@ export class StopActiveDebuggerSessionExecutor extends SfCommandletExecutor<{}> return new SfCommandBuilder() .withArg('data:query') .withDescription(nls.localize('debugger_query_session_text')) - .withFlag( - '--query', - "SELECT Id FROM ApexDebuggerSession WHERE Status = 'Active' LIMIT 1" - ) + .withFlag('--query', "SELECT Id FROM ApexDebuggerSession WHERE Status = 'Active' LIMIT 1") .withArg('--use-tooling-api') .withJson() .withLogName('debugger_query_session') @@ -107,11 +91,7 @@ export class StopActiveDebuggerSessionExecutor extends SfCommandletExecutor<{}> try { const result = await resultPromise; const queryResponse = JSON.parse(result) as QueryResponse; - if ( - queryResponse && - queryResponse.result && - queryResponse.result.size === 1 - ) { + if (queryResponse && queryResponse.result && queryResponse.result.size === 1) { const sessionIdToUpdate = queryResponse.result.records[0].Id; if (sessionIdToUpdate && sessionIdToUpdate.startsWith('07a')) { const sessionDetachCommandlet = new SfCommandlet( @@ -122,9 +102,7 @@ export class StopActiveDebuggerSessionExecutor extends SfCommandletExecutor<{}> await sessionDetachCommandlet.run(); } } else { - void notificationService.showInformationMessage( - nls.localize('debugger_stop_none_found_text') - ); + void notificationService.showInformationMessage(nls.localize('debugger_stop_none_found_text')); } // tslint:disable-next-line:no-empty } catch (e) {} diff --git a/packages/salesforcedx-vscode-core/src/commands/deleteSource.ts b/packages/salesforcedx-vscode-core/src/commands/deleteSource.ts index 32f403af56..8368246159 100644 --- a/packages/salesforcedx-vscode-core/src/commands/deleteSource.ts +++ b/packages/salesforcedx-vscode-core/src/commands/deleteSource.ts @@ -4,10 +4,7 @@ * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - Command, - SfCommandBuilder -} from '@salesforce/salesforcedx-utils-vscode'; +import { Command, SfCommandBuilder } from '@salesforce/salesforcedx-utils-vscode'; import { fileUtils } from '@salesforce/salesforcedx-utils-vscode'; import { CancelResponse, @@ -62,9 +59,7 @@ export class ManifestChecker implements PreconditionChecker { const manifestPath = path.join(workspaceRootPath, 'manifest'); const isManifestFile = this.explorerPath.includes(manifestPath); if (isManifestFile) { - notificationService.showErrorMessage( - nls.localize('delete_source_manifest_unsupported_message') - ); + notificationService.showErrorMessage(nls.localize('delete_source_manifest_unsupported_message')); return false; } return true; @@ -73,9 +68,7 @@ export class ManifestChecker implements PreconditionChecker { } } -export class ConfirmationAndSourcePathGatherer - implements ParametersGatherer<{ filePath: string }> -{ +export class ConfirmationAndSourcePathGatherer implements ParametersGatherer<{ filePath: string }> { private explorerPath: string; private readonly PROCEED = nls.localize('confirm_delete_source_button_text'); private readonly CANCEL = nls.localize('cancel_delete_source_button_text'); @@ -84,15 +77,9 @@ export class ConfirmationAndSourcePathGatherer this.explorerPath = fileUtils.flushFilePath(uri.fsPath); } - public async gather(): Promise< - CancelResponse | ContinueResponse<{ filePath: string }> - > { + public async gather(): Promise> { const prompt = nls.localize('delete_source_confirmation_message'); - const response = await vscode.window.showInformationMessage( - prompt, - this.PROCEED, - this.CANCEL - ); + const response = await vscode.window.showInformationMessage(prompt, this.PROCEED, this.CANCEL); return response && response === this.PROCEED ? { type: 'CONTINUE', data: { filePath: this.explorerPath } } @@ -111,9 +98,7 @@ export const deleteSource = async (sourceUri: vscode.Uri) => { if (editor && editor.document.languageId !== 'forcesourcemanifest') { sourceUri = editor.document.uri; } else { - const errorMessage = nls.localize( - 'delete_source_select_file_or_directory' - ); + const errorMessage = nls.localize('delete_source_select_file_or_directory'); telemetryService.sendException('project_delete_source', errorMessage); void notificationService.showErrorMessage(errorMessage); channelService.appendLine(errorMessage); diff --git a/packages/salesforcedx-vscode-core/src/commands/deployManifest.ts b/packages/salesforcedx-vscode-core/src/commands/deployManifest.ts index 561c1ec1b2..b82ac7a5b8 100644 --- a/packages/salesforcedx-vscode-core/src/commands/deployManifest.ts +++ b/packages/salesforcedx-vscode-core/src/commands/deployManifest.ts @@ -24,15 +24,10 @@ export class LibraryDeployManifestExecutor extends DeployExecutor { super(nls.localize('deploy_this_source_text'), 'deploy_with_manifest'); } - protected async getComponents( - response: ContinueResponse - ): Promise { - const packageDirs = - await SalesforcePackageDirectories.getPackageDirectoryPaths(); + protected async getComponents(response: ContinueResponse): Promise { + const packageDirs = await SalesforcePackageDirectories.getPackageDirectoryPaths(); const rootWorkspacePath = workspaceUtils.getRootWorkspacePath(); - const resolveSourcePaths = packageDirs.map(packageDir => - join(rootWorkspacePath, packageDir) - ); + const resolveSourcePaths = packageDirs.map(packageDir => join(rootWorkspacePath, packageDir)); const componentSet = await ComponentSet.fromManifest({ manifestPath: response.data, resolveSourcePaths, diff --git a/packages/salesforcedx-vscode-core/src/commands/deploySourcePath.ts b/packages/salesforcedx-vscode-core/src/commands/deploySourcePath.ts index 1ed609c77a..6cd0bc774d 100644 --- a/packages/salesforcedx-vscode-core/src/commands/deploySourcePath.ts +++ b/packages/salesforcedx-vscode-core/src/commands/deploySourcePath.ts @@ -25,11 +25,8 @@ export class LibraryDeploySourcePathExecutor extends DeployExecutor { this.showChannelOutput = showChannelOutput; } - public async getComponents( - response: ContinueResponse - ): Promise { - const paths = - typeof response.data === 'string' ? [response.data] : response.data; + public async getComponents(response: ContinueResponse): Promise { + const paths = typeof response.data === 'string' ? [response.data] : response.data; const componentSet = ComponentSet.fromSource(paths); return componentSet; @@ -73,18 +70,13 @@ export const deploySourcePaths = async ( const messages = getConflictMessagesFor('deploy_with_sourcepath'); if (messages) { - const showOutputPanel = !( - isDeployOnSave && !salesforceCoreSettings.getDeployOnSaveShowOutputPanel() - ); + const showOutputPanel = !(isDeployOnSave && !salesforceCoreSettings.getDeployOnSaveShowOutputPanel()); const commandlet = new SfCommandlet( new SfWorkspaceChecker(), new LibraryPathsGatherer(uris), new LibraryDeploySourcePathExecutor(showOutputPanel), - new CompositePostconditionChecker( - new SourcePathChecker(), - new TimestampConflictChecker(false, messages) - ) + new CompositePostconditionChecker(new SourcePathChecker(), new TimestampConflictChecker(false, messages)) ); await commandlet.run(); diff --git a/packages/salesforcedx-vscode-core/src/commands/describeMetadata.ts b/packages/salesforcedx-vscode-core/src/commands/describeMetadata.ts index 2dd668e372..73e22f9206 100644 --- a/packages/salesforcedx-vscode-core/src/commands/describeMetadata.ts +++ b/packages/salesforcedx-vscode-core/src/commands/describeMetadata.ts @@ -45,9 +45,7 @@ export class DescribeMetadataExecutor extends SfCommandletExecutor { } } -export const describeMetadata = async ( - outputFolder: string -): Promise => { +export const describeMetadata = async (outputFolder: string): Promise => { const describeMetadataExecutor = new DescribeMetadataExecutor(); const execution = describeMetadataExecutor.execute(); if (!fs.existsSync(outputFolder)) { diff --git a/packages/salesforcedx-vscode-core/src/commands/index.ts b/packages/salesforcedx-vscode-core/src/commands/index.ts index 363ad23f1a..15d6056abc 100644 --- a/packages/salesforcedx-vscode-core/src/commands/index.ts +++ b/packages/salesforcedx-vscode-core/src/commands/index.ts @@ -44,55 +44,26 @@ export { StopActiveDebuggerSessionExecutor, debuggerStop } from './debuggerStop'; -export { - ConfirmationAndSourcePathGatherer, - DeleteSourceExecutor, - ManifestChecker, - deleteSource -} from './deleteSource'; +export { ConfirmationAndSourcePathGatherer, DeleteSourceExecutor, ManifestChecker, deleteSource } from './deleteSource'; export { projectGenerateManifest } from './projectGenerateManifest'; export { DescribeMetadataExecutor, describeMetadata } from './describeMetadata'; export { ListMetadataExecutor, listMetadata } from './listMetadata'; -export { - PackageInstallExecutor, - SelectInstallationKey, - SelectPackageID, - packageInstall -} from './packageInstall'; -export { - RefreshSObjectsExecutor, - refreshSObjects, - initSObjectDefinitions -} from './refreshSObjects'; +export { PackageInstallExecutor, SelectInstallationKey, SelectPackageID, packageInstall } from './packageInstall'; +export { RefreshSObjectsExecutor, refreshSObjects, initSObjectDefinitions } from './refreshSObjects'; export { renameLightningComponent } from './renameLightningComponent'; export { deployManifest } from './deployManifest'; -export { - LibraryDeploySourcePathExecutor, - deploySourcePaths -} from './deploySourcePath'; +export { LibraryDeploySourcePathExecutor, deploySourcePaths } from './deploySourcePath'; export { sourceDiff, sourceFolderDiff, handleCacheResults } from './sourceDiff'; export { retrieveManifest } from './retrieveManifest'; export { retrieveComponent } from './retrieveMetadata'; -export { - LibraryRetrieveSourcePathExecutor, - SourcePathChecker, - retrieveSourcePaths -} from './retrieveSourcePath'; +export { LibraryRetrieveSourcePathExecutor, SourcePathChecker, retrieveSourcePaths } from './retrieveSourcePath'; export { openDocumentation } from './openDocumentation'; export { AliasGatherer, OrgCreateExecutor, orgCreate } from './orgCreate'; export { orgDelete } from './orgDelete'; export { OrgDisplay, orgDisplay } from './orgDisplay'; export { orgList } from './orgList'; -export { - OrgOpenContainerExecutor, - OrgOpenExecutor, - getExecutor, - orgOpen -} from './orgOpen'; -export { - ProjectDeployStartExecutor, - projectDeployStart -} from './projectDeployStart'; +export { OrgOpenContainerExecutor, OrgOpenExecutor, getExecutor, orgOpen } from './orgOpen'; +export { ProjectDeployStartExecutor, projectDeployStart } from './projectDeployStart'; export { PathExistsChecker, ProjectNameAndPathAndTemplate, @@ -104,15 +75,8 @@ export { projectTemplateEnum, sfProjectGenerate } from './projectGenerate'; -export { - ProjectRetrieveStartExecutor, - projectRetrieveStart -} from './projectRetrieveStart'; -export { - viewAllChanges, - viewLocalChanges, - viewRemoteChanges -} from './source/viewChanges'; +export { ProjectRetrieveStartExecutor, projectRetrieveStart } from './projectRetrieveStart'; +export { viewAllChanges, viewLocalChanges, viewRemoteChanges } from './source/viewChanges'; export { CreateDebugLevel, CreateTraceFlag, @@ -123,11 +87,7 @@ export { UpdateTraceFlagsExecutor, startApexDebugLogging } from './startApexDebugLogging'; -export { - StopApexDebugLoggingExecutor, - stopApexDebugLogging, - turnOffLogging -} from './stopApexDebugLogging'; +export { StopApexDebugLoggingExecutor, stopApexDebugLogging, turnOffLogging } from './stopApexDebugLogging'; export { taskStop } from './taskStop'; export { analyticsGenerateTemplate, diff --git a/packages/salesforcedx-vscode-core/src/commands/isvdebugging/bootstrapCmd.ts b/packages/salesforcedx-vscode-core/src/commands/isvdebugging/bootstrapCmd.ts index 596d750fa5..1467f02a14 100644 --- a/packages/salesforcedx-vscode-core/src/commands/isvdebugging/bootstrapCmd.ts +++ b/packages/salesforcedx-vscode-core/src/commands/isvdebugging/bootstrapCmd.ts @@ -33,12 +33,7 @@ import { SelectProjectFolder, SelectProjectName } from '../projectGenerate'; -import { - CompositeParametersGatherer, - EmptyPreChecker, - SfCommandlet, - SfCommandletExecutor -} from '../util'; +import { CompositeParametersGatherer, EmptyPreChecker, SfCommandlet, SfCommandletExecutor } from '../util'; // below uses require due to bundling restrictions // eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-unused-vars const AdmZip = require('adm-zip'); @@ -57,18 +52,9 @@ export const INSTALLED_PACKAGES = 'installed-packages'; export const PACKAGE_XML = 'package.xml'; export class IsvDebugBootstrapExecutor extends SfCommandletExecutor<{}> { - public readonly relativeMetadataTempPath = path.join( - projectPaths.relativeToolsFolder(), - ISVDEBUGGER - ); - public readonly relativeApexPackageXmlPath = path.join( - this.relativeMetadataTempPath, - PACKAGE_XML - ); - public readonly relativeInstalledPackagesPath = path.join( - projectPaths.relativeToolsFolder(), - INSTALLED_PACKAGES - ); + public readonly relativeMetadataTempPath = path.join(projectPaths.relativeToolsFolder(), ISVDEBUGGER); + public readonly relativeApexPackageXmlPath = path.join(this.relativeMetadataTempPath, PACKAGE_XML); + public readonly relativeInstalledPackagesPath = path.join(projectPaths.relativeToolsFolder(), INSTALLED_PACKAGES); // eslint-disable-next-line @typescript-eslint/no-unused-vars public build(data: {}): Command { @@ -97,13 +83,9 @@ export class IsvDebugBootstrapExecutor extends SfCommandletExecutor<{}> { .build(); } - public buildQueryForOrgNamespacePrefixCommand( - data: IsvDebugBootstrapConfig - ): Command { + public buildQueryForOrgNamespacePrefixCommand(data: IsvDebugBootstrapConfig): Command { return new SfCommandBuilder() - .withDescription( - nls.localize('isv_debug_bootstrap_configure_project_retrieve_namespace') - ) + .withDescription(nls.localize('isv_debug_bootstrap_configure_project_retrieve_namespace')) .withArg('data:query') .withFlag('--query', 'SELECT NamespacePrefix FROM Organization LIMIT 1') .withFlag('--target-org', data.sessionId) @@ -112,16 +94,13 @@ export class IsvDebugBootstrapExecutor extends SfCommandletExecutor<{}> { .build(); } - public parseOrgNamespaceQueryResultJson( - orgNamespaceQueryJson: string - ): string { + public parseOrgNamespaceQueryResultJson(orgNamespaceQueryJson: string): string { const orgNamespaceQueryResponse = JSON.parse(orgNamespaceQueryJson); if ( orgNamespaceQueryResponse.result && orgNamespaceQueryResponse.result.records && orgNamespaceQueryResponse.result.records[0] && - typeof orgNamespaceQueryResponse.result.records[0].NamespacePrefix === - 'string' + typeof orgNamespaceQueryResponse.result.records[0].NamespacePrefix === 'string' ) { return orgNamespaceQueryResponse.result.records[0].NamespacePrefix; } @@ -138,13 +117,9 @@ export class IsvDebugBootstrapExecutor extends SfCommandletExecutor<{}> { .build(); } - public buildPackageInstalledListAsJsonCommand( - data: IsvDebugBootstrapConfig - ): Command { + public buildPackageInstalledListAsJsonCommand(data: IsvDebugBootstrapConfig): Command { return new SfCommandBuilder() - .withDescription( - nls.localize('isv_debug_bootstrap_list_installed_packages') - ) + .withDescription(nls.localize('isv_debug_bootstrap_list_installed_packages')) .withArg('package:installed:list') .withFlag('--target-org', data.sessionId) .withJson() @@ -152,14 +127,9 @@ export class IsvDebugBootstrapExecutor extends SfCommandletExecutor<{}> { .build(); } - public buildRetrievePackageSourceCommand( - data: IsvDebugBootstrapConfig, - packageName: string - ): Command { + public buildRetrievePackageSourceCommand(data: IsvDebugBootstrapConfig, packageName: string): Command { return new SfCommandBuilder() - .withDescription( - nls.localize('isv_debug_bootstrap_retrieve_package_source', packageName) - ) + .withDescription(nls.localize('isv_debug_bootstrap_retrieve_package_source', packageName)) .withArg('project:retrieve:start') .withFlag('--package-name', packageName) .withFlag('--target-org', data.sessionId) @@ -170,9 +140,7 @@ export class IsvDebugBootstrapExecutor extends SfCommandletExecutor<{}> { .build(); } - public parsePackageInstalledListJson( - packagesJson: string - ): InstalledPackageInfo[] { + public parsePackageInstalledListJson(packagesJson: string): InstalledPackageInfo[] { const packagesData = JSON.parse(packagesJson); return packagesData.result.map((entry: any) => { return { @@ -186,26 +154,15 @@ export class IsvDebugBootstrapExecutor extends SfCommandletExecutor<{}> { }); } - public async execute( - response: ContinueResponse - ): Promise { + public async execute(response: ContinueResponse): Promise { const cancellationTokenSource = new vscode.CancellationTokenSource(); const cancellationToken = cancellationTokenSource.token; const projectParentPath = response.data.projectUri; const projectPath = path.join(projectParentPath, response.data.projectName); - const projectMetadataTempPath = path.join( - projectPath, - this.relativeMetadataTempPath - ); - const apexRetrievePackageXmlPath = path.join( - projectPath, - this.relativeApexPackageXmlPath - ); - const projectInstalledPackagesPath = path.join( - projectPath, - this.relativeInstalledPackagesPath - ); + const projectMetadataTempPath = path.join(projectPath, this.relativeMetadataTempPath); + const apexRetrievePackageXmlPath = path.join(projectPath, this.relativeApexPackageXmlPath); + const projectInstalledPackagesPath = path.join(projectPath, this.relativeInstalledPackagesPath); // remove any previous project at this path location shell.rm('-rf', projectPath); @@ -234,29 +191,16 @@ export class IsvDebugBootstrapExecutor extends SfCommandletExecutor<{}> { cancellationToken ); try { - const salesforceProjectJsonFile = path.join( - projectPath, - 'sfdx-project.json' - ); - const salesforceProjectConfig = JSON.parse( - fs.readFileSync(salesforceProjectJsonFile, { encoding: 'utf-8' }) - ); - salesforceProjectConfig.namespace = this.parseOrgNamespaceQueryResultJson( - orgNamespaceInfoResponseJson - ); - fs.writeFileSync( - salesforceProjectJsonFile, - JSON.stringify(salesforceProjectConfig, null, 2), - { encoding: 'utf-8' } - ); + const salesforceProjectJsonFile = path.join(projectPath, 'sfdx-project.json'); + const salesforceProjectConfig = JSON.parse(fs.readFileSync(salesforceProjectJsonFile, { encoding: 'utf-8' })); + salesforceProjectConfig.namespace = this.parseOrgNamespaceQueryResultJson(orgNamespaceInfoResponseJson); + fs.writeFileSync(salesforceProjectJsonFile, JSON.stringify(salesforceProjectConfig, null, 2), { + encoding: 'utf-8' + }); } catch (error) { console.error(error); - channelService.appendLine( - nls.localize('error_updating_salesforce_project', error.toString()) - ); - notificationService.showErrorMessage( - nls.localize('error_updating_salesforce_project', error.toString()) - ); + channelService.appendLine(nls.localize('error_updating_salesforce_project', error.toString())); + notificationService.showErrorMessage(nls.localize('error_updating_salesforce_project', error.toString())); return; } @@ -280,12 +224,8 @@ export class IsvDebugBootstrapExecutor extends SfCommandletExecutor<{}> { ); } catch (error) { console.error(error); - channelService.appendLine( - nls.localize('error_creating_packagexml', error.toString()) - ); - notificationService.showErrorMessage( - nls.localize('error_creating_packagexml', error.toString()) - ); + channelService.appendLine(nls.localize('error_creating_packagexml', error.toString())); + notificationService.showErrorMessage(nls.localize('error_creating_packagexml', error.toString())); return; } @@ -322,29 +262,19 @@ export class IsvDebugBootstrapExecutor extends SfCommandletExecutor<{}> { } for (const packageInfo of packageInfos) { - channelService.appendLine( - nls.localize('isv_debug_bootstrap_processing_package', packageInfo.name) - ); + channelService.appendLine(nls.localize('isv_debug_bootstrap_processing_package', packageInfo.name)); // generate installed-package.json file try { fs.writeFileSync( - path.join( - projectInstalledPackagesPath, - packageInfo.name.replaceAll('.', '-'), - 'installed-package.json' - ), + path.join(projectInstalledPackagesPath, packageInfo.name.replaceAll('.', '-'), 'installed-package.json'), JSON.stringify(packageInfo, null, 2), { encoding: 'utf-8' } ); } catch (error) { console.error(error); - channelService.appendLine( - nls.localize('error_writing_installed_package_info', error.toString()) - ); - notificationService.showErrorMessage( - nls.localize('error_writing_installed_package_info', error.toString()) - ); + channelService.appendLine(nls.localize('error_writing_installed_package_info', error.toString())); + notificationService.showErrorMessage(nls.localize('error_writing_installed_package_info', error.toString())); return; } } @@ -354,19 +284,13 @@ export class IsvDebugBootstrapExecutor extends SfCommandletExecutor<{}> { shell.rm('-rf', projectMetadataTempPath); } catch (error) { console.error(error); - channelService.appendLine( - nls.localize('error_cleanup_temp_files', error.toString()) - ); - notificationService.showErrorMessage( - nls.localize('error_cleanup_temp_files', error.toString()) - ); + channelService.appendLine(nls.localize('error_cleanup_temp_files', error.toString())); + notificationService.showErrorMessage(nls.localize('error_cleanup_temp_files', error.toString())); return; } // 6: generate launch configuration - channelService.appendLine( - nls.localize('isv_debug_bootstrap_generate_launchjson') - ); + channelService.appendLine(nls.localize('isv_debug_bootstrap_generate_launchjson')); try { const projectVsCodeFolder = path.join(projectPath, '.vscode'); shell.mkdir('-p', projectVsCodeFolder); @@ -396,21 +320,14 @@ export class IsvDebugBootstrapExecutor extends SfCommandletExecutor<{}> { ); } catch (error) { console.error(error); - channelService.appendLine( - nls.localize('error_creating_launchjson', error.toString()) - ); - notificationService.showErrorMessage( - nls.localize('error_creating_launchjson', error.toString()) - ); + channelService.appendLine(nls.localize('error_creating_launchjson', error.toString())); + notificationService.showErrorMessage(nls.localize('error_creating_launchjson', error.toString())); return; } // last step: open the folder in VS Code channelService.appendLine(nls.localize('isv_debug_bootstrap_open_project')); - await vscode.commands.executeCommand( - 'vscode.openFolder', - vscode.Uri.file(projectPath) - ); + await vscode.commands.executeCommand('vscode.openFolder', vscode.Uri.file(projectPath)); } public async executeCommand( @@ -421,9 +338,7 @@ export class IsvDebugBootstrapExecutor extends SfCommandletExecutor<{}> { ): Promise { const startTime = process.hrtime(); // do not inherit global env because we are setting our own auth - const execution = new CliCommandExecutor(command, options, false).execute( - cancellationToken - ); + const execution = new CliCommandExecutor(command, options, false).execute(cancellationToken); const result = new CommandOutput().getCmdResult(execution); @@ -443,17 +358,13 @@ export class IsvDebugBootstrapExecutor extends SfCommandletExecutor<{}> { ) { channelService.streamCommandOutput(execution); channelService.showChannelOutput(); - notificationService.reportCommandExecutionStatus( - execution, - cancellationToken - ); + notificationService.reportCommandExecutionStatus(execution, cancellationToken); ProgressNotification.show(execution, cancellationTokenSource); taskViewService.addCommandExecution(execution, cancellationTokenSource); } } -export type IsvDebugBootstrapConfig = ProjectNameAndPathAndTemplate & - ForceIdeUri; +export type IsvDebugBootstrapConfig = ProjectNameAndPathAndTemplate & ForceIdeUri; export type ForceIdeUri = { loginUrl: string; @@ -479,14 +390,10 @@ export class EnterForceIdeUri implements ParametersGatherer { }; public forceIdUrl?: ForceIdeUri; - public async gather(): Promise< - CancelResponse | ContinueResponse - > { + public async gather(): Promise> { const forceIdeUri = await vscode.window.showInputBox({ prompt: nls.localize('parameter_gatherer_paste_forceide_url'), - placeHolder: nls.localize( - 'parameter_gatherer_paste_forceide_url_placeholder' - ), + placeHolder: nls.localize('parameter_gatherer_paste_forceide_url_placeholder'), ignoreFocusOut: true, validateInput: EnterForceIdeUri.uriValidator }); @@ -497,12 +404,9 @@ export class EnterForceIdeUri implements ParametersGatherer { const loginUrl = parameter.get('url'); const sessionId = parameter.get('sessionId'); if (loginUrl && sessionId) { - const protocolPrefix = - parameter.get('secure') === '0' ? 'http://' : 'https://'; + const protocolPrefix = parameter.get('secure') === '0' ? 'http://' : 'https://'; this.forceIdUrl = { - loginUrl: loginUrl.toLowerCase().startsWith('http') - ? loginUrl - : protocolPrefix + loginUrl, + loginUrl: loginUrl.toLowerCase().startsWith('http') ? loginUrl : protocolPrefix + loginUrl, sessionId, orgName: url.hostname }; @@ -512,9 +416,7 @@ export class EnterForceIdeUri implements ParametersGatherer { }; } - vscode.window.showErrorMessage( - nls.localize('parameter_gatherer_invalid_forceide_url') - ); + vscode.window.showErrorMessage(nls.localize('parameter_gatherer_invalid_forceide_url')); } return { type: 'CANCEL' }; @@ -526,13 +428,8 @@ const workspaceChecker = new EmptyPreChecker(); const parameterGatherer = new CompositeParametersGatherer( forceIdeUrlGatherer, new SelectProjectName(() => { - if ( - forceIdeUrlGatherer.forceIdUrl && - forceIdeUrlGatherer.forceIdUrl.orgName - ) { - return sanitize( - forceIdeUrlGatherer.forceIdUrl.orgName.replace(/[+]/g, '_') - ); + if (forceIdeUrlGatherer.forceIdUrl && forceIdeUrlGatherer.forceIdUrl.orgName) { + return sanitize(forceIdeUrlGatherer.forceIdUrl.orgName.replace(/[+]/g, '_')); } return ''; }), @@ -541,12 +438,7 @@ const parameterGatherer = new CompositeParametersGatherer( const pathExistsChecker = new PathExistsChecker(); const executor = new IsvDebugBootstrapExecutor(); -const commandlet = new SfCommandlet( - workspaceChecker, - parameterGatherer, - executor, - pathExistsChecker -); +const commandlet = new SfCommandlet(workspaceChecker, parameterGatherer, executor, pathExistsChecker); export const isvDebugBootstrap = async (): Promise => { await commandlet.run(); diff --git a/packages/salesforcedx-vscode-core/src/commands/listMetadata.ts b/packages/salesforcedx-vscode-core/src/commands/listMetadata.ts index ad1b20a7ee..5cc9a84eb8 100644 --- a/packages/salesforcedx-vscode-core/src/commands/listMetadata.ts +++ b/packages/salesforcedx-vscode-core/src/commands/listMetadata.ts @@ -21,11 +21,7 @@ export class ListMetadataExecutor extends SfCommandletExecutor { private targetOrgOrAlias: string; private folder?: string; - public constructor( - metadataType: string, - targetOrgOrAlias: string, - folder?: string - ) { + public constructor(metadataType: string, targetOrgOrAlias: string, folder?: string) { super(); this.metadataType = metadataType; this.targetOrgOrAlias = targetOrgOrAlias; @@ -66,11 +62,7 @@ export const listMetadata = async ( outputPath: string, folder?: string ): Promise => { - const listMetadataExecutor = new ListMetadataExecutor( - metadataType, - targetOrgOrAlias, - folder - ); + const listMetadataExecutor = new ListMetadataExecutor(metadataType, targetOrgOrAlias, folder); const execution = listMetadataExecutor.execute(); const cmdOutput = new CommandOutput(); const result = await cmdOutput.getCmdResult(execution); diff --git a/packages/salesforcedx-vscode-core/src/commands/openDocumentation.ts b/packages/salesforcedx-vscode-core/src/commands/openDocumentation.ts index 3cf984e7e9..796eac66cf 100644 --- a/packages/salesforcedx-vscode-core/src/commands/openDocumentation.ts +++ b/packages/salesforcedx-vscode-core/src/commands/openDocumentation.ts @@ -26,10 +26,7 @@ export const openDocumentation = (): void => { if (filePath.includes(AURA_PATH)) { docUrl = nls.localize('aura_doc_url'); - } else if ( - filePath.includes(APEX_CLASSES_PATH) || - extension === APEX_FILE_NAME_EXTENSION - ) { + } else if (filePath.includes(APEX_CLASSES_PATH) || extension === APEX_FILE_NAME_EXTENSION) { docUrl = nls.localize('apex_doc_url'); } else if (extension === SOQL_FILE_NAME_EXTENSION) { docUrl = nls.localize('soql_doc_url'); diff --git a/packages/salesforcedx-vscode-core/src/commands/orgCreate.ts b/packages/salesforcedx-vscode-core/src/commands/orgCreate.ts index 55b7de429a..e4cb51e3c1 100644 --- a/packages/salesforcedx-vscode-core/src/commands/orgCreate.ts +++ b/packages/salesforcedx-vscode-core/src/commands/orgCreate.ts @@ -83,21 +83,16 @@ export class OrgCreateExecutor extends SfCommandletExecutor { const folderName = workspaceUtils .getRootWorkspace() .name.replace(/\W/g /* Replace all non-alphanumeric characters */, ''); - defaultAlias = isAlphaNumSpaceString(folderName) - ? folderName - : DEFAULT_ALIAS; + defaultAlias = isAlphaNumSpaceString(folderName) ? folderName : DEFAULT_ALIAS; } const aliasInputOptions = { prompt: nls.localize('parameter_gatherer_enter_alias_name'), placeHolder: defaultAlias, validateInput: value => { - return isAlphaNumSpaceString(value) || value === '' - ? null - : nls.localize('error_invalid_org_alias'); + return isAlphaNumSpaceString(value) || value === '' ? null : nls.localize('error_invalid_org_alias'); } } as vscode.InputBoxOptions; const alias = await vscode.window.showInputBox(aliasInputOptions); @@ -143,19 +131,13 @@ export class AliasGatherer implements ParametersGatherer { return { type: 'CANCEL' }; } const expirationDaysInputOptions = { - prompt: nls.localize( - 'parameter_gatherer_enter_scratch_org_expiration_days' - ), + prompt: nls.localize('parameter_gatherer_enter_scratch_org_expiration_days'), placeHolder: defaultExpirationdate, validateInput: value => { - return isIntegerInRange(value, [1, 30]) || value === '' - ? null - : nls.localize('error_invalid_expiration_days'); + return isIntegerInRange(value, [1, 30]) || value === '' ? null : nls.localize('error_invalid_expiration_days'); } } as vscode.InputBoxOptions; - const scratchOrgExpirationInDays = await vscode.window.showInputBox( - expirationDaysInputOptions - ); + const scratchOrgExpirationInDays = await vscode.window.showInputBox(expirationDaysInputOptions); if (scratchOrgExpirationInDays === undefined) { return { type: 'CANCEL' }; } @@ -163,10 +145,7 @@ export class AliasGatherer implements ParametersGatherer { type: 'CONTINUE', data: { alias: alias === '' ? defaultAlias : alias, - expirationDays: - scratchOrgExpirationInDays === '' - ? defaultExpirationdate - : scratchOrgExpirationInDays + expirationDays: scratchOrgExpirationInDays === '' ? defaultExpirationdate : scratchOrgExpirationInDays } }; } @@ -178,10 +157,7 @@ export type Alias = { export type AliasAndFileSelection = Alias & FileSelection; -const preconditionChecker = new CompositePreconditionChecker( - new SfWorkspaceChecker(), - new DevUsernameChecker() -); +const preconditionChecker = new CompositePreconditionChecker(new SfWorkspaceChecker(), new DevUsernameChecker()); const parameterGatherer = new CompositeParametersGatherer( new FileSelector( nls.localize('parameter_gatherer_enter_scratch_org_def_files'), @@ -192,10 +168,6 @@ const parameterGatherer = new CompositeParametersGatherer( ); export const orgCreate = (): void => { - const commandlet = new SfCommandlet( - preconditionChecker, - parameterGatherer, - new OrgCreateExecutor() - ); + const commandlet = new SfCommandlet(preconditionChecker, parameterGatherer, new OrgCreateExecutor()); void commandlet.run(); }; diff --git a/packages/salesforcedx-vscode-core/src/commands/orgDelete.ts b/packages/salesforcedx-vscode-core/src/commands/orgDelete.ts index ed80b9bfac..5b6c2cbbcc 100644 --- a/packages/salesforcedx-vscode-core/src/commands/orgDelete.ts +++ b/packages/salesforcedx-vscode-core/src/commands/orgDelete.ts @@ -5,10 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - Command, - SfCommandBuilder -} from '@salesforce/salesforcedx-utils-vscode'; +import { Command, SfCommandBuilder } from '@salesforce/salesforcedx-utils-vscode'; import { nls } from '../messages'; import { CompositeParametersGatherer, @@ -54,19 +51,11 @@ export async function orgDelete(this: FlagParameter) { const parameterGatherer = flag ? new CompositeParametersGatherer( new SelectUsername(), - new PromptConfirmGatherer( - nls.localize('parameter_gatherer_placeholder_delete_selected_org') - ) + new PromptConfirmGatherer(nls.localize('parameter_gatherer_placeholder_delete_selected_org')) ) - : new PromptConfirmGatherer( - nls.localize('parameter_gatherer_placeholder_delete_default_org') - ); + : new PromptConfirmGatherer(nls.localize('parameter_gatherer_placeholder_delete_default_org')); const executor = new OrgDeleteExecutor(flag); - const commandlet = new SfCommandlet( - workspaceChecker, - parameterGatherer, - executor - ); + const commandlet = new SfCommandlet(workspaceChecker, parameterGatherer, executor); await commandlet.run(); } diff --git a/packages/salesforcedx-vscode-core/src/commands/orgDisplay.ts b/packages/salesforcedx-vscode-core/src/commands/orgDisplay.ts index 9b51ca2b0e..e1600bc756 100644 --- a/packages/salesforcedx-vscode-core/src/commands/orgDisplay.ts +++ b/packages/salesforcedx-vscode-core/src/commands/orgDisplay.ts @@ -5,10 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - Command, - SfCommandBuilder -} from '@salesforce/salesforcedx-utils-vscode'; +import { Command, SfCommandBuilder } from '@salesforce/salesforcedx-utils-vscode'; import { nls } from '../messages'; import { EmptyParametersGatherer, @@ -33,9 +30,7 @@ export class OrgDisplay extends SfCommandletExecutor<{}> { .withArg('org:display') .withLogName('org_display_default'); if (this.flag === '--target-org' && data.username) { - builder - .withDescription(nls.localize('org_display_username_text')) - .withFlag(this.flag, data.username); + builder.withDescription(nls.localize('org_display_username_text')).withFlag(this.flag, data.username); } return builder.build(); } @@ -46,14 +41,8 @@ const workspaceChecker = new SfWorkspaceChecker(); export async function orgDisplay(this: FlagParameter) { // tslint:disable-next-line:no-invalid-this const flag = this ? this.flag : undefined; - const parameterGatherer = flag - ? new SelectUsername() - : new EmptyParametersGatherer(); + const parameterGatherer = flag ? new SelectUsername() : new EmptyParametersGatherer(); const executor = new OrgDisplay(flag); - const commandlet = new SfCommandlet( - workspaceChecker, - parameterGatherer, - executor - ); + const commandlet = new SfCommandlet(workspaceChecker, parameterGatherer, executor); await commandlet.run(); } diff --git a/packages/salesforcedx-vscode-core/src/commands/orgList.ts b/packages/salesforcedx-vscode-core/src/commands/orgList.ts index 4411d6efec..01e343c243 100644 --- a/packages/salesforcedx-vscode-core/src/commands/orgList.ts +++ b/packages/salesforcedx-vscode-core/src/commands/orgList.ts @@ -5,17 +5,9 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - Command, - SfCommandBuilder -} from '@salesforce/salesforcedx-utils-vscode'; +import { Command, SfCommandBuilder } from '@salesforce/salesforcedx-utils-vscode'; import { nls } from '../messages'; -import { - PromptConfirmGatherer, - SfCommandlet, - SfCommandletExecutor, - SfWorkspaceChecker -} from './util'; +import { PromptConfirmGatherer, SfCommandlet, SfCommandletExecutor, SfWorkspaceChecker } from './util'; export class OrgListExecutor extends SfCommandletExecutor<{}> { // eslint-disable-next-line @typescript-eslint/no-unused-vars @@ -33,14 +25,8 @@ export class OrgListExecutor extends SfCommandletExecutor<{}> { const workspaceChecker = new SfWorkspaceChecker(); export const orgList = (): void => { - const parameterGatherer = new PromptConfirmGatherer( - nls.localize('parameter_gatherer_placeholder_org_list_clean') - ); + const parameterGatherer = new PromptConfirmGatherer(nls.localize('parameter_gatherer_placeholder_org_list_clean')); const executor = new OrgListExecutor(); - const commandlet = new SfCommandlet( - workspaceChecker, - parameterGatherer, - executor - ); + const commandlet = new SfCommandlet(workspaceChecker, parameterGatherer, executor); void commandlet.run(); }; diff --git a/packages/salesforcedx-vscode-core/src/commands/orgOpen.ts b/packages/salesforcedx-vscode-core/src/commands/orgOpen.ts index fe494276be..7e0a45f5e4 100644 --- a/packages/salesforcedx-vscode-core/src/commands/orgOpen.ts +++ b/packages/salesforcedx-vscode-core/src/commands/orgOpen.ts @@ -13,10 +13,7 @@ import { OrgOpenSuccessResult, SfCommandBuilder } from '@salesforce/salesforcedx-utils-vscode'; -import { - ContinueResponse, - isSFContainerMode -} from '@salesforce/salesforcedx-utils-vscode'; +import { ContinueResponse, isSFContainerMode } from '@salesforce/salesforcedx-utils-vscode'; import * as vscode from 'vscode'; import { channelService } from '../channels'; import { nls } from '../messages'; @@ -24,12 +21,7 @@ import { notificationService, ProgressNotification } from '../notifications'; import { taskViewService } from '../statuses'; import { telemetryService } from '../telemetry'; import { workspaceUtils } from '../util'; -import { - EmptyParametersGatherer, - SfCommandlet, - SfCommandletExecutor, - SfWorkspaceChecker -} from './util'; +import { EmptyParametersGatherer, SfCommandlet, SfCommandletExecutor, SfWorkspaceChecker } from './util'; export class OrgOpenContainerExecutor extends SfCommandletExecutor<{}> { // eslint-disable-next-line @typescript-eslint/no-unused-vars @@ -85,9 +77,7 @@ export class OrgOpenContainerExecutor extends SfCommandletExecutor<{}> { channelService.appendLine(errorResponse.message); } } catch (error) { - channelService.appendLine( - nls.localize('org_open_default_scratch_org_container_error') - ); + channelService.appendLine(nls.localize('org_open_default_scratch_org_container_error')); telemetryService.sendException( 'org_open_container', // eslint-disable-next-line @typescript-eslint/restrict-template-expressions @@ -96,10 +86,7 @@ export class OrgOpenContainerExecutor extends SfCommandletExecutor<{}> { } }); - notificationService.reportCommandExecutionStatus( - execution, - cancellationToken - ); + notificationService.reportCommandExecutionStatus(execution, cancellationToken); ProgressNotification.show(execution, cancellationTokenSource); taskViewService.addCommandExecution(execution, cancellationTokenSource); } @@ -124,10 +111,6 @@ const workspaceChecker = new SfWorkspaceChecker(); const parameterGatherer = new EmptyParametersGatherer(); export const orgOpen = (): void => { - const commandlet = new SfCommandlet( - workspaceChecker, - parameterGatherer, - getExecutor() - ); + const commandlet = new SfCommandlet(workspaceChecker, parameterGatherer, getExecutor()); void commandlet.run(); }; diff --git a/packages/salesforcedx-vscode-core/src/commands/packageInstall.ts b/packages/salesforcedx-vscode-core/src/commands/packageInstall.ts index 98ae6a7d72..a1934bcfba 100644 --- a/packages/salesforcedx-vscode-core/src/commands/packageInstall.ts +++ b/packages/salesforcedx-vscode-core/src/commands/packageInstall.ts @@ -16,12 +16,7 @@ import { import * as vscode from 'vscode'; import { PKG_ID_PREFIX } from '../constants'; import { nls } from '../messages'; -import { - CompositeParametersGatherer, - EmptyPreChecker, - SfCommandlet, - SfCommandletExecutor -} from './util'; +import { CompositeParametersGatherer, EmptyPreChecker, SfCommandlet, SfCommandletExecutor } from './util'; type packageInstallOptions = { packageId: string; @@ -74,35 +69,25 @@ export class SelectPackageID implements ParametersGatherer { } as vscode.InputBoxOptions; const packageId = await vscode.window.showInputBox(packageIdInputOptions); - return packageId - ? { type: 'CONTINUE', data: { packageId } } - : { type: 'CANCEL' }; + return packageId ? { type: 'CONTINUE', data: { packageId } } : { type: 'CANCEL' }; } } -export class SelectInstallationKey - implements ParametersGatherer -{ +export class SelectInstallationKey implements ParametersGatherer { private readonly prefillValueProvider?: () => string; constructor(prefillValueProvider?: () => string) { this.prefillValueProvider = prefillValueProvider; } - public async gather(): Promise< - CancelResponse | ContinueResponse - > { + public async gather(): Promise> { const installationKeyInputOptions = { - prompt: nls.localize( - 'parameter_gatherer_enter_installation_key_if_necessary' - ) + prompt: nls.localize('parameter_gatherer_enter_installation_key_if_necessary') } as vscode.InputBoxOptions; if (this.prefillValueProvider) { installationKeyInputOptions.value = this.prefillValueProvider(); } - const installationKey = await vscode.window.showInputBox( - installationKeyInputOptions - ); + const installationKey = await vscode.window.showInputBox(installationKeyInputOptions); return installationKey || installationKey === '' ? { type: 'CONTINUE', data: { installationKey } } : { type: 'CANCEL' }; @@ -110,16 +95,9 @@ export class SelectInstallationKey } const workspaceChecker = new EmptyPreChecker(); -const parameterGatherer = new CompositeParametersGatherer( - new SelectPackageID(), - new SelectInstallationKey() -); - -const sfPackageInstallCommandlet = new SfCommandlet( - workspaceChecker, - parameterGatherer, - new PackageInstallExecutor() -); +const parameterGatherer = new CompositeParametersGatherer(new SelectPackageID(), new SelectInstallationKey()); + +const sfPackageInstallCommandlet = new SfCommandlet(workspaceChecker, parameterGatherer, new PackageInstallExecutor()); export const packageInstall = async (): Promise => { await sfPackageInstallCommandlet.run(); diff --git a/packages/salesforcedx-vscode-core/src/commands/projectDeployStart.ts b/packages/salesforcedx-vscode-core/src/commands/projectDeployStart.ts index 351b7adfb0..92ddc4132d 100644 --- a/packages/salesforcedx-vscode-core/src/commands/projectDeployStart.ts +++ b/packages/salesforcedx-vscode-core/src/commands/projectDeployStart.ts @@ -66,7 +66,6 @@ export class ProjectDeployStartExecutor extends SfCommandletExecutor<{}> { return DeployType.Push; } - // eslint-disable-next-line @typescript-eslint/no-unused-vars public build(data: {}): Command { const builder = new SfCommandBuilder() .withDescription(nls.localize(this.params.description.default)) @@ -75,9 +74,7 @@ export class ProjectDeployStartExecutor extends SfCommandletExecutor<{}> { .withLogName(this.params.logName.default); if (this.flag === '--ignore-conflicts') { builder.withArg(this.flag); - builder.withDescription( - nls.localize(this.params.description.ignoreConflicts) - ); + builder.withDescription(nls.localize(this.params.description.ignoreConflicts)); } return builder.build(); } @@ -87,8 +84,7 @@ export class ProjectDeployStartExecutor extends SfCommandletExecutor<{}> { const cancellationTokenSource = new vscode.CancellationTokenSource(); const cancellationToken = cancellationTokenSource.token; const workspacePath = workspaceUtils.getRootWorkspacePath() || ''; - const execFilePathOrPaths = - this.getDeployType() === DeployType.Deploy ? response.data : ''; + const execFilePathOrPaths = this.getDeployType() === DeployType.Deploy ? response.data : ''; const execution = new CliCommandExecutor(this.build(response.data), { cwd: workspacePath, env: { SF_JSON_TO_STDOUT: 'true' } @@ -115,7 +111,6 @@ export class ProjectDeployStartExecutor extends SfCommandletExecutor<{}> { this.attachExecution(execution, cancellationTokenSource, cancellationToken); } - /* eslint-disable @typescript-eslint/no-unused-vars */ protected async exitProcessHandlerPush( exitCode: number | undefined, stdOut: string, @@ -125,7 +120,6 @@ export class ProjectDeployStartExecutor extends SfCommandletExecutor<{}> { startTime: [number, number], cancellationToken: vscode.CancellationToken | undefined, cancellationTokenSource: vscode.CancellationTokenSource - /* eslint-enable @typescript-eslint/no-unused-vars */ ): Promise { if (execution.command.logName === PROJECT_DEPLOY_START_LOG_NAME) { const pushResult = this.parseOutput(stdOut); @@ -158,21 +152,13 @@ export class ProjectDeployStartExecutor extends SfCommandletExecutor<{}> { SfCommandletExecutor.errorCollection.clear(); DeployRetrieveExecutor.errorCollection.clear(); if (e.name !== 'ProjectDeployStartParserFail') { - e.message = - 'Error while creating diagnostics for vscode problem view.'; + e.message = 'Error while creating diagnostics for vscode problem view.'; } - telemetryService.sendException( - execution.command.logName, - `Error: name = ${e.name} message = ${e.message}` - ); + telemetryService.sendException(execution.command.logName, `Error: name = ${e.name} message = ${e.message}`); console.error(e.message); } telemetry.addProperty('success', String(success)); - this.logMetric( - execution.command.logName, - startTime, - telemetry.build().properties - ); + this.logMetric(execution.command.logName, startTime, telemetry.build().properties); this.onDidFinishExecutionEventEmitter.fire(startTime); } } @@ -198,9 +184,7 @@ export class ProjectDeployStartExecutor extends SfCommandletExecutor<{}> { const pushedSource = successes ? successes.result.files : undefined; if (pushedSource || parser.hasConflicts()) { const rows = pushedSource || (errors && errors.files); - const title = !parser.hasConflicts() - ? nls.localize(`table_title_${titleType}ed_source`) - : undefined; + const title = !parser.hasConflicts() ? nls.localize(`table_title_${titleType}ed_source`) : undefined; const outputTable = this.getOutputTable(table, rows, title); if (parser.hasConflicts()) { channelService.appendLine(nls.localize('push_conflicts_error') + '\n'); @@ -220,11 +204,7 @@ export class ProjectDeployStartExecutor extends SfCommandletExecutor<{}> { } else if (name && message) { channelService.appendLine(`${name}: ${message}\n`); } else { - console.log( - `There were errors parsing the push operation response. Raw response: ${JSON.stringify( - errors - )}` - ); + console.log(`There were errors parsing the push operation response. Raw response: ${JSON.stringify(errors)}`); } } } @@ -266,25 +246,12 @@ export class ProjectDeployStartExecutor extends SfCommandletExecutor<{}> { const workspaceChecker = new SfWorkspaceChecker(); const parameterGatherer = new EmptyParametersGatherer(); -export async function projectDeployStart( - this: FlagParameter, - isDeployOnSave: boolean -) { - const showOutputPanel = !( - isDeployOnSave && !salesforceCoreSettings.getDeployOnSaveShowOutputPanel() - ); +export async function projectDeployStart(this: FlagParameter, isDeployOnSave: boolean) { + const showOutputPanel = !(isDeployOnSave && !salesforceCoreSettings.getDeployOnSaveShowOutputPanel()); const { flag } = this || {}; - const executor = new ProjectDeployStartExecutor( - flag, - pushCommand, - showOutputPanel - ); + const executor = new ProjectDeployStartExecutor(flag, pushCommand, showOutputPanel); - const commandlet = new SfCommandlet( - workspaceChecker, - parameterGatherer, - executor - ); + const commandlet = new SfCommandlet(workspaceChecker, parameterGatherer, executor); await commandlet.run(); } diff --git a/packages/salesforcedx-vscode-core/src/commands/projectGenerate.ts b/packages/salesforcedx-vscode-core/src/commands/projectGenerate.ts index 527ff54de5..1c7e698952 100644 --- a/packages/salesforcedx-vscode-core/src/commands/projectGenerate.ts +++ b/packages/salesforcedx-vscode-core/src/commands/projectGenerate.ts @@ -19,11 +19,7 @@ import { nls } from '../messages'; import { notificationService } from '../notifications'; import { InputUtils } from '../util/inputUtils'; import { LibraryBaseTemplateCommand } from './templates/libraryBaseTemplateCommand'; -import { - CompositeParametersGatherer, - EmptyPreChecker, - SfCommandlet -} from './util'; +import { CompositeParametersGatherer, EmptyPreChecker, SfCommandlet } from './util'; export enum projectTemplateEnum { standard = 'standard', @@ -58,14 +54,8 @@ export class LibraryProjectGenerateExecutor extends LibraryBaseTemplateCommand

{ +export class SelectProjectTemplate implements ParametersGatherer { private readonly prefillValueProvider?: () => string; constructor(prefillValueProvider?: () => string) { this.prefillValueProvider = prefillValueProvider; } - public async gather(): Promise< - CancelResponse | ContinueResponse - > { + public async gather(): Promise> { const items: vscode.QuickPickItem[] = [ - new ProjectTemplateItem( - 'project_generate_standard_template_display_text', - 'project_generate_standard_template' - ), - new ProjectTemplateItem( - 'project_generate_empty_template_display_text', - 'project_generate_empty_template' - ), - new ProjectTemplateItem( - 'project_generate_analytics_template_display_text', - 'project_generate_analytics_template' - ) + new ProjectTemplateItem('project_generate_standard_template_display_text', 'project_generate_standard_template'), + new ProjectTemplateItem('project_generate_empty_template_display_text', 'project_generate_empty_template'), + new ProjectTemplateItem('project_generate_analytics_template_display_text', 'project_generate_analytics_template') ]; const selection = await vscode.window.showQuickPick(items); @@ -140,9 +116,7 @@ export class SelectProjectTemplate default: break; } - return projectTemplate - ? { type: 'CONTINUE', data: { projectTemplate } } - : { type: 'CANCEL' }; + return projectTemplate ? { type: 'CONTINUE', data: { projectTemplate } } : { type: 'CANCEL' }; } } export class SelectProjectName implements ParametersGatherer { @@ -152,27 +126,16 @@ export class SelectProjectName implements ParametersGatherer { this.prefillValueProvider = prefillValueProvider; } - public async gather(): Promise< - CancelResponse | ContinueResponse - > { + public async gather(): Promise> { const prompt = nls.localize('parameter_gatherer_enter_project_name'); - const prefillValue = this.prefillValueProvider - ? this.prefillValueProvider() - : ''; - const projectName = await InputUtils.getFormattedString( - prompt, - prefillValue - ); - return projectName - ? { type: 'CONTINUE', data: { projectName } } - : { type: 'CANCEL' }; + const prefillValue = this.prefillValueProvider ? this.prefillValueProvider() : ''; + const projectName = await InputUtils.getFormattedString(prompt, prefillValue); + return projectName ? { type: 'CONTINUE', data: { projectName } } : { type: 'CANCEL' }; } } export class SelectProjectFolder implements ParametersGatherer { - public async gather(): Promise< - CancelResponse | ContinueResponse - > { + public async gather(): Promise> { const projectUri = await vscode.window.showOpenDialog({ canSelectFiles: false, canSelectFolders: true, @@ -185,15 +148,12 @@ export class SelectProjectFolder implements ParametersGatherer { } } -export class PathExistsChecker - implements PostconditionChecker { +export class PathExistsChecker implements PostconditionChecker { public async check( inputs: ContinueResponse | CancelResponse ): Promise | CancelResponse> { if (inputs.type === 'CONTINUE') { - const pathExists = fs.existsSync( - path.join(inputs.data.projectUri, `${inputs.data.projectName}/`) - ); + const pathExists = fs.existsSync(path.join(inputs.data.projectUri, `${inputs.data.projectName}/`)); if (!pathExists) { return inputs; } else { diff --git a/packages/salesforcedx-vscode-core/src/commands/projectGenerateManifest.ts b/packages/salesforcedx-vscode-core/src/commands/projectGenerateManifest.ts index e69ff668b2..aea1b3e8a7 100644 --- a/packages/salesforcedx-vscode-core/src/commands/projectGenerateManifest.ts +++ b/packages/salesforcedx-vscode-core/src/commands/projectGenerateManifest.ts @@ -26,11 +26,7 @@ export class GenerateManifestExecutor extends LibraryCommandletExecutor private sourcePaths: string[]; private responseText: string | undefined; constructor(sourcePaths: string[], responseText: string | undefined) { - super( - nls.localize(GENERATE_MANIFEST_EXECUTOR), - GENERATE_MANIFEST_EXECUTOR, - OUTPUT_CHANNEL - ); + super(nls.localize(GENERATE_MANIFEST_EXECUTOR), GENERATE_MANIFEST_EXECUTOR, OUTPUT_CHANNEL); this.sourcePaths = sourcePaths; this.responseText = responseText; } @@ -45,9 +41,7 @@ export class GenerateManifestExecutor extends LibraryCommandletExecutor /* eslint-enable @typescript-eslint/no-unused-vars */ ): Promise { if (this.sourcePaths) { - const packageXML = await ComponentSet.fromSource( - this.sourcePaths - ).getPackageXml(); + const packageXML = await ComponentSet.fromSource(this.sourcePaths).getPackageXml(); if (this.responseText === undefined) { // Canceled and declined to name the document await openUntitledDocument(packageXML); @@ -60,10 +54,7 @@ export class GenerateManifestExecutor extends LibraryCommandletExecutor } } -export const projectGenerateManifest = async ( - sourceUri: vscode.Uri, - uris: vscode.Uri[] | undefined -): Promise => { +export const projectGenerateManifest = async (sourceUri: vscode.Uri, uris: vscode.Uri[] | undefined): Promise => { if (!uris || uris.length < 1) { uris = []; uris.push(sourceUri); @@ -111,14 +102,9 @@ const saveDocument = async (response: string, packageXML: string): Promise const checkForDuplicateManifest = (saveLocation: string, fileName: string): void => { if (fs.existsSync(saveLocation)) { - void vscode.window.showErrorMessage( - format(nls.localize('manifest_input_dupe_error'), fileName) - ); - throw new Error( - format(nls.localize('manifest_input_dupe_error'), fileName) - ); + void vscode.window.showErrorMessage(format(nls.localize('manifest_input_dupe_error'), fileName)); + throw new Error(format(nls.localize('manifest_input_dupe_error'), fileName)); } }; -const appendExtension = (input: string): string => - parse(input).name?.concat('.xml'); +const appendExtension = (input: string): string => parse(input).name?.concat('.xml'); diff --git a/packages/salesforcedx-vscode-core/src/commands/projectRetrieveStart.ts b/packages/salesforcedx-vscode-core/src/commands/projectRetrieveStart.ts index 669c5d896b..a525ac956c 100644 --- a/packages/salesforcedx-vscode-core/src/commands/projectRetrieveStart.ts +++ b/packages/salesforcedx-vscode-core/src/commands/projectRetrieveStart.ts @@ -59,9 +59,7 @@ export class ProjectRetrieveStartExecutor extends SfCommandletExecutor<{}> { .withLogName(this.params.logName.default); if (this.flag === '--ignore-conflicts') { - builder - .withArg(this.flag) - .withDescription(nls.localize(this.params.description.ignoreConflicts)); + builder.withArg(this.flag).withDescription(nls.localize(this.params.description.ignoreConflicts)); } return builder.build(); } @@ -82,13 +80,7 @@ export class ProjectRetrieveStartExecutor extends SfCommandletExecutor<{}> { }); execution.processExitSubject.subscribe(exitCode => { - this.exitProcessHandlerPull( - exitCode, - execution, - response, - startTime, - output - ); + this.exitProcessHandlerPull(exitCode, execution, response, startTime, output); }); this.attachExecution(execution, cancellationTokenSource, cancellationToken); @@ -115,23 +107,14 @@ export class ProjectRetrieveStartExecutor extends SfCommandletExecutor<{}> { this.outputResultPull(pullParser); } - const telemetryData = this.getTelemetryData( - exitCode === 0, - response, - output - ); + const telemetryData = this.getTelemetryData(exitCode === 0, response, output); let properties; let measurements; if (telemetryData) { properties = telemetryData.properties; measurements = telemetryData.measurements; } - this.logMetric( - execution.command.logName, - startTime, - properties, - measurements - ); + this.logMetric(execution.command.logName, startTime, properties, measurements); this.onDidFinishExecutionEventEmitter.fire(startTime); } @@ -156,9 +139,7 @@ export class ProjectRetrieveStartExecutor extends SfCommandletExecutor<{}> { const pulledSource = successes ? successes?.result.files : undefined; if (pulledSource || parser.hasConflicts()) { const rows = pulledSource || errors?.files; - const tableTitle = !parser.hasConflicts() - ? nls.localize(`table_title_${titleType}ed_source`) - : undefined; + const tableTitle = !parser.hasConflicts() ? nls.localize(`table_title_${titleType}ed_source`) : undefined; const outputTable = this.getOutputTable(table, rows, tableTitle); if (parser.hasConflicts()) { channelService.appendLine(nls.localize('pull_conflicts_error') + '\n'); @@ -178,11 +159,7 @@ export class ProjectRetrieveStartExecutor extends SfCommandletExecutor<{}> { } else if (name && message) { channelService.appendLine(`${name}: ${message}\n`); } else { - console.log( - `There were errors parsing the pull operation response. Raw response: ${JSON.stringify( - errors - )}` - ); + console.log(`There were errors parsing the pull operation response. Raw response: ${JSON.stringify(errors)}`); } } } @@ -227,10 +204,6 @@ const parameterGatherer = new EmptyParametersGatherer(); export async function projectRetrieveStart(this: FlagParameter) { const { flag } = this || {}; const executor = new ProjectRetrieveStartExecutor(flag, pullCommand); - const commandlet = new SfCommandlet( - workspaceChecker, - parameterGatherer, - executor - ); + const commandlet = new SfCommandlet(workspaceChecker, parameterGatherer, executor); await commandlet.run(); } diff --git a/packages/salesforcedx-vscode-core/src/commands/refreshSObjects.ts b/packages/salesforcedx-vscode-core/src/commands/refreshSObjects.ts index 6486568c4a..0ca8e3f91a 100644 --- a/packages/salesforcedx-vscode-core/src/commands/refreshSObjects.ts +++ b/packages/salesforcedx-vscode-core/src/commands/refreshSObjects.ts @@ -38,18 +38,14 @@ export type RefreshSelection = { source: SObjectRefreshSource; }; -export class SObjectRefreshGatherer - implements ParametersGatherer -{ +export class SObjectRefreshGatherer implements ParametersGatherer { private source?: SObjectRefreshSource; public constructor(source?: SObjectRefreshSource) { this.source = source; } - public async gather(): Promise< - ContinueResponse | CancelResponse - > { + public async gather(): Promise | CancelResponse> { let category = SObjectCategory.ALL; if (!this.source || this.source === SObjectRefreshSource.Manual) { const options = [ @@ -83,8 +79,7 @@ export class SObjectRefreshGatherer } export class RefreshSObjectsExecutor extends SfCommandletExecutor<{}> { - public static readonly refreshSObjectsCommandCompletionEventEmitter = - new vscode.EventEmitter(); + public static readonly refreshSObjectsCommandCompletionEventEmitter = new vscode.EventEmitter(); public static readonly onRefreshSObjectsCommandCompletion = RefreshSObjectsExecutor.refreshSObjectsCommandCompletionEventEmitter.event; private static isActive = false; @@ -97,13 +92,9 @@ export class RefreshSObjectsExecutor extends SfCommandletExecutor<{}> { .build(); } - public async execute( - response: ContinueResponse - ): Promise { + public async execute(response: ContinueResponse): Promise { if (RefreshSObjectsExecutor.isActive) { - await vscode.window.showErrorMessage( - nls.localize('sobjects_no_refresh_if_already_active_error_text') - ); + await vscode.window.showErrorMessage(nls.localize('sobjects_no_refresh_if_already_active_error_text')); return; } const startTime = process.hrtime(); @@ -119,22 +110,14 @@ export class RefreshSObjectsExecutor extends SfCommandletExecutor<{}> { } if (response.data.source !== SObjectRefreshSource.StartupMin) { - notificationService.reportCommandExecutionStatus( - execution, - channelService, - cancellationToken - ); + notificationService.reportCommandExecutionStatus(execution, channelService, cancellationToken); } let progressLocation = vscode.ProgressLocation.Notification; if (response.data.source !== SObjectRefreshSource.Manual) { progressLocation = vscode.ProgressLocation.Window; } - ProgressNotification.show( - execution, - cancellationTokenSource, - progressLocation - ); + ProgressNotification.show(execution, cancellationTokenSource, progressLocation); const commandName = execution.command.logName; try { @@ -170,11 +153,9 @@ export class RefreshSObjectsExecutor extends SfCommandletExecutor<{}> { customObjects: result.data.customObjects ?? 0 } ); - RefreshSObjectsExecutor.refreshSObjectsCommandCompletionEventEmitter.fire( - { - exitCode: LocalCommandExecution.SUCCESS_CODE - } - ); + RefreshSObjectsExecutor.refreshSObjectsCommandCompletionEventEmitter.fire({ + exitCode: LocalCommandExecution.SUCCESS_CODE + }); } catch (error) { console.log('Generate error ' + error.error); telemetryService.sendException( @@ -195,32 +176,17 @@ const workspaceChecker = new SfWorkspaceChecker(); export const refreshSObjects = async (source?: SObjectRefreshSource) => { const parameterGatherer = new SObjectRefreshGatherer(source); - const commandlet = new SfCommandlet( - workspaceChecker, - parameterGatherer, - new RefreshSObjectsExecutor() - ); + const commandlet = new SfCommandlet(workspaceChecker, parameterGatherer, new RefreshSObjectsExecutor()); await commandlet.run(); }; -export const initSObjectDefinitions = async ( - projectPath: string, - isSettingEnabled: boolean -) => { +export const initSObjectDefinitions = async (projectPath: string, isSettingEnabled: boolean) => { if (projectPath) { - const sobjectFolder = isSettingEnabled - ? getSObjectsDirectory() - : getStandardSObjectsDirectory(); - const refreshSource = isSettingEnabled - ? SObjectRefreshSource.Startup - : SObjectRefreshSource.StartupMin; + const sobjectFolder = isSettingEnabled ? getSObjectsDirectory() : getStandardSObjectsDirectory(); + const refreshSource = isSettingEnabled ? SObjectRefreshSource.Startup : SObjectRefreshSource.StartupMin; if (!fs.existsSync(sobjectFolder)) { - telemetryService.sendEventData( - 'sObjectRefreshNotification', - { type: refreshSource }, - undefined - ); + telemetryService.sendEventData('sObjectRefreshNotification', { type: refreshSource }, undefined); try { await refreshSObjects(refreshSource); } catch (e) { @@ -236,9 +202,5 @@ const getSObjectsDirectory = () => { }; const getStandardSObjectsDirectory = () => { - return path.join( - projectPaths.toolsFolder(), - SOBJECTS_DIR, - STANDARDOBJECTS_DIR - ); + return path.join(projectPaths.toolsFolder(), SOBJECTS_DIR, STANDARDOBJECTS_DIR); }; diff --git a/packages/salesforcedx-vscode-core/src/commands/renameLightningComponent.ts b/packages/salesforcedx-vscode-core/src/commands/renameLightningComponent.ts index bf99f46e22..64d360f9f1 100644 --- a/packages/salesforcedx-vscode-core/src/commands/renameLightningComponent.ts +++ b/packages/salesforcedx-vscode-core/src/commands/renameLightningComponent.ts @@ -7,42 +7,33 @@ import { notificationService } from '@salesforce/salesforcedx-utils-vscode'; import { LibraryCommandletExecutor } from '@salesforce/salesforcedx-utils-vscode'; -import { - CancelResponse, - ContinueResponse, - ParametersGatherer -} from '@salesforce/salesforcedx-utils-vscode'; +import { CancelResponse, ContinueResponse, ParametersGatherer } from '@salesforce/salesforcedx-utils-vscode'; import { CreateUtil } from '@salesforce/templates'; import * as fs from 'fs'; import * as path from 'path'; import * as vscode from 'vscode'; import { OUTPUT_CHANNEL } from '../channels'; import { nls } from '../messages'; -import { - ComponentName, - getComponentName, - getComponentPath, - isLwcComponent, - TEST_FOLDER -} from '../util'; +import { ComponentName, getComponentName, getComponentPath, isLwcComponent, TEST_FOLDER } from '../util'; import { SfCommandlet, SfWorkspaceChecker } from './util'; -import { LwcAuraDuplicateComponentCheckerForRename } from './util'; -import { isNameMatch, RENAME_ERROR, RENAME_INPUT_PLACEHOLDER, RENAME_INPUT_PROMPT, RENAME_LIGHTNING_COMPONENT_EXECUTOR, RENAME_WARNING } from './util/lwcAuraDuplicateDetectionUtils'; +import { LwcAuraDuplicateComponentCheckerForRename } from './util'; +import { + isNameMatch, + RENAME_ERROR, + RENAME_INPUT_PLACEHOLDER, + RENAME_INPUT_PROMPT, + RENAME_LIGHTNING_COMPONENT_EXECUTOR, + RENAME_WARNING +} from './util/lwcAuraDuplicateDetectionUtils'; export class RenameLwcComponentExecutor extends LibraryCommandletExecutor { private sourceFsPath: string; constructor(sourceFsPath: string) { - super( - nls.localize(RENAME_LIGHTNING_COMPONENT_EXECUTOR), - RENAME_LIGHTNING_COMPONENT_EXECUTOR, - OUTPUT_CHANNEL - ); + super(nls.localize(RENAME_LIGHTNING_COMPONENT_EXECUTOR), RENAME_LIGHTNING_COMPONENT_EXECUTOR, OUTPUT_CHANNEL); this.sourceFsPath = sourceFsPath; } - public async run( - response: ContinueResponse - ): Promise { + public async run(response: ContinueResponse): Promise { let newComponentName = response.data.name?.trim(); if (newComponentName && this.sourceFsPath) { newComponentName = await inputGuard(this.sourceFsPath, newComponentName); @@ -77,25 +68,18 @@ export class GetComponentName implements ParametersGatherer { constructor(sourceFsPath: string) { this.sourceFsPath = sourceFsPath; } - public async gather(): Promise< - CancelResponse | ContinueResponse - > { + public async gather(): Promise> { const inputOptions = { value: getComponentName(await getComponentPath(this.sourceFsPath)), placeHolder: nls.localize(RENAME_INPUT_PLACEHOLDER), promopt: nls.localize(RENAME_INPUT_PROMPT) } as vscode.InputBoxOptions; const inputResult = await vscode.window.showInputBox(inputOptions); - return inputResult - ? { type: 'CONTINUE', data: { name: inputResult } } - : { type: 'CANCEL' }; + return inputResult ? { type: 'CONTINUE', data: { name: inputResult } } : { type: 'CANCEL' }; } } -export const inputGuard = async ( - sourceFsPath: string, - newName: string -): Promise => { +export const inputGuard = async (sourceFsPath: string, newName: string): Promise => { const componentPath = await getComponentPath(sourceFsPath); if (isLwcComponent(componentPath)) { newName = newName.charAt(0).toLowerCase() + newName.slice(1); @@ -104,10 +88,7 @@ export const inputGuard = async ( return newName; }; -const renameComponent = async ( - sourceFsPath: string, - newName: string -): Promise => { +const renameComponent = async (sourceFsPath: string, newName: string): Promise => { const componentPath = await getComponentPath(sourceFsPath); const componentName = getComponentName(componentPath); const items = await fs.promises.readdir(componentPath); @@ -115,10 +96,7 @@ const renameComponent = async ( // only rename the file that has same name with component if (isNameMatch(item, componentName, componentPath)) { const newItem = item.replace(componentName, newName); - await fs.promises.rename( - path.join(componentPath, item), - path.join(componentPath, newItem) - ); + await fs.promises.rename(path.join(componentPath, item), path.join(componentPath, newItem)); } if (item === TEST_FOLDER) { const testFolderPath = path.join(componentPath, TEST_FOLDER); @@ -126,10 +104,7 @@ const renameComponent = async ( for (const file of testFiles) { if (isNameMatch(file, componentName, componentPath)) { const newFile = file.replace(componentName, newName); - await fs.promises.rename( - path.join(testFolderPath, file), - path.join(testFolderPath, newFile) - ); + await fs.promises.rename(path.join(testFolderPath, file), path.join(testFolderPath, newFile)); } } } diff --git a/packages/salesforcedx-vscode-core/src/commands/retrieveManifest.ts b/packages/salesforcedx-vscode-core/src/commands/retrieveManifest.ts index ab90698fe7..6db7cf43ea 100644 --- a/packages/salesforcedx-vscode-core/src/commands/retrieveManifest.ts +++ b/packages/salesforcedx-vscode-core/src/commands/retrieveManifest.ts @@ -22,15 +22,10 @@ export class LibraryRetrieveManifestExecutor extends RetrieveExecutor { super(nls.localize('retrieve_this_source_text'), 'retrieve_with_manifest'); } - protected async getComponents( - response: ContinueResponse - ): Promise { - const packageDirs = - await SalesforcePackageDirectories.getPackageDirectoryPaths(); + protected async getComponents(response: ContinueResponse): Promise { + const packageDirs = await SalesforcePackageDirectories.getPackageDirectoryPaths(); const rootWorkspacePath = workspaceUtils.getRootWorkspacePath(); - const resolveSourcePaths = packageDirs.map(packageDir => - join(rootWorkspacePath, packageDir) - ); + const resolveSourcePaths = packageDirs.map(packageDir => join(rootWorkspacePath, packageDir)); const componentSet = await ComponentSet.fromManifest({ manifestPath: response.data, @@ -42,9 +37,7 @@ export class LibraryRetrieveManifestExecutor extends RetrieveExecutor { } } -export const retrieveManifest = async ( - explorerPath: vscode.Uri -): Promise => { +export const retrieveManifest = async (explorerPath: vscode.Uri): Promise => { if (!explorerPath) { const editor = vscode.window.activeTextEditor; if (editor && editor.document.languageId === 'forcesourcemanifest') { diff --git a/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/componentNodeDescriber.ts b/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/componentNodeDescriber.ts index 7ae2971c15..27213c7fdd 100644 --- a/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/componentNodeDescriber.ts +++ b/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/componentNodeDescriber.ts @@ -9,9 +9,7 @@ import { NodeDescriber } from './nodeDescriber'; export class ComponentNodeDescriber extends NodeDescriber { public buildMetadataArg(): string { - return `${this.node.getAssociatedTypeNode().fullName}:${ - this.node.fullName - }`; + return `${this.node.getAssociatedTypeNode().fullName}:${this.node.fullName}`; } public gatherOutputLocations(): Promise { diff --git a/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/libraryRetrieveSourcePathExecutor.ts b/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/libraryRetrieveSourcePathExecutor.ts index 197d44578c..8f414844e0 100644 --- a/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/libraryRetrieveSourcePathExecutor.ts +++ b/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/libraryRetrieveSourcePathExecutor.ts @@ -5,14 +5,8 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - ContinueResponse, - LocalComponent -} from '@salesforce/salesforcedx-utils-vscode'; -import { - ComponentSet, - RetrieveResult -} from '@salesforce/source-deploy-retrieve-bundle'; +import { ContinueResponse, LocalComponent } from '@salesforce/salesforcedx-utils-vscode'; +import { ComponentSet, RetrieveResult } from '@salesforce/source-deploy-retrieve-bundle'; import { ComponentLike } from '@salesforce/source-deploy-retrieve-bundle/lib/src/resolve/types'; import * as path from 'path'; import * as vscode from 'vscode'; @@ -21,27 +15,17 @@ import { SalesforcePackageDirectories } from '../../salesforceProject'; import { workspaceUtils } from '../../util'; import { RetrieveExecutor } from '../baseDeployRetrieve'; -export class LibraryRetrieveSourcePathExecutor extends RetrieveExecutor< - LocalComponent[] -> { +export class LibraryRetrieveSourcePathExecutor extends RetrieveExecutor { private openAfterRetrieve: boolean; constructor(openAfterRetrieve = false) { - super( - nls.localize('retrieve_this_source_text'), - 'retrieve_with_sourcepath' - ); + super(nls.localize('retrieve_this_source_text'), 'retrieve_with_sourcepath'); this.openAfterRetrieve = openAfterRetrieve; } - protected async getComponents( - response: ContinueResponse - ): Promise { - const toRetrieve = new ComponentSet( - response.data.map(lc => ({ fullName: lc.fileName, type: lc.type })) - ); - const packageDirs = - await SalesforcePackageDirectories.getPackageDirectoryFullPaths(); + protected async getComponents(response: ContinueResponse): Promise { + const toRetrieve = new ComponentSet(response.data.map(lc => ({ fullName: lc.fileName, type: lc.type }))); + const packageDirs = await SalesforcePackageDirectories.getPackageDirectoryFullPaths(); const localSourceComponents = ComponentSet.fromSource({ fsPaths: packageDirs, include: toRetrieve @@ -60,22 +44,15 @@ export class LibraryRetrieveSourcePathExecutor extends RetrieveExecutor< const componentToOpen = result.components.getSourceComponents().first(); if (componentToOpen) { - const dirPath = - (await SalesforcePackageDirectories.getDefaultPackageDir()) || ''; - const defaultOutput = path.join( - workspaceUtils.getRootWorkspacePath(), - dirPath - ); + const dirPath = (await SalesforcePackageDirectories.getDefaultPackageDir()) || ''; + const defaultOutput = path.join(workspaceUtils.getRootWorkspacePath(), dirPath); const compSet = ComponentSet.fromSource(defaultOutput); await this.openResources(this.findResources(componentToOpen, compSet)); } } } - private findResources( - filter: ComponentLike, - compSet?: ComponentSet - ): string[] { + private findResources(filter: ComponentLike, compSet?: ComponentSet): string[] { if (compSet && compSet.size > 0) { const oneComp = compSet.getSourceComponents(filter).first(); diff --git a/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/nodeDescriber.ts b/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/nodeDescriber.ts index bd23bc126b..48f22989cf 100644 --- a/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/nodeDescriber.ts +++ b/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/nodeDescriber.ts @@ -24,8 +24,7 @@ export abstract class NodeDescriber implements RetrieveDescriber { protected async buildOutput(node: BrowserNode): Promise { const typeNode = node.getAssociatedTypeNode(); // TODO: Only create one cmp when cli bug (W-6558000) fixed - const packageDirectories = - await SalesforcePackageDirectories.getPackageDirectoryPaths(); + const packageDirectories = await SalesforcePackageDirectories.getPackageDirectoryPaths(); return packageDirectories.map(directory => ({ fileName: node.fullName, outputdir: join(directory, 'main', 'default', typeNode.directoryName!), diff --git a/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/retrieveComponent.ts b/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/retrieveComponent.ts index fb1dd61c82..475f9f21cb 100644 --- a/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/retrieveComponent.ts +++ b/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/retrieveComponent.ts @@ -11,10 +11,7 @@ import { RetrieveComponentOutputGatherer } from '../util/parameterGatherers'; import { LibraryRetrieveSourcePathExecutor } from './libraryRetrieveSourcePathExecutor'; import { RetrieveMetadataTrigger } from './retrieveMetadataTrigger'; -export const retrieveComponent = ( - trigger: RetrieveMetadataTrigger, - openAfterRetrieve: boolean = false -): void => { +export const retrieveComponent = (trigger: RetrieveMetadataTrigger, openAfterRetrieve: boolean = false): void => { const retrieveDescriber = trigger.describer(); const commandlet = new SfCommandlet( new SfWorkspaceChecker(), diff --git a/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/retrieveDescriberFactory.ts b/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/retrieveDescriberFactory.ts index f05f51d144..79d50fc439 100644 --- a/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/retrieveDescriberFactory.ts +++ b/packages/salesforcedx-vscode-core/src/commands/retrieveMetadata/retrieveDescriberFactory.ts @@ -13,9 +13,7 @@ export class RetrieveDescriberFactory { return new TypeNodeDescriber(node); } - public static createComponentNodeDescriber( - node: BrowserNode - ): ComponentNodeDescriber { + public static createComponentNodeDescriber(node: BrowserNode): ComponentNodeDescriber { return new ComponentNodeDescriber(node); } } diff --git a/packages/salesforcedx-vscode-core/src/commands/retrieveSourcePath.ts b/packages/salesforcedx-vscode-core/src/commands/retrieveSourcePath.ts index c96ab35fbf..1c810b3caf 100644 --- a/packages/salesforcedx-vscode-core/src/commands/retrieveSourcePath.ts +++ b/packages/salesforcedx-vscode-core/src/commands/retrieveSourcePath.ts @@ -4,11 +4,7 @@ * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - CancelResponse, - ContinueResponse, - PostconditionChecker -} from '@salesforce/salesforcedx-utils-vscode'; +import { CancelResponse, ContinueResponse, PostconditionChecker } from '@salesforce/salesforcedx-utils-vscode'; import { ComponentSet } from '@salesforce/source-deploy-retrieve-bundle'; import * as vscode from 'vscode'; import { channelService } from '../channels'; @@ -19,21 +15,13 @@ import { telemetryService } from '../telemetry'; import { RetrieveExecutor } from './baseDeployRetrieve'; import { LibraryPathsGatherer, SfCommandlet, SfWorkspaceChecker } from './util'; -export class LibraryRetrieveSourcePathExecutor extends RetrieveExecutor< - string[] -> { +export class LibraryRetrieveSourcePathExecutor extends RetrieveExecutor { constructor() { - super( - nls.localize('retrieve_this_source_text'), - 'retrieve_with_sourcepath' - ); + super(nls.localize('retrieve_this_source_text'), 'retrieve_with_sourcepath'); } - public async getComponents( - response: ContinueResponse - ): Promise { - const paths = - typeof response.data === 'string' ? [response.data] : response.data; + public async getComponents(response: ContinueResponse): Promise { + const paths = typeof response.data === 'string' ? [response.data] : response.data; const componentSet = ComponentSet.fromSource(paths); return componentSet; @@ -48,13 +36,10 @@ export class SourcePathChecker implements PostconditionChecker { const sourcePaths = inputs.data; try { for (const sourcePath of sourcePaths) { - const isInSalesforcePackageDirectory = - await SalesforcePackageDirectories.isInPackageDirectory(sourcePath); + const isInSalesforcePackageDirectory = await SalesforcePackageDirectories.isInPackageDirectory(sourcePath); if (!isInSalesforcePackageDirectory) { - throw nls.localize( - 'error_source_path_not_in_package_directory_text' - ); + throw nls.localize('error_source_path_not_in_package_directory_text'); } } @@ -62,15 +47,11 @@ export class SourcePathChecker implements PostconditionChecker { } catch (error) { telemetryService.sendException( 'retrieve_with_sourcepath', - `Error while parsing package directories. ${ - error instanceof Error ? error.message : JSON.stringify(error) - }` + `Error while parsing package directories. ${error instanceof Error ? error.message : JSON.stringify(error)}` ); } - const errorMessage = nls.localize( - 'error_source_path_not_in_package_directory_text' - ); + const errorMessage = nls.localize('error_source_path_not_in_package_directory_text'); telemetryService.sendException('retrieve_with_sourcepath', errorMessage); notificationService.showErrorMessage(errorMessage); channelService.appendLine(errorMessage); @@ -80,10 +61,7 @@ export class SourcePathChecker implements PostconditionChecker { } } -export const retrieveSourcePaths = async ( - sourceUri: vscode.Uri | undefined, - uris: vscode.Uri[] | undefined -) => { +export const retrieveSourcePaths = async (sourceUri: vscode.Uri | undefined, uris: vscode.Uri[] | undefined) => { if (!sourceUri) { // When the source is retrieved via the command palette, both sourceUri and uris are // each undefined, and sourceUri needs to be obtained from the active text editor. diff --git a/packages/salesforcedx-vscode-core/src/commands/source/sourceTrackingGetStatusExecutor.ts b/packages/salesforcedx-vscode-core/src/commands/source/sourceTrackingGetStatusExecutor.ts index eba2456aaa..aeea66004d 100644 --- a/packages/salesforcedx-vscode-core/src/commands/source/sourceTrackingGetStatusExecutor.ts +++ b/packages/salesforcedx-vscode-core/src/commands/source/sourceTrackingGetStatusExecutor.ts @@ -12,24 +12,16 @@ import { import { channelService, OUTPUT_CHANNEL } from '../../channels'; import { nls } from '../../messages'; -export class SourceTrackingGetStatusExecutor extends LibraryCommandletExecutor< - string -> { +export class SourceTrackingGetStatusExecutor extends LibraryCommandletExecutor { private options; - constructor( - executionName: string, - logName: string, - options?: { local: boolean; remote: boolean } - ) { + constructor(executionName: string, logName: string, options?: { local: boolean; remote: boolean }) { super(nls.localize(executionName), logName, OUTPUT_CHANNEL); this.options = options; } public async execute(): Promise { - const sourceStatusSummary: string = await SourceTrackingService.getSourceStatusSummary( - this.options || {} - ); + const sourceStatusSummary: string = await SourceTrackingService.getSourceStatusSummary(this.options || {}); channelService.appendLine(nls.localize('source_status')); channelService.appendLine(sourceStatusSummary); channelService.showChannelOutput(); diff --git a/packages/salesforcedx-vscode-core/src/commands/source/viewChanges.ts b/packages/salesforcedx-vscode-core/src/commands/source/viewChanges.ts index 3fea089673..9c5e9b8d4d 100644 --- a/packages/salesforcedx-vscode-core/src/commands/source/viewChanges.ts +++ b/packages/salesforcedx-vscode-core/src/commands/source/viewChanges.ts @@ -4,18 +4,12 @@ * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - EmptyParametersGatherer, - SfCommandlet, - SfWorkspaceChecker -} from '../util'; +import { EmptyParametersGatherer, SfCommandlet, SfWorkspaceChecker } from '../util'; import { SourceTrackingGetStatusExecutor } from './sourceTrackingGetStatusExecutor'; const workspaceChecker = new SfWorkspaceChecker(); const parameterGatherer = new EmptyParametersGatherer(); -const getCommandletFor = ( - executor: SourceTrackingGetStatusExecutor -): SfCommandlet<{}> => +const getCommandletFor = (executor: SourceTrackingGetStatusExecutor): SfCommandlet<{}> => new SfCommandlet(workspaceChecker, parameterGatherer, executor); export const viewAllChanges = (): void => { @@ -30,12 +24,7 @@ export const viewRemoteChanges = (): void => { viewChanges('view_remote_changes_text', 'view_remote_changes', false, true); }; -const viewChanges = ( - executionName: string, - logName: string, - local: boolean, - remote: boolean -): void => { +const viewChanges = (executionName: string, logName: string, local: boolean, remote: boolean): void => { const executor = new SourceTrackingGetStatusExecutor(executionName, logName, { local, remote diff --git a/packages/salesforcedx-vscode-core/src/commands/sourceDiff.ts b/packages/salesforcedx-vscode-core/src/commands/sourceDiff.ts index 7608ef9fdc..69b7edb28d 100644 --- a/packages/salesforcedx-vscode-core/src/commands/sourceDiff.ts +++ b/packages/salesforcedx-vscode-core/src/commands/sourceDiff.ts @@ -7,11 +7,7 @@ import * as vscode from 'vscode'; import { channelService } from '../channels'; -import { - MetadataCacheExecutor, - MetadataCacheResult, - PathType -} from '../conflict'; +import { MetadataCacheExecutor, MetadataCacheResult, PathType } from '../conflict'; import * as differ from '../conflict/directoryDiffer'; import { WorkspaceContext } from '../context'; import { nls } from '../messages'; @@ -38,9 +34,7 @@ export const sourceDiff = async (sourceUri?: vscode.Uri) => { const targetOrgorAlias = WorkspaceContext.getInstance().username; if (!targetOrgorAlias) { - await notificationService.showErrorMessage( - nls.localize('missing_default_org') - ); + await notificationService.showErrorMessage(nls.localize('missing_default_org')); return; } const executor = new MetadataCacheExecutor( @@ -49,11 +43,7 @@ export const sourceDiff = async (sourceUri?: vscode.Uri) => { 'source_diff', handleCacheResults ); - const commandlet = new SfCommandlet( - workspaceChecker, - new FilePathGatherer(sourceUri), - executor - ); + const commandlet = new SfCommandlet(workspaceChecker, new FilePathGatherer(sourceUri), executor); await commandlet.run(); }; @@ -74,9 +64,7 @@ export const sourceFolderDiff = async (explorerPath: vscode.Uri) => { const username = WorkspaceContext.getInstance().username; if (!username) { - await notificationService.showErrorMessage( - nls.localize('missing_default_org') - ); + await notificationService.showErrorMessage(nls.localize('missing_default_org')); return; } @@ -93,17 +81,10 @@ export const sourceFolderDiff = async (explorerPath: vscode.Uri) => { await commandlet.run(); }; -export const handleCacheResults = async ( - username: string, - cache?: MetadataCacheResult -): Promise => { +export const handleCacheResults = async (username: string, cache?: MetadataCacheResult): Promise => { if (cache) { if (cache.selectedType === PathType.Individual && cache.cache.components) { - await differ.diffOneFile( - cache.selectedPath, - cache.cache.components[0], - username - ); + await differ.diffOneFile(cache.selectedPath, cache.cache.components[0], username); } else if (cache.selectedType === PathType.Folder) { differ.diffFolder(cache, username); } diff --git a/packages/salesforcedx-vscode-core/src/commands/startApexDebugLogging.ts b/packages/salesforcedx-vscode-core/src/commands/startApexDebugLogging.ts index 4f3033bbee..56a52daf2f 100644 --- a/packages/salesforcedx-vscode-core/src/commands/startApexDebugLogging.ts +++ b/packages/salesforcedx-vscode-core/src/commands/startApexDebugLogging.ts @@ -23,21 +23,14 @@ import { nls } from '../messages'; import { telemetryService } from '../telemetry'; import { OrgAuthInfo, workspaceUtils } from '../util'; import { developerLogTraceFlag } from '.'; -import { - EmptyParametersGatherer, - SfCommandlet, - SfCommandletExecutor, - SfWorkspaceChecker -} from './util'; +import { EmptyParametersGatherer, SfCommandlet, SfCommandletExecutor, SfWorkspaceChecker } from './util'; export class StartApexDebugLoggingExecutor extends SfCommandletExecutor<{}> { private cancellationTokenSource = new vscode.CancellationTokenSource(); private cancellationToken = this.cancellationTokenSource.token; public build(): Command { - return new CommandBuilder(nls.localize('start_apex_debug_logging')) - .withLogName('start_apex_debug_logging') - .build(); + return new CommandBuilder(nls.localize('start_apex_debug_logging')).withLogName('start_apex_debug_logging').build(); } public attachSubExecution(execution: CommandExecution) { @@ -47,14 +40,8 @@ export class StartApexDebugLoggingExecutor extends SfCommandletExecutor<{}> { // eslint-disable-next-line @typescript-eslint/no-unused-vars public async execute(response: ContinueResponse<{}>): Promise { const startTime = process.hrtime(); - const executionWrapper = new CompositeCliCommandExecutor( - this.build() - ).execute(this.cancellationToken); - this.attachExecution( - executionWrapper, - this.cancellationTokenSource, - this.cancellationToken - ); + const executionWrapper = new CompositeCliCommandExecutor(this.build()).execute(this.cancellationToken); + this.attachExecution(executionWrapper, this.cancellationTokenSource, this.cancellationToken); executionWrapper.processExitSubject.subscribe(() => { this.logMetric(executionWrapper.command.logName, startTime); @@ -64,9 +51,7 @@ export class StartApexDebugLoggingExecutor extends SfCommandletExecutor<{}> { // query traceflag const userId = await getUserId(workspaceUtils.getRootWorkspacePath()); - let resultJson = await this.subExecute( - new QueryTraceFlag().build(userId) - ); + let resultJson = await this.subExecute(new QueryTraceFlag().build(userId)); if (resultJson && resultJson.result && resultJson.result.totalSize >= 1) { const traceflag = resultJson.result.records[0]; developerLogTraceFlag.setTraceFlagDebugLevelInfo( @@ -91,9 +76,7 @@ export class StartApexDebugLoggingExecutor extends SfCommandletExecutor<{}> { developerLogTraceFlag.setDebugLevelId(debugLevelId); developerLogTraceFlag.validateDates(); - resultJson = await this.subExecute( - new CreateTraceFlag(userId).build() - ); + resultJson = await this.subExecute(new CreateTraceFlag(userId).build()); developerLogTraceFlag.setTraceFlagId(resultJson.result.id); } } @@ -155,10 +138,7 @@ export class QueryUser extends SfCommandletExecutor<{}> { public build(): Command { return new SfCommandBuilder() .withArg('data:query') - .withFlag( - '--query', - `SELECT id FROM User WHERE username='${this.username}'` - ) + .withFlag('--query', `SELECT id FROM User WHERE username='${this.username}'`) .withJson() .withLogName('query_user') .build(); @@ -216,10 +196,7 @@ export class UpdateDebugLevelsExecutor extends SfCommandletExecutor<{}> { .withArg('data:update:record') .withFlag('--sobject', 'DebugLevel') .withFlag('--record-id', nonNullDebugLevel) - .withFlag( - '--values', - `ApexCode=${APEX_CODE_DEBUG_LEVEL} Visualforce=${VISUALFORCE_DEBUG_LEVEL}` - ) + .withFlag('--values', `ApexCode=${APEX_CODE_DEBUG_LEVEL} Visualforce=${VISUALFORCE_DEBUG_LEVEL}`) .withArg('--use-tooling-api') .withJson() .withLogName('update_debug_level') @@ -234,12 +211,7 @@ export class UpdateTraceFlagsExecutor extends SfCommandletExecutor<{}> { .withArg('data:update:record') .withFlag('--sobject', 'TraceFlag') .withFlag('--record-id', nonNullTraceFlag) - .withFlag( - '--values', - `StartDate='' ExpirationDate='${developerLogTraceFlag - .getExpirationDate() - .toUTCString()}'` - ) + .withFlag('--values', `StartDate='' ExpirationDate='${developerLogTraceFlag.getExpirationDate().toUTCString()}'`) .withArg('--use-tooling-api') .withJson() .withLogName('update_trace_flag') @@ -268,10 +240,6 @@ export class QueryTraceFlag extends SfCommandletExecutor<{}> { export const startApexDebugLogging = async (): Promise => { const executor = new StartApexDebugLoggingExecutor(); - const commandlet = new SfCommandlet( - workspaceChecker, - parameterGatherer, - executor - ); + const commandlet = new SfCommandlet(workspaceChecker, parameterGatherer, executor); await commandlet.run(); }; diff --git a/packages/salesforcedx-vscode-core/src/commands/stopApexDebugLogging.ts b/packages/salesforcedx-vscode-core/src/commands/stopApexDebugLogging.ts index 4385fa6113..4069f60aed 100644 --- a/packages/salesforcedx-vscode-core/src/commands/stopApexDebugLogging.ts +++ b/packages/salesforcedx-vscode-core/src/commands/stopApexDebugLogging.ts @@ -5,17 +5,8 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { - CliCommandExecutor, - Command, - CommandOutput, - SfCommandBuilder -} from '@salesforce/salesforcedx-utils-vscode'; -import { - CancelResponse, - ContinueResponse, - ParametersGatherer -} from '@salesforce/salesforcedx-utils-vscode'; +import { CliCommandExecutor, Command, CommandOutput, SfCommandBuilder } from '@salesforce/salesforcedx-utils-vscode'; +import { CancelResponse, ContinueResponse, ParametersGatherer } from '@salesforce/salesforcedx-utils-vscode'; import * as vscode from 'vscode'; import { hideTraceFlagExpiration } from '../decorators'; import { nls } from '../messages'; @@ -89,11 +80,7 @@ class ActiveLogging implements ParametersGatherer<{}> { const workspaceChecker = new SfWorkspaceChecker(); const parameterGatherer = new ActiveLogging(); const executor = new StopApexDebugLoggingExecutor(); -const commandlet = new SfCommandlet( - workspaceChecker, - parameterGatherer, - executor -); +const commandlet = new SfCommandlet(workspaceChecker, parameterGatherer, executor); export const stopApexDebugLogging = async (): Promise => { await commandlet.run(); diff --git a/packages/salesforcedx-vscode-core/src/commands/templates/analyticsGenerateTemplate.ts b/packages/salesforcedx-vscode-core/src/commands/templates/analyticsGenerateTemplate.ts index b82b46b4cf..3bc25b5cf8 100644 --- a/packages/salesforcedx-vscode-core/src/commands/templates/analyticsGenerateTemplate.ts +++ b/packages/salesforcedx-vscode-core/src/commands/templates/analyticsGenerateTemplate.ts @@ -23,10 +23,7 @@ import { SourcePathStrategy } from '../util'; import { LibraryBaseTemplateCommand } from './libraryBaseTemplateCommand'; -import { - ANALYTICS_TEMPLATE_DIRECTORY, - ANALYTICS_TEMPLATE_TYPE -} from './metadataTypeConstants'; +import { ANALYTICS_TEMPLATE_DIRECTORY, ANALYTICS_TEMPLATE_TYPE } from './metadataTypeConstants'; export class LibraryAnalyticsGenerateTemplateExecutor extends LibraryBaseTemplateCommand { public executionName = nls.localize('analytics_generate_template_text'); @@ -66,29 +63,18 @@ export class SelectProjectTemplate implements ParametersGatherer