{"_id":"@amritk/mini-helpers","_rev":"3-9061d9319a61416eb1261f797edfac63","name":"@amritk/mini-helpers","dist-tags":{"latest":"0.2.0"},"versions":{"0.0.0":{"name":"@amritk/mini-helpers","version":"0.0.0","keywords":["routing","json-schema","validation","typescript","mjst"],"author":{"name":"amritk"},"license":"MIT","_id":"@amritk/mini-helpers@0.0.0","maintainers":[{"name":"amritk","email":"amrit+spam@hockey-community.com"}],"homepage":"https://github.com/amritk/mini/tree/main/packages/mini-helpers#readme","bugs":{"url":"https://github.com/amritk/mini/issues"},"dist":{"shasum":"3a071ca4c667e27c473fffa66d94372d6c0e4414","tarball":"https://registry.npmjs.org/@amritk/mini-helpers/-/mini-helpers-0.0.0.tgz","fileCount":8,"integrity":"sha512-JHZe1MNa/jNg6FPkFxzeNkotsTwsaaWyZ5ukn3ZPVujtuChgTngAYpMcIzfx0vaWifeLeuUNK9y2c6UwRQ97qw==","signatures":[{"sig":"MEQCIHv30C6DUb4siiVIFCRCtT/o7oPcb/S3fhjlyvvVg31AAiBU9Z2587trJg0UJ72KL32f8FKwe9zlVXkSGHm7BoZXOg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17005},"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","development":"./src/index.ts"},"./schema":{"types":"./dist/schema/index.d.ts","import":"./dist/schema/index.js","default":"./dist/schema/index.js","development":"./src/schema/index.ts"},"./package.json":"./package.json"},"gitHead":"a38a601e3cbdd49eab39930835e8b06b76f21b6e","scripts":{"test":"NODE_ENV=production vitest run --root ../.. packages/mini-helpers/","build":"tsgo -p tsconfig.build.json && tsc-alias -p tsconfig.build.json -f && node ../../scripts/strip-comments.mjs","types:check":"tsgo -p . --noEmit"},"_npmUser":{"name":"amritk","email":"amrit+spam@hockey-community.com"},"repository":{"url":"git+https://github.com/amritk/mini.git","type":"git","directory":"packages/mini-helpers"},"_npmVersion":"11.16.0","description":"The pure helpers @amritk/mini and @amritk/mini-lynx both need: no reactivity, no platform, no dependencies.","directories":{},"sideEffects":false,"_nodeVersion":"26.3.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5","@amritk/runtime-validators":"^0.9.0"},"peerDependencies":{"typescript":"^5","@amritk/runtime-validators":">=0.8.0"},"peerDependenciesMeta":{"typescript":{"optional":true},"@amritk/runtime-validators":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/mini-helpers_0.0.0_1785224406157_0.6517346936697241","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@amritk/mini-helpers","version":"0.1.0","keywords":["routing","json-schema","validation","typescript","mjst"],"author":{"name":"amritk"},"license":"MIT","_id":"@amritk/mini-helpers@0.1.0","maintainers":[{"name":"amritk","email":"amrit+spam@hockey-community.com"}],"homepage":"https://github.com/amritk/mini/tree/main/packages/mini-helpers#readme","bugs":{"url":"https://github.com/amritk/mini/issues"},"dist":{"shasum":"8e9349df288f49830982c542f04aab7374c52cbd","tarball":"https://registry.npmjs.org/@amritk/mini-helpers/-/mini-helpers-0.1.0.tgz","fileCount":19,"integrity":"sha512-0hMbatzwG76PjF9tVTtrus0n53dtSDOZnxGiJliDx707gm0Ll0R+7JxIBovQPnkTYO4MfJ2Juwfz5zTb6q28MQ==","signatures":[{"sig":"MEQCIES6MLpNBX6UxTUQrum9dYXzEwi01jZrPa2z5b1S0mhZAiB/fnDyN64lfq3JR/1KfPZueeGeV1by5/ILApFHpPPrQA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amritk%2fmini-helpers@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":27008},"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./schema":{"types":"./dist/schema/index.d.ts","import":"./dist/schema/index.js","default":"./dist/schema/index.js"},"./package.json":"./package.json"},"gitHead":"f54a9de1987e2804c290bd70745b58db074caeca","scripts":{"test":"NODE_ENV=production vitest run --root ../.. packages/mini-helpers/","build":"tsgo -p tsconfig.build.json && tsc-alias -p tsconfig.build.json -f && node ../../scripts/strip-comments.mjs","types:check":"tsgo -p . --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:bac72e5a-6e8b-4c52-9523-a5310af75a78"}},"repository":{"url":"git+https://github.com/amritk/mini.git","type":"git","directory":"packages/mini-helpers"},"_npmVersion":"12.0.1","description":"The pure helpers @amritk/mini and @amritk/mini-lynx both need: no reactivity, no platform, no dependencies.","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5","@amritk/runtime-validators":"^0.9.0"},"peerDependencies":{"typescript":"^5","@amritk/runtime-validators":">=0.8.0"},"peerDependenciesMeta":{"typescript":{"optional":true},"@amritk/runtime-validators":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/mini-helpers_0.1.0_1785226637447_0.4429661907778022","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@amritk/mini-helpers","version":"0.2.0","description":"The pure helpers @amritk/mini and @amritk/mini-lynx both need: no reactivity, no platform, no dependencies.","type":"module","license":"MIT","author":{"name":"amritk"},"sideEffects":false,"keywords":["routing","json-schema","validation","typescript","mjst"],"repository":{"type":"git","url":"git+https://github.com/amritk/mini.git","directory":"packages/mini-helpers"},"homepage":"https://github.com/amritk/mini/tree/main/packages/mini-helpers#readme","bugs":{"url":"https://github.com/amritk/mini/issues"},"publishConfig":{"access":"public"},"scripts":{"build":"tsgo -p tsconfig.build.json && tsc-alias -p tsconfig.build.json -f && node ../../scripts/strip-comments.mjs","types:check":"tsgo -p . --noEmit","test":"NODE_ENV=production vitest run --root ../.. packages/mini-helpers/"},"exports":{"./package.json":"./package.json",".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./schema":{"types":"./dist/schema/index.d.ts","import":"./dist/schema/index.js","default":"./dist/schema/index.js"}},"peerDependencies":{"@amritk/runtime-validators":">=0.8.0","typescript":"^5"},"peerDependenciesMeta":{"@amritk/runtime-validators":{"optional":true},"typescript":{"optional":true}},"devDependencies":{"@amritk/runtime-validators":"^0.9.0","typescript":"^5"},"gitHead":"9c6b6bc96beba6a5f106f5e1bf5d7d0ab3b762c1","_id":"@amritk/mini-helpers@0.2.0","_nodeVersion":"24.18.0","_npmVersion":"12.0.2","dist":{"integrity":"sha512-Kk94istAbPtrbKlsWHOABHaFRFMy+bH1rI76SKp3JLO3v76gXhX59KrrQFcp/eCluj6HaPNoOsCHowZTgUsKGg==","shasum":"b4600adc4111f335e63899bcb67d20bc8645d533","tarball":"https://registry.npmjs.org/@amritk/mini-helpers/-/mini-helpers-0.2.0.tgz","fileCount":28,"unpackedSize":42459,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@amritk%2fmini-helpers@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAC6RDFq3iaxRo4gZDzNCZIBj0OcxIn70SA8aFrsX8sBAiBMxKFB1CBRs+oBMb90uSlCV7F1gJpRwHQYFAW/qAuSAQ=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:bac72e5a-6e8b-4c52-9523-a5310af75a78"}},"directories":{},"maintainers":[{"name":"amritk","email":"amrit+spam@hockey-community.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mini-helpers_0.2.0_1785905545516_0.4579351658020505"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-28T07:40:06.002Z","modified":"2026-08-05T04:52:25.976Z","0.0.0":"2026-07-28T07:40:06.296Z","0.1.0":"2026-07-28T08:17:17.611Z","0.2.0":"2026-08-05T04:52:25.683Z"},"bugs":{"url":"https://github.com/amritk/mini/issues"},"author":{"name":"amritk"},"license":"MIT","homepage":"https://github.com/amritk/mini/tree/main/packages/mini-helpers#readme","keywords":["routing","json-schema","validation","typescript","mjst"],"repository":{"type":"git","url":"git+https://github.com/amritk/mini.git","directory":"packages/mini-helpers"},"description":"The pure helpers @amritk/mini and @amritk/mini-lynx both need: no reactivity, no platform, no dependencies.","maintainers":[{"name":"amritk","email":"amrit+spam@hockey-community.com"}],"readme":"# @amritk/mini-helpers\n\nThe helpers [`@amritk/mini`](../mini) and [`@amritk/mini-lynx`](../mini-lynx)\nboth need, factored out so they cannot drift apart.\n\nYou do not normally install this yourself — both packages depend on it and\nre-export everything in it, so `matchRoute` still comes from\n`@amritk/mini/router` and `schemaToValidator` still comes from\n`@amritk/mini/forms`. It is published on its own because those packages are\npublished on their own, and it is documented here because the rule about **what\nis allowed in** is worth stating.\n\n## What is in it\n\n| Entry | Exports | Depends on |\n|---|---|---|\n| `@amritk/mini-helpers` | `matchRoute`, `buildPath`, `PathParams`, `RouteParams`, `parseQuery`, `stripBase` | nothing at all |\n| `@amritk/mini-helpers/schema` | `schemaToValidator`, `FormErrors` | `@amritk/runtime-validators` (optional peer) |\n\n```ts\nimport { buildPath, matchRoute, parseQuery } from '@amritk/mini-helpers'\n\nmatchRoute('/users/:id', '/users/42')        // { id: '42' }\nmatchRoute('/docs/*', '/docs/guide/routing') // { rest: 'guide/routing' }\nmatchRoute('/users/:id', '/users')           // null\n\nbuildPath('/users/:id', { id: '42' })        // '/users/42'\n\nparseQuery('?tab=posts&page=2')              // { tab: 'posts', page: '2' }\n```\n\nThe pattern is read at the type level too. `PathParams<'/users/:id'>` is\n`{ id: string }`, so `matchRoute` hands back exactly the keys the pattern names\nand `buildPath` demands exactly the ones it needs — while a pattern known only\nas `string` widens back to `RouteParams`, which is what a table built at runtime\ngets and what every existing table already got.\n\n## The bar for adding something\n\n`mini` and `mini-lynx` are **siblings, not layers** — neither imports the\nother, and that independence is the design. It has one cost, and it has been\npaid twice: a defect found in one is usually latent in the other. This package\npays that down for the narrow band of code where sharing costs nothing back, and\nthe bar is two rules:\n\n1. **No reactivity.** Nothing here imports `alien-signals`, directly or\n   transitively. Each package reaches the signal engine through exactly one\n   module of its own; a third edge is how a consumer ends up with two signal\n   graphs that cannot see each other's writes.\n2. **No platform.** No DOM, no Node, no host. The tsconfig withholds both\n   ambient libraries, so this is a compiler constraint rather than a convention\n   — it is why `parseQuery` is hand-rolled instead of calling `URLSearchParams`,\n   which is a web global and not an ECMAScript one.\n\n`src/purity.test.ts` walks the source graph and enforces both, so the charter\ncannot erode one convenient import at a time.\n\n## What is deliberately *not* in it\n\n- **The runtime cores.** `signals`, `list`, `mount`, the JSX runtimes and the\n  bind helpers are genuinely different code: `@amritk/mini` takes DOM fast paths\n  (writing `textContent`, cloning a static template) that have no meaning behind\n  a `Host`.\n- **`onCleanup` and `runDetached`**, even though they are byte-identical in both\n  packages. They live in each package's `.` entry, whose transitive imports must\n  be `alien-signals` and nothing else — a shared dependency there would be a\n  byte the bundle-size-sensitive widget pays for.\n- **`createQuery`**, which is also a verbatim port. It is built out of signals,\n  so sharing it would break rule 1.\n\n## Licence\n\nMIT\n","readmeFilename":"README.md"}