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

AG-13294 add more sparklines migrations #94

Closed
wants to merge 13 commits into from

Conversation

Stephanemw
Copy link
Contributor

No description provided.

@@ -78,6 +78,8 @@
},
"types": "./index.d.ts",
"dependencies": {
"@types/jscodeshift": "0.12.0",
Copy link
Contributor

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",
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

@eliasmalik eliasmalik left a 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);
Copy link
Contributor

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
Copy link
Contributor

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[] = [
Copy link
Contributor

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?)

@Stephanemw Stephanemw closed this Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants