{"id":34697813,"url":"https://github.com/moderneinc/rewrite-codemods","last_synced_at":"2026-01-20T21:00:35.313Z","repository":{"id":232668808,"uuid":"728111433","full_name":"moderneinc/rewrite-codemods","owner":"moderneinc","description":"rewrite running Javascript codemods","archived":false,"fork":false,"pushed_at":"2026-01-14T12:43:28.000Z","size":1838,"stargazers_count":5,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-01-14T16:52:03.970Z","etag":null,"topics":["automation","hacktoberfest","rewrite"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moderneinc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-12-06T08:54:07.000Z","updated_at":"2026-01-14T12:43:32.000Z","dependencies_parsed_at":"2025-12-25T21:01:13.337Z","dependency_job_id":null,"html_url":"https://github.com/moderneinc/rewrite-codemods","commit_stats":null,"previous_names":["moderneinc/rewrite-codemods","openrewrite/rewrite-codemods"],"tags_count":40,"template":false,"template_full_name":"moderneinc/rewrite-recipe-starter","purl":"pkg:github/moderneinc/rewrite-codemods","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moderneinc%2Frewrite-codemods","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moderneinc%2Frewrite-codemods/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moderneinc%2Frewrite-codemods/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moderneinc%2Frewrite-codemods/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moderneinc","download_url":"https://codeload.github.com/moderneinc/rewrite-codemods/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moderneinc%2Frewrite-codemods/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28613659,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T18:56:40.769Z","status":"ssl_error","status_checked_at":"2026-01-20T18:54:26.653Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","hacktoberfest","rewrite"],"created_at":"2025-12-24T22:39:12.003Z","updated_at":"2026-01-20T21:00:35.300Z","avatar_url":"https://github.com/moderneinc.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Logo](https://github.com/openrewrite/rewrite/raw/main/doc/logo-oss.png)\n## Apply JavaScript / TypeScript codemods\n\nThis repository provides JavaScript / TypeScript codemods wrapped up into OpenRewrite recipes, so that they can be applied from the command line or using the [platform](https://app.moderne.io/).\nCurrently, the support is limited to [jscodeshift](https://github.com/facebook/jscodeshift)-based codemods.\n\n## Implementation Notes\n\nAs existing codemods have not been designed to operate on OpenRewrite LSTs, the recipes for codemods operate in a very special way and also have certain limitations.\nAll recipes based on [ApplyCodemod](src/main/java/org/openrewrite/codemods/ApplyCodemod.java) are scanning recipes and operate as follows:\n1. In the scanning phase (when all source files are available with the original content) all sources are serialized to the recipe's working directory.\nThus, this basically recreates the original Git repository in the local file system.\n2. In the generate phase the recipe also extracts the [packaged Node modules](src/main/resources/codemods) into another directory in the local file system and then finally uses the `node` executable to apply the codemod to the repo as created in the scanning phase.\n3. Finally, in the edit phase, the visitor checks if the current source file was modified by the codemod and if so returns an updated source file.\nNote that the source files will then always be `PlainText` sources.\n\nIf there are multiple codemod recipes contained in the current recipe run (all based on `ApplyCodemod`) then the recipes are \"chained\" so that the input (i.e. source files) to a codemod is the result of the previous codemod. To achieve this with separation the generate phase copies the entire directory with the source files before running the codemod.\n\nThe limitations imposed by this implementation are due to the fact that the actual modifications are already performed in the generate phase. So as soon as codemod recipes are combined with other recipes in the same recipe run, this breaks down: The codemod recipes won't \"see\" the changes performed by other recipes (which modify sources in the edit phase) and vice versa.\n\n\u003e [!IMPORTANT]\n\u003e `ApplyCodemod`-based recipes can currently not be followed by other recipes (not based on `ApplyCodemod`) in the same recipe run.\n\nSee our documentation on [creating recipes that run ESLint plugins\n](https://docs.openrewrite.org/authoring-recipes/recipe-with-npm-dependency) for a step-by-step guide to wrapping your own ESLint plugins.\n\n## Licensing\n\nFor more information about licensing, please visit our [licensing page](https://docs.openrewrite.org/licensing/openrewrite-licensing).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoderneinc%2Frewrite-codemods","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoderneinc%2Frewrite-codemods","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoderneinc%2Frewrite-codemods/lists"}