kanso/kanso — Issue #353: Override kanso.json settings by env-specific entries from .kansorc
Author: skiqh
Created: 2012-01-17 09:38:30+00:00
State: open

Assume we have this `kanso.json`:

```javascript
{
"name": "my_app",
"version": "0.0.1",
...
"less": {
"compile": [ ... ],
"compress": VALUE
}
"dependencies": {
"less-precompiler": null,
...
}
}
```

Depending on `VALUE`, this will tell the less-precompiler to compress its output _all of the time_ or _never_.
(The less-precompiler just holds as an example here)

I think it would be great to distinguish between different environments, so I could set this to one value on a `kanso push` and to another on a `kanso push production`, for instance. A good place for this should be the `.kansorc`

```javascript
exports.env = {
// the default env will be used when you just do "kanso push"
'default': {
db: 'http://user:pass@127.0.0.1/my_db',

"less": {
"compress": false
},
},
// this one will be used when you do "kanso push production"
'production': {
db: 'http://user:pass@somecouch.iriscouch.com/app_db',

"less": {
"compress": true
},
}
};

```

That way, one would define a default behaviour of a package in `kanso.json` and be able to transparently override those settings on a built-specific basis.
Note: The above is just an example of how one could put that into a `.kansorc`, I could also imagine an explicit `override`-section of some sort.