{"id":19408491,"url":"https://github.com/4lessandrodev/types-generator","last_synced_at":"2025-02-25T02:17:10.764Z","repository":{"id":105008751,"uuid":"403221301","full_name":"4lessandrodev/types-generator","owner":"4lessandrodev","description":"Generate files and module for types ddd lib","archived":false,"fork":false,"pushed_at":"2021-09-05T23:47:04.000Z","size":243,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-07T14:22:52.254Z","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/4lessandrodev.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-05T05:13:28.000Z","updated_at":"2021-09-05T23:47:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"f976c326-9366-41f0-a403-cf18e096e3ab","html_url":"https://github.com/4lessandrodev/types-generator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4lessandrodev%2Ftypes-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4lessandrodev%2Ftypes-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4lessandrodev%2Ftypes-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4lessandrodev%2Ftypes-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/4lessandrodev","download_url":"https://codeload.github.com/4lessandrodev/types-generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240587478,"owners_count":19825005,"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","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":"2024-11-10T12:06:22.764Z","updated_at":"2025-02-25T02:17:10.750Z","avatar_url":"https://github.com/4lessandrodev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Types-ddd Generator\n\n## This lib generate types-ddd module and files\n\nDownload the `generator` folder. Put it on you project root folder.\n\nExecute the command on your terminal on your project root.\n\n```shell\n\nwget https://github.com/4lessandrodev/types-generator/archive/refs/heads/main.zip \u0026\u0026 \nunzip main.zip \u0026\u0026 mv ./types-generator-main/generator ./generator \u0026\u0026 rm -rf main.zip types-generator-main\n\n```\n\nYou may download clicking [HERE](https://downgit.github.io/#/home?url=https:%2F%2Fgithub.com%2F4lessandrodev%2Ftypes-generator%2Ftree%2Fmain%2Fgenerator) or clone this repo.\n\n### Folder structure\n\n```shell\n  $ tree\n  .\n  ├── package.json\n  ├── README.md\n  └── src\n       ├── config\n       │    ├── main.ts    \n       │    └── env.ts \n       │\n       └── modules\n            │ \n            └── [module-name]\n                  │ \n                  │── domain\n                  │     ├── value-objects\n                  │     ├── entities\n                  │     ├── aggregates\n                  │     ├── events\n                  │     ├── subscriptions\n                  │     ├── repo\n                  │     └── services\n                  │ \n                  ├── application\n                  │     └── use-cases \n                  │ \n                  └── infra\n                        ├── models     \n                        ├── repo\n                        └── mappers \n\n```\n\nPut the command below on you `package.json` scripts\n\n```json\n\n\"scripts\":{\n    \"generate\": \"yarn plop --plopfile ./generator/plopfile.js\"\n}\n\n```\n\n### Install plop and types-ddd\n\n* `$ yarn add types-ddd` or `$ npm install types-ddd`\n* `$ yarn add plop -D` or `$ npm install plop --dev`\n\n\u003e To generate a ddd module or resource use the command \n\n* `$ yarn generate \u003cresource-name\u003e` or \n* `$ npm run generate \u003cresource-name\u003e`\n\nExample:\n\n`$ yarn generate user`\n\n\n\u003e If you choose module. All default files and folders for a modules will be generated on src folder.\n\n![./readme/options.png](./readme/options.png)\n![./readme/generated.png](./readme/generated.png)\n\n\u003e By default import paths are set to aliases.\n\nYou can set alias on you `tsconfig.json` or change your templates import paths\n\n```json\n    \"baseUrl\": \"src\",\n    \"paths\": {\n      \"@modules/*\":[\"modules/*\"]\n    },\n```\n\nOn your package.json \n\n```json\n  \"_moduleAliases\": {\n    \"@modules\": \"./dist/modules\",\n  }\n```\n\nInstall module alias \n\n`$ yarn add module-alias` or `$ npm install module-alias`\n\nand finally, register it on your main file, before start your server.\n\nmain.ts / app.ts or index.ts\n\n`import 'module-alias/register';`\n\nYou can use the repository as example\n\n[Click To Example](https://github.com/4lessandrodev/nest-template)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4lessandrodev%2Ftypes-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F4lessandrodev%2Ftypes-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4lessandrodev%2Ftypes-generator/lists"}