{"_id":"@drzl/generator-ts-rest","_rev":"2-f2b61689b5d8ae2a787895358df760fd","name":"@drzl/generator-ts-rest","dist-tags":{"latest":"0.2.1"},"versions":{"0.2.0":{"name":"@drzl/generator-ts-rest","version":"0.2.0","keywords":["drizzle","drizzle-orm","ts-rest","contract","rest","codegen","standard-schema"],"license":"Apache-2.0","_id":"@drzl/generator-ts-rest@0.2.0","maintainers":[{"name":"omar-dulaimi","email":"o.m.dulaimi@gmail.com"}],"dist":{"shasum":"13af1cf376113808f84353ad715817f48a53847d","tarball":"https://registry.npmjs.org/@drzl/generator-ts-rest/-/generator-ts-rest-0.2.0.tgz","fileCount":7,"integrity":"sha512-ZZAiI1R7TGjIanBQZNMZ9rUVsyq6pAMpRrGF54GkIr2g4j3Y8Vw5ognaBlirNFM45VZx29kNE0f1v4hvRR9pew==","signatures":[{"sig":"MEYCIQDMDXysUAKKBphVUEwnJUZItsieFsFqXmyyqCGGGvzrYgIhAK1rVEQTCTuGiRqERrUVyS3uexeEoul/PM6DFg+RGemj","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":54346},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.17.0"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"funding":{"url":"https://github.com/sponsors/omar-dulaimi","type":"github"},"private":false,"scripts":{"lint":"eslint . --ext .ts","test":"vitest run --testTimeout=20000","build":"tsup src/index.ts --dts --format esm,cjs --external prettier --clean"},"_npmUser":{"name":"omar-dulaimi","email":"o.m.dulaimi@gmail.com"},"repository":{"url":"https://github.com/use-drzl/drzl","type":"git","directory":"packages/generator-ts-rest"},"description":"Generate ts-rest contracts from a Drizzle schema, one contract per table plus a root router, with DRZL's own schemas as the body, params, query and response types.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.0","dependencies":{"@drzl/analyzer":"^1.21.5","@drzl/validation-core":"^3.22.6"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.4.3","tsup":"^8.5.1","arktype":"^2.1.29","valibot":"^1.1.0","typescript":"^5.9.3","@ts-rest/core":"^3.53.0-rc.1","@ts-rest/core-stable":"npm:@ts-rest/core@3.52.1"},"_npmOperationalInternal":{"tmp":"tmp/generator-ts-rest_0.2.0_1786499485601_0.6953316296356653","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@drzl/generator-ts-rest","version":"0.2.1","private":false,"license":"Apache-2.0","description":"Generate ts-rest contracts from a Drizzle schema, one contract per table plus a root router, with DRZL's own schemas as the body, params, query and response types.","keywords":["drizzle","drizzle-orm","ts-rest","contract","rest","codegen","standard-schema"],"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"sideEffects":false,"dependencies":{"@drzl/validation-core":"^3.23.0","@drzl/analyzer":"^1.22.0"},"devDependencies":{"@ts-rest/core":"^3.53.0-rc.1","@ts-rest/core-stable":"npm:@ts-rest/core@3.52.1","arktype":"^2.1.29","tsup":"^8.5.1","typescript":"^5.9.3","valibot":"^1.1.0","zod":"^4.4.3"},"engines":{"node":">=18.17.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/","provenance":true},"repository":{"type":"git","url":"https://github.com/use-drzl/drzl","directory":"packages/generator-ts-rest"},"funding":{"type":"github","url":"https://github.com/sponsors/omar-dulaimi"},"scripts":{"build":"tsup src/index.ts --dts --format esm,cjs --external prettier --clean","lint":"eslint . --ext .ts","test":"vitest run --testTimeout=20000"},"_nodeVersion":"24.18.0","_id":"@drzl/generator-ts-rest@0.2.1","dist":{"integrity":"sha512-h11qzUHqxj2sWSSe8Mmb1hQEKOh5/L509jtyS3Y+qvrShe64/1pO0C4UBxzvQOiHuH3JLctbqNszDGbWLDMciA==","shasum":"9b1599c2c9b666334fa51323a4bbcbadfbeb0c75","tarball":"https://registry.npmjs.org/@drzl/generator-ts-rest/-/generator-ts-rest-0.2.1.tgz","fileCount":7,"unpackedSize":54361,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@drzl%2fgenerator-ts-rest@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCXN8DMXQod+0lUvv6kuYNZR2KEHVTanRFMRnIId64P2AIhAIc5B6d9G2uy9qHbJWjRSSsCoV/IjuaoIAhFq0zJJ6Zm"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:db700f79-8218-4ea3-8a1d-b357782c849b"}},"directories":{},"maintainers":[{"name":"omar-dulaimi","email":"o.m.dulaimi@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/generator-ts-rest_0.2.1_1786697009081_0.8410181696444594"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-12T01:51:25.437Z","modified":"2026-08-14T08:43:29.516Z","0.2.0":"2026-08-12T01:51:25.753Z","0.2.1":"2026-08-14T08:43:29.219Z"},"license":"Apache-2.0","keywords":["drizzle","drizzle-orm","ts-rest","contract","rest","codegen","standard-schema"],"repository":{"type":"git","url":"https://github.com/use-drzl/drzl","directory":"packages/generator-ts-rest"},"description":"Generate ts-rest contracts from a Drizzle schema, one contract per table plus a root router, with DRZL's own schemas as the body, params, query and response types.","maintainers":[{"name":"omar-dulaimi","email":"o.m.dulaimi@gmail.com"}],"readme":"# @drzl/generator-ts-rest\n\nGenerate [ts-rest](https://ts-rest.com) contracts from a Drizzle schema: one contract per table plus\na root router, declared against the schemas a validation generator already writes.\n\n## A contract is nothing but its schemas\n\nts-rest has no router to implement and no handler to stub. A contract is a plain object of methods,\npaths and schemas, and both the server implementation and the typed client are derived from it, so\nthis is the surface where DRZL's output is closest to being the whole artefact.\n\n## Install\n\n```bash\nnpm install -D @drzl/generator-ts-rest\nnpm install @ts-rest/core@^3.53.0-rc.1\n```\n\n```ts\n// drzl.config.ts\nexport default {\n  schema: './src/db/schema.ts',\n  generators: [\n    { kind: 'zod', path: 'src/validators/zod' },\n    { kind: 'ts-rest', path: 'src/contract' },\n  ],\n};\n```\n\n## Why the release candidate\n\n`@ts-rest/core`'s `latest` tag is 3.52.1, and it cannot be used here for two measured reasons.\n\nIt declares `zod: ^3.22.3` as a peer dependency, and DRZL's zod generator requires `zod >=4.0.0`, so\nnpm refuses to put them in the same tree at all: `ERESOLVE ... Conflicting peer dependency`.\n\nWith valibot or arktype it is worse, because it is quiet. 3.52.1 decides whether a schema is a schema\nby testing `typeof obj?.safeParse === 'function'`, and anything failing that test falls through to a\nbranch returning the input unchanged as a success. valibot and arktype expose `~standard` and have no\n`.safeParse` method, so a contract built from either validates nothing. Measured: a body of\n`{ email: 12345, wat: true }` came back valid against a schema requiring a string.\n\n3.53.0-rc.1 accepts any Standard Schema, drops the zod peer, and validates through\n`~standard.validate`. Both halves are pinned as tests here, so a stable release that fixes them makes\nthis suite say so.\n\n`zod`, `valibot` and `arktype` all work. TypeBox and Effect Schema do not: neither exposes\n`~standard` on the schema object, so the contract would type against `any`. Effect users have\n`@drzl/generator-effect-http`.\n\n## Two details worth knowing\n\nA path parameter is a string, so a numeric key is a checked string that converts rather than a\nnumber: `z.number()` refuses every request and `z.coerce.number()` takes an empty segment as `0`.\n\nOptionality is not one spelling. zod and valibot wrap the value; ArkType marks the key,\n`type({ 'limit?': 'string.numeric.parse' })`. Emitting the value-wrapped form for all three left\nArkType's paging required on every list route.\n\nFull documentation: https://use-drzl.github.io/drzl/generators/ts-rest\n\n## Licence\n\nApache-2.0. Generated output is yours under your own project's licence.\n","readmeFilename":""}