-
Notifications
You must be signed in to change notification settings - Fork 53
chore(template): update #1633
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
base: main
Are you sure you want to change the base?
chore(template): update #1633
Conversation
@AugustinMauroy is attempting to deploy a commit to the Codemod Team on Vercel. A member of the Team first needs to authorize it. |
commit: |
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.
Looks great! And this was so overdue! Thanks. Just a comment on the codemod file name
}, | ||
"scripts": { | ||
"test": "node tests/test.js", | ||
"apply": "node scripts/apply-codemod.js" | ||
"test": "npx codemod@next jssg test -l typescript ./scripts/codemod.js.ts", |
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.
"test": "npx codemod@next jssg test -l typescript ./scripts/codemod.js.ts", | |
"test": "npx codemod@next jssg test -l typescript ./scripts/codemod.ts", |
js-ast-grep: | ||
js_file: "scripts/codemod.ts" | ||
base_path: "." | ||
js_file: scripts/codemod.js.ts |
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.
Why .js.ts
?
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.
because in the example the transform function that touch js file is call like that
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.
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.
Ah, that's the template file names. When the file gets created, it's actually named codemod.ts
always:
codemod/crates/cli/src/commands/init.rs
Line 436 in 3223123
fs::write(scripts_dir.join("codemod.ts"), codemod_script.as_str())?; |
that .<lang>
extension prefix is just for the template file name in our source code.
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.
cool cool cool let's me update that
}, | ||
"devDependencies": { | ||
"@codemod.com/jssg-types": "^1.0.3" | ||
"@codemod.com/jssg-types": "^1.0.3", | ||
"typescript": "^5.8.3" |
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.
Good call!
Description
Update JSSG example to make it functional and related to lasted change