From 454dd69b5333c6e1739e9dffb7f0fc0a58dc0629 Mon Sep 17 00:00:00 2001 From: Aaron Jensen Date: Fri, 31 Jul 2015 08:53:25 -0700 Subject: [PATCH] Initial commit w/ yo node --- .babelrc | 1 + .editorconfig | 11 +++++++++ .eslintrc | 21 ++++++++++++++++ .gitattributes | 1 + .gitignore | 3 +++ .travis.yml | 6 +++++ LICENSE.txt | 22 +++++++++++++++++ README.md | 32 ++++++++++++++++++++++++ gulpfile.js | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++ lib/index.js | 2 ++ package.json | 28 ++++++++++++++++----- test/index.js | 9 +++++++ 12 files changed, 197 insertions(+), 6 deletions(-) create mode 100644 .babelrc create mode 100644 .editorconfig create mode 100644 .eslintrc create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 LICENSE.txt create mode 100644 README.md create mode 100644 gulpfile.js create mode 100644 lib/index.js create mode 100644 test/index.js diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/.babelrc @@ -0,0 +1 @@ +{} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..beffa30 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..9c7ed24 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,21 @@ +{ + "ecmaFeatures": { + "modules": true + }, + "env": { + "es6": true + }, + "rules": { + "strict": [2, "global"], + "quotes": [2, "single"], + "indent": [2, 2], + "one-var": [2, "never"], + "consistent-return": 0, + "no-use-before-define": [2, "nofunc"], + "space-before-function-paren": [2, {anonymous: "always", named: "never"}] + }, + "env": { + "node": true, + "mocha": true + } +} diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..176a458 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9c62828 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +node_modules +coverage +dist diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..b0c6a8d --- /dev/null +++ b/.travis.yml @@ -0,0 +1,6 @@ +sudo: false +language: node_js +node_js: + - '0.10' + - '0.12' + - 'iojs' diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..d9f80bf --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright (c) 2015 Aaron Jensen + +MIT License + +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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..ab7908b --- /dev/null +++ b/README.md @@ -0,0 +1,32 @@ +# updeep [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url] +> [WIP: do not use] Easily update immutable objects (frozen or not) in a declarative way. + + +## Install + +```sh +$ npm install --save updeep +``` + + +## Usage + +```js +var updeep = require('updeep'); + +updeep('Rainbow'); +``` + +## License + +MIT © [Aaron Jensen]() + + +[npm-image]: https://badge.fury.io/js/updeep.svg +[npm-url]: https://npmjs.org/package/updeep +[travis-image]: https://travis-ci.org//updeep.svg?branch=master +[travis-url]: https://travis-ci.org//updeep +[daviddm-image]: https://david-dm.org//updeep.svg?theme=shields.io +[daviddm-url]: https://david-dm.org//updeep +[coveralls-image]: https://coveralls.io/repos//updeep/badge.svg +[coveralls-url]: https://coveralls.io/r//updeep diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..1a73bd9 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,67 @@ +'use strict'; +var path = require('path'); +var gulp = require('gulp'); +var eslint = require('gulp-eslint'); +var excludeGitignore = require('gulp-exclude-gitignore'); +var mocha = require('gulp-mocha'); +var istanbul = require('gulp-istanbul'); +var nsp = require('gulp-nsp'); +var plumber = require('gulp-plumber'); +var coveralls = require('gulp-coveralls'); +var babel = require('gulp-babel'); + +// Initialize the babel transpiler so ES2015 files gets compiled +// when they're loaded +require('babel-core/register'); + +gulp.task('static', function () { + return gulp.src('**/*.js') + .pipe(excludeGitignore()) + .pipe(eslint()) + .pipe(eslint.format()) + .pipe(eslint.failAfterError()) +}); + +gulp.task('nsp', function (cb) { + nsp('package.json', cb); +}); + +gulp.task('pre-test', function () { + return gulp.src('lib/**/*.js') + .pipe(babel()) + .pipe(istanbul({includeUntested: true})) + .pipe(istanbul.hookRequire()); +}); + +gulp.task('test', ['pre-test'], function (cb) { + var mochaErr; + + gulp.src('test/**/*.js') + .pipe(plumber()) + .pipe(mocha({reporter: 'spec'})) + .on('error', function (err) { + mochaErr = err; + }) + .pipe(istanbul.writeReports()) + .on('end', function () { + cb(mochaErr); + }); +}); + +gulp.task('coveralls', ['test'], function () { + if (!process.env.CI) { + return; + } + + return gulp.src(path.join(__dirname, 'coverage/lcov.info')) + .pipe(coveralls()); +}); + +gulp.task('babel', function () { + return gulp.src('lib/**/*.js') + .pipe(babel()) + .pipe(gulp.dest('dist')); +}); + +gulp.task('prepublish', ['nsp', 'babel']); +gulp.task('default', ['static', 'test', 'coveralls']); diff --git a/lib/index.js b/lib/index.js new file mode 100644 index 0000000..8552ad9 --- /dev/null +++ b/lib/index.js @@ -0,0 +1,2 @@ +'use strict'; +export default {}; diff --git a/package.json b/package.json index 4a2c04f..a5a9569 100644 --- a/package.json +++ b/package.json @@ -2,24 +2,40 @@ "name": "updeep", "version": "0.0.0", "description": "[WIP: do not use] Easily update immutable objects (frozen or not) in a declarative way.", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, + "homepage": "https://github.com/aaronjensen/updeep", "repository": { "type": "git", "url": "https://github.com/aaronjensen/updeep" }, + "author": "Aaron Jensen", + "files": [ + "dist" + ], + "main": "index.js", "keywords": [ "immutable", "frozen", "functional", "declarative" ], - "author": "Aaron Jensen", + "scripts": { + "test": "gulp", + "prepublish": "gulp prepublish" + }, "license": "MIT", "bugs": { "url": "https://github.com/aaronjensen/updeep/issues" }, - "homepage": "https://github.com/aaronjensen/updeep" + "devDependencies": { + "gulp": "^3.6.0", + "gulp-exclude-gitignore": "^1.0.0", + "gulp-istanbul": "^0.9.0", + "gulp-eslint": "^0.15.0", + "gulp-mocha": "^2.0.0", + "gulp-plumber": "^1.0.0", + "gulp-nsp": "^0.4.5", + "gulp-coveralls": "^0.1.0", + "gulp-babel": "^5.1.0", + "babel-core": "^5.5.0" + } } diff --git a/test/index.js b/test/index.js new file mode 100644 index 0000000..bb5d3ce --- /dev/null +++ b/test/index.js @@ -0,0 +1,9 @@ +'use strict'; +import assert from 'assert'; +import updeep from '../lib'; + +describe('updeep', function () { + it('should have unit test!', function () { + assert(false, 'we expected this package author to add actual unit tests.'); + }); +});