{"id":13781585,"url":"https://github.com/eidellev/adonis-stardust","last_synced_at":"2025-05-11T15:31:55.050Z","repository":{"id":46212856,"uuid":"397724938","full_name":"eidellev/adonis-stardust","owner":"eidellev","description":null,"archived":false,"fork":false,"pushed_at":"2023-08-04T17:03:47.000Z","size":2082,"stargazers_count":31,"open_issues_count":3,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T08:17:40.654Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eidellev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-08-18T20:17:50.000Z","updated_at":"2025-03-17T01:55:15.000Z","dependencies_parsed_at":"2024-01-15T09:05:05.407Z","dependency_job_id":"9f6a58da-b4d1-4941-8360-3740d74eff51","html_url":"https://github.com/eidellev/adonis-stardust","commit_stats":{"total_commits":37,"total_committers":2,"mean_commits":18.5,"dds":"0.16216216216216217","last_synced_commit":"ce1867922fb81d21c649589653cdefcaed7b7a74"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eidellev%2Fadonis-stardust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eidellev%2Fadonis-stardust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eidellev%2Fadonis-stardust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eidellev%2Fadonis-stardust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eidellev","download_url":"https://codeload.github.com/eidellev/adonis-stardust/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253588566,"owners_count":21932278,"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":[],"created_at":"2024-08-03T18:01:27.377Z","updated_at":"2025-05-11T15:31:54.637Z","avatar_url":"https://github.com/eidellev.png","language":"TypeScript","funding_links":[],"categories":["Packages"],"sub_categories":[],"readme":"# Adonis Stardust\n\n![](https://img.shields.io/npm/types/typescript?style=for-the-badge)\n\u003ca href=\"https://adonisjs.com/\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/%E2%96%B2%20adonis-v5-5a45ff?style=for-the-badge\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://prettier.io/\"\u003e\n\u003cimg alt=\"code style: prettier\" src=\"https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=for-the-badge\"\u003e\n\u003c/a\u003e\n\u003ca href=\"\"\u003e\n\u003ca href=\"https://www.npmjs.com/package/semantic-release\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge\"/\u003e\n\u003c/a\u003e\n\n# ⭐ Adonis Stardust ⭐\n\nUse your adonis named stardust in the client.\n\n## Installation\n\n```shell\nnpm i @eidellev/adonis-stardust\n\nnode ace configure @eidellev/adonis-stardust\n```\n\n## Setup\n\n### Register Middleware\n\nAdd the Stardust middleware to `start/kernel.ts`:\n\n```typescript\nServer.middleware.register([\n  () =\u003e import('@ioc:Adonis/Core/BodyParser'),\n  () =\u003e import('@ioc:EidelLev/Stardust/Middleware'),\n]);\n```\n\n### Register a Named Route\n\nCreate a named route in your stardust file:\n\n```typescript\nRoute.get('users/:id', () =\u003e {\n  ...\n}).as('users.show');\n```\n\n### In Your View\n\nAdd the `@routes` Edge tag to your main layout (before your application's JavaScript).\n\n```blade\n@routes\n@entryPointStyles('app')\n@entryPolintScripts('app')\n```\n\n## Client-Side Usage\n\n### Client Setup\n\nStardust should be initialized as early as possible, e.g. in your application's entrypoint\n\n```typescript\nimport { initRoutes } from '@eidellev/adonis-stardust/client';\n\ninitRoutes();\n```\n\nNow you can use the `stardust` helper to access your adonis routes:\n\n```typescript\nimport { stardust } from '@eidellev/adonis-stardust/client';\n\nstardust.route('users.show', { id: 1 }); // =\u003e `/users/1`\n\n/**\n * You can also pass path params as an array and they will populated\n * according to their order:\n */\nstardust.route('users.show', [1]); // =\u003e `/users/1`\n```\n\nYou can also pass query parameters like so:\n\n```typescript\nstardust.route('tasks.index', undefined, { qs: { tags: ['work', 'personal'] } });\n// `/tasks?tags=work,personal\n```\n\n### Checking the Current Route\n\n```typescript\nstardust.current; // =\u003e 'tasks.index'\nstardust.isCurrent('tasks.index'); // =\u003e true\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feidellev%2Fadonis-stardust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feidellev%2Fadonis-stardust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feidellev%2Fadonis-stardust/lists"}