Skip to content

Commit

Permalink
refactor: real plugins-core, use built-in confirm prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Jan 5, 2024
1 parent 30c5889 commit 42cf6d5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
"bugs": "https://github.com/forcedotcom/cli/issues",
"dependencies": {
"@inquirer/checkbox": "^1.5.0",
"@inquirer/confirm": "^2.0.15",
"@inquirer/password": "^1.1.14",
"@inquirer/select": "^1.3.1",
"@oclif/core": "^3.16.0",
"@salesforce/core": "^6.4.3",
"@salesforce/kit": "^3.0.15",
"@salesforce/sf-plugins-core": "5.0.14-dev.0",
"@salesforce/sf-plugins-core": "^7.0.0",
"@salesforce/ts-types": "^2.0.9",
"chalk": "^5.3.0",
"open": "^9.1.0"
Expand Down
4 changes: 2 additions & 2 deletions src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { Logger, SfdcUrl, SfProject, Messages, SfError, Global, Mode } from '@salesforce/core';
import { getString, isObject } from '@salesforce/ts-types';
import chalk from 'chalk';
import confirm from '@inquirer/confirm';
import { prompts } from '@salesforce/sf-plugins-core';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-auth', 'messages');
Expand Down Expand Up @@ -46,7 +46,7 @@ const throwIfLightning = (urlString?: string): void => {
const shouldExitCommand = async (noPrompt?: boolean): Promise<boolean> =>
Boolean(noPrompt) || Global.getEnvironmentMode() !== Mode.DEMO
? false
: !(await confirm({ message: chalk.dim(messages.getMessage('warnAuth', ['sf'])) }));
: !(await prompts.confirm({ message: chalk.dim(messages.getMessage('warnAuth', ['sf'])), ms: 60_000 }));

export default {
shouldExitCommand,
Expand Down
26 changes: 13 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1102,19 +1102,6 @@
resolved "https://registry.yarnpkg.com/@salesforce/schemas/-/schemas-1.6.1.tgz#7d1c071e1e509ca9d2d8a6e48ac7447dd67a534d"
integrity sha512-eVy947ZMxCJReKJdgfddUIsBIbPTa/i8RwQGwxq4/ss38H5sLOAeSTaun9V7HpJ1hkpDznWKfgzYvjsst9K6ig==

"@salesforce/[email protected]":
version "5.0.14-dev.0"
resolved "https://registry.yarnpkg.com/@salesforce/sf-plugins-core/-/sf-plugins-core-5.0.14-dev.0.tgz#9588807ae33e4b7bafeaab76c67ee2cbb4529dc8"
integrity sha512-gveYtjQkkcU3b38dkhLg1J9+DKbsezc1l8xyRBv087F5+6EE241CuGhGGuzOlDWdSg+YKZiUKG5F1BxqV8q55w==
dependencies:
"@inquirer/confirm" "^2.0.15"
"@inquirer/password" "^1.1.14"
"@oclif/core" "^3.16.0"
"@salesforce/core" "^6.4.2"
"@salesforce/kit" "^3.0.15"
"@salesforce/ts-types" "^2.0.9"
chalk "^5.3.0"

"@salesforce/sf-plugins-core@^5.0.12":
version "5.0.13"
resolved "https://registry.yarnpkg.com/@salesforce/sf-plugins-core/-/sf-plugins-core-5.0.13.tgz#f2941527d66ded5750a6646e146af047ab72acc9"
Expand All @@ -1128,6 +1115,19 @@
chalk "^4"
inquirer "^8.2.5"

"@salesforce/sf-plugins-core@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/@salesforce/sf-plugins-core/-/sf-plugins-core-7.0.0.tgz#56cb4eaafcd04a183938d86c5e93323e037b15ab"
integrity sha512-vl53Ee0/eg9wgvtWro6kX82/943s28Hph/o3lTQk6URorfqMC+zH0RGKJj1X0VKeLhDSOCRYXqIu54jE8AZ/3g==
dependencies:
"@inquirer/confirm" "^2.0.15"
"@inquirer/password" "^1.1.14"
"@oclif/core" "^3.16.0"
"@salesforce/core" "^6.4.2"
"@salesforce/kit" "^3.0.15"
"@salesforce/ts-types" "^2.0.9"
chalk "^5.3.0"

"@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"
Expand Down

0 comments on commit 42cf6d5

Please sign in to comment.