Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "feat: create new amplify-prompts package to handle all terminal interactions" #7870

Closed
wants to merge 1 commit into from
Closed
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ packages/amplify-migration-tests/amplify-migration-reports
packages/amplify-migration-tests/lib
packages/amplify-headless-interface/lib
packages/amplify-provider-awscloudformation/lib
packages/amplify-prompts/lib
packages/amplify-util-import/lib
packages/amplify-util-headless-input/lib
packages/*/node_modules
Expand Down
39 changes: 0 additions & 39 deletions packages/amplify-cli-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ export type $TSAny = any;
// Use it for all CLI Context class references, it enables a quick way to see what we have on the context
export type $TSContext = {
amplify: AmplifyToolkit;
/**
* @deprecated Use printer from package amplify-prompts instead
*/
print: IContextPrint;
migrationInfo: $TSAny;
projectHasMobileHubResources: boolean;
Expand All @@ -52,49 +49,16 @@ export type CategoryName = string;
export type ResourceName = string;

export type IContextPrint = {
/**
* @deprecated Use printer.info from amplify-prommpts instead
*/
info: (message: string) => void;
/**
* @deprecated Why are you using this? If you really need it, implement it in amplify-prompts printer.ts
*/
fancy: (message?: string) => void;
/**
* @deprecated Use printer.warn from amplify-prompts instead
*/
warning: (message: string) => void;
/**
* @deprecated Use printer.error from amplify-prompts instead
*/
error: (message: string) => void;
/**
* @deprecated Use printer.success from amplify-prommpts instead
*/
success: (message: string) => void;
/**
* @deprecated The next time we refactor code that uses this function, refactor the table function into formatter.ts from amplify-prompts and use that instead
*/
table: (data: string[][], options?: { format?: 'markdown' | 'lean' }) => void;
/**
* @deprecated Use printer.debug from amplify-prompts instead
*/
debug: (message: string) => void;
/**
* @deprecated Use printer.info from amplify-prompts and specify color
*/
green: (message: string) => void;
/**
* @deprecated Use printer.info from amplify-prompts and specify color
*/
yellow: (message: string) => void;
/**
* @deprecated Use printer.info from amplify-prompts and specify color
*/
red: (message: string) => void;
/**
* @deprecated Use printer.info from amplify-prompts and specify color
*/
blue: (message: string) => void;
};

Expand Down Expand Up @@ -224,9 +188,6 @@ interface AmplifyToolkit {
getResourceStatus: (category?: $TSAny, resourceName?: $TSAny, providerName?: $TSAny, filteredResources?: $TSAny) => $TSAny;
getResourceOutputs: () => $TSAny;
getWhen: () => $TSAny;
/**
* @deprecated Use validators from amplify-prompts or add a new validator in that module
*/
inputValidation: (input: $TSAny) => (value: $TSAny) => boolean | string;
listCategories: () => $TSAny;
makeId: (n?: number) => string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import * as inquirer from 'inquirer';

/**
* @deprecated Use confirmContinue from ammplify-prompts instead
*/
export async function confirmPrompt(message: string, defaultValue = true) {
const ans = await inquirer.prompt({
name: 'yesno',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/**
* @deprecated Use validators from amplify-prompts or add a new validator to that module
* question is either of the legacy form:
* {
* validation: {
Expand Down
18 changes: 0 additions & 18 deletions packages/amplify-cli/src/extensions/amplify-helpers/print.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,22 @@ type CLIPrintColors = typeof importedColors & {

const colors = importedColors as CLIPrintColors;

/**
* @deprecated Use printer.info from amplify-prompts instead
*/
function info(message) {
console.log(colors.info(message));
}

/**
* @deprecated Use printer.warn from amplify-prompts instead
*/
function warning(message) {
console.log(colors.warning(message));
}

/**
* @deprecated Use printer.error from amplify-prompts instead
*/
function error(message) {
console.log(colors.error(message));
}

/**
* @deprecated Use printer.success from amplify-prompts instead
*/
function success(message) {
console.log(colors.success(message));
}

/**
* @deprecated Use printer.debug from amplify-prompts instead
*/
function debug(message, title = 'DEBUG') {
const topLine = `vvv -----[ ${title} ]----- vvv`;
const botLine = `^^^ -----[ ${title} ]----- ^^^`;
Expand All @@ -61,9 +46,6 @@ function debug(message, title = 'DEBUG') {
console.log(colors.rainbow(botLine));
}

/**
* @deprecated The next time we refactor code that uses this function, refactor the table function into formatter.ts from amplify-prompts and use that instead
*/
function table(data, options: any = {}) {
let t: CLITable.Table;
switch (options.format) {
Expand Down
7 changes: 0 additions & 7 deletions packages/amplify-prompts/jest.config.js

This file was deleted.

35 changes: 0 additions & 35 deletions packages/amplify-prompts/package.json

This file was deleted.

17 changes: 0 additions & 17 deletions packages/amplify-prompts/src/__tests__/formatter.test.ts

This file was deleted.

112 changes: 0 additions & 112 deletions packages/amplify-prompts/src/__tests__/printer.test.ts

This file was deleted.

Loading