From 7dc09313dd8babaaa1384df35d77fed44a5aea22 Mon Sep 17 00:00:00 2001 From: Jeff Escalante Date: Mon, 9 May 2016 19:08:47 -0400 Subject: [PATCH 1/4] update to node 6 and boost deps to latest roots --- .babelrc | 3 --- LICENSE.md | 2 +- Makefile | 12 ------------ README.md | 6 +++--- contributing.md | 8 +++----- lib/index.js | 20 ++++++++++---------- package.json | 40 ++++++++++++++++------------------------ test/index.js | 12 ++++++------ 8 files changed, 39 insertions(+), 64 deletions(-) delete mode 100644 .babelrc delete mode 100644 Makefile diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 0558174..0000000 --- a/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["es2015", "stage-2"] -} diff --git a/LICENSE.md b/LICENSE.md index 719cc3f..0ec5b67 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,7 +1,7 @@ License (MIT) ------------- -Copyright (c) 2015 carrot +Copyright (c) 2015 Jeff Escalante, Carrot Creative 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: diff --git a/Makefile b/Makefile deleted file mode 100644 index 3e7053b..0000000 --- a/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -build: - cp -R lib src - babel src --out-dir lib - -unbuild: - rm -rf lib - mv src lib - -publish: - make build - npm publish . - make unbuild \ No newline at end of file diff --git a/README.md b/README.md index 8b23e29..0d592c8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# roots-mini-records +# Roots Mini Records [![npm](http://img.shields.io/npm/v/roots-mini-records.svg?style=flat)](https://badge.fury.io/js/roots-mini-records) [![tests](http://img.shields.io/travis/carrot/roots-mini-records/master.svg?style=flat)](https://travis-ci.org/carrot/roots-mini-records) [![dependencies](http://img.shields.io/gemnasium/carrot/roots-mini-records.svg?style=flat)](https://david-dm.org/carrot/roots-mini-records) @@ -17,9 +17,9 @@ Install into your project with `npm i roots-mini-records -S`. Then load it up as a plugin in `app.js` like this: ```js -import RecordsPlugin from 'roots-mini-records' +const RecordsPlugin = require('roots-mini-records') -export default { +module.exports = { plugins: [new RecordsPlugin({ test: { file: 'data.json' } })] } ``` diff --git a/contributing.md b/contributing.md index 8e495c3..60b8df6 100644 --- a/contributing.md +++ b/contributing.md @@ -9,19 +9,17 @@ If you are opening an issue about a bug, make sure that you include clear steps ### Getting Set Up - Clone the project down -- Make sure [nodejs](http://nodejs.org) has been installed and is above version `5.2.x` +- Make sure [nodejs](http://nodejs.org) has been installed and is above version `6.0.0` - Run `npm install` - Put in work ### Testing -This project is constantly evolving, and to ensure that things are secure and working for everyone, we need to have tests. If you are adding a new feature, please make sure to add a test for it. The test suite for this project uses [mocha](http://visionmedia.github.io/mocha/) and [should](https://github.com/visionmedia/should.js/)/ - -To run the test suite, make sure you have installed mocha (`npm install mocha -g`), then you can use the `npm test` or simply `mocha` command to run the tests. +You can run the tests with `npm test`. They are written using [ava](https://github.com/sindresorhus/ava). ### Code Style -This project uses ES6, transpiled by babel for tests and on deploy. To keep a consistent coding style in the project, we are using [standard js](http://standardjs.com/). In order for tests to pass, all code must pass standard js linting. This project also uses an [editorconfig](http://editorconfig.org/). It will make life much easier if you have the [editorconfig plugin](http://editorconfig.org/#download) for your text editor. For any inline documentation in the code, we're using [JSDoc](http://usejsdoc.org/). +This project uses ES6 directly through node >= v6. To keep a consistent coding style in the project, we are using [standard js](http://standardjs.com/). In order for tests to pass, all code must pass standard js linting. This project also uses an [editorconfig](http://editorconfig.org/). It will make life much easier if you have the [editorconfig plugin](http://editorconfig.org/#download) for your text editor. For any inline documentation in the code, we're using [JSDoc](http://usejsdoc.org/). ### Commit Cleanliness diff --git a/lib/index.js b/lib/index.js index f983ac9..45ca916 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,15 +1,15 @@ -import W from 'when' -import keys from 'when/keys' -import node from 'when/node' -import rest from 'rest' -import fs from 'fs' -import path from 'path' -import R from 'ramda' -import jade from 'jade' -import mkdirp from 'mkdirp' +const W = require('when') +const keys = require('when/keys') +const node = require('when/node') +const rest = require('rest') +const fs = require('fs') +const path = require('path') +const R = require('ramda') +const jade = require('jade') +const mkdirp = require('mkdirp') // this needs to be a function that returns a function -export default class Records { +module.exports = class Records { constructor (opts) { this.opts = opts } diff --git a/package.json b/package.json index ed740b5..2fe68a2 100644 --- a/package.json +++ b/package.json @@ -1,39 +1,31 @@ { "name": "roots-mini-records", + "description": "remote data > static templates", "version": "0.0.4", - "description": "remote data > static templates", - "main": "lib", - "scripts": { - "test": "ava" - }, "author": "carrot", - "license": "MIT", - "babel": { - "presets": [ - "es2015-node5" - ] - }, - "devDependencies": { - "ava": "0.13.x", - "babel-cli": "6.x", - "babel-core": "6.x", - "babel-preset-es2015": "6.x", - "rimraf": "^2.5.2", - "roots-mini": "0.0.13", - "standard": "5.x" - }, "ava": { - "require": [ - "babel-core/register" - ], "verbose": "true", "serial": "true" }, "dependencies": { "jade": "^1.11.0", "mkdirp": "^0.5.1", - "ramda": "^0.20.1", + "ramda": "^0.21.0", "rest": "^1.3.2", "when": "^3.7.7" + }, + "devDependencies": { + "ava": "^0.14.0", + "rimraf": "^2.5.2", + "roots-mini": "0.0.23", + "standard": "^7.0.1" + }, + "engines": { + "node": ">= 6.0.0" + }, + "license": "MIT", + "main": "lib", + "scripts": { + "test": "ava" } } diff --git a/test/index.js b/test/index.js index 35ba930..9620f54 100644 --- a/test/index.js +++ b/test/index.js @@ -1,9 +1,9 @@ -import test from 'ava' -import Roots from 'roots-mini' -import path from 'path' -import fs from 'fs' -import Records from '..' -import rimraf from 'rimraf' +const test = require('ava') +const Roots = require('roots-mini') +const path = require('path') +const fs = require('fs') +const Records = require('..') +const rimraf = require('rimraf') const fixturesPath = path.join(__dirname, 'fixtures') From 9dadaad7e30e5277dd808cac0a3d5869ae9e6152 Mon Sep 17 00:00:00 2001 From: kylemac Date: Tue, 10 May 2016 08:13:06 -0400 Subject: [PATCH 2/4] update travis to use node 6 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7f7ace0..37c4918 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ language: node_js sudo: false node_js: - - 5.2 + - 6 From 1ffb020a43107802f625d41cf3d4b53971185e36 Mon Sep 17 00:00:00 2001 From: Jeff Escalante Date: Tue, 10 May 2016 10:02:21 -0400 Subject: [PATCH 3/4] add coveralls --- .gitignore | 3 ++- .travis.yml | 2 ++ README.md | 3 ++- package.json | 6 +++++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 28f1ba7..6f9fe6b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules -.DS_Store \ No newline at end of file +.DS_Store +.nyc_output diff --git a/.travis.yml b/.travis.yml index 37c4918..5bbca54 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,3 +2,5 @@ language: node_js sudo: false node_js: - 6 +after_script: + - npm run coveralls diff --git a/README.md b/README.md index 0d592c8..09d253e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Roots Mini Records -[![npm](http://img.shields.io/npm/v/roots-mini-records.svg?style=flat)](https://badge.fury.io/js/roots-mini-records) [![tests](http://img.shields.io/travis/carrot/roots-mini-records/master.svg?style=flat)](https://travis-ci.org/carrot/roots-mini-records) [![dependencies](http://img.shields.io/gemnasium/carrot/roots-mini-records.svg?style=flat)](https://david-dm.org/carrot/roots-mini-records) +[![npm](http://img.shields.io/npm/v/roots-mini-records.svg?style=flat)](https://badge.fury.io/js/roots-mini-records) [![tests](http://img.shields.io/travis/carrot/roots-mini-records/master.svg?style=flat)](https://travis-ci.org/carrot/roots-mini-records) [![dependencies](http://img.shields.io/david/carrot/roots-mini-records.svg?style=flat)](https://david-dm.org/carrot/roots-mini-records) +[![coverage](http://img.shields.io/coveralls/carrot/roots-mini-records.svg?style=flat)](https://coveralls.io/github/carrot/roots-mini-rooftop?branch=master) remote data -> static templates diff --git a/package.json b/package.json index 2fe68a2..1c26305 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,8 @@ }, "devDependencies": { "ava": "^0.14.0", + "coveralls": "^2.11.9", + "nyc": "^6.4.4", "rimraf": "^2.5.2", "roots-mini": "0.0.23", "standard": "^7.0.1" @@ -26,6 +28,8 @@ "license": "MIT", "main": "lib", "scripts": { - "test": "ava" + "test": "ava", + "coverage": "nyc ava", + "coveralls": "nyc --reporter=lcov ava && cat ./coverage/lcov.info | coveralls" } } From 186419db91d91a2d6dcef4c57d31681a33559cb0 Mon Sep 17 00:00:00 2001 From: Jeff Escalante Date: Tue, 10 May 2016 10:07:47 -0400 Subject: [PATCH 4/4] badge correction --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 09d253e..1ece246 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Roots Mini Records [![npm](http://img.shields.io/npm/v/roots-mini-records.svg?style=flat)](https://badge.fury.io/js/roots-mini-records) [![tests](http://img.shields.io/travis/carrot/roots-mini-records/master.svg?style=flat)](https://travis-ci.org/carrot/roots-mini-records) [![dependencies](http://img.shields.io/david/carrot/roots-mini-records.svg?style=flat)](https://david-dm.org/carrot/roots-mini-records) -[![coverage](http://img.shields.io/coveralls/carrot/roots-mini-records.svg?style=flat)](https://coveralls.io/github/carrot/roots-mini-rooftop?branch=master) +[![coverage](http://img.shields.io/coveralls/carrot/roots-mini-records.svg?style=flat)](https://coveralls.io/github/carrot/roots-mini-records?branch=master) remote data -> static templates