From efe093f6b6517926e3fa2d7a46f7d75b3b60c6e2 Mon Sep 17 00:00:00 2001 From: Fabio Crisci Date: Fri, 16 Mar 2018 13:24:52 +0900 Subject: [PATCH] Refactor to use this project as a module You don't always have to use the CLI. Add a bunch of unit tests --- .eslintignore | 1 + .eslintrc.json | 4 + README.md | 45 +- cli.js | 62 + index.js | 191 +- index.test.js | 48 + lib/__tests__/.eslintrc.json | 5 + lib/__tests__/config.options.json | 3 + lib/__tests__/file-system.test.js | 86 + lib/__tests__/git.test.js | 52 + lib/__tests__/process.test.js | 57 + lib/__tests__/scripts/nested.js | 6 + lib/__tests__/scripts/rename.js | 5 + lib/__tests__/scripts/syntax.js | 1 + lib/__tests__/scripts/throws.js | 3 + lib/__tests__/templates/invalid.ejs | 2 + lib/file-system.js | 104 + lib/git.js | 74 +- lib/process.js | 63 + package-lock.json | 4992 ++++++++++++++++++++++++++- package.json | 25 +- samples/output-html-bootstrap.html | 30 +- 22 files changed, 5605 insertions(+), 254 deletions(-) create mode 100644 .eslintignore create mode 100755 cli.js create mode 100644 index.test.js create mode 100644 lib/__tests__/.eslintrc.json create mode 100644 lib/__tests__/config.options.json create mode 100644 lib/__tests__/file-system.test.js create mode 100644 lib/__tests__/git.test.js create mode 100644 lib/__tests__/process.test.js create mode 100644 lib/__tests__/scripts/nested.js create mode 100644 lib/__tests__/scripts/rename.js create mode 100644 lib/__tests__/scripts/syntax.js create mode 100644 lib/__tests__/scripts/throws.js create mode 100644 lib/__tests__/templates/invalid.ejs create mode 100644 lib/file-system.js create mode 100644 lib/process.js diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..448e13e --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +lib/__tests__/scripts/syntax.js diff --git a/.eslintrc.json b/.eslintrc.json index de0f1ae..bcee297 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,8 +1,12 @@ { "env": { + "es6": true, "node": true }, "extends": "eslint:recommended", + "parserOptions": { + "ecmaVersion": 6 + }, "rules": { "no-console": 0 } diff --git a/README.md b/README.md index 171479c..1166016 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,11 @@ It's preferable to install it globally through [`npm`](https://www.npmjs.com/pac npm install -g git-release-notes +It's also possible to use `git-release-notes` as a node module. Check the usage on [usage as a module](#Usage_as_a_module) + ### Usage -The basic usage is +The basic usage from the command line is cd git-release-notes ..