{"id":18053864,"url":"https://github.com/danielstern/redux-tool","last_synced_at":"2025-04-05T08:21:49.263Z","repository":{"id":69958870,"uuid":"92187480","full_name":"danielstern/redux-tool","owner":"danielstern","description":"A CLI Tool for React-Redux Applications","archived":false,"fork":false,"pushed_at":"2017-07-03T23:25:56.000Z","size":44,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-10T15:50:56.081Z","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/danielstern.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-05-23T15:13:22.000Z","updated_at":"2017-09-07T16:15:05.000Z","dependencies_parsed_at":"2023-02-22T04:30:11.878Z","dependency_job_id":null,"html_url":"https://github.com/danielstern/redux-tool","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielstern%2Fredux-tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielstern%2Fredux-tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielstern%2Fredux-tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielstern%2Fredux-tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielstern","download_url":"https://codeload.github.com/danielstern/redux-tool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247307330,"owners_count":20917450,"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-10-31T00:08:23.002Z","updated_at":"2025-04-05T08:21:49.244Z","avatar_url":"https://github.com/danielstern.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003eRedux Tool\n\u003cimg src=\"https://cloud.githubusercontent.com/assets/4268152/26364385/2af2943c-3fb2-11e7-84ce-ff3d792ea273.png\" height=\"36\"\u003e\n\u003c/h1\u003e\n\n![promo-full](https://cloud.githubusercontent.com/assets/4268152/26363752/fecc6b14-3faf-11e7-9e93-a22c2a0ce73c.gif)\n\n## About\n\nRedux-Tool, an *unopinionated* helper to create your Redux files for you, handling all the boilerplate. Redux apps are great, but often creating just one new user interaction requires touching 8, 9, even 10 or more files. This tool lets you automate that process easily.\n\nRedux-Tool does all the repetitive tasks necessary to create your app,\n- Creates all necessary new folders and up-to-date index files for those folders\n- Creates new files using customizable boilerplate\n- Uses all latest ES6 syntax\n- Automatically creates utilities as required\n\n## Installation\n`npm install -g redux-tool`\n\nThis makes the following commands available in the command line,\n\n```\nredux-tool-selector [propertyName]\nredux-tool-action [actionName] [argumentName]\nredux-tool-reducer [propertyName] [defaultValue=0]\nredux-tool-component [componentName]\nredux-tool-saga [sagaName] [actionName=\"ACTION_NAME\"]\n```\n\nExecuting these commands will create boilerplate Redux code relative to the directory they are executed from.\n\n## Usage\n**Please note that you should always quickly commit your progress before using any CLI tool**\n\nRedux tool is run from the command line.\nIt creates necessary files for a React-Redux application and updates the index. \nIt assumes you are using ES6 with `import` statements.\n\nExample:\n`redux-tool-selector taxAmount`\n \nDescription: Create a file `./src/selectors/taxAmountSelector.js` and updates the index of the `./src/selectors/` directory.\n  \n###  Changing Templates\nTo change the templates, create a `redux-tool-config.js` file and indicate the templates there. See the [`redux-tool-config.js`](redux-tool-config.js) of this repository for a full example.\n\n```javascript\nmodule.exports = {\n    templates:{\n        selector:require('./templates/selector'),\n    },\n};\n```\n \nTemplates are standard lodash-style templates. E.g,\n ```javascript\n`export { \u003c%= name %\u003e} } from './\u003c%= name %\u003e';`\n```\n\n### Commands\n#### `redux-tool-selector [propertyName]`\nCreates a new selector in the selectors folder that selects `propertyName`. Also updates the index. The basic generated selector is meant to be modified but sometimes is enough on its own.\n##### Example\n```\nredux-tool-selector tax\n```\n###### selectors/taxSelector.js\n```javascript\nimport { createSelector } from 'reselect'\nexport const taxSelector = createSelector(\n   state=\u003estate.tax,\n   tax=\u003etax\n)\n```\n\n#### `redux-tool-component [componentName]`\nCreates a new directory `componentName` in the components folder. Creates display and container React-Redux components and updates the index.\n##### Example\n ```\nredux-tool-component TaxWidget\n```\n###### components/TaxWidget/TaxWidgetContainer.js\n\n```javascript\nimport { connect } from 'react-redux'\nimport {\n    TaxWidgetDisplay\n} from './TaxWidgetDisplay';\n   \n[...]\n\nexport const TaxWidgetContainer = connect(\n    mapStateToProps,\n    mapDispatchToProps\n)(TaxWidgetDisplay);\n```\n\n###### components/TaxWidget/TaxWidgetDisplay.jsx\n```jsx harmony\nimport React from 'react'\nexport const TaxWidgetDisplay = ({})=\u003e(\n    \u003cdiv\u003e\n        \n    \u003c/div\u003e\n);\n```\n\n#### `redux-tool-action [actionName] [argumentName]`\nCreates a new action creator and constant based on `actionName`. The action and the constant are both exported. A property name can be added to the action with `argumentName` (optional).\n##### Example\n ```shell\nredux-tool-action changeTax rate\n```\n###### actions/changeTax.js\n```javascript\nimport { makeActionCreator } from '../utility';\nexport const CHANGE_TAX = \"CHANGE_TAX\";\nexport const changeTax = makeActionCreator(CHANGE_TAX,\"rate\");\n```\n\n###### actions/index.js\n```javascript\nexport { changeTax , CHANGE_TAX } from './changeTax';\n```\n\n#### `redux-tool-reducer [propertyName] [defaultValue=0]`\nCreates a new reducer for the state property `propertyName`. A `defaultValue` can be defined, or it is automatically set to 0.\n##### Example\n ```\nredux-tool-reducer taxRate\n```\n###### reducers/taxRate.js\n```javascript\nimport { createReducer } from './../utility';\nexport const taxRate = createReducer(0, {\n    [\"ACTION_NAME\"](state,action) {\n        return state;\n    }\n});\n```\n\n#### `redux-tool-saga [sagaName] [actionName=\"ACTION_NAME\"]`\nCreates a saga called `sagaName`, importing an optional action name.\n##### Example\n```\nredux-tool-saga updateTaxRates changeLocale\n```\n\n###### sagas/updateTaxRatesSaga.js\n```javascript\nimport { takeEvery } from 'redux-saga/effects'\n\nimport {\n    CHANGE_LOCALE,\n} from './../actions'\n\nfunction* updateTaxRates() {\n\n}\n\nexport function* updateTaxRatesSaga() {\n    yield takeEvery(CHANGE_LOCALE, updateTaxRates);\n}\n```\n\n\n### Contributing\nAll contributions are warmly encouraged! If you already have something to contribute, just go ahead and open a PR.\nIf you're not sure what to contribute, open an issue and let us know you're here to help.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielstern%2Fredux-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielstern%2Fredux-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielstern%2Fredux-tool/lists"}