Skip to content

Commit

Permalink
fix: rename devhub flag
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiand391 committed Mar 15, 2023
1 parent 5ff70c6 commit 5bb0a25
Show file tree
Hide file tree
Showing 29 changed files with 101 additions and 155 deletions.
28 changes: 14 additions & 14 deletions command-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"loglevel",
"package",
"seed-metadata",
"target-hub-org",
"target-dev-hub",
"wait"
],
"alias": ["force:package:beta:convert", "force:package:convert"]
Expand All @@ -69,14 +69,14 @@
"org-dependent",
"package-type",
"path",
"target-hub-org"
"target-dev-hub"
],
"alias": ["force:package:beta:create", "force:package:create"]
},
{
"command": "package:delete",
"plugin": "@salesforce/plugin-packaging",
"flags": ["api-version", "json", "loglevel", "no-prompt", "package", "target-hub-org", "undelete"],
"flags": ["api-version", "json", "loglevel", "no-prompt", "package", "target-dev-hub", "undelete"],
"alias": ["force:package:beta:delete", "force:package:delete"]
},
{
Expand Down Expand Up @@ -114,7 +114,7 @@
{
"command": "package:list",
"plugin": "@salesforce/plugin-packaging",
"flags": ["api-version", "json", "loglevel", "target-hub-org", "verbose"],
"flags": ["api-version", "json", "loglevel", "target-dev-hub", "verbose"],
"alias": ["force:package:beta:list", "force:package:list"]
},
{
Expand All @@ -140,7 +140,7 @@
"loglevel",
"name",
"package",
"target-hub-org"
"target-dev-hub"
],
"alias": ["force:package:beta:update", "force:package:update"]
},
Expand All @@ -167,7 +167,7 @@
"skip-ancestor-check",
"skip-validation",
"tag",
"target-hub-org",
"target-dev-hub",
"uninstall-script",
"validate-schema",
"verbose",
Expand All @@ -181,25 +181,25 @@
{
"command": "package:version:create:list",
"plugin": "@salesforce/plugin-packaging",
"flags": ["api-version", "created-last-days", "json", "loglevel", "status", "target-hub-org"],
"flags": ["api-version", "created-last-days", "json", "loglevel", "status", "target-dev-hub"],
"alias": ["force:package:beta:version:create:list", "force:package:version:create:list"]
},
{
"command": "package:version:create:report",
"plugin": "@salesforce/plugin-packaging",
"flags": ["api-version", "json", "loglevel", "package-create-request-id", "target-hub-org"],
"flags": ["api-version", "json", "loglevel", "package-create-request-id", "target-dev-hub"],
"alias": ["force:package:beta:version:create:report", "force:package:version:create:report"]
},
{
"command": "package:version:delete",
"plugin": "@salesforce/plugin-packaging",
"flags": ["api-version", "json", "loglevel", "no-prompt", "package", "target-hub-org", "undelete"],
"flags": ["api-version", "json", "loglevel", "no-prompt", "package", "target-dev-hub", "undelete"],
"alias": ["force:package:beta:version:delete", "force:package:version:delete"]
},
{
"command": "package:version:displayancestry",
"plugin": "@salesforce/plugin-packaging",
"flags": ["api-version", "dot-code", "json", "loglevel", "package", "target-hub-org", "verbose"],
"flags": ["api-version", "dot-code", "json", "loglevel", "package", "target-dev-hub", "verbose"],
"alias": ["force:package:beta:version:displayancestry", "force:package:version:displayancestry"]
},
{
Expand All @@ -215,21 +215,21 @@
"order-by",
"packages",
"released",
"target-hub-org",
"target-dev-hub",
"verbose"
],
"alias": ["force:package:beta:version:list", "force:package:version:list"]
},
{
"command": "package:version:promote",
"plugin": "@salesforce/plugin-packaging",
"flags": ["api-version", "json", "loglevel", "no-prompt", "package", "target-hub-org"],
"flags": ["api-version", "json", "loglevel", "no-prompt", "package", "target-dev-hub"],
"alias": ["force:package:beta:version:promote", "force:package:version:promote"]
},
{
"command": "package:version:report",
"plugin": "@salesforce/plugin-packaging",
"flags": ["api-version", "json", "loglevel", "package", "target-hub-org", "verbose"],
"flags": ["api-version", "json", "loglevel", "package", "target-dev-hub", "verbose"],
"alias": ["force:package:beta:version:report", "force:package:version:report"]
},
{
Expand All @@ -243,7 +243,7 @@
"loglevel",
"package",
"tag",
"target-hub-org",
"target-dev-hub",
"version-description",
"version-name"
],
Expand Down
2 changes: 1 addition & 1 deletion messages/package_convert.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ To list package version creation requests in the org, run "<%= config.bin %> pac

- Similar to previous example, but uses the specified Dev Hub org:

<%= config.bin %> <%= command.id %> --package 033... --installation-key password123 --target-hub-org [email protected]
<%= config.bin %> <%= command.id %> --package 033... --installation-key password123 --target-dev-hub [email protected]

# flags.package.summary

Expand Down
2 changes: 1 addition & 1 deletion messages/package_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Run '<%= config.bin %> package list to list all packages in the Dev Hub org.

- Create a managed packaged from the "force-app" directory files, give the package a description, and use the specified Dev Hub org:

<%= config.bin %> <%= command.id %> --name MyManagedPackage --description "Your Package Descripton" --package-type Managed --path force-app --target-hub-org [email protected]
<%= config.bin %> <%= command.id %> --name MyManagedPackage --description "Your Package Descripton" --package-type Managed --path force-app --target-dev-hub [email protected]

# flags.name.summary

Expand Down
2 changes: 1 addition & 1 deletion messages/package_delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Delete unlocked and second-generation managed packages. Before you delete a pack

- Delete a package using its ID from the specified Dev Hub org:

<%= config.bin %> <%= command.id %> --package 0Ho... --target-hub-org [email protected]
<%= config.bin %> <%= command.id %> --package 0Ho... --target-dev-hub [email protected]

# flags.package.summary

Expand Down
2 changes: 1 addition & 1 deletion messages/package_displayancestry.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Display the ancestry tree for a 2GP managed package version.

- Display the ancestry tree for a package with the specified ID, using the Dev Hub org with username [email protected]:

<%= config.bin %> <%= command.id %> --package OHo... --target-hub-org [email protected]
<%= config.bin %> <%= command.id %> --package OHo... --target-dev-hub [email protected]

- Display the ancestry tree of a package version with the specified ID, using your default Dev Hub org:

Expand Down
4 changes: 2 additions & 2 deletions messages/package_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ You can view the namespace, IDs, and other details for each package.

- List all packages in the specified Dev Hub org:

<%= config.bin %> <%= command.id %> --target-hub-org [email protected]
<%= config.bin %> <%= command.id %> --target-dev-hub [email protected]

- List all packages details in the specified Dev Hub org, and show extended details about each package:

<%= config.bin %> <%= command.id %> --target-hub-org [email protected] --verbose
<%= config.bin %> <%= command.id %> --target-dev-hub [email protected] --verbose

# namespace

Expand Down
2 changes: 1 addition & 1 deletion messages/package_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Run "<%= config.bin %> package list" to list all packages in the Dev Hub org.

- Update the description of the package with the specified ID; uses the specified Dev Hub org:

<%= config.bin %> <%= command.id %> --package 0Ho... --description "New Package Description" --target-hub-org [email protected]
<%= config.bin %> <%= command.id %> --package 0Ho... --description "New Package Description" --target-dev-hub [email protected]

# flags.package.summary

Expand Down
2 changes: 1 addition & 1 deletion messages/package_version_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ We don’t calculate code coverage for org-dependent unlocked packages, or for p

- Create a package version from a package with the specified alias; uses the Dev Hub org with username [email protected]:

<%= config.bin %> <%= command.id %> --package "Your Package Alias" --installation-key password123 --target-hub-org [email protected]
<%= config.bin %> <%= command.id %> --package "Your Package Alias" --installation-key password123 --target-dev-hub [email protected]

- Create a package version from a package with the specified ID:

Expand Down
2 changes: 1 addition & 1 deletion messages/package_version_create_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Status of the version creation request, used to filter the list.

- List package version creation requests from the last 3 days in the Dev Hub org with username [email protected]:

<%= config.bin %> <%= command.id %> --created-last-days 3 --target-hub-org
<%= config.bin %> <%= command.id %> --created-last-days 3 --target-dev-hub

- List package version creation requests with status Error:

Expand Down
2 changes: 1 addition & 1 deletion messages/package_version_create_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ To show all requests in the org, run "<%= config.bin %> package version create l

- Retrieve details about the specified package version creation request in the Dev Hub org with username [email protected]:

<%= config.bin %> <%= command.id %> --package-create-request-id 08c... --target-hub-org [email protected]
<%= config.bin %> <%= command.id %> --package-create-request-id 08c... --target-dev-hub [email protected]

# flags.package-create-request-id.summary

Expand Down
2 changes: 1 addition & 1 deletion messages/package_version_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Display extended package version details.

- List the released package versions for the two specified packages that were modified today; use the Dev Hub org with username [email protected]:

<%= config.bin %> <%= command.id %> --packages 0Ho000000000000,0Ho000000000001 --released --modified-last-days 0 --target-hub-org [email protected]
<%= config.bin %> <%= command.id %> --packages 0Ho000000000000,0Ho000000000001 --released --modified-last-days 0 --target-dev-hub [email protected]

- List all released package versions in your default Dev Hub org:

Expand Down
2 changes: 1 addition & 1 deletion messages/package_version_promote.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Supply the ID or alias of the package version you want to promote. Promotes the

- Promote the package version with the specified alias to released; uses the Dev Hub org with username [email protected]:

<%= config.bin %> <%= command.id %> --package awesome_package_alias --target-hub-org [email protected]
<%= config.bin %> <%= command.id %> --package awesome_package_alias --target-dev-hub [email protected]

- Promote the package version with an alias that has spaces to released:

Expand Down
2 changes: 1 addition & 1 deletion messages/package_version_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To update package version values, run "<%= config.bin %> package version update"

- Retrieve details about the package version with the specified alias (that contains spaces) from the Dev Hub org with username [email protected]:

<%= config.bin %> <%= command.id %> --package "Your Package Alias" --target-hub-org [email protected]
<%= config.bin %> <%= command.id %> --package "Your Package Alias" --target-dev-hub [email protected]

# flags.package.summary

Expand Down
2 changes: 1 addition & 1 deletion messages/package_version_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ To display details about a package version, run "<%= config.bin %> package versi

- Update the package version that has the specified ID with a new branch and tag; use the Dev Hub org with username [email protected]:

<%= config.bin %> <%= command.id %> --package 04t... --branch main --tag 'Release 1.0.7' --target-hub-org [email protected]
<%= config.bin %> <%= command.id %> --package 04t... --branch main --tag 'Release 1.0.7' --target-dev-hub [email protected]

- Update the package version that has the specified ID with a new description:

Expand Down
13 changes: 4 additions & 9 deletions src/commands/package/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/

import {
Flags,
loglevel,
orgApiVersionFlagWithDeprecations,
requiredHubFlagWithDeprecations,
SfCommand,
} from '@salesforce/sf-plugins-core';
import { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand } from '@salesforce/sf-plugins-core';
import { Lifecycle, Messages, SfError, SfProject } from '@salesforce/core';
import {
INSTALL_URL_BASE,
Expand All @@ -22,6 +16,7 @@ import {
} from '@salesforce/packaging';
import { camelCaseToTitleCase, Duration } from '@salesforce/kit';
import { Optional } from '@salesforce/ts-types';
import { requiredHubFlag } from '../../utils/hubFlag';

Messages.importMessagesDirectory(__dirname);
const messages = Messages.loadMessages('@salesforce/plugin-packaging', 'package_convert');
Expand All @@ -36,7 +31,7 @@ export class PackageConvert extends SfCommand<PackageVersionCreateRequestResult>
public static readonly hidden = true;
public static readonly flags = {
loglevel,
'target-hub-org': requiredHubFlagWithDeprecations,
'target-dev-hub': requiredHubFlag,
'api-version': orgApiVersionFlagWithDeprecations,
package: Flags.salesforceId({
length: 'both',
Expand Down Expand Up @@ -114,7 +109,7 @@ export class PackageConvert extends SfCommand<PackageVersionCreateRequestResult>
this.spinner.status = 'Converting Package';
const result = await Package.convert(
flags.package,
flags['target-hub-org'].getConnection(flags['api-version']),
flags['target-dev-hub'].getConnection(flags['api-version']),
{
wait: flags.wait,
installationKey: flags['installation-key'] as string,
Expand Down
13 changes: 4 additions & 9 deletions src/commands/package/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,10 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/

import {
Flags,
loglevel,
orgApiVersionFlagWithDeprecations,
requiredHubFlagWithDeprecations,
SfCommand,
} from '@salesforce/sf-plugins-core';
import { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand } from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core';
import { Package, PackageCreateOptions, PackageType } from '@salesforce/packaging';
import { requiredHubFlag } from '../../utils/hubFlag';

Messages.importMessagesDirectory(__dirname);
const messages = Messages.loadMessages('@salesforce/plugin-packaging', 'package_create');
Expand All @@ -28,7 +23,7 @@ export class PackageCreateCommand extends SfCommand<PackageCreate> {
public static readonly requiresProject = true;
public static readonly flags = {
loglevel,
'target-hub-org': requiredHubFlagWithDeprecations,
'target-dev-hub': requiredHubFlag,
'api-version': orgApiVersionFlagWithDeprecations,
name: Flags.string({
char: 'n',
Expand Down Expand Up @@ -89,7 +84,7 @@ export class PackageCreateCommand extends SfCommand<PackageCreate> {
path: flags.path,
};
const result: PackageCreate = await Package.create(
flags['target-hub-org'].getConnection(flags['api-version']),
flags['target-dev-hub'].getConnection(flags['api-version']),
this.project,
options
);
Expand Down
13 changes: 4 additions & 9 deletions src/commands/package/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,10 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/

import {
Flags,
loglevel,
orgApiVersionFlagWithDeprecations,
requiredHubFlagWithDeprecations,
SfCommand,
} from '@salesforce/sf-plugins-core';
import { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand } from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core';
import { Package, PackageSaveResult } from '@salesforce/packaging';
import { requiredHubFlag } from '../../utils/hubFlag';

Messages.importMessagesDirectory(__dirname);
const messages = Messages.loadMessages('@salesforce/plugin-packaging', 'package_delete');
Expand All @@ -27,7 +22,7 @@ export class PackageDeleteCommand extends SfCommand<PackageSaveResult> {
public static readonly requiresProject = true;
public static readonly flags = {
loglevel,
'target-hub-org': requiredHubFlagWithDeprecations,
'target-dev-hub': requiredHubFlag,
'api-version': orgApiVersionFlagWithDeprecations,
'no-prompt': Flags.boolean({
char: 'n',
Expand Down Expand Up @@ -56,7 +51,7 @@ export class PackageDeleteCommand extends SfCommand<PackageSaveResult> {
}

const pkg = new Package({
connection: flags['target-hub-org'].getConnection(flags['api-version']),
connection: flags['target-dev-hub'].getConnection(flags['api-version']),
project: this.project,
packageAliasOrId: flags.package,
});
Expand Down
13 changes: 4 additions & 9 deletions src/commands/package/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,11 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/

import {
Flags,
loglevel,
orgApiVersionFlagWithDeprecations,
requiredHubFlagWithDeprecations,
SfCommand,
} from '@salesforce/sf-plugins-core';
import { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand } from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core';
import { Package, PackagingSObjects } from '@salesforce/packaging';
import * as chalk from 'chalk';
import { requiredHubFlag } from '../../utils/hubFlag';

Messages.importMessagesDirectory(__dirname);
const messages = Messages.loadMessages('@salesforce/plugin-packaging', 'package_list');
Expand Down Expand Up @@ -48,7 +43,7 @@ export class PackageListCommand extends SfCommand<PackageListCommandResult> {
public static readonly aliases = ['force:package:beta:list', 'force:package:list'];
public static readonly flags = {
loglevel,
'target-hub-org': requiredHubFlagWithDeprecations,
'target-dev-hub': requiredHubFlag,
'api-version': orgApiVersionFlagWithDeprecations,
verbose: Flags.boolean({
summary: messages.getMessage('flags.verbose.summary'),
Expand All @@ -59,7 +54,7 @@ export class PackageListCommand extends SfCommand<PackageListCommandResult> {

public async run(): Promise<PackageListCommandResult> {
const { flags } = await this.parse(PackageListCommand);
const queryResult = await Package.list(flags['target-hub-org'].getConnection(flags['api-version']));
const queryResult = await Package.list(flags['target-dev-hub'].getConnection(flags['api-version']));
this.mapRecordsToResults(queryResult);
this.displayResults(flags.verbose);
return this.results;
Expand Down
Loading

0 comments on commit 5bb0a25

Please sign in to comment.