{"_id":"@dcsv-io/d2-i18n-keys","_rev":"2-fb4f802539cb1ca3d1b0768132ddd0fb","name":"@dcsv-io/d2-i18n-keys","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.1":{"name":"@dcsv-io/d2-i18n-keys","version":"0.1.1","_id":"@dcsv-io/d2-i18n-keys@0.1.1","maintainers":[{"name":"dcsv-tristan","email":"tristan@dcsv.io"}],"dist":{"shasum":"4cbfeeb6736b2e4630477e68dcaa48ac7a1d4066","tarball":"https://registry.npmjs.org/@dcsv-io/d2-i18n-keys/-/d2-i18n-keys-0.1.1.tgz","fileCount":11,"integrity":"sha512-Hmb49AZ4Z8jyf8PLGOWRzFfx5htdPPGuBGmlcRdtjpt5hfEwxHPY3vL8ttXoRn50nyHSNtuZi1hJk66Gh8XpEA==","signatures":[{"sig":"MEMCIDwPFtX/kH1fnHfzYW9/QfVgMRV8GdpgPiwnyTOsd3ezAh8GHx1Vk471PbUak3wqAdo2ELw7dvegk2VNd0zEp1zq","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":182262},"main":"./dist/index.js","type":"module","_from":"file:bundle/npm/dcsv-io-d2-i18n-keys-0.1.1.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"tsc -b","test:coverage":"vitest run --coverage","type-check:test":"tsc -p tsconfig.test.json"},"_npmUser":{"name":"dcsv-tristan","email":"tristan@dcsv.io"},"_resolved":"/home/runner/work/D2-Public/D2-Public/bundle/npm/dcsv-io-d2-i18n-keys-0.1.1.tgz","_integrity":"sha512-Hmb49AZ4Z8jyf8PLGOWRzFfx5htdPPGuBGmlcRdtjpt5hfEwxHPY3vL8ttXoRn50nyHSNtuZi1hJk66Gh8XpEA==","_npmVersion":"11.16.0","description":"<!-- Copyright (c) DCSV. Licensed under the Apache License, Version 2.0. -->","directories":{},"_nodeVersion":"24.18.0","dependencies":{"@dcsv-io/d2-i18n-abstractions":"0.1.1"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"4.0.18","typescript":"5.9.3","@vitest/coverage-v8":"4.0.18"},"_npmOperationalInternal":{"tmp":"tmp/d2-i18n-keys_0.1.1_1784262837220_0.003989132105569171","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@dcsv-io/d2-i18n-keys","version":"0.1.2","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"dependencies":{"@dcsv-io/d2-i18n-abstractions":"0.1.2"},"devDependencies":{"@vitest/coverage-v8":"4.0.18","typescript":"5.9.3","vitest":"4.0.18"},"scripts":{"build":"tsc -b","test":"vitest run","test:coverage":"vitest run --coverage","type-check:test":"tsc -p tsconfig.test.json"},"_id":"@dcsv-io/d2-i18n-keys@0.1.2","description":"<!-- Copyright (c) DCSV. Licensed under the Apache License, Version 2.0. -->","_integrity":"sha512-3qHIZR0h+FXk9qkVAGs2wpPFh/mP3D3vh6lRZfpMMY2Slck5bJ3SME4yws702ibUbbaGvAxnDmBeWNsYSp+uaA==","_resolved":"/home/runner/work/D2-Public/D2-Public/bundle/npm/dcsv-io-d2-i18n-keys-0.1.2.tgz","_from":"file:bundle/npm/dcsv-io-d2-i18n-keys-0.1.2.tgz","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-3qHIZR0h+FXk9qkVAGs2wpPFh/mP3D3vh6lRZfpMMY2Slck5bJ3SME4yws702ibUbbaGvAxnDmBeWNsYSp+uaA==","shasum":"b77022cd321e5977fa7abfca83c2eb68f987443e","tarball":"https://registry.npmjs.org/@dcsv-io/d2-i18n-keys/-/d2-i18n-keys-0.1.2.tgz","fileCount":11,"unpackedSize":182268,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAEH7fOsZ+t6YsqjPPxcUw+zmLNZ7GgVmvGU6WDigNRSAiAhhExCXpmj5rephjbjrybCzyG5VF/8nsTr3g9gXpqbyA=="}]},"_npmUser":{"name":"dcsv-tristan","email":"tristan@dcsv.io"},"directories":{},"maintainers":[{"name":"dcsv-tristan","email":"tristan@dcsv.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/d2-i18n-keys_0.1.2_1784286999276_0.48556969257049065"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-17T04:33:57.054Z","modified":"2026-07-17T11:16:39.577Z","0.1.1":"2026-07-17T04:33:57.353Z","0.1.2":"2026-07-17T11:16:39.404Z"},"description":"<!-- Copyright (c) DCSV. Licensed under the Apache License, Version 2.0. -->","maintainers":[{"name":"dcsv-tristan","email":"tristan@dcsv.io"}],"readme":"<!--\nCopyright (c) DCSV. Licensed under the Apache License, Version 2.0.\n-->\n\n# @dcsv-io/d2-i18n-keys\n\nFoundational package that exports the type-safe TK constants catalog. Mirrors\n`DcsvIo.D2.I18n.Keys` on the .NET side — a thin keys layer whose only dependency\nis the i18n-abstractions package (for the `TKMessage` type + `tk()` factory), so\nany package in the graph can import TK constants without risking a circular\ndependency.\n\n## Install\n\n```bash\npnpm add @dcsv-io/d2-i18n-keys\n```\n\n## Public API\n\n| Export  | Purpose                                                                                                                                                        |\n| ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `TK`    | Nested object of `TKMessage` instances, each whose `.key` is its snake-case message key (e.g. `TK.common.errors.NOT_FOUND.key === \"common_errors_NOT_FOUND\"`). |\n| `TKKey` | `string` type alias for a raw TK key value.                                                                                                                    |\n\nBoth are auto-generated from `contracts/messages/en-US.json` by\nthe messages catalog (sources committed). Do not edit `src/generated/tk-keys.g.ts` by hand — changes\nwill be overwritten on the next codegen run.\n\n## Dependencies\n\n`@dcsv-io/d2-i18n-abstractions` (the `TKMessage` type + `tk()` factory the generated\nconstants are built from). That package is a zero-dependency leaf, so this\npackage stays shallow in the graph.\n\n## Usage example\n\n```ts\nimport { TK } from \"@dcsv-io/d2-i18n-keys\";\n\n// TK.common.errors.NOT_FOUND === { key: \"common_errors_NOT_FOUND\" }\n// Drop straight into D2Result.messages — no tk() wrapper needed:\n//   notFound({ messages: [TK.common.errors.NOT_FOUND] })\nconsole.log(TK.common.errors.NOT_FOUND.key);\n```\n\n## Why a separate package\n\nThe TK constants are needed by both `@dcsv-io/d2-result` (for factory default messages)\nand `@dcsv-io/d2-i18n` (the Translator and Paraglide runtime). If the constants lived\nin `@dcsv-io/d2-i18n`, packages that depend on `@dcsv-io/d2-result` could not also transitively\nimport the constants without creating a cycle (`result → i18n → result`).\nKeeping the constants in this shallow package — whose only dependency is the\nzero-dep `@dcsv-io/d2-i18n-abstractions` leaf — breaks the cycle structurally: any\npackage may import `@dcsv-io/d2-i18n-keys` regardless of where it sits in the dependency\ngraph.\n\nConsumers of the `@dcsv-io/d2-i18n/keys` re-export (`import { TK } from \"@dcsv-io/d2-i18n/keys\"`)\ncontinue to work unchanged — `@dcsv-io/d2-i18n` re-exports from this package for\nbackward compatibility.\n\n## Parity with .NET\n\nMirrors `DcsvIo.D2.I18n.Keys` (`TK.g.cs`). Both are generated from the same\n`contracts/messages/en-US.json` source and expose the TK constants as `TKMessage`\ninstances built on the abstractions package — single spec, two emitters, drift\nstructurally impossible.\n","readmeFilename":"README.md"}