{"_id":"@dudousxd/nestjs-inertia-codegen-extension","_rev":"4-d42bd2880c648930fe615d4055534c7b","name":"@dudousxd/nestjs-inertia-codegen-extension","dist-tags":{"latest":"0.4.0"},"versions":{"0.1.0":{"name":"@dudousxd/nestjs-inertia-codegen-extension","version":"0.1.0","keywords":["nestjs","inertia","codegen","extension"],"author":{"name":"Davi Carvalho","email":"davi@goflip.ai"},"license":"MIT","_id":"@dudousxd/nestjs-inertia-codegen-extension@0.1.0","maintainers":[{"name":"dudousxd","email":"davi_carvalho96@hotmail.com"}],"homepage":"https://github.com/DavideCarvalho/nestjs-inertia#readme","bugs":{"url":"https://github.com/DavideCarvalho/nestjs-inertia/issues"},"dist":{"shasum":"8d32a1b5d98defe6bd7840cbca1f3ed06cbdc836","tarball":"https://registry.npmjs.org/@dudousxd/nestjs-inertia-codegen-extension/-/nestjs-inertia-codegen-extension-0.1.0.tgz","fileCount":7,"integrity":"sha512-V1IolWryjrhnWrQ2DFb1oR+xLxdCXYh8Z5X5rkx4r8Zj1zrIeg6aYx/zFTfx4OtFyNsX0/PYwFLsirqQxLnUCw==","signatures":[{"sig":"MEQCIBRFCRYkRBahGHTDDGq3SKxcT3SfEPkX5hF3pZ9GeFwXAiByEqTPBYQtDPXBS3Bsxn7S0RFkwFjbEwMFYugeJ/7zcg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dudousxd%2fnestjs-inertia-codegen-extension@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":9312},"main":"./dist/index.js","type":"module","_from":"file:dudousxd-nestjs-inertia-codegen-extension-0.1.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"dudousxd","email":"davi_carvalho96@hotmail.com"},"_resolved":"/tmp/920b86104844119a8fa9eba2a4a3fe96/dudousxd-nestjs-inertia-codegen-extension-0.1.0.tgz","_integrity":"sha512-V1IolWryjrhnWrQ2DFb1oR+xLxdCXYh8Z5X5rkx4r8Zj1zrIeg6aYx/zFTfx4OtFyNsX0/PYwFLsirqQxLnUCw==","repository":{"url":"git+https://github.com/DavideCarvalho/nestjs-inertia.git","type":"git","directory":"packages/codegen-extension"},"_npmVersion":"10.9.8","description":"nestjs-codegen extension for @dudousxd/nestjs-inertia — adds the Inertia navigate() helper to the generated api.ts.","directories":{},"_nodeVersion":"22.22.3","_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.0","typescript":"^5.4.0","@dudousxd/nestjs-codegen":"0.2.1"},"peerDependencies":{"@inertiajs/react":">=1.0.0","@dudousxd/nestjs-codegen":">=0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/nestjs-inertia-codegen-extension_0.1.0_1781135735587_0.2614371512843756","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@dudousxd/nestjs-inertia-codegen-extension","version":"0.2.0","keywords":["nestjs","inertia","codegen","extension"],"author":{"name":"Davi Carvalho","email":"davi@goflip.ai"},"license":"MIT","_id":"@dudousxd/nestjs-inertia-codegen-extension@0.2.0","maintainers":[{"name":"dudousxd","email":"davi_carvalho96@hotmail.com"}],"homepage":"https://github.com/DavideCarvalho/nestjs-inertia#readme","bugs":{"url":"https://github.com/DavideCarvalho/nestjs-inertia/issues"},"dist":{"shasum":"ee8a8960e6fa7868f92a87d97ef90498824659e9","tarball":"https://registry.npmjs.org/@dudousxd/nestjs-inertia-codegen-extension/-/nestjs-inertia-codegen-extension-0.2.0.tgz","fileCount":7,"integrity":"sha512-zg8sA1H1FjTIa++Qdzh2a9GM4I71WxbteBJMiuQoVA2eUxFbXE+dzn2Oh6dssc04kN3FkwKHgNOp8qA5poWjRw==","signatures":[{"sig":"MEYCIQCndcYeuYJODgSL3jT8okQoZHz2YdcLopM2dixJVKnO1gIhANk9x7q4SXT3zXTBOWpfv5k2DPPy9CM03E/kHs6tpSHr","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dudousxd%2fnestjs-inertia-codegen-extension@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":9336},"main":"./dist/index.js","type":"module","_from":"file:dudousxd-nestjs-inertia-codegen-extension-0.2.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"dudousxd","email":"davi_carvalho96@hotmail.com"},"_resolved":"/tmp/61b960245c1caff5af84d2dfb14fc107/dudousxd-nestjs-inertia-codegen-extension-0.2.0.tgz","_integrity":"sha512-zg8sA1H1FjTIa++Qdzh2a9GM4I71WxbteBJMiuQoVA2eUxFbXE+dzn2Oh6dssc04kN3FkwKHgNOp8qA5poWjRw==","repository":{"url":"git+https://github.com/DavideCarvalho/nestjs-inertia.git","type":"git","directory":"packages/codegen-extension"},"_npmVersion":"10.9.8","description":"nestjs-codegen extension for @dudousxd/nestjs-inertia — adds the Inertia navigate() helper to the generated api.ts.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.3","_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.0","typescript":"^5.4.0","@dudousxd/nestjs-codegen":"0.2.1"},"peerDependencies":{"@inertiajs/react":">=1.0.0","@dudousxd/nestjs-codegen":">=0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/nestjs-inertia-codegen-extension_0.2.0_1781797306876_0.9528288138643759","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@dudousxd/nestjs-inertia-codegen-extension","version":"0.3.0","keywords":["nestjs","inertia","codegen","extension"],"author":{"name":"Davi Carvalho","email":"davi@goflip.ai"},"license":"MIT","_id":"@dudousxd/nestjs-inertia-codegen-extension@0.3.0","maintainers":[{"name":"dudousxd","email":"davi_carvalho96@hotmail.com"}],"homepage":"https://github.com/DavideCarvalho/nestjs-inertia#readme","bugs":{"url":"https://github.com/DavideCarvalho/nestjs-inertia/issues"},"dist":{"shasum":"213ac8f9fbe5a3d38df9a20bf580454f806925c0","tarball":"https://registry.npmjs.org/@dudousxd/nestjs-inertia-codegen-extension/-/nestjs-inertia-codegen-extension-0.3.0.tgz","fileCount":19,"integrity":"sha512-N+r4CA0ZXuIu9/Ga6OqIK+Sp0/yLoFH3FYzV4fTiVPFIHF77YmY0ig7HMmi6r0dnvtC60fMgrTPzJ9E3wyXoYA==","signatures":[{"sig":"MEUCIQCrReLzbjgksvS3LDo7j+tAThG+0XhrQHqdkD9XAumtEwIgS1fg9ZDoc0j9/EwIkjmawzc0XmFxA4UyUBrgrUm6ip4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dudousxd%2fnestjs-inertia-codegen-extension@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":37544},"main":"./dist/index.js","type":"module","_from":"file:dudousxd-nestjs-inertia-codegen-extension-0.3.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"dudousxd","email":"davi_carvalho96@hotmail.com"},"_resolved":"/tmp/e1be6eb013e55a5404b67e0bd4c4cc3e/dudousxd-nestjs-inertia-codegen-extension-0.3.0.tgz","_integrity":"sha512-N+r4CA0ZXuIu9/Ga6OqIK+Sp0/yLoFH3FYzV4fTiVPFIHF77YmY0ig7HMmi6r0dnvtC60fMgrTPzJ9E3wyXoYA==","repository":{"url":"git+https://github.com/DavideCarvalho/nestjs-inertia.git","type":"git","directory":"packages/codegen-extension"},"_npmVersion":"10.9.8","description":"nestjs-codegen extension for @dudousxd/nestjs-inertia — adds the Inertia navigate() helper to the generated api.ts, plus opt-in shared.ts and page-excludes.ts emission.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.1","dependencies":{"ts-morph":"28.0.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.0","typescript":"^5.4.0","@types/node":"^20.0.0","@dudousxd/nestjs-codegen":"0.13.2"},"peerDependencies":{"@inertiajs/react":">=1.0.0","@dudousxd/nestjs-codegen":">=0.2.1"},"_npmOperationalInternal":{"tmp":"tmp/nestjs-inertia-codegen-extension_0.3.0_1783723724983_0.49523325417926367","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"_id":"@dudousxd/nestjs-inertia-codegen-extension@0.4.0","bugs":{"url":"https://github.com/DavideCarvalho/nestjs-inertia/issues"},"dist":{"shasum":"9ca804e036ec75911cc2dd7d990a67a75c6b1d3a","tarball":"https://registry.npmjs.org/@dudousxd/nestjs-inertia-codegen-extension/-/nestjs-inertia-codegen-extension-0.4.0.tgz","fileCount":19,"integrity":"sha512-ik1SYEfXSUtOO4PC+JP5Vgv48EMkU/NCAsTRSl+lPcRfDaOzoC7DXwcEMZUWc2eAP+tvffSEXl41q7yaZA9P+A==","signatures":[{"sig":"MEUCIQC5dntYrAWoV+Q+JEvltV4GZ9Pjk1mPJIvNWPSRfNKmVwIgaWb11x7HpDdFezLE47Ydg0TVweHvV957kBvAEvaTqe0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIH6URIq4bN2lgQnEKDNKd114cKCU+k60YuIIPyLAW+7dAiEA8y/w4dAED7Yc0843voMwmyfIKA9TDBNcaiqwjdfkYPg="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dudousxd%2fnestjs-inertia-codegen-extension@0.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":41895},"main":"./dist/index.js","name":"@dudousxd/nestjs-inertia-codegen-extension","type":"module","_from":"file:dudousxd-nestjs-inertia-codegen-extension-0.4.0.tgz","types":"./dist/index.d.ts","author":{"name":"Davi Carvalho","email":"davi@goflip.ai"},"engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"license":"MIT","scripts":{"test":"vitest run","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"version":"0.4.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"4ee2bba6-c450-4ace-b11e-b21e48dcb3c3"}},"homepage":"https://davidecarvalho.github.io/aviary/docs/inertia","keywords":["nestjs","inertia","codegen","extension"],"_resolved":"/tmp/5b0824f8e1aa536ee1a68efc7d6f2f55/dudousxd-nestjs-inertia-codegen-extension-0.4.0.tgz","_integrity":"sha512-ik1SYEfXSUtOO4PC+JP5Vgv48EMkU/NCAsTRSl+lPcRfDaOzoC7DXwcEMZUWc2eAP+tvffSEXl41q7yaZA9P+A==","repository":{"url":"git+https://github.com/DavideCarvalho/nestjs-inertia.git","type":"git","directory":"packages/codegen-extension"},"_npmVersion":"11.20.0","description":"nestjs-codegen extension for @dudousxd/nestjs-inertia — adds the Inertia navigate() helper to the generated api.ts, plus opt-in shared.ts and page-excludes.ts emission.","directories":{},"maintainers":[{"name":"dudousxd","email":"davi_carvalho96@hotmail.com"}],"sideEffects":false,"_nodeVersion":"22.23.2","dependencies":{"ts-morph":"28.0.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.8","typescript":"^5.4.0","@types/node":"^20.19.41","@dudousxd/nestjs-codegen":"0.25.2"},"peerDependencies":{"@inertiajs/react":">=1.0.0","@dudousxd/nestjs-codegen":">=0.2.1"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nestjs-inertia-codegen-extension_0.4.0_1790707182474_0.49962273051999206"}}},"time":{"created":"2026-06-10T23:55:35.451Z","modified":"2026-09-29T18:39:42.975Z","0.1.0":"2026-06-10T23:55:35.730Z","0.2.0":"2026-06-18T15:41:47.094Z","0.3.0":"2026-07-10T22:48:45.137Z","0.4.0":"2026-09-29T18:39:42.555Z"},"bugs":{"url":"https://github.com/DavideCarvalho/nestjs-inertia/issues"},"author":{"name":"Davi Carvalho","email":"davi@goflip.ai"},"license":"MIT","homepage":"https://davidecarvalho.github.io/aviary/docs/inertia","keywords":["nestjs","inertia","codegen","extension"],"repository":{"url":"git+https://github.com/DavideCarvalho/nestjs-inertia.git","type":"git","directory":"packages/codegen-extension"},"description":"nestjs-codegen extension for @dudousxd/nestjs-inertia — adds the Inertia navigate() helper to the generated api.ts, plus opt-in shared.ts and page-excludes.ts emission.","maintainers":[{"name":"dudousxd","email":"davi_carvalho96@hotmail.com"}],"readme":"# @dudousxd/nestjs-inertia-codegen-extension\n\n> The Inertia extension for [`@dudousxd/nestjs-codegen`](https://github.com/DavideCarvalho/nestjs-codegen) — adds an Inertia `router` import and a type-safe `navigate()` helper to the generated typed client.\n\n![npm](https://img.shields.io/npm/v/@dudousxd/nestjs-inertia-codegen-extension)\n\nThe typed client codegen lives in the standalone [`@dudousxd/nestjs-codegen`](https://github.com/DavideCarvalho/nestjs-codegen) package. This package is **just the Inertia extension** for it: register `nestjsInertiaCodegen()` and the generated `api.ts` gains a `navigate()` helper backed by Inertia's `router`, so your mutations and links can drive Inertia visits with full route-name and params autocomplete.\n\n## Install\n\n```bash\npnpm add -D @dudousxd/nestjs-inertia-codegen-extension\n```\n\nIt is an extension for the core codegen, so install that alongside it (the Inertia adapter for React provides `router`):\n\n```bash\npnpm add -D @dudousxd/nestjs-codegen\npnpm add @inertiajs/react\n```\n\n| Peer dependency | Range |\n|---|---|\n| `@dudousxd/nestjs-codegen` | `>=0.1.0` |\n| `@inertiajs/react` | `>=1.0.0` |\n\n## Setup\n\nRegister the extension in the codegen's `extensions: [...]` array — either via the Nest module or in `defineConfig` for CLI/CI runs.\n\n```ts title=\"src/app.module.ts\"\nimport { NestjsCodegenModule } from '@dudousxd/nestjs-codegen/nest';\nimport { nestjsInertiaCodegen } from '@dudousxd/nestjs-inertia-codegen-extension';\n\nNestjsCodegenModule.forRoot({\n  contracts: { glob: 'src/**/*.controller.ts' },\n  pages: { glob: 'inertia/pages/**/*.tsx' },\n  app: { moduleEntry: 'src/app.module.ts' },\n  codegen: { outDir: '.nestjs-inertia' },\n  extensions: [nestjsInertiaCodegen()],\n});\n```\n\nThe same array works in `nestjs-codegen.config.ts` (`defineConfig`) — keep one source of truth and import it into both.\n\n## What it adds\n\n`nestjsInertiaCodegen()` is a `CodegenExtension` whose `apiHeader` hook contributes to the generated `api.ts`:\n\n- an import of Inertia's `router` — `import { router } from '@inertiajs/react';`\n- a `NavigateOptions` type (`method`, `data`, `preserveState`, `preserveScroll`, `replace`)\n- a type-safe **`navigate()`** helper that resolves a named route to its URL and calls `router.visit()`\n\n```tsx\nimport { navigate } from '~codegen/api';\n\n// Route name autocompleted; params required when the route has :id\nnavigate('users.show', { params: { id: '42' } });\nnavigate('showDashboard.show');\n\n// With Inertia visit options\nnavigate('users.list', { preserveState: true, replace: true });\n```\n\nOpt-in files: `shared` emits `shared.ts` (`InertiaSharedProps`), `scopes: { <scope>: { shared } }` adds each `forFeature` scope's shared props to it (`InertiaScopeSharedProps`, `ScopeSharedProps<S>`), and `pageExcludes: true` emits `page-excludes.ts`.\n\nWithout the extension, `api.ts` is a plain typed-fetch client and `@inertiajs/react`'s `router` is never imported. The extension owns only the Inertia surface of `api.ts` — Inertia page discovery (`pages.d.ts` / `components.json`) and shared props are still handled by the core `pages` / `app` config.\n\n## How it fits\n\n`@dudousxd/nestjs-codegen` runs a discovery → IR → emit pipeline and exposes an extension contract at `@dudousxd/nestjs-codegen/extension`. Integrations aren't config flags — they're extensions you register in `extensions: [...]`, and each one shapes routes, emits extra files, or augments `api.ts`. This package implements that contract with a single `apiHeader` hook:\n\n```ts\nimport type { CodegenExtension } from '@dudousxd/nestjs-codegen/extension';\n\nexport function nestjsInertiaCodegen(): CodegenExtension {\n  return {\n    name: 'nestjs-inertia',\n    apiHeader() {\n      return {\n        imports: [\"import { router } from '@inertiajs/react';\"],\n        statements: [/* NavigateOptions + navigate() */],\n      };\n    },\n  };\n}\n```\n\nIt composes with the other companion extensions — e.g. `tanstackQuery()` (`@dudousxd/nestjs-codegen-tanstack`) for `queryOptions`/`mutationOptions` and `nestjsFilterCodegen()` (`@dudousxd/nestjs-filter-codegen`) for typed filters.\n\n## Links\n\n- Codegen core: [`@dudousxd/nestjs-codegen`](https://github.com/DavideCarvalho/nestjs-codegen)\n- Inertia adapter for NestJS: [`@dudousxd/nestjs-inertia`](https://github.com/DavideCarvalho/nestjs-inertia)\n\n## License\n\nMIT\n","readmeFilename":"README.md"}