Kaynağa Gözat

Merge pull request #94 from blink1073/watch-example

Streamline the example watching
A. Darian 9 yıl önce
ebeveyn
işleme
19acd40e8d

+ 3 - 1
examples/filebrowser/package.json

@@ -5,7 +5,8 @@
     "build": "tsc --project src && webpack --config webpack.conf.js",
     "clean": "rimraf build && rimraf node_modules",
     "postinstall": "npm dedupe",
-    "update": "rimraf node_modules/jupyter-js-ui && npm install"
+    "update": "rimraf node_modules/jupyter-js-ui && npm install",
+    "watch": "watch 'npm run update && npm run build' ../../src src --wait 10"
   },
   "dependencies": {
     "jupyter-js-services": "^0.10.1",
@@ -20,6 +21,7 @@
     "rimraf": "^2.5.2",
     "style-loader": "^0.13.1",
     "typescript": "^1.8.10",
+    "watch": "^0.18.0",
     "webpack": "^1.13.0"
   }
 }

+ 3 - 1
examples/terminal/package.json

@@ -5,7 +5,8 @@
     "build": "tsc --project src && webpack --config webpack.conf.js",
     "clean": "rimraf build && rimraf node_modules",
     "postinstall": "npm dedupe",
-    "update": "rimraf node_modules/jupyter-js-ui && npm install"
+    "update": "rimraf node_modules/jupyter-js-ui && npm install",
+    "watch": "watch 'npm run update && npm run build' ../../src src --wait 10"
   },
   "dependencies": {
     "jupyter-js-ui": "file:../..",
@@ -16,6 +17,7 @@
     "rimraf": "^2.5.2",
     "style-loader": "^0.13.1",
     "typescript": "^1.8.10",
+    "watch": "^0.18.0",
     "webpack": "^1.13.0"
   }
 }

+ 6 - 6
package.json

@@ -53,19 +53,19 @@
     "clean:examples": "node scripts/cleanexamples.js",
     "build:examples": "node scripts/buildexamples.js",
     "build:src": "tsc --project src && node scripts/copycss.js",
-    "build:test": "cd test && tsc --project src && webpack --config webpack.conf.js",
-    "build": "npm run build:src && npm run build:test",
+    "build:test": "tsc --project test/src && webpack --config test/webpack.conf.js",
+    "build": "npm run build:src",
     "docs": "typedoc --mode modules --module commonjs --excludeNotExported --target es5 --moduleResolution node --out docs/ src",
     "prepublish": "npm run build",
     "postinstall": "npm dedupe",
     "test:chrome": "karma start --browsers=Chrome test/karma.conf.js",
-    "test:coverage": "cd test && webpack --config webpack-cov.conf.js && karma start karma-cov.conf.js",
+    "test:coverage": "npm run build:test && webpack --config test/webpack-cov.conf.js && karma start test/karma-cov.conf.js",
     "test:firefox": "karma start --browsers=Firefox test/karma.conf.js",
     "test:ie": "karma start --browsers=IE test/karma.conf.js",
     "test:debug": "karma start --browsers=Chrome --singleRun=false --debug=true test/karma.conf.js",
-    "test": "npm run test:firefox",
-    "watch:examples": "watch 'npm run build && npm run build:examples' src --wait 10",
-    "watch": "watch 'npm run build' src"
+    "test": "npm run build:test && npm run test:firefox",
+    "watch": "watch 'npm run build' src --wait 10",
+    "watch:test": "watch 'npm run build && npm test' src src/test --wait 10"
   },
   "repository": {
     "type": "git",

+ 1 - 1
test/webpack-cov.conf.js

@@ -1,7 +1,7 @@
 var path = require('path');
 
 module.exports = {
-  entry: './build/index.js',
+  entry: './test/build/index.js',
   output: {
     path: __dirname + "/build",
     filename: "coverage.js",

+ 1 - 1
test/webpack.conf.js

@@ -1,7 +1,7 @@
 var path = require('path');
 
 module.exports = {
-  entry: './build/index.js',
+  entry: './test/build/index.js',
   output: {
     path: __dirname + "/build",
     filename: "bundle.js",