-
Notifications
You must be signed in to change notification settings - Fork 1
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
AG-13294 add more sparklines migrations #94
Conversation
@@ -78,6 +78,8 @@ | |||
}, | |||
"types": "./index.d.ts", | |||
"dependencies": { | |||
"@types/jscodeshift": "0.12.0", |
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.
This is here twice, don't we only need the one in devDependencies
?
"@types/node": "22.7.3", | ||
"@types/semver": "7.5.8", | ||
"diff": "5.2.0", | ||
"glob": "11.0.0", | ||
"graceful-fs": "4.2.11", | ||
"ignore": "5.3.2", | ||
"jscodeshift": "17.1.1", |
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.
Do we need this here as well? Or only in dependencies
?
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.
I was experimenting, I think I have a handle on what's breaking the build in another branch. It thankfully doesn't look like the dependencies
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.
Very minor comments, ignore if you like. The only thing I would suggest (possibly as a follow up), is to make your codeshift adapter into a plugin like the existing ones that we can use with the CLI commands
visitor: { | ||
Program: { | ||
exit(path: NodePath) { | ||
const root: Collection<any> = j((path.hub as any).file.ast); |
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.
Minor: the any
here suggests this isn't really the intended way to get the root AST node?
// remove the old import if no other named imports are present | ||
export const processImports: JSCodeShiftTransformer = (root) => { | ||
// find old imports | ||
const importToBeInspected: Collection<any> = root |
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.
I don't think we need this annotation, we get a more specific type through inference.
@@ -0,0 +1,19 @@ | |||
import { ImportSpecifierOption } from '../types'; | |||
|
|||
export const oldImports: ImportSpecifierOption[] = [ |
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.
Do we need these constants to be of the same type? As far as I can see oldImports
is always treated like a string[]
and newImports
is always treated like a { name: .... }
(and the type
field isn't used?)
No description provided.