-
Notifications
You must be signed in to change notification settings - Fork 3
Interactive mode #110
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
Merged
Merged
Interactive mode #110
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c684e9f
stash interactive changes
StephenCooper 76d4933
stash interactive changes
StephenCooper b69f900
Merge branch 'interactive-mode' of https://github.com/ag-grid/devtool…
StephenCooper 1351865
Define choices within the version manifest
StephenCooper c4f5591
Enable non-interactive mode for tests
StephenCooper 2c45bf7
More test updates
StephenCooper a42eb38
Simplify user input required
StephenCooper 9fd4b21
remove unused import
StephenCooper File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -5,17 +5,77 @@ import transformGridApiMethodsV33_0 from '../../transforms/transform-grid-api-me | |
| import transformSparklinesOptionsV33_0 from '../../transforms/transform-sparklines-options-v33-0/manifest.ts'; | ||
|
|
||
| import transformModulesToPackagesV33 from '../../transforms/transform-modules-to-packages-v33/manifest.ts'; | ||
| import { select } from '@inquirer/prompts'; | ||
|
|
||
| const transforms: Array<TransformManifest> = [ | ||
| transformGridApiMethodsV33_0, | ||
| transformSparklinesOptionsV33_0, | ||
| transformModulesToPackagesV33, | ||
| ]; | ||
|
|
||
| const manifest: VersionManifest = { | ||
| type Choices33 = { | ||
| usingCharts: boolean; | ||
| chartType: string; | ||
| }; | ||
|
|
||
| const manifest: VersionManifest<Choices33> = { | ||
| version: '33.0.0', | ||
| codemodPath: 'versions/33.0.0', | ||
| transforms, | ||
| choices: { | ||
| usingCharts: () => { | ||
| return select({ | ||
| message: | ||
| 'Are you using chart based features in any of your grids, i.e Sparklines / Integrated Charts?', | ||
| default: false, | ||
| choices: [ | ||
| { | ||
| value: true, | ||
| name: 'Yes', | ||
| description: 'Some grid has Sparklines in cells or is using Integrated Charts.', | ||
| }, | ||
| { | ||
| value: false, | ||
| name: 'No', | ||
| description: 'No charting based features used in any of the grids.', | ||
| }, | ||
| ], | ||
| }); | ||
| }, | ||
| chartType: () => { | ||
| if (process.env.AG_IS_USING_CHARTS == 'false') { | ||
| // If they are using community packages, they are not using AG Charts | ||
| return Promise.resolve('none'); | ||
| } | ||
|
|
||
| return select({ | ||
| message: 'Are you using AG Charts Community or Enterprise?', | ||
| default: 'community', | ||
| choices: [ | ||
| { | ||
| value: 'community', | ||
| name: 'Community', | ||
| description: | ||
| 'Using the Community version of AG Charts via one of: ag-grid-enterprise / @ag-grid-enterprise/charts', | ||
| }, | ||
| { | ||
| value: 'enterprise', | ||
| name: 'Enterprise', | ||
| description: | ||
| 'Using the Enterprise version of AG Charts via one of: ag-grid-charts-enterprise / @ag-grid-enterprise/charts-enterprise', | ||
| }, | ||
| ], | ||
| }); | ||
| }, | ||
| }, | ||
| setAnswers: { | ||
| usingCharts: (answer) => { | ||
| process.env.AG_IS_USING_CHARTS = answer; | ||
Stephanemw marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| chartType: (answers) => { | ||
| process.env.AG_USING_CHARTS = answers; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This matches the existing env value that was previously set by the command line. |
||
| }, | ||
| }, | ||
| }; | ||
|
|
||
| export default manifest; | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idea is to have each version able to ask the user questions for input. These can then be used to set global variables that can be used within the transforms themselves to tweak behaviour.