-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f512ee
commit f416988
Showing
46 changed files
with
68 additions
and
31 deletions.
There are no files selected for viewing
21 changes: 0 additions & 21 deletions
21
packages/cli/src/codemods/transforms/migrate-sparklines-options/README.md
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
packages/cli/src/codemods/transforms/migrate-sparklines-options/index.ts
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
packages/cli/src/codemods/transforms/transform-sparklines-options-v33-0/README.md
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,21 @@ | ||
# `transform-sparklines-options-v33-0` | ||
|
||
> _Transform sparklines configuration_ | ||
## Common tasks | ||
|
||
### Add a test case | ||
|
||
Create a new unit test scenario for this transform: | ||
|
||
``` | ||
pnpm run task:create-test --type transform --target transform-sparklines-options-v33-0 | ||
``` | ||
|
||
### Add to a codemod release | ||
|
||
Add this source code transformation to a codemod release: | ||
|
||
``` | ||
pnpm run task:include-transform --transform transform-sparklines-options-v33-0 | ||
``` |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions
1
packages/cli/src/codemods/transforms/transform-sparklines-options-v33-0/index.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 @@ | ||
export { default } from './transform-sparklines-options-v33-0'; |
4 changes: 2 additions & 2 deletions
4
...ms/migrate-sparklines-options/manifest.ts → ...form-sparklines-options-v33-0/manifest.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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { type TransformManifest } from '@ag-grid-devtools/types'; | ||
|
||
const manifest: TransformManifest = { | ||
name: 'migrate-sparklines-options', | ||
description: 'Migrate sparklines configuration', | ||
name: 'Transform Sparklines options v33.0', | ||
description: 'Transform sparklines options', | ||
}; | ||
|
||
export default manifest; |
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
37 changes: 37 additions & 0 deletions
37
packages/cli/src/codemods/transforms/transform-sparklines-options-v33-0/zzzz.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,37 @@ | ||
import { type AstCliContext, type AstTransform } from '@ag-grid-devtools/ast'; | ||
|
||
import * as m from './match-utils'; | ||
import * as t from '@babel/types'; | ||
import * as v from './visitor-utils'; | ||
import { mergeImports, mergeTypecasts } from './transform-utils'; | ||
|
||
const parser = require('@babel/parser'); | ||
const traverse = require('@babel/traverse').default; | ||
|
||
const transform: AstTransform<AstCliContext> = function migrateSparklinesOptions(_babel) { | ||
const oldOptionNames = [ | ||
'AreaSparklineOptions', | ||
'BarSparklineOptions', | ||
'ColumnSparklineOptions', | ||
'LineSparklineOptions', | ||
]; | ||
|
||
const newOptionName = 'AgSparklineOptions'; | ||
const newPackage = 'ag-charts-types'; | ||
|
||
const js = `{sparklineOptions: {type: 'column'}}`; | ||
const ast = parser.parse(js); | ||
// traverse(ast, v.createVisitor([ | ||
|
||
// ], (results) => { | ||
|
||
// })); | ||
|
||
return { | ||
visitor: v.combineVisitors( | ||
v.createComplexVisitor(c2bTransform), | ||
v.createComplexVisitor(mergeImports(oldOptionNames, newOptionName, newPackage)), | ||
v.createComplexVisitor(mergeTypecasts(oldOptionNames, newOptionName)), | ||
), | ||
}; | ||
}; |
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