Skip to content

Commit

Permalink
v3.0.0 - boundation, changelog, version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
balupton committed Mar 25, 2020
1 parent ca90425 commit 1089d31
Show file tree
Hide file tree
Showing 13 changed files with 1,116 additions and 847 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ patreon: bevry
open_collective: bevry
ko_fi: balupton
liberapay: bevry
custom: ['https://bevry.me/fund']
custom: ['https://bevry.me/fund']
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ node_modules/
.pnp/
.pnp.js

# Ecosystem Files
.dependabout
.github

# Documentation Files
docs/
guides/
Expand Down
22 changes: 12 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
version: ~> 1.0
sudo: false
language: node_js
node_js:
- '8'
- '10'
- '12'
- '10'
- '12'
matrix:
fast_finish: true
allow_failures: []
cache: npm
install:
- eval "$(curl -fsSL https://raw.githubusercontent.com/bevry/awesome-travis/c91c9d5eef34ecb0e92029667fd5052640225fa3/scripts/node-install.bash)"
- >-
eval "$(curl -fsSL
https://raw.githubusercontent.com/bevry/awesome-travis/c91c9d5eef34ecb0e92029667fd5052640225fa3/scripts/node-install.bash)"
before_script:
- eval "$(curl -fsSL https://raw.githubusercontent.com/bevry/awesome-travis/c91c9d5eef34ecb0e92029667fd5052640225fa3/scripts/node-verify.bash)"
- >-
eval "$(curl -fsSL
https://raw.githubusercontent.com/bevry/awesome-travis/c91c9d5eef34ecb0e92029667fd5052640225fa3/scripts/node-verify.bash)"
after_success:
- eval "$(curl -fsSL https://raw.githubusercontent.com/bevry/awesome-travis/c91c9d5eef34ecb0e92029667fd5052640225fa3/scripts/node-publish.bash)"
notifications:
email:
recipients:
secure: coLKegx3USFs048rXR7eUU2fU/WPFTLlV8TGLcXpencBi5w/O/I+zcLBRdKlNBu48dH1hBBL89cFZfxXXfABkEqOqvZqRQHeDfxKSbqFpF8w/Y5Jt5alGhpJqVmc9jbtQ0VaDVmT+W7LMPSlzABVUq05nc9fTJlNYuMtcBVPXJo=
- >-
eval "$(curl -fsSL
https://raw.githubusercontent.com/bevry/awesome-travis/c91c9d5eef34ecb0e92029667fd5052640225fa3/scripts/node-publish.bash)"
38 changes: 16 additions & 22 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
2019 February 28
2019 December 18
https://github.com/bevry/base
-->

Expand All @@ -9,12 +9,10 @@ https://github.com/bevry/base

We offer support through our [Official Support Channels](https://bevry.me/support). Do not use GitHub Issues for support, your issue will be closed.


## Contribute

Our [Contributing Guide](https://bevry.me/contribute) contains useful tips and suggestions for how to contribute to this project, it's worth the read.


## Development

### Setup
Expand All @@ -25,40 +23,38 @@ Our [Contributing Guide](https://bevry.me/contribute) contains useful tips and s

1. Setup the project for development

``` bash
```bash
npm run our:setup
```


### Developing

1. Compile changes

``` bash
```bash
npm run our:compile
```

1. Run tests

``` bash
```bash
npm test
```


### Publishing

Follow these steps in order to implement your changes/improvements into your desired project:


#### Preparation

1. Make sure your changes are on their own branch that is branched off from master.

1. You can do this by: `git checkout master; git checkout -b your-new-branch`
1. And push the changes up by: `git push origin your-new-branch`

1. Ensure all tests pass:

``` bash
```bash
npm test
```

Expand All @@ -70,7 +66,6 @@ Follow these steps in order to implement your changes/improvements into your des
npm run our:release:prepare
```


#### Pull Request

To send your changes for the project owner to merge in:
Expand All @@ -79,37 +74,36 @@ To send your changes for the project owner to merge in:
1. When submitting, if the original project has a `dev` or `integrate` branch, use that as the target branch for your pull request instead of the default `master`
1. By submitting a pull request you agree for your changes to have the same license as the original plugin


#### Publish

To publish your changes as the project owner:

1. Switch to the master branch:

``` bash
```bash
git checkout master
```

1. Merge in the changes of the feature branch (if applicable)

1. Increment the version number in the `package.json` file according to the [semantic versioning](http://semver.org) standard, that is:

1. `x.0.0` MAJOR version when you make incompatible API changes (note: DocPad plugins must use v2 as the major version, as v2 corresponds to the current DocPad v6.x releases)
1. `x.y.0` MINOR version when you add functionality in a backwards-compatible manner
1. `x.y.z` PATCH version when you make backwards-compatible bug fixes

1. Add an entry to the changelog following the format of the previous entries, an example of this is:

``` markdown
```markdown
## v6.29.0 2013 April 1
- Progress on [issue #474](https://github.com/bevry/docpad/issues/474)
- DocPad will now set permissions based on the process's ability
- Thanks to [Avi Deitcher](https://github.com/deitch), [Stephan Lough](https://github.com/stephanlough) for [issue #165](https://github.com/bevry/docpad/issues/165)
- Updated dependencies
```
1. Commit the changes with the commit title set to something like `v6.29.0. Bugfix. Improvement.` and commit description set to the changelog entry
- Progress on [issue #474](https://github.com/bevry/docpad/issues/474)
- DocPad will now set permissions based on the process's ability
- Thanks to [Avi Deitcher](https://github.com/deitch), [Stephan Lough](https://github.com/stephanlough) for [issue #165](https://github.com/bevry/docpad/issues/165)
- Updated dependencies
```
1) Commit the changes with the commit title set to something like `v6.29.0. Bugfix. Improvement.` and commit description set to the changelog entry
1. Ensure the project is ready for publishing:
Expand All @@ -119,6 +113,6 @@ To publish your changes as the project owner:
1. Prepare the release and publish it to npm and git:
``` bash
```bash
npm run our:release
```
5 changes: 5 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# History

## v3.0.0 2020 March 26

- Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation)
- Minimum required node version changed from `node: >=8` to `node: >=10` to keep up with mandatory ecosystem changes

## v2.4.0 2019 December 9

- Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation)
Expand Down
48 changes: 24 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,41 @@ Provide some arguments, get back a hash object of the arguments indexed by their
<!-- /DESCRIPTION -->


## Usage

Let's say your coding a function, and you want to accept arguments in any order. Traditionally this would look like:

> https://github.com/bevry/argsbytype/blob/master/example/01.js
But what happens when you:

- Start having arguments that are regular expressions or dates which `typeof` is still `object` instead of `regexp` or `date`
- Or, when you start having multiple arguments of the same type, that you would like to accept (e.g. the first string should be the `name` property, the second string should be the `keyword` property)

At that point in time, it becomes too much trouble to bother with. Fortunately, `argsbytype` is to the rescue! Now you can do:

> https://github.com/bevry/argsbytype/blob/master/example/02.js
Yay! Big win for agnostic argument order! But when would you actually want this? Well, it turns out that in CoffeeScript options come first, in JavaScript, options usually come last. By using this, we can support both conventions, for example:

> https://github.com/bevry/argsbytype/blob/master/example/03.js
<!-- INSTALL/ -->

<h2>Install</h2>

<a href="https://npmjs.com" title="npm is a package manager for javascript"><h3>npm</h3></a>
<ul>
<li>Install: <code>npm install --save argsbytype</code></li>
<li>Require: <code>require('argsbytype')</code></li>
<li>Import: <code>import * as pkg from ('argsbytype')</code></li>
<li>Require: <code>const pkg = require('argsbytype')</code></li>
</ul>

<a href="https://jspm.io" title="Native ES Modules CDN"><h3>jspm</h3></a>

``` html
<script type="module">
import * as pkg from '//dev.jspm.io/argsbytype'
import * as pkg from '//dev.jspm.io/argsbytype@3.0.0'
</script>
```

Expand All @@ -56,32 +76,12 @@ Provide some arguments, get back a hash object of the arguments indexed by their
<p>This package is published with the following editions:</p>

<ul><li><code>argsbytype</code> aliases <code>argsbytype/source/index.js</code></li>
<li><code>argsbytype/source/index.js</code> is esnext source code with require for modules</li>
<li><code>argsbytype/edition-browsers/index.js</code> is esnext compiled for browsers with require for modules</li></ul>
<li><code>argsbytype/source/index.js</code> is <a href="https://en.wikipedia.org/wiki/ECMAScript#ES.Next" title="ECMAScript Next">ESNext</a> source code for <a href="https://nodejs.org" title="Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine">Node.js</a> with <a href="https://nodejs.org/dist/latest-v5.x/docs/api/modules.html" title="Node/CJS Modules">Require</a> for modules</li>
<li><code>argsbytype/edition-browsers/index.js</code> is <a href="https://en.wikipedia.org/wiki/ECMAScript#ES.Next" title="ECMAScript Next">ESNext</a> compiled for web browsers with <a href="https://nodejs.org/dist/latest-v5.x/docs/api/modules.html" title="Node/CJS Modules">Require</a> for modules</li></ul>

<!-- /INSTALL -->


## Usage

Let's say your coding a function, and you want to accept arguments in any order. Traditionally this would look like:

> https://github.com/bevry/argsbytype/blob/master/example/01.js
But what happens when you:

- Start having arguments that are regular expressions or dates which `typeof` is still `object` instead of `regexp` or `date`
- Or, when you start having multiple arguments of the same type, that you would like to accept (e.g. the first string should be the `name` property, the second string should be the `keyword` property)

At that point in time, it becomes too much trouble to bother with. Fortunately, `argsbytype` is to the rescue! Now you can do:

> https://github.com/bevry/argsbytype/blob/master/example/02.js
Yay! Big win for agnostic argument order! But when would you actually want this? Well, it turns out that in CoffeeScript options come first, in JavaScript, options usually come last. By using this, we can support both conventions, for example:

> https://github.com/bevry/argsbytype/blob/master/example/03.js

<!-- HISTORY/ -->

<h2>History</h2>
Expand Down
10 changes: 5 additions & 5 deletions example/01.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint prefer-rest-params:0, no-undefined:0, no-console:0 */
'use strict'

function myFunction () {
function myFunction() {
// Specify our argument variables
let name, options, concurrency

Expand All @@ -28,10 +28,10 @@ function myFunction () {
console.log({
name,
options,
concurrency
concurrency,
})
}

myFunction('sup', { a: 1 }, 123) // {name: 'sup', options:{a: 1}, concurrency: 123}
myFunction({ a: 1 }, 123, 'sup') // {name: 'sup', options:{a: 1}, concurrency: 123}
myFunction(123, 'sup', { a: 1 }) // {name: 'sup', options:{a: 1}, concurrency: 123}
myFunction('sup', { a: 1 }, 123) // {name: 'sup', options:{a: 1}, concurrency: 123}
myFunction({ a: 1 }, 123, 'sup') // {name: 'sup', options:{a: 1}, concurrency: 123}
myFunction(123, 'sup', { a: 1 }) // {name: 'sup', options:{a: 1}, concurrency: 123}
10 changes: 5 additions & 5 deletions example/02.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint prefer-rest-params:0, no-undefined:0, no-console:0 */
'use strict'

function myFunction () {
function myFunction() {
// Extract our arguments
const args = require('../')(arguments)
const name = args.strings[0]
Expand All @@ -12,10 +12,10 @@ function myFunction () {
console.log({
name,
options,
concurrency
concurrency,
})
}

myFunction('sup', { a: 1 }, 123) // {name: 'sup', options:{a: 1}, concurrency: 123}
myFunction({ a: 1 }, 123, 'sup') // {name: 'sup', options:{a: 1}, concurrency: 123}
myFunction(123, 'sup', { a: 1 }) // {name: 'sup', options:{a: 1}, concurrency: 123}
myFunction('sup', { a: 1 }, 123) // {name: 'sup', options:{a: 1}, concurrency: 123}
myFunction({ a: 1 }, 123, 'sup') // {name: 'sup', options:{a: 1}, concurrency: 123}
myFunction(123, 'sup', { a: 1 }) // {name: 'sup', options:{a: 1}, concurrency: 123}
2 changes: 1 addition & 1 deletion example/03.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'use strict'

// agnostic setTimeout
function wait () {
function wait() {
const args = require('../')(arguments)
return setTimeout(args.functions[0], args.numbers[0])
}
Expand Down
Loading

0 comments on commit 1089d31

Please sign in to comment.