{"id":13775350,"url":"https://github.com/jaebradley/fruit","last_synced_at":"2025-04-11T21:33:09.671Z","repository":{"id":41055483,"uuid":"130255564","full_name":"jaebradley/fruit","owner":"jaebradley","description":"🥝🍋🍐🍓🍊🍍 Automatically generate your rollup.js boilerplate  🍒🍈🍇🍉🍏🍎","archived":false,"fork":false,"pushed_at":"2022-06-19T23:00:01.000Z","size":2838,"stargazers_count":58,"open_issues_count":17,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T17:46:50.354Z","etag":null,"topics":["boilerplate","cli","library-boilerplate","node","nodejs","react","rollup","rollup-js"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/jaebradley.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":"2018-04-19T18:20:49.000Z","updated_at":"2024-05-23T09:25:51.000Z","dependencies_parsed_at":"2022-08-24T04:31:19.858Z","dependency_job_id":null,"html_url":"https://github.com/jaebradley/fruit","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaebradley%2Ffruit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaebradley%2Ffruit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaebradley%2Ffruit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaebradley%2Ffruit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaebradley","download_url":"https://codeload.github.com/jaebradley/fruit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248483389,"owners_count":21111441,"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":["boilerplate","cli","library-boilerplate","node","nodejs","react","rollup","rollup-js"],"created_at":"2024-08-03T17:01:37.262Z","updated_at":"2025-04-11T21:33:09.636Z","avatar_url":"https://github.com/jaebradley.png","language":"JavaScript","funding_links":[],"categories":["Packages","cli"],"sub_categories":["Community Packages"],"readme":"\u003cp align=\"center\"\u003e\n \u003ca href=\"#\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n  \u003cimg width=\"550\" src=\"https://imgur.com/ZdlPAqI.png\" alt=\"fruit\"\u003e\n \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003eBuild your \u003cb\u003e\u003ca href=\"https://rollupjs.org/guide\"\u003erollup.js\u003c/a\u003e\u003c/b\u003e boilerplate in seconds.\u003csup\u003e\u003ca href=\"#build-in-seconds-footnote\"\u003e1\u003c/a\u003e\u003c/sup\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n \u003ca href=\"https://github.com/jaebradley/fruit/actions?query=workflow%3AFruit\"\u003e\n  \u003cimg src=\"https://github.com/jaebradley/fruit/workflows/Fruit/badge.svg\" alt=\"build-status\"\u003e\u003c/img\u003e\n \u003c/a\u003e\n \u003ca href=\"https://www.npmjs.com/package/@jaebradley/fruit\"\u003e\n  \u003cimg src=\"https://img.shields.io/npm/v/@jaebradley/fruit.svg\" alt=\"npm-version\"\u003e\u003c/img\u003e\n \u003c/a\u003e\n \u003ca href=\"https://www.npmjs.com/package/@jaebradley/fruit\"\u003e\n  \u003cimg src=\"https://img.shields.io/npm/dt/@jaebradley/fruit.svg\" alt=\"npm-total-downloads\"\u003e\u003c/img\u003e\n \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e🥝  🍋  🍐  🍓  🍊  🍍  🍰  🍒  🍈  🍇  🍉  🍏  🍎  🍌\u003c/p\u003e\n\n* [Introduction](#introduction)\n* [Installation](#installation)\n* [Usage](#usage)\n* [Configuration Options](#configuration-option)\n  * [Node](#node)\n  * [React](#react)\n  * [`commitlint`](#commitlint)\n  * [`semantic-release`](#semantic-release)\n\n## Introduction\n\nTwo of the most-popular libraries used to bundle JavaScript are [`rollup`](https://rollupjs.org/guide) and [`webpack`](https://webpack.js.org).\n\n[The general consensus](https://medium.com/webpack/webpack-and-rollup-the-same-but-different-a41ad427058c) is that `rollup` should be used for building libraries and `webpack` should be used for building applications.\n\nThis is because [`webpack` comes with features like hot module reloading (which has obvious benefits for applications) while `rollup` \"scope hoists\", which guarantees smaller bundles than `webpack`](https://stackoverflow.com/a/43255948/5225575).\n\nHowever, there is a decent amount of boilerplate associated with configuring a baseline `rollup` library (`.eslintrc`, `travis.yml`, `.babelrc`, `jest`, etc.).\n\n`fruit` aims to generate `rollup` library boilerplate (using some preferred configuration options) so that you can start building your library right away.\n\n## Installation\n\n```bash\nnpm install @jaebradley/fruit --global\n```\n\n## Usage\n\nExecute `fruit` via the command line and then follow the configuration options\n\n![configuration-options](https://imgur.com/rsAx6CG.gif)\n\nwhich will install dependencies and generate a basic bundle, with \"logic\" for placeholder library exports.\n\n![bundle-generation](https://imgur.com/FwCdIln.gif)\n\n## Configuration Options\n\nRight now, there are two different types of libraries you can generate boilerplate for - `Node` and `React`.\n\nBoth come with\n\n* [`eslint`](https://eslint.org)\n  * Extends from [Airbnb's `eslint` config](https://www.npmjs.com/package/eslint-config-airbnb)\n* [`Babel 7`](https://babeljs.io/blog/2017/03/01/upgrade-to-babel-7)\n  * Specifically\n    * [`@babel/cli`](https://www.npmjs.com/package/@babel/cli)\n    * [`@babel/core`](https://www.npmjs.com/package/@babel/core)\n    * [`@babel/preset-env`](https://www.npmjs.com/package/@babel/preset-env)\n    * `babel-core` (the `7.0.0-bridge.0` version to [play nicely with `jest`](https://facebook.github.io/jest/docs/en/getting-started.html#using-babel))\n* [`jest`](https://facebook.github.io/jest/)\n  * Run tests by executing `npm run test`\n* [`rollup`](https://rollupjs.org/guide/en) (duh)\n  * [`rollup-plugin-babel`](https://www.npmjs.com/package/rollup-plugin-babel)\n  * [`rollup-plugin-babel-minify`](https://www.npmjs.com/package/rollup-plugin-babel)\n  * [`rollup-plugin-commonjs`](https://www.npmjs.com/package/rollup-plugin-commonjs)\n  * [`rollup-plugin-filesize`](https://www.npmjs.com/package/rollup-plugin-filesize)\n  * [`rollup-plugin-local-resolve`](https://www.npmjs.com/package/rollup-plugin-local-resolve)\n  * [`rollup-plugin-node-resolve`](https://www.npmjs.com/package/rollup-plugin-node-resolve)\n* A `.travis.yml` configuration file that will build, lint, and test your project for the latest version of `Node@8` and the latest version of `npm@5`\n  * Runs the `npm run deploy` script on `master` (this defaults to a no-op for the non-`semantic-release` option\n* Will initialize `git`\n* An entry point at `src/index.js`\n* Building `umd`, `cjs`, and `es` modules that will output to `build/index.js`, `build/index.cjs.js`, and `build/index.esm.js` respectively.\n\n### Node\n\n#### Node Library Directory Structure (with `commitlint`ing)\n\n```text\n/some/project/path\n├── .babelrc\n├── .eslintignore\n├── .eslintrc\n├── .gitignore\n├── .npmignore\n├── .travis.yml\n├── build\n|  ├── index.cjs.js\n|  ├── index.esm.js\n|  └── index.js\n├── commitlint.config.js\n├── package-lock.json\n├── package.json\n├── rollup.config.js\n└── src\n   ├── index.js\n   └── index.test.js\n```\n\n### `React`\n\nThis option also comes with the following additional dependencies\n\n#### Production Dependencies\n\n* `react`\n* `react-dom`\n* `prop-types`\n\n#### Development Dependencies\n\n* [`@babel/preset-react`](https://www.npmjs.com/package/@babel/preset-react)\n* [`enzyme`](https://www.npmjs.com/package/enzyme)\n* [`rollup-plugin-peer-deps-external`](https://www.npmjs.com/package/rollup-plugin-peer-deps-external)\n* [`rollup-plugin-postcss`](https://www.npmjs.com/package/rollup-plugin-postcss)\n\nIt also comes with [`Storybook`](https://github.com/storybooks/storybook) which makes it easy to display different component use-cases.\n\nYou can run Storybook locally, on port `6006` by executing the `storybook` `npm` script (`npm run storybook`).\n\n### React Library Directory Structure (with `commitlint`ing)\n\n```text\n/some/project/path\n├── .babelrc\n├── .eslintignore\n├── .eslintrc\n├── .gitignore\n├── .npmignore\n├── .storybook\n|  ├── addons.js\n|  ├── config.js\n|  └── webpack.config.js\n├── .travis.yml\n├── build\n|  ├── index.cjs.css\n|  ├── index.cjs.js\n|  ├── index.css\n|  ├── index.esm.css\n|  ├── index.esm.js\n|  └── index.js\n├── commitlint.config.js\n├── package-lock.json\n├── package.json\n├── rollup.config.js\n└── src\n   ├── AnExample\n   |  ├── AnExample.scss\n   |  ├── AnExample.stories.jsx\n   |  ├── AnExample.test.jsx\n   |  └── index.jsx\n   ├── AnotherExample\n   |  ├── AnotherExample.scss\n   |  ├── AnotherExample.stories.jsx\n   |  ├── AnotherExample.test.jsx\n   |  └── index.jsx\n   ├── index.js\n   └── setupTest.js\n```\n\n### `commitlint`\n\nI like [`commitlint`](https://github.com/marionebl/commitlint)ing.\n\nIf you select the `commitlint` feature, it'll add the following development dependencies\n\n* [`@commitlint/cli`](https://github.com/marionebl/commitlint/blob/master/@commitlint/cli)\n* [`@commitlint/config-angular`](https://www.npmjs.com/package/@commitlint/config-angular)\n  * The default commit convention is [`Angular`](https://gist.github.com/stephenparish/9941e89d80e2bc58a153)\n* [`@commitlint/prompt`](https://www.npmjs.com/package/@commitlint/prompt)\n* [`@commitlint/prompt-cli`](https://www.npmjs.com/package/@commitlint/prompt-cli)\n* [`husky`](https://www.npmjs.com/package/husky)\n\nand the following `npm` `scripts`\n\n* `commitmsg`\n  * A commit message `.git` hook that will trigger `commitlint`\n* `gc`\n  * Triggers [the `@commitlint/cli`](https://github.com/marionebl/commitlint/tree/master/@commitlint/cli) to help build a syntactically correct commit message\n\n### `semantic-release`\n\nI like to automate package deployment using [`semantic-release`](https://github.com/semantic-release/semantic-release).\n\nIf you select the `semantic-release` feature, the following dependencies will be added\n\n* [`semantic-release`](https://www.npmjs.com/package/semantic-release)\n* [`travis-deploy-once`](https://www.npmjs.com/package/travis-deploy-once)\n\nalong with the following `npm` `scripts`\n\n* `deploy`\n  * which will trigger the `semantic-release` deploy process\n* `semantic-release` (for use in `npm run deploy`)\n* `travis-deploy-once` (for use in `npm run deploy`)\n\n### Footnotes\n\n\u003ca name=\"build-in-seconds-footnote\"\u003e\u003csup\u003e1\u003c/sup\u003e\u003c/a\u003e Ok, maybe more like \"many seconds\" (☕ time?)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaebradley%2Ffruit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaebradley%2Ffruit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaebradley%2Ffruit/lists"}