Skip to content

Commit

Permalink
feat: hide deprecated commands (#1050)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc authored Jan 3, 2024
1 parent 6ceea73 commit ed172ae
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 29 deletions.
4 changes: 2 additions & 2 deletions src/commands/force/mdapi/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/


import { Duration, env } from '@salesforce/kit';
import { Lifecycle, Messages, Org } from '@salesforce/core';
import { AsyncResult, DeployVersionData, MetadataApiDeploy } from '@salesforce/source-deploy-retrieve';
Expand All @@ -32,7 +31,7 @@ import { DeployProgressStatusFormatter } from '../../../formatters/deployProgres
import { MdDeployAsyncResultFormatter } from '../../../formatters/mdapi/mdDeployAsyncResultFormatter.js';
import { ResultFormatterOptions } from '../../../formatters/resultFormatter.js';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-source', 'md.deploy');
const deployMessages = Messages.loadMessages('@salesforce/plugin-source', 'deployCommand');

Expand All @@ -46,6 +45,7 @@ export class Deploy extends DeployCommand {
to: replacement,
message: messages.getMessage('deprecation', [replacement]),
};
public static readonly hidden = true;
public static readonly summary = messages.getMessage('summary');
public static readonly examples = messages.getMessages('examples');
public static readonly flags = {
Expand Down
4 changes: 2 additions & 2 deletions src/commands/force/mdapi/deploy/cancel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/


import { Connection, Messages, SfError } from '@salesforce/core';
import { Duration } from '@salesforce/kit';
import { RequestStatus } from '@salesforce/source-deploy-retrieve';
Expand All @@ -23,7 +22,7 @@ import {
DeployCancelResultFormatter,
} from '../../../../formatters/deployCancelResultFormatter.js';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-source', 'md.cancel');

const replacement = 'project deploy cancel';
Expand All @@ -33,6 +32,7 @@ export class Cancel extends DeployCommand {
public static readonly summary = messages.getMessage('summary');
public static readonly examples = messages.getMessages('examples');
public static readonly state = 'deprecated';
public static readonly hidden = true;
public static readonly deprecationOptions = {
to: replacement,
message: messages.getMessage('deprecation', [replacement]),
Expand Down
4 changes: 2 additions & 2 deletions src/commands/force/mdapi/deploy/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/


import { Messages, Org } from '@salesforce/core';
import { Duration, env } from '@salesforce/kit';
import { RequestStatus } from '@salesforce/source-deploy-retrieve';
Expand All @@ -24,7 +23,7 @@ import { ProgressFormatter } from '../../../../formatters/progressFormatter.js';
import { DeployProgressBarFormatter } from '../../../../formatters/deployProgressBarFormatter.js';
import { DeployProgressStatusFormatter } from '../../../../formatters/deployProgressStatusFormatter.js';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-source', 'md.deployreport');

const replacement = 'project deploy report';
Expand All @@ -34,6 +33,7 @@ export class Report extends DeployCommand {
public static readonly description = messages.getMessage('description');
public static readonly examples = messages.getMessages('examples');
public static readonly state = 'deprecated';
public static readonly hidden = true;
public static readonly deprecationOptions = {
to: replacement,
message: messages.getMessage('deprecation', ['project deploy start', replacement]),
Expand Down
4 changes: 2 additions & 2 deletions src/commands/force/mdapi/retrieve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/


import { Lifecycle, Messages, Org, SfError, SfProject } from '@salesforce/core';
import { Duration } from '@salesforce/kit';
import {
Expand All @@ -32,7 +31,7 @@ import {
RetrieveResultFormatter,
} from '../../../formatters/mdapi/retrieveResultFormatter.js';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-source', 'md.retrieve');
const spinnerMessages = Messages.loadMessages('@salesforce/plugin-source', 'spinner');
const retrieveMessages = Messages.loadMessages('@salesforce/plugin-source', 'retrieve');
Expand All @@ -45,6 +44,7 @@ export class Retrieve extends SourceCommand {
to: replacement,
message: messages.getMessage('deprecation', [replacement]),
};
public static readonly hidden = true;
public static readonly summary = messages.getMessage('retrieve.summary');
public static readonly description = messages.getMessage('retrieve.description');
public static readonly examples = messages.getMessages('retrieve.examples');
Expand Down
4 changes: 2 additions & 2 deletions src/commands/force/mdapi/retrieve/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/


import { Messages, Org, SfError } from '@salesforce/core';
import { Duration } from '@salesforce/kit';
import { MetadataApiRetrieve, MetadataApiRetrieveStatus, RetrieveResult } from '@salesforce/source-deploy-retrieve';
Expand All @@ -25,7 +24,7 @@ import {
RetrieveResultFormatter,
} from '../../../../formatters/mdapi/retrieveResultFormatter.js';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-source', 'md.retrieve');
const spinnerMessages = Messages.loadMessages('@salesforce/plugin-source', 'spinner');
export type ReportCommandResult = RetrieveCommandResult | RetrieveCommandAsyncResult;
Expand All @@ -34,6 +33,7 @@ export class Report extends SourceCommand {
public static readonly description = messages.getMessage('report.description');
public static readonly examples = messages.getMessages('report.examples');
public static readonly state = 'deprecated';
public static readonly hidden = true;
public static readonly flags = {
'api-version': orgApiVersionFlagWithDeprecations,
loglevel,
Expand Down
5 changes: 2 additions & 3 deletions src/commands/force/source/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/



import { Lifecycle, Messages, Org } from '@salesforce/core';
import { Duration, env } from '@salesforce/kit';
import { SourceTracking } from '@salesforce/source-tracking';
Expand Down Expand Up @@ -37,7 +35,7 @@ import { DeployProgressStatusFormatter } from '../../../formatters/deployProgres
import { filterConflictsByComponentSet, trackingSetup, updateTracking } from '../../../trackingFunctions.js';
import { ResultFormatterOptions } from '../../../formatters/resultFormatter.js';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);

const messages = Messages.loadMessages('@salesforce/plugin-source', 'deploy');
const deployMessages = Messages.loadMessages('@salesforce/plugin-source', 'deployCommand');
Expand All @@ -53,6 +51,7 @@ export class Deploy extends DeployCommand {
public static readonly description = messages.getMessage('description');
public static readonly examples = messages.getMessages('examples');
public static readonly state = 'deprecated';
public static readonly hidden = true;
public static readonly deprecationOptions = {
to: replacement,
message: messages.getMessage('deprecation', [replacement]),
Expand Down
4 changes: 2 additions & 2 deletions src/commands/force/source/deploy/cancel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/


import { Messages, SfError } from '@salesforce/core';
import { Duration } from '@salesforce/kit';
import { RequestStatus } from '@salesforce/source-deploy-retrieve';
Expand All @@ -23,7 +22,7 @@ import {
DeployCancelResultFormatter,
} from '../../../../formatters/deployCancelResultFormatter.js';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-source', 'cancel');

const replacement = 'project deploy cancel';
Expand All @@ -32,6 +31,7 @@ export class Cancel extends DeployCommand {
public static readonly description = messages.getMessage('description');
public static readonly examples = messages.getMessages('examples');
public static readonly state = 'deprecated';
public static readonly hidden = true;
public static readonly deprecationOptions = {
to: replacement,
message: messages.getMessage('deprecation', [replacement]),
Expand Down
5 changes: 2 additions & 3 deletions src/commands/force/source/deploy/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/



import { Messages, SfProject } from '@salesforce/core';

import { Duration, env } from '@salesforce/kit';
Expand All @@ -30,7 +28,7 @@ import { DeployProgressBarFormatter } from '../../../../formatters/deployProgres
import { DeployProgressStatusFormatter } from '../../../../formatters/deployProgressStatusFormatter.js';
import { ResultFormatterOptions } from '../../../../formatters/resultFormatter.js';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-source', 'report');

const replacement = 'project deploy report';
Expand All @@ -40,6 +38,7 @@ export class Report extends DeployCommand {
public static readonly summary = messages.getMessage('summary');
public static readonly examples = messages.getMessages('examples');
public static readonly state = 'deprecated';
public static readonly hidden = true;
public static readonly deprecationOptions = {
to: replacement,
message: messages.getMessage('deprecation', ['project deploy start', replacement]),
Expand Down
5 changes: 2 additions & 3 deletions src/commands/force/source/pull.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/



import { Duration } from '@salesforce/kit';
import { Lifecycle, Messages } from '@salesforce/core';
import { FileResponse, RequestStatus, RetrieveVersionData, RetrieveResult } from '@salesforce/source-deploy-retrieve';
Expand All @@ -23,14 +21,15 @@ import { SourceCommand } from '../../../sourceCommand.js';
import { PullResponse, PullResultFormatter } from '../../../formatters/source/pullFormatter.js';
import { trackingSetup, updateTracking } from '../../../trackingFunctions.js';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-source', 'pull');
const retrieveMessages = Messages.loadMessages('@salesforce/plugin-source', 'retrieve');

const replacement = 'project retrieve start';

export default class Pull extends SourceCommand {
public static readonly state = 'deprecated';
public static readonly hidden = true;
public static readonly deprecationOptions = {
to: replacement,
message: messages.getMessage('deprecation', [replacement]),
Expand Down
5 changes: 2 additions & 3 deletions src/commands/force/source/push.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/



import { Duration, env } from '@salesforce/kit';
import { Lifecycle, Messages } from '@salesforce/core';
import { ComponentStatus, DeployResult, DeployVersionData, RequestStatus } from '@salesforce/source-deploy-retrieve';
Expand All @@ -27,14 +25,15 @@ import { DeployProgressBarFormatter } from '../../../formatters/deployProgressBa
import { DeployProgressStatusFormatter } from '../../../formatters/deployProgressStatusFormatter.js';
import { trackingSetup, updateTracking } from '../../../trackingFunctions.js';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-source', 'push');
const deployMessages = Messages.loadMessages('@salesforce/plugin-source', 'deployCommand');

const replacement = 'project deploy start';

export default class Push extends DeployCommand {
public static readonly state = 'deprecated';
public static readonly hidden = true;
public static readonly deprecationOptions = {
to: replacement,
message: messages.getMessage('deprecation', [replacement]),
Expand Down
4 changes: 2 additions & 2 deletions src/commands/force/source/retrieve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import { dirname, join, resolve } from 'node:path';
import fs from 'node:fs';


import { Lifecycle, Messages, SfError, SfProject } from '@salesforce/core';
import { Duration } from '@salesforce/kit';
import {
Expand Down Expand Up @@ -39,7 +38,7 @@ import {
import { filterConflictsByComponentSet, trackingSetup, updateTracking } from '../../../trackingFunctions.js';
import { promisesQueue } from '../../../promiseQueue.js';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-source', 'retrieve');
const spinnerMessages = Messages.loadMessages('@salesforce/plugin-source', 'spinner');
const retrieveMessages = Messages.loadMessages('@salesforce/plugin-source', 'retrieve');
Expand All @@ -52,6 +51,7 @@ export class Retrieve extends SourceCommand {
public static readonly examples = messages.getMessages('examples');
public static readonly requiresProject = true;
public static readonly state = 'deprecated';
public static readonly hidden = true;
public static readonly deprecationOptions = {
to: replacement,
message: messages.getMessage('deprecation', [replacement]),
Expand Down
5 changes: 2 additions & 3 deletions src/commands/force/source/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/



import { Messages } from '@salesforce/core';
import { ChangeResult, StatusOutputRow } from '@salesforce/source-tracking';
import { Interfaces } from '@oclif/core';
Expand All @@ -26,7 +24,7 @@ import {
} from '../../../formatters/source/statusFormatter.js';
import { trackingSetup } from '../../../trackingFunctions.js';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-source', 'status');

export type StatusCommandResult = StatusResult[];
Expand All @@ -36,6 +34,7 @@ export default class Status extends SfCommand<StatusCommandResult> {
public static readonly summary = messages.getMessage('summary');
public static readonly examples = messages.getMessages('examples');
public static readonly state = 'deprecated';
public static readonly hidden = true;
public static readonly deprecationOptions = {
to: replacement,
message: messages.getMessage('deprecation', [replacement]),
Expand Down

0 comments on commit ed172ae

Please sign in to comment.