From 8ba7de44c232cf345ccb1dd77cbaaeedcba3104f Mon Sep 17 00:00:00 2001 From: Kaustav Chakraborty Date: Tue, 30 Jul 2019 17:56:28 +0530 Subject: [PATCH] Kaustav | #40 | Added nvmrc file. Removed default test cases from the test files. | TG-40 --- .nvmrc | 1 + README.md | 26 ++++++++++++++++---------- package.json | 29 ++++++++++++++--------------- test/commands/generate.test.js | 18 +----------------- test/commands/new.test.js | 1 + 5 files changed, 33 insertions(+), 42 deletions(-) create mode 100644 .nvmrc diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..7ef6981 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +11.5.0 diff --git a/README.md b/README.md index 56e0787..fc78adb 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,9 @@ A CLI tool to create and manage initial react project -[![Version](https://img.shields.io/npm/v/@itchef/rg-cli.svg)](https://npmjs.org/package/@itchef/rg-cli) -[![License](https://img.shields.io/npm/l/@itchef/rg-cli.svg)](https://github.com/ITChef/rg-cli/blob/master/package.json) +![npm](https://img.shields.io/npm/v/@itchef/rg-cli?style=for-the-badge)![npm](https://img.shields.io/npm/dm/@itchef/rg-cli?logo=rg-cli&style=for-the-badge) +![npm bundle size](https://img.shields.io/bundlephobia/min/@itchef/rg-cli?style=for-the-badge) +![NPM](https://img.shields.io/npm/l/@itchef/rg-cli?style=for-the-badge) * [Usage](#usage) @@ -26,24 +27,29 @@ USAGE # Commands -* [`rg generate`](#rg-generate) -* [`rg help [COMMAND]`](#rg-help-command) -* [`rg new APPNAME`](#rg-new-appname) +- [@itchef/rg-cli](#itchefrg-cli) +- [Usage](#usage) +- [Commands](#commands) + - [`rg generate`](#rg-generate) + - [`rg help [COMMAND]`](#rg-help-command) + - [`rg new APPNAME`](#rg-new-appname) + - [License](#license) + - [The MIT License](#the-mit-license) ## `rg generate` -Describe the command here +Generate new files. Such as components, modules etc. ``` USAGE $ rg generate -OPTIONS - -n, --name=name name to print +Arguments + task name of the task + name generator name DESCRIPTION - ... - Extra documentation goes here + Currently we are only supporting COMPONENT generation task. ``` _See code: [src/commands/generate.js](https://github.com/ITChef/rg-cli/blob/v0.1.0/src/commands/generate.js)_ diff --git a/package.json b/package.json index 597697b..3001098 100644 --- a/package.json +++ b/package.json @@ -9,24 +9,24 @@ "bugs": "https://github.com/ITChef/rg-cli/issues", "dependencies": { "@itchef/rg-lib": "git+https://git@github.com/itchef/rg-lib.git", - "@oclif/command": "^1.5.13", - "@oclif/config": "^1.13.0", - "@oclif/plugin-help": "^2.1.6", - "cli-ux": "^5.3.1", + "@oclif/command": "1.5.13", + "@oclif/config": "1.13.0", + "@oclif/plugin-help": "2.1.6", + "cli-ux": "5.3.1", "temp": "0.9.0" }, "devDependencies": { - "@oclif/dev-cli": "^1.22.0", - "@oclif/test": "^1.2.4", - "chai": "^4.2.0", - "eslint": "^6.1.0", - "eslint-config-oclif": "^3.1.0", - "globby": "^10.0.1", - "mocha": "^6.2.0", - "nyc": "^14.1.1" + "@oclif/dev-cli": "1.22.0", + "@oclif/test": "1.2.4", + "chai": "4.2.0", + "eslint": "6.1.0", + "eslint-config-oclif": "3.1.0", + "globby": "10.0.1", + "mocha": "6.2.0", + "nyc": "14.1.1" }, "engines": { - "node": ">=8.0.0" + "node": ">=11.5.0" }, "files": [ "/bin", @@ -50,9 +50,8 @@ "repository": "ITChef/rg-cli", "scripts": { "postpack": "rm -f oclif.manifest.json", - "posttest": "eslint .", "prepack": "oclif-dev manifest && oclif-dev readme", - "test": "echo \"Error: no test specified\" && exit 0", + "test": "nyc mocha --forbid-only \"test/**/*.test.js\"", "version": "oclif-dev readme && git add README.md" } } diff --git a/test/commands/generate.test.js b/test/commands/generate.test.js index 4a53567..aeaaf42 100644 --- a/test/commands/generate.test.js +++ b/test/commands/generate.test.js @@ -1,17 +1 @@ -const {expect, test} = require('@oclif/test') - -describe('generate', () => { - test - .stdout() - .command(['generate']) - .it('runs hello', ctx => { - expect(ctx.stdout).to.contain('hello world') - }) - - test - .stdout() - .command(['generate', '--name', 'jeff']) - .it('runs hello --name jeff', ctx => { - expect(ctx.stdout).to.contain('hello jeff') - }) -}) +describe("generate", () => {}); diff --git a/test/commands/new.test.js b/test/commands/new.test.js index e69de29..3a16d78 100644 --- a/test/commands/new.test.js +++ b/test/commands/new.test.js @@ -0,0 +1 @@ +describe("new", () => {});