{"id":23413868,"url":"https://github.com/sunopar/react-component-maker","last_synced_at":"2025-09-19T00:04:21.555Z","repository":{"id":57149558,"uuid":"71307923","full_name":"sunopar/react-component-maker","owner":"sunopar","description":"react-component-maker","archived":false,"fork":false,"pushed_at":"2017-03-17T14:15:37.000Z","size":22,"stargazers_count":32,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-12T05:43:55.961Z","etag":null,"topics":["cli","nodejs","react-components"],"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/sunopar.png","metadata":{"files":{"readme":"README-zh.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":"2016-10-19T01:46:42.000Z","updated_at":"2022-08-04T08:17:35.000Z","dependencies_parsed_at":"2022-08-24T12:00:08.915Z","dependency_job_id":null,"html_url":"https://github.com/sunopar/react-component-maker","commit_stats":null,"previous_names":["sunbrother/react-component-tool","sunbrother/react-component-maker"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunopar%2Freact-component-maker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunopar%2Freact-component-maker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunopar%2Freact-component-maker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunopar%2Freact-component-maker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunopar","download_url":"https://codeload.github.com/sunopar/react-component-maker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525156,"owners_count":21118616,"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":["cli","nodejs","react-components"],"created_at":"2024-12-22T19:55:58.693Z","updated_at":"2025-09-19T00:04:16.382Z","avatar_url":"https://github.com/sunopar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-component-maker\r\n\r\n一键式创建React组件\r\n\r\n## v1.2.0\r\n\r\n支持自由选择创建`css`,`scss`,`less`\r\n\r\n## 功能\r\n\r\n1. 一键式创建React组件，不是React脚手架！\r\n2. 支持一次创建多个组件\r\n3. 支持自由选择创建`css`,`Scss`,`Less`\r\n4. 支持无状态组建（stateless function）\r\n\r\n### Usage\r\n\r\n```\r\nnpm i -g react-component-maker\r\nmkreact App\r\n//此时你创建了一个名字为App的组件\r\nmkreact Header,Body,Footer\r\n//此时你创建了三个组件，分别为Header,Body,Footer\r\n```\r\n\r\n#### 创建样式为Scss的组件\r\n```\r\nmkreact -s Body\r\n//创建Body组件，但是样式文件为Scss\r\n```\r\n#### 创建样式为Less的组件\r\n```\r\n#### mkreact -l Body\r\n//创建Body组件，但是样式文件为Scsss\r\n```\r\n#### create React component with stateless\r\n```\r\nmkreact -p Body\r\n//创建Body无状态组件\r\n```\r\n## 组件详情\r\n\r\n一个组件为一个文件夹，文件夹目录为\r\n\r\n- [name].jsx\r\n- [name].css\r\n- index.jsx\r\n\r\n## 文件内容\r\n\r\n### [name].jsx\r\n\r\n```\r\nimport React from 'react';\r\nimport styles from './[name].css'\r\nclass [name] extends React.Component {\r\n    constructor(props) {\r\n        super(props);\r\n        this.displayName = [name];\r\n    }\r\n    render() {\r\n        return (\r\n            \u003cdiv className={styles.container}\u003e\r\n            [name]\r\n            \u003c/div\u003e\r\n        )\r\n    }\r\n}\r\nexport default [name];\r\n```\r\n\r\n### [name].css\r\n\r\n```\r\n.container {\r\n  \r\n}\r\n```\r\n\r\n### index.jsx\r\n\r\n```\r\nimport [name] from './hh'\r\n\r\nexport default [name]\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunopar%2Freact-component-maker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunopar%2Freact-component-maker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunopar%2Freact-component-maker/lists"}