Skip to content

Commit bf753e2

Browse files
authored
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
1 parent 0a6ef67 commit bf753e2

38 files changed

Lines changed: 113 additions & 68 deletions

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
"bugs": "https://github.com/forcedotcom/analyticsdx-vscode/issues",
77
"dependencies": {
88
"@oclif/config": "^1",
9-
"@salesforce/command": "^3.1.3",
10-
"@salesforce/core": "^2.25.1",
9+
"@oclif/plugin-help": "^3.3.1",
10+
"@salesforce/command": "^4.2.2",
11+
"@salesforce/core": "^2.36.0",
1112
"moment": "^2.24.0",
1213
"tslib": "^2"
1314
},

src/commands/analytics/app/create.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
77

8+
import { promises as fs } from 'fs';
89
import { EOL } from 'os';
910
import { flags, SfdxCommand } from '@salesforce/command';
10-
import { fs, Messages, Org, SfdxError, StatusResult, StreamingClient } from '@salesforce/core';
11+
import { Messages, Org, SfdxError, StatusResult, StreamingClient } from '@salesforce/core';
1112
import { Duration } from '@salesforce/kit';
1213
import { JsonMap } from '@salesforce/ts-types';
1314
import chalk from 'chalk';

src/commands/analytics/query.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
77

8+
import { promises as fs } from 'fs';
89
import * as path from 'path';
910
import { flags, SfdxCommand } from '@salesforce/command';
10-
import { fs, Messages, Org, SfdxError } from '@salesforce/core';
11+
import { Messages, Org, SfdxError } from '@salesforce/core';
1112
import QuerySvc, {
1213
DRYRUN_FLAG,
1314
LIMIT_FLAG,

test/commands/app/create.test.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
77

8-
import { core } from '@salesforce/command';
8+
import { promises as fs } from 'fs';
9+
import * as core from '@salesforce/core';
910
import { expect, test } from '@salesforce/command/lib/test';
1011
import { AnyJson, ensureJsonMap, ensureString } from '@salesforce/ts-types';
1112
import { StreamingClient } from '@salesforce/core';
@@ -188,7 +189,7 @@ describe('analytics:app:create', () => {
188189
}
189190
return Promise.reject();
190191
})
191-
.stub(core.fs, 'readFile', () =>
192+
.stub(fs, 'readFile', () =>
192193
Promise.resolve(
193194
JSON.stringify({
194195
templateSourceId: testTemplateJson.id,
@@ -222,7 +223,7 @@ describe('analytics:app:create', () => {
222223
}
223224
return Promise.reject();
224225
})
225-
.stub(core.fs, 'readFile', () =>
226+
.stub(fs, 'readFile', () =>
226227
Promise.resolve(
227228
JSON.stringify({
228229
templateSourceId: testTemplateJson.id,
@@ -256,7 +257,7 @@ describe('analytics:app:create', () => {
256257
}
257258
return Promise.reject();
258259
})
259-
.stub(core.fs, 'readFile', () =>
260+
.stub(fs, 'readFile', () =>
260261
Promise.resolve(
261262
JSON.stringify({
262263
assetIcon: '16.png',
@@ -300,7 +301,7 @@ describe('analytics:app:create', () => {
300301
})
301302
};
302303
})
303-
.stub(core.fs, 'readFile', () =>
304+
.stub(fs, 'readFile', () =>
304305
Promise.resolve(
305306
JSON.stringify({
306307
templateSourceId: testTemplateJson.id,
@@ -346,7 +347,7 @@ describe('analytics:app:create', () => {
346347
}
347348
};
348349
})
349-
.stub(core.fs, 'readFile', () =>
350+
.stub(fs, 'readFile', () =>
350351
Promise.resolve(
351352
JSON.stringify({
352353
templateSourceId: testTemplateJson.id,
@@ -396,7 +397,7 @@ describe('analytics:app:create', () => {
396397
})
397398
};
398399
})
399-
.stub(core.fs, 'readFile', () =>
400+
.stub(fs, 'readFile', () =>
400401
Promise.resolve(
401402
JSON.stringify({
402403
templateSourceId: testTemplateJson.id,
@@ -446,7 +447,7 @@ describe('analytics:app:create', () => {
446447
}
447448
};
448449
})
449-
.stub(core.fs, 'readFile', () =>
450+
.stub(fs, 'readFile', () =>
450451
Promise.resolve(
451452
JSON.stringify({
452453
templateSourceId: testTemplateJson.id,

test/commands/app/decouple.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
77

8-
import { core } from '@salesforce/command';
8+
import * as core from '@salesforce/core';
99
import { expect, test } from '@salesforce/command/lib/test';
1010

1111
core.Messages.importMessagesDirectory(__dirname);

test/commands/app/delete.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Licensed under the BSD 3-Clause license.
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
7-
import { core } from '@salesforce/command';
7+
import * as core from '@salesforce/core';
88
import { expect, test } from '@salesforce/command/lib/test';
99
import { ensureJsonMap } from '@salesforce/ts-types';
1010

test/commands/app/display.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
77

8-
import { core } from '@salesforce/command';
8+
import * as core from '@salesforce/core';
99
import { expect, test } from '@salesforce/command/lib/test';
1010

1111
core.Messages.importMessagesDirectory(__dirname);

test/commands/app/list.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
77

8-
import { core } from '@salesforce/command';
8+
import * as core from '@salesforce/core';
99
import { expect, test } from '@salesforce/command/lib/test';
1010
import { ensureJsonMap, ensureString } from '@salesforce/ts-types';
1111

test/commands/app/update.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
77

8-
import { core } from '@salesforce/command';
8+
import * as core from '@salesforce/core';
99
import { expect, test } from '@salesforce/command/lib/test';
1010

1111
const messages = core.Messages.loadMessages('@salesforce/analytics', 'app');

test/commands/asset/publisher/create.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
77

8-
import { core } from '@salesforce/command';
8+
import * as core from '@salesforce/core';
99
import { expect, test } from '@salesforce/command/lib/test';
1010

1111
core.Messages.importMessagesDirectory(__dirname);

0 commit comments

Comments
 (0)