{"id":23764459,"url":"https://github.com/chaqchase/next-routes","last_synced_at":"2025-06-14T19:08:22.644Z","repository":{"id":216276669,"uuid":"740897641","full_name":"chaqchase/next-routes","owner":"chaqchase","description":"Never worry about broken links in your Next.js app again!","archived":false,"fork":false,"pushed_at":"2025-01-07T23:12:53.000Z","size":163,"stargazers_count":14,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-04T17:18:50.311Z","etag":null,"topics":["next-routes","nextjs","nextjs-13","nextjs-app-router","nextjs-router","nextjs14"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@triyanox/next-routes","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/chaqchase.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2024-01-09T09:45:32.000Z","updated_at":"2025-05-07T12:50:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"587a2044-2329-4c87-b037-a2ccc008b8cc","html_url":"https://github.com/chaqchase/next-routes","commit_stats":{"total_commits":42,"total_committers":1,"mean_commits":42.0,"dds":0.0,"last_synced_commit":"aacb7bca7582e7c23e9dff799f30e3e1174a44bc"},"previous_names":["triyanox/next-routes","chaqchase/next-routes"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/chaqchase/next-routes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaqchase%2Fnext-routes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaqchase%2Fnext-routes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaqchase%2Fnext-routes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaqchase%2Fnext-routes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chaqchase","download_url":"https://codeload.github.com/chaqchase/next-routes/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaqchase%2Fnext-routes/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259868583,"owners_count":22924236,"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":["next-routes","nextjs","nextjs-13","nextjs-app-router","nextjs-router","nextjs14"],"created_at":"2024-12-31T22:18:14.319Z","updated_at":"2025-06-14T19:08:22.596Z","avatar_url":"https://github.com/chaqchase.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `@triyanox/next-routes` - Never worry about broken links in your Next.js app again!\n\n`@triyanox/next-routes` is a powerful plugin for Next.js that ensures your application's links are always valid. It generates routes and utilities for your application, making link management a breeze.\n\n## Roadmap\n\n- [x] Support TypeScript out of the box\n- [x] Support Next.js 13+ app directory structure\n- [x] Generate routes and utilities for your application\n- [x] Support static routes (e.g. `/about`)\n- [x] Support dynamic routes (e.g. `/[slug]`)\n- [x] Support route groups (e.g. `(auth)/login`)\n- [ ] Support catch-all routes (e.g. `/[...slug]`)\n- [ ] Support optional catch-all routes (e.g. `/[[...slug]]`)\n- [ ] more features coming soon...\n\n## Installation\n\nInstall `@triyanox/next-routes` using your favorite package manager:\n\n```bash\n# pnpm\npnpm add @triyanox/next-routes\n\n# bun\nbun add @triyanox/next-routes\n\n# npm\nnpm i @triyanox/next-routes\n\n# yarn\nyarn add @triyanox/next-routes\n```\n\n## Usage\n\n### Basic Setup\n\n1. In your `next.config.js` file, add the following:\n\n```js\nimport withRoutes from '@triyanox/next-routes';\n// if you are using the `src` directory you can just\n// wrap your config object with `withRoutes`\n\nconst config = withRoutes({\n  //... your next config\n});\n\nexport default config;\n```\n\n2. Import link$ function from @/lib and use it in your components:\n\n```js\nimport link$ from '@/lib';\nimport Link from 'next/link';\n\nconst MyComponent = () =\u003e {\n  return (\n    \u003cLink\n      href={link$({\n          path: '/[slug]',\n          params: {\n            slug: 'home',\n          },\n          hash: 'my-hash',\n          query: {\n            foo: 'bar',\n          },\n      })}\n    \u003e\n      Home\n    \u003c/Link\u003e\n  );\n};\n```\n\n3. Run your app and enjoy!\n\n### Advanced Setup\n\nYou can customize the behavior of `@triyanox/next-routes` by passing an options object to the `withRoutes` function. Here's an example:\n\n```js\nimport withRoutes from '@triyanox/next-routes';\nimport path from 'path';\nimport { cwd } from 'process';\n\n// this is an example not using the `src` directory\nconst config = withRoutes(\n  {\n    //... your next config\n  },\n  {\n    appDir: path.resolve(cwd(), './app'),\n    declarationPath: path.resolve(\n      cwd(),\n      './node_modules/@types/next-routes/index.d.ts',\n    ),\n    utilsPath: path.resolve(cwd(), './lib/link.ts'),\n  },\n);\n\nexport default config;\n```\n\nIn this example, the appDir, declarationPath, and utilsPath options are used to customize the behavior of `@triyanox/next-routes`.\n\n### Contributing\n\nContributions are welcome! Please read our contributing guidelines for more information.\n\n### License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaqchase%2Fnext-routes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchaqchase%2Fnext-routes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaqchase%2Fnext-routes/lists"}