From b1ad7e4902be292e2fe9a65ad129ade0da0038e8 Mon Sep 17 00:00:00 2001 From: Todd Bluhm Date: Sun, 5 May 2019 21:11:19 -0500 Subject: [PATCH] Documentation updates and lint command changes - Fixed some minor documentation issues - Added tsc command to npm run lint to check for typescript errors when linting --- .npmignore | 3 ++- CHANGELOG.md | 4 ++++ README.md | 8 ++++---- dist/help.js | 10 ---------- dist/parse-args.js | 2 +- package.json | 6 +++--- src/parse-args.ts | 2 +- 7 files changed, 15 insertions(+), 20 deletions(-) delete mode 100644 dist/help.js diff --git a/.npmignore b/.npmignore index 499adf7..bd75d62 100644 --- a/.npmignore +++ b/.npmignore @@ -1,3 +1,4 @@ +.DS_Store .nyc_output .vscode coverage/ @@ -6,4 +7,4 @@ src/ test/ *.yml tsconfig.json -.eslintrc.json \ No newline at end of file +.eslintrc.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 943bc59..4251272 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Changelog +## 9.0.1 - Unreleased +- **Change**: Fixed some documentation issues +- **Change**: `npm run lint` command now includes calling `tsc` to check for typescript errors + ## 9.0.0 - ***BREAKING***: Converted project to Typescript - ***BREAKING***: Changes to all option flags, see docs for new options diff --git a/README.md b/README.md index 35334aa..d90e4c6 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Usage: _ [options] [...args] Options: -v, --version output the version number - -f, --file [path] Custom env file file path (default path: ./.env) + -f, --file [path] Custom env file path (default path: ./.env) -r, --rc-file [path] Custom rc file path (default path: ./.env-cmdrc(|.js|.json) -e, --environments [env1,env2,...] The rc file environment(s) to use --fallback Fallback to default env file path, if custom env file path not found @@ -61,7 +61,7 @@ use from the `.env-cmdrc` file. Using multiple environment names will merge the together. Later environments overwrite earlier ones in the list if conflicting environment variables are found. -**.rc file `.env-cmdrc`** +**.rc file `./.env-cmdrc`** ```json { @@ -104,7 +104,7 @@ commands together that share the same environment variables. **Terminal** ```sh -./node_modules/.bin/env-cmd -f ./test/.env --use-shell "node run lint && node test" +./node_modules/.bin/env-cmd -f ./test/.env --use-shell "npm run lint && npm test" ``` ### Asynchronous env file support @@ -205,4 +205,4 @@ added. Before opening a PR please make sure to run the following scripts: - `npm run lint` checks for code errors and format according to [js-standard](https://github.com/feross/standard) - `npm test` make sure all tests pass -- `npm run test-cover` make sure the coverage has not decreased from current master +- `npm run test-cover` make sure the coverage has not decreased from current master \ No newline at end of file diff --git a/dist/help.js b/dist/help.js deleted file mode 100644 index 6bdb8fe..0000000 --- a/dist/help.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/** - * Prints out some minor help text - * @return {String} Help text - */ -function PrintHelp() { - return "\nUsage: env-cmd [options] [env_file | env_name] command [command options]\n\nA simple utility for running a cli application using an env config file.\n\nAlso supports using a .env-cmdrc json file in the execution directory to support multiple\nenvironment configs in one file.\n\nOptions:\n --no-override - do not override existing process env vars with file env vars\n --fallback - if provided env file does not exist, attempt to use fallback .env file in root dir\n "; -} -exports.PrintHelp = PrintHelp; diff --git a/dist/parse-args.js b/dist/parse-args.js index 7bddad3..8112cdb 100644 --- a/dist/parse-args.js +++ b/dist/parse-args.js @@ -10,7 +10,7 @@ function parseArgs(args) { program .version('9.0.0', '-v, --version') .usage('[options] [...args]') - .option('-f, --file [path]', 'Custom env file file path (default path: ./.env)') + .option('-f, --file [path]', 'Custom env file path (default path: ./.env)') .option('-r, --rc-file [path]', 'Custom rc file path (default path: ./.env-cmdrc(|.js|.json)') .option('-e, --environments [env1,env2,...]', 'The rc file environment(s) to use', utils_1.parseArgList) .option('--fallback', 'Fallback to default env file path, if custom env file path not found') diff --git a/package.json b/package.json index 55cc92c..14bf3a6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "env-cmd", - "version": "9.0.0", - "description": "Executes a command using the envs in the provided env file", + "version": "9.0.1", + "description": "Executes a command using the environment variables in an env file", "main": "dist/index.js", "types": "dist/index.d.ts", "engines": { @@ -15,7 +15,7 @@ "test-cover": "nyc --reporter=lcov --reporter=text npm test", "test-lint": "eslint ./src/**/*.ts ./test/**/*.ts", "coveralls": "coveralls < coverage/lcov.info", - "lint": "eslint --fix ./src/**/*.ts ./test/**/*.ts", + "lint": "eslint --fix ./src/**/*.ts ./test/**/*.ts && tsc --noEmit", "build": "tsc" }, "repository": { diff --git a/src/parse-args.ts b/src/parse-args.ts index 9fb4a10..c120819 100644 --- a/src/parse-args.ts +++ b/src/parse-args.ts @@ -10,7 +10,7 @@ export function parseArgs (args: string[]): EnvCmdOptions { program .version('9.0.0', '-v, --version') .usage('[options] [...args]') - .option('-f, --file [path]', 'Custom env file file path (default path: ./.env)') + .option('-f, --file [path]', 'Custom env file path (default path: ./.env)') .option('-r, --rc-file [path]', 'Custom rc file path (default path: ./.env-cmdrc(|.js|.json)') .option('-e, --environments [env1,env2,...]', 'The rc file environment(s) to use', parseArgList) .option('--fallback', 'Fallback to default env file path, if custom env file path not found')