{"id":15492132,"url":"https://github.com/imjuni/fast-maker","last_synced_at":"2025-09-09T22:44:35.444Z","repository":{"id":36967920,"uuid":"359848015","full_name":"imjuni/fast-maker","owner":"imjuni","description":"CLI to generate route configuration using directory structure","archived":false,"fork":false,"pushed_at":"2024-02-25T18:24:04.000Z","size":2482,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-05T00:45:27.894Z","etag":null,"topics":["cli","fastify","fastifyjs","nodejs","route","routing","routing-engine","typescript"],"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/imjuni.png","metadata":{"files":{"readme":"README.ko.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":"2021-04-20T14:37:32.000Z","updated_at":"2024-03-29T14:43:30.000Z","dependencies_parsed_at":"2024-11-16T16:06:11.029Z","dependency_job_id":"0d3dae46-da0d-4180-959a-43c1f386de65","html_url":"https://github.com/imjuni/fast-maker","commit_stats":{"total_commits":88,"total_committers":1,"mean_commits":88.0,"dds":0.0,"last_synced_commit":"4250291c75e73f9beefeb75111390cbf6346d21a"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/imjuni/fast-maker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjuni%2Ffast-maker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjuni%2Ffast-maker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjuni%2Ffast-maker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjuni%2Ffast-maker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imjuni","download_url":"https://codeload.github.com/imjuni/fast-maker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjuni%2Ffast-maker/sbom","scorecard":{"id":485671,"data":{"date":"2025-08-11","repo":{"name":"github.com/imjuni/fast-maker","commit":"4250291c75e73f9beefeb75111390cbf6346d21a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/18 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/imjuni/fast-maker/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/imjuni/fast-maker/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/imjuni/fast-maker/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/imjuni/fast-maker/ci.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"12 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99","Warn: Project is vulnerable to: GHSA-rrr8-f88r-h8q6","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T17:42:26.499Z","repository_id":36967920,"created_at":"2025-08-19T17:42:26.499Z","updated_at":"2025-08-19T17:42:26.499Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274374931,"owners_count":25273827,"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-09-09T02:00:10.223Z","response_time":80,"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":["cli","fastify","fastifyjs","nodejs","route","routing","routing-engine","typescript"],"created_at":"2024-10-02T07:58:58.986Z","updated_at":"2025-09-09T22:44:35.406Z","avatar_url":"https://github.com/imjuni.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fast-maker\r\n\r\n![ts](https://flat.badgen.net/badge/Built%20With/TypeScript/blue)\r\n[![Download Status](https://img.shields.io/npm/dw/fast-maker.svg?style=flat-square)](https://npmcharts.com/compare/fast-maker?minimal=true)\r\n[![Github Star](https://img.shields.io/github/stars/imjuni/fast-maker.svg?style=flat-square)](https://github.com/imjuni/fast-maker)\r\n[![Github Issues](https://img.shields.io/github/issues-raw/imjuni/fast-maker.svg?style=flat-square)](https://github.com/imjuni/fast-maker/issues)\r\n[![NPM version](https://img.shields.io/npm/v/fast-maker.svg?style=flat-square)](https://www.npmjs.com/package/fast-maker)\r\n[![License](https://img.shields.io/npm/l/fast-maker.svg?style=flat-square)](https://github.com/imjuni/fast-maker/blob/master/LICENSE)\r\n[![ci](https://github.com/imjuni/fast-maker/actions/workflows/ci.yml/badge.svg?branch=master\u0026style=flat-square)](https://github.com/imjuni/fast-maker/actions/workflows/ci.yml)\r\n[![codecov](https://codecov.io/gh/imjuni/fast-maker/branch/master/graph/badge.svg?token=YrUlnfDbso\u0026style=flat-square)](https://codecov.io/gh/imjuni/fast-maker)\r\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\r\n\r\n`fast-maker` generate fastify.js route configuration using by directory structure.\r\n\r\nWhy `fast-maker`?\r\n\r\nfastify.js already have auto route mechanics using [fastify-autoload](https://github.com/fastify/fastify-autoload). But why you have to use `fast-maker`?\r\n\r\n1. [Static analysis](https://en.wikipedia.org/wiki/Static_program_analysis): `fast-maker` generate TypeScript source code. Because it help to find error in compile-time, not runtime\r\n2. Complex Variable: You can use like that: `/person/[kind]-[id]/`. It help to get id and kind of id, for example serial-number and id or db-pk and id\r\n3. Next.js: `fast-maker` use the same mechanics as [Next.js](https://nextjs.org/docs/routing/introduction)\r\n4. `fast-maker` support a beautiful cli-interface\r\n\r\n## Table of Contents \u003c!-- omit in toc --\u003e\r\n\r\n- [Getting started](#getting-started)\r\n- [How it works?](#how-it-works)\r\n- [Installation](#installation)\r\n- [Usage](#usage)\r\n- [Routing](#routing)\r\n  - [HTTP Method](#http-method)\r\n  - [Route options](#route-options)\r\n  - [Route handler](#route-handler)\r\n  - [Variable in Route Path](#variable-in-route-path)\r\n- [Example using fastify.js](#example-using-fastifyjs)\r\n- [Relate To](#relate-to)\r\n- [Roadmaps](#roadmaps)\r\n- [License](#license)\r\n\r\n## Getting started\r\n\r\n```bash\r\nnpx fast-maker init\r\nnpx fast-maker route\r\n```\r\n\r\nYou can create configuration file using init command. And you can run route command, `fast-maker` generate `route.ts` file on your output directory in configuration file.\r\n\r\nYou can see this mechanics!\r\n\r\n![fast-maker-showcase.gif](assets/fast-maker-showcase.gif)\r\n\r\n## How it works?\r\n\r\n`fast-maker` using **TypeScript Compiler API**. So `fast-maker` exactly know handler function and route option in each file.\r\n\r\n```mermaid\r\ngraph LR\r\n\r\nA[route file] --\u003e fast-maker\r\nsubgraph fast-maker\r\ndirection TB\r\nC[TypeScript Compiler API]--\u003e|extract \u003cbr/\u003ehandler function,\u003cbr /\u003e option variable|B[fast-maker]\r\nend\r\nfast-maker--\u003e|extract \u003cbr /\u003eroute path|D[route.ts]\r\n```\r\n\r\nThe image below briefly shows how the directory is converted to route configurations.\r\n\r\n| AS-IS (directory structure)                                |     | TO-BE (route function)                             |\r\n| ---------------------------------------------------------- | --- | -------------------------------------------------- |\r\n| ![directory_structure.png](assets/directory_structure.png) | ➜   | ![route_config_ts.png](assets/route_config_ts.png) |\r\n\r\n## Installation\r\n\r\n```basn\r\nnpm i fast-maker --save-dev\r\n```\r\n\r\n## Usage\r\n\r\nYou can see help from `--help` option.\r\n\r\n```bash\r\n# display help for each commands\r\nnpx fast-maker --help\r\n\r\n# display help for route commands\r\nnpx fast-maker route --help\r\n\r\n# display help for watch commands\r\nnpx fast-maker watch --help\r\n\r\n# display help for init commands\r\nnpx fast-maker init --help\r\n```\r\n\r\nAlso you can see detail option [here](/docs/options.md).\r\n\r\n## Routing\r\n\r\n`fast-maker` has a file-system based route configuration. This concept borrowed from [Next.js routing system](https://nextjs.org/docs/routing/introduction). But one difference is that _HTTP Method_ is separated by file-system.\r\n\r\n### HTTP Method\r\n\r\nuse file-system.\r\n\r\n```text\r\nhandlers/\r\n├─ get/\r\n│  ├─ hero/\r\n│  │  ├─ [name].ts\r\n├─ post/\r\n│  ├─ hero.ts\r\n├─ put/\r\n│  ├─ hero/\r\n│  │  ├─ [name].ts\r\n├─ delete/\r\n│  ├─ hero/\r\n│  │  ├─ [name].ts\r\n```\r\n\r\n`get`, `post`, `put`, `delete` directory represent _HTTP Method_. Also you can use `options`, `patch`, `head`, `all` directory.\r\n\r\n### Route options\r\n\r\nYou can pass `RouteShorthandOptions` option like that,\r\n\r\n```ts\r\nexport const option: RouteShorthandOptions = {\r\n  schema: {\r\n    querystring: schema.properties?.Querystring,\r\n    body: schema.properties?.Body,\r\n  },\r\n};\r\n```\r\n\r\nYou have to `named export` and variable name must be a `option`.\r\n\r\n### Route handler\r\n\r\nYou can pass route handler function like that,\r\n\r\n```ts\r\nimport { FastifyRequest } from 'fastify';\r\nimport type { IReqSearchPokemonQuerystring, IReqSearchPokemonParams } from '../../interface/IReqSearchPokemon';\r\n\r\nexport default async function (\r\n  req: FastifyRequest\u003c{ Querystring: IReqSearchPokemonQuerystring; Params: IReqSearchPokemonParams }\u003e,\r\n) {\r\n  console.debug(req.query);\r\n  console.debug(req.body);\r\n\r\n  return 'hello';\r\n}\r\n```\r\n\r\nYou have to `non-named export` (aka default export). Also you can use arrow function and you can use any name under TypeScript function name rule, as well as type arguments perfectly applied on route configuration\r\n\r\n### Variable in Route Path\r\n\r\nFile or Directory name surrounded square bracket like that,\r\n\r\n```text\r\nhandlers/\r\n├─ get/\r\n│  ├─ hero/\r\n│  │  ├─ [name].ts\r\n```\r\n\r\nComplex variable, No problem.\r\n\r\n```text\r\nhandlers/\r\n├─ get/\r\n│  ├─ hero/\r\n│  │  ├─ [affiliation]-[name].ts\r\n```\r\n\r\nThis route path access like that: `curl http://localhost:8080/hero/marvel-ironman`\r\n\r\nThat's it. `fast-maker` takes care of the rest.\r\n\r\n## Example using fastify.js\r\n\r\nA complete example of using `fast-maker` can be found at [Ma-eum](https://github.com/maeumjs/maeum).\r\n\r\n## Relate To\r\n\r\n- [ts-morph](https://github.com/dsherret/ts-morph)\r\n  - TypeScript Compiler API wrapper\r\n\r\n## Roadmaps\r\n\r\n- [ ] display each route path in cli-table\r\n- [ ] add new option silent\r\n- [ ] documentation site\r\n- [ ] add more test\r\n\r\n## License\r\n\r\nThis software is licensed under the [MIT](https://github.com/imjuni/fast-maker/blob/master/LICENSE).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimjuni%2Ffast-maker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimjuni%2Ffast-maker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimjuni%2Ffast-maker/lists"}