{"_id":"@dltech/site-map","_rev":"3-972de1b239c894063177c6b713144741","name":"@dltech/site-map","dist-tags":{"next":"1.0.0-next.0","latest":"1.0.1"},"versions":{"1.0.0-next.0":{"name":"@dltech/site-map","version":"1.0.0-next.0","keywords":["routing","routes","typescript","type-safe","url-builder","site-map","nextjs","react"],"author":{"name":"Dennis Lysenko"},"license":"MIT","_id":"@dltech/site-map@1.0.0-next.0","maintainers":[{"name":"dennisofficial","email":"dennislysenko@hotmail.com"}],"homepage":"https://github.com/dennisofficial/site-map#readme","bugs":{"url":"https://github.com/dennisofficial/site-map/issues"},"dist":{"shasum":"7d9c4ea3b27dd118e8fc87cff241fe7d9b8b6a98","tarball":"https://registry.npmjs.org/@dltech/site-map/-/site-map-1.0.0-next.0.tgz","fileCount":9,"integrity":"sha512-YqSvhzaHArqd4R/lP06cahVdUSOvVHC4FQF/B9f/nHwaN+bNQWw00qKieVxwKlfA6OhuNiv7KddWL4wE6V0ZHQ==","signatures":[{"sig":"MEUCIQCr+ZBurHfOsKTWCDWAmk7pAeqF1iLmTBj8+eGvLKb8kQIgNOGXiJy2rgVXD+F7Nq7+piGClMjM3JI5VU1cumFq0ww=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":21134},"main":"./dist/index.js","type":"commonjs","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=20"},"exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"./package.json":"./package.json"},"gitHead":"e49b964ea9f253ba7cf2374db4f8162de0b620c0","scripts":{"dev":"nodemon","build":"tsup","prepare":"pnpm build","release":"changeset version","changeset":"changeset","typecheck":"tsc --noEmit"},"_npmUser":{"name":"dennisofficial","email":"dennislysenko@hotmail.com"},"repository":{"url":"git+https://github.com/dennisofficial/site-map.git","type":"git"},"_npmVersion":"10.9.2","description":"Typed, composable site-map builder for React/Next.js apps — declare routes as a tree and get autocompleted route functions with typed query params back","directories":{},"sideEffects":false,"_nodeVersion":"22.13.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@11.18.0+sha512.33d83c77da82f49fba836925c6f1b841181ec3132b670639bd012f7075f5c7cf634c5f870147c19aae7478fac01df09d8892e880454896edd23ee9b33757563c","devDependencies":{"tsup":"^8.5.1","nodemon":"^3.1.14","prettier":"^3.8.3","@swc/core":"^1.15.32","typescript":"6.0.3","@types/node":"^25.6.0","@changesets/cli":"^2.31.1","prettier-plugin-organize-imports":"^4.3.0"},"_npmOperationalInternal":{"tmp":"tmp/site-map_1.0.0-next.0_1785550452897_0.5590024270823282","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@dltech/site-map","version":"1.0.0","keywords":["routing","routes","typescript","type-safe","url-builder","site-map","nextjs","react"],"author":"Dennis Lysenko","license":"MIT","_id":"@dltech/site-map@1.0.0","maintainers":[{"name":"dennisofficial","email":"dennislysenko@hotmail.com"}],"homepage":"https://github.com/dennisofficial/site-map#readme","bugs":{"url":"https://github.com/dennisofficial/site-map/issues"},"dist":{"shasum":"d4c80afa5320a7c64b641a0cbbaf3be7042b1d85","tarball":"https://registry.npmjs.org/@dltech/site-map/-/site-map-1.0.0.tgz","fileCount":9,"integrity":"sha512-CVXdmJ7FvQO1mN078/zAzAZNhOZmjW/8X+TbdJJpNF9grzamQS7XpGU6wSoySebhdSaYszmi+mH6dqzuQ7w4JA==","signatures":[{"sig":"MEUCIBaCkmEN/L6SHHsJdd5hmVJv0bsgNUg2d4Ebv/u+TahAAiEAocD8obR50kltX3jQKgMXjYQVtU7diHqGEGuRyf1zlQw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dltech%2fsite-map@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":20925},"main":"./dist/index.js","type":"commonjs","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=20"},"exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"./package.json":"./package.json"},"scripts":{"dev":"nodemon","build":"tsup","release":"changeset version","changeset":"changeset","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:5d62b6da-2266-4e49-a04c-5fccd25f0cc4"}},"repository":{"url":"git+https://github.com/dennisofficial/site-map.git","type":"git"},"description":"Typed, composable site-map builder for React/Next.js apps — declare routes as a tree and get autocompleted route functions with typed query params back","directories":{},"sideEffects":false,"_nodeVersion":"24.18.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","nodemon":"^3.1.14","prettier":"^3.8.3","@swc/core":"^1.15.32","typescript":"6.0.3","@types/node":"^25.6.0","@changesets/cli":"^2.31.1","prettier-plugin-organize-imports":"^4.3.0"},"_npmOperationalInternal":{"tmp":"tmp/site-map_1.0.0_1785550919027_0.9555178475348827","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@dltech/site-map","version":"1.0.1","description":"Typed, composable site-map builder for React/Next.js apps — declare routes as a tree and get autocompleted route functions with typed query params back","license":"MIT","author":"Dennis Lysenko","repository":{"type":"git","url":"git+https://github.com/dennisofficial/site-map.git"},"homepage":"https://github.com/dennisofficial/site-map#readme","bugs":{"url":"https://github.com/dennisofficial/site-map/issues"},"keywords":["routing","routes","typescript","type-safe","url-builder","site-map","nextjs","react"],"publishConfig":{"access":"public"},"engines":{"node":">=20"},"type":"commonjs","sideEffects":false,"main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"./package.json":"./package.json"},"devDependencies":{"@changesets/cli":"^2.31.1","@swc/core":"^1.15.32","@types/node":"^25.6.0","nodemon":"^3.1.14","prettier":"^3.8.3","prettier-plugin-organize-imports":"^4.3.0","tsup":"^8.5.1","typescript":"6.0.3","vitest":"^4.1.10"},"scripts":{"build":"tsup","changeset":"changeset","release":"changeset version","dev":"nodemon","test":"vitest run","typecheck":"tsc --noEmit"},"_nodeVersion":"24.18.1","_id":"@dltech/site-map@1.0.1","dist":{"integrity":"sha512-IMXMMpIl6hz1FrQmU8273kEJ3wi28Rh8BtZ/ciSywdnQRvLNzFXM8TlC7g2OgYFUPqSIY9v7nDRAZUlkg6ZoYQ==","shasum":"717a5b507c91ee9399dd551ba6bdeb4aa848ac1e","tarball":"https://registry.npmjs.org/@dltech/site-map/-/site-map-1.0.1.tgz","fileCount":9,"unpackedSize":21591,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dltech%2fsite-map@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDlFdK09qbpdjBMC6A1x4mxb02QU7Ad4l3faOwNNstEBAiEAjBLzpSDqC8PRV/YDgOX7LdQh1TPZ9AWk9vvMcQxj/mA="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:5d62b6da-2266-4e49-a04c-5fccd25f0cc4"}},"directories":{},"maintainers":[{"name":"dennisofficial","email":"dennislysenko@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/site-map_1.0.1_1787080832993_0.6291043859234449"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-01T02:14:12.707Z","modified":"2026-08-18T19:20:33.527Z","1.0.0-next.0":"2026-08-01T02:14:13.030Z","1.0.0":"2026-08-01T02:21:59.186Z","1.0.1":"2026-08-18T19:20:33.158Z"},"bugs":{"url":"https://github.com/dennisofficial/site-map/issues"},"author":"Dennis Lysenko","license":"MIT","homepage":"https://github.com/dennisofficial/site-map#readme","keywords":["routing","routes","typescript","type-safe","url-builder","site-map","nextjs","react"],"repository":{"type":"git","url":"git+https://github.com/dennisofficial/site-map.git"},"description":"Typed, composable site-map builder for React/Next.js apps — declare routes as a tree and get autocompleted route functions with typed query params back","maintainers":[{"name":"dennisofficial","email":"dennislysenko@hotmail.com"}],"readme":"# @dltech/site-map\n\nA typed, composable site-map builder. Declare your app's routes as a tree and get back an object\nof route functions — each one autocompleted, each one accepting only the query params you\ndeclared for it.\n\n## Install\n\n```bash\npnpm add @dltech/site-map\n```\n\n## Usage\n\nBuild the tree with `createSiteMap`. `makeRoute` adds a static segment (optionally nesting more\nroutes inside it via a callback); `param` adds a dynamic segment, applied functionally.\n\n```ts\nimport { createSiteMap } from '@dltech/site-map';\n\nexport const SITE_MAP = createSiteMap(({ makeRoute }) => ({\n  auth: makeRoute('auth', ({ makeRoute }) => ({\n    login: makeRoute<{ next?: string }>('login'),\n    signup: makeRoute('signup'),\n  })),\n  jobs: makeRoute('jobs', ({ param }) => ({\n    job: param(({ param }) => ({\n      thread: param(() => ({})),\n    })),\n  })),\n}));\n```\n\nEvery leaf is a callable that returns the path, and takes an optional object of query params that\nget serialized onto the URL:\n\n```ts\nSITE_MAP.auth.login(); // '/auth/login'\nSITE_MAP.auth.login({ next: '/app' }); // '/auth/login?next=%2Fapp'\n```\n\nParam leaves (declared with `param`) take the id first, then are called again to yield the\nstring — this is what lets a param segment nest further static and dynamic routes beneath it:\n\n```ts\nSITE_MAP.jobs.job('job_42')(); // '/jobs/job_42'\nSITE_MAP.jobs.job('job_42').thread('thread_7')(); // '/jobs/job_42/thread_7'\n```\n\nQuery param types are per-route — pass a type argument to `makeRoute<TQuery>` to constrain what\ncallers can pass for that leaf; leaves without one default to `Record<string, QueryValue>`.\n","readmeFilename":""}