From bf753e23dad3e1337977f036a6e26c49d5684a1d Mon Sep 17 00:00:00 2001 From: Greg Smith Date: Wed, 13 Apr 2022 10:25:58 -0600 Subject: [PATCH] fix: add back -h support (#104) * fix: add back -h support To bring in plugin-help, I also reved @salesforce/core and @salesforce/command. That then needed some minor updates for changes to the types. * chore: switch from deprecated core.fs --- package.json | 5 +- src/commands/analytics/app/create.ts | 3 +- src/commands/analytics/query.ts | 3 +- test/commands/app/create.test.ts | 17 +++-- test/commands/app/decouple.test.ts | 2 +- test/commands/app/delete.test.ts | 2 +- test/commands/app/display.test.ts | 2 +- test/commands/app/list.test.ts | 2 +- test/commands/app/update.test.ts | 2 +- test/commands/asset/publisher/create.test.ts | 2 +- .../asset/publisher/deleteall.test.ts | 2 +- test/commands/asset/publisher/list.test.ts | 2 +- test/commands/autoinstall/app/create.test.ts | 3 +- test/commands/autoinstall/app/delete.test.ts | 3 +- test/commands/autoinstall/app/update.test.ts | 3 +- test/commands/autoinstall/list.test.ts | 2 +- test/commands/dashboard/history/list.test.ts | 2 +- .../commands/dashboard/history/revert.test.ts | 2 +- test/commands/dashboard/list.test.ts | 2 +- test/commands/dashboard/update.test.ts | 2 +- test/commands/dataflow/history/list.test.ts | 2 +- test/commands/dataflow/history/revert.test.ts | 2 +- test/commands/dataflow/list.test.ts | 2 +- test/commands/dataset/display.test.ts | 2 +- test/commands/dataset/list.test.ts | 2 +- test/commands/dataset/rows/fetch.test.ts | 2 +- test/commands/enable.test.ts | 3 +- test/commands/lens/history/list.test.ts | 2 +- test/commands/lens/history/revert.test.ts | 2 +- test/commands/lens/list.test.ts | 2 +- test/commands/query.test.ts | 7 +- test/commands/template/create.test.ts | 2 +- test/commands/template/delete.test.ts | 2 +- test/commands/template/display.test.ts | 2 +- test/commands/template/list.test.ts | 2 +- test/commands/template/update.test.ts | 2 +- tsconfig.json | 4 + yarn.lock | 76 +++++++++++++------ 38 files changed, 113 insertions(+), 68 deletions(-) diff --git a/package.json b/package.json index 799a29f..21454ab 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,9 @@ "bugs": "https://github.com/forcedotcom/analyticsdx-vscode/issues", "dependencies": { "@oclif/config": "^1", - "@salesforce/command": "^3.1.3", - "@salesforce/core": "^2.25.1", + "@oclif/plugin-help": "^3.3.1", + "@salesforce/command": "^4.2.2", + "@salesforce/core": "^2.36.0", "moment": "^2.24.0", "tslib": "^2" }, diff --git a/src/commands/analytics/app/create.ts b/src/commands/analytics/app/create.ts index 231002d..6c69531 100644 --- a/src/commands/analytics/app/create.ts +++ b/src/commands/analytics/app/create.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 { promises as fs } from 'fs'; import { EOL } from 'os'; import { flags, SfdxCommand } from '@salesforce/command'; -import { fs, Messages, Org, SfdxError, StatusResult, StreamingClient } from '@salesforce/core'; +import { Messages, Org, SfdxError, StatusResult, StreamingClient } from '@salesforce/core'; import { Duration } from '@salesforce/kit'; import { JsonMap } from '@salesforce/ts-types'; import chalk from 'chalk'; diff --git a/src/commands/analytics/query.ts b/src/commands/analytics/query.ts index f2cb867..03439bd 100644 --- a/src/commands/analytics/query.ts +++ b/src/commands/analytics/query.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 { promises as fs } from 'fs'; import * as path from 'path'; import { flags, SfdxCommand } from '@salesforce/command'; -import { fs, Messages, Org, SfdxError } from '@salesforce/core'; +import { Messages, Org, SfdxError } from '@salesforce/core'; import QuerySvc, { DRYRUN_FLAG, LIMIT_FLAG, diff --git a/test/commands/app/create.test.ts b/test/commands/app/create.test.ts index c349356..aaefe3a 100644 --- a/test/commands/app/create.test.ts +++ b/test/commands/app/create.test.ts @@ -5,7 +5,8 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { core } from '@salesforce/command'; +import { promises as fs } from 'fs'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; import { AnyJson, ensureJsonMap, ensureString } from '@salesforce/ts-types'; import { StreamingClient } from '@salesforce/core'; @@ -188,7 +189,7 @@ describe('analytics:app:create', () => { } return Promise.reject(); }) - .stub(core.fs, 'readFile', () => + .stub(fs, 'readFile', () => Promise.resolve( JSON.stringify({ templateSourceId: testTemplateJson.id, @@ -222,7 +223,7 @@ describe('analytics:app:create', () => { } return Promise.reject(); }) - .stub(core.fs, 'readFile', () => + .stub(fs, 'readFile', () => Promise.resolve( JSON.stringify({ templateSourceId: testTemplateJson.id, @@ -256,7 +257,7 @@ describe('analytics:app:create', () => { } return Promise.reject(); }) - .stub(core.fs, 'readFile', () => + .stub(fs, 'readFile', () => Promise.resolve( JSON.stringify({ assetIcon: '16.png', @@ -300,7 +301,7 @@ describe('analytics:app:create', () => { }) }; }) - .stub(core.fs, 'readFile', () => + .stub(fs, 'readFile', () => Promise.resolve( JSON.stringify({ templateSourceId: testTemplateJson.id, @@ -346,7 +347,7 @@ describe('analytics:app:create', () => { } }; }) - .stub(core.fs, 'readFile', () => + .stub(fs, 'readFile', () => Promise.resolve( JSON.stringify({ templateSourceId: testTemplateJson.id, @@ -396,7 +397,7 @@ describe('analytics:app:create', () => { }) }; }) - .stub(core.fs, 'readFile', () => + .stub(fs, 'readFile', () => Promise.resolve( JSON.stringify({ templateSourceId: testTemplateJson.id, @@ -446,7 +447,7 @@ describe('analytics:app:create', () => { } }; }) - .stub(core.fs, 'readFile', () => + .stub(fs, 'readFile', () => Promise.resolve( JSON.stringify({ templateSourceId: testTemplateJson.id, diff --git a/test/commands/app/decouple.test.ts b/test/commands/app/decouple.test.ts index 9e14b65..ed90f59 100644 --- a/test/commands/app/decouple.test.ts +++ b/test/commands/app/decouple.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 { core } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; core.Messages.importMessagesDirectory(__dirname); diff --git a/test/commands/app/delete.test.ts b/test/commands/app/delete.test.ts index c971656..91ba84d 100644 --- a/test/commands/app/delete.test.ts +++ b/test/commands/app/delete.test.ts @@ -4,7 +4,7 @@ * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { core } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; import { ensureJsonMap } from '@salesforce/ts-types'; diff --git a/test/commands/app/display.test.ts b/test/commands/app/display.test.ts index 70d9271..c0b534f 100644 --- a/test/commands/app/display.test.ts +++ b/test/commands/app/display.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 { core } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; core.Messages.importMessagesDirectory(__dirname); diff --git a/test/commands/app/list.test.ts b/test/commands/app/list.test.ts index 9f46198..a45c2ea 100644 --- a/test/commands/app/list.test.ts +++ b/test/commands/app/list.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 { core } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; import { ensureJsonMap, ensureString } from '@salesforce/ts-types'; diff --git a/test/commands/app/update.test.ts b/test/commands/app/update.test.ts index be6fad4..7fd4bf4 100644 --- a/test/commands/app/update.test.ts +++ b/test/commands/app/update.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 { core } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; const messages = core.Messages.loadMessages('@salesforce/analytics', 'app'); diff --git a/test/commands/asset/publisher/create.test.ts b/test/commands/asset/publisher/create.test.ts index 288a626..1a13847 100644 --- a/test/commands/asset/publisher/create.test.ts +++ b/test/commands/asset/publisher/create.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 { core } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; core.Messages.importMessagesDirectory(__dirname); diff --git a/test/commands/asset/publisher/deleteall.test.ts b/test/commands/asset/publisher/deleteall.test.ts index 55ae432..7bdeaaa 100644 --- a/test/commands/asset/publisher/deleteall.test.ts +++ b/test/commands/asset/publisher/deleteall.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 { core } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; import { ensureJsonMap } from '@salesforce/ts-types'; diff --git a/test/commands/asset/publisher/list.test.ts b/test/commands/asset/publisher/list.test.ts index d0b1f1f..f50ff20 100644 --- a/test/commands/asset/publisher/list.test.ts +++ b/test/commands/asset/publisher/list.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 { core } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; core.Messages.importMessagesDirectory(__dirname); diff --git a/test/commands/autoinstall/app/create.test.ts b/test/commands/autoinstall/app/create.test.ts index fd418ee..ee82942 100644 --- a/test/commands/autoinstall/app/create.test.ts +++ b/test/commands/autoinstall/app/create.test.ts @@ -5,7 +5,8 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { core, UX } from '@salesforce/command'; +import { UX } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; import { SfdxError } from '@salesforce/core'; import { JsonMap } from '@salesforce/ts-types'; diff --git a/test/commands/autoinstall/app/delete.test.ts b/test/commands/autoinstall/app/delete.test.ts index 2bd4713..cf84ce1 100644 --- a/test/commands/autoinstall/app/delete.test.ts +++ b/test/commands/autoinstall/app/delete.test.ts @@ -5,7 +5,8 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { core, UX } from '@salesforce/command'; +import { UX } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; import { SfdxError } from '@salesforce/core'; import { JsonMap } from '@salesforce/ts-types'; diff --git a/test/commands/autoinstall/app/update.test.ts b/test/commands/autoinstall/app/update.test.ts index 380bff6..d80588e 100644 --- a/test/commands/autoinstall/app/update.test.ts +++ b/test/commands/autoinstall/app/update.test.ts @@ -5,7 +5,8 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { core, UX } from '@salesforce/command'; +import { UX } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; import { SfdxError } from '@salesforce/core'; import { JsonMap } from '@salesforce/ts-types'; diff --git a/test/commands/autoinstall/list.test.ts b/test/commands/autoinstall/list.test.ts index 12f8ee4..45d822b 100644 --- a/test/commands/autoinstall/list.test.ts +++ b/test/commands/autoinstall/list.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 { core } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; core.Messages.importMessagesDirectory(__dirname); const messages = core.Messages.loadMessages('@salesforce/analytics', 'autoinstall'); diff --git a/test/commands/dashboard/history/list.test.ts b/test/commands/dashboard/history/list.test.ts index 2fc475b..b23dc0c 100644 --- a/test/commands/dashboard/history/list.test.ts +++ b/test/commands/dashboard/history/list.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 { core } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; core.Messages.importMessagesDirectory(__dirname); diff --git a/test/commands/dashboard/history/revert.test.ts b/test/commands/dashboard/history/revert.test.ts index b4b1915..41b6a75 100644 --- a/test/commands/dashboard/history/revert.test.ts +++ b/test/commands/dashboard/history/revert.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 { core } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; core.Messages.importMessagesDirectory(__dirname); diff --git a/test/commands/dashboard/list.test.ts b/test/commands/dashboard/list.test.ts index 2b2b57e..3e701ae 100644 --- a/test/commands/dashboard/list.test.ts +++ b/test/commands/dashboard/list.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 { core } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; core.Messages.importMessagesDirectory(__dirname); diff --git a/test/commands/dashboard/update.test.ts b/test/commands/dashboard/update.test.ts index 2d1715e..09f47ec 100644 --- a/test/commands/dashboard/update.test.ts +++ b/test/commands/dashboard/update.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 { core } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; core.Messages.importMessagesDirectory(__dirname); diff --git a/test/commands/dataflow/history/list.test.ts b/test/commands/dataflow/history/list.test.ts index 46c8574..2db9f7c 100644 --- a/test/commands/dataflow/history/list.test.ts +++ b/test/commands/dataflow/history/list.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 { core } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; core.Messages.importMessagesDirectory(__dirname); diff --git a/test/commands/dataflow/history/revert.test.ts b/test/commands/dataflow/history/revert.test.ts index ae05836..47d5ad6 100644 --- a/test/commands/dataflow/history/revert.test.ts +++ b/test/commands/dataflow/history/revert.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 { core } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; core.Messages.importMessagesDirectory(__dirname); diff --git a/test/commands/dataflow/list.test.ts b/test/commands/dataflow/list.test.ts index 11bf1d4..c31d15f 100644 --- a/test/commands/dataflow/list.test.ts +++ b/test/commands/dataflow/list.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 { core } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; core.Messages.importMessagesDirectory(__dirname); diff --git a/test/commands/dataset/display.test.ts b/test/commands/dataset/display.test.ts index 428b9dd..6c29cb1 100644 --- a/test/commands/dataset/display.test.ts +++ b/test/commands/dataset/display.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 { core } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; core.Messages.importMessagesDirectory(__dirname); diff --git a/test/commands/dataset/list.test.ts b/test/commands/dataset/list.test.ts index 02ff3fb..6f0aacf 100644 --- a/test/commands/dataset/list.test.ts +++ b/test/commands/dataset/list.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 { core } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; core.Messages.importMessagesDirectory(__dirname); diff --git a/test/commands/dataset/rows/fetch.test.ts b/test/commands/dataset/rows/fetch.test.ts index f7d1a76..d09aedf 100644 --- a/test/commands/dataset/rows/fetch.test.ts +++ b/test/commands/dataset/rows/fetch.test.ts @@ -7,7 +7,7 @@ // the test data is actual data from a server, which uses _ in field names /* eslint-disable camelcase */ -import { core } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; import { SfdxError } from '@salesforce/core'; import { AnyJson, JsonMap, ensureJsonMap, ensureString } from '@salesforce/ts-types'; diff --git a/test/commands/enable.test.ts b/test/commands/enable.test.ts index f66fcb2..351627a 100644 --- a/test/commands/enable.test.ts +++ b/test/commands/enable.test.ts @@ -5,7 +5,8 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { core, UX } from '@salesforce/command'; +import { UX } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; import { SfdxError } from '@salesforce/core'; import { JsonMap } from '@salesforce/ts-types'; diff --git a/test/commands/lens/history/list.test.ts b/test/commands/lens/history/list.test.ts index 140adb5..4d7602f 100644 --- a/test/commands/lens/history/list.test.ts +++ b/test/commands/lens/history/list.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 { core } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; core.Messages.importMessagesDirectory(__dirname); diff --git a/test/commands/lens/history/revert.test.ts b/test/commands/lens/history/revert.test.ts index e169b17..5d6921e 100644 --- a/test/commands/lens/history/revert.test.ts +++ b/test/commands/lens/history/revert.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 { core } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; core.Messages.importMessagesDirectory(__dirname); diff --git a/test/commands/lens/list.test.ts b/test/commands/lens/list.test.ts index d0672d5..fcfdc6e 100644 --- a/test/commands/lens/list.test.ts +++ b/test/commands/lens/list.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 { core } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; core.Messages.importMessagesDirectory(__dirname); diff --git a/test/commands/query.test.ts b/test/commands/query.test.ts index e4d9e35..3696e7a 100644 --- a/test/commands/query.test.ts +++ b/test/commands/query.test.ts @@ -7,7 +7,8 @@ // our test data is real data from a server, which uses _'s in the field names /* eslint-disable camelcase */ -import { core } from '@salesforce/command'; +import { promises as fs } from 'fs'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; import { SfdxError } from '@salesforce/core'; import { AnyJson, JsonMap, ensureJsonMap, ensureString } from '@salesforce/ts-types'; @@ -315,7 +316,7 @@ describe('analytics:query', () => { } return Promise.reject(new SfdxError('Invalid connection request')); }) - .stub(core.fs, 'readFile', () => Promise.resolve(sqlResponse.query)) + .stub(fs, 'readFile', () => Promise.resolve(sqlResponse.query)) .stdout() .stderr() .command(['analytics:query', '-f', 'query.sql']) @@ -348,7 +349,7 @@ describe('analytics:query', () => { } return Promise.reject(new SfdxError('Invalid connection request')); }) - .stub(core.fs, 'readFile', () => Promise.resolve('q = load "datasetname";')) + .stub(fs, 'readFile', () => Promise.resolve('q = load "datasetname";')) .stderr() .stdout() .command(['analytics:query', '-f', 'query.saql']) diff --git a/test/commands/template/create.test.ts b/test/commands/template/create.test.ts index 4ea463d..ba76166 100644 --- a/test/commands/template/create.test.ts +++ b/test/commands/template/create.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 { core } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; import { AnyJson, ensureJsonMap, ensureString } from '@salesforce/ts-types'; diff --git a/test/commands/template/delete.test.ts b/test/commands/template/delete.test.ts index 7abf93a..59c14e2 100644 --- a/test/commands/template/delete.test.ts +++ b/test/commands/template/delete.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 { core } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; import { ensureJsonMap, ensureString } from '@salesforce/ts-types'; diff --git a/test/commands/template/display.test.ts b/test/commands/template/display.test.ts index 577eb7f..c3fa3d0 100644 --- a/test/commands/template/display.test.ts +++ b/test/commands/template/display.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 { core } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; core.Messages.importMessagesDirectory(__dirname); diff --git a/test/commands/template/list.test.ts b/test/commands/template/list.test.ts index ec5aa4a..31ddc74 100644 --- a/test/commands/template/list.test.ts +++ b/test/commands/template/list.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 { core } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; core.Messages.importMessagesDirectory(__dirname); diff --git a/test/commands/template/update.test.ts b/test/commands/template/update.test.ts index 3b62d71..bf58b8e 100644 --- a/test/commands/template/update.test.ts +++ b/test/commands/template/update.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 { core } from '@salesforce/command'; +import * as core from '@salesforce/core'; import { expect, test } from '@salesforce/command/lib/test'; import { AnyJson, ensureJsonMap, ensureString } from '@salesforce/ts-types'; diff --git a/tsconfig.json b/tsconfig.json index df0fca3..4f761bf 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,6 +4,10 @@ "target": "ES2019", "outDir": "lib", "rootDir": "src", + "baseUrl": ".", + "paths": { + "@salesforce/core": ["node_modules/@salesforce/core"] + }, "noImplicitAny": true, "esModuleInterop": true, "skipLibCheck": true diff --git a/yarn.lock b/yarn.lock index 3f40469..ccf46db 100644 --- a/yarn.lock +++ b/yarn.lock @@ -455,7 +455,7 @@ "@nodelib/fs.scandir" "2.1.3" fastq "^1.6.0" -"@oclif/command@^1.5.13", "@oclif/command@^1.5.17", "@oclif/command@^1.6.0", "@oclif/command@^1.8.1", "@oclif/command@^1.8.14", "@oclif/command@^1.8.15", "@oclif/command@^1.8.3": +"@oclif/command@^1.5.13", "@oclif/command@^1.6.0", "@oclif/command@^1.8.1", "@oclif/command@^1.8.14", "@oclif/command@^1.8.15", "@oclif/command@^1.8.3": version "1.8.16" resolved "https://registry.yarnpkg.com/@oclif/command/-/command-1.8.16.tgz#bea46f81b2061b47e1cda318a0b923e62ca4cc0c" integrity sha512-rmVKYEsKzurfRU0xJz+iHelbi1LGlihIWZ7Qvmb/CBz1EkhL7nOkW4SVXmG2dA5Ce0si2gr88i6q4eBOMRNJ1w== @@ -551,7 +551,7 @@ chalk "^4.1.0" tslib "^2.0.0" -"@oclif/parser@^3.8.0", "@oclif/parser@^3.8.3": +"@oclif/parser@^3.8.0": version "3.8.5" resolved "https://registry.npmjs.org/@oclif/parser/-/parser-3.8.5.tgz#c5161766a1efca7343e1f25d769efbefe09f639b" integrity sha512-yojzeEfmSxjjkAvMRj0KzspXlMjCfBzNRPkWw8ZwOSoNWoJn+OCS/m/S+yfV6BvAM4u2lTzX9Y5rCbrFIgkJLg== @@ -606,6 +606,23 @@ widest-line "^2.0.1" wrap-ansi "^4.0.0" +"@oclif/plugin-help@^3.3.1": + version "3.3.1" + resolved "https://registry.yarnpkg.com/@oclif/plugin-help/-/plugin-help-3.3.1.tgz#36adb4e0173f741df409bb4b69036d24a53bfb24" + integrity sha512-QuSiseNRJygaqAdABYFWn/H1CwIZCp9zp/PLid6yXvy6VcQV7OenEFF5XuYaCvSARe2Tg9r8Jqls5+fw1A9CbQ== + dependencies: + "@oclif/command" "^1.8.15" + "@oclif/config" "1.18.2" + "@oclif/errors" "1.3.5" + "@oclif/help" "^1.0.1" + chalk "^4.1.2" + indent-string "^4.0.0" + lodash "^4.17.21" + string-width "^4.2.0" + strip-ansi "^6.0.0" + widest-line "^3.1.0" + wrap-ansi "^6.2.0" + "@oclif/screen@^1.0.3", "@oclif/screen@^1.0.4": version "1.0.4" resolved "https://registry.npmjs.org/@oclif/screen/-/screen-1.0.4.tgz#b740f68609dfae8aa71c3a6cab15d816407ba493" @@ -644,23 +661,7 @@ strip-ansi "6.0.1" ts-retry-promise "^0.6.0" -"@salesforce/command@^3.1.3": - version "3.1.3" - resolved "https://registry.yarnpkg.com/@salesforce/command/-/command-3.1.3.tgz#d72ed2bc516ce7fea1151576a997b45fd1752d26" - integrity sha512-Yg9lhl3ghwPN7WwqFmgfWIn6i7vz43WTpEsYsChz80bKORlVbDvhwPZQUj0XTv3DKDnPZVU8FFIDsrLSOa9G1A== - dependencies: - "@oclif/command" "^1.5.17" - "@oclif/errors" "^1.2.2" - "@oclif/parser" "^3.8.3" - "@oclif/plugin-help" "^2.2.0" - "@oclif/test" "^1.2.4" - "@salesforce/core" "^2.23.4" - "@salesforce/kit" "^1.2.2" - "@salesforce/ts-types" "^1.2.0" - chalk "^2.4.2" - cli-ux "^4.9.3" - -"@salesforce/command@^4.1.5": +"@salesforce/command@^4.1.5", "@salesforce/command@^4.2.2": version "4.2.2" resolved "https://registry.yarnpkg.com/@salesforce/command/-/command-4.2.2.tgz#2d1c301d771a6a6aac3cf25f14f18e829bf37b1d" integrity sha512-2QEtPIMaeRyUEnLmPHJ1PhfKDJBupfQS5T4nG8rXpK2yOznBu48aPWaWCYErrxyC0bPa5eoFACeyPWz1k9QMog== @@ -676,7 +677,7 @@ chalk "^2.4.2" cli-ux "^4.9.3" -"@salesforce/core@^2.23.4", "@salesforce/core@^2.24.0", "@salesforce/core@^2.25.1", "@salesforce/core@^2.29.0", "@salesforce/core@^2.35.0": +"@salesforce/core@^2.24.0", "@salesforce/core@^2.29.0", "@salesforce/core@^2.35.0": version "2.35.0" resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-2.35.0.tgz#15890d5b0294c56b5b435a4803f37f6a0c177893" integrity sha512-eqBZtaHn3s3FsASjsrZ8T9e/TE+aHuB2DkuKDEierDYW5cSVqJyZ0ccMi9QKI7oQuPO1UHhcUyWmyezkdEjYzg== @@ -700,6 +701,30 @@ semver "^7.3.5" ts-retry-promise "^0.6.0" +"@salesforce/core@^2.36.0": + version "2.36.0" + resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-2.36.0.tgz#eadade3d663f0a2e11d0cc9f9097c528c182997d" + integrity sha512-VsKt7SXArxrOelaJl5Ez21Pmtdp2eU6qimqZ5clxnNaZDZKOySDPYnKHu7AYCt1LUNFN9cfsX8K5yOHxS+wT+w== + dependencies: + "@salesforce/bunyan" "^2.0.0" + "@salesforce/kit" "^1.5.17" + "@salesforce/schemas" "^1.0.1" + "@salesforce/ts-types" "^1.5.20" + "@types/graceful-fs" "^4.1.5" + "@types/jsforce" "^1.9.41" + "@types/mkdirp" "^1.0.1" + archiver "^5.3.0" + debug "^3.1.0" + faye "^1.4.0" + graceful-fs "^4.2.4" + js2xmlparser "^4.0.1" + jsen "0.6.6" + jsforce "^1.11.0" + jsonwebtoken "8.5.0" + mkdirp "1.0.4" + semver "^7.3.5" + ts-retry-promise "^0.6.0" + "@salesforce/dev-config@^3.0.0": version "3.0.0" resolved "https://registry.yarnpkg.com/@salesforce/dev-config/-/dev-config-3.0.0.tgz#a87e2cc310011a3364fc0a5d6c5550daa3192642" @@ -745,7 +770,7 @@ typedoc-plugin-missing-exports "0.22.6" typescript "^4.1.3" -"@salesforce/kit@^1.2.2", "@salesforce/kit@^1.5.13", "@salesforce/kit@^1.5.17": +"@salesforce/kit@^1.5.13", "@salesforce/kit@^1.5.17": version "1.5.32" resolved "https://registry.yarnpkg.com/@salesforce/kit/-/kit-1.5.32.tgz#ed5925ea6cca23ef7cdef8086d9e663e50f98e93" integrity sha512-5MIYLLx1Ee3eTcqEoqFXDCKXwtU8J5wo1QWyzb+BjReNGLVUuSc6Qi5JoCZtYGXeZpdBJmM3s9Y14QXr53ZmQw== @@ -788,7 +813,7 @@ sinon "^5.1.1" tslib "^2.2.0" -"@salesforce/ts-types@^1.2.0", "@salesforce/ts-types@^1.5.17", "@salesforce/ts-types@^1.5.20": +"@salesforce/ts-types@^1.5.17", "@salesforce/ts-types@^1.5.20": version "1.5.20" resolved "https://registry.yarnpkg.com/@salesforce/ts-types/-/ts-types-1.5.20.tgz#f6875a710ceca48223b240026a14af6d3b39882f" integrity sha512-Ov6um4CWd63EvkRavkHG0J/P9XYL55sdkDWPMr7+AIgqh5flHxDRz09/C4e9M94aX30rzJxW4TVX6EBf4Cu2BQ== @@ -915,6 +940,13 @@ dependencies: "@types/node" "*" +"@types/jsforce@^1.9.41": + version "1.9.41" + resolved "https://registry.yarnpkg.com/@types/jsforce/-/jsforce-1.9.41.tgz#08b31a0d04e14fd5f8a232196e16bc742e22bbed" + integrity sha512-J0dReK6EPGR98b4fAowqqQqFXH4DGtPxY2lLrZGcuCthrHYkYNrKnfGf2xM1jwiBC5CGdSEDmWEDwRwwmX25tA== + dependencies: + "@types/node" "*" + "@types/json-schema@^7.0.7": version "7.0.7" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad"