diff --git a/README.md b/README.md index 9b51c76..49ebe15 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,46 @@ -``` - _ _ _ _ ____ _ ____ _ ___ - / \ __| |__ __ __ _ _ __ __| | ___ __| | | _ \ ___ __ _ ___ | |_ / ___|| | |_ _| - / _ \ / _` |\ \ / // _` || '_ \ / _` | / _ \ / _` | | |_) |/ _ \ / _` | / __|| __| | | | | | | - / ___ \| (_| | \ V /| (_| || | | || (_| || __/| (_| | | _ <| __/| (_| || (__ | |_ | |___ | |___ | | - /_/ \_\\__,_| \_/ \__,_||_| |_| \__,_| \___| \__,_| |_| \_\\___| \__,_| \___| \__| \____||_____||___| +
+
+
+     _        _           ____                     _      ____  _      ___
+    / \    __| |__   __  |  _ \  ___   __ _   ___ | |_   / ___|| |    |_ _|
+   / _ \  / _` |\ \ / /  | |_) |/ _ \ / _` | / __|| __| | |    | |     | |
+  / ___ \| (_| | \ V /_  |  _ <|  __/| (_| || (__ | |_  | |___ | |___  | |
+ /_/   \_\\__,_|  \_/(_) |_| \_\\___| \__,_| \___| \__|  \____||_____||___|
+
+
+
+
+ +
+

+ + Table of Contents + +

+
+ +
+ +
-``` +## About [![version](https://img.shields.io/npm/v/advanced-react-cli.svg?color=blue)](https://www.npmjs.com/package/advanced-react-cli) [![downloads](https://img.shields.io/npm/dw/advanced-react-cli.svg)](https://www.npmjs.com/package/advanced-react-cli) ![Test](https://github.com/devisle/advanced-react-cli/workflows/Test/badge.svg) ![CodeQL](https://github.com/devisle/advanced-react-cli/actions/workflows/codeql.yml/badge.svg) -## Table of Contents - -- [About](#about) -- [Project's purpose](#projects-purpose) -- [Credits](#credits) -- [Run the CLI](#run-the-cli) -- [Installing the CLI globally](#installing-the-cli-globally) -- [Packages](#packages) -- [Running tests](#running-tests) -- [Contributing](CONTRIBUTING.md) -- [Development Checklist](CHECKLIST.md) -- [What does this do?](#what-does-this-do) -- [FAQs](#faqs) -- [Dev Isle community](#dev-isle-community) -- [License](https://github.com/devisle/advanced-react-cli/blob/master/LICENSE) - -## About - This is an **NPM package** which aims to provide a better way to install a React-starter application and third-party packages for your application through an intuitive CLI. ## Project's Purpose @@ -35,18 +49,7 @@ We at Dev Isle, felt that the community has been longing for a good, functional **Note**: We do not discourage or refrain the community from using terminal commands instructions. In fact, we highly recommend our users to read and understand the docs so that you will know what to expect. This CLI is merely an alternative! -## Credits - -This CLI uses some of the best repos' terminal commands under the hood, to execute it's functionality. We would like to credit the following GitHub repos by making this CLI possible: - -- [Brandon Nozaki Miller - Node-CMD](https://github.com/RIAEvangelist/node-cmd) -- [Simon Boudrias - Inquirer JS](https://github.com/SBoudrias/Inquirer.js/) -- [Nathan Peck - CLUI](https://www.npmjs.com/package/clui) -- [Dave Eddy - Clear](https://github.com/bahamas10/node-clear) -- [Patorjk - Figlet](https://github.com/patorjk/figlet.js) -- [Chalk](https://www.npmjs.com/package/chalk) - -**Be sure to check the above repos out if you're facing any issues! We are of course, always open to improvements.** +**Be sure to check the repos in [credits](#credits) if you're facing any issues! We are of course, always open to improvements.** ## Run the CLI @@ -87,6 +90,21 @@ The CLI currently has these packages available for installation: - [@types/react-router](https://www.npmjs.com/package/@types/react-router) & [@types/react-router-dom](https://www.npmjs.com/package/@types/react-router-dom) - [@types/jest](https://www.npmjs.com/package/@types/jest) +## What does this do? + +We are continuously working on improving the CLI. But, as of this current stable version, we have enabled a few options such as: + +- Yarn/NPM option for installation packages +- Installing React using `create-react-app`, with optional packages React-Router and Redux as a single bundle. +- React Component generator lets you make a class/function component with optional package imports such as prop-types, react-router and redux! +- Installing Individual packages such as Node-Sass, Styled-Components, React-Router, Prop-Types, and State Management. +- Redux, Unstated, Unstated-Next and Redux-Thunk have been added in the State Management. +- Installing Redux automatically generates a store folder containing boilerplate Redux code with instructions to get you started! +- Installing Prop-Types automatically generates a file containing a sample code to get started! +- Node-Sass and Styled-Components feature under StyledPackages section of the CLI +- Installing packages used for accessibility such as React-A11y and React-Axe. +- TypeScript and `@types` definitions for Node, React, React-Router, React-Redux and Jest + ## Running tests Test: @@ -101,27 +119,23 @@ Test coverage: npm run test:coverage or yarn test:coverage ``` -## What does this do? +## Credits -We are continuously working on improving the CLI. But, as of this current stable version, we have enabled a few options such as: +This CLI uses some of the best repos' terminal commands under the hood, to execute it's functionality. We would like to credit the following GitHub repos by making this CLI possible: -- Yarn/NPM option for installation packages -- Installing React using `create-react-app`, with optional packages React-Router and Redux as a single bundle. -- React Component generator lets you make a class/function component with optional package imports such as prop-types, react-router and redux! -- Installing Individual packages such as Node-Sass, Styled-Components, React-Router, Prop-Types, and State Management. -- Redux, Unstated, Unstated-Next and Redux-Thunk have been added in the State Management. -- Installing Redux automatically generates a store folder containing boilerplate Redux code with instructions to get you started! -- Installing Prop-Types automatically generates a file containing a sample code to get started! -- Node-Sass and Styled-Components feature under StyledPackages section of the CLI -- Installing packages used for accessibility such as React-A11y and React-Axe. -- TypeScript and `@types` definitions for Node, React, React-Router, React-Redux and Jest +- [Brandon Nozaki Miller - Node-CMD](https://github.com/RIAEvangelist/node-cmd) +- [Simon Boudrias - Inquirer JS](https://github.com/SBoudrias/Inquirer.js/) +- [Nathan Peck - CLUI](https://www.npmjs.com/package/clui) +- [Dave Eddy - Clear](https://github.com/bahamas10/node-clear) +- [Patorjk - Figlet](https://github.com/patorjk/figlet.js) +- [Chalk](https://www.npmjs.com/package/chalk) -# FAQs +## FAQs 1. How can I test this out? - If you'd like to try it out , Run the following command `npx advanced-react-cli` in your terminal. -- We are still continuing to work on our [Development Checklist](CHECKLIST.md). +- We are still continuing to work on our [Development Checklist](https://github.com/devisle/advanced-react-cli/blob/master/CHECKLIST.md). - Ensure you have git version control, and package manager - either npm (node package manager) or Yarn Installed. You may check if your system has them installed by running the following commands `git --version` and depending on your package manager of choice, run `npm --version` or `yarn --version`. If you don't have it installed, please visit: @@ -152,7 +166,7 @@ We are continuously working on improving the CLI. But, as of this current stable - The documentation site is built using [docsify](https://docsify.js.org/#/). - Install `docsify` if you haven't done that already `npm i docsify-cli -g`. -- Run the site `docsify serve docs`. +- Run the site `npm run docs`. ## Dev Isle Community diff --git a/cli.js b/cli.js index c7a0d8b..d0d5084 100755 --- a/cli.js +++ b/cli.js @@ -2,15 +2,7 @@ const [...args] = process.argv -// console.log(`folder name ${args[2]}`); -// console.log(`folder location ${args[3]}`); - -// Current working directory -const cwd = process.cwd() -console.log(cwd) - const inquirer = require('inquirer') - const chalk = require('chalk') const clear = require('clear') const figlet = require('figlet') diff --git a/docs/README.md b/docs/README.md index 069f829..fd8e44c 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,31 +1,35 @@ ## About -[![version](https://img.shields.io/npm/v/advanced-react-cli.svg?color=blue)](https://www.npmjs.com/package/advanced-react-cli) [![downloads](https://img.shields.io/npm/dw/advanced-react-cli.svg)](https://www.npmjs.com/package/advanced-react-cli) ![Test](https://github.com/devisle/advanced-react-cli/workflows/Test/badge.svg) +[![version](https://img.shields.io/npm/v/advanced-react-cli.svg?color=blue)](https://www.npmjs.com/package/advanced-react-cli) [![downloads](https://img.shields.io/npm/dw/advanced-react-cli.svg)](https://www.npmjs.com/package/advanced-react-cli) ![Test](https://github.com/devisle/advanced-react-cli/workflows/Test/badge.svg) ![CodeQL](https://github.com/devisle/advanced-react-cli/actions/workflows/codeql.yml/badge.svg) This is an **NPM package** which aims to provide a better way to install a React-starter application and third-party packages for your application through an intuitive CLI. -### Project's Purpose +## Project's Purpose We at Dev Isle, felt that the community has been longing for a good, functional and intuitive CLI rather than always writing on the terminal command line. **Note**: We do not discourage or refrain the community from using terminal commands instructions. In fact, we highly recommend our users to read and understand the docs so that you will know what to expect. This CLI is merely an alternative! -### What does this do? +**Be sure to check the repos in [credits](#credits) if you're facing any issues! We are of course, always open to improvements.** -We are continuously working on improving the CLI. But, as of this current stable version, we have enabled a few options such as: +## Run the CLI -- Yarn/NPM option for installation packages. -- Installing React using `create-react-app`, with optional packages React-Router and Redux as a single bundle. -- React Component generator lets you make a class/function component with optional package imports such as prop-types, react-router and redux! -- Installing Individual packages such as Node-Sass, Styled-Components, React-Router, Prop-Types, and State Management. -- Redux, Unstated, Unstated-Next and Redux-Thunk have been added in the State Management. -- Installing Redux automatically generates a store folder containing boilerplate Redux code with instructions to get you started! -- Installing Prop-Types automatically generates a file containing a sample code to get started! -- Node-Sass and Styled-Components feature under StyledPackages section of the CLI. -- Installing packages used for accessibility such as React-A11y and React-Axe. -- TypeScript and `@types` definitions for Node, React, React-Router, React-Redux and Jest. +Just type in the following command in your terminal and run it! (Please check FAQ for more on testing and contributions) -#### Packages available for installation +- NPX: `npx advanced-react-cli` + +## Installing the CLI globally + +- NPM: + `npm i -g advanced-react-cli` + +- Yarn: + `yarn global add advanced-react-cli` + +- To invoke the CLI (Both **NPM** & **Yarn**) + `arc` + +## Packages The CLI currently has these packages available for installation: @@ -47,103 +51,101 @@ The CLI currently has these packages available for installation: - [@types/react-router](https://www.npmjs.com/package/@types/react-router) & [@types/react-router-dom](https://www.npmjs.com/package/@types/react-router-dom) - [@types/jest](https://www.npmjs.com/package/@types/jest) -## Getting started - -### What do you need? +## What does this do? -Ensure you have git version control, and package manager - either npm (node package manager) or Yarn Installed. You may check if your system has them installed by running the following commands `git --version` and depending on your package manager of choice, run `npm --version` or `yarn --version`. If you don't have it installed, please visit: +We are continuously working on improving the CLI. But, as of this current stable version, we have enabled a few options such as: -- [Git](https://git-scm.com/downloads) to download/install git. -- [NodeJS](https://nodejs.org/en/download/) to download/install Node.Js (NPM gets installed with Node.Js). -- [Yarn](https://yarnpkg.com/en/docs/getting-started) to download/install Yarn Package Manager +- Yarn/NPM option for installation packages +- Installing React using `create-react-app`, with optional packages React-Router and Redux as a single bundle. +- React Component generator lets you make a class/function component with optional package imports such as prop-types, react-router and redux! +- Installing Individual packages such as Node-Sass, Styled-Components, React-Router, Prop-Types, and State Management. +- Redux, Unstated, Unstated-Next and Redux-Thunk have been added in the State Management. +- Installing Redux automatically generates a store folder containing boilerplate Redux code with instructions to get you started! +- Installing Prop-Types automatically generates a file containing a sample code to get started! +- Node-Sass and Styled-Components feature under StyledPackages section of the CLI +- Installing packages used for accessibility such as React-A11y and React-Axe. +- TypeScript and `@types` definitions for Node, React, React-Router, React-Redux and Jest -### Run the CLI +## Running tests -Run the following command: +Test: ```sh -npx advanced-react-cli +npm run test or yarn test ``` -### Installing the CLI globally - -#### NPM +Test coverage: ```sh -npm i -g advanced-react-cli +npm run test:coverage or yarn test:coverage ``` -#### Yarn - -```sh -yarn global add advanced-react-cli -``` +## Credits -#### Invoke the CLI (Both NPM & Yarn) +This CLI uses some of the best repos' terminal commands under the hood, to execute it's functionality. We would like to credit the following GitHub repos by making this CLI possible: -```sh -arc -``` +- [Brandon Nozaki Miller - Node-CMD](https://github.com/RIAEvangelist/node-cmd) +- [Simon Boudrias - Inquirer JS](https://github.com/SBoudrias/Inquirer.js/) +- [Nathan Peck - CLUI](https://www.npmjs.com/package/clui) +- [Dave Eddy - Clear](https://github.com/bahamas10/node-clear) +- [Patorjk - Figlet](https://github.com/patorjk/figlet.js) +- [Chalk](https://www.npmjs.com/package/chalk) ## FAQs -### Can I report any issues or bugs with the CLI? +1. How can I test this out? + +- If you'd like to try it out , Run the following command `npx advanced-react-cli` in your terminal. +- We are still continuing to work on our [Development Checklist](https://github.com/devisle/advanced-react-cli/blob/master/CHECKLIST.md). + +- Ensure you have git version control, and package manager - either npm (node package manager) or Yarn Installed. You may check if your system has them installed by running the following commands `git --version` and depending on your package manager of choice, run `npm --version` or `yarn --version`. If you don't have it installed, please visit: + + - [Git](https://git-scm.com/downloads) to download/install git. + - [NodeJS](https://nodejs.org/en/download/) to download/install Node.Js (NPM gets installed with Node.Js). + - [Yarn](https://yarnpkg.com/en/docs/getting-started) to download/install Yarn Package Manager + +- Alternatively, if you would like to contribute and test it locally, you may fork the repo, and/or clone it to your local desktop. Once you've done that, open the terminal in that local folder and run the command `npm install` for **NPM users** or `yarn install` for **Yarn users** to install the required dependencies. +- After that, you may open the folder in your editor of choice. Once again, in the terminal you may simply run `npm run react-cli` or `yarn run react-cli` to get it working. And voila! + +2. Can I report any issues or bugs with the CLI? How do I report it? - We appreciate all the reports on bugs or issues from the community! - You may report an issue by going to this [Here](https://github.com/devisle/advanced-react-cli/issues/new/choose) and next to the "Bug Report", click the button "Get Started"! - If you wish to get in touch with us quicker, you may join our Discord server! The link is under the "Dev Isle Community" section -### Where do I create a feature request? +3. I would like to make a feature request. Where do I do it? - We are open to your suggestions for the CLI! - If you'd like to make a new feature request, just head over [here](https://github.com/devisle/advanced-react-cli/issues/new/choose) and next to the "Feature Request", click the button "Get Started"! -### Where can I make a pull request? +4. I would like to make a pull request. How can I do it? -- If you would like to contribute and test it locally, you may fork the repo, and/or clone it to your local desktop. Once you've done that, open the terminal in that local folder and run the command `npm install` for **NPM users** or `yarn install` for **Yarn users** to install the required dependencies. -- After that, you may open the folder in your editor of choice. Once again, in the terminal you may simply run `npm run react-cli` or `yarn run react-cli` to get it working. And voila! +- We are open to pull requests for the CLI! - Before making a pull request, be sure to read the [contribution guidelines](https://github.com/devisle/advanced-react-cli/blob/master/CONTRIBUTING.md) that also have the pull request guide. -### How can I run the documentation site? +5. How can I run the documentation site? - The documentation site is built using [docsify](https://docsify.js.org/#/). - Install `docsify` if you haven't done that already `npm i docsify-cli -g`. -- Run the site `docsify serve docs`. - -## Credits +- Run the site `npm run docs`. -### Used packages - -This CLI uses some of the best repos' terminal commands under the hood, to execute it's functionality. We would like to credit the following GitHub repos by making this CLI possible: - -- [Brandon Nozaki Miller - Node-CMD](https://github.com/RIAEvangelist/node-cmd) -- [Simon Boudrias - Inquirer JS](https://github.com/SBoudrias/Inquirer.js/) -- [Nathan Peck - CLUI](https://www.npmjs.com/package/clui) -- [Dave Eddy - Clear](https://github.com/bahamas10/node-clear) -- [Patorjk - Figlet](https://github.com/patorjk/figlet.js) -- [Chalk](https://www.npmjs.com/package/chalk) +## Dev Isle Community -**Be sure to check the above repos out if you're facing any issues! We are of course, always open to improvements.** +Are you interested in hanging out, contributing to our open-source repos and be a part of a good community? We would love for you to join us on our [Discord](http://discord.gg/MSTQKRE). -### Authors +## Authors -#### Maintainers +### Maintainers - [@shreyas1307](https://github.com/shreyas1307) - Creator - [@endormi](https://github.com/endormi) -#### Contributors +### Contributors - [@munsterberg](https://github.com/Munsterberg) - [@natedeploys](https://github.com/Natedeploys) - [@kruzus](https://github.com/kruzus) - [@jgiamanco](https://github.com/jgiamanco) - [@rakeshshubhu](https://github.com/rakeshshubhu) -## Dev Isle Community - -Are you interested in hanging out, contributing to our open source repositories and be a part of a good community? - -We would love for you to join us on our [Discord](http://discord.gg/MSTQKRE). - ## License The source code is released under the [GPL-3.0 License](https://github.com/devisle/advanced-react-cli/blob/master/LICENSE). diff --git a/package.json b/package.json index da28c9a..7d8ee1b 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,8 @@ "react-cli": "node cli.js", "format": "prettier-standard '**/*.{js,jsx}'", "build": "babel . -d lib", + "docs": "docsify serve docs", + "copy": "node ./scripts/copy.js", "test": "jest", "test:coverage": "jest --coverage", "patch-release": "npm version patch && npm publish && git push --follow-tags", diff --git a/scripts/copy.js b/scripts/copy.js new file mode 100644 index 0000000..30e2a00 --- /dev/null +++ b/scripts/copy.js @@ -0,0 +1,30 @@ +const fs = require('fs') + +const fileName = 'README.md' +const filePath = `docs/${fileName}` + +// If in scripts folder +// cd .. +if (!fs.existsSync('package.json')) { + process.chdir('..') +} + +// Find file +if (!fs.existsSync(fileName)) { + console.error('File not found!') +} + +fs.copyFile(fileName, filePath, err => { + if (err) throw err + fs.readFile(filePath, 'utf8', (err, data) => { + if (err) throw err + let re1 = /\]*\>([^]*)\<\/div>/m + let re2 = /^(\s*\r\n){2,}/ + + let removeDiv = data.replace(re1, '').replace(re2, '') + + fs.writeFileSync(filePath, removeDiv, 'utf8', err => { + if (err) throw err + }) + }) +})