File tree Expand file tree Collapse file tree 3 files changed +11
-8
lines changed
src/commands/force/package/beta
test/commands/force/package Expand file tree Collapse file tree 3 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 8
8
import * as os from 'os' ;
9
9
import { Messages } from '@salesforce/core' ;
10
10
import { SfdxCommand } from '@salesforce/command' ;
11
- import { packageInstalledList } from '@salesforce/packaging' ;
12
11
import { CliUx } from '@oclif/core' ;
12
+ import { Package } from '@salesforce/packaging' ;
13
13
14
14
Messages . importMessagesDirectory ( __dirname ) ;
15
15
const messages = Messages . loadMessages ( '@salesforce/plugin-packaging' , 'package_installed_list' ) ;
@@ -31,7 +31,7 @@ export class PackageInstalledListCommand extends SfdxCommand {
31
31
public static readonly requiresProject = true ;
32
32
33
33
public async run ( ) : Promise < PackageInstalledListResult [ ] > {
34
- const result = await packageInstalledList ( this . org . getConnection ( ) ) ;
34
+ const result = await Package . installedList ( this . org . getConnection ( ) ) ;
35
35
36
36
const records = result . map ( ( record ) => ( {
37
37
Id : record . Id ,
Original file line number Diff line number Diff line change 8
8
import * as os from 'os' ;
9
9
import { flags , FlagsConfig , SfdxCommand } from '@salesforce/command' ;
10
10
import { Messages } from '@salesforce/core' ;
11
- import { PackageAncestry , PackageAncestryNodeData } from '@salesforce/packaging' ;
11
+ import { PackageAncestryNodeData , PackageVersion } from '@salesforce/packaging' ;
12
12
13
13
// Import i18n messages
14
14
Messages . importMessagesDirectory ( __dirname ) ;
@@ -41,11 +41,11 @@ export class PackageVersionDisplayAncestryCommand extends SfdxCommand {
41
41
} ;
42
42
43
43
public async run ( ) : Promise < PackageAncestryNodeData | string > {
44
- const packageAncestry = await PackageAncestry . create ( {
45
- packageId : this . flags . package as string ,
46
- project : this . project ,
47
- connection : this . hubOrg . getConnection ( ) ,
48
- } ) ;
44
+ const packageAncestry = await PackageVersion . getAncestry (
45
+ this . flags . package as string ,
46
+ this . project ,
47
+ this . hubOrg . getConnection ( )
48
+ ) ;
49
49
const jsonProducer = packageAncestry . getJsonProducer ( ) ;
50
50
if ( this . flags . dotcode ) {
51
51
const dotProducer = packageAncestry . getDotProducer ( ) ;
Original file line number Diff line number Diff line change @@ -245,6 +245,9 @@ describe('force:package:install', () => {
245
245
}
246
246
} ) ;
247
247
248
+ // TODO: It seems that while linking @salesforce /packaging into the plugin
249
+ // we cannot stub the library calls of `SfProject.getInstance` e.g. "SfProject, 'getInstance'"
250
+ // once the library has been published, the stubs resume to work and this test will pass
248
251
it ( 'should print SUCCESS status correctly for package alias' , async ( ) => {
249
252
// Stubs SfProject.getInstance, SfProject.getSfProjectJson, and SfProjectJson.getContents
250
253
// in a way that makes TS happy... all to test package aliases.
You can’t perform that action at this time.
0 commit comments