{"id":18310007,"url":"https://github.com/wilsonsergio2500/templateall","last_synced_at":"2025-04-09T11:43:39.897Z","repository":{"id":45040134,"uuid":"203849740","full_name":"wilsonsergio2500/templateall","owner":"wilsonsergio2500","description":"Create boilerplate or scafold code anytime and anywhere with ease","archived":false,"fork":false,"pushed_at":"2022-01-13T02:17:16.000Z","size":39,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T14:49:41.658Z","etag":null,"topics":["boilerplate-template","codecreator","template","template-engine","templatecreation","templating","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/wilsonsergio2500.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}},"created_at":"2019-08-22T18:18:36.000Z","updated_at":"2022-01-13T02:17:19.000Z","dependencies_parsed_at":"2022-08-27T16:31:48.526Z","dependency_job_id":null,"html_url":"https://github.com/wilsonsergio2500/templateall","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/wilsonsergio2500%2Ftemplateall","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilsonsergio2500%2Ftemplateall/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilsonsergio2500%2Ftemplateall/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilsonsergio2500%2Ftemplateall/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wilsonsergio2500","download_url":"https://codeload.github.com/wilsonsergio2500/templateall/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248033333,"owners_count":21036774,"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":["boilerplate-template","codecreator","template","template-engine","templatecreation","templating","typescript"],"created_at":"2024-11-05T16:12:59.906Z","updated_at":"2025-04-09T11:43:39.877Z","avatar_url":"https://github.com/wilsonsergio2500.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003ch1\u003etemplateall\u003c/h1\u003e\n\n\u003cp\u003eCreate boilerplate or scafold code anytime and anywhere with ease\u003c/p\u003e\n\n\u003c/div\u003e\n\n\u003chr /\u003e\n\n## The Problem\nMost often your project shares consistent boilearplate all across that you wish you could avoid  re-typing. On other instances, cli can take you far but yet not far enough. **Templateall** is here for all of those other moments when the project structure feels really personal and you desired to increase your tempo by bringing about a lot of code that is consistent with the pattern you follow.\n\nNeedless to say, I have utilized templateall with a great degree of sucess. My teammates have also enjoy it tremendously and appreciate its simplicity. Feel free to make it your own!\n\n\n## Installation\n\nThis module is distributed via [npm][npm]. In order to scafold or create boilerplate  - from templates - globally install this package.\n\n```\nnpm install templateall -g\n```\n\n## Running The Command\nThe command would prompt you for document name and document type, the list of types is orginated from the Types defined in the configuration file ([config.json][configExample])\n\n```\ntemplateall-create\n```\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://im.ages.io/RTLYaintl1\"/\u003e\n\u003c/p\u003e\n\nOn Success the module will provide confirmation of the documents created\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://im.ages.io/MxZjdintl1\"/\u003e\n\u003c/p\u003e\n\n## Prelude\nIn order stay consistent and provide ownership to the template creator and apply the least amount of configuration when running the module. The configuration file config.json and the templates must be under one common directory. \n\n\u003cdiv \u003e\n\u003cp\u003e\u003cstrong\u003eTip:\u003c/strong\u003e The package assumes that the configuration folder and the templates folder could be found at \u003cstrong\u003e\u003ci\u003eroot\\templateall.\u003c/i\u003e\u003c/strong\u003e thus in a Windows machine \u003cb\u003e\u003ci\u003eC:\\templateall.\u003c/i\u003e\u003c/b\u003e However, where the templates are actually located could be specified in the configuration file \u003cb\u003e\u003ci\u003econfig.json\u003c/i\u003e\u003c/b\u003e\u003c/p\u003e\n\u003c/div\u003e\n\n## Usage\n- Download the contents of the [assets][templateFiles] forlder into c:\\templateall\n- The above will provide a few examples that you could run in order to get you started with the templates\n- Point the configuration file to the diserable template folder.\n\n######  Config File (config.json)\n```\n{\n  \"templates\": \"C:\\\\templateall\\\\templates\",\n  \"types\": {\n    \"NGXS State\": \"state\",\n    \"NGXS State \u0026 List Filter Paginator\": \"state-list-paginator\",\n    \"NG Component \u0026 Resolver\": \"ng-component-resolver\",\n    \"NG Component\": \"ng-component\",\n    \"NG Component \u0026 Formly\": \"ng-component-formly\",\n    \"NG Component \u0026 List Filter Paginator\": \"ng-component-list-filter\"\n\n  },\n  \"autoIndent\": false,\n}\n```\n- In types you could specify the name of the template and under what name the templates would be found. `{ [template name]: [folder name]}`\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://im.ages.io/LxZjdintl1\"/\u003e\n\u003c/p\u003e\n\n- Change the template according to the below options\n\nName               | Description\n---                |---\nType               | The name of the type selected (If the first above selected then value equals **state**)\nName_original               | Name of the original document name entered -i.e *myDocument*\nName_file | Name of the file to generate (currently snake cased) -i.e *my-document*\nName_titlelized | Name of the entry as a title  -i.e *My Document*\nName_pascalized | Name of the entry as a pasca -i.e *MyDocument*\nName_camelized | Name of the entry as a camel -i.e *myDocument*\n\n- Hence you can specify binding syntax in the document as the following, Like an the `NGXS Example`\n\n######  Action File ({state}.actions.ts)\n```Typescript\nexport class {Name_pascalized}Loading {\n  static type = '[{Name_titlelized}] Set As Working';\n}\n\nexport class {Name_pascalized}Done {\n  static type = '[{Name_titlelized}] Set As Done';\n}\n\nexport class {Name_pascalized}GetElements {\n  static type = '[{Name_titlelized}] Get Elements';\n}\n```\n######  State File ({state}.state.ts)\n\n```Typescript\nimport { Store, State, Selector, StateContext, Action } from '@ngxs/store';\nimport { HttpClient } from '@angular/common/http';\nimport { I{Name_pascalized}StateModel } from './{Name_file}.model';\nimport { {Name_pascalized}Done, {Name_pascalized}Loading, {Name_pascalized}GetElements } \nfrom './{Name_file}.actions';\nimport { tap, mergeMap } from 'rxjs/operators';\n\n@State\u003cI{Name_pascalized}StateModel\u003e({\nname: '{Name_camelized}State',\ndefaults: \u003cI{Name_pascalized}StateModel\u003e{\n    working: true,\n    records: [],\n}\n})\nexport class {Name_pascalized}State {\n\n    constructor(\n        private httpClient: HttpClient\n    ){}\n\n...\n```\n- Will provide the following results\n######  Action File (my-document.actions.ts)\n```Typescript\nexport class MyDocumentLoading {\n  static type = '[My Document] Set As Working';\n}\n\nexport class MyDocumentDone {\n  static type = '[My Document] Set As Done';\n}\n\nexport class MyDocumentGetElements {\n  static type = '[My Document] Get Elements';\n}\n```\n######  State File (my-document.state.ts)\n```Typescript\nimport { Store, State, Selector, StateContext, Action } from '@ngxs/store';\nimport { HttpClient } from '@angular/common/http';\nimport { IMyDocumentStateModel } from './my-document.model';\nimport { MyDocumentDone, MyDocumentLoading, MyDocumentGetElements } \nfrom './my-document.actions';\nimport { tap, mergeMap } from 'rxjs/operators';\n\n@State\u003cIMyDocumentStateModel\u003e({\n    name: 'myDocumentState',\n    defaults: \u003cIMyDocumentStateModel\u003e{\n        working: true,\n        records: [],\n      }\n})\nexport class MyDocumentState {\n\n    constructor(\n        private httpClient: HttpClient\n    ){}\n\n...\n```\n\n## Alternative\n\nYou could inject custom metadata by including this in the `Data` attribute in [config.json][configExample] check the example. You could extrapolate this information by using Mustache. However the custom Mustache Tag has been defined as `['{!', '!}']` This is to avoid conflict with already common usage. \n\n[Ask Me More][more]\n\n[npm]: https://www.npmjs.com/\n[templateFiles]: /assets/\n[configExample]: /assets/config.json\n[more]: https://github.com/wilsonsergio2500/templateall/issues","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilsonsergio2500%2Ftemplateall","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilsonsergio2500%2Ftemplateall","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilsonsergio2500%2Ftemplateall/lists"}