Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/@ionic/cli/src/commands/deploy/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { input, strong, weak } from '../../lib/color';
import { Command } from '../../lib/command';
import { FatalException } from '../../lib/errors';
import { createRequest, download } from '../../lib/utils/http';
import { IONIC_CLOUD_CLI_MIGRATION } from '../../lib/updates';

const debug = Debug('ionic:commands:deploy:build');

Expand Down Expand Up @@ -45,7 +46,7 @@ export class BuildCommand extends Command {
return {
name: 'build',
type: 'project',
groups: [MetadataGroup.PAID],
groups: [MetadataGroup.PAID, MetadataGroup.DEPRECATED],
summary: 'Create a deploy build on Appflow',
description: `
This command creates a deploy build on Appflow. While the build is running, it prints the remote build log to the terminal. If the build is successful, it downloads the created web build zip file in the current directory. Downloading build artifacts can be skipped by supplying the flag ${input('skip-download')}.
Expand Down Expand Up @@ -100,7 +101,11 @@ Customizing the build:
};
}

async run(inputs: CommandLineInputs, options: CommandLineOptions): Promise<void> {
async preRun(inputs: CommandLineInputs, optinos: CommandLineOptions): Promise<void> {
this.env.log.warn(IONIC_CLOUD_CLI_MIGRATION);
}

async run(inputs: CommandLineInputs, options: CommandLineOptions): Promise<void> {
if (!this.project) {
throw new FatalException(`Cannot run ${input('ionic deploy build')} outside a project directory.`);
}
Expand Down
5 changes: 4 additions & 1 deletion packages/@ionic/cli/src/commands/package/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { Command } from '../../lib/command';
import { FatalException } from '../../lib/errors';
import { fileUtils } from '../../lib/utils/file';
import { createRequest, download } from '../../lib/utils/http';
import { IONIC_CLOUD_CLI_MIGRATION } from '../../lib/updates';

const debug = Debug('ionic:commands:package:build');
const PLATFORMS = ['android', 'ios'];
Expand Down Expand Up @@ -68,7 +69,7 @@ export class BuildCommand extends Command {
return {
name: 'build',
type: 'project',
groups: [MetadataGroup.PAID],
groups: [MetadataGroup.PAID, MetadataGroup.DEPRECATED],
summary: 'Create a package build on Appflow',
description: `
This command creates a package build on Appflow. While the build is running, it prints the remote build log to the terminal. If the build is successful, it downloads the created app package file in the current directory. Downloading build artifacts can be skipped by supplying the flag ${input('skip-download')}.
Expand Down Expand Up @@ -214,6 +215,8 @@ if you do not wish to download ${input('apk')}.
}

async preRun(inputs: CommandLineInputs, options: CommandLineOptions): Promise<void> {
this.env.log.warn(IONIC_CLOUD_CLI_MIGRATION);

if (!inputs[0]) {
const platformInput = await this.env.prompt({
type: 'list',
Expand Down
6 changes: 4 additions & 2 deletions packages/@ionic/cli/src/commands/package/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { isSuperAgentError } from '../../guards';
import { input, strong } from '../../lib/color';
import { Command } from '../../lib/command';
import { FatalException } from '../../lib/errors';
import { IONIC_CLOUD_CLI_MIGRATION } from '../../lib/updates';

import { PackageBuild } from './build';

Expand Down Expand Up @@ -49,7 +50,7 @@ export class DeployCommand extends Command {
return {
name: 'deploy',
type: 'project',
groups: [MetadataGroup.PAID],
groups: [MetadataGroup.PAID, MetadataGroup.DEPRECATED],
summary: 'Deploys a binary to a destination, such as an app store using Appflow',
description: `
This command deploys a binary to a destination using Appflow. While running, the remote log is printed to the terminal.
Expand Down Expand Up @@ -84,6 +85,7 @@ Both can be retrieved from the Dashboard[^dashboard].
inputs: CommandLineInputs,
options: CommandLineOptions
): Promise<void> {
this.env.log.warn(IONIC_CLOUD_CLI_MIGRATION);
if (!inputs[0]) {
const buildIdInputInput = await this.env.prompt({
type: 'input',
Expand All @@ -108,7 +110,7 @@ Both can be retrieved from the Dashboard[^dashboard].
async run(
inputs: CommandLineInputs,
options: CommandLineOptions
): Promise<void> {
): Promise<void> {
if (!this.project) {
throw new FatalException(
`Cannot run ${input(
Expand Down
8 changes: 5 additions & 3 deletions packages/@ionic/cli/src/commands/package/index.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
import { MetadataGroup } from '@ionic/cli-framework';
import { MetadataGroup, NamespaceMetadata } from '@ionic/cli-framework';

import { strong } from '../../lib/color';
import { CommandMap, Namespace } from '../../lib/namespace';
import { IONIC_CLOUD_CLI_MIGRATION } from '../../lib/updates';

export class PackageNamespace extends Namespace {
async getMetadata() {
async getMetadata(): Promise<NamespaceMetadata> {
return {
name: 'package',
summary: 'Appflow package functionality',
description: `
${IONIC_CLOUD_CLI_MIGRATION}
Interface to execute commands about package builds and deployments on Ionic Appflow.

Appflow package documentation:
- Overview: ${strong('https://ion.link/appflow-package-docs')}
`,
groups: [MetadataGroup.PAID],
groups: [MetadataGroup.PAID, MetadataGroup.DEPRECATED],
};
}

Expand Down
2 changes: 1 addition & 1 deletion packages/@ionic/cli/src/lib/color.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ const HELP_COLORS: Partial<HelpColors> = {

export const COLORS: Colors = { ...DEFAULT_COLORS, help: { ...DEFAULT_COLORS.help, ...HELP_COLORS } };

export const { strong, weak, input, success, failure, ancillary, help: { title } } = COLORS;
export const { strong, weak, input, success, failure, ancillary, help: { title }, log: { WARN } } = COLORS;
9 changes: 8 additions & 1 deletion packages/@ionic/cli/src/lib/updates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as semver from 'semver';

import { IConfig, IonicEnvironment } from '../definitions';

import { input, success, weak } from './color';
import { input, strong, success, weak, WARN } from './color';
import { sendMessage } from './helper';
import { pkgFromRegistry, pkgManagerArgs } from './utils/npm';

Expand Down Expand Up @@ -77,6 +77,13 @@ export async function runUpdateCheck({ config }: PersistPackageVersionsDeps): Pr
await writeUpdateConfig(dir, newUpdateConfig);
}

export const IONIC_CLOUD_CLI_MIGRATION = (() =>
`${strong(WARN('Deprecated: Ionic Appflow functionality has moved to the new Ionic Cloud CLI'))}.\n`+
`Existing functionality in the Ionic CLI is deprecated as of ${WARN('v6.18.0')}. `+
`This functionality will be removed from the Ionic CLI in the next major version. `+
`Please visit our simple guide to migrate to the Ionic Cloud CLI, available now.\n`+
`${strong('https://ionic.io/docs/appflow/cli/migration/')}\n`)();

export async function runNotify(env: IonicEnvironment, pkg: PersistedPackage, latestVersion: string): Promise<void> {
const dir = path.dirname(env.config.p);
const args = await pkgManagerArgs(env.config.get('npmClient'), { command: 'install', pkg: pkg.name, global: true });
Expand Down