{"_id":"@burojs/field-types","name":"@burojs/field-types","dist-tags":{"latest":"0.2.0"},"versions":{"0.2.0":{"name":"@burojs/field-types","version":"0.2.0","license":"MIT","description":"Buro: default field types (string, number, ref, ...)","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"}},"./package.json":"./package.json"},"dependencies":{"@burojs/core":"0.2.0"},"peerDependencies":{"zod":"^3.24.0"},"devDependencies":{"tsup":"^8.3.0","typescript":"^5.5.0","vitest":"^2.1.0","expect-type":"^1.1.0","@burojs/tooling-tsconfig":"0.0.0","@burojs/tooling-eslint":"0.0.0"},"publishConfig":{"access":"public"},"scripts":{"build":"tsup","dev":"tsup --watch","typecheck":"tsc --noEmit","typecheck:tests":"tsc -p tsconfig.test.json"},"_id":"@burojs/field-types@0.2.0","_integrity":"sha512-Uoyd7vgxGfbWTLIM/FhP83E+VYJ4Ox9zBUezxi+bRt3TwfTG2Cm8NsK0CY/k2sEdJ0XmV+ejNuIataY3Kk6YKQ==","_resolved":"/tmp/356e6ad48805ec72d8d12649e76ea884/burojs-field-types-0.2.0.tgz","_from":"file:burojs-field-types-0.2.0.tgz","_nodeVersion":"22.23.2","_npmVersion":"10.9.8","dist":{"integrity":"sha512-Uoyd7vgxGfbWTLIM/FhP83E+VYJ4Ox9zBUezxi+bRt3TwfTG2Cm8NsK0CY/k2sEdJ0XmV+ejNuIataY3Kk6YKQ==","shasum":"08fbab30177bc1872cb98e99724d9c5ec034bd2c","tarball":"https://registry.npmjs.org/@burojs/field-types/-/field-types-0.2.0.tgz","fileCount":9,"unpackedSize":250782,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGBx5LtepCysommRJYe4Xvyvbmx6ltCmFXkfkgXKVPggAiEAp52OnS/eW2suaOv5IW3HQqrHy0W4zdjTlrbLIfW21gI="}]},"_npmUser":{"name":"maksimkuznetsov","email":"mak.kooz@gmail.com"},"directories":{},"maintainers":[{"name":"maksimkuznetsov","email":"mak.kooz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/field-types_0.2.0_1786820376138_0.5694416255758545"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-15T18:59:36.012Z","0.2.0":"2026-08-15T18:59:36.296Z","modified":"2026-08-15T18:59:36.514Z"},"maintainers":[{"name":"maksimkuznetsov","email":"mak.kooz@gmail.com"}],"description":"Buro: default field types (string, number, ref, ...)","license":"MIT","readme":"# @burojs/field-types\n\nThe default field-type set for [buro](https://github.com/buro/buro) — the `f.*` builder you use inside `defineResource`.\n\n## Install\n\n```bash\npnpm add @burojs/field-types @burojs/core\n```\n\n## Usage\n\n```ts\nimport { defineResource } from '@burojs/field-types';\n\ndefineResource(\n  'document',\n  {\n    fields: (f) => ({\n      id: f.number({ system: true }),\n      title: f.string({ label: 'Title', required: true }),\n      status: f.enum(['draft', 'published'], { label: 'Status' }),\n      author: f.ref('user', { label: 'Author' }),\n      tags: f.refMany('tag', { label: 'Tags' }),\n      published_at: f.dateTime({ label: 'Published' }),\n      config: f.code({ language: 'yaml' }),\n      is_active: f.boolean({ label: 'Active' }),\n    }),\n  },\n);\n```\n\nEach field carries its own label, visibility predicate, validation and UI hints, so the list, show and form surfaces are all derived from one declaration.\n\n## Main exports\n\n- **`defineResource`** — the canonical resource factory, already bound to the complete default field builder.\n- **`fieldBuilder` / `FieldBuilder` / `extendFieldBuilder`** — compose a custom builder and pass it once to core's `createResourceFactory`; includes `string`, `number`, `boolean`, `date`, `dateTime`, `enum`, `ref`, `refMany`, `code`, `richText`, `json`, `children` and friends.\n- **`fieldTypesPlugin`** — registers the set with a `defineApp` instance.\n- **`fromSchema` / `FromSchemaFieldDef`** — derive fields from an existing schema instead of hand-writing them.\n- **`isStandardSchema`** — detects a [Standard Schema](https://standardschema.dev) validator, so Zod/Valibot/ArkType can be passed to a field's `validate` with no runtime dependency on any of them.\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-255eb094fcb8cfaf1246af8db0b225d8"}