From 2cd8cba33c75daeaea3ae70eef5da7ec123c843c Mon Sep 17 00:00:00 2001 From: Shane McLaughlin Date: Tue, 14 Nov 2023 14:11:07 -0600 Subject: [PATCH 1/2] feat!: esm (#811) * feat!: esm * test: generated nuts vs. ts-node * chore: __filename * test: nut fixes for esm * chore: dep bumps * test: none of that experimental stuff * chore: bump deps for testkit windows hangs --- .eslintignore | 1 + .gitignore | 2 + .lintstagedrc.cjs | 3 + .lintstagedrc.js | 3 - .mocharc.json | 5 +- DEVELOPING.md | 4 +- README.md | 4 +- bin/dev | 21 - bin/dev.cmd | 4 +- bin/dev.js | 8 + bin/run | 5 - bin/run.js | 9 + commitlint.config.js => commitlint.config.cjs | 0 package.json | 70 +-- schemas/project-retrieve-start.json | 25 +- src/commands/deploy.ts | 7 +- src/commands/project/convert/mdapi.ts | 9 +- src/commands/project/convert/source.ts | 17 +- src/commands/project/delete/source.ts | 32 +- src/commands/project/delete/tracking.ts | 6 +- src/commands/project/deploy/cancel.ts | 14 +- src/commands/project/deploy/preview.ts | 8 +- src/commands/project/deploy/quick.ts | 22 +- src/commands/project/deploy/report.ts | 18 +- src/commands/project/deploy/resume.ts | 26 +- src/commands/project/deploy/start.ts | 34 +- src/commands/project/deploy/validate.ts | 37 +- src/commands/project/generate/manifest.ts | 7 +- src/commands/project/list/ignored.ts | 9 +- src/commands/project/reset/tracking.ts | 4 +- src/commands/project/retrieve/preview.ts | 6 +- src/commands/project/retrieve/start.ts | 17 +- src/configMeta.ts | 6 +- .../asyncDeployCancelResultFormatter.ts | 7 +- src/formatters/asyncDeployResultFormatter.ts | 7 +- src/formatters/deleteResultFormatter.ts | 12 +- src/formatters/deployCancelResultFormatter.ts | 2 +- src/formatters/deployReportResultFormatter.ts | 4 +- src/formatters/deployResultFormatter.ts | 14 +- .../metadataConvertResultFormatter.ts | 2 +- .../metadataRetrieveResultFormatter.ts | 13 +- src/formatters/retrieveResultFormatter.ts | 4 +- .../sourceConvertResultFormatter.ts | 7 +- src/formatters/testResultsFormatter.ts | 16 +- src/hooks/deploy.ts | 2 +- src/index.ts | 2 +- src/utils/coverage.ts | 4 +- src/utils/deploy.ts | 20 +- src/utils/deployCache.ts | 4 +- src/utils/errorCodes.ts | 4 +- src/utils/flags.ts | 11 +- src/utils/metadataDeployer.ts | 18 +- src/utils/output.ts | 8 +- src/utils/previewOutput.ts | 41 +- src/utils/progressBar.ts | 8 +- test/.eslintrc.cjs | 2 - test/commands/convert/source.test.ts | 8 +- test/commands/delete/source.test.ts | 16 +- test/commands/deploy.nut.ts | 9 +- test/commands/deploy.test.ts | 2 +- test/commands/deploy/metadata.nut.ts | 3 +- test/commands/deploy/metadata/cancel.nut.ts | 4 +- test/commands/deploy/metadata/quick.nut.ts | 5 +- .../deploy/metadata/report-mdapi.nut.ts | 5 +- test/commands/deploy/metadata/report.nut.ts | 5 +- test/commands/deploy/metadata/resume.nut.ts | 7 +- test/commands/deploy/metadata/validate.nut.ts | 5 +- test/commands/deploy/start.test.ts | 8 +- test/commands/retrieve/start.test.ts | 23 +- test/nuts/convert/mdapi.nut.ts | 2 +- test/nuts/convert/source.nut.ts | 2 +- test/nuts/delete/source.nut.ts | 5 +- test/nuts/deploy/formatter.nut.ts | 2 +- test/nuts/deploy/noProject.nut.ts | 2 +- test/nuts/deploy/noTracking.nut.ts | 2 +- .../destructive/destructiveChanges.nut.ts | 3 +- .../nuts/digitalExperienceBundle/constants.ts | 4 +- .../deb.manifest.nut.ts | 6 +- .../deb.metadata.nut.ts | 6 +- .../deb.sourcepath.nut.ts | 6 +- .../deb.tracking.nut.ts | 13 +- test/nuts/digitalExperienceBundle/helper.ts | 4 +- test/nuts/generateNuts.ts | 7 +- test/nuts/list/ignored.nut.ts | 2 +- test/nuts/retrieve/customLabels.nut.ts | 2 +- test/nuts/retrieve/metadata.nut.ts | 3 +- test/nuts/retrieve/noProject.ts | 2 +- test/nuts/retrieve/noTracking.ts | 2 +- test/nuts/retrieve/partialBundleDelete.nut.ts | 6 +- .../seeds/deploy.metadata.manifest.seed.ts | 7 +- .../deploy.metadata.metadata-dir.seed.ts | 7 +- .../seeds/deploy.metadata.metadata.seed.ts | 7 +- .../seeds/deploy.metadata.source-dir.seed.ts | 7 +- .../seeds/deploy.metadata.test-level.seed.ts | 5 +- test/nuts/specialTypes/customLabels.nut.ts | 3 +- test/nuts/specialTypes/folderTypes.nut.ts | 2 +- test/nuts/specialTypes/nestedLwc.nut.ts | 2 +- test/nuts/specialTypes/territory2.nut.ts | 2 +- test/nuts/specialTypes/translation.nut.ts | 4 +- test/nuts/tracking/basics.nut.ts | 12 +- test/nuts/tracking/conflicts.nut.ts | 8 +- test/nuts/tracking/deleteResetTracking.nut.ts | 2 +- test/nuts/tracking/forceIgnore.nut.ts | 6 +- test/nuts/tracking/lwc.nut.ts | 6 +- test/nuts/tracking/mpd-non-sequential.nut.ts | 2 +- test/nuts/tracking/remoteChanges.nut.ts | 8 +- test/tsconfig.json | 2 +- test/utils/coverage.test.ts | 2 +- test/utils/deploy.test.ts | 8 +- test/utils/errorCodes.test.ts | 2 +- test/utils/flags.test.ts | 8 +- test/utils/manifestCache.test.ts | 4 +- test/utils/output.test.ts | 8 +- test/utils/promiseQueue.test.ts | 2 +- test/utils/testConsts.ts | 2 +- test/utils/types.test.ts | 2 +- tsconfig.json | 8 +- yarn.lock | 436 ++++++++---------- 118 files changed, 720 insertions(+), 690 deletions(-) create mode 100644 .eslintignore create mode 100644 .lintstagedrc.cjs delete mode 100644 .lintstagedrc.js delete mode 100755 bin/dev mode change 100644 => 100755 bin/dev.cmd create mode 100755 bin/dev.js delete mode 100755 bin/run create mode 100755 bin/run.js rename commitlint.config.js => commitlint.config.cjs (100%) diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..ee638464 --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +*.cjs/ diff --git a/.gitignore b/.gitignore index c32d10c9..9d793718 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,5 @@ oclif.manifest.json # ignore generated nut tests test/nuts/generated/ + +oclif.lock \ No newline at end of file diff --git a/.lintstagedrc.cjs b/.lintstagedrc.cjs new file mode 100644 index 00000000..9a99d41c --- /dev/null +++ b/.lintstagedrc.cjs @@ -0,0 +1,3 @@ +module.exports = { + '**/*.{js,json,md}?(x)': () => 'npm run reformat', +}; diff --git a/.lintstagedrc.js b/.lintstagedrc.js deleted file mode 100644 index d7fab80d..00000000 --- a/.lintstagedrc.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - '**/*.{js,json,md}?(x)': () => 'npm run reformat' -}; diff --git a/.mocharc.json b/.mocharc.json index e59ba8bf..a8398045 100644 --- a/.mocharc.json +++ b/.mocharc.json @@ -1,8 +1,9 @@ { - "require": "ts-node/register,source-map-support/register", + "require": ["ts-node/register"], "watch-extensions": "ts", "watch-files": ["src", "test"], "recursive": true, "reporter": "spec", - "timeout": 10000 + "timeout": 10000, + "node-option": ["loader=ts-node/esm"] } diff --git a/DEVELOPING.md b/DEVELOPING.md index 166c1bda..e021276d 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -29,7 +29,7 @@ 1. Build and lint the code: `yarn build` 1. Create a branch off main for new work: `git checkout -b ` _Suggestion: use branch_name format of initials/work-title_. For external contributors, please fork the main branch of the repo instead and PR the fork to the main branch. 1. Make code changes and build: `yarn build` -1. Run changed commands: `./bin/dev project:deploy:start --help` +1. Run changed commands: `./bin/dev.js project:deploy:start --help` 1. Write tests and run: `yarn test` (unit) and/or `yarn test:nuts` (NUTs) 1. Show all changed files: `git status` 1. Add all files to staging: `git add .` @@ -93,7 +93,7 @@ If there are conflict errors in the tests then we need to make a similar modific ## Running Commands -To run your modified plugin commands locally, use `./bin/dev` or `./bin/dev.cmd` file, which uses ts-node to execute the plugin's TypeScript commands. +To run your modified plugin commands locally, use `./bin/dev.js` or `./bin/dev.cmd` file, which uses ts-node to execute the plugin's TypeScript commands. ```bash # Run using local dev file. diff --git a/README.md b/README.md index 694c12a2..11476c6c 100644 --- a/README.md +++ b/README.md @@ -44,11 +44,11 @@ yarn install yarn build ``` -To use your plugin, run using the local `./bin/dev` or `./bin/dev.cmd` file. +To use your plugin, run using the local `./bin/dev.js` or `./bin/dev.cmd` file. ```bash # Run using local run file. -./bin/dev deploy +./bin/dev.js deploy ``` There should be no differences when running via the Salesforce CLI or using the local run file. However, it can be useful to link the plugin to do some additional testing or run your commands from anywhere on your machine. diff --git a/bin/dev b/bin/dev deleted file mode 100755 index d88b6a38..00000000 --- a/bin/dev +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env node - -const oclif = require('@oclif/core'); - -const path = require('path'); -const project = path.join(__dirname, '..', 'tsconfig.json'); - -// In dev mode -> use ts-node and dev plugins -process.env.NODE_ENV = 'development'; - -// Enable SWC for faster typescript compiling -require('ts-node').register({ project, swc: true }); - -// In dev mode, always show stack traces -const g = (global.oclif = global.oclif || {}); - -// In dev mode, always show stack traces -global.oclif.debug = true; - -// Start the CLI -oclif.run().then(require('@oclif/core/flush')).catch(require('@oclif/core/handle')); diff --git a/bin/dev.cmd b/bin/dev.cmd old mode 100644 new mode 100755 index d7ee75da..cec553be --- a/bin/dev.cmd +++ b/bin/dev.cmd @@ -1,3 +1,3 @@ @echo off -set NODE_ENV=development -node "%~dp0\dev" %* + +node --loader ts-node/esm --no-warnings=ExperimentalWarning "%~dp0\dev" %* diff --git a/bin/dev.js b/bin/dev.js new file mode 100755 index 00000000..89a549a7 --- /dev/null +++ b/bin/dev.js @@ -0,0 +1,8 @@ +#!/usr/bin/env -S node --loader ts-node/esm --no-warnings=ExperimentalWarning +// eslint-disable-next-line node/shebang +async function main() { + const { execute } = await import('@oclif/core'); + await execute({ development: true, dir: import.meta.url }); +} + +await main(); diff --git a/bin/run b/bin/run deleted file mode 100755 index eaa62fea..00000000 --- a/bin/run +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env node - -require('@oclif/core').run() -.then(require('@oclif/core/flush')) -.catch(require('@oclif/core/handle')) diff --git a/bin/run.js b/bin/run.js new file mode 100755 index 00000000..cf13fb93 --- /dev/null +++ b/bin/run.js @@ -0,0 +1,9 @@ +#!/usr/bin/env node + +// eslint-disable-next-line node/shebang +async function main() { + const { execute } = await import('@oclif/core'); + await execute({ dir: import.meta.url }); +} + +await main(); diff --git a/commitlint.config.js b/commitlint.config.cjs similarity index 100% rename from commitlint.config.js rename to commitlint.config.cjs diff --git a/package.json b/package.json index fd0d55a3..5432001b 100644 --- a/package.json +++ b/package.json @@ -1,55 +1,55 @@ { "name": "@salesforce/plugin-deploy-retrieve", "description": "deploy and retrieve commands for sf", - "version": "1.20.3", + "version": "2.0.0", "author": "Salesforce", "bugs": "https://github.com/forcedotcom/cli/issues", "dependencies": { - "@oclif/core": "^2.15.0", + "@oclif/core": "^3.11.0", "@salesforce/apex-node": "^2.1.2", - "@salesforce/core": "^5.3.18", + "@salesforce/core": "^5.3.20", "@salesforce/kit": "^3.0.15", - "@salesforce/sf-plugins-core": "^3.1.22", - "@salesforce/source-deploy-retrieve": "^9.8.4", - "@salesforce/source-tracking": "^4.3.0", - "chalk": "^4.1.2", - "tslib": "^2" + "@salesforce/sf-plugins-core": "^4.1.2", + "@salesforce/source-deploy-retrieve": "^9.8.6", + "@salesforce/source-tracking": "^4.4.3", + "chalk": "^5.3.0" }, "devDependencies": { - "@oclif/plugin-command-snapshot": "^4.0.16", - "@salesforce/cli-plugins-testkit": "^5.0.2", - "@salesforce/dev-scripts": "^6.0.3", + "@oclif/plugin-command-snapshot": "^5.0.2", + "@salesforce/cli-plugins-testkit": "^5.0.4", + "@salesforce/dev-scripts": "^6.0.4", "@salesforce/plugin-command-reference": "^3.0.46", - "@salesforce/plugin-source": "^2.11.0", - "@salesforce/source-testkit": "^2.1.62", - "@salesforce/ts-sinon": "1.4.19", - "@salesforce/ts-types": "^2.0.8", - "@swc/core": "1.3.39", + "@salesforce/plugin-source": "^2.11.3", + "@salesforce/source-testkit": "^2.1.65", + "@salesforce/ts-sinon": "^1.4.19", + "@salesforce/ts-types": "^2.0.9", "cross-env": "^7.0.3", - "eslint-plugin-sf-plugin": "^1.16.14", - "oclif": "^3.16.0", + "eslint-plugin-sf-plugin": "^1.16.15", + "oclif": "^4.0.3", "shx": "0.3.4", "ts-node": "^10.9.1", "typescript": "^5.2.2" }, "config": {}, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "files": [ "/lib", "/messages", "/oclif.manifest.json", - "/schemas" + "/schemas", + "/oclif.lock" ], "homepage": "https://github.com/salesforcecli/plugin-deploy-retrieve", "keywords": [ "force", "salesforce", - "sfdx", "sf", + "sf deploy", "sf retrieve", - "sf deploy" + "sf-plugin", + "sfdx" ], "license": "BSD-3-Clause", "oclif": { @@ -93,7 +93,8 @@ } } } - } + }, + "flexibleTaxonomy": true }, "repository": "salesforcecli/plugin-deploy-retrieve", "scripts": { @@ -109,16 +110,16 @@ "prepack": "sf-prepack", "prepare": "sf-install", "test": "wireit", - "test:nuts": "ts-node ./test/nuts/generateNuts.ts && nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 10", + "test:nuts": "node --loader ts-node/esm ./test/nuts/generateNuts.ts && nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 10", "test:nuts:convert": "nyc mocha \"test/nuts/convert/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20", "test:nuts:deb": "nyc mocha \"test/nuts/digitalExperienceBundle/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20", "test:nuts:delete": "nyc mocha \"test/nuts/delete/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20", "test:nuts:deploy": "nyc mocha \"test/nuts/deploy/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20", - "test:nuts:deploy:metadata:manifest": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.manifest ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20", - "test:nuts:deploy:metadata:metadata": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.metadata ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20", - "test:nuts:deploy:metadata:metadata-dir": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.metadata-dir ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20", - "test:nuts:deploy:metadata:source-dir": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.source-dir ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20", - "test:nuts:deploy:metadata:test-level": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.test-level ts-node ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20", + "test:nuts:deploy:metadata:manifest": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.manifest node --loader ts-node/esm ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20", + "test:nuts:deploy:metadata:metadata": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.metadata node --loader ts-node/esm ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20", + "test:nuts:deploy:metadata:metadata-dir": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.metadata-dir node --loader ts-node/esm ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20", + "test:nuts:deploy:metadata:source-dir": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.source-dir node --loader ts-node/esm ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20", + "test:nuts:deploy:metadata:test-level": "cross-env PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER=deploy.metadata.test-level node --loader ts-node/esm ./test/nuts/generateNuts.ts && mocha \"test/nuts/generated/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20", "test:nuts:destructive": "nyc mocha \"test/nuts/destructive/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20", "test:nuts:manifest": "nyc mocha \"test/nuts/manifest/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20", "test:nuts:retrieve": "nyc mocha \"test/nuts/retrieve/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20", @@ -132,7 +133,6 @@ "publishConfig": { "access": "public" }, - "main": "lib/index.js", "wireit": { "build": { "dependencies": [ @@ -209,7 +209,7 @@ "output": [] }, "test:command-reference": { - "command": "\"./bin/dev\" commandreference:generate --erroronwarnings", + "command": "ts-node \"./bin/dev.js\" commandreference:generate --erroronwarnings", "files": [ "src/**/*.ts", "messages/**", @@ -220,7 +220,7 @@ ] }, "test:deprecation-policy": { - "command": "\"./bin/dev\" snapshot:compare", + "command": "ts-node \"./bin/dev.js\" snapshot:compare", "files": [ "src/**/*.ts" ], @@ -230,12 +230,14 @@ ] }, "test:json-schema": { - "command": "\"./bin/dev\" schema:compare", + "command": "ts-node \"./bin/dev.js\" schema:compare", "files": [ "src/**/*.ts", "schemas" ], "output": [] } - } + }, + "exports": "./lib/index.js", + "type": "module" } diff --git a/schemas/project-retrieve-start.json b/schemas/project-retrieve-start.json index 1937b5a8..465b3a45 100644 --- a/schemas/project-retrieve-start.json +++ b/schemas/project-retrieve-start.json @@ -154,17 +154,7 @@ "type": "string" }, "manageableState": { - "type": "string", - "enum": [ - "beta", - "deleted", - "deprecated", - "deprecatedEditable", - "installed", - "installedEditable", - "released", - "unmanaged" - ] + "$ref": "#/definitions/ManageableState" }, "namespacePrefix": { "type": "string" @@ -187,6 +177,19 @@ ], "additionalProperties": false }, + "ManageableState": { + "type": "string", + "enum": [ + "beta", + "deleted", + "deprecated", + "deprecatedEditable", + "installed", + "installedEditable", + "released", + "unmanaged" + ] + }, "RequestStatus": { "type": "string", "enum": ["Pending", "InProgress", "Succeeded", "SucceededPartial", "Failed", "Canceling", "Canceled"] diff --git a/src/commands/deploy.ts b/src/commands/deploy.ts index 178b34aa..a7ac0039 100644 --- a/src/commands/deploy.ts +++ b/src/commands/deploy.ts @@ -10,6 +10,8 @@ import { EOL } from 'node:os'; import { writeFile, readFile } from 'node:fs/promises'; import { existsSync } from 'node:fs'; import { exec } from 'node:child_process'; +import { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; import { Hook } from '@oclif/core'; import { Messages } from '@salesforce/core'; import { Env, parseJsonMap } from '@salesforce/kit'; @@ -22,8 +24,9 @@ import { SfHook, Flags, } from '@salesforce/sf-plugins-core'; -import { DeployerResult } from '@salesforce/sf-plugins-core/lib/deployer'; -Messages.importMessagesDirectory(__dirname); +import { DeployerResult } from '@salesforce/sf-plugins-core/lib/deployer.js'; + +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy'); diff --git a/src/commands/project/convert/mdapi.ts b/src/commands/project/convert/mdapi.ts index bed2ac7b..637f5869 100644 --- a/src/commands/project/convert/mdapi.ts +++ b/src/commands/project/convert/mdapi.ts @@ -6,7 +6,8 @@ */ import { dirname, resolve } from 'node:path'; -import * as fs from 'node:fs'; +import fs from 'node:fs'; +import { fileURLToPath } from 'node:url'; import { Messages, SfError } from '@salesforce/core'; import { ComponentSet, @@ -22,10 +23,10 @@ import { SfCommand, } from '@salesforce/sf-plugins-core'; import { Interfaces } from '@oclif/core'; -import { ConvertMdapiJson } from '../../../utils/types'; -import { MetadataConvertResultFormatter } from '../../../formatters/metadataConvertResultFormatter'; +import { ConvertMdapiJson } from '../../../utils/types.js'; +import { MetadataConvertResultFormatter } from '../../../formatters/metadataConvertResultFormatter.js'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'convert.mdapi'); export interface EnsureFsFlagOptions { diff --git a/src/commands/project/convert/source.ts b/src/commands/project/convert/source.ts index 3a416f5a..df9b1264 100644 --- a/src/commands/project/convert/source.ts +++ b/src/commands/project/convert/source.ts @@ -5,9 +5,9 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { resolve } from 'node:path'; -import * as fs from 'node:fs'; - +import { resolve, dirname } from 'node:path'; +import fs from 'node:fs'; +import { fileURLToPath } from 'node:url'; import { Messages } from '@salesforce/core'; import { ComponentSet, @@ -15,7 +15,6 @@ import { ConvertResult, MetadataConverter, } from '@salesforce/source-deploy-retrieve'; -import { getString } from '@salesforce/ts-types'; import { arrayWithDeprecation, Flags, @@ -24,11 +23,11 @@ import { SfCommand, } from '@salesforce/sf-plugins-core'; import { Interfaces } from '@oclif/core'; -import { getPackageDirs, getSourceApiVersion } from '../../../utils/project'; -import { SourceConvertResultFormatter } from '../../../formatters/sourceConvertResultFormatter'; -import { ConvertResultJson } from '../../../utils/types'; +import { getPackageDirs, getSourceApiVersion } from '../../../utils/project.js'; +import { SourceConvertResultFormatter } from '../../../formatters/sourceConvertResultFormatter.js'; +import { ConvertResultJson } from '../../../utils/types.js'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'convert.source'); export class Source extends SfCommand { @@ -153,7 +152,7 @@ export class Source extends SfCommand { } protected resolveSuccess(): void { - if (!getString(this.convertResult, 'packagePath')) { + if (!this.convertResult.packagePath) { process.exitCode = 1; } } diff --git a/src/commands/project/delete/source.ts b/src/commands/project/delete/source.ts index 08843c3b..5ef74f57 100644 --- a/src/commands/project/delete/source.ts +++ b/src/commands/project/delete/source.ts @@ -5,9 +5,10 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import * as fs from 'node:fs'; -import * as path from 'node:path'; -import * as os from 'node:os'; +import fs from 'node:fs'; +import path from 'node:path'; +import os from 'node:os'; +import { fileURLToPath } from 'node:url'; import { Interfaces } from '@oclif/core'; import { Lifecycle, Messages, Org, SfError } from '@salesforce/core'; import { @@ -31,19 +32,19 @@ import { requiredOrgFlagWithDeprecations, SfCommand, } from '@salesforce/sf-plugins-core'; -import * as chalk from 'chalk'; -import { API, DeleteSourceJson, isSourceComponent } from '../../../utils/types'; -import { getPackageDirs, getSourceApiVersion } from '../../../utils/project'; -import { resolveApi, validateTests } from '../../../utils/deploy'; -import { DeployResultFormatter } from '../../../formatters/deployResultFormatter'; -import { DeleteResultFormatter } from '../../../formatters/deleteResultFormatter'; -import { DeployProgress } from '../../../utils/progressBar'; -import { DeployCache } from '../../../utils/deployCache'; -import { testLevelFlag, testsFlag } from '../../../utils/flags'; +import chalk from 'chalk'; +import { API, DeleteSourceJson, isSourceComponent } from '../../../utils/types.js'; +import { getPackageDirs, getSourceApiVersion } from '../../../utils/project.js'; +import { resolveApi, validateTests } from '../../../utils/deploy.js'; +import { DeployResultFormatter } from '../../../formatters/deployResultFormatter.js'; +import { DeleteResultFormatter } from '../../../formatters/deleteResultFormatter.js'; +import { DeployProgress } from '../../../utils/progressBar.js'; +import { DeployCache } from '../../../utils/deployCache.js'; +import { testLevelFlag, testsFlag } from '../../../utils/flags.js'; const fsPromises = fs.promises; const testFlags = 'Test'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectory(path.dirname(fileURLToPath(import.meta.url))); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'delete.source'); const xorFlags = ['metadata', 'source-dir']; export class Source extends SfCommand { @@ -72,11 +73,10 @@ export class Source extends SfCommand { description: messages.getMessage('flags.wait.description'), summary: messages.getMessage('flags.wait.summary'), }), - tests: { - ...testsFlag, + tests: testsFlag({ helpGroup: testFlags, char: undefined, - }, + }), 'test-level': testLevelFlag({ aliases: ['testlevel'], deprecateAliases: true, diff --git a/src/commands/project/delete/tracking.ts b/src/commands/project/delete/tracking.ts index 3c4fa34c..275bbd5c 100644 --- a/src/commands/project/delete/tracking.ts +++ b/src/commands/project/delete/tracking.ts @@ -5,8 +5,10 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ +import { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; import { Messages } from '@salesforce/core'; -import * as chalk from 'chalk'; +import chalk from 'chalk'; import { SourceTracking } from '@salesforce/source-tracking'; import { Flags, @@ -16,7 +18,7 @@ import { SfCommand, } from '@salesforce/sf-plugins-core'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'delete.tracking'); export type DeleteTrackingResult = { diff --git a/src/commands/project/deploy/cancel.ts b/src/commands/project/deploy/cancel.ts index 4e19ad19..e34b1da1 100644 --- a/src/commands/project/deploy/cancel.ts +++ b/src/commands/project/deploy/cancel.ts @@ -5,17 +5,19 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ +import { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; import { Messages } from '@salesforce/core'; import { Duration } from '@salesforce/kit'; import { SfCommand, Flags } from '@salesforce/sf-plugins-core'; import { RequestStatus } from '@salesforce/source-deploy-retrieve'; -import { cancelDeploy, cancelDeployAsync } from '../../../utils/deploy'; -import { DeployCache } from '../../../utils/deployCache'; -import { AsyncDeployCancelResultFormatter } from '../../../formatters/asyncDeployCancelResultFormatter'; -import { DeployCancelResultFormatter } from '../../../formatters/deployCancelResultFormatter'; -import { DeployResultJson } from '../../../utils/types'; +import { cancelDeploy, cancelDeployAsync } from '../../../utils/deploy.js'; +import { DeployCache } from '../../../utils/deployCache.js'; +import { AsyncDeployCancelResultFormatter } from '../../../formatters/asyncDeployCancelResultFormatter.js'; +import { DeployCancelResultFormatter } from '../../../formatters/deployCancelResultFormatter.js'; +import { DeployResultJson } from '../../../utils/types.js'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata.cancel'); export default class DeployMetadataCancel extends SfCommand { diff --git a/src/commands/project/deploy/preview.ts b/src/commands/project/deploy/preview.ts index 37e4fc31..25e717a7 100644 --- a/src/commands/project/deploy/preview.ts +++ b/src/commands/project/deploy/preview.ts @@ -4,14 +4,16 @@ * 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 { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; import { Messages } from '@salesforce/core'; import { SfCommand, Flags } from '@salesforce/sf-plugins-core'; import { SourceTracking } from '@salesforce/source-tracking'; import { ForceIgnore } from '@salesforce/source-deploy-retrieve'; -import { buildComponentSet } from '../../../utils/deploy'; -import { PreviewResult, printTables, compileResults, getConflictFiles } from '../../../utils/previewOutput'; +import { buildComponentSet } from '../../../utils/deploy.js'; +import { PreviewResult, printTables, compileResults, getConflictFiles } from '../../../utils/previewOutput.js'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata.preview'); const exclusiveFlags = ['manifest', 'source-dir', 'metadata']; diff --git a/src/commands/project/deploy/quick.ts b/src/commands/project/deploy/quick.ts index d95b76a7..1e3a504c 100644 --- a/src/commands/project/deploy/quick.ts +++ b/src/commands/project/deploy/quick.ts @@ -5,19 +5,21 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { bold } from 'chalk'; +import { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import chalk from 'chalk'; import { Messages, Org } from '@salesforce/core'; import { SfCommand, toHelpSection, Flags } from '@salesforce/sf-plugins-core'; import { MetadataApiDeploy, RequestStatus } from '@salesforce/source-deploy-retrieve'; import { Duration } from '@salesforce/kit'; -import { DeployOptions, determineExitCode, resolveApi } from '../../../utils/deploy'; -import { DeployCache } from '../../../utils/deployCache'; -import { DEPLOY_STATUS_CODES_DESCRIPTIONS } from '../../../utils/errorCodes'; -import { AsyncDeployResultFormatter } from '../../../formatters/asyncDeployResultFormatter'; -import { DeployResultFormatter } from '../../../formatters/deployResultFormatter'; -import { API, DeployResultJson } from '../../../utils/types'; - -Messages.importMessagesDirectory(__dirname); +import { DeployOptions, determineExitCode, resolveApi } from '../../../utils/deploy.js'; +import { DeployCache } from '../../../utils/deployCache.js'; +import { DEPLOY_STATUS_CODES_DESCRIPTIONS } from '../../../utils/errorCodes.js'; +import { AsyncDeployResultFormatter } from '../../../formatters/asyncDeployResultFormatter.js'; +import { DeployResultFormatter } from '../../../formatters/deployResultFormatter.js'; +import { API, DeployResultJson } from '../../../utils/types.js'; + +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata.quick'); export default class DeployMetadataQuick extends SfCommand { @@ -99,7 +101,7 @@ export default class DeployMetadataQuick extends SfCommand { }); // This is the ID of the deploy (of the validated metadata) const deployId = await mdapiDeploy.deployRecentValidation(api === API['REST']); - this.log(`Deploy ID: ${bold(deployId)}`); + this.log(`Deploy ID: ${chalk.bold(deployId)}`); if (flags.async) { const asyncFormatter = new AsyncDeployResultFormatter(deployId, this.config.bin); diff --git a/src/commands/project/deploy/report.ts b/src/commands/project/deploy/report.ts index 6e660994..4019c26d 100644 --- a/src/commands/project/deploy/report.ts +++ b/src/commands/project/deploy/report.ts @@ -5,17 +5,19 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ +import { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; import { Messages, Org, SfProject } from '@salesforce/core'; import { SfCommand, Flags } from '@salesforce/sf-plugins-core'; import { ComponentSet, DeployResult, MetadataApiDeploy } from '@salesforce/source-deploy-retrieve'; -import { buildComponentSet } from '../../../utils/deploy'; -import { DeployProgress } from '../../../utils/progressBar'; -import { DeployCache } from '../../../utils/deployCache'; -import { DeployReportResultFormatter } from '../../../formatters/deployReportResultFormatter'; -import { API, DeployResultJson } from '../../../utils/types'; -import { coverageFormattersFlag } from '../../../utils/flags'; +import { buildComponentSet } from '../../../utils/deploy.js'; +import { DeployProgress } from '../../../utils/progressBar.js'; +import { DeployCache } from '../../../utils/deployCache.js'; +import { DeployReportResultFormatter } from '../../../formatters/deployReportResultFormatter.js'; +import { API, DeployResultJson } from '../../../utils/types.js'; +import { coverageFormattersFlag } from '../../../utils/flags.js'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata.report'); const deployMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata'); const testFlags = 'Test'; @@ -47,7 +49,7 @@ export default class DeployMetadataReport extends SfCommand { summary: messages.getMessage('flags.use-most-recent.summary'), exactlyOne: ['use-most-recent', 'job-id'], }), - 'coverage-formatters': { ...coverageFormattersFlag, helpGroup: testFlags }, + 'coverage-formatters': coverageFormattersFlag({ helpGroup: testFlags }), junit: Flags.boolean({ summary: messages.getMessage('flags.junit.summary'), helpGroup: testFlags, diff --git a/src/commands/project/deploy/resume.ts b/src/commands/project/deploy/resume.ts index 9c621d22..13a42965 100644 --- a/src/commands/project/deploy/resume.ts +++ b/src/commands/project/deploy/resume.ts @@ -5,20 +5,22 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { bold } from 'chalk'; +import { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import chalk from 'chalk'; import { EnvironmentVariable, Messages, Org, SfError } from '@salesforce/core'; import { SfCommand, toHelpSection, Flags } from '@salesforce/sf-plugins-core'; import { DeployResult, MetadataApiDeploy } from '@salesforce/source-deploy-retrieve'; import { Duration } from '@salesforce/kit'; -import { DeployResultFormatter } from '../../../formatters/deployResultFormatter'; -import { DeployProgress } from '../../../utils/progressBar'; -import { API, DeployResultJson } from '../../../utils/types'; -import { buildComponentSet, determineExitCode, executeDeploy, isNotResumable } from '../../../utils/deploy'; -import { DeployCache } from '../../../utils/deployCache'; -import { DEPLOY_STATUS_CODES_DESCRIPTIONS } from '../../../utils/errorCodes'; -import { coverageFormattersFlag } from '../../../utils/flags'; - -Messages.importMessagesDirectory(__dirname); +import { DeployResultFormatter } from '../../../formatters/deployResultFormatter.js'; +import { DeployProgress } from '../../../utils/progressBar.js'; +import { API, DeployResultJson } from '../../../utils/types.js'; +import { buildComponentSet, determineExitCode, executeDeploy, isNotResumable } from '../../../utils/deploy.js'; +import { DeployCache } from '../../../utils/deployCache.js'; +import { DEPLOY_STATUS_CODES_DESCRIPTIONS } from '../../../utils/errorCodes.js'; +import { coverageFormattersFlag } from '../../../utils/flags.js'; + +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata.resume'); const testFlags = 'Test'; @@ -63,7 +65,7 @@ export default class DeployMetadataResume extends SfCommand { helpValue: '', min: 1, }), - 'coverage-formatters': { ...coverageFormattersFlag, helpGroup: testFlags }, + 'coverage-formatters': coverageFormattersFlag({ helpGroup: testFlags }), junit: Flags.boolean({ summary: messages.getMessage('flags.junit.summary'), helpGroup: testFlags, @@ -125,7 +127,7 @@ export default class DeployMetadataResume extends SfCommand { jobId ); - this.log(`Deploy ID: ${bold(jobId)}`); + this.log(`Deploy ID: ${chalk.bold(jobId)}`); new DeployProgress(deploy, this.jsonEnabled()).start(); result = await deploy.pollStatus(500, wait.seconds); diff --git a/src/commands/project/deploy/start.ts b/src/commands/project/deploy/start.ts index d29330f8..80f3ea33 100644 --- a/src/commands/project/deploy/start.ts +++ b/src/commands/project/deploy/start.ts @@ -4,25 +4,27 @@ * 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 { bold } from 'chalk'; +import { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import chalk from 'chalk'; import { EnvironmentVariable, Lifecycle, Messages, OrgConfigProperties, SfError } from '@salesforce/core'; import { DeployVersionData } from '@salesforce/source-deploy-retrieve'; import { Duration } from '@salesforce/kit'; import { SfCommand, toHelpSection, Flags } from '@salesforce/sf-plugins-core'; import { SourceConflictError } from '@salesforce/source-tracking'; -import { AsyncDeployResultFormatter } from '../../../formatters/asyncDeployResultFormatter'; -import { DeployResultFormatter } from '../../../formatters/deployResultFormatter'; -import { DeployProgress } from '../../../utils/progressBar'; -import { DeployResultJson, TestLevel } from '../../../utils/types'; -import { executeDeploy, resolveApi, validateTests, determineExitCode } from '../../../utils/deploy'; -import { DeployCache } from '../../../utils/deployCache'; -import { DEPLOY_STATUS_CODES_DESCRIPTIONS } from '../../../utils/errorCodes'; -import { ConfigVars } from '../../../configMeta'; -import { coverageFormattersFlag, fileOrDirFlag, testLevelFlag, testsFlag } from '../../../utils/flags'; -import { writeConflictTable } from '../../../utils/conflicts'; -import { getOptionalProject } from '../../../utils/project'; +import { AsyncDeployResultFormatter } from '../../../formatters/asyncDeployResultFormatter.js'; +import { DeployResultFormatter } from '../../../formatters/deployResultFormatter.js'; +import { DeployProgress } from '../../../utils/progressBar.js'; +import { DeployResultJson, TestLevel } from '../../../utils/types.js'; +import { executeDeploy, resolveApi, validateTests, determineExitCode } from '../../../utils/deploy.js'; +import { DeployCache } from '../../../utils/deployCache.js'; +import { DEPLOY_STATUS_CODES_DESCRIPTIONS } from '../../../utils/errorCodes.js'; +import { ConfigVars } from '../../../configMeta.js'; +import { coverageFormattersFlag, fileOrDirFlag, testLevelFlag, testsFlag } from '../../../utils/flags.js'; +import { writeConflictTable } from '../../../utils/conflicts.js'; +import { getOptionalProject } from '../../../utils/project.js'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata'); const exclusiveFlags = ['manifest', 'source-dir', 'metadata', 'metadata-dir']; @@ -115,7 +117,7 @@ export default class DeployMetadata extends SfCommand { summary: messages.getMessage('flags.target-org.summary'), required: true, }), - tests: { ...testsFlag, helpGroup: testFlags }, + tests: testsFlag({ helpGroup: testFlags }), 'test-level': testLevelFlag({ description: messages.getMessage('flags.test-level.description'), summary: messages.getMessage('flags.test-level.summary'), @@ -152,7 +154,7 @@ export default class DeployMetadata extends SfCommand { dependsOn: ['manifest'], helpGroup: destructiveFlags, }), - 'coverage-formatters': { ...coverageFormattersFlag, helpGroup: testFlags }, + 'coverage-formatters': coverageFormattersFlag({ helpGroup: testFlags }), junit: Flags.boolean({ summary: messages.getMessage('flags.junit.summary'), helpGroup: testFlags, @@ -233,7 +235,7 @@ export default class DeployMetadata extends SfCommand { if (!deploy.id) { throw new SfError('The deploy id is not available.'); } - this.log(`Deploy ID: ${bold(deploy.id)}`); + this.log(`Deploy ID: ${chalk.bold(deploy.id)}`); if (flags.async) { if (flags['coverage-formatters']) { diff --git a/src/commands/project/deploy/validate.ts b/src/commands/project/deploy/validate.ts index d5ea2716..1e9346e5 100644 --- a/src/commands/project/deploy/validate.ts +++ b/src/commands/project/deploy/validate.ts @@ -5,22 +5,23 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ import * as os from 'node:os'; -import { bold } from 'chalk'; +import { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import chalk from 'chalk'; import { EnvironmentVariable, Lifecycle, Messages, OrgConfigProperties, SfError } from '@salesforce/core'; import { CodeCoverageWarnings, DeployVersionData, RequestStatus } from '@salesforce/source-deploy-retrieve'; -import { Duration } from '@salesforce/kit'; +import { Duration, ensureArray } from '@salesforce/kit'; import { SfCommand, toHelpSection, Flags } from '@salesforce/sf-plugins-core'; -import { ensureArray } from '@salesforce/kit'; -import { AsyncDeployResultFormatter } from '../../../formatters/asyncDeployResultFormatter'; -import { DeployResultFormatter } from '../../../formatters/deployResultFormatter'; -import { DeployProgress } from '../../../utils/progressBar'; -import { DeployResultJson, TestLevel } from '../../../utils/types'; -import { executeDeploy, resolveApi, determineExitCode, validateTests } from '../../../utils/deploy'; -import { DEPLOY_STATUS_CODES_DESCRIPTIONS } from '../../../utils/errorCodes'; -import { ConfigVars } from '../../../configMeta'; -import { coverageFormattersFlag, fileOrDirFlag, testLevelFlag, testsFlag } from '../../../utils/flags'; - -Messages.importMessagesDirectory(__dirname); +import { AsyncDeployResultFormatter } from '../../../formatters/asyncDeployResultFormatter.js'; +import { DeployResultFormatter } from '../../../formatters/deployResultFormatter.js'; +import { DeployProgress } from '../../../utils/progressBar.js'; +import { DeployResultJson, TestLevel } from '../../../utils/types.js'; +import { executeDeploy, resolveApi, determineExitCode, validateTests } from '../../../utils/deploy.js'; +import { DEPLOY_STATUS_CODES_DESCRIPTIONS } from '../../../utils/errorCodes.js'; +import { ConfigVars } from '../../../configMeta.js'; +import { coverageFormattersFlag, fileOrDirFlag, testLevelFlag, testsFlag } from '../../../utils/flags.js'; + +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata.validate'); const deployMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata'); @@ -90,7 +91,7 @@ export default class DeployMetadataValidate extends SfCommand summary: messages.getMessage('flags.target-org.summary'), required: true, }), - tests: { ...testsFlag, helpGroup: testFlags }, + tests: testsFlag({ helpGroup: testFlags }), 'test-level': testLevelFlag({ options: [TestLevel.RunAllTestsInOrg, TestLevel.RunLocalTests, TestLevel.RunSpecifiedTests], default: TestLevel.RunLocalTests, @@ -117,7 +118,7 @@ export default class DeployMetadataValidate extends SfCommand description: deployMessages.getMessage('flags.ignore-warnings.description'), default: false, }), - 'coverage-formatters': { ...coverageFormattersFlag, helpGroup: testFlags }, + 'coverage-formatters': coverageFormattersFlag({ helpGroup: testFlags }), junit: Flags.boolean({ summary: messages.getMessage('flags.junit.summary'), helpGroup: testFlags, @@ -199,7 +200,7 @@ export default class DeployMetadataValidate extends SfCommand if (!deploy.id) { throw new SfError('The deploy id is not available.'); } - this.log(`Deploy ID: ${bold(deploy.id)}`); + this.log(`Deploy ID: ${chalk.bold(deploy.id)}`); if (flags.async) { const asyncFormatter = new AsyncDeployResultFormatter(deploy.id, this.config.bin); @@ -211,7 +212,9 @@ export default class DeployMetadataValidate extends SfCommand const result = await deploy.pollStatus(500, flags.wait?.seconds); process.exitCode = determineExitCode(result); - const formatter = new DeployResultFormatter(result, flags); + const formatter = new DeployResultFormatter(result, { + ...flags, + }); if (!this.jsonEnabled()) { formatter.display(); diff --git a/src/commands/project/generate/manifest.ts b/src/commands/project/generate/manifest.ts index 484a65ce..91146dfe 100644 --- a/src/commands/project/generate/manifest.ts +++ b/src/commands/project/generate/manifest.ts @@ -4,8 +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 { join } from 'node:path'; +import { join, dirname } from 'node:path'; import * as fs from 'node:fs'; +import { fileURLToPath } from 'node:url'; import { Messages, Org } from '@salesforce/core'; import { ComponentSetBuilder } from '@salesforce/source-deploy-retrieve'; import { @@ -15,9 +16,9 @@ import { orgApiVersionFlagWithDeprecations, SfCommand, } from '@salesforce/sf-plugins-core'; -import { getPackageDirs, getSourceApiVersion } from '../../../utils/project'; +import { getPackageDirs, getSourceApiVersion } from '../../../utils/project.js'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'manifest.generate'); const manifestTypes = { diff --git a/src/commands/project/list/ignored.ts b/src/commands/project/list/ignored.ts index 0f0ff1fb..02eaac8d 100644 --- a/src/commands/project/list/ignored.ts +++ b/src/commands/project/list/ignored.ts @@ -4,13 +4,14 @@ * 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 * as path from 'node:path'; -import * as fs from 'node:fs'; +import { join, dirname } from 'node:path'; +import fs from 'node:fs'; +import { fileURLToPath } from 'node:url'; import { Messages, SfError } from '@salesforce/core'; import { ForceIgnore } from '@salesforce/source-deploy-retrieve'; import { SfCommand, Flags } from '@salesforce/sf-plugins-core'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'list.ignored'); export type SourceIgnoredResults = { @@ -80,7 +81,7 @@ export class Ignored extends SfCommand { // Recursively search a directory for source files to test. private async findIgnored(dir: string): Promise>> { - return (await fs.promises.readdir(dir)).map((filename) => this.statIgnored(path.join(dir, filename))); + return (await fs.promises.readdir(dir)).map((filename) => this.statIgnored(join(dir, filename))); } // Test if a source file is denied, adding any ignored files to diff --git a/src/commands/project/reset/tracking.ts b/src/commands/project/reset/tracking.ts index 267f4ba5..f19b27ff 100644 --- a/src/commands/project/reset/tracking.ts +++ b/src/commands/project/reset/tracking.ts @@ -5,6 +5,8 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ +import { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; import { Messages } from '@salesforce/core'; import { SourceTracking } from '@salesforce/source-tracking'; import { @@ -16,7 +18,7 @@ import { StandardColors, } from '@salesforce/sf-plugins-core'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'delete.tracking'); export type ResetTrackingResult = { diff --git a/src/commands/project/retrieve/preview.ts b/src/commands/project/retrieve/preview.ts index c8a99afc..4b67866f 100644 --- a/src/commands/project/retrieve/preview.ts +++ b/src/commands/project/retrieve/preview.ts @@ -4,13 +4,15 @@ * 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 { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; import { Messages } from '@salesforce/core'; import { SfCommand, Flags } from '@salesforce/sf-plugins-core'; import { SourceTracking } from '@salesforce/source-tracking'; import { ForceIgnore } from '@salesforce/source-deploy-retrieve'; -import { PreviewResult, printTables, compileResults, getConflictFiles } from '../../../utils/previewOutput'; +import { PreviewResult, printTables, compileResults, getConflictFiles } from '../../../utils/previewOutput.js'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'retrieve.metadata.preview'); export default class RetrieveMetadataPreview extends SfCommand { diff --git a/src/commands/project/retrieve/start.ts b/src/commands/project/retrieve/start.ts index d12adb15..fef75887 100644 --- a/src/commands/project/retrieve/start.ts +++ b/src/commands/project/retrieve/start.ts @@ -9,6 +9,7 @@ import { rm } from 'node:fs/promises'; import { dirname, join, resolve } from 'node:path'; import * as fs from 'node:fs'; +import { fileURLToPath } from 'node:url'; import { EnvironmentVariable, Lifecycle, Messages, OrgConfigProperties, SfError, SfProject } from '@salesforce/core'; import { RetrieveResult, @@ -27,15 +28,15 @@ import { SourceTracking, SourceConflictError } from '@salesforce/source-tracking import { Duration } from '@salesforce/kit'; import { Interfaces } from '@oclif/core'; -import { DEFAULT_ZIP_FILE_NAME, ensuredDirFlag, zipFileFlag } from '../../../utils/flags'; -import { RetrieveResultFormatter } from '../../../formatters/retrieveResultFormatter'; -import { MetadataRetrieveResultFormatter } from '../../../formatters/metadataRetrieveResultFormatter'; -import { getOptionalProject, getPackageDirs } from '../../../utils/project'; -import { RetrieveResultJson } from '../../../utils/types'; -import { writeConflictTable } from '../../../utils/conflicts'; -import { promisesQueue } from '../../../utils/promiseQueue'; +import { DEFAULT_ZIP_FILE_NAME, ensuredDirFlag, zipFileFlag } from '../../../utils/flags.js'; +import { RetrieveResultFormatter } from '../../../formatters/retrieveResultFormatter.js'; +import { MetadataRetrieveResultFormatter } from '../../../formatters/metadataRetrieveResultFormatter.js'; +import { getOptionalProject, getPackageDirs } from '../../../utils/project.js'; +import { RetrieveResultJson } from '../../../utils/types.js'; +import { writeConflictTable } from '../../../utils/conflicts.js'; +import { promisesQueue } from '../../../utils/promiseQueue.js'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'retrieve.start'); const mdTransferMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'metadata.transfer'); diff --git a/src/configMeta.ts b/src/configMeta.ts index 3cde41a3..e2d8b7fe 100644 --- a/src/configMeta.ts +++ b/src/configMeta.ts @@ -5,10 +5,12 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ +import { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; import type { ConfigValue } from '@salesforce/core'; +import { Messages } from '@salesforce/core/lib/messages.js'; -import { Messages } from '@salesforce/core/lib/messages'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'config'); export enum ConfigVars { diff --git a/src/formatters/asyncDeployCancelResultFormatter.ts b/src/formatters/asyncDeployCancelResultFormatter.ts index 3f55a265..06e11aa5 100644 --- a/src/formatters/asyncDeployCancelResultFormatter.ts +++ b/src/formatters/asyncDeployCancelResultFormatter.ts @@ -4,11 +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 { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; import { ux } from '@oclif/core'; import { Messages } from '@salesforce/core'; -import { AsyncDeployResultJson, DeployResultJson, Formatter } from '../utils/types'; - -Messages.importMessagesDirectory(__dirname); +import { AsyncDeployResultJson, DeployResultJson, Formatter } from '../utils/types.js'; +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); export const deployAsyncMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.async'); diff --git a/src/formatters/asyncDeployResultFormatter.ts b/src/formatters/asyncDeployResultFormatter.ts index 6c2f6196..f43a3772 100644 --- a/src/formatters/asyncDeployResultFormatter.ts +++ b/src/formatters/asyncDeployResultFormatter.ts @@ -4,11 +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 { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; import { ux } from '@oclif/core'; import { Messages } from '@salesforce/core'; -import { AsyncDeployResultJson, Formatter } from '../utils/types'; - -Messages.importMessagesDirectory(__dirname); +import { AsyncDeployResultJson, Formatter } from '../utils/types.js'; +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); export const deployAsyncMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.async'); export class AsyncDeployResultFormatter implements Formatter { diff --git a/src/formatters/deleteResultFormatter.ts b/src/formatters/deleteResultFormatter.ts index 5b16f806..fd70548c 100644 --- a/src/formatters/deleteResultFormatter.ts +++ b/src/formatters/deleteResultFormatter.ts @@ -7,11 +7,11 @@ import { ux } from '@oclif/core'; import { DeployResult, FileResponse, RequestStatus } from '@salesforce/source-deploy-retrieve'; import { ensureArray } from '@salesforce/kit'; -import { bold, blue } from 'chalk'; +import chalk from 'chalk'; import { StandardColors } from '@salesforce/sf-plugins-core'; -import { DeleteSourceJson, Formatter, TestLevel } from '../utils/types'; -import { sortFileResponses, asRelativePaths } from '../utils/output'; -import { TestResultsFormatter } from '../formatters/testResultsFormatter'; +import { DeleteSourceJson, Formatter, TestLevel } from '../utils/types.js'; +import { sortFileResponses, asRelativePaths } from '../utils/output.js'; +import { TestResultsFormatter } from '../formatters/testResultsFormatter.js'; export class DeleteResultFormatter extends TestResultsFormatter implements Formatter { public constructor( @@ -75,7 +75,7 @@ export class DeleteResultFormatter extends TestResultsFormatter implements Forma } ux.log(''); - ux.styledHeader(blue('Deleted Source')); + ux.styledHeader(chalk.blue('Deleted Source')); ux.table( successes.map((entry) => ({ fullName: entry.fullName, @@ -106,7 +106,7 @@ export class DeleteResultFormatter extends TestResultsFormatter implements Forma error: { header: 'Problem' }, }; const options: ux.Table.table.Options = { - title: StandardColors.error(bold(`Component Failures [${failures.length}]`)), + title: StandardColors.error(chalk.bold(`Component Failures [${failures.length}]`)), 'no-truncate': true, }; ux.log(); diff --git a/src/formatters/deployCancelResultFormatter.ts b/src/formatters/deployCancelResultFormatter.ts index 08de925d..b1f57780 100644 --- a/src/formatters/deployCancelResultFormatter.ts +++ b/src/formatters/deployCancelResultFormatter.ts @@ -6,7 +6,7 @@ */ import { ux } from '@oclif/core'; import { DeployResult, RequestStatus } from '@salesforce/source-deploy-retrieve'; -import { DeployResultJson, Formatter } from '../utils/types'; +import { DeployResultJson, Formatter } from '../utils/types.js'; export class DeployCancelResultFormatter implements Formatter { public constructor(protected result: DeployResult) {} diff --git a/src/formatters/deployReportResultFormatter.ts b/src/formatters/deployReportResultFormatter.ts index 0654c0ac..71a13ed6 100644 --- a/src/formatters/deployReportResultFormatter.ts +++ b/src/formatters/deployReportResultFormatter.ts @@ -8,8 +8,8 @@ import { ux } from '@oclif/core'; import { RequestStatus } from '@salesforce/source-deploy-retrieve'; import { StandardColors } from '@salesforce/sf-plugins-core'; import { Duration } from '@salesforce/kit'; -import { tableHeader } from '../utils/output'; -import { DeployResultFormatter } from './deployResultFormatter'; +import { tableHeader } from '../utils/output.js'; +import { DeployResultFormatter } from './deployResultFormatter.js'; export class DeployReportResultFormatter extends DeployResultFormatter { public display(): void { diff --git a/src/formatters/deployResultFormatter.ts b/src/formatters/deployResultFormatter.ts index 55a60e62..ef2e1c3e 100644 --- a/src/formatters/deployResultFormatter.ts +++ b/src/formatters/deployResultFormatter.ts @@ -18,16 +18,22 @@ import { JUnitReporter, TestResult, } from '@salesforce/apex-node'; -import { DeployResultJson, isSdrFailure, isSdrSuccess, TestLevel, Verbosity, Formatter } from '../utils/types'; +import { DeployResultJson, isSdrFailure, isSdrSuccess, TestLevel, Verbosity, Formatter } from '../utils/types.js'; import { generateCoveredLines, getCoverageFormattersOptions, getCoverageNumbers, mapTestResults, transformCoverageToApexCoverage, -} from '../utils/coverage'; -import { sortFileResponses, asRelativePaths, tableHeader, getFileResponseSuccessProps, error } from '../utils/output'; -import { TestResultsFormatter } from '../formatters/testResultsFormatter'; +} from '../utils/coverage.js'; +import { + sortFileResponses, + asRelativePaths, + tableHeader, + getFileResponseSuccessProps, + error, +} from '../utils/output.js'; +import { TestResultsFormatter } from '../formatters/testResultsFormatter.js'; export class DeployResultFormatter extends TestResultsFormatter implements Formatter { private relativeFiles: FileResponse[]; diff --git a/src/formatters/metadataConvertResultFormatter.ts b/src/formatters/metadataConvertResultFormatter.ts index 11a86b2b..8c6d82f7 100644 --- a/src/formatters/metadataConvertResultFormatter.ts +++ b/src/formatters/metadataConvertResultFormatter.ts @@ -7,7 +7,7 @@ import * as path from 'node:path'; import { ux } from '@oclif/core'; import { ConvertResult } from '@salesforce/source-deploy-retrieve'; -import { Formatter, ConvertMdapiJson } from '../utils/types'; +import { Formatter, ConvertMdapiJson } from '../utils/types.js'; export class MetadataConvertResultFormatter implements Formatter { private convertResults!: ConvertMdapiJson; diff --git a/src/formatters/metadataRetrieveResultFormatter.ts b/src/formatters/metadataRetrieveResultFormatter.ts index 7b7467a7..ef0f9076 100644 --- a/src/formatters/metadataRetrieveResultFormatter.ts +++ b/src/formatters/metadataRetrieveResultFormatter.ts @@ -4,14 +4,15 @@ * 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 * as path from 'node:path'; +import { join, parse, dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; import { ux } from '@oclif/core'; import { FileResponse, RetrieveResult } from '@salesforce/source-deploy-retrieve'; import { Messages } from '@salesforce/core'; -import { Formatter, MetadataRetrieveResultJson } from '../utils/types'; -import { sortFileResponses, asRelativePaths } from '../utils/output'; +import { Formatter, MetadataRetrieveResultJson } from '../utils/types.js'; +import { sortFileResponses, asRelativePaths } from '../utils/output.js'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); export const retrieveMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'retrieve.start'); export class MetadataRetrieveResultFormatter implements Formatter { @@ -21,7 +22,7 @@ export class MetadataRetrieveResultFormatter implements Formatter { ux.log(retrieveMessages.getMessage('info.WroteZipFile', [this.zipFilePath])); if (this.opts.unzip) { - const extractPath = path.join(this.opts['target-metadata-dir'], path.parse(this.opts['zip-file-name']).name); + const extractPath = join(this.opts['target-metadata-dir'], parse(this.opts['zip-file-name']).name); ux.log(retrieveMessages.getMessage('info.ExtractedZipFile', [this.zipFilePath, extractPath])); } } diff --git a/src/formatters/retrieveResultFormatter.ts b/src/formatters/retrieveResultFormatter.ts index 82a29fa8..fd6dff8e 100644 --- a/src/formatters/retrieveResultFormatter.ts +++ b/src/formatters/retrieveResultFormatter.ts @@ -9,8 +9,8 @@ import { Ux } from '@salesforce/sf-plugins-core'; import { FileResponse, RetrieveMessage, RetrieveResult } from '@salesforce/source-deploy-retrieve'; import { NamedPackageDir, SfProject } from '@salesforce/core'; import { ensureArray } from '@salesforce/kit'; -import { Formatter, isSdrSuccess, RetrieveResultJson } from '../utils/types'; -import { sortFileResponses, asRelativePaths, tableHeader, getFileResponseSuccessProps } from '../utils/output'; +import { Formatter, isSdrSuccess, RetrieveResultJson } from '../utils/types.js'; +import { sortFileResponses, asRelativePaths, tableHeader, getFileResponseSuccessProps } from '../utils/output.js'; export class RetrieveResultFormatter implements Formatter { private files: FileResponse[]; diff --git a/src/formatters/sourceConvertResultFormatter.ts b/src/formatters/sourceConvertResultFormatter.ts index f1211492..d554f650 100644 --- a/src/formatters/sourceConvertResultFormatter.ts +++ b/src/formatters/sourceConvertResultFormatter.ts @@ -4,13 +4,14 @@ * 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 { resolve } from 'node:path'; +import { resolve, dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; import { ux } from '@oclif/core'; import { ConvertResult } from '@salesforce/source-deploy-retrieve'; import { SfError, Messages } from '@salesforce/core'; -import { ConvertResultJson, Formatter } from '../utils/types'; +import { ConvertResultJson, Formatter } from '../utils/types.js'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); export const convertMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'convert.source'); export class SourceConvertResultFormatter implements Formatter { diff --git a/src/formatters/testResultsFormatter.ts b/src/formatters/testResultsFormatter.ts index 6c8047c2..37f9857b 100644 --- a/src/formatters/testResultsFormatter.ts +++ b/src/formatters/testResultsFormatter.ts @@ -6,7 +6,7 @@ */ import * as os from 'node:os'; import { ux } from '@oclif/core'; -import { dim, underline } from 'chalk'; +import chalk from 'chalk'; import { CodeCoverage, CodeCoverageWarnings, @@ -17,9 +17,9 @@ import { Successes, } from '@salesforce/source-deploy-retrieve'; import { ensureArray } from '@salesforce/kit'; -import { TestLevel, Verbosity } from '../utils/types'; -import { tableHeader, error, success, check } from '../utils/output'; -import { coverageOutput } from '../utils/coverage'; +import { TestLevel, Verbosity } from '../utils/types.js'; +import { tableHeader, error, success, check } from '../utils/output.js'; +import { coverageOutput } from '../utils/coverage.js'; export class TestResultsFormatter { public testLevel: TestLevel | undefined; @@ -75,7 +75,7 @@ const displayVerboseTestSuccesses = (resultSuccesses: RunTestResult['successes'] ux.log(); ux.log(success(`Test Success [${successes.length}]`)); for (const test of successes) { - const testName = underline(`${test.name}.${test.methodName}`); + const testName = chalk.underline(`${test.name}.${test.methodName}`); ux.log(`${check} ${testName}`); } } @@ -89,12 +89,12 @@ const displayVerboseTestFailures = (response: MetadataApiDeployStatus): void => ux.log(); ux.log(error(`Test Failures [${failureCount}]`)); for (const test of failures) { - const testName = underline(`${test.name}.${test.methodName}`); + const testName = chalk.underline(`${test.name}.${test.methodName}`); ux.log(`• ${testName}`); - ux.log(` ${dim('message')}: ${test.message}`); + ux.log(` ${chalk.dim('message')}: ${test.message}`); if (test.stackTrace) { const stackTrace = test.stackTrace.replace(/\n/g, `${os.EOL} `); - ux.log(` ${dim('stacktrace')}: ${os.EOL} ${stackTrace}`); + ux.log(` ${chalk.dim('stacktrace')}: ${os.EOL} ${stackTrace}`); } ux.log(); } diff --git a/src/hooks/deploy.ts b/src/hooks/deploy.ts index a7834d42..1870a1d3 100644 --- a/src/hooks/deploy.ts +++ b/src/hooks/deploy.ts @@ -7,7 +7,7 @@ import { SfProject } from '@salesforce/core'; import { SfHook } from '@salesforce/sf-plugins-core'; -import { MetadataDeployer } from '../utils/metadataDeployer'; +import { MetadataDeployer } from '../utils/metadataDeployer.js'; const hook: SfHook.Deploy = async function () { const project = await SfProject.resolve(); diff --git a/src/index.ts b/src/index.ts index c5811107..af79a8cd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,4 +5,4 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -export = {}; +export default {}; diff --git a/src/utils/coverage.ts b/src/utils/coverage.ts index 46e4352d..2946054d 100644 --- a/src/utils/coverage.ts +++ b/src/utils/coverage.ts @@ -5,7 +5,6 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ import * as path from 'node:path'; - import { ApexTestResultData, ApexTestResultOutcome, @@ -18,7 +17,6 @@ import { import { Successes, Failures, CodeCoverage } from '@salesforce/source-deploy-retrieve'; import { ensureArray } from '@salesforce/kit'; import { StandardColors } from '@salesforce/sf-plugins-core'; -import { Chalk } from 'chalk'; export const mapTestResults = (testResults: T[]): ApexTestResultData[] => testResults.map((testResult) => ({ @@ -104,7 +102,7 @@ export const coverageOutput = ( : '', }); -const color = (percent: number): Chalk => +const color = (percent: number): typeof StandardColors.success => percent >= 90 ? StandardColors.success : percent >= 75 ? StandardColors.warning : StandardColors.error; const formatPercent = (percent: number): string => color(percent)(`${percent}%`); diff --git a/src/utils/deploy.ts b/src/utils/deploy.ts index 33701bae..466b8f91 100644 --- a/src/utils/deploy.ts +++ b/src/utils/deploy.ts @@ -5,6 +5,8 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ +import { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; import { ConfigAggregator, Messages, Org, SfError, SfProject } from '@salesforce/core'; import { Duration } from '@salesforce/kit'; import { Nullable } from '@salesforce/ts-types'; @@ -17,14 +19,14 @@ import { RequestStatus, } from '@salesforce/source-deploy-retrieve'; import { SourceTracking } from '@salesforce/source-tracking'; -import ConfigMeta, { ConfigVars } from '../configMeta'; -import { getPackageDirs, getSourceApiVersion } from './project'; -import { API, PathInfo, TestLevel } from './types'; -import { DEPLOY_STATUS_CODES } from './errorCodes'; -import { DeployCache } from './deployCache'; -import { writeManifest } from './manifestCache'; - -Messages.importMessagesDirectory(__dirname); +import ConfigMeta, { ConfigVars } from '../configMeta.js'; +import { getPackageDirs, getSourceApiVersion } from './project.js'; +import { API, PathInfo, TestLevel } from './types.js'; +import { DEPLOY_STATUS_CODES } from './errorCodes.js'; +import { DeployCache } from './deployCache.js'; +import { writeManifest } from './manifestCache.js'; + +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); export const cacheMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'cache'); const deployMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata'); @@ -79,7 +81,7 @@ export async function buildComponentSet(opts: Partial, stl?: Sour /** localChangesAsComponentSet returned an array to support multiple sequential deploys. * `sf` chooses not to support this so we force one ComponentSet */ - const cs = (await stl.localChangesAsComponentSet(false))?.[0] ?? new ComponentSet(); + const cs = (await stl.localChangesAsComponentSet(false))[0] ?? new ComponentSet(); // stl produces a cs with api version already set. command might have specified a version. if (opts['api-version']) { cs.apiVersion = opts['api-version']; diff --git a/src/utils/deployCache.ts b/src/utils/deployCache.ts index df38990a..d7446abd 100644 --- a/src/utils/deployCache.ts +++ b/src/utils/deployCache.ts @@ -7,8 +7,8 @@ import { Global, TTLConfig } from '@salesforce/core'; import { Duration } from '@salesforce/kit'; import { JsonMap } from '@salesforce/ts-types'; -import { DeployOptions, CachedOptions, cacheMessages } from './deploy'; -import { maybeDestroyManifest } from './manifestCache'; +import { DeployOptions, CachedOptions, cacheMessages } from './deploy.js'; +import { maybeDestroyManifest } from './manifestCache.js'; export class DeployCache extends TTLConfig { public static getFileName(): string { diff --git a/src/utils/errorCodes.ts b/src/utils/errorCodes.ts index 90c67866..bdfbea7a 100644 --- a/src/utils/errorCodes.ts +++ b/src/utils/errorCodes.ts @@ -5,10 +5,12 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ +import { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; import { Messages } from '@salesforce/core'; import { RequestStatus } from '@salesforce/source-deploy-retrieve'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'errorCodes'); export const DEPLOY_STATUS_CODES = new Map([ diff --git a/src/utils/flags.ts b/src/utils/flags.ts index df4b86d9..20a35235 100644 --- a/src/utils/flags.ts +++ b/src/utils/flags.ts @@ -5,12 +5,13 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ import * as fs from 'node:fs'; -import { resolve, extname } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { resolve, extname, dirname } from 'node:path'; import { Flags } from '@oclif/core'; import { Messages, Lifecycle } from '@salesforce/core'; -import { PathInfo, TestLevel, reportsFormatters } from './types'; +import { PathInfo, TestLevel, reportsFormatters } from './types.js'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'validation'); const commonFlagMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'commonFlags'); @@ -88,7 +89,7 @@ export const zipFileFlag = Flags.custom({ parse: async (input) => Promise.resolve(resolveZipFileName(input)), }); -export const testsFlag = Flags.string({ +export const testsFlag = Flags.custom({ char: 't', multiple: true, dependsOn: ['test-level'], @@ -102,7 +103,7 @@ export const testsFlag = Flags.string({ ), }); -export const coverageFormattersFlag = Flags.string({ +export const coverageFormattersFlag = Flags.custom({ multiple: true, summary: commonFlagMessages.getMessage('flags.coverage-formatters.summary'), description: commonFlagMessages.getMessage('flags.coverage-formatters.description'), diff --git a/src/utils/metadataDeployer.ts b/src/utils/metadataDeployer.ts index 8a41f442..8e5662c0 100644 --- a/src/utils/metadataDeployer.ts +++ b/src/utils/metadataDeployer.ts @@ -6,8 +6,10 @@ */ /* eslint-disable class-methods-use-this */ +import { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; import { EOL } from 'node:os'; -import { cyan, red } from 'chalk'; +import chalk from 'chalk'; import { Duration } from '@salesforce/kit'; import { AuthInfo, @@ -21,12 +23,12 @@ import { } from '@salesforce/core'; import { Deployable, Deployer, DeployerResult, generateTableChoices } from '@salesforce/sf-plugins-core'; -import { DeployResultFormatter } from '../formatters/deployResultFormatter'; -import { TestLevel } from './types'; -import { DeployProgress } from './progressBar'; -import { determineExitCode, executeDeploy, resolveApi } from './deploy'; +import { DeployResultFormatter } from '../formatters/deployResultFormatter.js'; +import { TestLevel } from './types.js'; +import { DeployProgress } from './progressBar.js'; +import { determineExitCode, executeDeploy, resolveApi } from './deploy.js'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy'); type OrgAuthWithTimestamp = OrgAuthorization & { timestamp: Date }; @@ -123,7 +125,7 @@ export class MetadataDeployer extends Deployer { public async deploy(): Promise { const directories = this.deployables.map((d) => d.pkg.fullPath); - const name = this.deployables.map((p) => cyan.bold(p.getPath())).join(', '); + const name = this.deployables.map((p) => chalk.cyan.bold(p.getPath())).join(', '); const api = await resolveApi(); this.log(`${EOL}Deploying ${name} to ${this.username} using ${api} API`); @@ -176,7 +178,7 @@ export class MetadataDeployer extends Deployer { { name: 'continue', type: 'confirm', - message: red(messages.getMessage('warning.TargetOrgIsExpired', [aliasOrUsername])), + message: chalk.red(messages.getMessage('warning.TargetOrgIsExpired', [aliasOrUsername])), }, ]); if (!continueAnswer.continue) { diff --git a/src/utils/output.ts b/src/utils/output.ts index 432a506b..a566e4be 100644 --- a/src/utils/output.ts +++ b/src/utils/output.ts @@ -6,12 +6,12 @@ */ import * as path from 'node:path'; -import { blue, bold } from 'chalk'; +import chalk from 'chalk'; import { StandardColors } from '@salesforce/sf-plugins-core'; import { FileResponse, FileResponseFailure, FileResponseSuccess } from '@salesforce/source-deploy-retrieve'; export function tableHeader(message: string): string { - return blue(bold(message)); + return chalk.blue.bold(message); } export function asRelativePaths( @@ -46,11 +46,11 @@ export const getFileResponseSuccessProps = ( successes.map((s) => ({ filePath: s.filePath, fullName: s.fullName, type: s.type, state: s.state })); export function error(message: string): string { - return StandardColors.error(bold(message)); + return StandardColors.error(chalk.bold(message)); } export function success(message: string): string { - return StandardColors.success(bold(message)); + return StandardColors.success(chalk.bold(message)); } export const check = StandardColors.success('✓'); diff --git a/src/utils/previewOutput.ts b/src/utils/previewOutput.ts index 348ddf8b..32c2dc52 100644 --- a/src/utils/previewOutput.ts +++ b/src/utils/previewOutput.ts @@ -4,10 +4,11 @@ * 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 * as path from 'node:path'; +import { isAbsolute, relative, resolve, dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; import { ux } from '@oclif/core'; import { StandardColors } from '@salesforce/sf-plugins-core'; -import { bold, dim } from 'chalk'; +import chalk from 'chalk'; import { Messages } from '@salesforce/core'; import { ComponentSet, @@ -18,12 +19,12 @@ import { MetadataType, SourceComponent, } from '@salesforce/source-deploy-retrieve'; -import { filePathsFromMetadataComponent } from '@salesforce/source-deploy-retrieve/lib/src/utils/filePathGenerator'; +import { filePathsFromMetadataComponent } from '@salesforce/source-deploy-retrieve/lib/src/utils/filePathGenerator.js'; import { SourceTracking } from '@salesforce/source-tracking'; -import { isSourceComponentWithXml } from './types'; +import { isSourceComponentWithXml } from './types.js'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'previewMessages'); type BaseOperation = 'deploy' | 'retrieve'; @@ -48,7 +49,7 @@ export interface PreviewResult { toRetrieve: PreviewFile[]; } -const ensureAbsolutePath = (f: string): string => (path.isAbsolute(f) ? f : path.resolve(f)); +const ensureAbsolutePath = (f: string): string => (isAbsolute(f) ? f : resolve(f)); // borrowed from STL populateFilesPaths. // TODO: this goes in SDR maybe? @@ -134,9 +135,9 @@ export const compileResults = ({ const someFile = c.xml ?? c.content; if (someFile) { return { - path: path.isAbsolute(someFile) ? someFile : path.resolve(someFile), + path: isAbsolute(someFile) ? someFile : resolve(someFile), // for cleaner output - projectRelativePath: path.relative(projectPath, someFile), + projectRelativePath: relative(projectPath, someFile), }; } return {}; @@ -183,7 +184,7 @@ export const compileResults = ({ const ignoredSourceComponents = resolvePaths([...(componentSet.forceIgnoredPaths ?? [])]).map( (resolved): PreviewFile => ({ ...resolved, - ...(resolved.path ? { projectRelativePath: path.relative(projectPath, resolved.path) } : {}), + ...(resolved.path ? { projectRelativePath: relative(projectPath, resolved.path) } : {}), conflict: false, ignored: true, }) @@ -201,10 +202,10 @@ export const compileResults = ({ const printDeployTable = (files: PreviewFile[]): void => { ux.log(); if (files.length === 0) { - ux.log(dim(messages.getMessage('deploy.none'))); + ux.log(chalk.dim(messages.getMessage('deploy.none'))); } else { // not using table title property to avoid all the ASCII art - ux.log(StandardColors.success(bold(messages.getMessage('deploy.header', [files.length])))); + ux.log(StandardColors.success(chalk.bold(messages.getMessage('deploy.header', [files.length])))); ux.table(files, columns); } }; @@ -212,10 +213,10 @@ const printDeployTable = (files: PreviewFile[]): void => { const printRetrieveTable = (files: PreviewFile[]): void => { ux.log(); if (files.length === 0) { - ux.log(dim(messages.getMessage('retrieve.none'))); + ux.log(chalk.dim(messages.getMessage('retrieve.none'))); } else { // not using table title property to avoid all the ASCII art - ux.log(StandardColors.success(bold(messages.getMessage('retrieve.header', [files.length])))); + ux.log(StandardColors.success(chalk.bold(messages.getMessage('retrieve.header', [files.length])))); ux.table(files, columns); } }; @@ -223,9 +224,9 @@ const printRetrieveTable = (files: PreviewFile[]): void => { const printDeleteTable = (files: PreviewFile[]): void => { ux.log(); if (files.length === 0) { - ux.log(dim(messages.getMessage('delete.none'))); + ux.log(chalk.dim(messages.getMessage('delete.none'))); } else { - ux.log(StandardColors.warning(bold(messages.getMessage('delete.header', [files.length])))); + ux.log(StandardColors.warning(chalk.bold(messages.getMessage('delete.header', [files.length])))); ux.table(files, columns); } }; @@ -233,9 +234,9 @@ const printDeleteTable = (files: PreviewFile[]): void => { const printConflictsTable = (files: PreviewFile[]): void => { ux.log(); if (files.length === 0) { - ux.log(dim(messages.getMessage('conflicts.none'))); + ux.log(chalk.dim(messages.getMessage('conflicts.none'))); } else { - ux.log(StandardColors.error(bold(messages.getMessage('conflicts.header', [files.length])))); + ux.log(StandardColors.error(chalk.bold(messages.getMessage('conflicts.header', [files.length])))); ux.table(files, columns, { sort: 'path' }); } }; @@ -243,9 +244,9 @@ const printConflictsTable = (files: PreviewFile[]): void => { export const printIgnoredTable = (files: PreviewFile[], baseOperation: BaseOperation): void => { ux.log(); if (files.length === 0) { - ux.log(dim(messages.getMessage('ignored.none'))); + ux.log(chalk.dim(messages.getMessage('ignored.none'))); } else { - ux.log(dim(messages.getMessage('ignored.header', [files.length, baseOperation]))); + ux.log(chalk.dim(messages.getMessage('ignored.header', [files.length, baseOperation]))); ux.table(files, columns, { sort: 'path' }); } }; @@ -265,4 +266,4 @@ export const printTables = (result: PreviewResult, baseOperation: BaseOperation) export const getConflictFiles = async (stl?: SourceTracking, ignore = false): Promise> => !stl || ignore ? new Set() - : new Set((await stl.getConflicts()).flatMap((conflict) => (conflict.filenames ?? []).map((f) => path.resolve(f)))); + : new Set((await stl.getConflicts()).flatMap((conflict) => (conflict.filenames ?? []).map((f) => resolve(f)))); diff --git a/src/utils/progressBar.ts b/src/utils/progressBar.ts index 6d189be7..1a2de233 100644 --- a/src/utils/progressBar.ts +++ b/src/utils/progressBar.ts @@ -4,13 +4,13 @@ * 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 { envVars as env, EnvironmentVariable } from '@salesforce/core'; +import { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { envVars as env, EnvironmentVariable, Messages } from '@salesforce/core'; import { MetadataApiDeploy, MetadataApiDeployStatus } from '@salesforce/source-deploy-retrieve'; -import { Messages } from '@salesforce/core'; import { Progress } from '@salesforce/sf-plugins-core'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); const mdTransferMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'metadata.transfer'); const showBar = Boolean( diff --git a/test/.eslintrc.cjs b/test/.eslintrc.cjs index fadf2c90..05cd7ab8 100644 --- a/test/.eslintrc.cjs +++ b/test/.eslintrc.cjs @@ -13,8 +13,6 @@ module.exports = { // Allow assert style expressions. i.e. expect(true).to.be.true 'no-unused-expressions': 'off', - // It is common for tests to stub out method. - // Return types are defined by the source code. Allows for quick overwrites. '@typescript-eslint/explicit-function-return-type': 'off', // Mocked out the methods that shouldn't do anything in the tests. diff --git a/test/commands/convert/source.test.ts b/test/commands/convert/source.test.ts index df6f07d8..794e0994 100644 --- a/test/commands/convert/source.test.ts +++ b/test/commands/convert/source.test.ts @@ -7,14 +7,14 @@ import { join, resolve, sep } from 'node:path'; import { ComponentSetBuilder, ComponentSetOptions, MetadataConverter } from '@salesforce/source-deploy-retrieve'; -import * as sinon from 'sinon'; +import sinon from 'sinon'; import { expect } from 'chai'; import { stubMethod } from '@salesforce/ts-sinon'; -import { MockTestOrgData, TestContext } from '@salesforce/core/lib/testSetup'; +import { MockTestOrgData, TestContext } from '@salesforce/core/lib/testSetup.js'; import { stubSfCommandUx } from '@salesforce/sf-plugins-core'; -import * as oclifUtils from '@oclif/core/lib/util'; +import oclifUtils from '@oclif/core/lib/util/fs.js'; import { SfProject } from '@salesforce/core'; -import { Source } from '../../../src/commands/project/convert/source'; +import { Source } from '../../../src/commands/project/convert/source.js'; describe('project convert source', () => { const $$ = new TestContext(); diff --git a/test/commands/delete/source.test.ts b/test/commands/delete/source.test.ts index c1ebbf55..4b77d2ea 100644 --- a/test/commands/delete/source.test.ts +++ b/test/commands/delete/source.test.ts @@ -5,8 +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 'node:fs'; -import * as sinon from 'sinon'; +import fs from 'node:fs'; +import sinon from 'sinon'; import { expect } from 'chai'; import { ComponentSet, @@ -17,13 +17,11 @@ import { import { Lifecycle, SfProject } from '@salesforce/core'; import { fromStub, stubInterface, stubMethod } from '@salesforce/ts-sinon'; import { Config } from '@oclif/core'; -import { MockTestOrgData, TestContext } from '@salesforce/core/lib/testSetup'; +import { MockTestOrgData, TestContext } from '@salesforce/core/lib/testSetup.js'; import { SfCommand } from '@salesforce/sf-plugins-core'; -import { ComponentProperties } from '@salesforce/source-deploy-retrieve/lib/src/resolve/sourceComponent'; -import { Source } from '../../../src/commands/project/delete/source'; -import { DeployCache } from '../../../src/utils/deployCache'; - -const fsPromises = fs.promises; +import { ComponentProperties } from '@salesforce/source-deploy-retrieve/lib/src/resolve/sourceComponent.js'; +import { Source } from '../../../src/commands/project/delete/source.js'; +import { DeployCache } from '../../../src/utils/deployCache.js'; export const exampleSourceComponent: ComponentProperties = { name: 'GeocodingService', @@ -151,7 +149,7 @@ describe('project delete source', () => { onError: () => {}, }); stubMethod($$.SANDBOX, cmd, 'handlePrompt').returns(confirm); - fsUnlink = stubMethod($$.SANDBOX, fsPromises, 'unlink').resolves(true); + fsUnlink = stubMethod($$.SANDBOX, fs.promises, 'unlink').resolves(true); stubMethod($$.SANDBOX, DeployCache, 'update').resolves(); return cmd.runIt(); diff --git a/test/commands/deploy.nut.ts b/test/commands/deploy.nut.ts index 4df08955..8e6ed314 100644 --- a/test/commands/deploy.nut.ts +++ b/test/commands/deploy.nut.ts @@ -6,10 +6,11 @@ */ import * as path from 'node:path'; +import { fileURLToPath } from 'node:url'; import { SourceTestkit } from '@salesforce/source-testkit'; -import { writeJson } from '../../src/commands/deploy'; -import { TestLevel } from '../../src/utils/types'; -import { MetadataDeployer } from '../../src/utils/metadataDeployer'; +import { writeJson } from '../../src/commands/deploy.js'; +import { TestLevel } from '../../src/utils/types.js'; +import { MetadataDeployer } from '../../src/utils/metadataDeployer.js'; describe('deploy NUTs', () => { let testkit: SourceTestkit; @@ -17,7 +18,7 @@ describe('deploy NUTs', () => { before(async () => { testkit = await SourceTestkit.create({ repository: 'https://github.com/trailheadapps/dreamhouse-lwc.git', - nut: __filename, + nut: fileURLToPath(import.meta.url), }); }); diff --git a/test/commands/deploy.test.ts b/test/commands/deploy.test.ts index c4afa3c1..5de53559 100644 --- a/test/commands/deploy.test.ts +++ b/test/commands/deploy.test.ts @@ -9,7 +9,7 @@ import { expect } from 'chai'; import { Hook } from '@oclif/core'; import { Deployer } from '@salesforce/sf-plugins-core'; -import Deploy from '../../src/commands/deploy'; +import Deploy from '../../src/commands/deploy.js'; import Result = Hook.Result; class TestDeploy extends Deploy { diff --git a/test/commands/deploy/metadata.nut.ts b/test/commands/deploy/metadata.nut.ts index 487d2aca..4760d0a1 100644 --- a/test/commands/deploy/metadata.nut.ts +++ b/test/commands/deploy/metadata.nut.ts @@ -5,6 +5,7 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ +import { fileURLToPath } from 'node:url'; import { SourceTestkit } from '@salesforce/source-testkit'; describe('deploy metadata NUTs', () => { @@ -13,7 +14,7 @@ describe('deploy metadata NUTs', () => { before(async () => { testkit = await SourceTestkit.create({ repository: 'https://github.com/trailheadapps/dreamhouse-lwc.git', - nut: __filename, + nut: fileURLToPath(import.meta.url), }); }); diff --git a/test/commands/deploy/metadata/cancel.nut.ts b/test/commands/deploy/metadata/cancel.nut.ts index 7a419e61..f875d007 100644 --- a/test/commands/deploy/metadata/cancel.nut.ts +++ b/test/commands/deploy/metadata/cancel.nut.ts @@ -11,8 +11,8 @@ import { strict as assert } from 'node:assert'; import { TestSession, execCmd } from '@salesforce/cli-plugins-testkit'; import { expect } from 'chai'; import { RequestStatus } from '@salesforce/source-deploy-retrieve'; -import { DeployResultJson } from '../../../../src/utils/types'; -import { CachedOptions } from '../../../../src/utils/deploy'; +import { DeployResultJson } from '../../../../src/utils/types.js'; +import { CachedOptions } from '../../../../src/utils/deploy.js'; function readDeployCache(sessionDir: string): Record { const contents = fs.readFileSync(path.join(sessionDir, '.sf', 'deploy-cache.json'), 'utf-8'); diff --git a/test/commands/deploy/metadata/quick.nut.ts b/test/commands/deploy/metadata/quick.nut.ts index 7bad5ebe..d7636c33 100644 --- a/test/commands/deploy/metadata/quick.nut.ts +++ b/test/commands/deploy/metadata/quick.nut.ts @@ -5,10 +5,11 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ +import { fileURLToPath } from 'node:url'; import { SourceTestkit } from '@salesforce/source-testkit'; import { assert, config } from 'chai'; import { execCmd } from '@salesforce/cli-plugins-testkit'; -import { DeployResultJson } from '../../../../src/utils/types'; +import { DeployResultJson } from '../../../../src/utils/types.js'; config.truncateThreshold = 0; describe('deploy metadata quick NUTs', () => { @@ -17,7 +18,7 @@ describe('deploy metadata quick NUTs', () => { before(async () => { testkit = await SourceTestkit.create({ repository: 'https://github.com/salesforcecli/sample-project-multiple-packages.git', - nut: __filename, + nut: fileURLToPath(import.meta.url), }); }); diff --git a/test/commands/deploy/metadata/report-mdapi.nut.ts b/test/commands/deploy/metadata/report-mdapi.nut.ts index 8c0cbfff..d838828b 100644 --- a/test/commands/deploy/metadata/report-mdapi.nut.ts +++ b/test/commands/deploy/metadata/report-mdapi.nut.ts @@ -7,10 +7,11 @@ import { unlinkSync, existsSync } from 'node:fs'; import { join, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; import { SourceTestkit } from '@salesforce/source-testkit'; import { assert, expect } from 'chai'; import { RequestStatus } from '@salesforce/source-deploy-retrieve'; -import { DeployResultJson } from '../../../../src/utils/types'; +import { DeployResultJson } from '../../../../src/utils/types.js'; describe('[project deploy report] NUTs with metadata-dir', () => { let testkit: SourceTestkit; @@ -20,7 +21,7 @@ describe('[project deploy report] NUTs with metadata-dir', () => { before(async () => { testkit = await SourceTestkit.create({ repository: 'https://github.com/salesforcecli/sample-project-multiple-packages.git', - nut: __filename, + nut: fileURLToPath(import.meta.url), scratchOrgs: [{ duration: 1, alias: orgAlias, config: join('config', 'project-scratch-def.json') }], }); await testkit.convert({ diff --git a/test/commands/deploy/metadata/report.nut.ts b/test/commands/deploy/metadata/report.nut.ts index f21f11a0..a4ce3620 100644 --- a/test/commands/deploy/metadata/report.nut.ts +++ b/test/commands/deploy/metadata/report.nut.ts @@ -7,10 +7,11 @@ import { unlinkSync, existsSync } from 'node:fs'; import { join, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; import { SourceTestkit } from '@salesforce/source-testkit'; import { assert, isObject } from '@salesforce/ts-types'; import { expect } from 'chai'; -import { DeployResultJson } from '../../../../src/utils/types'; +import { DeployResultJson } from '../../../../src/utils/types.js'; describe('[project deploy report] NUTs with source-dir', () => { let testkit: SourceTestkit; @@ -20,7 +21,7 @@ describe('[project deploy report] NUTs with source-dir', () => { before(async () => { testkit = await SourceTestkit.create({ repository: 'https://github.com/salesforcecli/sample-project-multiple-packages.git', - nut: __filename, + nut: fileURLToPath(import.meta.url), scratchOrgs: [{ duration: 1, alias: orgAlias, config: join('config', 'project-scratch-def.json') }], }); }); diff --git a/test/commands/deploy/metadata/resume.nut.ts b/test/commands/deploy/metadata/resume.nut.ts index 0864350d..8afa3c6f 100644 --- a/test/commands/deploy/metadata/resume.nut.ts +++ b/test/commands/deploy/metadata/resume.nut.ts @@ -6,13 +6,14 @@ */ import * as fs from 'node:fs'; +import { fileURLToPath } from 'node:url'; import * as path from 'node:path'; import { strict as assert } from 'node:assert'; import { SourceTestkit } from '@salesforce/source-testkit'; import { expect } from 'chai'; import { RequestStatus } from '@salesforce/source-deploy-retrieve'; -import { DeployResultJson } from '../../../../src/utils/types'; -import { CachedOptions } from '../../../../src/utils/deploy'; +import { DeployResultJson } from '../../../../src/utils/types.js'; +import { CachedOptions } from '../../../../src/utils/deploy.js'; function readDeployCache(projectDir: string): Record { // source-testkit doesn't expose the session, so we'll go up 1 level from the project to get to it @@ -26,7 +27,7 @@ describe('[project deploy resume] NUTs', () => { before(async () => { testkit = await SourceTestkit.create({ repository: 'https://github.com/salesforcecli/sample-project-multiple-packages.git', - nut: __filename, + nut: fileURLToPath(import.meta.url), }); }); diff --git a/test/commands/deploy/metadata/validate.nut.ts b/test/commands/deploy/metadata/validate.nut.ts index 83042650..5fa12870 100644 --- a/test/commands/deploy/metadata/validate.nut.ts +++ b/test/commands/deploy/metadata/validate.nut.ts @@ -6,11 +6,12 @@ */ import * as path from 'node:path'; +import { fileURLToPath } from 'node:url'; import { SourceTestkit } from '@salesforce/source-testkit'; import { isObject } from '@salesforce/ts-types'; import { assert, expect } from 'chai'; import { execCmd } from '@salesforce/cli-plugins-testkit'; -import { DeployResultJson } from '../../../../src/utils/types'; +import { DeployResultJson } from '../../../../src/utils/types.js'; describe('deploy metadata validate NUTs', () => { let testkit: SourceTestkit; @@ -18,7 +19,7 @@ describe('deploy metadata validate NUTs', () => { before(async () => { testkit = await SourceTestkit.create({ repository: 'https://github.com/salesforcecli/sample-project-multiple-packages.git', - nut: __filename, + nut: fileURLToPath(import.meta.url), }); }); diff --git a/test/commands/deploy/start.test.ts b/test/commands/deploy/start.test.ts index 21fecb60..39b2d801 100644 --- a/test/commands/deploy/start.test.ts +++ b/test/commands/deploy/start.test.ts @@ -5,13 +5,15 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ +import { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; import { expect } from 'chai'; -import { MockTestOrgData, TestContext } from '@salesforce/core/lib/testSetup'; +import { MockTestOrgData, TestContext } from '@salesforce/core/lib/testSetup.js'; import { stubSfCommandUx } from '@salesforce/sf-plugins-core'; import { Messages } from '@salesforce/core'; -import DeployMetadata from '../../../src/commands/project/deploy/start'; +import DeployMetadata from '../../../src/commands/project/deploy/start.js'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata'); describe('project deploy start', () => { diff --git a/test/commands/retrieve/start.test.ts b/test/commands/retrieve/start.test.ts index ce7f2ce7..f71211bf 100644 --- a/test/commands/retrieve/start.test.ts +++ b/test/commands/retrieve/start.test.ts @@ -5,8 +5,9 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import * as path from 'node:path'; -import * as sinon from 'sinon'; +import { dirname, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import sinon from 'sinon'; import { expect } from 'chai'; import { ComponentLike, @@ -20,15 +21,15 @@ import { import { Messages, SfProject } from '@salesforce/core'; import { stubMethod } from '@salesforce/ts-sinon'; import { stubSfCommandUx, stubSpinner, stubUx } from '@salesforce/sf-plugins-core'; -import { MockTestOrgData, TestContext } from '@salesforce/core/lib/testSetup'; -import * as oclifUtils from '@oclif/core/lib/util'; -import { RetrieveResultFormatter } from '../../../src/formatters/retrieveResultFormatter'; -import { getRetrieveResult } from '../../utils/retrieveResponse'; -import { RetrieveResultJson } from '../../../src/utils/types'; -import { exampleSourceComponent } from '../../utils/testConsts'; -import RetrieveMetadata from '../../../src/commands/project/retrieve/start'; +import { MockTestOrgData, TestContext } from '@salesforce/core/lib/testSetup.js'; +import oclifUtils from '@oclif/core/lib/util/fs.js'; +import { RetrieveResultFormatter } from '../../../src/formatters/retrieveResultFormatter.js'; +import { getRetrieveResult } from '../../utils/retrieveResponse.js'; +import { RetrieveResultJson } from '../../../src/utils/types.js'; +import { exampleSourceComponent } from '../../utils/testConsts.js'; +import RetrieveMetadata from '../../../src/commands/project/retrieve/start.js'; -Messages.importMessagesDirectory(__dirname); +Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'retrieve.start'); describe('project retrieve start', () => { @@ -151,7 +152,7 @@ describe('project retrieve start', () => { metadataEntries: ['ApexClass:MyClass'], }, }); - ensureRetrieveArgs({ output: path.resolve(sourcepath[0]), format: 'source' }); + ensureRetrieveArgs({ output: resolve(sourcepath[0]), format: 'source' }); expect(renameStub.calledOnce).to.be.true; }); diff --git a/test/nuts/convert/mdapi.nut.ts b/test/nuts/convert/mdapi.nut.ts index 7f571ad0..f130e6df 100644 --- a/test/nuts/convert/mdapi.nut.ts +++ b/test/nuts/convert/mdapi.nut.ts @@ -9,7 +9,7 @@ import * as path from 'node:path'; import { expect, assert } from 'chai'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; import { ComponentSet, SourceComponent } from '@salesforce/source-deploy-retrieve'; -import { ConvertMdapiJson } from '../../../src/utils/types'; +import { ConvertMdapiJson } from '../../../src/utils/types.js'; let session: TestSession; diff --git a/test/nuts/convert/source.nut.ts b/test/nuts/convert/source.nut.ts index 12af8012..fe9c1e2b 100644 --- a/test/nuts/convert/source.nut.ts +++ b/test/nuts/convert/source.nut.ts @@ -8,7 +8,7 @@ import * as fs from 'node:fs'; import * as path from 'node:path'; import { expect } from 'chai'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; -import { ConvertResultJson } from '../../../src/utils/types'; +import { ConvertResultJson } from '../../../src/utils/types.js'; let session: TestSession; diff --git a/test/nuts/delete/source.nut.ts b/test/nuts/delete/source.nut.ts index 020f764d..f1d3c2fe 100644 --- a/test/nuts/delete/source.nut.ts +++ b/test/nuts/delete/source.nut.ts @@ -6,6 +6,7 @@ */ import * as fs from 'node:fs'; +import { fileURLToPath } from 'node:url'; import * as path from 'node:path'; import { expect } from 'chai'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; @@ -13,7 +14,7 @@ import { SourceTestkit } from '@salesforce/source-testkit'; import { FileResponse } from '@salesforce/source-deploy-retrieve'; import { AuthInfo, Connection } from '@salesforce/core'; import { ensureArray } from '@salesforce/ts-types'; -import { DeleteSourceJson } from '../../../src/utils/types'; +import { DeleteSourceJson } from '../../../src/utils/types.js'; const isNameObsolete = async (username: string, memberType: string, memberName: string): Promise => { const connection = await Connection.create({ @@ -109,7 +110,7 @@ describe('project delete source NUTs', () => { before(async () => { testkit = await SourceTestkit.create({ - nut: __filename, + nut: fileURLToPath(import.meta.url), repository: 'https://github.com/trailheadapps/dreamhouse-lwc.git', }); execCmd('project:deploy:start --source-dir force-app', { ensureExitCode: 0 }); diff --git a/test/nuts/deploy/formatter.nut.ts b/test/nuts/deploy/formatter.nut.ts index 3e4653b4..c3c889a8 100644 --- a/test/nuts/deploy/formatter.nut.ts +++ b/test/nuts/deploy/formatter.nut.ts @@ -9,7 +9,7 @@ import * as path from 'node:path'; import { EOL } from 'node:os'; import { expect } from 'chai'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; -import { DeployResultJson } from '../../../src/utils/types'; +import { DeployResultJson } from '../../../src/utils/types.js'; describe('Deploy Formatter', () => { let testkit: TestSession; diff --git a/test/nuts/deploy/noProject.nut.ts b/test/nuts/deploy/noProject.nut.ts index 4340e8e0..1a23b487 100644 --- a/test/nuts/deploy/noProject.nut.ts +++ b/test/nuts/deploy/noProject.nut.ts @@ -8,7 +8,7 @@ import { join } from 'node:path'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; import { expect } from 'chai'; -import { DeployResultJson } from '../../../src/utils/types'; +import { DeployResultJson } from '../../../src/utils/types.js'; describe('deploy mdapi format without project', () => { let session: TestSession; diff --git a/test/nuts/deploy/noTracking.nut.ts b/test/nuts/deploy/noTracking.nut.ts index 4b8e26ab..cffa4bd2 100644 --- a/test/nuts/deploy/noTracking.nut.ts +++ b/test/nuts/deploy/noTracking.nut.ts @@ -8,7 +8,7 @@ import { join } from 'node:path'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; import { expect } from 'chai'; -import { DeployResultJson } from '../../../src/utils/types'; +import { DeployResultJson } from '../../../src/utils/types.js'; describe('deploy mdapi format without tracking', () => { let session: TestSession; diff --git a/test/nuts/destructive/destructiveChanges.nut.ts b/test/nuts/destructive/destructiveChanges.nut.ts index 053f2c5a..4f528df2 100644 --- a/test/nuts/destructive/destructiveChanges.nut.ts +++ b/test/nuts/destructive/destructiveChanges.nut.ts @@ -6,6 +6,7 @@ */ import * as path from 'node:path'; +import { fileURLToPath } from 'node:url'; import { expect } from 'chai'; import { execCmd } from '@salesforce/cli-plugins-testkit'; import { SourceTestkit } from '@salesforce/source-testkit'; @@ -47,7 +48,7 @@ describe('project deploy start --destructive NUTs', () => { before(async () => { testkit = await SourceTestkit.create({ - nut: __filename, + nut: fileURLToPath(import.meta.url), repository: 'https://github.com/trailheadapps/dreamhouse-lwc.git', }); execCmd('project:deploy:start --source-dir force-app', { ensureExitCode: 0 }); diff --git a/test/nuts/digitalExperienceBundle/constants.ts b/test/nuts/digitalExperienceBundle/constants.ts index f8d69d17..93b83730 100644 --- a/test/nuts/digitalExperienceBundle/constants.ts +++ b/test/nuts/digitalExperienceBundle/constants.ts @@ -6,9 +6,9 @@ */ import { join } from 'node:path'; -import { TestSessionOptions } from '@salesforce/cli-plugins-testkit/lib/testSession'; +import { TestSessionOptions } from '@salesforce/cli-plugins-testkit/lib/testSession.js'; import { registry } from '@salesforce/source-deploy-retrieve'; -import { META_XML_SUFFIX } from '@salesforce/source-deploy-retrieve/lib/src/common'; +import { META_XML_SUFFIX } from '@salesforce/source-deploy-retrieve/lib/src/common/constants.js'; import { assert } from 'chai'; export const SOURCE_BASE_RELATIVE_PATH = join('force-app', 'main', 'default'); diff --git a/test/nuts/digitalExperienceBundle/deb.manifest.nut.ts b/test/nuts/digitalExperienceBundle/deb.manifest.nut.ts index 454016e7..18cb0c63 100644 --- a/test/nuts/digitalExperienceBundle/deb.manifest.nut.ts +++ b/test/nuts/digitalExperienceBundle/deb.manifest.nut.ts @@ -9,8 +9,8 @@ import { join } from 'node:path'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; import { assert, expect } from 'chai'; import { beforeEach } from 'mocha'; -import { DeployResultJson, RetrieveResultJson } from '../../../src/utils/types'; -import { DEBS_RELATIVE_PATH, FULL_NAMES, METADATA, STORE, TEST_SESSION_OPTIONS, TYPES } from './constants'; +import { DeployResultJson, RetrieveResultJson } from '../../../src/utils/types.js'; +import { DEBS_RELATIVE_PATH, FULL_NAMES, METADATA, STORE, TEST_SESSION_OPTIONS, TYPES } from './constants.js'; import { assertAllDEBAndTheirDECounts, assertDECountOfSingleDEB, @@ -21,7 +21,7 @@ import { assertViewHome, createDocumentDetailPageAInLocal, deleteLocalSource, -} from './helper'; +} from './helper.js'; describe('deb -- manifest option', () => { let session: TestSession; diff --git a/test/nuts/digitalExperienceBundle/deb.metadata.nut.ts b/test/nuts/digitalExperienceBundle/deb.metadata.nut.ts index ba865201..13234ae3 100644 --- a/test/nuts/digitalExperienceBundle/deb.metadata.nut.ts +++ b/test/nuts/digitalExperienceBundle/deb.metadata.nut.ts @@ -7,9 +7,9 @@ import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; import { assert } from 'chai'; import { beforeEach } from 'mocha'; -import { DeleteSourceJson, DeployResultJson, RetrieveResultJson } from '../../../src/utils/types'; +import { DeleteSourceJson, DeployResultJson, RetrieveResultJson } from '../../../src/utils/types.js'; -import { DEBS_RELATIVE_PATH, FULL_NAMES, METADATA, TEST_SESSION_OPTIONS, TYPES } from './constants'; +import { DEBS_RELATIVE_PATH, FULL_NAMES, METADATA, TEST_SESSION_OPTIONS, TYPES } from './constants.js'; import { assertAllDEBAndTheirDECounts, assertDECountOfSingleDEB, @@ -21,7 +21,7 @@ import { createDocumentDetailPageAInLocal, deleteLocalSource, metadataToArray, -} from './helper'; +} from './helper.js'; describe('deb -- metadata option', () => { let session: TestSession; diff --git a/test/nuts/digitalExperienceBundle/deb.sourcepath.nut.ts b/test/nuts/digitalExperienceBundle/deb.sourcepath.nut.ts index c2648877..c55711c4 100644 --- a/test/nuts/digitalExperienceBundle/deb.sourcepath.nut.ts +++ b/test/nuts/digitalExperienceBundle/deb.sourcepath.nut.ts @@ -7,7 +7,7 @@ // import * as fs from 'fs'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; import { assert } from 'chai'; -import { DeleteSourceJson, DeployResultJson, RetrieveResultJson } from '../../../src/utils/types'; +import { DeleteSourceJson, DeployResultJson, RetrieveResultJson } from '../../../src/utils/types.js'; import { DEB_A_RELATIVE_PATH, @@ -16,7 +16,7 @@ import { FULL_NAMES, TEST_SESSION_OPTIONS, TYPES, -} from './constants'; +} from './constants.js'; import { assertAllDEBAndTheirDECounts, assertDocumentDetailPageA, @@ -25,7 +25,7 @@ import { assertViewHome, metadataToArray, createDocumentDetailPageAInLocal, -} from './helper'; +} from './helper.js'; describe('deb -- sourcepath option', () => { let session: TestSession; diff --git a/test/nuts/digitalExperienceBundle/deb.tracking.nut.ts b/test/nuts/digitalExperienceBundle/deb.tracking.nut.ts index df3972cb..89e11a8e 100644 --- a/test/nuts/digitalExperienceBundle/deb.tracking.nut.ts +++ b/test/nuts/digitalExperienceBundle/deb.tracking.nut.ts @@ -8,13 +8,10 @@ import * as fs from 'node:fs'; import { join } from 'node:path'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; import { assert, expect } from 'chai'; -import { PreviewResult } from '../../../src/utils/previewOutput'; -import { DeleteTrackingResult } from '../../../src/commands/project/delete/tracking'; -import { DeployResultJson, RetrieveResultJson } from '../../../src/utils/types'; - -// import { SourceTrackingClearResult } from '../../../src/commands/force/source/tracking/clear'; -// import { PullResponse } from '../../../src/formatters/source/pullFormatter'; -import { FILE_RELATIVE_PATHS, TEST_SESSION_OPTIONS, TYPES } from './constants'; +import { PreviewResult } from '../../../src/utils/previewOutput.js'; +import { DeleteTrackingResult } from '../../../src/commands/project/delete/tracking.js'; +import { DeployResultJson, RetrieveResultJson } from '../../../src/utils/types.js'; +import { FILE_RELATIVE_PATHS, TEST_SESSION_OPTIONS, TYPES } from './constants.js'; import { assertAllDEBAndTheirDECounts, assertDEBMeta, @@ -27,7 +24,7 @@ import { createDocumentDetailPageAInLocal, deleteDocumentDetailPageAInLocal, previewFileResponseToFileResponse, -} from './helper'; +} from './helper.js'; describe('deb -- tracking/push/pull', () => { let session: TestSession; diff --git a/test/nuts/digitalExperienceBundle/helper.ts b/test/nuts/digitalExperienceBundle/helper.ts index 683766b6..e4104371 100644 --- a/test/nuts/digitalExperienceBundle/helper.ts +++ b/test/nuts/digitalExperienceBundle/helper.ts @@ -10,8 +10,8 @@ import { FileResponse } from '@salesforce/source-deploy-retrieve'; import { assert, expect } from 'chai'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; import { AuthInfo, Connection } from '@salesforce/core'; -import { PreviewFile, PreviewResult } from '../../../src/utils/previewOutput'; -import { DIR_RELATIVE_PATHS, FILE_RELATIVE_PATHS, FULL_NAMES, STORE, TYPES } from './constants'; +import { PreviewFile, PreviewResult } from '../../../src/utils/previewOutput.js'; +import { DIR_RELATIVE_PATHS, FILE_RELATIVE_PATHS, FULL_NAMES, STORE, TYPES } from './constants.js'; type CustomFileResponses = Array>; diff --git a/test/nuts/generateNuts.ts b/test/nuts/generateNuts.ts index cc45ab6f..9ec137f3 100644 --- a/test/nuts/generateNuts.ts +++ b/test/nuts/generateNuts.ts @@ -7,13 +7,14 @@ import * as path from 'node:path'; import * as fs from 'node:fs'; -import { RepoConfig, TEST_REPOS_MAP } from './testMatrix'; +import { fileURLToPath } from 'node:url'; +import { RepoConfig, TEST_REPOS_MAP } from './testMatrix.js'; const SEED_FILTER = process.env.PLUGIN_DEPLOY_RETRIEVE_SEED_FILTER ?? ''; const SEED_EXCLUDE = process.env.PLUGIN_DEPLOY_RETRIEVE_SEED_EXCLUDE; function getSeedFiles(): string[] { - const seedDir = path.join(__dirname, 'seeds'); + const seedDir = path.join(path.dirname(fileURLToPath(import.meta.url)), 'seeds'); const files = fs.readdirSync(seedDir); return files .filter((f) => f.endsWith('.seed.ts')) @@ -39,7 +40,7 @@ function generateNut(generatedDir: string, seedName: string, seedContents: strin } function generateNuts(): void { - const generatedDir = path.resolve(__dirname, 'generated'); + const generatedDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), 'generated'); fs.rmSync(generatedDir, { recursive: true, force: true }); fs.mkdirSync(generatedDir, { recursive: true }); const seeds = getSeedFiles(); diff --git a/test/nuts/list/ignored.nut.ts b/test/nuts/list/ignored.nut.ts index 5688d0fe..c29548f5 100644 --- a/test/nuts/list/ignored.nut.ts +++ b/test/nuts/list/ignored.nut.ts @@ -9,7 +9,7 @@ import * as os from 'node:os'; import * as path from 'node:path'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; import { expect } from 'chai'; -import { SourceIgnoredResults } from '../../../src/commands/project/list/ignored'; +import { SourceIgnoredResults } from '../../../src/commands/project/list/ignored.js'; describe('project:list:ignored', () => { let session: TestSession; diff --git a/test/nuts/retrieve/customLabels.nut.ts b/test/nuts/retrieve/customLabels.nut.ts index 2ce755ac..9de8d0ce 100644 --- a/test/nuts/retrieve/customLabels.nut.ts +++ b/test/nuts/retrieve/customLabels.nut.ts @@ -11,7 +11,7 @@ import { expect } from 'chai'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; import { AuthInfo, Connection } from '@salesforce/core'; -import { DeployResultJson, RetrieveResultJson } from '../../../src/utils/types'; +import { DeployResultJson, RetrieveResultJson } from '../../../src/utils/types.js'; let session: TestSession; diff --git a/test/nuts/retrieve/metadata.nut.ts b/test/nuts/retrieve/metadata.nut.ts index bb51e45f..8b2bad21 100644 --- a/test/nuts/retrieve/metadata.nut.ts +++ b/test/nuts/retrieve/metadata.nut.ts @@ -7,6 +7,7 @@ import * as path from 'node:path'; import * as fs from 'node:fs'; +import { fileURLToPath } from 'node:url'; import { execCmd } from '@salesforce/cli-plugins-testkit'; import { SourceTestkit } from '@salesforce/source-testkit'; import { expect } from 'chai'; @@ -19,7 +20,7 @@ describe('retrieve metadata NUTs', () => { before(async () => { testkit = await SourceTestkit.create({ repository: 'https://github.com/trailheadapps/dreamhouse-lwc.git', - nut: __filename, + nut: fileURLToPath(import.meta.url), }); await testkit.addTestFiles(); await testkit.deploy({ args: '--source-dir force-app', exitCode: 0 }); diff --git a/test/nuts/retrieve/noProject.ts b/test/nuts/retrieve/noProject.ts index f7595c75..a0af05c4 100644 --- a/test/nuts/retrieve/noProject.ts +++ b/test/nuts/retrieve/noProject.ts @@ -9,7 +9,7 @@ import * as fs from 'node:fs'; import { join } from 'node:path'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; import { assert, expect } from 'chai'; -import { RetrieveResultJson } from '../../../src/utils/types'; +import { RetrieveResultJson } from '../../../src/utils/types.js'; const packageXml = ` diff --git a/test/nuts/retrieve/noTracking.ts b/test/nuts/retrieve/noTracking.ts index 1ba35fdd..f6fc4739 100644 --- a/test/nuts/retrieve/noTracking.ts +++ b/test/nuts/retrieve/noTracking.ts @@ -9,7 +9,7 @@ import * as fs from 'node:fs'; import { join } from 'node:path'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; import { assert, expect } from 'chai'; -import { RetrieveResultJson } from '../../../src/utils/types'; +import { RetrieveResultJson } from '../../../src/utils/types.js'; const packageXml = ` diff --git a/test/nuts/retrieve/partialBundleDelete.nut.ts b/test/nuts/retrieve/partialBundleDelete.nut.ts index ebd2b285..48581af0 100644 --- a/test/nuts/retrieve/partialBundleDelete.nut.ts +++ b/test/nuts/retrieve/partialBundleDelete.nut.ts @@ -6,7 +6,7 @@ */ import * as path from 'node:path'; import * as fs from 'node:fs'; -import * as sinon from 'sinon'; +import sinon from 'sinon'; import { assert, expect } from 'chai'; import { TestSession, TestProject, execCmd } from '@salesforce/cli-plugins-testkit'; import { stubSfCommandUx } from '@salesforce/sf-plugins-core'; @@ -19,8 +19,8 @@ import { MetadataApiRetrieve, RetrieveSetOptions, } from '@salesforce/source-deploy-retrieve'; -import { RetrieveResultJson } from '../../../src/utils/types'; -import RetrieveMetadata from '../../../src/commands/project/retrieve/start'; +import { RetrieveResultJson } from '../../../src/utils/types.js'; +import RetrieveMetadata from '../../../src/commands/project/retrieve/start.js'; describe('Partial Bundle Delete Retrieves', () => { let session: TestSession; diff --git a/test/nuts/seeds/deploy.metadata.manifest.seed.ts b/test/nuts/seeds/deploy.metadata.manifest.seed.ts index d3d1c828..6fddc705 100644 --- a/test/nuts/seeds/deploy.metadata.manifest.seed.ts +++ b/test/nuts/seeds/deploy.metadata.manifest.seed.ts @@ -6,10 +6,11 @@ */ import * as path from 'node:path'; +import { fileURLToPath } from 'node:url'; import { SourceTestkit } from '@salesforce/source-testkit'; import { assert } from 'chai'; -import { TEST_REPOS_MAP } from '../testMatrix'; -import { DeployResultJson } from '../../../src/utils/types'; +import { TEST_REPOS_MAP } from '../testMatrix.js'; +import { DeployResultJson } from '../../../src/utils/types.js'; // DO NOT TOUCH. generateNuts.ts will insert these values const REPO = TEST_REPOS_MAP.get('%REPO_URL%'); @@ -20,7 +21,7 @@ context('deploy metadata --manifest NUTs [name: %REPO_NAME%]', () => { before(async () => { testkit = await SourceTestkit.create({ repository: REPO.gitUrl, - nut: __filename, + nut: fileURLToPath(import.meta.url), }); // some deploys reference other metadata not included in the deploy, if it's not already in the org it will fail const args = testkit.packageNames.map((p) => `--source-dir ${p}`).join(' '); diff --git a/test/nuts/seeds/deploy.metadata.metadata-dir.seed.ts b/test/nuts/seeds/deploy.metadata.metadata-dir.seed.ts index 880bc610..feaab68a 100644 --- a/test/nuts/seeds/deploy.metadata.metadata-dir.seed.ts +++ b/test/nuts/seeds/deploy.metadata.metadata-dir.seed.ts @@ -6,12 +6,13 @@ */ import * as path from 'node:path'; +import { fileURLToPath } from 'node:url'; import { SourceTestkit } from '@salesforce/source-testkit'; import { RequestStatus } from '@salesforce/source-deploy-retrieve'; import { JsonMap } from '@salesforce/ts-types'; import { assert } from 'chai'; -import { TEST_REPOS_MAP } from '../testMatrix'; -import { DeployResultJson } from '../../../src/utils/types'; +import { TEST_REPOS_MAP } from '../testMatrix.js'; +import { DeployResultJson } from '../../../src/utils/types.js'; // DO NOT TOUCH. generateNuts.ts will insert these values const REPO = TEST_REPOS_MAP.get('%REPO_URL%'); @@ -22,7 +23,7 @@ context('deploy metadata --metadata-dir NUTs [name: %REPO_NAME%]', () => { before(async () => { testkit = await SourceTestkit.create({ repository: REPO.gitUrl, - nut: __filename, + nut: fileURLToPath(import.meta.url), }); }); diff --git a/test/nuts/seeds/deploy.metadata.metadata.seed.ts b/test/nuts/seeds/deploy.metadata.metadata.seed.ts index 13a7eea2..166866a0 100644 --- a/test/nuts/seeds/deploy.metadata.metadata.seed.ts +++ b/test/nuts/seeds/deploy.metadata.metadata.seed.ts @@ -5,10 +5,11 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ +import { fileURLToPath } from 'node:url'; import { SourceTestkit } from '@salesforce/source-testkit'; import { assert } from 'chai'; -import { TEST_REPOS_MAP } from '../testMatrix'; -import { DeployResultJson } from '../../../src/utils/types'; +import { TEST_REPOS_MAP } from '../testMatrix.js'; +import { DeployResultJson } from '../../../src/utils/types.js'; // DO NOT TOUCH. generateNuts.ts will insert these values const REPO = TEST_REPOS_MAP.get('%REPO_URL%'); @@ -19,7 +20,7 @@ context('deploy metadata --metadata NUTs [name: %REPO_NAME%]', () => { before(async () => { testkit = await SourceTestkit.create({ repository: REPO.gitUrl, - nut: __filename, + nut: fileURLToPath(import.meta.url), }); // some deploys reference other metadata not included in the deploy, if it's not already in the org it will fail const args = testkit.packageNames.map((p) => `--source-dir ${p}`).join(' '); diff --git a/test/nuts/seeds/deploy.metadata.source-dir.seed.ts b/test/nuts/seeds/deploy.metadata.source-dir.seed.ts index 11ee4081..afc3ef5f 100644 --- a/test/nuts/seeds/deploy.metadata.source-dir.seed.ts +++ b/test/nuts/seeds/deploy.metadata.source-dir.seed.ts @@ -6,10 +6,11 @@ */ import * as path from 'node:path'; +import { fileURLToPath } from 'node:url'; import { assert } from 'chai'; import { SourceTestkit } from '@salesforce/source-testkit'; -import { TEST_REPOS_MAP } from '../testMatrix'; -import { DeployResultJson } from '../../../src/utils/types'; +import { TEST_REPOS_MAP } from '../testMatrix.js'; +import { DeployResultJson } from '../../../src/utils/types.js'; // DO NOT TOUCH. generateNuts.ts will insert these values const REPO = TEST_REPOS_MAP.get('%REPO_URL%'); @@ -20,7 +21,7 @@ context('deploy metadata --source-dir NUTs [name: %REPO_NAME%]', () => { before(async () => { testkit = await SourceTestkit.create({ repository: REPO.gitUrl, - nut: __filename, + nut: fileURLToPath(import.meta.url), }); }); diff --git a/test/nuts/seeds/deploy.metadata.test-level.seed.ts b/test/nuts/seeds/deploy.metadata.test-level.seed.ts index 5991839d..494d511d 100644 --- a/test/nuts/seeds/deploy.metadata.test-level.seed.ts +++ b/test/nuts/seeds/deploy.metadata.test-level.seed.ts @@ -7,10 +7,11 @@ import * as fs from 'node:fs'; import * as path from 'node:path'; +import { fileURLToPath } from 'node:url'; import { SourceTestkit } from '@salesforce/source-testkit'; import { assert, expect } from 'chai'; import { execCmd } from '@salesforce/cli-plugins-testkit'; -import { TEST_REPOS_MAP } from '../testMatrix'; +import { TEST_REPOS_MAP } from '../testMatrix.js'; // DO NOT TOUCH. generateNuts.ts will insert these values const REPO = TEST_REPOS_MAP.get('%REPO_URL%'); @@ -22,7 +23,7 @@ context('deploy metadata --test-level NUTs [name: %REPO_NAME%]', () => { before(async () => { testkit = await SourceTestkit.create({ repository: REPO.gitUrl, - nut: __filename, + nut: fileURLToPath(import.meta.url), }); const args = testkit.packageNames.map((p) => `--source-dir ${p}`).join(' '); diff --git a/test/nuts/specialTypes/customLabels.nut.ts b/test/nuts/specialTypes/customLabels.nut.ts index d3a0c059..146b7c02 100644 --- a/test/nuts/specialTypes/customLabels.nut.ts +++ b/test/nuts/specialTypes/customLabels.nut.ts @@ -6,6 +6,7 @@ */ import * as path from 'node:path'; +import { fileURLToPath } from 'node:url'; import { SourceTestkit } from '@salesforce/source-testkit'; context('deploy metadata CustomLabels NUTs', () => { @@ -14,7 +15,7 @@ context('deploy metadata CustomLabels NUTs', () => { before(async () => { testkit = await SourceTestkit.create({ repository: 'https://github.com/salesforcecli/sample-project-multiple-packages.git', - nut: __filename, + nut: fileURLToPath(import.meta.url), }); }); diff --git a/test/nuts/specialTypes/folderTypes.nut.ts b/test/nuts/specialTypes/folderTypes.nut.ts index ce216670..9706506a 100644 --- a/test/nuts/specialTypes/folderTypes.nut.ts +++ b/test/nuts/specialTypes/folderTypes.nut.ts @@ -9,7 +9,7 @@ import * as path from 'node:path'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; import { assert, expect } from 'chai'; import { FileResponse } from '@salesforce/source-deploy-retrieve'; -import { DeployResultJson, RetrieveResultJson } from '../../../src/utils/types'; +import { DeployResultJson, RetrieveResultJson } from '../../../src/utils/types.js'; describe('metadata types that go in folders', () => { let session: TestSession; diff --git a/test/nuts/specialTypes/nestedLwc.nut.ts b/test/nuts/specialTypes/nestedLwc.nut.ts index 17f863b4..fc3bec5a 100644 --- a/test/nuts/specialTypes/nestedLwc.nut.ts +++ b/test/nuts/specialTypes/nestedLwc.nut.ts @@ -8,7 +8,7 @@ import * as path from 'node:path'; import { expect } from 'chai'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; -import { DeployResultJson } from '../../../src/utils/types'; +import { DeployResultJson } from '../../../src/utils/types.js'; describe('Nested LWCs', () => { let session: TestSession; diff --git a/test/nuts/specialTypes/territory2.nut.ts b/test/nuts/specialTypes/territory2.nut.ts index 39bad588..f57af331 100644 --- a/test/nuts/specialTypes/territory2.nut.ts +++ b/test/nuts/specialTypes/territory2.nut.ts @@ -8,7 +8,7 @@ import * as fs from 'node:fs'; import * as path from 'node:path'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; import { expect } from 'chai'; -import { DeployResultJson, RetrieveResultJson } from '../../../src/utils/types'; +import { DeployResultJson, RetrieveResultJson } from '../../../src/utils/types.js'; describe('territories', () => { let session: TestSession; diff --git a/test/nuts/specialTypes/translation.nut.ts b/test/nuts/specialTypes/translation.nut.ts index 09758e65..835df2fb 100644 --- a/test/nuts/specialTypes/translation.nut.ts +++ b/test/nuts/specialTypes/translation.nut.ts @@ -8,8 +8,8 @@ import * as fs from 'node:fs'; import * as path from 'node:path'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; import { expect } from 'chai'; -import { PreviewResult } from '../../../src/utils/previewOutput'; -import { DeployResultJson, RetrieveResultJson } from '../../../src/utils/types'; +import { PreviewResult } from '../../../src/utils/previewOutput.js'; +import { DeployResultJson, RetrieveResultJson } from '../../../src/utils/types.js'; describe('translations', () => { let session: TestSession; diff --git a/test/nuts/tracking/basics.nut.ts b/test/nuts/tracking/basics.nut.ts index d0bf10ee..eecea14c 100644 --- a/test/nuts/tracking/basics.nut.ts +++ b/test/nuts/tracking/basics.nut.ts @@ -10,14 +10,16 @@ import * as fs from 'node:fs'; import { expect, assert } from 'chai'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; import { ComponentStatus } from '@salesforce/source-deploy-retrieve'; -import { StatusResult } from '@salesforce/plugin-source/lib/formatters/source/statusFormatter'; -import { DeployResultJson, RetrieveResultJson, isSdrFailure } from '../../../src/utils/types'; -import { PreviewResult } from '../../../src/utils/previewOutput'; -import { eBikesDeployResultCount } from './constants'; +import { StatusResult } from '@salesforce/plugin-source/lib/formatters/source/statusFormatter.js'; +import { DeployResultJson, RetrieveResultJson, isSdrFailure } from '../../../src/utils/types.js'; +import { PreviewResult } from '../../../src/utils/previewOutput.js'; +import { eBikesDeployResultCount } from './constants.js'; + const filterIgnored = (r: StatusResult): boolean => r.ignored !== true; -let session: TestSession; describe('end-to-end-test for tracking with an org (single packageDir)', () => { + let session: TestSession; + before(async () => { session = await TestSession.create({ project: { diff --git a/test/nuts/tracking/conflicts.nut.ts b/test/nuts/tracking/conflicts.nut.ts index dbd91027..6639fb6b 100644 --- a/test/nuts/tracking/conflicts.nut.ts +++ b/test/nuts/tracking/conflicts.nut.ts @@ -12,10 +12,10 @@ import { expect } from 'chai'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; import { AuthInfo, Connection } from '@salesforce/core'; import { ComponentStatus } from '@salesforce/source-deploy-retrieve'; -import { StatusResult } from '@salesforce/plugin-source/lib/formatters/source/statusFormatter'; -import { DeployResultJson, RetrieveResultJson } from '../../../src/utils/types'; -import { PreviewResult } from '../../../src/utils/previewOutput'; -import { eBikesDeployResultCount } from './constants'; +import { StatusResult } from '@salesforce/plugin-source/lib/formatters/source/statusFormatter.js'; +import { DeployResultJson, RetrieveResultJson } from '../../../src/utils/types.js'; +import { PreviewResult } from '../../../src/utils/previewOutput.js'; +import { eBikesDeployResultCount } from './constants.js'; let session: TestSession; describe('conflict detection and resolution', () => { diff --git a/test/nuts/tracking/deleteResetTracking.nut.ts b/test/nuts/tracking/deleteResetTracking.nut.ts index 0b66862f..b65e2ca9 100644 --- a/test/nuts/tracking/deleteResetTracking.nut.ts +++ b/test/nuts/tracking/deleteResetTracking.nut.ts @@ -10,7 +10,7 @@ import * as fs from 'node:fs'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; import { expect } from 'chai'; import { AuthInfo, Connection } from '@salesforce/core'; -import { DeleteTrackingResult } from '../../../src/commands/project/delete/tracking'; +import { DeleteTrackingResult } from '../../../src/commands/project/delete/tracking.js'; let session: TestSession; let orgId: string; diff --git a/test/nuts/tracking/forceIgnore.nut.ts b/test/nuts/tracking/forceIgnore.nut.ts index baa88934..464a408c 100644 --- a/test/nuts/tracking/forceIgnore.nut.ts +++ b/test/nuts/tracking/forceIgnore.nut.ts @@ -12,9 +12,9 @@ import { expect } from 'chai'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; import { AuthInfo, Connection } from '@salesforce/core'; import { ComponentStatus } from '@salesforce/source-deploy-retrieve'; -import { StatusResult } from '@salesforce/plugin-source/lib/formatters/source/statusFormatter'; -import { DeployResultJson, RetrieveResultJson } from '../../../src/utils/types'; -import { PreviewResult } from '../../../src/utils/previewOutput'; +import { StatusResult } from '@salesforce/plugin-source/lib/formatters/source/statusFormatter.js'; +import { DeployResultJson, RetrieveResultJson } from '../../../src/utils/types.js'; +import { PreviewResult } from '../../../src/utils/previewOutput.js'; let session: TestSession; // leave this in posix path mode since it's used in forceignore diff --git a/test/nuts/tracking/lwc.nut.ts b/test/nuts/tracking/lwc.nut.ts index 9795ff10..a525498a 100644 --- a/test/nuts/tracking/lwc.nut.ts +++ b/test/nuts/tracking/lwc.nut.ts @@ -9,10 +9,10 @@ import * as path from 'node:path'; import * as fs from 'node:fs'; import { assert, expect } from 'chai'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; -import { StatusResult } from '@salesforce/plugin-source/lib/formatters/source/statusFormatter'; +import { StatusResult } from '@salesforce/plugin-source/lib/formatters/source/statusFormatter.js'; import { ComponentStatus } from '@salesforce/source-deploy-retrieve'; -import { PreviewResult } from '../../../src/utils/previewOutput'; -import { DeployResultJson } from '../../../src/utils/types'; +import { PreviewResult } from '../../../src/utils/previewOutput.js'; +import { DeployResultJson } from '../../../src/utils/types.js'; let session: TestSession; let cssPathAbsolute: string; diff --git a/test/nuts/tracking/mpd-non-sequential.nut.ts b/test/nuts/tracking/mpd-non-sequential.nut.ts index efe0519b..9b693e83 100644 --- a/test/nuts/tracking/mpd-non-sequential.nut.ts +++ b/test/nuts/tracking/mpd-non-sequential.nut.ts @@ -10,7 +10,7 @@ import { AuthInfo, Connection } from '@salesforce/core'; import { expect } from 'chai'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; import { assert } from '@salesforce/ts-types'; -import { DeployResultJson } from '../../../src/utils/types'; +import { DeployResultJson } from '../../../src/utils/types.js'; let session: TestSession; let conn: Connection; diff --git a/test/nuts/tracking/remoteChanges.nut.ts b/test/nuts/tracking/remoteChanges.nut.ts index 2c6f6425..89fa06e8 100644 --- a/test/nuts/tracking/remoteChanges.nut.ts +++ b/test/nuts/tracking/remoteChanges.nut.ts @@ -12,10 +12,10 @@ import { expect, assert } from 'chai'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; import { AuthInfo, Connection } from '@salesforce/core'; import { ComponentStatus, FileResponse } from '@salesforce/source-deploy-retrieve'; -import { StatusResult } from '@salesforce/plugin-source/lib/formatters/source/statusFormatter'; -import { PreviewResult, PreviewFile } from '../../../src/utils/previewOutput'; -import { DeployResultJson, RetrieveResultJson } from '../../../src/utils/types'; -import { eBikesDeployResultCount } from './constants'; +import { StatusResult } from '@salesforce/plugin-source/lib/formatters/source/statusFormatter.js'; +import { PreviewResult, PreviewFile } from '../../../src/utils/previewOutput.js'; +import { DeployResultJson, RetrieveResultJson } from '../../../src/utils/types.js'; +import { eBikesDeployResultCount } from './constants.js'; let session: TestSession; let conn: Connection; diff --git a/test/tsconfig.json b/test/tsconfig.json index 779a1b5f..a5f451cf 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "@salesforce/dev-config/tsconfig-test-strict", + "extends": "@salesforce/dev-config/tsconfig-test-strict-esm", "include": ["./**/*.ts"], "compilerOptions": { "skipLibCheck": true diff --git a/test/utils/coverage.test.ts b/test/utils/coverage.test.ts index 7a761c26..a6d0bcf1 100644 --- a/test/utils/coverage.test.ts +++ b/test/utils/coverage.test.ts @@ -8,7 +8,7 @@ import { expect } from 'chai'; import { ApexTestResultOutcome } from '@salesforce/apex-node'; import { StandardColors } from '@salesforce/sf-plugins-core'; -import { coverageOutput, getCoveragePct, mapTestResults } from '../../src/utils/coverage'; +import { coverageOutput, getCoveragePct, mapTestResults } from '../../src/utils/coverage.js'; // methods are mutating the object instead of returning new ones function getSampleTestResult() { diff --git a/test/utils/deploy.test.ts b/test/utils/deploy.test.ts index a67dc434..ec75d535 100644 --- a/test/utils/deploy.test.ts +++ b/test/utils/deploy.test.ts @@ -7,11 +7,11 @@ import { DeployResult, RequestStatus } from '@salesforce/source-deploy-retrieve'; import { expect } from 'chai'; -import * as sinon from 'sinon'; +import sinon from 'sinon'; import { ConfigAggregator } from '@salesforce/core'; -import { determineExitCode, resolveApi, validateTests } from '../../src/utils/deploy'; -import { API, TestLevel } from '../../src/utils/types'; -import { ConfigVars } from '../../src/configMeta'; +import { determineExitCode, resolveApi, validateTests } from '../../src/utils/deploy.js'; +import { API, TestLevel } from '../../src/utils/types.js'; +import { ConfigVars } from '../../src/configMeta.js'; describe('deploy utils', () => { describe('validateTests', () => { diff --git a/test/utils/errorCodes.test.ts b/test/utils/errorCodes.test.ts index 690cd35f..3ebfa9bf 100644 --- a/test/utils/errorCodes.test.ts +++ b/test/utils/errorCodes.test.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 { expect } from 'chai'; -import { DEPLOY_STATUS_CODES_DESCRIPTIONS, DEPLOY_STATUS_CODES } from '../../src/utils/errorCodes'; +import { DEPLOY_STATUS_CODES_DESCRIPTIONS, DEPLOY_STATUS_CODES } from '../../src/utils/errorCodes.js'; describe('error codes', () => { describe('help descriptions DEPLOY_STATUS_CODES_DESCRIPTIONS', () => { diff --git a/test/utils/flags.test.ts b/test/utils/flags.test.ts index 58364dbc..76e2530d 100644 --- a/test/utils/flags.test.ts +++ b/test/utils/flags.test.ts @@ -5,19 +5,19 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import * as fs from 'node:fs'; +import fs from 'node:fs'; import * as path from 'node:path'; import { assert, expect } from 'chai'; import { Parser } from '@oclif/core'; -import * as sinon from 'sinon'; +import sinon from 'sinon'; import { testLevelFlag, fileOrDirFlag, ensuredDirFlag, zipFileFlag, DEFAULT_ZIP_FILE_NAME, -} from '../../src/utils/flags'; -import { TestLevel } from '../../src/utils/types'; +} from '../../src/utils/flags.js'; +import { TestLevel } from '../../src/utils/types.js'; const STAT = { // 'BigIntStats': atimeNs, mtimeNs, ctimeNs, birthtimeNs diff --git a/test/utils/manifestCache.test.ts b/test/utils/manifestCache.test.ts index 9a4d1d27..be5b3e19 100644 --- a/test/utils/manifestCache.test.ts +++ b/test/utils/manifestCache.test.ts @@ -7,8 +7,8 @@ import * as fs from 'node:fs'; import { expect } from 'chai'; import { ComponentSet } from '@salesforce/source-deploy-retrieve'; -import * as sinon from 'sinon'; -import { writeManifest } from '../../src/utils/manifestCache'; +import sinon from 'sinon'; +import { writeManifest } from '../../src/utils/manifestCache.js'; describe('manifest cache', () => { let sandbox: sinon.SinonSandbox; diff --git a/test/utils/output.test.ts b/test/utils/output.test.ts index 84fbf062..bb9fff4f 100644 --- a/test/utils/output.test.ts +++ b/test/utils/output.test.ts @@ -6,12 +6,12 @@ */ import * as path from 'node:path'; import { assert, expect, config } from 'chai'; -import * as sinon from 'sinon'; +import sinon from 'sinon'; import { DeployResult } from '@salesforce/source-deploy-retrieve'; import { ux } from '@oclif/core'; -import { getCoverageFormattersOptions } from '../../src/utils/coverage'; -import { DeployResultFormatter } from '../../src/formatters/deployResultFormatter'; -import { getDeployResult } from './deployResponses'; +import { getCoverageFormattersOptions } from '../../src/utils/coverage.js'; +import { DeployResultFormatter } from '../../src/formatters/deployResultFormatter.js'; +import { getDeployResult } from './deployResponses.js'; config.truncateThreshold = 0; diff --git a/test/utils/promiseQueue.test.ts b/test/utils/promiseQueue.test.ts index c67d49c3..b4d24229 100644 --- a/test/utils/promiseQueue.test.ts +++ b/test/utils/promiseQueue.test.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 { expect } from 'chai'; -import { promisesQueue } from '../../src/utils/promiseQueue'; +import { promisesQueue } from '../../src/utils/promiseQueue.js'; describe('promisesQueue', () => { const numberResolver = (n: number) => Promise.resolve(n); it('should handle 0 queue entries', async () => { diff --git a/test/utils/testConsts.ts b/test/utils/testConsts.ts index 17396a6a..96745e89 100644 --- a/test/utils/testConsts.ts +++ b/test/utils/testConsts.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 { ComponentProperties } from '@salesforce/source-deploy-retrieve/lib/src/resolve/sourceComponent'; +import { ComponentProperties } from '@salesforce/source-deploy-retrieve/lib/src/resolve/sourceComponent.js'; export const exampleSourceComponent: ComponentProperties = { name: 'GeocodingService', diff --git a/test/utils/types.test.ts b/test/utils/types.test.ts index 19fa572f..94e62c26 100644 --- a/test/utils/types.test.ts +++ b/test/utils/types.test.ts @@ -7,7 +7,7 @@ import { expect, config } from 'chai'; import { SourceComponent, RegistryAccess } from '@salesforce/source-deploy-retrieve'; -import { isSourceComponent, isSourceComponentWithXml } from '../../src/utils/types'; +import { isSourceComponent, isSourceComponentWithXml } from '../../src/utils/types.js'; config.truncateThreshold = 0; diff --git a/tsconfig.json b/tsconfig.json index 776b408c..1fa9d631 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,14 +1,10 @@ { - "extends": "@salesforce/dev-config/tsconfig-strict", + "extends": "@salesforce/dev-config/tsconfig-strict-esm", "compilerOptions": { "outDir": "lib", "rootDir": "src", "skipLibCheck": true, - "baseUrl": ".", - "paths": { - "@salesforce/core": ["node_modules/@salesforce/core"], - "@salesforce/source-deploy-retrieve": ["node_modules/@salesforce/source-deploy-retrieve"] - } + "baseUrl": "." }, "include": ["./src/**/*.ts"] } diff --git a/yarn.lock b/yarn.lock index fef85aeb..7f69e976 100644 --- a/yarn.lock +++ b/yarn.lock @@ -170,7 +170,7 @@ core-js-pure "^3.30.2" regenerator-runtime "^0.13.11" -"@babel/runtime@^7.12.5", "@babel/runtime@^7.21.0": +"@babel/runtime@^7.12.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.5.tgz#8564dd588182ce0047d55d7a75e93921107b57ec" integrity sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA== @@ -746,7 +746,7 @@ read-package-json-fast "^3.0.0" which "^3.0.0" -"@oclif/core@^2.11.10", "@oclif/core@^2.11.4", "@oclif/core@^2.15.0": +"@oclif/core@^2.15.0": version "2.15.0" resolved "https://registry.yarnpkg.com/@oclif/core/-/core-2.15.0.tgz#f27797b30a77d13279fba88c1698fc34a0bd0d2a" integrity sha512-fNEMG5DzJHhYmI3MgpByTvltBOMyFcnRIUMxbiz2ai8rhaYgaTHMG3Q38HcosfIvtw9nCjxpcQtC8MN8QtVCcA== @@ -780,10 +780,10 @@ wordwrap "^1.0.0" wrap-ansi "^7.0.0" -"@oclif/core@^3.5.0": - version "3.10.8" - resolved "https://registry.yarnpkg.com/@oclif/core/-/core-3.10.8.tgz#8a855841107576b88a2ebe2e20e6e0d7ee885713" - integrity sha512-DRiEiXUvijq/1dXL80/sFGdhTjejFiUzxURW7N310TEKlONujas66KhLATfF/nG3mICqTCU0f9B+VNfLtZoGqw== +"@oclif/core@^3.0.0", "@oclif/core@^3.0.4", "@oclif/core@^3.10.8", "@oclif/core@^3.11.0", "@oclif/core@^3.3.1": + version "3.11.0" + resolved "https://registry.yarnpkg.com/@oclif/core/-/core-3.11.0.tgz#dadfac39238af3b717e33b910dde1f1f0fd2105e" + integrity sha512-9A2LhDQATf1vrRqPoO0gGuBrey0jt3kDafC+eazxTNWV2EvlEpgY2587iyrxPK/fL2xg7f+0mtxYaSHdO2k8eg== dependencies: ansi-escapes "^4.3.2" ansi-styles "^4.3.0" @@ -812,12 +812,12 @@ wordwrap "^1.0.0" wrap-ansi "^7.0.0" -"@oclif/plugin-command-snapshot@^4.0.16": - version "4.0.16" - resolved "https://registry.yarnpkg.com/@oclif/plugin-command-snapshot/-/plugin-command-snapshot-4.0.16.tgz#50ab214246088d16c86af7ae81b3c5084478571e" - integrity sha512-J4q2e7l7jNxzuS4qvmLPALoFftsRXczE54I2qnFpSp7YC9RyS9cUcBdoXklOsX2yZckj234o5gmGdkAmBAAqHA== +"@oclif/plugin-command-snapshot@^5.0.2": + version "5.0.2" + resolved "https://registry.yarnpkg.com/@oclif/plugin-command-snapshot/-/plugin-command-snapshot-5.0.2.tgz#41e88d245e1ffb1822b4cb127df39f61672cf2b1" + integrity sha512-4Aun0P/K9uVC5JLmG968OJhDT5HMiOs4mmw7A2cWmf1Paw8zp4xZ40PvYOOKN86gaKukKFDTQ1sDuLBzqNhZow== dependencies: - "@oclif/core" "^3.5.0" + "@oclif/core" "^3.10.8" "@types/lodash.difference" "^4.5.8" chalk "^5.3.0" just-diff "^5.2.0" @@ -843,18 +843,16 @@ chalk "^4" fast-levenshtein "^3.0.0" -"@oclif/plugin-warn-if-update-available@^2.0.44": - version "2.0.49" - resolved "https://registry.yarnpkg.com/@oclif/plugin-warn-if-update-available/-/plugin-warn-if-update-available-2.0.49.tgz#1f2923ecf9153d885be0123f965072ee55635a29" - integrity sha512-9Xc54BTDD5JFgMvMZLYnvi+xrhFg4dkn2AYRunZ5KNC0kejn5zUzxCy7x6hSdg5hop2TkeEnJYIQVMVzSNoX3A== +"@oclif/plugin-warn-if-update-available@^3.0.0": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@oclif/plugin-warn-if-update-available/-/plugin-warn-if-update-available-3.0.2.tgz#76d02069c0d5545b5000660460edb6085272cbcd" + integrity sha512-dUXfRNFtnezS4uqQ+Ap4qb6UP0DWExTvoqghNvvGTIN4PEgfYHogvBORn+rFnDXXE8kgZFuqP4ZQJRP9NyLhOA== dependencies: - "@oclif/core" "^2.11.10" - chalk "^4.1.0" + "@oclif/core" "^3.3.1" + chalk "^5.3.0" debug "^4.1.0" - fs-extra "^9.0.1" http-call "^5.2.2" - lodash "^4.17.21" - semver "^7.5.4" + lodash.template "^4.5.0" "@octokit/auth-token@^2.4.4": version "2.5.0" @@ -975,40 +973,25 @@ istanbul-lib-report "^3.0.1" istanbul-reports "^3.1.6" -"@salesforce/cli-plugins-testkit@^4.4.8": - version "4.4.12" - resolved "https://registry.yarnpkg.com/@salesforce/cli-plugins-testkit/-/cli-plugins-testkit-4.4.12.tgz#425132a4cd49b5aacb979df07af987b338ec00ae" - integrity sha512-k0jJYqB0PazmVyhNBau8FtJDa3+4EbhvD8F3u+yZ71jjPkp7YLKqtxfs1y7P3LCrmtel8JE3faHTfMaahdK96Q== - dependencies: - "@salesforce/core" "^5.3.10" - "@salesforce/kit" "^3.0.15" - "@salesforce/ts-types" "^2.0.6" - "@types/shelljs" "^0.8.14" - debug "^4.3.1" - jszip "^3.10.1" - shelljs "^0.8.4" - strip-ansi "6.0.1" - ts-retry-promise "^0.7.1" - -"@salesforce/cli-plugins-testkit@^5.0.2": - version "5.0.2" - resolved "https://registry.yarnpkg.com/@salesforce/cli-plugins-testkit/-/cli-plugins-testkit-5.0.2.tgz#be35c0b449223ee50e395aba7e1b4ccb1a5e49d7" - integrity sha512-piHWPnbkwytudtc3VntfyECa3NzxngecM7/hka2rooLWs7NZCLcJoAEvYDWNRGgNa0Yw6gefBJVNivoVpfNSKQ== +"@salesforce/cli-plugins-testkit@^5.0.4": + version "5.0.4" + resolved "https://registry.yarnpkg.com/@salesforce/cli-plugins-testkit/-/cli-plugins-testkit-5.0.4.tgz#523c459f43822d7b24bff5117aeda7f77ed5e26c" + integrity sha512-8pquViVBCd5sF6nBXgLgwymEBE6pSAS376R9qq7rxuV+PSFCC5bnzQaKm2ugY+s5vXKNcV6WcmBHNCQnGv+M7Q== dependencies: - "@salesforce/core" "^5.3.17" + "@salesforce/core" "^5.3.20" "@salesforce/kit" "^3.0.15" "@salesforce/ts-types" "^2.0.6" - "@types/shelljs" "^0.8.14" + "@types/shelljs" "^0.8.15" debug "^4.3.1" jszip "^3.10.1" shelljs "^0.8.4" strip-ansi "6.0.1" ts-retry-promise "^0.7.1" -"@salesforce/core@^5.3.1", "@salesforce/core@^5.3.10", "@salesforce/core@^5.3.14", "@salesforce/core@^5.3.17", "@salesforce/core@^5.3.18": - version "5.3.18" - resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-5.3.18.tgz#c0b7b59fbef7f0689e88968c614dd1ae2c420f02" - integrity sha512-/Ag7elFngTT13PRblSPJPB2Q+xk3jR2SX8bYa83fcQljVF7ApGB5qtFpauXmUv8lgRnN+F01HNqM16iszAMP9w== +"@salesforce/core@^5.3.1", "@salesforce/core@^5.3.17", "@salesforce/core@^5.3.18", "@salesforce/core@^5.3.20": + version "5.3.20" + resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-5.3.20.tgz#4e934d4551bb70423cb1c4115615bc41cffca41e" + integrity sha512-y+O6O2c8OYFDrAy2qsG+pAcNxoyL14nmBXcBRRcYA7Huj8ikK+aLJK84PuVAYdQz+hNwImQF+69IWtDkpK4Irg== dependencies: "@salesforce/kit" "^3.0.15" "@salesforce/schemas" "^1.6.1" @@ -1029,21 +1012,21 @@ semver "^7.5.4" ts-retry-promise "^0.7.1" -"@salesforce/dev-config@^4.0.1": +"@salesforce/dev-config@^4.1.0": version "4.1.0" resolved "https://registry.yarnpkg.com/@salesforce/dev-config/-/dev-config-4.1.0.tgz#e529576466d074e7a5f1441236510fef123da01e" integrity sha512-2iDDepiIwjXHS5IVY7pwv8jMo4xWosJ7p/UTj+lllpB/gnJiYLhjJPE4Z3FCGFKyvfg5jGaimCd8Ca6bLGsCQA== -"@salesforce/dev-scripts@^6.0.3": - version "6.0.3" - resolved "https://registry.yarnpkg.com/@salesforce/dev-scripts/-/dev-scripts-6.0.3.tgz#6cf4504fd0ec8b4685e729b26685eed60f9c8b26" - integrity sha512-WLl1N07oNeRywdypwUrebX/kCkSm3IzmAQpUt4q4Sk8r4vTWv5b6F0pHLv0pGS8/QWNJT7xWGZDF1lgJBHOsmA== +"@salesforce/dev-scripts@^6.0.4": + version "6.0.4" + resolved "https://registry.yarnpkg.com/@salesforce/dev-scripts/-/dev-scripts-6.0.4.tgz#0043b8ef4b970f8c2f945cc74eada3b1db52fa9a" + integrity sha512-/kdl99bHaNeCoVwfeQhIaKzorcmgpe/nZhlT7ru+If+18NRvBgW5OGmh++Q/NsraaYbsQ/0cDcGNz1dnQ11weA== dependencies: "@commitlint/cli" "^17.1.2" "@commitlint/config-conventional" "^17.1.0" - "@salesforce/dev-config" "^4.0.1" + "@salesforce/dev-config" "^4.1.0" "@salesforce/prettier-config" "^0.0.3" - "@types/chai" "^4.2.11" + "@types/chai" "^4.3.9" "@types/mocha" "^10.0.3" "@types/node" "^18" "@types/sinon" "^10.0.20" @@ -1065,7 +1048,7 @@ typescript "^4.9.5" wireit "^0.14.1" -"@salesforce/kit@^3.0.13", "@salesforce/kit@^3.0.14", "@salesforce/kit@^3.0.15": +"@salesforce/kit@^3.0.13", "@salesforce/kit@^3.0.15": version "3.0.15" resolved "https://registry.yarnpkg.com/@salesforce/kit/-/kit-3.0.15.tgz#713df3f5767f874c70a2e731c7cb5ba677989559" integrity sha512-XkA8jsuLvVnyP460dAbU3pBFP2IkmmmsVxMQVifcKKbNWaIBbZBzAfj+vdaQfnvZyflLhsrFT3q2xkb0vHouPg== @@ -1087,18 +1070,18 @@ handlebars "^4.7.8" tslib "^2" -"@salesforce/plugin-source@^2.11.0": - version "2.11.0" - resolved "https://registry.yarnpkg.com/@salesforce/plugin-source/-/plugin-source-2.11.0.tgz#078d1f66378f1e73fafc34da005c44745adcbdac" - integrity sha512-sT0Tj1V0U7xqZ90OfS4jmigv8yLgPuTq5yYAGKnKhqYgsZ0afmR9Z6GBn2j439peaV+KElNjUEg1nLro3fWQpA== +"@salesforce/plugin-source@^2.11.3": + version "2.11.3" + resolved "https://registry.yarnpkg.com/@salesforce/plugin-source/-/plugin-source-2.11.3.tgz#2f559a9588cee5514bb74d1159df215313cf11d4" + integrity sha512-44F5W0/1laIJtbmwv/oYh7+8+pL51EXX1uy/UlxQxF4+pv1z0gGLNjbyQW/Iw6a2nt/4WLcCxHIG9h9+p4b2gA== dependencies: "@oclif/core" "^2.15.0" "@salesforce/apex-node" "^2.1.0" - "@salesforce/core" "^5.3.18" + "@salesforce/core" "^5.3.20" "@salesforce/kit" "^3.0.15" "@salesforce/sf-plugins-core" "^3.1.25" - "@salesforce/source-deploy-retrieve" "^9.8.4" - "@salesforce/source-tracking" "^4.3.0" + "@salesforce/source-deploy-retrieve" "^9.8.5" + "@salesforce/source-tracking" "^4.4.0" chalk "^4.1.2" got "^11.8.6" proxy-agent "^6.3.1" @@ -1114,7 +1097,7 @@ resolved "https://registry.yarnpkg.com/@salesforce/schemas/-/schemas-1.6.1.tgz#7d1c071e1e509ca9d2d8a6e48ac7447dd67a534d" integrity sha512-eVy947ZMxCJReKJdgfddUIsBIbPTa/i8RwQGwxq4/ss38H5sLOAeSTaun9V7HpJ1hkpDznWKfgzYvjsst9K6ig== -"@salesforce/sf-plugins-core@^3.1.22", "@salesforce/sf-plugins-core@^3.1.25", "@salesforce/sf-plugins-core@^3.1.28": +"@salesforce/sf-plugins-core@^3.1.25", "@salesforce/sf-plugins-core@^3.1.28": version "3.1.28" resolved "https://registry.yarnpkg.com/@salesforce/sf-plugins-core/-/sf-plugins-core-3.1.28.tgz#7714c5b1ce26052bb5cbc524c5990bc52eb601cd" integrity sha512-Z1fVS/pqLCX/3ESrjvtzyuvDFwXu8qxjqs5Gana0J7RKkhDL0f7w+pz3DR1/YfQPeHK8rk9pFDOKB3tOnXf9Lw== @@ -1126,10 +1109,23 @@ chalk "^4" inquirer "^8.2.5" -"@salesforce/source-deploy-retrieve@^9.8.3", "@salesforce/source-deploy-retrieve@^9.8.4": - version "9.8.4" - resolved "https://registry.yarnpkg.com/@salesforce/source-deploy-retrieve/-/source-deploy-retrieve-9.8.4.tgz#e6d21d8f2e0b44fae242e31ef8b4f31991a07deb" - integrity sha512-/g/WkUFCogCANnKkeHmQyXpAbIy+A2htEYliVaoxg3UccDqHCZd5Gmlk6Gwsd03YsLAt249bay5mAokD7y39sQ== +"@salesforce/sf-plugins-core@^4.1.2": + version "4.1.2" + resolved "https://registry.yarnpkg.com/@salesforce/sf-plugins-core/-/sf-plugins-core-4.1.2.tgz#0e03ca012828de8dc30ffccd7ca289c6aa703a2d" + integrity sha512-mjb9mLyfLos4Y+/qhko2mrKgwxMzWipAnR/Inuu9cuw4dK9sCgHl79t4zU+6FyNT2T14Q9md/hDXN5QNg0eGJA== + dependencies: + "@oclif/core" "^3.0.0" + "@salesforce/core" "^5.3.1" + "@salesforce/kit" "^3.0.13" + "@salesforce/ts-types" "^2.0.7" + "@types/inquirer" "^8.2.3" + chalk "^4" + inquirer "^8.2.5" + +"@salesforce/source-deploy-retrieve@^9.8.5", "@salesforce/source-deploy-retrieve@^9.8.6": + version "9.8.6" + resolved "https://registry.yarnpkg.com/@salesforce/source-deploy-retrieve/-/source-deploy-retrieve-9.8.6.tgz#3b9240bc776a44bc740e59acbd86da3072f3efdc" + integrity sha512-avsfR/hB54ZdSOI3bYdUqRPQbjExKEwAZfsIbs6N1vtidPrc1TSHvloCZhY0Clou+vLgjabIHEHVyQJUln0FKA== dependencies: "@salesforce/core" "^5.3.17" "@salesforce/kit" "^3.0.15" @@ -1144,15 +1140,15 @@ minimatch "^5.1.6" proxy-agent "^6.3.1" -"@salesforce/source-testkit@^2.1.62": - version "2.1.62" - resolved "https://registry.yarnpkg.com/@salesforce/source-testkit/-/source-testkit-2.1.62.tgz#502e8a90c0359e886a1654beb0567861d4ad0173" - integrity sha512-c7Qd7hHOd+x3V0sFzOSgPbQFBrMX3uZNbxJ1HMIa/xrEalm2tkk+cdH0HiXgpoqDZQUvn80hdeDoOdOFNYUzsw== +"@salesforce/source-testkit@^2.1.65": + version "2.1.65" + resolved "https://registry.yarnpkg.com/@salesforce/source-testkit/-/source-testkit-2.1.65.tgz#4cec6ab2921431791cff4185ad2ee2b9de99776a" + integrity sha512-9UljnUaebMzLpBb92ilQsaewsoxtncJduxwwCCbi52VejE47BauLNGBOM2B3kF8pw81bNrV94qZwqOlHUG6xsQ== dependencies: - "@salesforce/cli-plugins-testkit" "^4.4.8" - "@salesforce/core" "^5.3.14" - "@salesforce/kit" "^3.0.14" - "@salesforce/source-deploy-retrieve" "^9.8.3" + "@salesforce/cli-plugins-testkit" "^5.0.4" + "@salesforce/core" "^5.3.20" + "@salesforce/kit" "^3.0.15" + "@salesforce/source-deploy-retrieve" "^9.8.6" "@salesforce/ts-types" "^2.0.9" archiver "^5.3.2" chai-each "^0.0.1" @@ -1160,21 +1156,22 @@ shelljs "^0.8.4" sinon "^10.0.0" -"@salesforce/source-tracking@^4.3.0": - version "4.3.0" - resolved "https://registry.yarnpkg.com/@salesforce/source-tracking/-/source-tracking-4.3.0.tgz#dc281b260d28f831042475468aa0b0350d7328a7" - integrity sha512-1ysyxU7lLi2pQNgEQbLpfSciLhsYrYwVu+VEq+tCXzm0TfmyscT1a1vcyykOzztpWMtKNQW/HdJEaAPBPd9FVg== +"@salesforce/source-tracking@^4.4.0", "@salesforce/source-tracking@^4.4.3": + version "4.4.3" + resolved "https://registry.yarnpkg.com/@salesforce/source-tracking/-/source-tracking-4.4.3.tgz#3e83f5afd3935650e358410122cf1611f859d1b3" + integrity sha512-98XA3NKDmIauloX8PUQZ/fjDm/Llm8fW7Ro4U+VwF8zLFi4LQX3+hZPNlY1LesT08YfWmcLMtgek4ycDIrPeyQ== dependencies: - "@salesforce/core" "^5.3.18" + "@oclif/core" "^3.10.8" + "@salesforce/core" "^5.3.20" "@salesforce/kit" "^3.0.15" - "@salesforce/source-deploy-retrieve" "^9.8.4" + "@salesforce/source-deploy-retrieve" "^9.8.5" "@salesforce/ts-types" "^2.0.9" fast-xml-parser "^4.2.5" graceful-fs "^4.2.11" isomorphic-git "1.23.0" ts-retry-promise "^0.7.0" -"@salesforce/ts-sinon@1.4.19": +"@salesforce/ts-sinon@^1.4.19": version "1.4.19" resolved "https://registry.yarnpkg.com/@salesforce/ts-sinon/-/ts-sinon-1.4.19.tgz#64157b6c8cf4a3c637867e2ddd90c2d058c334f7" integrity sha512-vopxKrI6QD0OCtPlge1eGGHFWLkoDee7KaB/dpGeRwioeNfCVJ8ikELN0hv0zq9Ys6gUYWYcdpxzTP1upslCJA== @@ -1183,7 +1180,7 @@ sinon "^5.1.1" tslib "^2.6.1" -"@salesforce/ts-types@^2.0.6", "@salesforce/ts-types@^2.0.7", "@salesforce/ts-types@^2.0.8", "@salesforce/ts-types@^2.0.9": +"@salesforce/ts-types@^2.0.6", "@salesforce/ts-types@^2.0.7", "@salesforce/ts-types@^2.0.9": version "2.0.9" resolved "https://registry.yarnpkg.com/@salesforce/ts-types/-/ts-types-2.0.9.tgz#66bff7b41720065d6b01631b6f6a3ccca02857c5" integrity sha512-boUD9jw5vQpTCPCCmK/NFTWjSuuW+lsaxOynkyNXLW+zxOc4GDjhtKc4j0vWZJQvolpafbyS8ZLFHZJvs12gYA== @@ -1298,72 +1295,6 @@ resolved "https://registry.yarnpkg.com/@sinonjs/text-encoding/-/text-encoding-0.7.2.tgz#5981a8db18b56ba38ef0efb7d995b12aa7b51918" integrity sha512-sXXKG+uL9IrKqViTtao2Ws6dy0znu9sOaP1di/jKGW1M6VssO8vlpXCQcpZ+jisQ1tTFAC5Jo/EOzFbggBagFQ== -"@swc/core-darwin-arm64@1.3.39": - version "1.3.39" - resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.39.tgz#7c6e87dc8b27ce406eeb5d5cd39bde9fe06f416c" - integrity sha512-qYR47BEfUvK1WRAP/LVbHakCo4mcksgDjRutJbkx3maTgHlSGYQKCQo7hz+or+n3cbR2abY0rFEgoCLjZctGOw== - -"@swc/core-darwin-x64@1.3.39": - version "1.3.39" - resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.3.39.tgz#709f269e2af553b16d35a702c90553ef0af3e400" - integrity sha512-kqJ8OleY/y3S+HXnZxDWFVbKpRsb7gZDZr6Pksr8tzFba/6pLkZFBxds/zgfWIlUwri2Lcx0X872MJ46ghwv9w== - -"@swc/core-linux-arm-gnueabihf@1.3.39": - version "1.3.39" - resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.39.tgz#04e83e963ecf42228994bee3028f74b17a871456" - integrity sha512-+c3A2BV0esPNHn/KKMqP+bphUF86sVKUIaxn5tKMDrnO8ckOpEMbJ+SwzYLtwC9JIYjWwryg/0yvWrdma26Irw== - -"@swc/core-linux-arm64-gnu@1.3.39": - version "1.3.39" - resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.39.tgz#fae7fa25a1b22ea51ce53d9982ffbb17c99f7071" - integrity sha512-IRrfft7ANk3NR0qX6bXbfkqbT+WR0TMvgODQdZAtRQIt5ERFpdhcnYc4tlJzfV23R0Ek3kpdA8Gduj4tHk0K6w== - -"@swc/core-linux-arm64-musl@1.3.39": - version "1.3.39" - resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.39.tgz#74544b4fe31c708e5baad73a6ca52c6f9de4b4c1" - integrity sha512-N8tnynqBdRzY8m2blPAnLUtaln0m8gb96q6ipnY+XoHQ3Z6uZoUq8jWAeFDhD+MCzM7qD2HyBDN7sEqiwMRO/g== - -"@swc/core-linux-x64-gnu@1.3.39": - version "1.3.39" - resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.39.tgz#8b8345d7080dbbda3e673ce21419bae4fc7cd214" - integrity sha512-Jif56kWHOjQexCib4FVbGeUcBUc56cgNW7ELEKAUCID70z20JHMVTd5utcmfi1L9tywGMvfzqD5z+NQtrFV8GQ== - -"@swc/core-linux-x64-musl@1.3.39": - version "1.3.39" - resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.39.tgz#70d00f78ec1695b8d6581b0a885ac9ba1bca3867" - integrity sha512-ZiGERr/mdsEwfSiWn2Qokd8a4TTJkLVta6Nan39Bozo6J789u4uDF9Cj5TWWMSanHYAK/oRDaUm1yo2/DSecAA== - -"@swc/core-win32-arm64-msvc@1.3.39": - version "1.3.39" - resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.39.tgz#9f35782f008a722f8ae230766e16e426f2b146f9" - integrity sha512-eUAk12LZ6RQHhe0ikZZsi0CPbRA6qsvoNQQ/6uwVF60CT0UnJrLiX3w3q30aXK3WjVR6uUlVEn7ze5t7HUeGyQ== - -"@swc/core-win32-ia32-msvc@1.3.39": - version "1.3.39" - resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.39.tgz#3964c477d542ac41990c8cb12558d6f616cc3d64" - integrity sha512-c3MIt+0gvZD0hmPOyoIJtdgx1ubP7E+uUnljw2+Nk8rO6qhIrWI08tWRNbT0HNLXHfHhKMJHvSAg3DGW8vG3Rg== - -"@swc/core-win32-x64-msvc@1.3.39": - version "1.3.39" - resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.39.tgz#81344093a5e4b4e24894b1abcf35689f3838b5c2" - integrity sha512-c4xGToLavhHjrE0Um0GyXCilL3sKNRP71GgQTVvqTFHxMmdUCBdug28olMDE1gYsCqXHaF6rPtg3QmD6dhTzKQ== - -"@swc/core@1.3.39": - version "1.3.39" - resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.3.39.tgz#c59f92dc116cf32a08d788aa5e0ce7eb856e3d40" - integrity sha512-r5oIySPo2OkC14+gmhK5H1HnDEgOvj5kx6Ogxa+Og7KyWIHE8l1JjjW+4wzYdjxtdhRjVRhvoI6mPQNQz/btBg== - optionalDependencies: - "@swc/core-darwin-arm64" "1.3.39" - "@swc/core-darwin-x64" "1.3.39" - "@swc/core-linux-arm-gnueabihf" "1.3.39" - "@swc/core-linux-arm64-gnu" "1.3.39" - "@swc/core-linux-arm64-musl" "1.3.39" - "@swc/core-linux-x64-gnu" "1.3.39" - "@swc/core-linux-x64-musl" "1.3.39" - "@swc/core-win32-arm64-msvc" "1.3.39" - "@swc/core-win32-ia32-msvc" "1.3.39" - "@swc/core-win32-x64-msvc" "1.3.39" - "@szmarczak/http-timer@^4.0.5": version "4.0.6" resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-4.0.6.tgz#b4a914bb62e7c272d4e5989fe4440f812ab1d807" @@ -1429,10 +1360,10 @@ "@types/node" "*" "@types/responselike" "^1.0.0" -"@types/chai@^4.2.11": - version "4.3.5" - resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.5.tgz#ae69bcbb1bebb68c4ac0b11e9d8ed04526b3562b" - integrity sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng== +"@types/chai@^4.3.9": + version "4.3.10" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.10.tgz#2ad2959d1767edee5b0e4efb1a0cd2b500747317" + integrity sha512-of+ICnbqjmFCiixUnqRulbylyXQrPqIGf/B3Jax1wIF3DvSheysQxAWvqHhZiW3IQrycvokcLcFQlveGp+vyNg== "@types/cli-progress@^3.11.0": version "3.11.0" @@ -1459,6 +1390,14 @@ resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz#0ea7b61496902b95890dc4c3a116b60cb8dae812" integrity sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ== +"@types/inquirer@^8.2.3": + version "8.2.10" + resolved "https://registry.yarnpkg.com/@types/inquirer/-/inquirer-8.2.10.tgz#9444dce2d764c35bc5bb4d742598aaa4acb6561b" + integrity sha512-IdD5NmHyVjWM8SHWo/kPBgtzXatwPkfwzyP3fN1jF2g9BWt5WO+8hL2F4o2GKIYsU40PpqeevuUWvkS/roXJkA== + dependencies: + "@types/through" "*" + rxjs "^7.2.0" + "@types/istanbul-lib-coverage@*": version "2.0.4" resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44" @@ -1571,10 +1510,10 @@ resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.4.tgz#0a41252ad431c473158b22f9bfb9a63df7541cff" integrity sha512-MMzuxN3GdFwskAnb6fz0orFvhfqi752yjaXylr0Rp4oDg5H0Zn1IuyRhDVvYOwAXoJirx2xuS16I3WjxnAIHiQ== -"@types/shelljs@^0.8.14": - version "0.8.14" - resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.8.14.tgz#87b8817b2397ffe97b86a4d844036ee0d2a1f0ca" - integrity sha512-eqKaGPi60riuxI9pUVeCT02EGo94Y6HT119h7w5bXSELsis6+JqzdEy6H/w2xXl881wcN3VDnb/D0WlgSety5w== +"@types/shelljs@^0.8.15": + version "0.8.15" + resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.8.15.tgz#22c6ab9dfe05cec57d8e6cb1a95ea173aee9fcac" + integrity sha512-vzmnCHl6hViPu9GNLQJ+DZFd6BQI2DBTUeOvYHqkWQLMfKAAQYMb/xAmZkTogZI/vqXHCWkqDRymDI5p0QTi5Q== dependencies: "@types/glob" "~7.2.0" "@types/node" "*" @@ -1591,6 +1530,13 @@ resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.2.tgz#bf2e02a3dbd4aecaf95942ecd99b7402e03fad5e" integrity sha512-9GcLXF0/v3t80caGs5p2rRfkB+a8VBGLJZVih6CNFkx8IZ994wiKKLSRs9nuFwk1HevWs/1mnUmkApGrSGsShA== +"@types/through@*": + version "0.0.33" + resolved "https://registry.yarnpkg.com/@types/through/-/through-0.0.33.tgz#14ebf599320e1c7851e7d598149af183c6b9ea56" + integrity sha512-HsJ+z3QuETzP3cswwtzt2vEIiHBk/dCcHGhbmG5X3ecnwFD/lPrMpliGXxSCg03L9AhrdwA4Oz/qfspkDW+xGQ== + dependencies: + "@types/node" "*" + "@types/vinyl@^2.0.4": version "2.0.7" resolved "https://registry.yarnpkg.com/@types/vinyl/-/vinyl-2.0.7.tgz#9739a9a2afaf9af32761c54a0e82c735279f726c" @@ -1635,6 +1581,14 @@ "@typescript-eslint/types" "5.62.0" "@typescript-eslint/visitor-keys" "5.62.0" +"@typescript-eslint/scope-manager@6.10.0": + version "6.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.10.0.tgz#b0276118b13d16f72809e3cecc86a72c93708540" + integrity sha512-TN/plV7dzqqC2iPNf1KrxozDgZs53Gfgg5ZHyw8erd6jd5Ta/JIEcdCheXFt9b1NYb93a1wmIIVW/2gLkombDg== + dependencies: + "@typescript-eslint/types" "6.10.0" + "@typescript-eslint/visitor-keys" "6.10.0" + "@typescript-eslint/scope-manager@6.9.1": version "6.9.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.9.1.tgz#e96afeb9a68ad1cd816dba233351f61e13956b75" @@ -1658,6 +1612,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.62.0.tgz#258607e60effa309f067608931c3df6fed41fd2f" integrity sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ== +"@typescript-eslint/types@6.10.0": + version "6.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.10.0.tgz#f4f0a84aeb2ac546f21a66c6e0da92420e921367" + integrity sha512-36Fq1PWh9dusgo3vH7qmQAj5/AZqARky1Wi6WpINxB6SkQdY5vQoT2/7rW7uBIsPDcvvGCLi4r10p0OJ7ITAeg== + "@typescript-eslint/types@6.9.1": version "6.9.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.9.1.tgz#a6cfc20db0fcedcb2f397ea728ef583e0ee72459" @@ -1676,6 +1635,19 @@ semver "^7.3.7" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@6.10.0": + version "6.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.10.0.tgz#667381eed6f723a1a8ad7590a31f312e31e07697" + integrity sha512-ek0Eyuy6P15LJVeghbWhSrBCj/vJpPXXR+EpaRZqou7achUWL8IdYnMSC5WHAeTWswYQuP2hAZgij/bC9fanBg== + dependencies: + "@typescript-eslint/types" "6.10.0" + "@typescript-eslint/visitor-keys" "6.10.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.5.4" + ts-api-utils "^1.0.1" + "@typescript-eslint/typescript-estree@6.9.1": version "6.9.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.9.1.tgz#8c77910a49a04f0607ba94d78772da07dab275ad" @@ -1716,6 +1688,19 @@ eslint-scope "^5.1.1" semver "^7.3.7" +"@typescript-eslint/utils@^6.7.5": + version "6.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.10.0.tgz#4d76062d94413c30e402c9b0df8c14aef8d77336" + integrity sha512-v+pJ1/RcVyRc0o4wAGux9x42RHmAjIGzPRo538Z8M1tVx6HOnoQBCX/NoadHQlZeC+QO2yr4nNSFWOoraZCAyg== + dependencies: + "@eslint-community/eslint-utils" "^4.4.0" + "@types/json-schema" "^7.0.12" + "@types/semver" "^7.5.0" + "@typescript-eslint/scope-manager" "6.10.0" + "@typescript-eslint/types" "6.10.0" + "@typescript-eslint/typescript-estree" "6.10.0" + semver "^7.5.4" + "@typescript-eslint/visitor-keys@5.62.0": version "5.62.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz#2174011917ce582875954ffe2f6912d5931e353e" @@ -1724,6 +1709,14 @@ "@typescript-eslint/types" "5.62.0" eslint-visitor-keys "^3.3.0" +"@typescript-eslint/visitor-keys@6.10.0": + version "6.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.10.0.tgz#b9eaf855a1ac7e95633ae1073af43d451e8f84e3" + integrity sha512-xMGluxQIEtOM7bqFCo+rCMh5fqI+ZxV5RUUOa29iVPz1OgCZrtc7rFnz5cLUazlkPKYqX+75iuDq7m0HQ48nCg== + dependencies: + "@typescript-eslint/types" "6.10.0" + eslint-visitor-keys "^3.4.1" + "@typescript-eslint/visitor-keys@6.9.1": version "6.9.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.9.1.tgz#6753a9225a0ba00459b15d6456b9c2780b66707d" @@ -2103,11 +2096,6 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== -at-least-node@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" - integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== - atomic-sleep@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/atomic-sleep/-/atomic-sleep-1.0.0.tgz#eb85b77a601fc932cfe432c5acd364a9e2c9075b" @@ -2489,7 +2477,7 @@ chalk@^5.3.0: resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385" integrity sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w== -change-case@^4.1.2: +change-case@^4, change-case@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/change-case/-/change-case-4.1.2.tgz#fedfc5f136045e2398c0410ee441f95704641e12" integrity sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A== @@ -2768,21 +2756,6 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== -concurrently@^7.6.0: - version "7.6.0" - resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-7.6.0.tgz#531a6f5f30cf616f355a4afb8f8fcb2bba65a49a" - integrity sha512-BKtRgvcJGeZ4XttiDiNcFiRlxoAeZOseqUvyYRUp/Vtd+9p1ULmeoSqGsDA+2ivdeDFpqrJvGvmI+StKfKl5hw== - dependencies: - chalk "^4.1.0" - date-fns "^2.29.1" - lodash "^4.17.21" - rxjs "^7.0.0" - shell-quote "^1.7.3" - spawn-command "^0.0.2-1" - supports-color "^8.1.0" - tree-kill "^1.2.2" - yargs "^17.3.1" - console-control-strings@^1.0.0, console-control-strings@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" @@ -2949,13 +2922,6 @@ data-uri-to-buffer@^5.0.1: resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-5.0.1.tgz#db89a9e279c2ffe74f50637a59a32fb23b3e4d7c" integrity sha512-a9l6T1qqDogvvnw0nKlfZzqsyikEBZBClF39V3TFoKhDtGBqHu2HkuomJc02j5zft8zrUaXEuoicLeW54RkzPg== -date-fns@^2.29.1: - version "2.30.0" - resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.30.0.tgz#f367e644839ff57894ec6ac480de40cae4b0f4d0" - integrity sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw== - dependencies: - "@babel/runtime" "^7.21.0" - dateformat@^4.5.0, dateformat@^4.6.3: version "4.6.3" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-4.6.3.tgz#556fa6497e5217fedb78821424f8a1c22fa3f4b5" @@ -3417,12 +3383,21 @@ eslint-plugin-jsdoc@^46.8.2: semver "^7.5.4" spdx-expression-parse "^3.0.1" -eslint-plugin-sf-plugin@^1.16.14: - version "1.16.14" - resolved "https://registry.yarnpkg.com/eslint-plugin-sf-plugin/-/eslint-plugin-sf-plugin-1.16.14.tgz#64138f6c597ad7b750d9d7615894e2fe504852ec" - integrity sha512-numvHHhJjExz4ojxK3O25G8Vh8pXtMgZzwEaKGGsKaOJFm4rmSS2NabmfkRPYX2NCO/xn4eNHm1iGTnnQywGvg== +eslint-plugin-perfectionist@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-perfectionist/-/eslint-plugin-perfectionist-2.2.0.tgz#a1b1f1407ce9bc20a4f0e2b8113fb84e5b9dfb9f" + integrity sha512-/nG2Uurd6AY7CI6zlgjHPOoiPY8B7EYMUWdNb5w+EzyauYiQjjD5lQwAI1FlkBbCCFFZw/CdZIPQhXumYoiyaw== + dependencies: + "@typescript-eslint/utils" "^6.7.5" + minimatch "^9.0.3" + natural-compare-lite "^1.4.0" + +eslint-plugin-sf-plugin@^1.16.15: + version "1.16.15" + resolved "https://registry.yarnpkg.com/eslint-plugin-sf-plugin/-/eslint-plugin-sf-plugin-1.16.15.tgz#99d0b522bb7eebefc8e456aa4b725f6fbbf2fa01" + integrity sha512-Vog0xc8DwLOCoPbwFx9GxaXHqpG0FvlpITkGzp//SdjcV7wqVW4CT76JES8IGenGv6mAecW5VqSyQzsIHFZGew== dependencies: - "@salesforce/core" "^5.3.17" + "@salesforce/core" "^5.3.20" "@typescript-eslint/utils" "^5.59.11" eslint-plugin-unicorn@^49.0.0: @@ -3856,16 +3831,6 @@ fs-extra@^8.1, fs-extra@^8.1.0: jsonfile "^4.0.0" universalify "^0.1.0" -fs-extra@^9.0.1: - version "9.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" - integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== - dependencies: - at-least-node "^1.0.0" - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - fs-minipass@^2.0.0, fs-minipass@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" @@ -5192,6 +5157,11 @@ locate-path@^6.0.0: dependencies: p-locate "^5.0.0" +lodash._reinterpolate@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" + integrity sha512-xYHt68QRoYGjeeM/XOE1uJtvXQAgvszfBhjV4yvsQH0u2i9I6cI6c6/eG4Hh3UAOVn0y/xAXwmTzEay49Q//HA== + lodash.camelcase@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" @@ -5292,6 +5262,21 @@ lodash.startcase@^4.4.0: resolved "https://registry.yarnpkg.com/lodash.startcase/-/lodash.startcase-4.4.0.tgz#9436e34ed26093ed7ffae1936144350915d9add8" integrity sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg== +lodash.template@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.5.0.tgz#f976195cf3f347d0d5f52483569fe8031ccce8ab" + integrity sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A== + dependencies: + lodash._reinterpolate "^3.0.0" + lodash.templatesettings "^4.0.0" + +lodash.templatesettings@^4.0.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz#e481310f049d3cf6d47e912ad09313b154f0fb33" + integrity sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ== + dependencies: + lodash._reinterpolate "^3.0.0" + lodash.union@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.union/-/lodash.union-4.6.0.tgz#48bb5088409f16f1821666641c44dd1aaae3cd88" @@ -5605,10 +5590,10 @@ minimatch@^7.2.0: dependencies: brace-expansion "^2.0.1" -minimatch@^9.0.0, minimatch@^9.0.1: - version "9.0.1" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.1.tgz#8a555f541cf976c622daf078bb28f29fb927c253" - integrity sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w== +minimatch@^9.0.0, minimatch@^9.0.1, minimatch@^9.0.3: + version "9.0.3" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" + integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== dependencies: brace-expansion "^2.0.1" @@ -5823,6 +5808,11 @@ nanoid@3.3.3: resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.3.tgz#fd8e8b7aa761fe807dba2d1b98fb7241bb724a25" integrity sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w== +natural-compare-lite@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz#17b09581988979fddafe0201e931ba933c96cbb4" + integrity sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g== + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -6242,28 +6232,27 @@ object.values@^1.1.7: define-properties "^1.2.0" es-abstract "^1.22.1" -oclif@^3.16.0: - version "3.17.2" - resolved "https://registry.yarnpkg.com/oclif/-/oclif-3.17.2.tgz#f13756c9b1968047e76b99cb09db9725e96fb2f6" - integrity sha512-+vFXxgmR7dGGz+g6YiqSZu2LXVkBMaS9/rhtsLGkYw45e53CW/3kBgPRnOvxcTDM3Td9JPeBD2JWxXnPKGQW3A== +oclif@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/oclif/-/oclif-4.0.3.tgz#2ff8fab10c29b2cd0bbf8e9c87640a64151b65ff" + integrity sha512-Bq7t1bJvAKYwW3DKQIzok3jkXv7yUIMneoSec1qUr9wfSqzRTZQB0UUDovwlT/L+3TBMVoRyw1WeX+YDvfRJNA== dependencies: - "@oclif/core" "^2.11.4" + "@oclif/core" "^3.0.4" "@oclif/plugin-help" "^5.2.14" "@oclif/plugin-not-found" "^2.3.32" - "@oclif/plugin-warn-if-update-available" "^2.0.44" + "@oclif/plugin-warn-if-update-available" "^3.0.0" async-retry "^1.3.3" aws-sdk "^2.1231.0" - concurrently "^7.6.0" + change-case "^4" debug "^4.3.3" + eslint-plugin-perfectionist "^2.1.0" find-yarn-workspace-root "^2.0.0" fs-extra "^8.1" github-slugger "^1.5.0" got "^11" - lodash "^4.17.21" + lodash.template "^4.5.0" normalize-package-data "^3.0.3" semver "^7.3.8" - shelljs "^0.8.5" - tslib "^2.3.1" yeoman-environment "^3.15.1" yeoman-generator "^5.8.0" @@ -7160,7 +7149,7 @@ rxjs@^6.6.0: dependencies: tslib "^1.9.0" -rxjs@^7.0.0, rxjs@^7.5.5: +rxjs@^7.2.0, rxjs@^7.5.5: version "7.8.1" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543" integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg== @@ -7337,11 +7326,6 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== -shell-quote@^1.7.3: - version "1.8.1" - resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.8.1.tgz#6dbf4db75515ad5bac63b4f1894c3a154c766680" - integrity sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA== - shelljs@^0.8.4, shelljs@^0.8.5, shelljs@~0.8.4: version "0.8.5" resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.5.tgz#de055408d8361bed66c669d2f000538ced8ee20c" @@ -7537,11 +7521,6 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -spawn-command@^0.0.2-1: - version "0.0.2-1" - resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2-1.tgz#62f5e9466981c1b796dc5929937e11c9c6921bd0" - integrity sha512-n98l9E2RMSJ9ON1AKisHzz7V42VDiBQGY6PB1BwRglz99wpVsSuGzQ+jOi6lFXBGVTCrRpltvjm+/XA+tpeJrg== - spawn-wrap@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/spawn-wrap/-/spawn-wrap-2.0.0.tgz#103685b8b8f9b79771318827aa78650a610d457e" @@ -7745,7 +7724,7 @@ strnum@^1.0.5: resolved "https://registry.yarnpkg.com/strnum/-/strnum-1.0.5.tgz#5c4e829fe15ad4ff0d20c3db5ac97b73c9b072db" integrity sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA== -supports-color@8.1.1, supports-color@^8.1.0, supports-color@^8.1.1: +supports-color@8.1.1, supports-color@^8.1.1: version "8.1.1" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== @@ -7879,11 +7858,6 @@ tr46@~0.0.3: resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== -tree-kill@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" - integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A== - treeverse@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/treeverse/-/treeverse-1.0.4.tgz#a6b0ebf98a1bca6846ddc7ecbc900df08cb9cd5f" @@ -7956,7 +7930,7 @@ tslib@^1.8.1, tslib@^1.9.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2, tslib@^2.0.1, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.1, tslib@^2.5.0, tslib@^2.6.1, tslib@^2.6.2: +tslib@^2, tslib@^2.0.1, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.5.0, tslib@^2.6.1, tslib@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== @@ -8596,7 +8570,7 @@ yargs@^15.0.2: y18n "^4.0.0" yargs-parser "^18.1.2" -yargs@^17.0.0, yargs@^17.3.1: +yargs@^17.0.0: version "17.7.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== From 7d9de5f622d47c1f7a35212d677a067ba444a71d Mon Sep 17 00:00:00 2001 From: svc-cli-bot Date: Tue, 14 Nov 2023 20:13:55 +0000 Subject: [PATCH 2/2] chore(release): 2.0.1 [skip ci] --- CHANGELOG.md | 2 + README.md | 126 ++++++++++++++++++++++++++------------------------- package.json | 2 +- 3 files changed, 67 insertions(+), 63 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d6d9e4b..be250e3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## [2.0.1](https://github.com/salesforcecli/plugin-deploy-retrieve/compare/1.20.3...2.0.1) (2023-11-14) + ## [1.20.3](https://github.com/salesforcecli/plugin-deploy-retrieve/compare/1.20.2...1.20.3) (2023-11-11) ### Bug Fixes diff --git a/README.md b/README.md index 11476c6c..35e082e3 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ FLAGS -p, --metadata-dir=... Root of directory or zip file of metadata formatted files to convert. -r, --root-dir= (required) Root directory that contains the Metadata API–formatted metadata. -x, --manifest= File path to manifest (package.xml) of metadata types to convert. - --api-version= Override the api version used for api requests made by this command + --api-version= Override the api version used for api requests made by this command GLOBAL FLAGS --json Format output as json. @@ -141,7 +141,7 @@ FLAG DESCRIPTIONS If you specify this parameter, don’t specify --metadata or --source-dir. ``` -_See code: [src/commands/project/convert/mdapi.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/1.20.3/src/commands/project/convert/mdapi.ts)_ +_See code: [src/commands/project/convert/mdapi.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/1.20.4/src/commands/project/convert/mdapi.ts)_ ## `sf project convert source` @@ -153,14 +153,14 @@ USAGE | -m ] FLAGS - -d, --output-dir= [default: metadataPackage_1699692272222] Output directory to store the Metadata + -d, --output-dir= [default: metadataPackage_1699992830510] Output directory to store the Metadata API–formatted files in. -m, --metadata=... Metadata component names to convert. -n, --package-name= Name of the package to associate with the metadata-formatted files. -p, --source-dir=... Paths to the local source files to convert. -r, --root-dir= Source directory other than the default package to convert. -x, --manifest= Path to the manifest (package.xml) file that specifies the metadata types to convert. - --api-version= API Version to use in the generated project's manifest. By default, will use the version + --api-version= API Version to use in the generated project's manifest. By default, will use the version from sfdx-project.json GLOBAL FLAGS @@ -213,7 +213,7 @@ FLAG DESCRIPTIONS Override the api version used for api requests made by this command ``` -_See code: [src/commands/project/convert/source.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/1.20.3/src/commands/project/convert/source.ts)_ +_See code: [src/commands/project/convert/source.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/1.20.4/src/commands/project/convert/source.ts)_ ## `sf project delete source` @@ -234,13 +234,13 @@ FLAGS -r, --no-prompt Don't prompt for delete confirmation. -t, --track-source If the delete succeeds, update the source tracking information. -w, --wait= [default: 33 minutes] Number of minutes to wait for the command to finish. - --api-version= Override the api version used for api requests made by this command - --verbose Verbose output of the delete result. + --api-version= Override the api version used for api requests made by this command + --verbose Verbose output of the delete result. TEST FLAGS -l, --test-level=