From ccd63ed9f635627d64e33d0f86f250462e5c02c8 Mon Sep 17 00:00:00 2001 From: Camel Aissani Date: Tue, 28 Jun 2016 13:36:39 +0200 Subject: [PATCH] exposed project as an NPM package --- .npmignore | 2 ++ frontexpress.js => lib/frontexpress.js | 6 +++--- package.json | 10 ++++++++-- test/application-test.js | 2 +- test/router-test.js | 2 +- 5 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 .npmignore rename frontexpress.js => lib/frontexpress.js (56%) diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..d9bc7a4 --- /dev/null +++ b/.npmignore @@ -0,0 +1,2 @@ +test +coverage \ No newline at end of file diff --git a/frontexpress.js b/lib/frontexpress.js similarity index 56% rename from frontexpress.js rename to lib/frontexpress.js index f978d26..887b08d 100755 --- a/frontexpress.js +++ b/lib/frontexpress.js @@ -1,6 +1,6 @@ -import Application from './lib/application'; -import Router from './lib/router'; -import Middleware from './lib/middleware'; +import Application from './application'; +import Router from './router'; +import Middleware from './middleware'; function frontexpress() { return new Application(); diff --git a/package.json b/package.json index 157655e..c56df7b 100644 --- a/package.json +++ b/package.json @@ -2,13 +2,18 @@ "name": "frontexpress", "version": "1.0.0", "description": "Minimalist front end router framework a la express", - "main": "frontexpress.js", + "main": "dits/frontexpress.js", "scripts": { + "lint": "eslint .", "only-test": "mocha --compilers js:babel-core/register", - "test": "babel-node node_modules/.bin/babel-istanbul cover node_modules/.bin/_mocha" + "test": "npm run lint && babel-node node_modules/.bin/babel-istanbul cover node_modules/.bin/_mocha", + "prepublish": "rimraf dist && babel lib -d dist" }, "author": "Camel Aissani (https://nuageprive.fr)", "license": "MIT", + "engines": { + "node": ">=0.10.0" + }, "repository": "camelaissani/frontexpress", "keywords": [ "front", @@ -38,6 +43,7 @@ "mocha": "^2.5.3", "mocha-jsdom": "^1.1.0", "rewire": "^2.5.1", + "rimraf": "^2.5.2", "sinon": "^1.17.4" } } diff --git a/test/application-test.js b/test/application-test.js index a8d2565..4bff350 100755 --- a/test/application-test.js +++ b/test/application-test.js @@ -1,7 +1,7 @@ /*eslint-env mocha*/ import {assert} from 'chai'; import sinon from 'sinon'; -import frontexpress from '../frontexpress'; +import frontexpress from '../lib/frontexpress'; import Requester from '../lib/requester'; describe('Application', () => { diff --git a/test/router-test.js b/test/router-test.js index d7985d0..9fba6dd 100755 --- a/test/router-test.js +++ b/test/router-test.js @@ -1,7 +1,7 @@ /*eslint-env mocha*/ import {assert} from 'chai'; import sinon from 'sinon'; -import frontexpress from '../frontexpress'; +import frontexpress from '../lib/frontexpress'; import {HTTP_METHODS} from '../lib/requester'; describe('Router', () => {