{"id":15849333,"url":"https://github.com/rajasegar/sveltemod","last_synced_at":"2026-05-05T05:32:12.804Z","repository":{"id":211589980,"uuid":"729469983","full_name":"rajasegar/sveltemod","owner":"rajasegar","description":"A CLI to run codemods for Svelte","archived":false,"fork":false,"pushed_at":"2023-12-12T14:41:17.000Z","size":52,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-08T17:17:25.064Z","etag":null,"topics":["cli","codemod","jscodeshift","svelte"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rajasegar.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}},"created_at":"2023-12-09T10:34:34.000Z","updated_at":"2023-12-17T06:00:30.000Z","dependencies_parsed_at":"2023-12-12T15:44:53.651Z","dependency_job_id":null,"html_url":"https://github.com/rajasegar/sveltemod","commit_stats":null,"previous_names":["rajasegar/sveltemod"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajasegar%2Fsveltemod","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajasegar%2Fsveltemod/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajasegar%2Fsveltemod/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajasegar%2Fsveltemod/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rajasegar","download_url":"https://codeload.github.com/rajasegar/sveltemod/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246689282,"owners_count":20818087,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cli","codemod","jscodeshift","svelte"],"created_at":"2024-10-05T18:40:36.766Z","updated_at":"2026-05-05T05:32:12.731Z","avatar_url":"https://github.com/rajasegar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sveltemod\n[![npm version](http://img.shields.io/npm/v/sveltemod.svg?style=flat)](https://npmjs.org/package/sveltemod 'View this project on npm')\n\nA CLI to run codemods for Svelte\nThis project use [jscodeshift](https://github.com/facebook/jscodeshift)  underneath which allows this tool to leverage the standard codemod tooling for JavaScript in Svelte projects.\n\n## Install\n```\nnpm install -g sveltemod\n```\n\n## Usage\n```\nsveltemod \u003ccodemod\u003e \u003cfile\u003e\n```\n\nExample:\n```\nsveltemod transforms/v5-derived.js src/App.svelte\n```\n\nYou can also use jscodeshift to run the codemods like:\n```\njscodeshift --transform=./transforms/v5-derived.js --extensions=svelte ./src/App.svelte\n```\n\n\n## Available codemods:\n### v5/derived.js\n\n#### Before\n```js\n$: area = width * height;\n```\n\n#### After\n```js\nconst area = $derived(width * height);\n```\n\n### v5/effect.js\n\n#### Before\n```js\n$: console.log(area);\n```\n\n#### After\n```js\n$effect(() =\u003e {\n    console.log(area);\n});\n\n```\n\n\n### v5/props.js\n\n#### Before\n```js\nexport let width;\nexport let height;\n\n```\n\n#### After\n```js\nlet { width, height } = $props();\n\n```\n\n\n### v5/state.js\n\n#### Before\n```js\nlet count = 0;\n```\n\n#### After\n```js\n\nlet count = $state(0);\n```\n\n## Differences from svelte-migrate\n- It uses jscodeshift underneath which is kind of standard tooling for codemods\n- It completely uses AST based transforms instead of regex replacement which [svelte-migrate](https://github.com/sveltejs/kit/tree/master/packages/migrate) mostly uses\n- You can run any Jscodeshift based transform available out there not just something comes with svelte-migrate\n- Currently svelte-migrate doesn't have codemods for v5 or runes, I try to address that\n- It is extendable with other transforms for html, css, sass and so on\n\n## References:\n- https://github.com/sveltejs/kit/discussions/5774\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frajasegar%2Fsveltemod","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frajasegar%2Fsveltemod","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frajasegar%2Fsveltemod/lists"}