{"id":19190411,"url":"https://github.com/mdxprograms/react-do","last_synced_at":"2025-08-11T00:34:41.326Z","repository":{"id":71820247,"uuid":"108765338","full_name":"mdxprograms/react-do","owner":"mdxprograms","description":"react-do =\u003e A React file generator :pencil:","archived":false,"fork":false,"pushed_at":"2017-11-27T21:50:26.000Z","size":13,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-08T04:48:31.481Z","etag":null,"topics":["code-generator","generator","mobx","react"],"latest_commit_sha":null,"homepage":"","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/mdxprograms.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":"2017-10-29T19:42:40.000Z","updated_at":"2020-12-15T08:28:21.000Z","dependencies_parsed_at":"2023-10-12T05:43:31.020Z","dependency_job_id":null,"html_url":"https://github.com/mdxprograms/react-do","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"59849f54453307d979a525b15e261fbb473114ca"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdxprograms%2Freact-do","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdxprograms%2Freact-do/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdxprograms%2Freact-do/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdxprograms%2Freact-do/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdxprograms","download_url":"https://codeload.github.com/mdxprograms/react-do/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253002842,"owners_count":21838637,"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":["code-generator","generator","mobx","react"],"created_at":"2024-11-09T11:34:09.660Z","updated_at":"2025-05-08T04:48:37.481Z","avatar_url":"https://github.com/mdxprograms.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# { React Do }\n\n## Install\n\n`yarn add react-do --dev`\n\nor\n\n`npm i react-do --save-dev`\n\n## Description\n\nReact Do helps save time by reading `.react-do.json` in your project root and creating\na new file based on the configuration parameters and the `templatesDir` template you provide.\n\n```bash\nyarn react-do component HelloWorld\n```\n\nYou can also specify a nested filepath\n\n```bash\nyarn react-do component People/PersonList\n```\n\nThis will then create this file based off the configuration example below\n\n`./components/People/PersonList.js`\n\n\n## Configuration\n\n.react-do.json configuration example in project root\n\n```json\n{\n  \"templatesDir\": \"./templates\",\n  \"templates\": {\n    \"component\": {\n      \"ext\": \"js\",\n      \"destination\": \"./components/\"\n    },\n    \"container\": {\n      \"ext\": \"js\",\n      \"destination\": \"./components/\"\n    },\n    \"model\": {\n      \"ext\": \"js\",\n      \"destination\": \"./models/\"\n    },\n    \"actions\": {\n      \"ext\": \"js\",\n      \"destination\": \"./actions/\"\n    },\n    \"store\": {\n      \"ext\": \"js\",\n      \"destination\": \"./stores/\"\n    }\n  },\n  \"scaffold\": [\"component\", \"model\", \"actions\", \"store\"]\n}\n```\n\n## Templates\n\nYou can then define a templates directory somewhere in your project that\ncoincides with the `templatesDir`.\n\nThe script works off of the `templates` keys for finding the correct template in `templatesDir`.\n\nIf the `destination` doesn't exist it will create it for you.\n\nBoth `ext` and `destination` are mandatory.\n\nAn example template created in `./example-templates/component.js`\n\n```javascript\nimport React from 'react';\n\nconst YourComponent = () =\u003e (\n  \u003cdiv className=\"\"\u003e\n  • \u003cdiv\u003eI am render, bringer of fun\u003c/div\u003e\n  \u003c/div\u003e\n);\n\nexport default YourComponent;\n```\n\nThis will then create a component with your supplied filename via `yarn react-do component YourComponent`\nin `./components/YourComponent.js`\n\n## Scaffold\n\nYou can also setup a scaffolding command by adding the templates you want to get auto generated based off the scaffold name.\n\nexample command using the config above:\n\n```bash\nyarn react-do scaffold People\n```\n\nThis would then create `./components/People.js`, `./models/People.js`, `./actions/People.js`, `./stores/People.js`\n\n## Coming Soon\n\n- [ ] optional `filename` added to templates config will create a default filename to use for that template\n- [ ] destroy command for templates created individually or through scaffold\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdxprograms%2Freact-do","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdxprograms%2Freact-do","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdxprograms%2Freact-do/lists"}