Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
[ENG-8317][cli] deprecate publish:* (#4685)
Browse files Browse the repository at this point in the history
* [expo-cli] deprecate publish command

* Update packages/expo-cli/src/commands/publish/deprecationNotice.ts

Co-authored-by: James Ide <ide@users.noreply.github.com>

* fix lint

---------

Co-authored-by: James Ide <ide@users.noreply.github.com>
  • Loading branch information
quinlanj and ide committed Apr 21, 2023
1 parent bcaad85 commit 25f37af
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 5 deletions.
11 changes: 11 additions & 0 deletions packages/expo-cli/src/commands/publish/deprecationNotice.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Log from '../../log';
import { learnMore } from '../utils/TerminalLink';

export async function printDeprecationNotice(): Promise<void> {
Log.warn(
'The last day to use expo publish is 2024-02-12 and SDK 49 is the last version to support it. Migrate to eas update.'
);
Log.warn(
`${learnMore('https://blog.expo.dev/sunsetting-expo-publish-and-classic-updates-6cb9cd295378')}`
);
}
11 changes: 6 additions & 5 deletions packages/expo-cli/src/commands/publish/publish.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import chalk from 'chalk';
import type { Command } from 'commander';

import { applyAsyncActionProjectDir } from '../utils/applyAsyncAction';
Expand All @@ -7,7 +8,7 @@ export default function (program: Command) {
program
.command('publish [path]')
.alias('p')
.description('Deploy a project to Expo hosting')
.description(`${chalk.yellow`Superseded`} by ${chalk.bold`eas update`} in eas-cli`)
.helpGroup('publish')
.option('-q, --quiet', 'Suppress verbose output from the Metro bundler.')
.option('-s, --send-to [dest]', 'A phone number or email address to send a link to')
Expand All @@ -30,7 +31,7 @@ export default function (program: Command) {
program
.command('publish:set [path]')
.alias('ps')
.description('Specify the channel to serve a published release')
.description(`${chalk.yellow`Superseded`} by ${chalk.bold`eas update:republish`} in eas-cli`)
.helpGroup('publish')
.option(
'-c, --release-channel <name>',
Expand All @@ -48,7 +49,7 @@ export default function (program: Command) {
program
.command('publish:rollback [path]')
.alias('pr')
.description('Undo an update to a channel')
.description(`${chalk.yellow`Superseded`} by ${chalk.bold`eas update:republish`} in eas-cli`)
.helpGroup('publish')
.option('--channel-id <channel-id>', 'This flag is deprecated.')
.option('-c, --release-channel <name>', 'The channel to rollback from. (Required)')
Expand All @@ -62,7 +63,7 @@ export default function (program: Command) {
program
.command('publish:history [path]')
.alias('ph')
.description("Log the project's releases")
.description(`${chalk.yellow`Superseded`} by ${chalk.bold`eas update:list`} in eas-cli`)
.helpGroup('publish')
.option(
'-c, --release-channel <name>',
Expand All @@ -87,7 +88,7 @@ export default function (program: Command) {
program
.command('publish:details [path]')
.alias('pd')
.description('Log details of a published release')
.description(`${chalk.yellow`Superseded`} by ${chalk.bold`eas update:view`} in eas-cli`)
.helpGroup('publish')
.option('--publish-id <publish-id>', 'Publication id. (Required)')
.option('-r, --raw', 'Produce some raw output.'),
Expand Down
2 changes: 2 additions & 0 deletions packages/expo-cli/src/commands/publish/publishAsync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { confirmAsync } from '../../utils/prompts';
import * as TerminalLink from '../utils/TerminalLink';
import { formatNamedWarning } from '../utils/logConfigWarnings';
import * as sendTo from '../utils/sendTo';
import { printDeprecationNotice } from './deprecationNotice';

const EAS_UPDATE_URL = 'https://u.expo.dev';

Expand All @@ -37,6 +38,7 @@ export async function actionAsync(
projectRoot: string,
options: Options = {}
): Promise<Project.PublishedProjectResult> {
printDeprecationNotice();
assertValidReleaseChannel(options.releaseChannel);

const { exp, pkg } = getConfig(projectRoot, {
Expand Down
2 changes: 2 additions & 0 deletions packages/expo-cli/src/commands/publish/publishDetailsAsync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import {
getPublicationDetailAsync,
printPublicationDetailAsync,
} from '../utils/PublishUtils';
import { printDeprecationNotice } from './deprecationNotice';

export async function actionAsync(projectRoot: string, options: DetailOptions) {
printDeprecationNotice();
assert(options.publishId, '--publish-id must be specified.');

const detail = await getPublicationDetailAsync(projectRoot, options);
Expand Down
2 changes: 2 additions & 0 deletions packages/expo-cli/src/commands/publish/publishHistoryAsync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ import dateFormat from 'dateformat';
import Log from '../../log';
import { getPublishHistoryAsync, HistoryOptions, Publication } from '../utils/PublishUtils';
import * as table from '../utils/cli-table';
import { printDeprecationNotice } from './deprecationNotice';

const HORIZ_CELL_WIDTH_SMALL = 15;
const HORIZ_CELL_WIDTH_MEDIUM = 20;
const HORIZ_CELL_WIDTH_BIG = 40;

export async function actionAsync(projectRoot: string, options: HistoryOptions) {
printDeprecationNotice();
const result = await getPublishHistoryAsync(projectRoot, options);

if (options.raw) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import assert from 'assert';

import CommandError from '../../CommandError';
import { RollbackOptions, rollbackPublicationFromChannelAsync } from '../utils/PublishUtils';
import { printDeprecationNotice } from './deprecationNotice';
import { getUsageAsync } from './getUsageAsync';

type Options = {
Expand All @@ -12,6 +13,7 @@ type Options = {
};

export async function actionAsync(projectRoot: string, options: Options) {
printDeprecationNotice();
assert(
!options.channelId,
'--channel-id flag is deprecated and does not do anything. Please use --release-channel and --sdk-version instead.'
Expand Down
2 changes: 2 additions & 0 deletions packages/expo-cli/src/commands/publish/publishSetAsync.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import * as table from '../../commands/utils/cli-table';
import Log from '../../log';
import { setPublishToChannelAsync } from '../utils/PublishUtils';
import { printDeprecationNotice } from './deprecationNotice';

type Options = { releaseChannel?: string; publishId?: string };

export async function actionAsync(projectRoot: string, options: Options): Promise<void> {
printDeprecationNotice();
if (!options.releaseChannel) {
throw new Error('You must specify a release channel.');
}
Expand Down

0 comments on commit 25f37af

Please sign in to comment.