{"id":18613099,"url":"https://github.com/eduzz/componentzz","last_synced_at":"2025-04-10T23:31:48.129Z","repository":{"id":53542059,"uuid":"113883811","full_name":"eduzz/componentzz","owner":"eduzz","description":"React Presentational Components","archived":true,"fork":false,"pushed_at":"2021-03-25T11:37:38.000Z","size":353,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-13T03:01:52.174Z","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/eduzz.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":"2017-12-11T16:45:20.000Z","updated_at":"2023-11-08T16:46:50.000Z","dependencies_parsed_at":"2022-09-15T15:02:36.574Z","dependency_job_id":null,"html_url":"https://github.com/eduzz/componentzz","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/eduzz%2Fcomponentzz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eduzz%2Fcomponentzz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eduzz%2Fcomponentzz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eduzz%2Fcomponentzz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eduzz","download_url":"https://codeload.github.com/eduzz/componentzz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248316245,"owners_count":21083411,"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-11-07T03:19:54.031Z","updated_at":"2025-04-10T23:31:47.707Z","avatar_url":"https://github.com/eduzz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Presentational React Components\n\n#live demo\nhttps://jonathasrodrigues.github.io/presentational-react-components\n\n\u003e Boilerplate for reusable and declouped presentational react components.\n\nThe main idea of this project was based on develop decoupled components in a isolated environment. We don't need to use an entire application to build our components, we just need some place to run and test them.\n\n## Getting Started\n\n### Installation\nNode \u003e= 4 \nnpm install\n\n### Folders and Files\n\n```sh\n├── css\n│   └── main.css\n├── src\n│   └── Main.js\n├── stories\n│   └── Main.js\n├── storybook\n│   ├── config.js\n│   └── webpack.config.js\n├── tests\n│   ├── helpers\n│   │   └── setup.js\n│   └── specs\n│       └── Main.spec.js\n├── .babelrc\n├── .editorconfig\n├── .eslintrc\n├── .gitignore\n├── .npmignore\n├── .travis.yml\n├── Readme.md\n└── package.json\n```\n\n## Creating your Component\n\n### Writing your code\n\nWrite your component code on `src/Main.js`, you can create another files for composable components also.\n\n```js\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nconst Component = ({ name }) =\u003e (\n    \u003ch1\u003eHello {name}!\u003c/h1\u003e\n);\n\nComponent.propTypes = {\n    name: PropTypes.string.isRequired,\n};\n\nexport default Component;\n```\n\n### Writing Stories\n(https://storybook.js.org/basics/guide-react/). Follow the example above:\n\n```js\nstoriesOf('Component', module)\n    .add('my first presentational component', () =\u003e (\n        \u003cComponent name=\"First\" /\u003e\n    ))\n    .add('my second presentational component', () =\u003e (\n        \u003cComponent name=\"Second\" /\u003e\n    ))\n```\n\nEvery new story will be available on the left side panel of React Storybook to see different cases.\n\n### Running your code\n\nJust use `npm start`, Runs the app in development mode.\nOpen [http://localhost:9001](http://localhost:9001) to view it in the browser.\n\nThe page will reload if you make edits and you will see the build errors and lint warnings in the console.\n\n### Running tests\n\n- `npm test`: run your tests in a single-run mode.\n- `npm run test:tdd`: run and keep watching your test files.\n- `npm run test:coverage`: prints and create html files by istanbul coverage.\n\n### Linting your code\n\nIn order to keep your code clean and consistent we use [eslint](http://eslint.org/) with [Airbnb preset](https://github.com/airbnb/javascript/tree/master/react). We have 2 tasks for this:\n\n- `npm run lint`: lint all files searching for errors.\n- `npm run lint:fix`: fix automaticaly some lint errors.\n\n### Deploy your component\n\nYou can deploy your component (inside Storybook) to `github pages` running the command `npm run deploy-storybook`.\n\n## Why use this?\n\nWe believe that start to code shouldn't be hard, so you don't need to concern about configurations and tools, just create your pretty stuff. With this structure, your environment will have everything you need to build a modern React Component:\n\n- React, JSX and ES6 support with Babel.\n- A dev server with live reload\n- Stack for tests\n- Linters\n- A build script to compile and minify for production\n\n## What we use?\n\n#### Environment\n\n[React Storybook](https://github.com/kadirahq/react-storybook) - *to tell stories with different behaviors of the component and provide an example page.*\n\n#### Style Guide\n\n- [EditorConfig](http://editorconfig.org/) - *standardize some general settings among multiple editors*\n- [ESLint](http://eslint.org/) - *for reporting the patterns of code*\n  - [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript)\n  - **Plugins**\n    - [React](https://github.com/yannickcr/eslint-plugin-react)\n    - [A11y](https://github.com/evcohen/eslint-plugin-jsx-a11y)\n    - [Import](https://github.com/benmosher/eslint-plugin-import)\n\n#### Tests\n- [Mocha](https://github.com/mochajs/mocha) - *test framework*\n- [Chai](https://github.com/chaijs/chai) - *assertions*\n- [Enzyme](https://github.com/airbnb/enzyme) - *shallow component*\n- [Jsdom](https://github.com/tmpvar/jsdom) - *mock the browser*\n\n#### Compiler\n\n- [babel](https://babeljs.io/)\n  - **Plugins**\n    - [Airbnb](https://github.com/airbnb/babel-preset-airbnb)\n    - [ES2015](https://www.npmjs.com/package/babel-preset-es2015)\n    - [React](https://www.npmjs.com/package/babel-preset-react)\n\n## Code Standarts\n\nThis project uses [eslint](http://eslint.org/) and [.editorconfig](http://editorconfig.org/) is defined to have indent_size of **4 spaces**. \n\nThis project also uses [Husky](https://github.com/typicode/husky) to prevent to push code with lint errors or broken tests. If you don't want this, you can uninstall running `npm uninstall --save-dev husky` and deleting the [prepush command](https://github.com/lyef/lyef-react-component/blob/master/package.json#L21) on `package.json`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feduzz%2Fcomponentzz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feduzz%2Fcomponentzz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feduzz%2Fcomponentzz/lists"}