Skip to content
Permalink
Browse files

release v2.0.0 (#2) :shipit:

  • Loading branch information...
neocotic committed Nov 23, 2016
1 parent 5ae1034 commit dff0803bcf4ed5860cb53aa2cb0c7855388d3d1f
Showing with 2,239 additions and 638 deletions.
  1. +12 −0 .editorconfig
  2. +2 −0 .eslintignore
  3. +15 −0 .eslintrc.json
  4. +1 −0 .gitattributes
  5. +2 −4 .gitignore
  6. +7 −0 .npmignore
  7. +8 −0 .travis.yml
  8. +2 −1 AUTHORS.md
  9. +19 −0 CHANGES.md
  10. +33 −0 CONTRIBUTING.md
  11. +162 −0 Gruntfile.js
  12. +2 −2 LICENSE.md
  13. +327 −38 README.md
  14. +36 −0 bower.json
  15. +793 −0 dist/yourls.js
  16. +1 −0 dist/yourls.js.map
  17. +4 −0 dist/yourls.min.js
  18. +1 −0 dist/yourls.min.js.map
  19. +0 −186 docs/docco.css
  20. +0 −202 docs/yourls.html
  21. +44 −13 package.json
  22. +138 −0 src/api.js
  23. +147 −0 src/request/jsonp.js
  24. +46 −0 src/request/paramify.js
  25. +34 −0 src/util/array.js
  26. +48 −0 src/yourls-db.js
  27. +76 −0 src/yourls-url.js
  28. +279 −0 src/yourls.js
  29. +0 −186 yourls.js
  30. +0 −6 yourls.min.js
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
@@ -0,0 +1,2 @@
dist/
Gruntfile.js
@@ -0,0 +1,15 @@
{
"extends": "skelp/v3/es5",
"env": {
"browser": true
},
"parserOptions": {
"sourceType": "module"
},
"rules": {
"max-params": [
"error",
4
]
}
}
@@ -0,0 +1 @@
* text eol=lf
@@ -1,4 +1,2 @@
.DS_Store?
ehthumbs.db
Icon?
Thumbs.db
node_modules/
*.log
@@ -0,0 +1,7 @@
.*
AUTHORS.md
bower.json
CHANGES.md
CONTRIBUTING.md
Gruntfile.js
README.md
@@ -0,0 +1,8 @@
language: node_js
node_js:
- "0.10"
- "0.12"
- "4"
- "6"
script:
- npm test
@@ -1,3 +1,4 @@
# Authors ordered by first contribution

* Alasdair Mercer <mercer.alasdair@gmail.com>
* Alasdair Mercer <mercer.alasdair@gmail.com>
* Josh Panter <joshu@unfettered.net>
@@ -0,0 +1,19 @@
## 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)
* Rewrite library to be easier to maintain
* Refactor API methods to be easier to use (incl. breaking changes)
* Add `yourls.disconnect` API method to clear previously stored connection information
* Add `yourls.db.stats` API method to fetch statistics for all links
* Add `yourls.version` API method to fetch YOURLS version information
* Fix bug where query string parameter name and/or value are not always URL-encoded
* Rewrite documentation to be more informative
* Remove `docs` generated by [Docco](https://jashkenas.github.io/docco/)
* Add [EditorConfig](http://editorconfig.org) file
* Add [ESLint](http://eslint.org)
* Bundle library using [Rollup](http://rollupjs.org)
* Build library using [Grunt](http://gruntjs.com)
* Add continuous integration using [Travis](http://travis-ci.org)
* Add contributor guidelines
* Publish to [Bower](http://bower.io)
* Publish to [npm](https://www.npmjs.org)
@@ -0,0 +1,33 @@
# Contributing

If you have any questions about [YOURLS API](https://github.com/neocotic/yourls-api) please feel free to
[raise an issue](https://github.com/neocotic/yourls-api/issues/new).

Please [search existing issues](https://github.com/neocotic/yourls-api/issues) for the same feature and/or issue before
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.
This can be done easily via command-line:

``` bash
# install/update package dependencies
$ npm install
# run test suite
$ npm test
```

This will recompile the distribution files as well.

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.

Don't forget to add your details to the list of
[AUTHORS.md](https://github.com/neocotic/yourls-api/blob/master/AUTHORS.md) if you want your contribution to be
recognized by others.
@@ -0,0 +1,162 @@
/*
* Copyright (C) 2016 Alasdair Mercer
*
* 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.
*/

module.exports = function(grunt) {
var commonjs
var nodeResolve
var semver = require('semver')
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({
pkg: grunt.file.readJSON('package.json'),

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

var buildTasks = [ 'compile' ]
var compileTasks = []
var testTasks = [ 'compile' ]

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

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

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

rollup: {
umdDevelopment: {
options: {
format: 'umd',
moduleId: 'yourls-api',
moduleName: 'yourls',
sourceMap: true,
sourceMapRelativePaths: true,
banner: bannerLarge,
plugins: function() {
return [
nodeResolve({
browser: true,
jsnext: true,
main: true
}),
commonjs()
]
}
},
files: {
'dist/yourls.js': 'src/yourls.js'
}
},
umdProduction: {
options: {
format: 'umd',
moduleId: 'yourls-api',
moduleName: 'yourls',
sourceMap: true,
sourceMapRelativePaths: true,
banner: bannerSmall,
plugins: function() {
return [
nodeResolve({
browser: true,
jsnext: true,
main: true
}),
commonjs(),
uglify({
output: {
comments: function(node, comment) {
return comment.type === 'comment2' && /^\!/.test(comment.value)
}
}
})
]
}
},
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')
} else {
grunt.log.writeln('"eslint" task is disabled because Node.js version is <4! Please consider upgrading Node.js...')
}

grunt.loadNpmTasks('grunt-contrib-watch')

grunt.registerTask('default', [ 'build' ])
grunt.registerTask('build', buildTasks)
grunt.registerTask('compile', compileTasks)
grunt.registerTask('test', testTasks)
}
@@ -1,4 +1,4 @@
Copyright (C) 2011 Alasdair Mercer, http://neocotic.com/
Copyright (C) 2016 Alasdair Mercer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -16,4 +16,4 @@ 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.
SOFTWARE.
Oops, something went wrong.

0 comments on commit dff0803

Please sign in to comment.
You can’t perform that action at this time.