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
This commit is contained in:
Todd Bluhm 2019-05-05 21:11:19 -05:00
parent b7cb14651b
commit b1ad7e4902
No known key found for this signature in database
GPG Key ID: 9CF312607477B8AB
7 changed files with 15 additions and 20 deletions

View File

@ -1,3 +1,4 @@
.DS_Store
.nyc_output .nyc_output
.vscode .vscode
coverage/ coverage/
@ -6,4 +7,4 @@ src/
test/ test/
*.yml *.yml
tsconfig.json tsconfig.json
.eslintrc.json .eslintrc.json

View File

@ -1,4 +1,8 @@
# Changelog # 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 ## 9.0.0
- ***BREAKING***: Converted project to Typescript - ***BREAKING***: Converted project to Typescript
- ***BREAKING***: Changes to all option flags, see docs for new options - ***BREAKING***: Changes to all option flags, see docs for new options

View File

@ -42,7 +42,7 @@ Usage: _ [options] <command> [...args]
Options: Options:
-v, --version output the version number -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) -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 -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 --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 together. Later environments overwrite earlier ones in the list if conflicting environment variables
are found. are found.
**.rc file `.env-cmdrc`** **.rc file `./.env-cmdrc`**
```json ```json
{ {
@ -104,7 +104,7 @@ commands together that share the same environment variables.
**Terminal** **Terminal**
```sh ```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 ### 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 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 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

10
dist/help.js vendored
View File

@ -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;

2
dist/parse-args.js vendored
View File

@ -10,7 +10,7 @@ function parseArgs(args) {
program program
.version('9.0.0', '-v, --version') .version('9.0.0', '-v, --version')
.usage('[options] <command> [...args]') .usage('[options] <command> [...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('-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('-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') .option('--fallback', 'Fallback to default env file path, if custom env file path not found')

View File

@ -1,7 +1,7 @@
{ {
"name": "env-cmd", "name": "env-cmd",
"version": "9.0.0", "version": "9.0.1",
"description": "Executes a command using the envs in the provided env file", "description": "Executes a command using the environment variables in an env file",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
"engines": { "engines": {
@ -15,7 +15,7 @@
"test-cover": "nyc --reporter=lcov --reporter=text npm test", "test-cover": "nyc --reporter=lcov --reporter=text npm test",
"test-lint": "eslint ./src/**/*.ts ./test/**/*.ts", "test-lint": "eslint ./src/**/*.ts ./test/**/*.ts",
"coveralls": "coveralls < coverage/lcov.info", "coveralls": "coveralls < coverage/lcov.info",
"lint": "eslint --fix ./src/**/*.ts ./test/**/*.ts", "lint": "eslint --fix ./src/**/*.ts ./test/**/*.ts && tsc --noEmit",
"build": "tsc" "build": "tsc"
}, },
"repository": { "repository": {

View File

@ -10,7 +10,7 @@ export function parseArgs (args: string[]): EnvCmdOptions {
program program
.version('9.0.0', '-v, --version') .version('9.0.0', '-v, --version')
.usage('[options] <command> [...args]') .usage('[options] <command> [...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('-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('-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') .option('--fallback', 'Fallback to default env file path, if custom env file path not found')