Skip to content

Commit

Permalink
boiler plate
Browse files Browse the repository at this point in the history
  • Loading branch information
pghalliday committed Feb 27, 2017
0 parents commit f96bfdd
Show file tree
Hide file tree
Showing 12 changed files with 131 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"presets": ["env"],
"env": {
"test": {
"plugins": ["istanbul"]
}
}
}
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/node_modules/
/coverage/
/lib/
14 changes: 14 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -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'
}
};
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/npm-debug.log
/node_modules/
/coverage/
/.nyc_output/
.DS_Store
16 changes: 16 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -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
}
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: node_js
node_js:
- '5'
- '6'
- 'stable'
script: npm run ci
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
'use strict';

Object.defineProperty(exports, "__esModule", {
value: true
});

exports.default = function () {
return 'hello world';
};

;
41 changes: 41 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -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 <pghalliday@gmail.com> (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"
}
}
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function() {
return 'hello world';
};
1 change: 1 addition & 0 deletions test/mocha.opts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--recursive
10 changes: 10 additions & 0 deletions test/src/index.js
Original file line number Diff line number Diff line change
@@ -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');
});
});

0 comments on commit f96bfdd

Please sign in to comment.