{"_id":"@criistianlevrero/cmsir-schema-directus","name":"@criistianlevrero/cmsir-schema-directus","dist-tags":{"latest":"0.2.0"},"versions":{"0.2.0":{"name":"@criistianlevrero/cmsir-schema-directus","version":"0.2.0","description":"Compiles cmsIR schemas into a Directus snapshot and the cmsIR intermediate representation.","keywords":["cmsir","directus","schema","snapshot","codegen"],"license":"MIT","author":{"name":"Cristian Levriero","email":"cristianlevrero@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/criistianlevrero/cmsIR.git","directory":"packages/schema-directus"},"type":"module","main":"dist/index.js","types":"dist/index.d.ts","publishConfig":{"access":"public"},"scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","prepublishOnly":"npm run build","test:unit":"npm run build && node --test test/unit/**/*.test.mjs","test:golden":"npm run build && node --test test/golden/**/*.test.mjs"},"dependencies":{"@criistianlevrero/cmsir-schema-core":"0.2.0"},"gitHead":"fb43e49ff76a663d883d8ab648c8be449d50e60a","_id":"@criistianlevrero/cmsir-schema-directus@0.2.0","bugs":{"url":"https://github.com/criistianlevrero/cmsIR/issues"},"homepage":"https://github.com/criistianlevrero/cmsIR#readme","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-bafzA2xLHsEmEPj63TVQA/iy5KmCwTKP84FKxZMNeG5TMI9bRVDDWKfQi+be/vTC/8qxf5/hzXLXHZ6TeFCTjg==","shasum":"3b9f7d44b8ccc589aadb53da0d538bdc1002dc90","tarball":"https://registry.npmjs.org/@criistianlevrero/cmsir-schema-directus/-/cmsir-schema-directus-0.2.0.tgz","fileCount":39,"unpackedSize":62640,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCo5JcGFvrPU/9wmh/LejEdMoc4gM8NhiyDhMigWxhx8wIgDl4JuQTXaRfadWzo/elUF6N8CHcr90ah8viNvsZxrh4="}]},"_npmUser":{"name":"cristianlevrero","email":"cristianlevrero@gmail.com"},"directories":{},"maintainers":[{"name":"cristianlevrero","email":"cristianlevrero@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cmsir-schema-directus_0.2.0_1788230870719_0.7435500998833109"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-01T02:47:50.549Z","0.2.0":"2026-09-01T02:47:50.849Z","modified":"2026-09-01T02:47:51.043Z"},"maintainers":[{"name":"cristianlevrero","email":"cristianlevrero@gmail.com"}],"description":"Compiles cmsIR schemas into a Directus snapshot and the cmsIR intermediate representation.","homepage":"https://github.com/criistianlevrero/cmsIR#readme","keywords":["cmsir","directus","schema","snapshot","codegen"],"repository":{"type":"git","url":"git+https://github.com/criistianlevrero/cmsIR.git","directory":"packages/schema-directus"},"author":{"name":"Cristian Levriero","email":"cristianlevrero@gmail.com"},"bugs":{"url":"https://github.com/criistianlevrero/cmsIR/issues"},"license":"MIT","readme":"# @criistianlevrero/cmsir-schema-directus\n\nCompiles a **cmsIR** intermediate representation into a\n[Directus](https://directus.io) schema snapshot — the JSON you apply to a\nDirectus v11 instance to materialize your content model.\n\nHandles the parts that don't map one-to-one: field type mapping, file and image\nfields, relation modelling (o2m, m2m, m2a) and junction-collection naming.\n\n## Install\n\n```bash\nnpm install @criistianlevrero/cmsir-schema-directus\n```\n\n## Usage\n\n```ts\nimport { compileDirectus } from \"@criistianlevrero/cmsir-schema-directus\";\n\nconst { snapshotPath, snapshotHash, irHash, diagnostics } = await compileDirectus({\n  outputSnapshotPath: \"dist/directus.snapshot.json\",\n  outputIRPath: \"dist/directus.ir.json\",\n});\n```\n\nBoth hashes are content digests: unchanged input produces an unchanged hash, so\nyou can skip re-applying a snapshot that did not move.\n\nApply the resulting snapshot with the Directus\n[schema API](https://docs.directus.io/reference/system/schema.html).\n\n## Conventions it guarantees\n\nDownstream adapters rely on these and cannot introspect them from the IR:\n\n- **Junction FK naming** — the related side of an m2m junction is a column named\n  `<targetCollection>_id`.\n- **Manual ordering** — sortable junctions expose an integer column named `sort`.\n\nChanging either breaks consumers that read relations back out of Directus.\n\n## Related\n\n- [`@criistianlevrero/cmsir-schema-core`](https://www.npmjs.com/package/@criistianlevrero/cmsir-schema-core) — the schema DSL and IR producer\n- [`@criistianlevrero/next-datalayer-adapter-directus`](https://www.npmjs.com/package/@criistianlevrero/next-datalayer-adapter-directus) — reads and writes data against the resulting schema\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-6f163126d7a1fc08e4c04f76264bf6b9"}