Browse Source

Update services examples

Steven Silvester 8 years ago
parent
commit
49a134bd6d

+ 1 - 0
.gitignore

@@ -23,3 +23,4 @@ __pycache__
 
 test/coverage
 docs
+packages/services/examples/node/config.json

+ 1 - 0
lerna.json

@@ -4,6 +4,7 @@
     "jupyterlab",
     "examples/*",
     "packages/*",
+    "packages/services/examples/*",
     "test"
   ],
   "version": "independent"

+ 1 - 1
package.json

@@ -87,7 +87,7 @@
     "watch": "^1.0.2",
     "webpack": "^2.2.1",
     "webpack-config": "^6.2.0",
-    "ws": "^1.0.1",
+    "ws": "^1.1.1",
     "xmlhttprequest": "^1.8.0",
     "xterm": "^2.4.0"
   }

+ 1 - 2
packages/services/examples/browser/index.ts

@@ -3,13 +3,12 @@
 |
 | Distributed under the terms of the Modified BSD License.
 |----------------------------------------------------------------------------*/
-'use strict';
 
 // Polyfill for ES6 Promises
 import 'es6-promise';
 
 import {
-  Session, utils
+  Session
 } from '@jupyterlab/services';
 
 

+ 4 - 6
packages/services/examples/browser/package.json

@@ -2,17 +2,15 @@
   "private": true,
   "name": "browser-example",
   "dependencies": {
-    "es6-promise": "^3.2.1",
-    "@jupyterlab/services": "file:../.."
+    "es6-promise": "^4.1.0",
+    "@jupyterlab/services": "^0.43.0"
   },
   "scripts": {
     "build": "tsc && webpack",
-    "clean": "rimraf build && rimraf node_modules",
-    "prepublish": "npm run build",
-    "update": "rimraf node_modules/@jupyterlab/services && npm install"
+    "clean": "rimraf build"
   },
   "devDependencies": {
     "rimraf": "^2.5.2",
-    "webpack": "^1.12.14"
+    "webpack": "^2.2.1"
   }
 }

+ 1 - 1
packages/services/examples/browser/webpack.config.js

@@ -4,5 +4,5 @@ module.exports = {
   output: {
     filename: './build/bundle.js'
   },
-  debug: true
+  bail: true
 }

+ 8 - 2
packages/services/examples/node/main.py

@@ -4,6 +4,7 @@
 from __future__ import print_function, absolute_import
 
 import atexit
+import json
 import shutil
 import subprocess
 import sys
@@ -45,9 +46,14 @@ class TestApp(NotebookApp):
 
 def run_node(base_url, token):
     # Run the node script with command arguments.
-    node_command = ['node', 'index.js', '--baseUrl', base_url]
+    node_command = ['node', 'index.js', '--jupyter-config-data=./config.json']
+
+    config = dict(baseUrl=base_url)
     if token:
-        node_command.append('--token=%s' % token)
+        config['token'] = token
+
+    with open('config.json', 'w') as fid:
+        json.dump(config, fid)
 
     print('*' * 60)
     print(' '.join(node_command))

+ 1 - 1
packages/services/examples/node/package.json

@@ -2,7 +2,7 @@
   "private": true,
   "name": "node-example",
   "dependencies": {
-    "@jupyterlab/services": "file:../..",
+    "@jupyterlab/services": "^0.43.0",
     "requirejs": "^2.2.0",
     "ws": "^1.1.1",
     "xmlhttprequest": "^1.8.0"

+ 2 - 2
packages/services/package.json

@@ -23,13 +23,13 @@
     "expect.js": "^0.3.1",
     "istanbul": "^0.3.18",
     "mocha": "^3.2.0",
-    "requirejs": "^2.3.3",
+    "requirejs": "^2.2.0",
     "rimraf": "^2.5.2",
     "text-encoding": "^0.5.2",
     "typedoc": "^0.5.0",
     "typescript": "^2.2.1",
     "webpack": "^2.2.1",
-    "ws": "^1.0.1",
+    "ws": "^1.1.1",
     "xmlhttprequest": "^1.8.0"
   },
   "scripts": {