{"id":15412556,"url":"https://github.com/elmassimo/js_from_routes","last_synced_at":"2025-05-16T04:02:21.102Z","repository":{"id":42680928,"uuid":"273978079","full_name":"ElMassimo/js_from_routes","owner":"ElMassimo","description":"🛣️ Generate path helpers and API methods from your Rails routes","archived":false,"fork":false,"pushed_at":"2025-03-27T18:23:08.000Z","size":718,"stargazers_count":110,"open_issues_count":7,"forks_count":10,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-01T13:05:18.775Z","etag":null,"topics":["api","es6","generating-js","javascript","rails","rails-routes","router","typescript","vitejs"],"latest_commit_sha":null,"homepage":"https://js-from-routes.netlify.app/","language":"Ruby","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/ElMassimo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2020-06-21T20:22:59.000Z","updated_at":"2025-03-27T18:23:11.000Z","dependencies_parsed_at":"2024-01-13T02:59:56.874Z","dependency_job_id":"9769ffb1-3d26-4b64-a84f-bac0344aeb69","html_url":"https://github.com/ElMassimo/js_from_routes","commit_stats":{"total_commits":135,"total_committers":6,"mean_commits":22.5,"dds":"0.051851851851851816","last_synced_commit":"9420138eece57fc74ec79e549d59c7aff6dabc1d"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElMassimo%2Fjs_from_routes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElMassimo%2Fjs_from_routes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElMassimo%2Fjs_from_routes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElMassimo%2Fjs_from_routes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ElMassimo","download_url":"https://codeload.github.com/ElMassimo/js_from_routes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247856541,"owners_count":21007620,"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":["api","es6","generating-js","javascript","rails","rails-routes","router","typescript","vitejs"],"created_at":"2024-10-01T16:53:43.442Z","updated_at":"2025-04-08T14:06:06.314Z","avatar_url":"https://github.com/ElMassimo.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003ca href=\"https://js-from-routes.netlify.app/\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/ElMassimo/js_from_routes/main/docs/public/logo-with-text.svg\" width=\"240px\"/\u003e\n  \u003c/a\u003e\n\n  \u003cbr\u003e\n\n  \u003cp align=\"center\"\u003e\n    \u003ca href=\"https://travis-ci.org/ElMassimo/js_from_routes\"\u003e\n      \u003cimg alt=\"Build Status\" src=\"https://travis-ci.org/ElMassimo/js_from_routes.svg\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://codeclimate.com/github/ElMassimo/js_from_routes\"\u003e\n      \u003cimg alt=\"Maintainability\" src=\"https://codeclimate.com/github/ElMassimo/js_from_routes/badges/gpa.svg\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://codeclimate.com/github/ElMassimo/js_from_routes\"\u003e\n      \u003cimg alt=\"Test Coverage\" src=\"https://codeclimate.com/github/ElMassimo/js_from_routes/badges/coverage.svg\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://rubygems.org/gems/js_from_routes\"\u003e\n      \u003cimg alt=\"Gem Version\" src=\"https://img.shields.io/gem/v/js_from_routes.svg?colorB=e9573f\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/ElMassimo/js_from_routes/blob/main/LICENSE.txt\"\u003e\n      \u003cimg alt=\"License\" src=\"https://img.shields.io/badge/license-MIT-428F7E.svg\"/\u003e\n    \u003c/a\u003e\n  \u003c/p\u003e\n\u003c/h1\u003e\n\n[routes]: https://github.com/ElMassimo/js_from_routes/blob/main/playground/vanilla/config/routes.rb#L6\n[client libraries]: https://js-from-routes.netlify.app/client/\n[codegen]: https://js-from-routes.netlify.app/guide/codegen\n[rails bytes]: https://railsbytes.com/templates/X6ksgn\n[website]: https://js-from-routes.netlify.app\n[guides]: https://js-from-routes.netlify.app/guide/\n[guide]: https://js-from-routes.netlify.app/guide/#usage-🚀\n[configuration reference]: https://js-from-routes.netlify.app/config/\n[introduction]: https://js-from-routes.netlify.app/guide/introduction\n[ping]: https://github.com/ElMassimo/pingcrm-vite\n\n_[JS From Routes][website]_ generates path helpers and API methods from your Rails routes, allowing you to be more productive and prevent routing-related errors.\n\nSince code generation is fully customizable it can be used in very diverse scenarios.\n\n## Why? 🤔\n\nPath helpers in Rails make it easy to build URLs, while avoiding typos and mistakes.\n\nWith _[JS From Routes][website]_, it's possible the enjoy the same benefits in JS, and even more if using TypeScript.\n\nRead more about it in the [blog announcement](https://maximomussini.com/posts/js-from-routes/).\n\n## Features ⚡️\n\n- 🚀 Path and Request Helpers\n- 🔁 Serialization / Deserialization\n- ✅ Prevent Routing Errors\n- 🤖 Automatic Generation\n- 🛠 Customizable Generation\n- And [more][introduction]!\n\n## Documentation 📖\n\nVisit the [documentation website][website] to check out the [guides] and searchable [configuration reference].\n\n## Installation 💿\n\nFor a one liner, you can use [this template][rails bytes]:\n\n```\nrails app:template LOCATION='https://railsbytes.com/script/X6ksgn'\n```\n\nElse, add this line to your application's Gemfile in the `development` group and execute `bundle`:\n\n```ruby\ngroup :development, :test do\n  gem 'js_from_routes'\nend\n```\n\nThen, add the [client library][client libraries] to your `package.json`:\n\n```bash\nnpm install @js-from-routes/client # yarn add @js-from-routes/client\n```\n\nThere are more [client libraries] available.\n\n## Getting Started 🚀\n\nThe following is a short excerpt from the [guide].\n\n### Specify the routes you want\n\nUse the `export` attribute to determine which [routes] should be taken into account when generating JS.\n\n```ruby\nRails.application.routes.draw do\n  resources :video_clips, export: true do\n    get :download, on: :member\n  end\n\n  # Or:\n  defaults export: true do\n    # All routes defined inside this block will be exported.\n  end\nend\n```\n\n### Use the path helpers in your JS application\n\nPath helpers will be [automatically generated][codegen] when refreshing the page.\n\n```js\nimport { videoClips } from '~/api'\n\nconst video = await videoClips.show({ id: 'oHg5SJYRHA0' })\n\nconst downloadPath = videoClips.download.path(video)\n```\n\nCheck the [documentation website][guide] for more information.\n\nFor a working example, check [this repo][ping].\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felmassimo%2Fjs_from_routes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felmassimo%2Fjs_from_routes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felmassimo%2Fjs_from_routes/lists"}