Initial commit.

This commit is contained in:
Julien Fontanet 2016-01-05 18:13:43 +01:00
commit 8098464f58
11 changed files with 283 additions and 0 deletions

View File

@ -0,0 +1,11 @@
{
"comments": false,
"compact": true,
"plugins": [
"transform-runtime"
],
"presets": [
"stage-0",
"es2015"
]
}

View File

@ -0,0 +1,65 @@
# http://EditorConfig.org
#
# Julien Fontanet's configuration
# https://gist.github.com/julien-f/8096213
# Top-most EditorConfig file.
root = true
# Common config.
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespaces = true
# CoffeeScript
#
# https://github.com/polarmobile/coffeescript-style-guide/blob/master/README.md
[*.{,lit}coffee]
indent_size = 2
indent_style = space
# Markdown
[*.{md,mdwn,mdown,markdown}]
indent_size = 4
indent_style = space
# Package.json
#
# This indentation style is the one used by npm.
[/package.json]
indent_size = 2
indent_style = space
# Jade
[*.jade]
indent_size = 2
indent_style = space
# JavaScript
#
# Two spaces seems to be the standard most common style, at least in
# Node.js (http://nodeguide.com/style.html#tabs-vs-spaces).
[*.js]
indent_size = 2
indent_style = space
# Less
[*.less]
indent_size = 2
indent_style = space
# Sass
#
# Style used for http://libsass.com
[*.s[ac]ss]
indent_size = 2
indent_style = space
# YAML
#
# Only spaces are allowed.
[*.yaml]
indent_size = 2
indent_style = space

View File

@ -0,0 +1,9 @@
/.nyc_output/
/bower_components/
/dist/
npm-debug.log
npm-debug.log.*
!node_modules/*
node_modules/*/

View File

@ -0,0 +1,5 @@
Error.stackTraceLimit = 100
try { require('trace') } catch (_) {}
try { require('clarify') } catch (_) {}
try { require('source-map-support/register') } catch (_) {}

View File

@ -0,0 +1 @@
--require ./.mocha.js

View File

@ -0,0 +1,10 @@
/examples/
example.js
example.js.map
*.example.js
*.example.js.map
/test/
/tests/
*.spec.js
*.spec.js.map

View File

@ -0,0 +1,9 @@
language: node_js
node_js:
- 'stable'
- '4'
- '0.12'
# Use containers.
# http://docs.travis-ci.com/user/workers/container-based-infrastructure/
sudo: false

View File

@ -0,0 +1,52 @@
# ${pkg.name} [![Build Status](https://travis-ci.org/${pkg.shortGitHubPath}.png?branch=master)](https://travis-ci.org/${pkg.shortGitHubPath})
> ${pkg.description}
## Install
Installation of the [npm package](https://npmjs.org/package/${pkg.name}):
```
> npm install --save ${pkg.name}
```
## Usage
**TODO**
## Development
### Installing dependencies
```
> npm install
```
### Compilation
The sources files are watched and automatically recompiled on changes.
```
> npm run dev
```
### Tests
```
> npm run test-dev
```
## Contributions
Contributions are *very* welcomed, either on the documentation or on
the code.
You may:
- report any [issue](${pkg.bugs})
you've encountered;
- fork and create a pull request.
## License
${pkg.license} © [${pkg.author.name}](${pkg.author.url})

View File

@ -0,0 +1,61 @@
{
"private": true,
"name": "xo-server-usage-report",
"version": "0.0.0",
"license": "ISC",
"description": "",
"keywords": [],
"homepage": "",
"bugs": "",
"repository": {
"type": "git",
"url": ""
},
"author": {
"name": "Julien Fontanet",
"email": "julien.fontanet@isonoe.net"
},
"preferGlobal": false,
"main": "dist/",
"bin": {},
"files": [
"dist/"
],
"engines": {
"node": ">=0.12"
},
"dependencies": {
"babel-runtime": "^6.3.19"
},
"devDependencies": {
"babel-cli": "^6.3.17",
"babel-eslint": "^5.0.0-beta6",
"babel-plugin-transform-runtime": "^6.3.13",
"babel-preset-es2015": "^6.3.13",
"babel-preset-stage-0": "^6.3.13",
"clarify": "^1.0.5",
"dependency-check": "^2.5.1",
"mocha": "^2.3.4",
"must": "^0.13.1",
"nyc": "^5.2.0",
"source-map-support": "^0.4.0",
"standard": "^5.4.1",
"trace": "^2.0.2"
},
"scripts": {
"build": "babel --source-maps --out-dir=dist/ src/",
"depcheck": "dependency-check ./package.json",
"dev": "babel --watch --source-maps --out-dir=dist/ src/",
"dev-test": "mocha --opts .mocha.opts --watch --reporter=min \"dist/**/*.spec.js\"",
"lint": "standard",
"posttest": "npm run lint && npm run depcheck",
"prepublish": "npm run build",
"test": "nyc mocha --opts .mocha.opts \"dist/**/*.spec.js\""
},
"standard": {
"ignore": [
"dist/**"
],
"parser": "babel-eslint"
}
}

View File

@ -0,0 +1,47 @@
export const configurationSchema = {
type: 'object',
properties: {
emails: {
type: 'array',
items: {
type: 'string'
}
},
periodicity: {
enum: [ 'weekly', 'monthly' ]
}
},
additionalProperties: false,
required: [ 'emails', 'periodicity' ]
}
// ===================================================================
class UsageReportPlugin {
constructor (xo) {
this._xo = xo
this._unset = null
}
configure () {
// TODO
}
load () {
// TODO
this._unset = this._xo.api.addMethod('generateUsageReport', () => {
return 'toto'
})
}
unload () {
this._unset()
}
}
// ===================================================================
export default ({ xo }) => new UsageReportPlugin(xo)

View File

@ -0,0 +1,13 @@
/* eslint-env mocha */
import expect from 'must'
// ===================================================================
import myLib from './'
// ===================================================================
describe('myLib', () => {
// TODO
})