{"id":19529971,"url":"https://github.com/loopmode/alt-generator","last_synced_at":"2026-02-28T19:01:50.595Z","repository":{"id":35165196,"uuid":"39411539","full_name":"loopmode/alt-generator","owner":"loopmode","description":null,"archived":false,"fork":false,"pushed_at":"2015-09-08T19:01:05.000Z","size":144,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-09T13:23:18.391Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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/loopmode.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":"2015-07-20T22:28:27.000Z","updated_at":"2015-07-20T22:28:27.000Z","dependencies_parsed_at":"2022-09-16T15:01:01.358Z","dependency_job_id":null,"html_url":"https://github.com/loopmode/alt-generator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/loopmode/alt-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopmode%2Falt-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopmode%2Falt-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopmode%2Falt-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopmode%2Falt-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loopmode","download_url":"https://codeload.github.com/loopmode/alt-generator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopmode%2Falt-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29948228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T18:42:55.706Z","status":"ssl_error","status_checked_at":"2026-02-28T18:42:48.811Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":[],"created_at":"2024-11-11T01:28:19.672Z","updated_at":"2026-02-28T19:01:50.573Z","avatar_url":"https://github.com/loopmode.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# alt-generator\n\n__This is just an idea, not an implementation!__\n\nA set of CLI generator tools to simplify the work with boilerplate code that is tedious but often neccessary.\nThe initial usecase was working with the Alt javascript library, a flux implementation for react.js.\nHowever, defining a simple API and using itself, it should be easy to define you own helpers for any language or framework.  \n  \nThe idea is to generate actual source files from predefined templates and user-given options.\nOptions are given by the user's answers to predefined questions on the commandline, much like the usage of `npm init`.\n\nAll configuration is based on defaults, so that sometimes it may be skipped altogether, creating a default set of output in predefined locations. \nOtherwise, when you give the answers, it tries to stay out of your way, allowing you to keep hitting the enter key and intervening only occasionally.\n\nOptions may be specified by direct input, like specifying a name, or by using options in either multiple-choice or single-exclusive manner.\n\n\talt-generator [generator][command, ...options]\n\nThere is a 'generator generator' :) that can be used to easily create new generator helpers for some specific needs that you might have, like creating a test, view or config file:\n\n\talt-generator generator create generator AndroidView // create an 'AndroidView' generator wizard\n\talt-generator AndroidView create UserInfoPanel // Use your wizard to do whatever you wanted, create XML files, java classes, groovy scripts, ...\n\nExamples using [a bash alias](#aliases) for the `alt-entity` generator.\nAll examples will be using this User entity.\n\n\t\u003e\u003e alt-entity create User\n\tSkip configuration steps and use defaults? (✓) no () yes\n\tname of the entity: User\n\tuse generators:\n\t\t(✓) store\n\t\t(✓) actions\n\t\t(✓) datasource\n\t\t ( ) component\n\t\t ( ) test\n\t\t ( ) docs\n\n\nBenefits:\n- Standardized code style via templates\n- Tidy source files to start with\n- Unified interface for defining variable types (flowtype vs react PropTypes)\n- clean code, clean docs (see docs helper!)\n\n\n## Helpers overview\n\n\n### docs\n\nCreates a new readme file in the documentation folder. The default format is markdown.\n\nKeeping the documentation completely outside of source files improves the readability of your code.\nIt also applies the single-responsibility concept to a higher level by keeping a clear separation\nbetween the technical implementation in a programming language and its description in a human language.\n\nA documentation block will be created for all class members that are not marked with `/** @private */` according to the specified template.\nA link to the created markdown file will be added to `yourDocs/readme.md` (maybe index.md?)\nExample using the User entity:\n\n\t\u003e\u003e alt-entity -docs User\n\ttemplate: (✓) markdown ( ) other template?\n\toutput: docs/readme/entities/User.md \n\n\n### store\n\nCreates a new store for an entity. When using immutable.js, all properties of type object will be created as immutable Maps, and arrays as immutable Lists respectively.\n\nExample using the User entity:\n\n\t[store] use immutable.js? (✓) yes ( ) no\n\t[store] specify a list of property names. Use comma as separator.\n\t\u003e\u003e name, email, auth\n\t[store] do you want to define propTypes? (✓) yes ( ) no\n\n\t[store] is \"name\" required? ( ) no (✓) yes\t\t\t\t\t// no was default\n\t[store] propType for: \"name\"\n\t\u003e\u003e\t(✓) string  \n\t\u003e\u003e\t( ) number\n\t\u003e\u003e\t( ) bool  \n\t\u003e\u003e\t( ) custom type  \n\t[store] plese confirm:\n\t\"name\": React.PropTypes.string.isRequired \n\t\u003e\u003e (✓) ok ( ) no\n\t\n\t[store] is \"email\" required? (✓) no ( ) yes\n\t[store] propType for: \"email\"\n\t\u003e\u003e\t(✓) string  \n\t\u003e\u003e\t( ) number\n\t\u003e\u003e\t( ) bool  \n\t\u003e\u003e\t( ) custom type  \n\t[store] please confirm:\n\t\"email\": React.PropTypes.string \n\t\u003e\u003e (✓) ok ( ) no\n\t\n\t[store] is \"auth\" required? ( ) no (✓) yes\n\t[store] propType for: \"auth\"\n\t\u003e\u003e\t( ) string  \n\t\u003e\u003e\t( ) number\n\t\u003e\u003e\t( ) bool  \n\t\u003e\u003e\t(✓) custom type  \n\t[store] specify a custom type type for \"auth\": \n\t\u003e\u003e shape({token: any.isRequired, timestamp:number.isRequired})\n\t[store] please confirm:\n\t\"auth\": React.PropTypes.shape({\"token\": React.PropTypes.any.isRequired, \"timestamp\": React.PropTypes.number.isRequired}) \n\t(✓) ok ( ) no\n\t\n\t[store] target file:\n\t\u003e\u003e /src/app/stores/UserStore.js \t\t// the value was prefilled\n\n\t[store] store configuration done!\n\n\n### actions\n\nCreates a file containing action definitions.\n\nWhen a Store was detected, handler methods can be created in the Store class. The handler methods will be bound to the actions using ES7 decorators.\n\nWhen pairs of names are found that share the same base except of a past-tense suffix, the present-tense names are considered API request methods and no handler methods are created for them by default.\n\nExample using the User entity:\n\n\t[actions] specify a list of actions. Use comma as separator.\n\t\u003e\u003e load, loaded, create, created, update, updated, delete, deleted, error\n\t\n\t[actions] do you want to define params? (✓) yes ( ) no\n\t\n\t[actions] params for 'load':\n\t\u003e\u003e id:number\n\t[actions] params for 'loaded':\n\t\u003e\u003e data:any\n\t[actions] params for 'create':\n\t\u003e\u003e name:string\n\t[actions] params for 'created':\n\t\u003e\u003e name:string, id:number\n\t[actions] params for 'update':\n\t\u003e\u003e id:number, data:shape({name:string,email:string})\n\t[actions] params for 'updated':\n\t\u003e\u003e \n\t[actions] params for 'delete':\n\t\u003e\u003e id:number\n\t[actions] params for 'deleted':\n\t\u003e\u003e \n\n\t[actions] {StoreName} found.\n\t[actions] Select actions to be handled in {StoreName}\n\n\t( )\t\tload\n\t(✓) \tloaded\n\t( )\t\tcreate\n\t(✓) \tcreated\n\t( )\t\tupdate\n\t(✓) \tupdated\n\t( )\t\tdelete\n\t(✓)\t\tdeleted\n\n\t[actions] actions configuration done!\n\n### datasource\n\nCreates a datasource that connects the entity with your RESTful API.\n\nWhen actions are found, API request methods can be created. (TODO: clarify..)\n\nAPI request methods in datasource classes always return a `Promise`.\n\nWhen pairs of names are found that share the same base except of a past-tense suffix, the past-tense names are considered API response handlers and no request methods are created for them per default.\n\n\t[datasource] {ActionsName} found.\n\t[datasource] specify API request methods for these actions:\n\t(✓)\t\tload\n\t( ) \tloaded\n\t(✓)\t\tcreate\n\t( ) \tcreated\n\t(✓)\t\tupdate\n\t( ) \tupdated\n\t(✓)\t\tdelete\n\t( )\t\tdeleted\n\n\t[datasource] specify API request methods:\n\tload\t (✓) GET ( ) POST ( ) PUT ( ) PATCH ( ) DELETE\n\tcreate\t ( ) GET (✓) POST ( ) PUT ( ) PATCH ( ) DELETE\n\tupdate\t ( ) GET ( ) POST (✓) PUT (✓) PATCH ( ) DELETE\n\tdelete\t ( ) GET ( ) POST ( ) PUT ( ) PATCH (✓) DELETE\n\t... // same procedure as with prop types\n\n\n\n## Config file\n\nYou can configure tools using a `.altgenrc` file to specify default options.\nWhen\n\n\t{\n\t\t\"past-tense-suffix\": \"d\"\n\t\t\"generators\": {\n\t\t\t\"docs\": {\n\t\t\t\t\"output\": \"docs/entities/{file}\",\n\t\t\t\t\"format\": \"markdown\"\n\t\t\t},\n\t\t\t\"actions\": {\n\t\t\t\t\"output\": \"src/app/actions/{file}\",\n\t\t\t},\n\t\t\t\"stores\": {\n\t\t\t\t\"output\": \"src/app/stores/{file}\",\n\t\t\t},\n\t\t\t\"datasource\": {\n\t\t\t\t\"output\": \"src/app/datasources/{file}\"\n\t\t\t\t\"name-method-automap\": {\n\t\t\t\t\t\"load\": \"GET\"\n\t\t\t\t\t\"create\": \"POST\"\n\t\t\t\t\t\"update\": \"PUT, PATCH\",\n\t\t\t\t\t\"remove\": \"DELETE\"\n\t\t\t\t}\n\t\t\t}\n\t\t\\\n\t}\n\n#### \u003ca name=\"aliases\"\u003ebash aliases\n\nalias alt-entity=\"./node_modules/.bin/alt-generator alt-entity\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floopmode%2Falt-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floopmode%2Falt-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floopmode%2Falt-generator/lists"}