Skip to content

Commit

Permalink
roll v2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
neocotic committed Mar 24, 2017
1 parent 4fb95dd commit 737648a
Show file tree
Hide file tree
Showing 22 changed files with 117 additions and 193 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Original file line Diff line number Diff line change
@@ -1,8 +1,8 @@
sudo: false
language: node_js language: node_js
node_js: node_js:
- "0.10"
- "0.12"
- "4" - "4"
- "6" - "6"
- "7"
script: script:
- npm test - npm run ci
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,7 @@
## Version 2.1.0, 2017.03.24

* Support JSON requests (GET & POST) [#6](https://github.com/neocotic/yourls-api/issues/6)

## Version 2.0.0, 2016.11.23 ## Version 2.0.0, 2016.11.23


* Support time-limited signature token for [passwordless API](https://github.com/YOURLS/YOURLS/wiki/PasswordlessAPI) (Josh Panter) [#1](https://github.com/neocotic/yourls-api/issues/1) * Support time-limited signature token for [passwordless API](https://github.com/YOURLS/YOURLS/wiki/PasswordlessAPI) (Josh Panter) [#1](https://github.com/neocotic/yourls-api/issues/1)
Expand Down
12 changes: 2 additions & 10 deletions CONTRIBUTING.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Please [search existing issues](https://github.com/neocotic/yourls-api/issues) f
raising a new issue. Commenting on an existing issue is usually preferred over raising duplicate issues. raising a new issue. Commenting on an existing issue is usually preferred over raising duplicate issues.


Please ensure that all files conform to the coding standards, using the same coding style as the rest of the code base. Please ensure that all files conform to the coding standards, using the same coding style as the rest of the code base.
This can be done easily via command-line: This can easily be checked via command-line:


``` bash ``` bash
# install/update package dependencies # install/update package dependencies
Expand All @@ -16,15 +16,7 @@ $ npm install
$ npm test $ npm test
``` ```


This will recompile the distribution files as well. You must have at least [Node.js](https://nodejs.org) version 4 or newer installed.

If you're using a version of [Node.js](https://nodejs.org) that is older than 0.12, then linting is not performed by
this step. Please consider upgrading to at least 0.12 or your pull request may fail on the CI build.

Likewise, [Node.js](https://nodejs.org) versions older than 0.10 will also not be able to compile the source code using
[Rollup](http://rollupjs.org) so the test suite will not be executed against any changes you've made to `src/**.js`. For
this reason, 0.10 is not supported from a development perspective, but our CI builds do run the test suite against the
pre-compiled code for this version to ensure that it works.


All pull requests should be made to the `develop` branch. All pull requests should be made to the `develop` branch.


Expand Down
187 changes: 67 additions & 120 deletions Gruntfile.js
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2016 Alasdair Mercer * Copyright (C) 2017 Alasdair Mercer
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
Expand All @@ -21,138 +21,85 @@
*/ */


module.exports = function(grunt) { module.exports = function(grunt) {
var nodeResolve var nodeResolve = require('rollup-plugin-node-resolve')
var semver = require('semver') var uglify = require('rollup-plugin-uglify')
var uglify

var bannerLarge = [
'/*',
' * Copyright (C) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>',
' *',
' * Permission is hereby granted, free of charge, to any person obtaining a copy',
' * of this software and associated documentation files (the "Software"), to deal',
' * in the Software without restriction, including without limitation the rights',
' * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell',
' * copies of the Software, and to permit persons to whom the Software is',
' * furnished to do so, subject to the following conditions:',
' *',
' * The above copyright notice and this permission notice shall be included in all',
' * copies or substantial portions of the Software.',
' *',
' * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR',
' * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,',
' * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE',
' * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER',
' * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,',
' * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE',
' * SOFTWARE.',
' */'
].join('\n')
var bannerSmall = '/*! YOURLS API v<%= pkg.version %> | (C) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> | MIT License */'


grunt.initConfig({ grunt.initConfig({
pkg: grunt.file.readJSON('package.json'), pkg: grunt.file.readJSON('package.json'),


watch: { clean: {
all: { build: [ 'dist/**' ]
files: [ 'src/**/*.js' ], },
tasks: [ 'test' ]
}
}
})


var buildTasks = [ 'compile' ] eslint: {
var compileTasks = [] target: [ 'src/**/*.js' ]
var testTasks = [ 'compile' ] },

if (semver.satisfies(process.version, '>=0.12')) {
nodeResolve = require('rollup-plugin-node-resolve')
uglify = require('rollup-plugin-uglify')

compileTasks.push('clean', 'rollup')

grunt.config.merge({
clean: {
build: [ 'dist/**' ]
},


rollup: { rollup: {
umdDevelopment: { umdDevelopment: {
options: { options: {
format: 'umd', format: 'umd',
moduleId: 'yourls-api', moduleId: 'yourls-api',
moduleName: 'yourls', moduleName: 'yourls',
sourceMap: true, sourceMap: true,
sourceMapRelativePaths: true, sourceMapRelativePaths: true,
banner: bannerLarge, plugins: function() {
plugins: function() { return [
return [ nodeResolve({
nodeResolve({ browser: true,
browser: true, jsnext: true,
jsnext: true, main: true
main: true })
}) ]
]
}
},
files: {
'dist/yourls.js': 'src/yourls.js'
} }
}, },
umdProduction: { files: {
options: { 'dist/yourls.js': 'src/yourls.js'
format: 'umd', }
moduleId: 'yourls-api', },
moduleName: 'yourls', umdProduction: {
sourceMap: true, options: {
sourceMapRelativePaths: true, format: 'umd',
banner: bannerSmall, moduleId: 'yourls-api',
plugins: function() { moduleName: 'yourls',
return [ sourceMap: true,
nodeResolve({ sourceMapRelativePaths: true,
browser: true, banner: '/*! YOURLS API v<%= pkg.version %> | (C) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> | <%= pkg.license %> License */',
jsnext: true, plugins: function() {
main: true return [
}), nodeResolve({
uglify({ browser: true,
output: { jsnext: true,
comments: function(node, comment) { main: true
return comment.type === 'comment2' && /^\!/.test(comment.value) }),
} uglify({
output: {
comments: function(node, comment) {
return comment.type === 'comment2' && /^\!/.test(comment.value)
} }
}) }
] })
} ]
},
files: {
'dist/yourls.min.js': 'src/yourls.js'
} }
},
files: {
'dist/yourls.min.js': 'src/yourls.js'
} }
} }
}) },

grunt.loadNpmTasks('grunt-contrib-clean')
grunt.loadNpmTasks('grunt-rollup')
} else {
grunt.log.writeln('"clean" and "rollup" tasks are disabled because Node.js version is <0.12! Please consider upgrading Node.js...')
}

if (semver.satisfies(process.version, '>=4')) {
compileTasks.unshift('eslint')

grunt.config.set('eslint', {
target: [ 'src/**/*.js' ]
})


grunt.loadNpmTasks('grunt-eslint') watch: {
} else { all: {
grunt.log.writeln('"eslint" task is disabled because Node.js version is <4! Please consider upgrading Node.js...') files: [ 'src/**/*.js' ],
} tasks: [ 'eslint' ]
}
}
})


grunt.loadNpmTasks('grunt-contrib-watch') require('load-grunt-tasks')(grunt)


grunt.registerTask('default', [ 'build' ]) grunt.registerTask('default', [ 'ci' ])
grunt.registerTask('build', buildTasks) grunt.registerTask('build', [ 'eslint', 'clean:build', 'rollup' ])
grunt.registerTask('compile', compileTasks) grunt.registerTask('ci', [ 'eslint', 'clean', 'rollup' ])
grunt.registerTask('test', testTasks) grunt.registerTask('test', [ 'eslint' ])
} }
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (C) 2016 Alasdair Mercer Copyright (C) 2017 Alasdair Mercer


Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
d8888888888 888 888 d8888888888 888 888
d88P 888 888 8888888 d88P 888 888 8888888


[YOURLS API](https://github.com/neocotic/yourls-api) is a JavaScript library that provides bindings for
[YOURLS](https://yourls.org) URL shortener servers.

[![Build Status](https://img.shields.io/travis/neocotic/yourls-api/develop.svg?style=flat-square)](https://travis-ci.org/neocotic/yourls-api) [![Build Status](https://img.shields.io/travis/neocotic/yourls-api/develop.svg?style=flat-square)](https://travis-ci.org/neocotic/yourls-api)
[![Dev Dependency Status](https://img.shields.io/david/dev/neocotic/yourls-api.svg?style=flat-square)](https://david-dm.org/neocotic/yourls-api#info=devDependencies) [![Dev Dependency Status](https://img.shields.io/david/dev/neocotic/yourls-api.svg?style=flat-square)](https://david-dm.org/neocotic/yourls-api?type=dev)
[![License](https://img.shields.io/npm/l/yourls-api.svg?style=flat-square)](https://github.com/neocotic/yourls-api/blob/master/LICENSE.md) [![License](https://img.shields.io/npm/l/yourls-api.svg?style=flat-square)](https://github.com/neocotic/yourls-api/blob/master/LICENSE.md)
[![Release](https://img.shields.io/npm/v/yourls-api.svg?style=flat-square)](https://www.npmjs.com/package/yourls-api) [![Release](https://img.shields.io/npm/v/yourls-api.svg?style=flat-square)](https://www.npmjs.com/package/yourls-api)


[YOURLS API](https://github.com/neocotic/yourls-api) is a JavaScript library that provides bindings for
[YOURLS](https://yourls.org) URL shortener servers.

* [Install](#install) * [Install](#install)
* [API](#api) * [API](#api)
* [Migrating from v1](#migrating-from-v1) * [Migrating from v1](#migrating-from-v1)
Expand All @@ -46,8 +46,8 @@ intended for use in the browser. `npm` installations are supported for the many


If you want to simply download the file to be used in the browser you can find them below: If you want to simply download the file to be used in the browser you can find them below:


* [Development Version](https://github.com/neocotic/yourls-api/blob/master/dist/yourls.js) * [Development Version](https://cdn.rawgit.com/neocotic/yourls-api/master/dist/yourls.js) (TODO - [Source Map](https://cdn.rawgit.com/neocotic/yourls-api/master/dist/yourls.js.map))
* [Production Version](https://github.com/neocotic/yourls-api/blob/master/dist/yourls.min.js) * [Production Version](https://cdn.rawgit.com/neocotic/yourls-api/master/dist/yourls.min.js) (TODO - [Source Map](https://cdn.rawgit.com/neocotic/yourls-api/master/dist/yourls.min.js.map))


## API ## API


Expand Down Expand Up @@ -369,7 +369,7 @@ yourls.version(true, function(result, response) {
``` javascript ``` javascript
// Get version of this library // Get version of this library
console.log(yourls.VERSION) console.log(yourls.VERSION)
//=> "2.0.0" //=> "2.1.0"
``` ```


The current version of this library. The current version of this library.
Expand Down Expand Up @@ -403,6 +403,6 @@ A list of YOURLS API contributors can be found in


## License ## License


Copyright © 2016 Alasdair Mercer Copyright © 2017 Alasdair Mercer


See [LICENSE.md](https://github.com/neocotic/yourls-api/blob/master/LICENSE.md) for more information on our MIT license. See [LICENSE.md](https://github.com/neocotic/yourls-api/blob/master/LICENSE.md) for more information on our MIT license.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
{ {
"name": "yourls-api", "name": "yourls-api",
"version": "2.0.0", "version": "2.1.0",
"description": "Bindings for the YOURLS API", "description": "Bindings for the YOURLS API",
"homepage": "https://github.com/neocotic/yourls-api", "homepage": "https://github.com/neocotic/yourls-api",
"authors": [ "authors": [
Expand Down
Loading

0 comments on commit 737648a

Please sign in to comment.