{"id":14973474,"url":"https://github.com/tarsisexistence/routerkit","last_synced_at":"2025-04-07T06:11:14.424Z","repository":{"id":37243084,"uuid":"290985210","full_name":"tarsisexistence/routerkit","owner":"tarsisexistence","description":"🦩 strict typed angular routes","archived":false,"fork":false,"pushed_at":"2025-03-27T16:35:25.000Z","size":10771,"stargazers_count":77,"open_issues_count":16,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-31T05:04:59.769Z","etag":null,"topics":["angular","router","routes","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/tarsisexistence.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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-08-28T07:51:02.000Z","updated_at":"2024-11-10T20:13:18.000Z","dependencies_parsed_at":"2023-02-16T07:16:01.395Z","dependency_job_id":"d4b2a40d-2f0b-45b3-97e6-89b0fe6fbb79","html_url":"https://github.com/tarsisexistence/routerkit","commit_stats":{"total_commits":402,"total_committers":10,"mean_commits":40.2,"dds":0.6169154228855722,"last_synced_commit":"b72be4ffab333d4046337380e42c1badc91a5198"},"previous_names":["tarsisexistence/routerkit","tarsinzer/routerkit"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarsisexistence%2Frouterkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarsisexistence%2Frouterkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarsisexistence%2Frouterkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarsisexistence%2Frouterkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tarsisexistence","download_url":"https://codeload.github.com/tarsisexistence/routerkit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601448,"owners_count":20964864,"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":["angular","router","routes","typescript"],"created_at":"2024-09-24T13:48:49.185Z","updated_at":"2025-04-07T06:11:14.397Z","avatar_url":"https://github.com/tarsisexistence.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RouterKit\n\n\u003ca href=\"https://routeshub.gitbook.io/docs\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/tarsinzer/routerkit/master/assets/logo.png\" align=\"right\" alt=\"logo\" /\u003e\u003c/a\u003e\n\nA new approach to Angular routes:\n\n- **Type-safe.** Auto-completion and type checking for @angular/router routes.\n- **Easy setup.** Only 1 script to run before and 2 functions for use.\n- **Concise.** `[routerLink]=\"routes.one.two.three\"` instead of `[routerLink]=\"['one','two','three']\"`\n- **Versatile.** Supports modern and old fashion lazy routes syntax, and certainly eager routes.\n- **Tiny.** ~0.4kb. All the magic happens on the type level, runtime API is only one small function.\n\n\u003cbr/\u003e\n\n## Showcase\n\n\u003cimg src=\"https://raw.githubusercontent.com/tarsinzer/routerkit/master/assets/concise.gif\" alt=\"Gif demonstrating the process of running schematic script.\" align=\"center\"\u003e\n\n\u003cbr/\u003e\n\n## What problems does it solve?\n\n- Prevents errors, typos, mistakes with route paths\n- Reduces the number of magic strings\n- Collects all routes into one \"big picture\" of the particular angular project\n\n\u003cbr/\u003e\n\n## How does it work?\n\n[script](https://github.com/tarsinzer/routerkit/blob/master/package/src/parse/index.ts):\n\n- parses your Angular project\n- traverses generated AST, extracting route information and following eager / lazy routes\n- gets all connected routes to the projected\n- generates a TypeScript `type` containing all your routes information.\n- includes the generated type in your `tsconfig`\n\n[function](https://github.com/tarsinzer/routerkit/blob/master/package/src/core/getRoutes.ts):\n\n- returns route paths based on your routes type with appropriate JavaScript object structure\n\n\u003cbr/\u003e\n\n## Install\n\nInstall the package via [Angular schematic](https://angular.io/guide/schematics-for-libraries):\n\n```sh\nng add @routerkit/core\n```\n\n\u003cbr/\u003e\n\n## Usage\n\n### Schematic\n\nYou can run [Angular schematic](https://angular.io/guide/schematics) to generate the routes type:\n\n```sh\nng g @routerkit/core:parse --project YOUR_PROJECT_NAME\n```\n\n### App\n\n**Before:**\n\n```typescript\nimport { Component } from '@angular/core';\n\n@Component({\n  selector: 'user-details-link',\n  template: `\u003ca routerLink=\"/profile/users/{{ usersId }}\"\u003eUser Details\u003c/a\u003e`\n})\nexport class UserComponent {\n  usersId = 42;\n}\n```\n\n**After:**\n\n```typescript\nimport { Component } from '@angular/core';\n\nimport { getRoutes } from '@routerkit/core';\nimport { TypedRoutes } from '{ROOT}/{PROJECT_NAME}.routes.d.ts';\n\n@Component({\n  selector: 'user-details-link',\n  template: `\u003ca routerLink=\"{{ routes.profile.users[usersId] }}\"\u003eUser Details\u003c/a\u003e`\n})\nexport class UserComponent {\n  routes: TypedRoutes = getRoutes\u003cTypedRoutes\u003e();\n  usersId = 42;\n}\n```\n\n\u003cbr/\u003e\n\n_Tip: if you prefer [routerLink] directive you can use `asArray` (asString is available too) property_\n\n**Before:**\n\n```html\n\u003ca [routerLink]=\"['/', 'profile', 'users', userId]\"\u003eNavigate\u003c/a\u003e\n```\n\n**After:**\n\n```html\n\u003ca [routerLink]=\"routes.profile.users[userId].asArray\"\u003eNavigate\u003c/a\u003e\n```\n\n\u003cbr/\u003e\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/tarsinzer\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/21989873?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMax Tarsis\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#ideas-tarsinzer\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e \u003ca href=\"https://github.com/tarsinzer/routerkit/commits?author=tarsinzer\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#infra-tarsinzer\" title=\"Infrastructure (Hosting, Build-Tools, etc)\"\u003e🚇\u003c/a\u003e \u003ca href=\"https://github.com/tarsinzer/routerkit/commits?author=tarsinzer\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"#projectManagement-tarsinzer\" title=\"Project Management\"\u003e📆\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/limitofzero\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/16196664?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDenis Makarov\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#ideas-limitofzero\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e \u003ca href=\"https://github.com/tarsinzer/routerkit/commits?author=limitofzero\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://twitter.com/kirjs\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/2545357?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eKirill Cherkashin\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#ideas-kirjs\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e \u003ca href=\"https://github.com/tarsinzer/routerkit/commits?author=kirjs\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://thekiba.io/\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/1910515?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAndrew Grekov\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#ideas-thekiba\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://indepth.dev/author/layzee/\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/6364586?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eLars Gyrup Brink Nielsen\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/tarsinzer/routerkit/commits?author=LayZeeDK\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/JoepKockelkorn\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/12891645?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJoep Kockelkorn\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/tarsinzer/routerkit/issues?q=author%3AJoepKockelkorn\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/Andrei0872\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/36248290?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eGatej Andrei\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/tarsinzer/routerkit/commits?author=Andrei0872\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarsisexistence%2Frouterkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftarsisexistence%2Frouterkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarsisexistence%2Frouterkit/lists"}