Skip to content

Commit

Permalink
feat(lib): Initial release. It is ready!
Browse files Browse the repository at this point in the history
  • Loading branch information
Kent C. Dodds committed Jul 18, 2016
1 parent 8da56b0 commit ebd5168
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 42 deletions.
24 changes: 24 additions & 0 deletions .all-contributorsrc
@@ -0,0 +1,24 @@
{
"projectName": "webpack-config-utils",
"projectOwner": "kentcdodds",
"files": [
"README.md"
],
"imageSize": 100,
"commit": false,
"contributors": [
{
"login": "kentcdodds",
"name": "Kent C. Dodds",
"avatar_url": "https://avatars.githubusercontent.com/u/1500684?v=3",
"profile": "https://kentcdodds.com",
"contributions": [
"code",
"doc",
"example",
"infra",
"test"
]
}
]
}
43 changes: 5 additions & 38 deletions README.md
Expand Up @@ -113,50 +113,16 @@ module.exports = env => {

## API

### `here`

See the package details of [`here`](https://www.npmjs.com/package/here)

### `combineLoaders`

See the package details of [`webpack-combine-loaders`](https://www.npmjs.com/package/webpack-combine-loaders)

### `propIf`

This powers the methods returned from `getIfUtils` and `propIfNot`. It's actually just a simple ternary:

```
return getValue(add) ? value : alternate
```

Where `getValue` simply evaluates the given value

### `propIfNot`



### `removeEmpty`



### `getIfUtils`




## Inspiration



## Other Solutions


See the API Documentation [here][API Docs]. In addition to custom utilities from this package, it comes bundled with
a few other helpful utilities: [`path-here`](https://www.npmjs.com/package/path-here) (exposed as `here`) and [`webpack-combine-loaders`](https://www.npmjs.com/package/webpack-combine-loaders) (exposed as `combineLoaders`).

## Contributors

Thanks goes to these people ([emoji key][emojis]):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
| [<img src="https://avatars.githubusercontent.com/u/1500684?v=3" width="100px;"/><br /><sub>Kent C. Dodds</sub>](https://kentcdodds.com)<br />[💻](https://github.com/kentcdodds/webpack-config-utils/commits?author=kentcdodds) [📖](https://github.com/kentcdodds/webpack-config-utils/commits?author=kentcdodds) 💡 🚇 [⚠️](https://github.com/kentcdodds/webpack-config-utils/commits?author=kentcdodds) |
| :---: |
<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors][all-contributors] specification. Contributions of any kind welcome!
Expand Down Expand Up @@ -191,3 +157,4 @@ MIT
[all-contributors]: https://github.com/kentcdodds/all-contributors
[cross-env]: https://www.npmjs.com/package/cross-env
[p-s]: https://www.npmjs.com/package/p-s
[API Docs]: https://doclets.io/kentcdodds/webpack-config-utils/master
2 changes: 2 additions & 0 deletions other/EXAMPLES.md
@@ -1 +1,3 @@
# Examples

There's nothing here! [But PRs are welcome!](http://makeapullrequest.com)
7 changes: 7 additions & 0 deletions other/ROADMAP.md
Expand Up @@ -2,6 +2,13 @@

## Want to do

There are definitely more utilities we could make, but I can't think of any right now. Feel free to file an issue to
discuss!

## Might do

Similar to above

## Wont do

- Augment the Webpack API. I don't want to write a DSL on top of webpack's DSL.
7 changes: 4 additions & 3 deletions src/prop-if.js
Expand Up @@ -5,11 +5,12 @@ export {propIf, propIfNot}
* (to turn "true" to `true`). And if the result is truthy, then `value` will be returned, otherwise `alternate` will be
* returned. This powers the (arguably more useful) methods returned from `getIfUtils`.
* @example
* // returns 'value'
* propIf(true, 'value', 'alternate')
* @example <caption>Is falsy sensitive</caption>
* // returns 'alternate'
* // returns 'value'
* @example
* // Is falsy sensitive
* propIf(0, 'value', 'alternate')
* // returns 'alternate'
* @param {*} add The value to evaluate
* @param {*} value The value to return in a truthy case
* @param {*} alternate The value to return in a falsy case
Expand Down
3 changes: 2 additions & 1 deletion src/remove-empty.js
Expand Up @@ -3,7 +3,8 @@ export {removeEmpty}
/**
* Accepts an array and removes all undefined values (using `filter`)
*
* @example <caption>Primary use case is in `plugins` where `undefined` values can cause issues</caption>
* @example
* // Primary use case is in `plugins` where `undefined` values can cause issues
* module.exports = {
* ... your config
* plugins: removeEmpty([
Expand Down

0 comments on commit ebd5168

Please sign in to comment.