Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
akabekobeko committed Feb 3, 2017
2 parents 2473893 + 3d30099 commit a9b09e2
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 17 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
sudo: false
language: node_js
node_js:
- "4"
- "6"
- "7"
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# ChangeLog

# 1.1.2

* Change
* Node v4 support [#23](https://github.com/akabekobeko/npm-cross-conf-env/issues/23)

## 1.1.1

* Fix
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# npm-cross-conf-env

![node v6, v7](https://img.shields.io/badge/node-v6%2C%20v7-green.svg)
[![Support Node of LTS](https://img.shields.io/badge/node-LTS-brightgreen.svg)](https://nodejs.org/)
[![npm version](https://badge.fury.io/js/cross-conf-env.svg)](https://badge.fury.io/js/cross-conf-env)
[![Build Status](https://travis-ci.org/akabekobeko/npm-cross-conf-env.svg?branch=master)](https://travis-ci.org/akabekobeko/npm-cross-conf-env)
[![Document](https://doc.esdoc.org/github.com/akabekobeko/npm-cross-conf-env/badge.svg?t=0)](https://doc.esdoc.org/github.com/akabekobeko/npm-cross-conf-env)
Expand Down
4 changes: 2 additions & 2 deletions examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "examples-cross-conf-env",
"description": "Examples for the cross-conf-env.",
"private": true,
"version": "1.1.1",
"version": "1.1.2",
"author": "akabeko (http://akabeko.me/)",
"license": "MIT",
"main": "index.js",
Expand All @@ -19,7 +19,7 @@
"task:c-all": "npm run task:c --foo=Foo --bar=Bar --baz=Baz"
},
"devDependencies": {
"cross-conf-env": "^1.1.1",
"cross-conf-env": "^1.1.2",
"npm-run-all": "^4.0.1"
}
}
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
'use strict';

module.exports = require( './src/lib/main.js' );
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "cross-conf-env",
"description": "To cross-platform the config and root variable reference of package.json in npm-scripts.",
"version": "1.1.1",
"version": "1.1.2",
"author": "akabeko",
"license": "MIT",
"homepage": "https://github.com/akabekobeko/npm-cross-conf-env#readme",
"engines": {
"node": ">= 6"
"node": ">= 4"
},
"main": "index.js",
"bin": "src/bin/main.js",
Expand Down
2 changes: 2 additions & 0 deletions src/bin/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env node

'use strict';

const CrossConfEnv = require( '../lib/main.js' );

CrossConfEnv.execute( process.argv.slice( 2 ) );
2 changes: 2 additions & 0 deletions src/lib/cross-conf-env.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const Spawn = require( 'cross-spawn' );

/**
Expand Down
2 changes: 2 additions & 0 deletions src/lib/main.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
'use strict';

module.exports = require( './cross-conf-env.js' );
23 changes: 11 additions & 12 deletions test/lib/cross-conf-env.test.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
'use strict';

const assert = require( 'assert' );
const CrossConfEnv = require( '../../src/lib/cross-conf-env.js' );

/** @test {CrossConfEnv} */
describe( 'CrossConfEnv', () => {
const ENV_APP_NAME = 'MyApp';
const ENV_APP_MODE = 'test';
const ENV_APP_LANG = 'en-us';

// The number that defines the "npm_package_config_NAME" in "beforeEach"
const ENV_COUNT = 4;
const ENV_APP_NAME = 'MyApp';
const ENV_APP_MODE = 'test';
const ENV_APP_LANG = 'en-us';

beforeEach( () => {
process.env.npm_package_config_app = ENV_APP_NAME;
process.env.npm_package_config_appMode = ENV_APP_MODE;
process.env.npm_package_config_app_mode = ENV_APP_MODE;
process.env.npm_package_config_lang = ENV_APP_LANG;
process.env.npm_config_app = ENV_APP_NAME;
process.env.npm_config_lang = ENV_APP_LANG;
process.env[ 'npm_package_config_app' ] = ENV_APP_NAME;
process.env[ 'npm_package_config_appMode' ] = ENV_APP_MODE;
process.env[ 'npm_package_config_app_mode' ] = ENV_APP_MODE;
process.env[ 'npm_package_config_lang' ] = ENV_APP_LANG;
process.env[ 'npm_config_app' ] = ENV_APP_NAME;
process.env[ 'npm_config_lang' ] = ENV_APP_LANG;
} );

/** @test {CrossConfEnv#filterKeys} */
Expand Down

0 comments on commit a9b09e2

Please sign in to comment.