Skip to content

Commit

Permalink
feat(package): added docs, tests with travis, package details, contri…
Browse files Browse the repository at this point in the history
…butors
  • Loading branch information
Ahmad Nassri committed Dec 4, 2016
1 parent 86bfbd0 commit 080628c
Show file tree
Hide file tree
Showing 25 changed files with 167 additions and 46 deletions.
17 changes: 17 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
engines:
fixme:
enabled: true

duplication:
enabled: true
config:
languages:
- javascript

eslint:
enabled: true

ratings:
paths:
- lib/**
- test/**
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# http://editorconfig.org
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
*.log
/lib
/node_modules
/.nyc_output

.DS_Store
26 changes: 25 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,28 @@ language: node_js

node_js:
- 4
- 5
- 6
- 7

env:
- BABEL_ENV=test

matrix:
fast_finish: true

cache:
directories:
- node_modules

before_script:
- npm prune

after_success:
- npm run coverage
- npm run codeclimate
- npm run semantic-release

branches:
except:
- /^v\d+\.\d+\.\d+$/
- /^greenkeeper\/.+/
13 changes: 13 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright (c) 2015, Ahmad Nassri <[email protected]>

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
50 changes: 47 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,49 @@
# HAR Schema [![npm version](https://badge.fury.io/js/har-schema.svg)](https://www.npmjs.com/package/har-schema)
# HAR Schema [![version][npm-version]][npm-url] [![License][npm-license]][license-url]

JSON Schema for HTTP Archive ([HAR](http://www.softwareishard.com/blog/har-12-spec/)).
> JSON Schema for HTTP Archive ([HAR][spec]).
[![Build Status](https://travis-ci.org/epoberezkin/har-schema.svg?branch=master)](https://travis-ci.org/epoberezkin/har-schema)
[![Build Status][travis-image]][travis-url]
[![Downloads][npm-downloads]][npm-url]
[![Code Climate][codeclimate-quality]][codeclimate-url]
[![Coverage Status][codeclimate-coverage]][codeclimate-url]
[![Dependency Status][dependencyci-image]][dependencyci-url]
[![Dependencies][david-image]][david-url]

## Install

```bash
npm install --only=production --save har-schema
```

## Usage

Compatible with any [JSON Schema validation tool][validator].

----
> :copyright: [ahmadnassri.com](https://www.ahmadnassri.com/) &nbsp;&middot;&nbsp;
> License: [ISC][license-url] &nbsp;&middot;&nbsp;
> Github: [@ahmadnassri](https://github.com/ahmadnassri) &nbsp;&middot;&nbsp;
> Twitter: [@ahmadnassri](https://twitter.com/ahmadnassri)
[license-url]: http://choosealicense.com/licenses/isc/

[travis-url]: https://travis-ci.org/ahmadnassri/har-schema
[travis-image]: https://img.shields.io/travis/ahmadnassri/har-schema.svg?style=flat-square

[npm-url]: https://www.npmjs.com/package/har-schema
[npm-license]: https://img.shields.io/npm/l/har-schema.svg?style=flat-square
[npm-version]: https://img.shields.io/npm/v/har-schema.svg?style=flat-square
[npm-downloads]: https://img.shields.io/npm/dm/har-schema.svg?style=flat-square

[codeclimate-url]: https://codeclimate.com/github/ahmadnassri/har-schema
[codeclimate-quality]: https://img.shields.io/codeclimate/github/ahmadnassri/har-schema.svg?style=flat-square
[codeclimate-coverage]: https://img.shields.io/codeclimate/coverage/github/ahmadnassri/har-schema.svg?style=flat-square

[david-url]: https://david-dm.org/ahmadnassri/har-schema
[david-image]: https://img.shields.io/david/ahmadnassri/har-schema.svg?style=flat-square

[dependencyci-url]: https://dependencyci.com/github/ahmadnassri/har-schema
[dependencyci-image]: https://dependencyci.com/github/ahmadnassri/har-schema/badge?style=flat-square

[spec]: https://github.com/ahmadnassri/har-spec/blob/master/versions/1.2.md
[validator]: https://github.com/ahmadnassri/har-validator
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions schema/index.js → lib/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';
'use strict'

module.exports = {
cache: require('./cache.json'),
Expand All @@ -17,4 +17,4 @@ module.exports = {
request: require('./request.json'),
response: require('./response.json'),
timings: require('./timings.json')
};
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
50 changes: 35 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"version": "0.0.0-development",
"name": "har-schema",
"version": "0.1.0",
"description": "JSON Schema for HTTP Archive (HAR)",
"main": "schema/index.js",
"directories": {
"test": "test"
},
"scripts": {
"test": "mocha test/*.js -R spec"
},
"author": "Ahmad Nassri <[email protected]> (https://www.ahmadnassri.com/)",
"contributors": [
"Evgeny Poberezkin <[email protected]>"
],
"homepage": "https://github.com/ahmadnassri/har-schema",
"repository": {
"type": "git",
"url": "git+https://github.com/epoberezkin/har-schema.git"
"url": "https://github.com/ahmadnassri/har-schema.git"
},
"license": "ISC",
"main": "lib/index.js",
"keywords": [
"har",
"http",
Expand All @@ -21,14 +21,34 @@
"schema",
"JSON-schema"
],
"author": "Ahmad Nassri <[email protected]> (https://www.ahmadnassri.com/)",
"license": "ISC",
"engines": {
"node": ">=4"
},
"files": [
"lib"
],
"bugs": {
"url": "https://github.com/epoberezkin/har-schema/issues"
"url": "https://github.com/ahmadnassri/har-schema/issues"
},
"scripts": {
"test": "tap test --reporter spec",
"pretest": "snazzy && echint",
"coverage": "tap test --reporter silent --coverage",
"codeclimate": "tap --coverage-report=text-lcov | codeclimate-test-reporter",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"homepage": "https://github.com/epoberezkin/har-schema#readme",
"devDependencies": {
"ajv": "^4.1.7",
"mocha": "^2.5.3"
"ajv": "^4.9.1",
"codeclimate-test-reporter": "^0.4.0",
"cz-conventional-changelog": "^1.2.0",
"echint": "^2.0.0",
"semantic-release": "^6.3.5",
"snazzy": "^5.0.0",
"tap": "^8.0.1"
}
}
15 changes: 15 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict'

const schemas = require('../lib')
const Ajv = require('ajv')
const tap = require('tap')

tap.test('har-schema', (assert) => {
const ajv = new Ajv()
const keys = Object.keys(schemas)

assert.plan(keys.length * 2)

keys.forEach((key) => assert.doesNotThrow(ajv.addSchema(schemas[key])))
keys.forEach((key) => assert.type(ajv.compile(schemas[key]), 'function'))
})
22 changes: 0 additions & 22 deletions test/schema.js

This file was deleted.

0 comments on commit 080628c

Please sign in to comment.