{"id":46754266,"url":"https://github.com/harperfast/schema-codegen","last_synced_at":"2026-04-03T19:02:14.326Z","repository":{"id":342322956,"uuid":"1150958053","full_name":"HarperFast/schema-codegen","owner":"HarperFast","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-19T20:03:26.000Z","size":226,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-20T11:14:08.825Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HarperFast.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-05T22:15:59.000Z","updated_at":"2026-03-19T20:03:28.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/HarperFast/schema-codegen","commit_stats":null,"previous_names":["harperfast/schema-codegen"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/HarperFast/schema-codegen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarperFast%2Fschema-codegen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarperFast%2Fschema-codegen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarperFast%2Fschema-codegen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarperFast%2Fschema-codegen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HarperFast","download_url":"https://codeload.github.com/HarperFast/schema-codegen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarperFast%2Fschema-codegen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31371647,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T17:53:18.093Z","status":"ssl_error","status_checked_at":"2026-04-03T17:53:17.617Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-09T21:25:20.888Z","updated_at":"2026-04-03T19:02:14.308Z","avatar_url":"https://github.com/HarperFast.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @HarperFast/Schema-Codegen\n\nSchema Codegen will generate TypeScript types for your GraphQL schemas, making it easier to work with your data in TypeScript and JavaScript applications.\n\n## Installation\n\nInstall this with your favorite package manager!\n\n```bash\nnpm install --save @harperfast/schema-codegen\n```\n\nDrop this in your Harper application's config.yaml:\n\n```yaml\n'@harperfast/schema-codegen':\n  package: '@harperfast/schema-codegen'\n  globalTypes: 'schemas/globalTypes.d.ts'\n  schemaTypes: 'schemas/types.ts'\n```\n\nAlternatively, if you are using pure JavaScript, you can generate JSDoc instead:\n\n```yaml\n'@harperfast/schema-codegen':\n  package: '@harperfast/schema-codegen'\n  jsdoc: 'schemas/jsdocTypes.js'\n```\n\nWhen you `harper dev`, it will generate types based on the schema that's actually in your Harper database. If you change the schema, we will automatically regenerate the types for you.\n\n## Example\n\nFor example, here's a tracks.graphql schema:\n\n```graphql\ntype Tracks @table @sealed {\n\tid: ID @primaryKey\n\tname: String! @indexed\n\tmp3: Blob\n}\n```\n\nNext to it, a schemas/types.ts file will get generated with this:\n\n```typescript\n/**\n Generated from HarperDB schema\n Manual changes will be lost!\n \u003e harper dev .\n */\nexport interface Track {\n\tid: string;\n\tname: string;\n\tmp3?: any;\n}\n\nexport type NewTrack = Omit\u003cTrack, 'id'\u003e;\nexport type Tracks = Track[];\nexport type { Track as TrackRecord };\nexport type TrackRecords = Track[];\nexport type NewTrackRecord = Omit\u003cTrack, 'id'\u003e;\n```\n\nAn ambient declaration will also be generated in globalTypes.d.ts to enhance the global `tables` and `databases` from Harper:\n\n```typescript\n/**\n Generated from your schema files\n Manual changes will be lost!\n \u003e harper dev .\n */\nimport type { Table } from 'harperdb';\nimport type { Track } from './types.ts';\n\ndeclare module 'harperdb' {\n\texport const tables: {\n\t\tTracks: { new (...args: any[]): Table\u003cTrack\u003e };\n\t};\n\texport const databases: {\n\t\tdata: {\n\t\t\tTracks: { new (...args: any[]): Table\u003cTrack\u003e };\n\t\t};\n\t};\n}\n```\n\n## Development\n\nTo use this in an application, first link it:\n\n```bash\ngit clone git@github.com:HarperFast/schema-codegen.git\ncd schema-codegen\nnpm link\n```\n\nThen cd to your awesome application you want to test this with:\n\n```bash\ncd ~/my-awesome-app\nnpm link @harperfast/schema-codegen\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharperfast%2Fschema-codegen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharperfast%2Fschema-codegen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharperfast%2Fschema-codegen/lists"}