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/.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 7f7ace0..5bbca54 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,6 @@ language: node_js sudo: false node_js: - - 5.2 + - 6 +after_script: + - npm run coveralls 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..1ece246 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ -# 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) +[![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-records?branch=master) remote data -> static templates @@ -17,9 +18,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..1c26305 100644 --- a/package.json +++ b/package.json @@ -1,39 +1,35 @@ { "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", + "coveralls": "^2.11.9", + "nyc": "^6.4.4", + "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", + "coverage": "nyc ava", + "coveralls": "nyc --reporter=lcov ava && cat ./coverage/lcov.info | coveralls" } } 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')