Sfoglia il codice sorgente

replaced @jupyterlab/coreutils/uuid.ts with @phosphor/coreutils/uuid.ts

deleted @jupyterlab/coreutils/uuid.ts

change coreutils/uuid.ts to wrapper of phosphor/coreutils/UUID.uuid4

replaced @jupyterlab/coreutils/uuid.ts with @phosphor/coreutils/uuid.ts

deleted @jupyterlab/coreutils/uuid.ts

remove unused dependencies @jupyterlab/coreutils

keep original uuid but mark it as deprecated in docs

return back test for uuid

resolve conflict in session.spec.ts
Jiri Vrany 7 anni fa
parent
commit
9d7ab87bfb
38 ha cambiato i file con 224 aggiunte e 171 eliminazioni
  1. 6 2
      packages/apputils/src/clientsession.tsx
  2. 4 4
      packages/apputils/src/mainareawidget.ts
  3. 6 2
      packages/cells/src/model.ts
  4. 3 3
      packages/codemirror/src/editor.ts
  5. 6 2
      packages/console/src/panel.ts
  6. 3 1
      packages/coreutils/src/uuid.ts
  7. 4 3
      packages/docmanager/src/manager.ts
  8. 6 2
      packages/notebook-extension/src/index.ts
  9. 8 4
      packages/notebook/src/model.ts
  10. 7 3
      packages/services/src/kernel/default.ts
  11. 7 2
      packages/services/src/kernel/messages.ts
  12. 16 16
      packages/services/test/src/config/config.spec.ts
  13. 21 17
      packages/services/test/src/kernel/ikernel.spec.ts
  14. 8 7
      packages/services/test/src/kernel/kernel.spec.ts
  15. 8 7
      packages/services/test/src/session/manager.spec.ts
  16. 25 21
      packages/services/test/src/session/session.spec.ts
  17. 7 3
      packages/services/test/src/terminal/terminal.spec.ts
  18. 12 13
      packages/services/test/src/utils.ts
  19. 0 1
      tests/test-apputils/package.json
  20. 3 3
      tests/test-apputils/src/clientsession.spec.ts
  21. 1 1
      tests/test-console/package.json
  22. 3 3
      tests/test-console/src/foreign.spec.ts
  23. 1 1
      tests/test-csvviewer/package.json
  24. 3 3
      tests/test-csvviewer/src/widget.spec.ts
  25. 1 1
      tests/test-docmanager/package.json
  26. 3 3
      tests/test-docmanager/src/savehandler.spec.ts
  27. 3 3
      tests/test-docmanager/src/widgetmanager.spec.ts
  28. 0 1
      tests/test-docregistry/package.json
  29. 9 9
      tests/test-docregistry/src/context.spec.ts
  30. 4 3
      tests/test-docregistry/src/registry.spec.ts
  31. 1 0
      tests/test-filebrowser/package.json
  32. 13 9
      tests/test-filebrowser/src/model.spec.ts
  33. 1 1
      tests/test-fileeditor/package.json
  34. 5 5
      tests/test-fileeditor/src/widget.spec.ts
  35. 1 1
      tests/test-imageviewer/package.json
  36. 4 4
      tests/test-imageviewer/src/widget.spec.ts
  37. 3 3
      tests/test-rendermime/src/registry.spec.ts
  38. 8 4
      tests/utils.ts

+ 6 - 2
packages/apputils/src/clientsession.tsx

@@ -2,9 +2,13 @@
 // Distributed under the terms of the Modified BSD License.
 
 import {
-  PathExt, uuid
+  PathExt
 } from '@jupyterlab/coreutils';
 
+import {
+  UUID
+} from '@phosphor/coreutils';
+
 import {
   Kernel, KernelMessage, ServerConnection, Session
 } from '@jupyterlab/services';
@@ -229,7 +233,7 @@ class ClientSession implements IClientSession {
    */
   constructor(options: ClientSession.IOptions) {
     this.manager = options.manager;
-    this._path = options.path || uuid();
+    this._path = options.path || UUID.uuid4();
     this._type = options.type || '';
     this._name = options.name || '';
     this._setBusy = options.setBusy;

+ 4 - 4
packages/apputils/src/mainareawidget.ts

@@ -2,8 +2,8 @@
 // Distributed under the terms of the Modified BSD License.
 
 import {
-  uuid
-} from '@jupyterlab/coreutils';
+  UUID
+} from '@phosphor/coreutils';
 
 import {
   Message
@@ -41,7 +41,7 @@ class MainAreaWidget<T extends Widget = Widget> extends Widget {
   constructor(options: MainAreaWidget.IOptions<T>) {
     super(options);
     this.addClass('jp-MainAreaWidget');
-    this.id = uuid();
+    this.id = UUID.uuid4();
 
     const content = this._content = options.content;
     const toolbar = this._toolbar = options.toolbar || new Toolbar();
@@ -55,7 +55,7 @@ class MainAreaWidget<T extends Widget = Widget> extends Widget {
     layout.addWidget(content);
 
     if (!content.id) {
-      content.id = uuid();
+      content.id = UUID.uuid4();
     }
     content.node.tabIndex = -1;
 

+ 6 - 2
packages/cells/src/model.ts

@@ -20,9 +20,13 @@ import {
 } from '@jupyterlab/codeeditor';
 
 import {
-  IChangedArgs, nbformat, uuid
+  IChangedArgs, nbformat
 } from '@jupyterlab/coreutils';
 
+import {
+    UUID
+} from '@phosphor/coreutils';
+
 import {
   IObservableJSON, IModelDB, IObservableValue, ObservableValue
 } from '@jupyterlab/observables';
@@ -145,7 +149,7 @@ class CellModel extends CodeEditor.Model implements ICellModel {
   constructor(options: CellModel.IOptions) {
     super({modelDB: options.modelDB});
 
-    this.id = options.id || uuid();
+    this.id = options.id || UUID.uuid4();
 
     this.value.changed.connect(this.onGenericChange, this);
 

+ 3 - 3
packages/codemirror/src/editor.ts

@@ -28,8 +28,8 @@ import {
 } from '@jupyterlab/codeeditor';
 
 import {
-  uuid
-} from '@jupyterlab/coreutils';
+  UUID
+} from '@phosphor/coreutils';
 
 import {
   IObservableMap, IObservableString, ICollaborator
@@ -102,7 +102,7 @@ class CodeMirrorEditor implements CodeEditor.IEditor {
     host.addEventListener('blur', this, true);
     host.addEventListener('scroll', this, true);
 
-    this._uuid = options.uuid || uuid();
+    this._uuid = options.uuid || UUID.uuid4();
 
     // Handle selection style.
     let style = options.selectionStyle || {};

+ 6 - 2
packages/console/src/panel.ts

@@ -10,9 +10,13 @@ import {
 } from '@jupyterlab/codeeditor';
 
 import {
-  PathExt, Time, uuid
+  PathExt, Time
 } from '@jupyterlab/coreutils';
 
+import {
+  UUID
+} from '@phosphor/coreutils';
+
 import {
   RenderMimeRegistry
 } from '@jupyterlab/rendermime';
@@ -66,7 +70,7 @@ class ConsolePanel extends Panel {
     );
     let count = Private.count++;
     if (!path) {
-      path = `${basePath || ''}/console-${count}-${uuid()}`;
+      path = `${basePath || ''}/console-${count}-${UUID.uuid4()}`;
     }
 
     let session = this._session = new ClientSession({

+ 3 - 1
packages/coreutils/src/uuid.ts

@@ -1,7 +1,9 @@
 // Copyright (c) Jupyter Development Team.
 // Distributed under the terms of the Modified BSD License.
-
 /**
+ * WARNING - This function is deprecated.
+ * Please use  '@phosphor/coreutils' UUID.uuid4() instead.
+ *
  * Get a random hex string (not a formal UUID).
  *
  * @param length - The length of the hex string.

+ 4 - 3
packages/docmanager/src/manager.ts

@@ -7,8 +7,9 @@ import {
 } from '@jupyterlab/apputils';
 
 import {
-  uuid
-} from '@jupyterlab/coreutils';
+  UUID
+} from '@phosphor/coreutils';
+
 
 import {
   DocumentRegistry, Context, IDocumentWidget
@@ -362,7 +363,7 @@ class DocumentManager implements IDisposable {
   overwrite(oldPath: string, newPath: string): Promise<Contents.IModel> {
     // Cleanly overwrite the file by moving it, making sure the original does
     // not exist, and then renaming to the new path.
-    const tempPath = `${newPath}.${uuid()}`;
+    const tempPath = `${newPath}.${UUID.uuid4()}`;
     const cb = () => this.rename(tempPath, newPath);
     return this.rename(oldPath, tempPath).then(() => {
       return this.deleteFile(newPath);

+ 6 - 2
packages/notebook-extension/src/index.ts

@@ -18,9 +18,13 @@ import {
 } from '@jupyterlab/codeeditor';
 
 import {
-  ISettingRegistry, IStateDB, PageConfig, URLExt, uuid
+  ISettingRegistry, IStateDB, PageConfig, URLExt
 } from '@jupyterlab/coreutils';
 
+import {
+  UUID
+} from '@phosphor/coreutils';
+
 import  {
   IFileBrowserFactory
 } from '@jupyterlab/filebrowser';
@@ -1289,7 +1293,7 @@ function addCommands(app: JupyterLab, services: ServiceManager, tracker: Noteboo
       const content = (nb.activeCell as CodeCell).cloneOutputArea();
       // Create a MainAreaWidget
       const widget = new MainAreaWidget({ content });
-      widget.id = `LinkedOutputView-${uuid()}`;
+      widget.id = `LinkedOutputView-${UUID.uuid4()}`;
       widget.title.label = 'Output View';
       widget.title.icon = NOTEBOOK_ICON_CLASS;
       widget.title.caption = current.title.label ? `For Notebook: ${current.title.label}` : 'For Notebook:';

+ 8 - 4
packages/notebook/src/model.ts

@@ -11,9 +11,13 @@ import {
 } from '@jupyterlab/cells';
 
 import {
-  nbformat, uuid
+  nbformat
 } from '@jupyterlab/coreutils';
 
+import {
+  UUID
+} from '@phosphor/coreutils';
+
 import {
   IObservableJSON, IObservableUndoableList,
   IObservableList, IModelDB
@@ -428,7 +432,7 @@ namespace NotebookModel {
       }
       if (this.modelDB) {
         if (!options.id) {
-          options.id = uuid();
+          options.id = UUID.uuid4();
         }
         options.modelDB = this.modelDB.view(options.id);
       }
@@ -446,7 +450,7 @@ namespace NotebookModel {
     createMarkdownCell(options: CellModel.IOptions): IMarkdownCellModel {
       if (this.modelDB) {
         if (!options.id) {
-          options.id = uuid();
+          options.id = UUID.uuid4();
         }
         options.modelDB = this.modelDB.view(options.id);
       }
@@ -464,7 +468,7 @@ namespace NotebookModel {
     createRawCell(options: CellModel.IOptions): IRawCellModel {
       if (this.modelDB) {
         if (!options.id) {
-          options.id = uuid();
+          options.id = UUID.uuid4();
         }
         options.modelDB = this.modelDB.view(options.id);
       }

+ 7 - 3
packages/services/src/kernel/default.ts

@@ -2,9 +2,13 @@
 // Distributed under the terms of the Modified BSD License.
 
 import {
-  URLExt, uuid
+  URLExt
 } from '@jupyterlab/coreutils';
 
+import {
+  UUID
+} from '@phosphor/coreutils';
+
 import {
   ArrayExt, each, find
 } from '@phosphor/algorithm';
@@ -74,7 +78,7 @@ class DefaultKernel implements Kernel.IKernel {
     this._name = options.name;
     this._id = id;
     this.serverSettings = options.serverSettings || ServerConnection.makeSettings();
-    this._clientId = options.clientId || uuid();
+    this._clientId = options.clientId || UUID.uuid4();
     this._username = options.username || '';
     this._futures = new Map<string, KernelFutureHandler>();
     this._comms = new Map<string, Kernel.IComm>();
@@ -592,7 +596,7 @@ class DefaultKernel implements Kernel.IKernel {
    * #### Notes
    * If a client-side comm already exists with the given commId, it is returned.
    */
-  connectToComm(targetName: string, commId: string = uuid()): Kernel.IComm {
+  connectToComm(targetName: string, commId: string = UUID.uuid4()): Kernel.IComm {
     if (this._comms.has(commId)) {
       return this._comms.get(commId);
     }

+ 7 - 2
packages/services/src/kernel/messages.ts

@@ -2,9 +2,14 @@
 // Distributed under the terms of the Modified BSD License.
 
 import {
-  nbformat, uuid
+  nbformat
 } from '@jupyterlab/coreutils';
 
+import {
+  UUID
+} from '@phosphor/coreutils';
+
+
 import {
   JSONObject, JSONValue
 } from '@phosphor/coreutils';
@@ -29,7 +34,7 @@ namespace KernelMessage {
         username: options.username || '',
         version: '5.2',
         session: options.session,
-        msg_id: options.msgId || uuid(),
+        msg_id: options.msgId || UUID.uuid4(),
         msg_type: options.msgType
       },
       parent_header: { },

+ 16 - 16
packages/services/test/src/config/config.spec.ts

@@ -4,8 +4,8 @@
 import expect = require('expect.js');
 
 import {
-  uuid
-} from '@jupyterlab/coreutils';
+  UUID
+} from '@phosphor/coreutils';
 
 import {
   JSONObject
@@ -25,14 +25,14 @@ describe('config', () => {
   describe('ConfigSection.create()', () => {
 
     it('should load a config', () => {
-      return ConfigSection.create({ name: uuid() }).then(config => {
+      return ConfigSection.create({ name: UUID.uuid4() }).then(config => {
         expect(Object.keys(config.data).length).to.be(0);
       });
     });
 
     it('should accept server settings', () => {
       let serverSettings = makeSettings();
-      return ConfigSection.create({ name: uuid(), serverSettings }).then(config => {
+      return ConfigSection.create({ name: UUID.uuid4(), serverSettings }).then(config => {
         expect(Object.keys(config.data).length).to.be(0);
       });
     });
@@ -40,7 +40,7 @@ describe('config', () => {
 
     it('should fail for an incorrect response', (done) => {
       let serverSettings = getRequestHandler(201, { });
-      let configPromise = ConfigSection.create({ name: uuid(), serverSettings });
+      let configPromise = ConfigSection.create({ name: UUID.uuid4(), serverSettings });
       expectFailure(configPromise, done, 'Invalid response: 201 Created');
     });
 
@@ -50,7 +50,7 @@ describe('config', () => {
 
     it('should update a config', () => {
       let config: IConfigSection;
-      return ConfigSection.create({ name: uuid() }).then(c => {
+      return ConfigSection.create({ name: UUID.uuid4() }).then(c => {
         config = c;
         return config.update( { foo: 'baz', spam: 'eggs' });
       }).then((data: any) => {
@@ -64,7 +64,7 @@ describe('config', () => {
     it('should accept server settings', () => {
       let config: IConfigSection;
       let serverSettings = makeSettings();
-      return ConfigSection.create({ name: uuid(), serverSettings }).then(c => {
+      return ConfigSection.create({ name: UUID.uuid4(), serverSettings }).then(c => {
         config = c;
         return config.update( { foo: 'baz', spam: 'eggs' });
       }).then((data: any) => {
@@ -76,7 +76,7 @@ describe('config', () => {
     });
 
     it('should fail for an incorrect response', (done) => {
-      ConfigSection.create({ name: uuid() }).then(config => {
+      ConfigSection.create({ name: UUID.uuid4() }).then(config => {
         handleRequest(config, 201, { });
         let update = config.update({ foo: 'baz' });
         expectFailure(update, done, 'Invalid response: 201 Created');
@@ -95,7 +95,7 @@ describe('jupyter.services - ConfigWithDefaults', () => {
     it('should complete properly', () => {
       let defaults: JSONObject = { spam: 'eggs' };
       let className = 'testclass';
-      return ConfigSection.create({ name: uuid() }).then(section => {
+      return ConfigSection.create({ name: UUID.uuid4() }).then(section => {
         let config = new ConfigWithDefaults({ section, defaults, className });
         expect(config).to.be.a(ConfigWithDefaults);
       });
@@ -108,7 +108,7 @@ describe('jupyter.services - ConfigWithDefaults', () => {
     it('should get a new config value', () => {
       let defaults: JSONObject = { foo: 'bar' };
       let className = 'testclass';
-      return ConfigSection.create({ name: uuid() }).then(section => {
+      return ConfigSection.create({ name: UUID.uuid4() }).then(section => {
         let config = new ConfigWithDefaults({ section, defaults, className });
         let data = config.get('foo');
         expect(data).to.be('bar');
@@ -118,7 +118,7 @@ describe('jupyter.services - ConfigWithDefaults', () => {
     it('should get a default config value', () => {
       let defaults: JSONObject = { spam: 'eggs' };
       let className = 'testclass';
-      return ConfigSection.create({ name: uuid() }).then(section => {
+      return ConfigSection.create({ name: UUID.uuid4() }).then(section => {
         let config = new ConfigWithDefaults({ section, defaults, className });
         let data = config.get('spam');
         expect(data).to.be('eggs');
@@ -128,7 +128,7 @@ describe('jupyter.services - ConfigWithDefaults', () => {
     it('should get a default config value with no class', () => {
       let defaults: JSONObject = { spam: 'eggs' };
       let className = 'testclass';
-      return ConfigSection.create({ name: uuid() }).then(section => {
+      return ConfigSection.create({ name: UUID.uuid4() }).then(section => {
         let config = new ConfigWithDefaults({ section, defaults, className });
         let data = config.get('spam');
         expect(data).to.be('eggs');
@@ -139,7 +139,7 @@ describe('jupyter.services - ConfigWithDefaults', () => {
       let defaults: JSONObject = { foo: true };
       let className = 'testclass';
       let serverSettings = getRequestHandler(200, {foo: false });
-      return ConfigSection.create({ name: uuid(), serverSettings }).then(section => {
+      return ConfigSection.create({ name: UUID.uuid4(), serverSettings }).then(section => {
         let config = new ConfigWithDefaults({ section, defaults, className });
         let data = config.get('foo');
         expect(data).to.not.be.ok();
@@ -153,7 +153,7 @@ describe('jupyter.services - ConfigWithDefaults', () => {
     it('should set a value in a class immediately', () => {
       let className = 'testclass';
       let section: IConfigSection;
-      return ConfigSection.create({ name: uuid() }).then(s => {
+      return ConfigSection.create({ name: UUID.uuid4() }).then(s => {
         section = s;
         let config = new ConfigWithDefaults({ section, className });
         return config.set('foo', 'bar');
@@ -165,7 +165,7 @@ describe('jupyter.services - ConfigWithDefaults', () => {
 
     it('should set a top level value', () => {
       let section: IConfigSection;
-      return ConfigSection.create({ name: uuid() }).then(s => {
+      return ConfigSection.create({ name: UUID.uuid4() }).then(s => {
         section = s;
         let config = new ConfigWithDefaults({ section });
         let set = config.set('foo', 'bar');
@@ -179,7 +179,7 @@ describe('jupyter.services - ConfigWithDefaults', () => {
 
     it('should fail for an invalid response', (done) => {
       let serverSettings = getRequestHandler(200, {});
-      ConfigSection.create({ name: uuid(), serverSettings }).then(section => {
+      ConfigSection.create({ name: UUID.uuid4(), serverSettings }).then(section => {
         handleRequest(section, 201, {foo: 'bar'});
         let config = new ConfigWithDefaults({ section });
         let set = config.set('foo', 'bar');

+ 21 - 17
packages/services/test/src/kernel/ikernel.spec.ts

@@ -4,9 +4,13 @@
 import expect = require('expect.js');
 
 import {
-  PageConfig, uuid
+  PageConfig
 } from '@jupyterlab/coreutils';
 
+import {
+  UUID
+} from '@phosphor/coreutils';
+
 import {
   JSONObject, PromiseDelegate
 } from '@phosphor/coreutils';
@@ -92,7 +96,7 @@ describe('Kernel.IKernel', () => {
     it('should be emitted regardless of the sender', async () => {
       const tester = new KernelTester();
       const kernel = await tester.start();
-      const msgId = uuid();
+      const msgId = UUID.uuid4();
       const emission = testEmission(kernel.iopubMessage, {
         find: (k, msg) => (msg.header.msg_id === msgId)
       });
@@ -120,7 +124,7 @@ describe('Kernel.IKernel', () => {
 
     it('should be emitted for an unhandled message', async () => {
       const kernel = await tester.start();
-      const msgId = uuid();
+      const msgId = UUID.uuid4();
       const emission = testEmission(kernel.unhandledMessage, {
         find: (k, msg) => (msg.header.msg_id === msgId)
       });
@@ -140,13 +144,13 @@ describe('Kernel.IKernel', () => {
 
       // We'll send two messages, first an iopub message, then a shell message.
       // The unhandledMessage signal should only emit once for the shell message.
-      const msgId = uuid();
+      const msgId = UUID.uuid4();
       const emission = testEmission(kernel.unhandledMessage, {
         test: (k, msg) => { expect(msg.header.msg_id).to.be(msgId); }
       });
 
       // Send an iopub message.
-      tester.sendStatus(uuid(), 'idle');
+      tester.sendStatus(UUID.uuid4(), 'idle');
 
       // Send a shell message.
       let msg = KernelMessage.createShellMessage({
@@ -210,7 +214,7 @@ describe('Kernel.IKernel', () => {
 
     it('should be emitted for an unhandled message', async () => {
       const kernel = await tester.start();
-      const msgId = uuid();
+      const msgId = UUID.uuid4();
 
       const emission = testEmission(kernel.anyMessage, {
         test: (k, args) => {
@@ -356,7 +360,7 @@ describe('Kernel.IKernel', () => {
       const dead = testEmission(kernel.statusChanged, {
         find: () => kernel.status === 'dead'
       });
-      tester.sendStatus(uuid(), 'dead');
+      tester.sendStatus(UUID.uuid4(), 'dead');
       await dead;
       tester.dispose();
     });
@@ -373,10 +377,10 @@ describe('Kernel.IKernel', () => {
       });
 
       // This invalid status is not emitted.
-      tester.sendStatus(uuid(), 'invalid-status' as Kernel.Status);
+      tester.sendStatus(UUID.uuid4(), 'invalid-status' as Kernel.Status);
 
       // This valid status is emitted.
-      tester.sendStatus(uuid(), 'busy');
+      tester.sendStatus(UUID.uuid4(), 'busy');
 
       await emission;
       tester.dispose();
@@ -469,7 +473,7 @@ describe('Kernel.IKernel', () => {
       const tester = new KernelTester();
       let kernel = await tester.start();
       let done = new PromiseDelegate<void>();
-      let msgId = uuid();
+      let msgId = UUID.uuid4();
 
       tester.onMessage(msg => {
         try {
@@ -499,7 +503,7 @@ describe('Kernel.IKernel', () => {
       const tester = new KernelTester();
       let kernel = await tester.start();
       let done = new PromiseDelegate<void>();
-      let msgId = uuid();
+      let msgId = UUID.uuid4();
 
       tester.onMessage(msg => {
         try {
@@ -537,7 +541,7 @@ describe('Kernel.IKernel', () => {
       const dead = testEmission(kernel.statusChanged, {
         find: () => kernel.status === 'dead'
       });
-      tester.sendStatus(uuid(), 'dead');
+      tester.sendStatus(UUID.uuid4(), 'dead');
       await dead;
 
       let options: KernelMessage.IOptions = {
@@ -619,7 +623,7 @@ describe('Kernel.IKernel', () => {
       const dead = testEmission(kernel.statusChanged, {
         find: () => kernel.status === 'dead'
       });
-      tester.sendStatus(uuid(), 'dead');
+      tester.sendStatus(UUID.uuid4(), 'dead');
       await dead;
       await expectFailure(kernel.interrupt(), null, 'Kernel is dead');
       tester.dispose();
@@ -705,7 +709,7 @@ describe('Kernel.IKernel', () => {
     });
 
     it('should throw an error for an invalid response', async () => {
-      handleRequest(defaultKernel, 200, { id: uuid(), name: 'foo' });
+      handleRequest(defaultKernel, 200, { id: UUID.uuid4(), name: 'foo' });
       let shutdown = defaultKernel.shutdown();
       await expectFailure(shutdown, null, 'Invalid response: 200 OK');
     });
@@ -730,7 +734,7 @@ describe('Kernel.IKernel', () => {
       const dead = testEmission(kernel.statusChanged, {
         find: () => kernel.status === 'dead'
       });
-      tester.sendStatus(uuid(), 'dead');
+      tester.sendStatus(UUID.uuid4(), 'dead');
       await dead;
       await expectFailure(kernel.shutdown(), null, 'Kernel is dead');
       tester.dispose();
@@ -779,7 +783,7 @@ describe('Kernel.IKernel', () => {
       const dead = testEmission(kernel.statusChanged, {
         find: () => kernel.status === 'dead'
       });
-      tester.sendStatus(uuid(), 'dead');
+      tester.sendStatus(UUID.uuid4(), 'dead');
       await dead;
       expectFailure(kernel.requestComplete(options), null, 'Kernel is dead');
       tester.dispose();
@@ -852,7 +856,7 @@ describe('Kernel.IKernel', () => {
       const dead = testEmission(kernel.statusChanged, {
         find: () => kernel.status === 'dead'
       });
-      tester.sendStatus(uuid(), 'dead');
+      tester.sendStatus(UUID.uuid4(), 'dead');
       await dead;
       expect(() => { kernel.sendInputReply({ value: 'test' }); }).to.throwException(/Kernel is dead/);
       tester.dispose();

+ 8 - 7
packages/services/test/src/kernel/kernel.spec.ts

@@ -4,8 +4,9 @@
 import expect = require('expect.js');
 
 import {
-  uuid
-} from '@jupyterlab/coreutils';
+  UUID
+} from '@phosphor/coreutils';
+
 
 import {
   toArray
@@ -71,7 +72,7 @@ describe('kernel', () => {
     });
 
     it('should throw an error for an invalid model', (done) => {
-      let data = { id: uuid(), name: 'test' };
+      let data = { id: UUID.uuid4(), name: 'test' };
       let settings = getRequestHandler(200, data);
       let promise = Kernel.listRunning(settings);
       expectFailure(promise, done, 'Invalid kernel list');
@@ -128,19 +129,19 @@ describe('kernel', () => {
     });
 
     it('should throw an error for an invalid kernel id', (done) => {
-      let serverSettings = getRequestHandler(201, { id: uuid() });
+      let serverSettings = getRequestHandler(201, { id: UUID.uuid4() });
       let kernelPromise = Kernel.startNew({ serverSettings });
       expectFailure(kernelPromise, done);
     });
 
     it('should throw an error for another invalid kernel id', (done) => {
-      let serverSettings = getRequestHandler(201, { id: uuid(), name: 1 });
+      let serverSettings = getRequestHandler(201, { id: UUID.uuid4(), name: 1 });
       let kernelPromise = Kernel.startNew({ serverSettings });
       expectFailure(kernelPromise, done);
     });
 
     it('should throw an error for an invalid response', (done) => {
-      let data = { id: uuid(), name: 'foo' };
+      let data = { id: UUID.uuid4(), name: 'foo' };
       let serverSettings = getRequestHandler(200, data);
       let kernelPromise = Kernel.startNew({ serverSettings });
       expectFailure(kernelPromise, done, 'Invalid response: 200 OK');
@@ -194,7 +195,7 @@ describe('kernel', () => {
     });
 
     it('should handle a 404 error', () => {
-      return Kernel.shutdown(uuid());
+      return Kernel.shutdown(UUID.uuid4());
     });
 
   });

+ 8 - 7
packages/services/test/src/session/manager.spec.ts

@@ -4,8 +4,8 @@
 import expect = require('expect.js');
 
 import {
-  uuid
-} from '@jupyterlab/coreutils';
+  UUID
+} from '@phosphor/coreutils';
 
 import {
   toArray
@@ -28,11 +28,12 @@ import {
 } from '../utils';
 
 
+
 /**
  * Start a new session on with a default name.
  */
 function startNew(manager: SessionManager): Promise<Session.ISession> {
-  return manager.startNew({ path: uuid() });
+  return manager.startNew({ path: UUID.uuid4() });
 }
 
 
@@ -42,7 +43,7 @@ describe('session/manager', () => {
   let session: Session.ISession;
 
   before(async () => {
-    session = await Session.startNew({ path: uuid() });
+    session = await Session.startNew({ path: UUID.uuid4() });
     await session.kernel.ready;
   });
 
@@ -172,7 +173,7 @@ describe('session/manager', () => {
           manager.dispose();
           called = true;
         });
-        return session.setPath(uuid()).then(() => {
+        return session.setPath(UUID.uuid4()).then(() => {
           return manager.refreshRunning();
         }).then(() => {
           expect(called).to.be(true);
@@ -223,7 +224,7 @@ describe('session/manager', () => {
     describe('#startNew()', () => {
 
       it('should start a session', async () => {
-        let session = await manager.startNew({ path: uuid() });
+        let session = await manager.startNew({ path: UUID.uuid4() });
         await session.kernel.ready;
         expect(session.id).to.be.ok();
         return session.shutdown();
@@ -234,7 +235,7 @@ describe('session/manager', () => {
         manager.runningChanged.connect(() => {
           called = true;
         });
-        let session = await manager.startNew({ path: uuid() });
+        let session = await manager.startNew({ path: UUID.uuid4() });
         await session.kernel.ready;
         expect(called).to.be(true);
       });

+ 25 - 21
packages/services/test/src/session/session.spec.ts

@@ -4,9 +4,13 @@
 import expect = require('expect.js');
 
 import {
-  PageConfig, uuid
+  PageConfig
 } from '@jupyterlab/coreutils';
 
+import {
+  UUID
+} from '@phosphor/coreutils';
+
 import {
   toArray
 } from '@phosphor/algorithm';
@@ -51,7 +55,7 @@ function createSessionOptions(sessionModel: Session.IModel, serverSettings: Serv
  * Start a new session with a unique name.
  */
 function startNew(): Promise<Session.ISession> {
-  return Session.startNew({ path: uuid() });
+  return Session.startNew({ path: UUID.uuid4() });
 }
 
 
@@ -125,7 +129,7 @@ describe('session', () => {
 
     it('should accept ajax options', (done) => {
       let serverSettings = makeSettings();
-      let options: Session.IOptions = { path: uuid(), serverSettings };
+      let options: Session.IOptions = { path: UUID.uuid4(), serverSettings };
       Session.startNew(options).then(s => {
         session = s;
         expect(session.id).to.ok();
@@ -223,7 +227,7 @@ describe('session', () => {
     });
 
     it('should handle a 404 status', () => {
-      return Session.shutdown(uuid());
+      return Session.shutdown(UUID.uuid4());
     });
 
   });
@@ -300,7 +304,7 @@ describe('session', () => {
         const tester = new SessionTester();
         const session = await tester.startSession();
         await session.kernel.ready;
-        const msgId = uuid();
+        const msgId = UUID.uuid4();
         const emission = testEmission(session.unhandledMessage, {
           find: (k, msg) => (msg.header.msg_id === msgId)
         });
@@ -322,7 +326,7 @@ describe('session', () => {
     context('#propertyChanged', () => {
 
       it('should be emitted when the session path changes', () => {
-        let newPath = uuid();
+        let newPath = UUID.uuid4();
         let called = false;
         let object = {};
         defaultSession.propertyChanged.connect((s, type) => {
@@ -448,7 +452,7 @@ describe('session', () => {
     context('#setPath()', () => {
 
       it('should set the path of the session', () => {
-        let newPath = uuid();
+        let newPath = UUID.uuid4();
         return defaultSession.setPath(newPath).then(() => {
           expect(defaultSession.path).to.be(newPath);
         });
@@ -456,23 +460,23 @@ describe('session', () => {
 
       it('should fail for improper response status', (done) => {
         handleRequest(defaultSession, 201, {});
-        expectFailure(defaultSession.setPath(uuid()), done);
+        expectFailure(defaultSession.setPath(UUID.uuid4()), done);
       });
 
       it('should fail for error response status', (done) => {
         handleRequest(defaultSession, 500, {});
-        expectFailure(defaultSession.setPath(uuid()), done, '');
+        expectFailure(defaultSession.setPath(UUID.uuid4()), done, '');
       });
 
       it('should fail for improper model', (done) => {
         handleRequest(defaultSession, 200, {});
-        expectFailure(defaultSession.setPath(uuid()), done);
+        expectFailure(defaultSession.setPath(UUID.uuid4()), done);
       });
 
       it('should fail if the session is disposed', async () => {
         const session = Session.connectTo(defaultSession.model);
         session.dispose();
-        let promise = session.setPath(uuid());
+        let promise = session.setPath(UUID.uuid4());
         await expectFailure(promise, null, 'Session is disposed');
       });
 
@@ -481,7 +485,7 @@ describe('session', () => {
     context('#setType()', () => {
 
       it('should set the type of the session', () => {
-        let type = uuid();
+        let type = UUID.uuid4();
         return defaultSession.setType(type).then(() => {
           expect(defaultSession.type).to.be(type);
         });
@@ -489,23 +493,23 @@ describe('session', () => {
 
       it('should fail for improper response status', (done) => {
         handleRequest(defaultSession, 201, {});
-        expectFailure(defaultSession.setType(uuid()), done);
+        expectFailure(defaultSession.setType(UUID.uuid4()), done);
       });
 
       it('should fail for error response status', (done) => {
         handleRequest(defaultSession, 500, {});
-        expectFailure(defaultSession.setType(uuid()), done, '');
+        expectFailure(defaultSession.setType(UUID.uuid4()), done, '');
       });
 
       it('should fail for improper model', (done) => {
         handleRequest(defaultSession, 200, {});
-        expectFailure(defaultSession.setType(uuid()), done);
+        expectFailure(defaultSession.setType(UUID.uuid4()), done);
       });
 
       it('should fail if the session is disposed', async () => {
         const session = Session.connectTo(defaultSession.model);
         session.dispose();
-        let promise = session.setPath(uuid());
+        let promise = session.setPath(UUID.uuid4());
         await expectFailure(promise, null, 'Session is disposed');
       });
 
@@ -514,7 +518,7 @@ describe('session', () => {
     context('#setName()', () => {
 
       it('should set the name of the session', () => {
-        let name = uuid();
+        let name = UUID.uuid4();
         return defaultSession.setName(name).then(() => {
           expect(defaultSession.name).to.be(name);
         });
@@ -522,23 +526,23 @@ describe('session', () => {
 
       it('should fail for improper response status', (done) => {
         handleRequest(defaultSession, 201, {});
-        expectFailure(defaultSession.setName(uuid()), done);
+        expectFailure(defaultSession.setName(UUID.uuid4()), done);
       });
 
       it('should fail for error response status', (done) => {
         handleRequest(defaultSession, 500, {});
-        expectFailure(defaultSession.setName(uuid()), done, '');
+        expectFailure(defaultSession.setName(UUID.uuid4()), done, '');
       });
 
       it('should fail for improper model', (done) => {
         handleRequest(defaultSession, 200, {});
-        expectFailure(defaultSession.setName(uuid()), done);
+        expectFailure(defaultSession.setName(UUID.uuid4()), done);
       });
 
       it('should fail if the session is disposed', async () => {
         const session = Session.connectTo(defaultSession.model);
         session.dispose();
-        let promise = session.setPath(uuid());
+        let promise = session.setPath(UUID.uuid4());
         await expectFailure(promise, null, 'Session is disposed');
       });
 

+ 7 - 3
packages/services/test/src/terminal/terminal.spec.ts

@@ -4,9 +4,13 @@
 import expect = require('expect.js');
 
 import {
-  PageConfig, uuid
+  PageConfig
 } from '@jupyterlab/coreutils';
 
+import {
+  UUID
+} from '@phosphor/coreutils';
+
 import {
   Signal
 } from '@phosphor/signaling';
@@ -68,7 +72,7 @@ describe('terminal', () => {
       });
 
       it('should reject if the session does not exist on the server', () => {
-        return TerminalSession.connectTo(uuid()).then(
+        return TerminalSession.connectTo(UUID.uuid4()).then(
           () => { throw Error('should not get here'); },
           () => undefined
         );
@@ -86,7 +90,7 @@ describe('terminal', () => {
       });
 
       it('should handle a 404 status', () => {
-        return TerminalSession.shutdown(uuid());
+        return TerminalSession.shutdown(UUID.uuid4());
       });
 
     });

+ 12 - 13
packages/services/test/src/utils.ts

@@ -8,8 +8,8 @@ import WebSocket from 'ws';
 import expect from 'expect.js';
 
 import {
-  uuid
-} from '@jupyterlab/coreutils';
+  UUID
+} from '@phosphor/coreutils';
 
 import {
   JSONObject, JSONPrimitive, PromiseDelegate
@@ -17,7 +17,6 @@ import {
 
 import { Response } from 'node-fetch';
 
-
 import {
   ISignal, Signal
 } from '@phosphor/signaling';
@@ -433,7 +432,7 @@ class KernelTester extends SocketTester {
    */
   async start(): Promise<Kernel.IKernel> {
     // Set up the kernel request response.
-    handleRequest(this, 201, { name: 'test', id: uuid() });
+    handleRequest(this, 201, { name: 'test', id: UUID.uuid4() });
 
     // Construct a new kernel.
     let serverSettings = this.serverSettings;
@@ -487,13 +486,13 @@ class KernelTester extends SocketTester {
       if (data.header.msg_type === 'kernel_info_request') {
         // First send status busy message.
         this.parentHeader = data.header;
-        this.sendStatus(uuid(), 'busy');
+        this.sendStatus(UUID.uuid4(), 'busy');
 
         // Then send the kernel_info_reply message.
-        this.sendKernelInfoReply(uuid(), EXAMPLE_KERNEL_INFO);
+        this.sendKernelInfoReply(UUID.uuid4(), EXAMPLE_KERNEL_INFO);
 
         // Then send status idle message.
-        this.sendStatus(uuid(), 'idle');
+        this.sendStatus(UUID.uuid4(), 'idle');
         this.parentHeader = undefined;
       } else {
         let onMessage = this._onMessage;
@@ -504,7 +503,7 @@ class KernelTester extends SocketTester {
     });
   }
 
-  readonly serverSessionId = uuid();
+  readonly serverSessionId = UUID.uuid4();
 
   private _initialStatus = 'starting';
   private _kernel: Kernel.IKernel | null = null;
@@ -519,11 +518,11 @@ class KernelTester extends SocketTester {
 export
 function createSessionModel(id?: string): Session.IModel {
   return {
-    id: id || uuid(),
-    path: uuid(),
+    id: id || UUID.uuid4(),
+    path: UUID.uuid4(),
     name: '',
     type: '',
-    kernel: { id: uuid(), name: uuid() }
+    kernel: { id: UUID.uuid4(), name: UUID.uuid4() }
   };
 }
 
@@ -549,7 +548,7 @@ class SessionTester extends SocketTester {
   async startSession(): Promise<Session.ISession> {
     handleRequest(this, 201, createSessionModel());
     let serverSettings = this.serverSettings;
-    this._session = await Session.startNew({ path: uuid(), serverSettings });
+    this._session = await Session.startNew({ path: UUID.uuid4(), serverSettings });
     await this.ready;
     await this._session.kernel.ready;
     return this._session;
@@ -641,7 +640,7 @@ class SessionTester extends SocketTester {
     });
   }
 
-  readonly serverSessionId = uuid();
+  readonly serverSessionId = UUID.uuid4();
   private _initialStatus = 'starting';
   private _session: Session.ISession;
   private _onMessage: (msg: KernelMessage.IMessage) => void = null;

+ 0 - 1
tests/test-apputils/package.json

@@ -17,7 +17,6 @@
   },
   "dependencies": {
     "@jupyterlab/apputils": "^0.17.0-0",
-    "@jupyterlab/coreutils": "^2.0.0-0",
     "@jupyterlab/services": "^3.0.0-0",
     "@phosphor/algorithm": "^1.1.2",
     "@phosphor/commands": "^1.5.0",

+ 3 - 3
tests/test-apputils/src/clientsession.spec.ts

@@ -12,8 +12,8 @@ import {
 } from '@jupyterlab/apputils';
 
 import {
-  uuid
-} from '@jupyterlab/coreutils';
+  UUID
+} from '@phosphor/coreutils';
 
 import {
   acceptDialog, dismissDialog
@@ -250,7 +250,7 @@ describe('@jupyterlab/apputils', () => {
       it('should connect to an existing kernel', () => {
         let other: Session.ISession;
         session.dispose();
-        return manager.startNew({ path: uuid() }).then(o => {
+        return manager.startNew({ path: UUID.uuid4() }).then(o => {
           other = o;
           session = new ClientSession({
             manager, kernelPreference: { id: other.kernel.id }

+ 1 - 1
tests/test-console/package.json

@@ -21,8 +21,8 @@
     "@jupyterlab/codeeditor": "^0.17.0-0",
     "@jupyterlab/codemirror": "^0.17.0-0",
     "@jupyterlab/console": "^0.17.0-0",
-    "@jupyterlab/coreutils": "^2.0.0-0",
     "@jupyterlab/services": "^3.0.0-0",
+    "@phosphor/coreutils": "^1.3.0",
     "@phosphor/messaging": "^1.2.2",
     "@phosphor/signaling": "^1.2.2",
     "@phosphor/widgets": "^1.6.0",

+ 3 - 3
tests/test-console/src/foreign.spec.ts

@@ -4,8 +4,8 @@
 import expect = require('expect.js');
 
 import {
-  uuid
-} from '@jupyterlab/coreutils';
+  UUID
+} from '@phosphor/coreutils';
 
 import {
   KernelMessage, Session
@@ -107,7 +107,7 @@ describe('@jupyterlab/console', () => {
     let session: IClientSession;
 
     before(() => {
-      let path = uuid();
+      let path = UUID.uuid4();
       let sessions = [Session.startNew({ path }), Session.startNew({ path })];
       return Promise.all(sessions).then(([one, two]) => {
         local = one;

+ 1 - 1
tests/test-csvviewer/package.json

@@ -16,10 +16,10 @@
     "watch:src": "tsc -w --listEmittedFiles"
   },
   "dependencies": {
-    "@jupyterlab/coreutils": "^2.0.0-0",
     "@jupyterlab/csvviewer": "^0.17.0-0",
     "@jupyterlab/docregistry": "^0.17.0-0",
     "@jupyterlab/services": "^3.0.0-0",
+    "@phosphor/coreutils": "^1.3.0",
     "@phosphor/widgets": "^1.6.0",
     "csv-spectrum": "~1.0.0",
     "expect.js": "~0.3.1",

+ 3 - 3
tests/test-csvviewer/src/widget.spec.ts

@@ -4,8 +4,8 @@
 import expect = require('expect.js');
 
 import {
-  uuid
-} from '@jupyterlab/coreutils';
+  UUID
+} from '@phosphor/coreutils';
 
 import {
   ServiceManager
@@ -23,7 +23,7 @@ import {
 function createContext(): Context<DocumentRegistry.IModel> {
   let factory = new TextModelFactory();
   let manager = new ServiceManager();
-  let path = uuid() + '.csv';
+  let path = UUID.uuid4() + '.csv';
   return new Context({ factory, manager, path });
 }
 

+ 1 - 1
tests/test-docmanager/package.json

@@ -16,10 +16,10 @@
     "watch:src": "tsc -w --listEmittedFiles"
   },
   "dependencies": {
-    "@jupyterlab/coreutils": "^2.0.0-0",
     "@jupyterlab/docmanager": "^0.17.0-0",
     "@jupyterlab/docregistry": "^0.17.0-0",
     "@jupyterlab/services": "^3.0.0-0",
+    "@phosphor/coreutils": "^1.3.0",
     "@phosphor/messaging": "^1.2.2",
     "@phosphor/widgets": "^1.6.0",
     "expect.js": "~0.3.1"

+ 3 - 3
tests/test-docmanager/src/savehandler.spec.ts

@@ -4,8 +4,8 @@
 import expect = require('expect.js');
 
 import {
-  uuid
-} from '@jupyterlab/coreutils';
+  UUID
+} from '@phosphor/coreutils';
 
 import {
   ServiceManager
@@ -37,7 +37,7 @@ describe('docregistry/savehandler', () => {
   });
 
   beforeEach(() => {
-    context = new Context({ manager, factory, path: uuid() + '.txt' });
+    context = new Context({ manager, factory, path: UUID.uuid4() + '.txt' });
     handler = new SaveHandler({ context });
     return context.initialize(true);
   });

+ 3 - 3
tests/test-docmanager/src/widgetmanager.spec.ts

@@ -4,8 +4,8 @@
 import expect = require('expect.js');
 
 import {
-  uuid
-} from '@jupyterlab/coreutils';
+  UUID
+} from '@phosphor/coreutils';
 
 import {
   ServiceManager
@@ -91,7 +91,7 @@ describe('@jupyterlab/docmanager', () => {
     context = new Context({
       manager: services,
       factory: textModelFactory,
-      path: uuid()
+      path: UUID.uuid4()
     });
   });
 

+ 0 - 1
tests/test-docregistry/package.json

@@ -16,7 +16,6 @@
     "watch:src": "tsc -w --listEmittedFiles"
   },
   "dependencies": {
-    "@jupyterlab/coreutils": "^2.0.0-0",
     "@jupyterlab/docregistry": "^0.17.0-0",
     "@jupyterlab/rendermime": "^0.17.0-0",
     "@jupyterlab/services": "^3.0.0-0",

+ 9 - 9
tests/test-docregistry/src/context.spec.ts

@@ -4,8 +4,8 @@
 import expect = require('expect.js');
 
 import {
-  uuid
-} from '@jupyterlab/coreutils';
+  UUID
+} from '@phosphor/coreutils';
 
 import {
   Contents, ServiceManager
@@ -48,7 +48,7 @@ describe('docregistry/context', () => {
     let context: Context<DocumentRegistry.IModel>;
 
     beforeEach(() => {
-      context = new Context({ manager, factory, path: uuid() + '.txt' });
+      context = new Context({ manager, factory, path: UUID.uuid4() + '.txt' });
     });
 
     afterEach(() => {
@@ -60,7 +60,7 @@ describe('docregistry/context', () => {
     describe('#constructor()', () => {
 
       it('should create a new context', () => {
-        context = new Context({ manager, factory, path: uuid() + '.txt' });
+        context = new Context({ manager, factory, path: UUID.uuid4() + '.txt' });
         expect(context).to.be.a(Context);
       });
 
@@ -69,7 +69,7 @@ describe('docregistry/context', () => {
     describe('#pathChanged', () => {
 
       it('should be emitted when the path changes', (done) => {
-        let newPath = uuid() + '.txt';
+        let newPath = UUID.uuid4() + '.txt';
         context.pathChanged.connect((sender, args) => {
           expect(sender).to.be(context);
           expect(args).to.be(newPath);
@@ -255,7 +255,7 @@ describe('docregistry/context', () => {
     describe('#saveAs()', () => {
 
       it('should save the document to a different path chosen by the user', () => {
-        const newPath = uuid() + '.txt';
+        const newPath = UUID.uuid4() + '.txt';
         waitForDialog().then(() => {
           let dialog = document.body.getElementsByClassName('jp-Dialog')[0];
           let input = dialog.getElementsByTagName('input')[0];
@@ -270,7 +270,7 @@ describe('docregistry/context', () => {
       });
 
       it('should bring up a conflict dialog', () => {
-        const newPath = uuid() + '.txt';
+        const newPath = UUID.uuid4() + '.txt';
         waitForDialog().then(() => {
           let dialog = document.body.getElementsByClassName('jp-Dialog')[0];
           let input = dialog.getElementsByTagName('input')[0];
@@ -294,7 +294,7 @@ describe('docregistry/context', () => {
 
       it('should keep the file if overwrite is aborted', () => {
         let oldPath = context.path;
-        let newPath = uuid() + '.txt';
+        let newPath = UUID.uuid4() + '.txt';
         waitForDialog().then(() => {
           let dialog = document.body.getElementsByClassName('jp-Dialog')[0];
           let input = dialog.getElementsByTagName('input')[0];
@@ -431,7 +431,7 @@ describe('docregistry/context', () => {
         let opener = (widget: Widget) => {
           called = true;
         };
-        context = new Context({ manager, factory, path: uuid() + '.txt', opener });
+        context = new Context({ manager, factory, path: UUID.uuid4() + '.txt', opener });
         context.addSibling(new Widget());
         expect(called).to.be(true);
       });

+ 4 - 3
tests/test-docregistry/src/registry.spec.ts

@@ -4,8 +4,9 @@
 import expect = require('expect.js');
 
 import {
-  uuid
-} from '@jupyterlab/coreutils';
+  UUID
+} from '@phosphor/coreutils';
+
 
 import {
   toArray
@@ -45,7 +46,7 @@ class WidgetExtension implements DocumentRegistry.WidgetExtension {
 
 function createFactory(modelName?: string) {
   return new WidgetFactory({
-    name: uuid(),
+    name: UUID.uuid4(),
     modelName: modelName || 'text',
     fileTypes: ['text', 'foobar'],
     defaultFor: ['text', 'foobar']

+ 1 - 0
tests/test-filebrowser/package.json

@@ -22,6 +22,7 @@
     "@jupyterlab/filebrowser": "^0.17.0-0",
     "@jupyterlab/services": "^3.0.0-0",
     "@phosphor/algorithm": "^1.1.2",
+    "@phosphor/coreutils": "^1.3.0",
     "@phosphor/messaging": "^1.2.2",
     "@phosphor/signaling": "^1.2.2",
     "@phosphor/widgets": "^1.6.0",

+ 13 - 9
tests/test-filebrowser/src/model.spec.ts

@@ -4,9 +4,13 @@
 import expect = require('expect.js');
 
 import {
-  StateDB, uuid, PageConfig
+  StateDB, PageConfig
 } from '@jupyterlab/coreutils';
 
+import {
+  UUID
+} from '@phosphor/coreutils';
+
 import {
   DocumentManager, IDocumentManager
 } from '@jupyterlab/docmanager';
@@ -299,7 +303,7 @@ describe('filebrowser/model', () => {
     describe('#upload()', () => {
 
       it('should upload a file object', (done) => {
-        let fname = uuid() + '.html';
+        let fname = UUID.uuid4() + '.html';
         let file = new File(['<p>Hello world!</p>'], fname,
                             { type: 'text/html' });
         model.upload(file).then(contents => {
@@ -309,7 +313,7 @@ describe('filebrowser/model', () => {
       });
 
       it('should overwrite', () => {
-        let fname = uuid() + '.html';
+        let fname = UUID.uuid4() + '.html';
         let file = new File(['<p>Hello world!</p>'], fname,
                             { type: 'text/html' });
         return model.upload(file).then(contents => {
@@ -322,7 +326,7 @@ describe('filebrowser/model', () => {
       });
 
       it('should not overwrite', () => {
-        let fname = uuid() + '.html';
+        let fname = UUID.uuid4() + '.html';
         let file = new File(['<p>Hello world!</p>'], fname,
                             { type: 'text/html' });
         return model.upload(file).then(contents => {
@@ -335,7 +339,7 @@ describe('filebrowser/model', () => {
       });
 
       it('should emit the fileChanged signal', (done) => {
-        let fname = uuid() + '.html';
+        let fname = UUID.uuid4() + '.html';
         model.fileChanged.connect((sender, args) => {
           expect(sender).to.be(model);
           expect(args.type).to.be('save');
@@ -356,7 +360,7 @@ describe('filebrowser/model', () => {
         });
 
         it('should not upload large file', () => {
-          const fname = uuid() + '.html';
+          const fname = UUID.uuid4() + '.html';
           const file = new File([new ArrayBuffer(LARGE_FILE_SIZE + 1)], fname);
           return model.upload(file).then(() => {
             expect().fail('Upload should have failed');
@@ -378,7 +382,7 @@ describe('filebrowser/model', () => {
         });
 
         it('should not upload large notebook file', () => {
-          const fname = uuid() + '.ipynb';
+          const fname = UUID.uuid4() + '.ipynb';
           const file = new File([new ArrayBuffer(LARGE_FILE_SIZE + 1)], fname);
           return model.upload(file).then(() => {
             expect().fail('Upload should have failed');
@@ -389,7 +393,7 @@ describe('filebrowser/model', () => {
 
         for (const size of [CHUNK_SIZE - 1, CHUNK_SIZE, CHUNK_SIZE + 1, 2 * CHUNK_SIZE]) {
           it(`should upload a large file of size ${size}`, async () => {
-            const fname = uuid() + '.txt';
+            const fname = UUID.uuid4() + '.txt';
             const content = 'a'.repeat(size);
             const file = new File([content], fname);
             await model.upload(file);
@@ -398,7 +402,7 @@ describe('filebrowser/model', () => {
           });
         }
         it(`should produce progress as a large file uploads`, async () => {
-          const fname = uuid() + '.txt';
+          const fname = UUID.uuid4() + '.txt';
           const file = new File([new ArrayBuffer(2 * CHUNK_SIZE)], fname);
 
           const {cleanup, values: [start, first, second, finished]} = signalToPromises(model.uploadChanged, 4);

+ 1 - 1
tests/test-fileeditor/package.json

@@ -17,10 +17,10 @@
   },
   "dependencies": {
     "@jupyterlab/codemirror": "^0.17.0-0",
-    "@jupyterlab/coreutils": "^2.0.0-0",
     "@jupyterlab/docregistry": "^0.17.0-0",
     "@jupyterlab/fileeditor": "^0.17.0-0",
     "@jupyterlab/services": "^3.0.0-0",
+    "@phosphor/coreutils": "^1.3.0",
     "@phosphor/messaging": "^1.2.2",
     "@phosphor/widgets": "^1.6.0",
     "expect.js": "~0.3.1",

+ 5 - 5
tests/test-fileeditor/src/widget.spec.ts

@@ -16,8 +16,8 @@ import {
 } from 'simulate-event';
 
 import {
-  uuid
-} from '@jupyterlab/coreutils';
+  UUID
+} from '@phosphor/coreutils';
 
 import {
   ServiceManager
@@ -81,7 +81,7 @@ describe('fileeditorcodewrapper', () => {
     let widget: FileEditorCodeWrapper;
 
     beforeEach(() => {
-      let path = uuid() + '.py';
+      let path = UUID.uuid4() + '.py';
       context = new Context({ manager, factory: modelFactory, path });
       widget = new FileEditorCodeWrapper({
         factory: options => factoryService.newDocumentEditor(options),
@@ -126,7 +126,7 @@ describe('fileeditorcodewrapper', () => {
     let widget: LogFileEditor;
 
     beforeEach(() => {
-      let path = uuid() + '.py';
+      let path = UUID.uuid4() + '.py';
       context = new Context({ manager, factory: modelFactory, path });
       widget = new LogFileEditor({
         factory: options => factoryService.newDocumentEditor(options),
@@ -163,7 +163,7 @@ describe('fileeditorcodewrapper', () => {
           done();
         });
         context.initialize(true).then(() => {
-          return manager.contents.rename(context.path, uuid() + '.jl');
+          return manager.contents.rename(context.path, UUID.uuid4() + '.jl');
         }).catch(done);
       });
 

+ 1 - 1
tests/test-imageviewer/package.json

@@ -16,10 +16,10 @@
     "watch:src": "tsc -w --listEmittedFiles"
   },
   "dependencies": {
-    "@jupyterlab/coreutils": "^2.0.0-0",
     "@jupyterlab/docregistry": "^0.17.0-0",
     "@jupyterlab/imageviewer": "^0.17.0-0",
     "@jupyterlab/services": "^3.0.0-0",
+    "@phosphor/coreutils": "^1.3.0",
     "@phosphor/messaging": "^1.2.2",
     "@phosphor/widgets": "^1.6.0",
     "expect.js": "~0.3.1"

+ 4 - 4
tests/test-imageviewer/src/widget.spec.ts

@@ -4,8 +4,8 @@
 import expect = require('expect.js');
 
 import {
-  uuid
-} from '@jupyterlab/coreutils';
+  UUID
+} from '@phosphor/coreutils';
 
 import {
   Contents, ServiceManager
@@ -52,7 +52,7 @@ class LogImage extends ImageViewer {
  * The common image model.
  */
 const IMAGE: Partial<Contents.IModel> = {
-  path: uuid() + '.png',
+  path: UUID.uuid4() + '.png',
   type: 'file',
   mimetype: 'image/png',
   content:  'R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7',
@@ -100,7 +100,7 @@ describe('ImageViewer', () => {
     });
 
     it('should keep the title in sync with the file name', (done) => {
-      let newPath = (IMAGE as any).path = uuid() + '.png';
+      let newPath = (IMAGE as any).path = UUID.uuid4() + '.png';
       expect(widget.title.label).to.be(context.path);
       context.pathChanged.connect(() => {
         expect(widget.title.label).to.be(newPath);

+ 3 - 3
tests/test-rendermime/src/registry.spec.ts

@@ -4,8 +4,8 @@
 import expect = require('expect.js');
 
 import {
-  uuid
-} from '@jupyterlab/coreutils';
+  UUID
+} from '@phosphor/coreutils';
 
 import {
   Contents, Drive, ServiceManager, Session
@@ -307,7 +307,7 @@ describe('rendermime/registry', () => {
         contents = manager.contents;
         contents.addDrive(drive);
         return manager.ready.then(() => {
-          return manager.sessions.startNew({ path: uuid() });
+          return manager.sessions.startNew({ path: UUID.uuid4() });
         }).then(s => {
           session = s;
           resolver = new RenderMimeRegistry.UrlResolver({

+ 8 - 4
tests/utils.ts

@@ -19,9 +19,13 @@ import {
 } from '@jupyterlab/apputils';
 
 import {
-  nbformat, uuid
+  nbformat
 } from '@jupyterlab/coreutils';
 
+import {
+  UUID
+} from '@phosphor/coreutils';
+
 import {
   TextModelFactory, DocumentRegistry, Context
 } from '@jupyterlab/docregistry';
@@ -71,7 +75,7 @@ function createClientSession(options: Partial<ClientSession.IOptions> = {}): Pro
   return manager.ready.then(() => {
     return new ClientSession({
       manager,
-      path: options.path || uuid(),
+      path: options.path || UUID.uuid4(),
       name: options.name,
       type: options.type,
       kernelPreference: options.kernelPreference || {
@@ -91,7 +95,7 @@ export
 function createFileContext(path?: string, manager?: ServiceManager.IManager): Context<DocumentRegistry.IModel> {
   manager = manager || Private.manager;
   let factory = Private.textFactory;
-  path = path || uuid() + '.txt';
+  path = path || UUID.uuid4() + '.txt';
   return new Context({ manager, factory, path });
 }
 
@@ -104,7 +108,7 @@ async function createNotebookContext(path?: string, manager?: ServiceManager.IMa
   manager = manager || Private.manager;
   await manager.ready;
   const factory = Private.notebookFactory;
-  path = path || uuid() + '.ipynb';
+  path = path || UUID.uuid4() + '.ipynb';
   return new Context({
     manager, factory, path, kernelPreference: { name: manager.specs.default }
   });