{"id":43916848,"url":"https://github.com/formidablejs/ts-ports","last_synced_at":"2026-02-06T21:34:51.482Z","repository":{"id":48793119,"uuid":"517029226","full_name":"formidablejs/ts-ports","owner":"formidablejs","description":"Enable TypeScript support in the Formidable Framework.","archived":false,"fork":false,"pushed_at":"2025-04-20T14:30:00.000Z","size":532,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-10-08T15:18:51.124Z","etag":null,"topics":["typescript"],"latest_commit_sha":null,"homepage":"https://formidablejs.org/docs/typescript-support","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/formidablejs.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-23T10:41:47.000Z","updated_at":"2025-04-20T14:30:00.000Z","dependencies_parsed_at":"2024-08-21T21:55:33.305Z","dependency_job_id":null,"html_url":"https://github.com/formidablejs/ts-ports","commit_stats":{"total_commits":42,"total_committers":1,"mean_commits":42.0,"dds":0.0,"last_synced_commit":"e8347b98c5da9cec62e26b9b8ce90095d741d926"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/formidablejs/ts-ports","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formidablejs%2Fts-ports","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formidablejs%2Fts-ports/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formidablejs%2Fts-ports/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formidablejs%2Fts-ports/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/formidablejs","download_url":"https://codeload.github.com/formidablejs/ts-ports/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formidablejs%2Fts-ports/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29177554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T20:14:21.878Z","status":"ssl_error","status_checked_at":"2026-02-06T20:14:21.443Z","response_time":59,"last_error":"SSL_read: 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":["typescript"],"created_at":"2026-02-06T21:34:51.396Z","updated_at":"2026-02-06T21:34:51.476Z","avatar_url":"https://github.com/formidablejs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ts-ports\n\n`ts-ports` enables TypeScript support in the Formidable framework.\n\n![Build](https://github.com/formidablejs/ts-ports/actions/workflows/build.yml/badge.svg)\n![npm](https://img.shields.io/npm/v/@formidablejs/ts-ports)\n![GitHub](https://img.shields.io/github/license/formidablejs/ts-ports)\n\n## Requirements\n\n- [@formidablejs/framework](https://www.npmjs.com/package/@formidablejs/framework): `\u003e=0.12.x`\n\n## Install\n\n### Recommended\n\n```bash\nformidable new \u003capp-name\u003e [...args] --ts\n```\n\n### Existing Project\n\nnpm:\n\n```bash\nnpm i @formidablejs/ts-ports --save\n```\n\nyarn:\n\n```bash\nyarn add @formidablejs/ts-ports --save\n```\n\n## Configuration\n\nOpen the `package.json` file and add `\"language\": \"TypeScript\"`:\n\n```json\n{\n  ...\n  \"language\": \"TypeScript\",\n  ...\n}\n```\n\nFinaly, open the `config/app.ts` config file and add `TypeScriptPortsServiceResolver` under resolvers:\n\n```ts\n...\nimport { TypeScriptPortsServiceResolver } from '@formidablejs/ts-ports';\n\nexport default {\n  ...\n  resolvers: {\n    ...,\n    TypeScriptPortsServiceResolver,\n    ...\n\n```\n\n## Usage\n\n### `@use` Decorator\n\nThe `use` decorator in `@formidablejs/ts-ports` works the same way as the `use` decorator in `@formidablejs/framework`. To get started, just import the `use` decorator from `@formidablejs/ts-ports` and add it next to any of your class functions:\n\n```ts\nimport { use } from \"@formidablejs/ts-ports\";\nimport { Controller } from \"./Controller\";\n\nexport class UserController extends Controller {\n  @use(\"table:users\")\n  public async show(user: Promise\u003cUser | null\u003e): Promise\u003cUser | void\u003e {\n    return (await user) || this.notFound(\"User not found.\");\n  }\n}\n```\n\n### Commands\n\n`ts-ports` also adds 2 new commands to your application.\n\n#### `make:interface`\n\n```bash\nnode craftsman make:interface IUserController\n```\n\n#### `make:type`\n\n```bash\nnode craftsman make:type User\n```\n\n#### `types:generate`\n\n```bash\nnode craftsman types:generate\n```\n\nThis will generate types based on the rules of your `requests`.\n\n\u003e Works with TypeScript only\n\n## Security\n\nIf you discover any security related issues, please email donaldpakkies@gmail.com instead of using the issue tracker.\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformidablejs%2Fts-ports","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fformidablejs%2Fts-ports","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformidablejs%2Fts-ports/lists"}