forked from aws-amplify/amplify-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: revamp help command (aws-amplify#11667)
* feat: revamp help command * feat: revamp help command * feat: revamp help command * feat: revamp help command * feat: revamp help command * feat: revamp help command * feat: revamp help command (resolving merge conflicts) * feat: revamp help command (remove non-null assertions) * feat: revamp help command (remove non-null assertions) * feat: revamp help command (revisions) * feat: revamp help command (revisions) * feat: revamp help command (revisions) * feat: revamp help command (update to use array find) * feat: revamp help command (switch to single quotes) * feat: revamp help command (switch to single quotes) * feat: revamp help command (put imports on same line) * feat: revamp help command (extract api) * feat: revamp help command (prettier on help-helpers) * feat: revamp help command (fix tag line) * feat: revamp help command (changing test names) * feat: revamp help command (refactoring preserveHelpInformation)
- Loading branch information
1 parent
d802aee
commit ed6d08d
Showing
28 changed files
with
1,802 additions
and
317 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/amplify-category-analytics/src/commands/analytics/help.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { $TSContext, runHelp, commandsInfo } from 'amplify-cli-core'; | ||
|
||
export const run = (context: $TSContext) => { | ||
runHelp(context, commandsInfo); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { $TSContext, runHelp, commandsInfo } from 'amplify-cli-core'; | ||
|
||
export const run = (context: $TSContext) => { | ||
runHelp(context, commandsInfo); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/amplify-category-function/src/commands/function/help.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { $TSContext, runHelp, commandsInfo } from 'amplify-cli-core'; | ||
|
||
export const run = (context: $TSContext) => { | ||
runHelp(context, commandsInfo); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,5 @@ | ||
import { $TSContext } from 'amplify-cli-core'; | ||
import { category } from '../../constants'; | ||
import { printer } from 'amplify-prompts'; | ||
import { $TSContext, runHelp, commandsInfo } from 'amplify-cli-core'; | ||
|
||
export const name = category; | ||
|
||
export const run = async (context: $TSContext) => { | ||
const header = `amplify ${category} <subcommand>`; | ||
|
||
const commands = [ | ||
{ | ||
name: 'add', | ||
description: `Takes you through a CLI flow to add a ${category} resource to your local backend`, | ||
}, | ||
{ | ||
name: 'update', | ||
description: `Takes you through steps in the CLI to update a ${category} resource`, | ||
}, | ||
{ | ||
name: 'push', | ||
description: `Provisions only ${category} cloud resources with the latest local developments`, | ||
}, | ||
{ | ||
name: 'remove', | ||
description: `Removes ${category} resource from your local backend. The resource is removed from the cloud on the next push command.`, | ||
}, | ||
{ | ||
name: 'console', | ||
description: `Opens the web console for the ${category} category`, | ||
}, | ||
]; | ||
|
||
context.amplify.showHelp(header, commands); | ||
|
||
printer.blankLine(); | ||
export const run = (context: $TSContext) => { | ||
runHelp(context, commandsInfo); | ||
}; |
29 changes: 5 additions & 24 deletions
29
packages/amplify-category-interactions/src/commands/interactions.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,12 @@ | ||
import { run as runHelp } from './interactions/help'; | ||
|
||
const featureName = 'interactions'; | ||
|
||
module.exports = { | ||
name: featureName, | ||
run: async context => { | ||
const header = `amplify ${featureName} <subcommand>`; | ||
|
||
const commands = [ | ||
{ | ||
name: 'add', | ||
description: `Takes you through a CLI flow to add an ${featureName} resource to your local backend`, | ||
}, | ||
{ | ||
name: 'update', | ||
description: `Takes you through a CLI flow to update an ${featureName} resource`, | ||
}, | ||
{ | ||
name: 'push', | ||
description: `Provisions only ${featureName} cloud resources with the latest local developments`, | ||
}, | ||
{ | ||
name: 'remove', | ||
description: `Removes ${featureName} resource from your local backend which would be removed from the cloud on the next push command`, | ||
}, | ||
]; | ||
|
||
context.amplify.showHelp(header, commands); | ||
|
||
context.print.info(''); | ||
if (context.parameters.options.help) { | ||
return runHelp(context); | ||
} | ||
}, | ||
}; |
5 changes: 5 additions & 0 deletions
5
packages/amplify-category-interactions/src/commands/interactions/help.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { $TSContext, runHelp, commandsInfo } from 'amplify-cli-core'; | ||
|
||
export const run = (context: $TSContext) => { | ||
runHelp(context, commandsInfo); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/amplify-category-notifications/src/commands/notifications/help.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { $TSContext, runHelp, commandsInfo } from 'amplify-cli-core'; | ||
|
||
export const run = (context: $TSContext) => { | ||
runHelp(context, commandsInfo); | ||
}; |
28 changes: 5 additions & 23 deletions
28
packages/amplify-category-predictions/src/commands/predictions.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,13 @@ | ||
import { run as runHelp } from './predictions/help'; | ||
|
||
const categoryName = 'predictions'; | ||
|
||
module.exports = { | ||
name: categoryName, | ||
alias: ['Predictions'], | ||
run: async context => { | ||
const header = `amplify ${categoryName} <subcommand>`; | ||
|
||
const commands = [ | ||
{ | ||
name: 'add', | ||
description: `Takes you through a CLI flow to add a ${categoryName} resource to your local backend`, | ||
}, | ||
{ | ||
name: 'remove', | ||
description: `Removes ${categoryName} resource from your local backend which would be removed from the cloud on the next push command`, | ||
}, | ||
{ | ||
name: 'update', | ||
description: `Takes you through steps in the CLI to update an ${categoryName} resource`, | ||
}, | ||
{ | ||
name: 'console', | ||
description: `Opens a web console to view your ${categoryName} resource`, | ||
}, | ||
]; | ||
|
||
context.amplify.showHelp(header, commands); | ||
context.print.info(''); | ||
if (context.parameters.options.help) { | ||
return runHelp(context); | ||
} | ||
}, | ||
}; |
5 changes: 5 additions & 0 deletions
5
packages/amplify-category-predictions/src/commands/predictions/help.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { $TSContext, runHelp, commandsInfo } from 'amplify-cli-core'; | ||
|
||
export const run = (context: $TSContext) => { | ||
runHelp(context, commandsInfo); | ||
}; |
Oops, something went wrong.