{"id":32567259,"url":"https://github.com/zewish/generate-it-typegen-spec2ts","last_synced_at":"2025-10-29T05:59:47.319Z","repository":{"id":63740332,"uuid":"569802984","full_name":"zewish/generate-it-typegen-spec2ts","owner":"zewish","description":"A schema to TypeScript generator plugin for generate-it acting as a thin wrapper around the @spec2ts/jsonschema type generator.","archived":false,"fork":false,"pushed_at":"2022-11-23T17:22:21.000Z","size":165,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-19T16:01:11.271Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zewish.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-11-23T16:41:36.000Z","updated_at":"2023-02-28T15:56:35.000Z","dependencies_parsed_at":"2022-11-25T02:05:04.349Z","dependency_job_id":null,"html_url":"https://github.com/zewish/generate-it-typegen-spec2ts","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/zewish/generate-it-typegen-spec2ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zewish%2Fgenerate-it-typegen-spec2ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zewish%2Fgenerate-it-typegen-spec2ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zewish%2Fgenerate-it-typegen-spec2ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zewish%2Fgenerate-it-typegen-spec2ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zewish","download_url":"https://codeload.github.com/zewish/generate-it-typegen-spec2ts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zewish%2Fgenerate-it-typegen-spec2ts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281570345,"owners_count":26523793,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-29T02:00:06.901Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2025-10-29T05:59:45.886Z","updated_at":"2025-10-29T05:59:47.315Z","avatar_url":"https://github.com/zewish.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM Version](https://img.shields.io/npm/v/generate-it-typegen-spec2ts.svg?style=flat-square)](https://www.npmjs.com/package/generate-it-typegen-spec2ts)\n[![Build Status](https://github.com/zewish/generate-it-typegen-spec2ts/workflows/build/badge.svg)](https://github.com/zewish/generate-it-typegen-spec2ts/actions?query=workflow%3Abuild)\n[![Coverage Status](https://coveralls.io/repos/github/zewish/generate-it-typegen-spec2ts/badge.svg?branch=master)](https://coveralls.io/github/zewish/generate-it-typegen-spec2ts?branch=master)\n[![NPM Downloads](https://img.shields.io/npm/dm/generate-it-typegen-spec2ts.svg?style=flat-square)](https://www.npmjs.com/package/generate-it-typegen-spec2ts)\n\n# Generate-It TypeGen Spec2TS\n\nA schema to TypeScript generator plugin for [generate-it](https://github.com/acr-lfr/generate-it) acting as a thin wrapper around the [@spec2ts/jsonschema](https://github.com/touchifyapp/spec2ts/tree/master/packages/jsonschema) type generator.\n\n## Motivation\n\nSince version 5.42.0 generate-it supports using external schema to type generation plugins which effectively overrides the default integrated type generator (quicktype).\n\nThe @spec2ts/jsonschema package is clean-slate TypeScript-only solution which generates better types than the current solution used internally in generate-it. Compared to the default type generator this typegen has the following improvements:\n- generates proper date types (quicktype only generates `string` for the \"type: date-time\" fields at the time of writing);\n- always creates unions instead of the non-interchangeable enum types (quicktype generates `enums` by default, has an optional flag for `unions`);\n- supports and generates proper `nullable` properties (quicktype does not respect the `nullable` parameter at the time of writing);\n\n## Usage\n\nIn your generate-it managed project do the following:\n\n```sh\nnpm install --save-dev generate-it-typegen-spec2ts\n```\n\nAfterwards make sure you modify your `.nodegenrc` file to look like this:\n\n```jsonc\n{\n  // ...\n  // required:\n  \"typegen\": \"generate-it-typegen-spec2ts\",\n  // optionally override default typegen options (defaults are given here for reference):\n  \"typegenOptions\": {\n    \"avoidAny\": false,\n    \"enableDate\": true\n  }\n}\n```\n\nFinally make sure to regenerate your project.\n\n**NOTE: In case this is an existing project you may need to do some fixes on your exsiting types in the project.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzewish%2Fgenerate-it-typegen-spec2ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzewish%2Fgenerate-it-typegen-spec2ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzewish%2Fgenerate-it-typegen-spec2ts/lists"}