From f96bfdd8b8db02f67e48cbe083d26e41616ca1f5 Mon Sep 17 00:00:00 2001 From: Peter Halliday Date: Mon, 27 Feb 2017 01:37:36 +0100 Subject: [PATCH] boiler plate --- .babelrc | 8 ++++++++ .eslintignore | 3 +++ .eslintrc.js | 14 ++++++++++++++ .gitignore | 5 +++++ .nycrc | 16 ++++++++++++++++ .travis.yml | 6 ++++++ README.md | 13 +++++++++++++ lib/index.js | 11 +++++++++++ package.json | 41 +++++++++++++++++++++++++++++++++++++++++ src/index.js | 3 +++ test/mocha.opts | 1 + test/src/index.js | 10 ++++++++++ 12 files changed, 131 insertions(+) create mode 100644 .babelrc create mode 100644 .eslintignore create mode 100644 .eslintrc.js create mode 100644 .gitignore create mode 100644 .nycrc create mode 100644 .travis.yml create mode 100644 README.md create mode 100644 lib/index.js create mode 100644 package.json create mode 100644 src/index.js create mode 100644 test/mocha.opts create mode 100644 test/src/index.js diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..84b1bcc --- /dev/null +++ b/.babelrc @@ -0,0 +1,8 @@ +{ + "presets": ["env"], + "env": { + "test": { + "plugins": ["istanbul"] + } + } +} diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9d938c7 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,3 @@ +/node_modules/ +/coverage/ +/lib/ diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..3f6befc --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,14 @@ +module.exports = { + extends: 'google', + env: { + node: true, + es6: true + }, + rules: { + 'no-unused-vars': [2, {'args': 'after-used', 'argsIgnorePattern': '^_', 'varsIgnorePattern': '^_'}], + 'require-jsdoc': 0 + }, + parserOptions: { + sourceType: 'module' + } +}; diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bcd305d --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +/npm-debug.log +/node_modules/ +/coverage/ +/.nyc_output/ +.DS_Store diff --git a/.nycrc b/.nycrc new file mode 100644 index 0000000..4c3dad2 --- /dev/null +++ b/.nycrc @@ -0,0 +1,16 @@ +{ + "check-coverage": true, + "lines": 100, + "statements": 100, + "functions": 100, + "branches": 100, + "reporter": [ + "lcov", + "text" + ], + "require": [ + "babel-register" + ], + "sourceMap": false, + "instrument": false +} diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..04bea45 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +node_js: +- '5' +- '6' +- 'stable' +script: npm run ci diff --git a/README.md b/README.md new file mode 100644 index 0000000..59d7052 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# firegen + +[![Build Status](https://travis-ci.org/pghalliday/firegen.svg?branch=master)](https://travis-ci.org/pghalliday/firegen) +[![Coverage Status](https://coveralls.io/repos/github/pghalliday/firegen/badge.svg?branch=master)](https://coveralls.io/github/pghalliday/firegen?branch=master) + +Generate database rules and JavaScript APIs for Firebase projects + +## npm scripts + +- `npm test` - lint and test +- `npm run build` - run tests then build +- `npm run watch` - watch for changes and run build +- `npm run ci` - run build and submit coverage to coveralls diff --git a/lib/index.js b/lib/index.js new file mode 100644 index 0000000..a1719cf --- /dev/null +++ b/lib/index.js @@ -0,0 +1,11 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function () { + return 'hello world'; +}; + +; \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..e216fde --- /dev/null +++ b/package.json @@ -0,0 +1,41 @@ +{ + "name": "firegen", + "version": "1.0.0", + "description": "Generate database rules and JavaScript APIs for Firebase projects", + "main": "lib/index.js", + "scripts": { + "cmd:lint": "eslint .", + "cmd:test": "cross-env NODE_ENV=test nyc mocha", + "cmd:build": "babel src --out-dir lib", + "cmd:coveralls": "cat ./coverage/lcov.info | coveralls", + "test": "run-s cmd:lint cmd:test", + "build": "run-s test cmd:build", + "ci": "run-s build cmd:coveralls", + "watch": "chokidar '+(src|test)/**/*' -c 'npm run -s build'" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/pghalliday/firegen.git" + }, + "keywords": [], + "author": "Peter Halliday (http://pghalliday.com)", + "license": "ISC", + "bugs": { + "url": "https://github.com/pghalliday/firegen/issues" + }, + "homepage": "https://github.com/pghalliday/firegen#readme", + "devDependencies": { + "babel-cli": "^6.22.2", + "babel-plugin-istanbul": "^3.1.2", + "babel-preset-env": "^1.1.8", + "chai": "^3.5.0", + "chokidar-cli": "^1.2.0", + "coveralls": "^2.11.15", + "cross-env": "^3.1.4", + "eslint": "^3.14.1", + "eslint-config-google": "^0.7.1", + "mocha": "^3.2.0", + "npm-run-all": "^4.0.1", + "nyc": "^10.1.2" + } +} diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..d4bd59a --- /dev/null +++ b/src/index.js @@ -0,0 +1,3 @@ +export default function() { + return 'hello world'; +}; diff --git a/test/mocha.opts b/test/mocha.opts new file mode 100644 index 0000000..4a52320 --- /dev/null +++ b/test/mocha.opts @@ -0,0 +1 @@ +--recursive diff --git a/test/src/index.js b/test/src/index.js new file mode 100644 index 0000000..e7e3d9a --- /dev/null +++ b/test/src/index.js @@ -0,0 +1,10 @@ +import test from '../../src/index.js'; +import chai from 'chai'; + +chai.should(); + +describe('test', () => { + it('should pass', () => { + test().should.eql('hello world'); + }); +});