From 16d2e1497470901fe16d341dd7b95d19db56929c Mon Sep 17 00:00:00 2001 From: Aleksey Tsvetkov Date: Thu, 6 Oct 2016 18:27:23 +0300 Subject: [PATCH] Fix publish script --- .babelrc | 3 ++- package.json | 11 ++++++----- src/apps/index.js | 2 +- {config => src/config}/stable-api-apps.json | 0 {config => src/config}/stable-api.json | 0 src/extensions/index.js | 2 +- test/plugins/cookie/cookies.get.test.js | 2 +- test/plugins/cookie/cookies.getAll.test.js | 2 +- test/plugins/cookie/cookies.remove.test.js | 2 +- test/plugins/cookie/cookies.set.test.js | 2 +- test/plugins/cookie/cookies.test.js | 2 +- test/plugins/i18n/i18n.test.js | 2 +- 12 files changed, 16 insertions(+), 14 deletions(-) rename {config => src/config}/stable-api-apps.json (100%) rename {config => src/config}/stable-api.json (100%) diff --git a/.babelrc b/.babelrc index c13c5f6..ad0ec08 100644 --- a/.babelrc +++ b/.babelrc @@ -1,3 +1,4 @@ { - "presets": ["es2015"] + "presets": ["es2015"], + "plugins": ["add-module-exports"] } diff --git a/package.json b/package.json index cba2fd2..da76e7b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sinon-chrome", - "version": "2.0.0", + "version": "2.0.3", "description": "Mock of chrome extensions API for unit testing under nodejs", "homepage": "https://github.com/acvetkov/sinon-chrome", "author": { @@ -33,17 +33,18 @@ }, "main": "out/index.js", "scripts": { - "clean": "rm -rf ./out/ && rm -rf ./coverage/", + "clean": "rm -rf ./out/", "lint": "eslint ./src ./test", "test": "mocha --recursive --compilers js:babel-register --require ./test/setup.js", "test-navigate": "mocha --compilers js:babel-register examples/navigate.test.js", "test-events": "mocha --compilers js:babel-register examples/events.test.js", "test-then": "mocha --compilers js:babel-register examples/then-chrome.test.js", "transpile": "babel ./src --out-dir ./out", - "build": "npm run clean && npm run transpile && webpack", - "prepublish": "npm run lint && npm test && npm run build", + "build": "npm run clean && npm run transpile && webpack && cp -R ./src/config out/config", + "predeploy": "npm run clean && npm run lint && npm test && npm run build && npm run copy2out", "bundle": "webpack", - "bundle-dev": "webpack --watch --progress" + "bundle-dev": "webpack --watch --progress", + "copy2out": "cp ./README.md ./out/README.md && cp ./package.json ./out/package.json" }, "license": "ISC", "dependencies": { diff --git a/src/apps/index.js b/src/apps/index.js index bf2b05d..fb16d65 100644 --- a/src/apps/index.js +++ b/src/apps/index.js @@ -3,7 +3,7 @@ * @overview Apps entry point */ -import config from '../../config/stable-api-apps.json'; +import config from '../config/stable-api-apps.json'; import Api from '../api'; export default new Api(config).create(); diff --git a/config/stable-api-apps.json b/src/config/stable-api-apps.json similarity index 100% rename from config/stable-api-apps.json rename to src/config/stable-api-apps.json diff --git a/config/stable-api.json b/src/config/stable-api.json similarity index 100% rename from config/stable-api.json rename to src/config/stable-api.json diff --git a/src/extensions/index.js b/src/extensions/index.js index f99159a..0b3f78e 100644 --- a/src/extensions/index.js +++ b/src/extensions/index.js @@ -3,7 +3,7 @@ * @overview Extensions entry point */ -import config from '../../config/stable-api.json'; +import config from '../config/stable-api.json'; import Api from '../api'; export default new Api(config).create(); diff --git a/test/plugins/cookie/cookies.get.test.js b/test/plugins/cookie/cookies.get.test.js index 697b7da..bab4906 100644 --- a/test/plugins/cookie/cookies.get.test.js +++ b/test/plugins/cookie/cookies.get.test.js @@ -2,7 +2,7 @@ import _ from 'lodash'; import CookiesPlugin from '../../../src/plugins/cookies'; import state from '../data/cookie-state.json'; -import config from '../../../config/stable-api.json'; +import config from '../../../src/config/stable-api.json'; import Api from '../../../src/api'; describe('plugins/cookies/get', function () { diff --git a/test/plugins/cookie/cookies.getAll.test.js b/test/plugins/cookie/cookies.getAll.test.js index 3907574..03dbadd 100644 --- a/test/plugins/cookie/cookies.getAll.test.js +++ b/test/plugins/cookie/cookies.getAll.test.js @@ -1,6 +1,6 @@ import CookiesPlugin from '../../../src/plugins/cookies'; import state from '../data/cookie-state.json'; -import config from '../../../config/stable-api.json'; +import config from '../../../src/config/stable-api.json'; import Api from '../../../src/api'; describe('plugins/cookies/getAll', function () { diff --git a/test/plugins/cookie/cookies.remove.test.js b/test/plugins/cookie/cookies.remove.test.js index 0c75a30..d640d54 100644 --- a/test/plugins/cookie/cookies.remove.test.js +++ b/test/plugins/cookie/cookies.remove.test.js @@ -3,7 +3,7 @@ import _ from 'lodash'; import CookiesPlugin from '../../../src/plugins/cookies'; import state from '../data/cookie-state.json'; -import config from '../../../config/stable-api.json'; +import config from '../../../src/config/stable-api.json'; import Api from '../../../src/api'; describe('plugins/cookies/remove', function () { diff --git a/test/plugins/cookie/cookies.set.test.js b/test/plugins/cookie/cookies.set.test.js index a03338e..6622fe0 100644 --- a/test/plugins/cookie/cookies.set.test.js +++ b/test/plugins/cookie/cookies.set.test.js @@ -3,7 +3,7 @@ import _ from 'lodash'; import CookiesPlugin from '../../../src/plugins/cookies'; import state from '../data/cookie-state.json'; -import config from '../../../config/stable-api.json'; +import config from '../../../src/config/stable-api.json'; import Api from '../../../src/api'; describe('plugins/cookies/set', function () { diff --git a/test/plugins/cookie/cookies.test.js b/test/plugins/cookie/cookies.test.js index 818a9ad..5112c9e 100644 --- a/test/plugins/cookie/cookies.test.js +++ b/test/plugins/cookie/cookies.test.js @@ -1,6 +1,6 @@ import CookiesPlugin from '../../../src/plugins/cookies'; import * as is from '../../helpers/is'; -import config from '../../../config/stable-api.json'; +import config from '../../../src/config/stable-api.json'; import Api from '../../../src/api'; describe('plugins/cookies', function () { diff --git a/test/plugins/i18n/i18n.test.js b/test/plugins/i18n/i18n.test.js index 72b1ec8..d9aecc3 100644 --- a/test/plugins/i18n/i18n.test.js +++ b/test/plugins/i18n/i18n.test.js @@ -1,7 +1,7 @@ import I18nPlugin from '../../../src/plugins/i18n'; import * as is from '../../helpers/is'; import mockTranslations from './translations.json'; -import config from '../../../config/stable-api.json'; +import config from '../../../src/config/stable-api.json'; import Api from '../../../src/api'; describe('plugins/i18n', function () {