JSCodeshift
-
Codeshift repo at GitHub facebook/jscodeshift (opens in a new tab)
-
JSCodeshift API Doc (opens in a new tab) (by crguezl, done with jscodeshift --version jscodeshift: 0.13.1 babel: 7.17.5 babylon: 7.17.3 flow: 0.172.0 recast: 0.20.5)
- JSCodeshift API Doc (opens in a new tab) v0.3 obsolete
-
AST-Builder (opens in a new tab) by Rasegar. My fork at https://github.com/ULL-ESIT-PL/ast-builder (opens in a new tab), deployment at https://ull-esit-pl.github.io/ast-builder/ (opens in a new tab)
-
Write Code to Rewrite Your Code: jscodeshift (opens in a new tab) Examples: removing console.log, replacing imported method calls, from positional parameters to parameter object
-
jscodeshift cpojer/js-codemod no-vars.js (opens in a new tab) Conservatively converts
var
toconst
orlet
.jscodeshift -t js-codemod/transforms/no-vars.js <file>
-
Effective Refactoring with Codemods - JS Monthly London - November 2018 (opens in a new tab) Presented by Edd Yerburgh. Study case: substituting lodash
flatten
byarr.flat()
. YouTube -
Writing codemods to change all your code at once (opens in a new tab) by Sid. Case: Changing import a library whose name has changed. YouTube. 2018
-
Blog "Automating Code Transformation With jscodeshift" (opens in a new tab) Jan 21, 2021, by Mark Skelton. Study case: removing imported variable
queryCache
from "react-query"
and importing it from a file in your project"common/queryClient"
Rajasegar works
- AST-Builder (opens in a new tab)
- Migrating large codebase with Codemods (opens in a new tab) YouTube video. Talk at JSFoo Pune 2020. On component architecture, performance, security for front-end, and emerging trends. Rajasegar Chandran.
- Slides (opens in a new tab)
- Awesome codemods (opens in a new tab) at rajasegar/awesome-codemods
Codemods community
- codeshiftcommunity: The community-owned codemod registry (opens in a new tab)
- Docs: Your first codemod (opens in a new tab)
- codeshift cli (opens in a new tab)
- codeshift test-utils (opens in a new tab)
- Registry (opens in a new tab)
Riki Fridrich
- Write a code that writes code (opens in a new tab) talk by Riki Fridrich. Sep 22, 2021. WebExpo
- fczbkk/talk-2021-09-22-webexpo-codemod (opens in a new tab) GitHub Repo
ast-types and recast
- recast (opens in a new tab)
- ast-types examples in crguezl/hello-ast-types (opens in a new tab)
- api documentation for ast-types (v0.9.11) (opens in a new tab) (Don't trust it. Current version is 0.15)
Estraverse
- Estraverse README.md (opens in a new tab)
- Simple examples of AST traversal and transformation crguezl/ast-traversal (opens in a new tab)
Repositorios interesantes de cowchimp
- A curated list of awesome AST resources (opens in a new tab)
- AST Scout is a tool for analyzing and visualizing the relationship between the public API of a Class\Module and its implementations details (e.g. private methods, dependencies used). (opens in a new tab)
- A web tool to explore the ASTs generated by various parsers. (opens in a new tab)https://astexplorer.net/ (opens in a new tab) The repo
AST: Awesome Super Tool - JS Roundabout - April 2019
This is a talk similar to Yonatan Mevorach by Leonardo Crespo given in 2019:
- AST: Awesome Super Tool - JS Roundabout - April 2019 (opens in a new tab) by Leonardo Crespo
Wielding the powers of the JavaScript AST
by Kim Joar Bekkelund. September 14, 2017
JSCodeShift study case: Substitute Object.assign({}, a, b)
by {...a, ...b}
Wielding the powers of the JavaScript AST: Kim Joar Bekkelund (opens in a new tab) from JavaZone (opens in a new tab) on Vimeo (opens in a new tab).