Browse Source

Move instance tracker to app utils, fix import paths.

Afshin Darian 8 years ago
parent
commit
780a9f919f
39 changed files with 138 additions and 180 deletions
  1. 2 2
      packages/apputils-extension/src/settingeditor.ts
  2. 1 0
      packages/apputils/src/index.ts
  3. 9 13
      packages/apputils/src/instancetracker.ts
  4. 5 1
      packages/apputils/src/layoutrestorer.ts
  5. 18 22
      packages/console-extension/src/index.ts
  6. 12 12
      packages/console/src/foreign.ts
  7. 1 1
      packages/console/src/tracker.ts
  8. 20 24
      packages/console/src/widget.ts
  9. 0 1
      packages/coreutils/src/index.ts
  10. 0 1
      packages/csvviewer-extension/package.json
  11. 1 5
      packages/csvviewer-extension/src/index.ts
  12. 0 1
      packages/faq-extension/package.json
  13. 1 5
      packages/faq-extension/src/index.ts
  14. 4 4
      packages/faq-extension/src/widget.ts
  15. 2 2
      packages/filebrowser-extension/src/index.ts
  16. 5 1
      packages/filebrowser/src/factory.ts
  17. 2 2
      packages/fileeditor-extension/src/index.ts
  18. 4 4
      packages/fileeditor/src/index.ts
  19. 8 12
      packages/help-extension/src/index.ts
  20. 0 1
      packages/imageviewer-extension/package.json
  21. 1 5
      packages/imageviewer-extension/src/index.ts
  22. 1 1
      packages/imageviewer/package.json
  23. 4 4
      packages/imageviewer/src/index.ts
  24. 4 3
      packages/imageviewer/src/widget.ts
  25. 0 1
      packages/inspector-extension/package.json
  26. 1 5
      packages/inspector-extension/src/index.ts
  27. 4 4
      packages/inspector-extension/src/manager.ts
  28. 0 1
      packages/landing-extension/package.json
  29. 3 7
      packages/landing-extension/src/index.ts
  30. 4 4
      packages/landing-extension/src/widget.ts
  31. 0 1
      packages/markdownviewer-extension/package.json
  32. 1 5
      packages/markdownviewer-extension/src/index.ts
  33. 8 8
      packages/notebook/src/tracker.ts
  34. 0 1
      packages/terminal-extension/package.json
  35. 1 5
      packages/terminal-extension/src/index.ts
  36. 1 1
      packages/terminal/package.json
  37. 4 4
      packages/terminal/src/index.ts
  38. 4 4
      test/src/apputils/instancetracker.spec.ts
  39. 2 2
      test/src/apputils/layoutrestorer.spec.ts

+ 2 - 2
packages/apputils-extension/src/settingeditor.ts

@@ -8,11 +8,11 @@ import {
 } from '@jupyterlab/application';
 
 import {
-  ILayoutRestorer
+  ILayoutRestorer, InstanceTracker
 } from '@jupyterlab/apputils';
 
 import {
-  InstanceTracker, ISettingRegistry
+  ISettingRegistry
 } from '@jupyterlab/coreutils';
 
 import {

+ 1 - 0
packages/apputils/src/index.ts

@@ -11,6 +11,7 @@ export * from './dialog';
 export * from './domutils';
 export * from './hoverbox';
 export * from './iframe';
+export * from './instancetracker';
 export * from './layoutrestorer';
 export * from './mainmenu';
 export * from './sanitizer';

+ 9 - 13
packages/coreutils/src/instancetracker.ts → packages/apputils/src/instancetracker.ts

@@ -1,10 +1,18 @@
 // Copyright (c) Jupyter Development Team.
 // Distributed under the terms of the Modified BSD License.
 
+import {
+  IStateDB
+} from '@jupyterlab/coreutils';
+
 import {
   ArrayExt, each, find
 } from '@phosphor/algorithm';
 
+import {
+  CommandRegistry
+} from '@phosphor/commands';
+
 import {
   JSONObject
 } from '@phosphor/coreutils';
@@ -22,21 +30,9 @@ import {
 } from '@phosphor/signaling';
 
 import {
-  CommandRegistry
-} from '@phosphor/commands';
-
-import {
-  FocusTracker
-} from '@phosphor/widgets';
-
-import {
-  Widget
+  FocusTracker, Widget
 } from '@phosphor/widgets';
 
-import {
-  IStateDB
-} from './statedb';
-
 
 /**
  * An object that tracks widget instances.

+ 5 - 1
packages/apputils/src/layoutrestorer.ts

@@ -24,9 +24,13 @@ import {
 } from '@jupyterlab/application';
 
 import {
-  InstanceTracker, IStateDB
+  IStateDB
 } from '@jupyterlab/coreutils';
 
+import {
+  InstanceTracker
+} from '.';
+
 
 /* tslint:disable */
 /**

+ 18 - 22
packages/console-extension/src/index.ts

@@ -1,29 +1,13 @@
 // Copyright (c) Jupyter Development Team.
 // Distributed under the terms of the Modified BSD License.
 
-import {
-  IServiceManager
-} from '@jupyterlab/services';
-
-import {
-  find
-} from '@phosphor/algorithm';
-
-import {
-  JSONObject
-} from '@phosphor/coreutils';
-
-import {
-  Menu
-} from '@phosphor/widgets';
-
 import {
   JupyterLab, JupyterLabPlugin
 } from '@jupyterlab/application';
 
 import {
-  Dialog, ICommandPalette, ILayoutRestorer,
-  IMainMenu, showDialog
+  Dialog, ICommandPalette, ILayoutRestorer, IMainMenu, InstanceTracker,
+  showDialog
 } from '@jupyterlab/apputils';
 
 import {
@@ -34,10 +18,6 @@ import {
   IConsoleTracker, ConsolePanel
 } from '@jupyterlab/console';
 
-import {
-  InstanceTracker
-} from '@jupyterlab/coreutils';
-
 import {
   ILauncher
 } from '@jupyterlab/launcher';
@@ -46,6 +26,22 @@ import {
   IRenderMime
 } from '@jupyterlab/rendermime';
 
+import {
+  IServiceManager
+} from '@jupyterlab/services';
+
+import {
+  find
+} from '@phosphor/algorithm';
+
+import {
+  JSONObject
+} from '@phosphor/coreutils';
+
+import {
+  Menu
+} from '@phosphor/widgets';
+
 
 /**
  * The command IDs used by the console plugin.

+ 12 - 12
packages/console/src/foreign.ts

@@ -1,18 +1,6 @@
 // Copyright (c) Jupyter Development Team.
 // Distributed under the terms of the Modified BSD License.
 
-import {
-  KernelMessage
-} from '@jupyterlab/services';
-
-import {
-  IDisposable
-} from '@phosphor/disposable';
-
-import {
-  Signal
-} from '@phosphor/signaling';
-
 import {
   IClientSession
 } from '@jupyterlab/apputils';
@@ -25,6 +13,18 @@ import {
   nbformat
 } from '@jupyterlab/coreutils';
 
+import {
+  KernelMessage
+} from '@jupyterlab/services';
+
+import {
+  IDisposable
+} from '@phosphor/disposable';
+
+import {
+  Signal
+} from '@phosphor/signaling';
+
 
 /**
  * A handler for capturing API messages from other sessions that should be

+ 1 - 1
packages/console/src/tracker.ts

@@ -7,7 +7,7 @@ import {
 
 import {
   IInstanceTracker
-} from '@jupyterlab/coreutils';
+} from '@jupyterlab/apputils';
 
 import {
   ConsolePanel

+ 20 - 24
packages/console/src/widget.ts

@@ -1,30 +1,6 @@
 // Copyright (c) Jupyter Development Team.
 // Distributed under the terms of the Modified BSD License.
 
-import {
-  KernelMessage
-} from '@jupyterlab/services';
-
-import {
-  map, toArray
-} from '@phosphor/algorithm';
-
-import {
-  Message
-} from '@phosphor/messaging';
-
-import {
-  ISignal, Signal
-} from '@phosphor/signaling';
-
-import {
-  Panel, PanelLayout
-} from '@phosphor/widgets';
-
-import {
-  Widget
-} from '@phosphor/widgets';
-
 import {
   IClientSession
 } from '@jupyterlab/apputils';
@@ -47,6 +23,26 @@ import {
   IRenderMime
 } from '@jupyterlab/rendermime';
 
+import {
+  KernelMessage
+} from '@jupyterlab/services';
+
+import {
+  map, toArray
+} from '@phosphor/algorithm';
+
+import {
+  Message
+} from '@phosphor/messaging';
+
+import {
+  ISignal, Signal
+} from '@phosphor/signaling';
+
+import {
+  Panel, PanelLayout, Widget
+} from '@phosphor/widgets';
+
 import {
   ForeignHandler
 } from './foreign';

+ 0 - 1
packages/coreutils/src/index.ts

@@ -2,7 +2,6 @@
 // Distributed under the terms of the Modified BSD License.
 
 export * from './activitymonitor';
-export * from './instancetracker';
 export * from './interfaces';
 export * from './markdowncodeblocks';
 export * from './modeldb';

+ 0 - 1
packages/csvviewer-extension/package.json

@@ -14,7 +14,6 @@
   "dependencies": {
     "@jupyterlab/application": "^0.6.0",
     "@jupyterlab/apputils": "^0.6.0",
-    "@jupyterlab/coreutils": "^0.6.0",
     "@jupyterlab/csvviewer": "^0.6.0",
     "@jupyterlab/docregistry": "^0.6.0"
   },

+ 1 - 5
packages/csvviewer-extension/src/index.ts

@@ -6,13 +6,9 @@ import {
 } from '@jupyterlab/application';
 
 import {
-  ILayoutRestorer
+  ILayoutRestorer, InstanceTracker
 } from '@jupyterlab/apputils';
 
-import {
-  InstanceTracker
-} from '@jupyterlab/coreutils';
-
 import {
   CSVViewer, CSVViewerFactory
 } from '@jupyterlab/csvviewer';

+ 0 - 1
packages/faq-extension/package.json

@@ -15,7 +15,6 @@
   "dependencies": {
     "@jupyterlab/application": "^0.6.0",
     "@jupyterlab/apputils": "^0.6.0",
-    "@jupyterlab/coreutils": "^0.6.0",
     "@phosphor/messaging": "^1.2.0",
     "@phosphor/virtualdom": "^1.1.0"
   },

+ 1 - 5
packages/faq-extension/src/index.ts

@@ -6,13 +6,9 @@ import {
 } from '@jupyterlab/application';
 
 import {
-  ICommandLinker, ICommandPalette, ILayoutRestorer
+  ICommandLinker, ICommandPalette, ILayoutRestorer, InstanceTracker
 } from '@jupyterlab/apputils';
 
-import {
-  InstanceTracker
-} from '@jupyterlab/coreutils';
-
 import {
   FaqModel, FaqWidget
 } from './widget';

+ 4 - 4
packages/faq-extension/src/widget.ts

@@ -1,6 +1,10 @@
 // Copyright (c) Jupyter Development Team.
 // Distributed under the terms of the Modified BSD License.
 
+import {
+  ICommandLinker, VDomModel, VDomRenderer
+} from '@jupyterlab/apputils';
+
 import {
   Message
 } from '@phosphor/messaging';
@@ -9,10 +13,6 @@ import {
   h, VirtualNode
 } from '@phosphor/virtualdom';
 
-import {
-  ICommandLinker, VDomModel, VDomRenderer
-} from '@jupyterlab/apputils';
-
 
 /**
  * The class name added to the FAQ plugin.

+ 2 - 2
packages/filebrowser-extension/src/index.ts

@@ -6,11 +6,11 @@ import {
 } from '@jupyterlab/application';
 
 import {
-  ICommandPalette, ILayoutRestorer, IMainMenu
+  ICommandPalette, ILayoutRestorer, IMainMenu, InstanceTracker
 } from '@jupyterlab/apputils';
 
 import {
-  IChangedArgs, InstanceTracker, IStateDB
+  IChangedArgs, IStateDB
 } from '@jupyterlab/coreutils';
 
 import {

+ 5 - 1
packages/filebrowser/src/factory.ts

@@ -2,7 +2,11 @@
 // Distributed under the terms of the Modified BSD License.
 
 import {
-  InstanceTracker, IStateDB
+  InstanceTracker
+} from '@jupyterlab/apputils';
+
+import {
+  IStateDB
 } from '@jupyterlab/coreutils';
 
 import {

+ 2 - 2
packages/fileeditor-extension/src/index.ts

@@ -6,11 +6,11 @@ import {
 } from '@jupyterlab/application';
 
 import {
-  ILayoutRestorer
+  ILayoutRestorer, InstanceTracker
 } from '@jupyterlab/apputils';
 
 import {
-  InstanceTracker, ISettingRegistry
+  ISettingRegistry
 } from '@jupyterlab/coreutils';
 
 import {

+ 4 - 4
packages/fileeditor/src/index.ts

@@ -2,12 +2,12 @@
 // Distributed under the terms of the Modified BSD License.
 
 import {
- Token
-} from '@phosphor/coreutils';
+  IInstanceTracker
+} from '@jupyterlab/apputils';
 
 import {
-  IInstanceTracker
-} from '@jupyterlab/coreutils';
+ Token
+} from '@phosphor/coreutils';
 
 import {
   FileEditor

+ 8 - 12
packages/help-extension/src/index.ts

@@ -1,29 +1,25 @@
 // Copyright (c) Jupyter Development Team.
 // Distributed under the terms of the Modified BSD License.
 
-import {
-  Message
-} from '@phosphor/messaging';
-
-import {
-  Menu
-} from '@phosphor/widgets';
-
 import {
   JupyterLab, JupyterLabPlugin
 } from '@jupyterlab/application';
 
 import {
-  ICommandPalette, IFrame, ILayoutRestorer, IMainMenu
+  ICommandPalette, IFrame, ILayoutRestorer, IMainMenu, InstanceTracker
 } from '@jupyterlab/apputils';
 
 import {
-  InstanceTracker
+  PageConfig, URLExt
 } from '@jupyterlab/coreutils';
 
 import {
-  PageConfig, URLExt
-} from '@jupyterlab/coreutils';
+  Message
+} from '@phosphor/messaging';
+
+import {
+  Menu
+} from '@phosphor/widgets';
 
 import '../style/index.css';
 

+ 0 - 1
packages/imageviewer-extension/package.json

@@ -14,7 +14,6 @@
   "dependencies": {
     "@jupyterlab/application": "^0.6.0",
     "@jupyterlab/apputils": "^0.6.0",
-    "@jupyterlab/coreutils": "^0.6.0",
     "@jupyterlab/docregistry": "^0.6.0",
     "@jupyterlab/imageviewer": "^0.6.0"
   },

+ 1 - 5
packages/imageviewer-extension/src/index.ts

@@ -6,13 +6,9 @@ import {
 } from '@jupyterlab/application';
 
 import {
-  ICommandPalette, ILayoutRestorer
+  ICommandPalette, ILayoutRestorer, InstanceTracker
 } from '@jupyterlab/apputils';
 
-import {
-  InstanceTracker
-} from '@jupyterlab/coreutils';
-
 import {
   IDocumentRegistry
 } from '@jupyterlab/docregistry';

+ 1 - 1
packages/imageviewer/package.json

@@ -13,7 +13,7 @@
     "lib": "lib/"
   },
   "dependencies": {
-    "@jupyterlab/coreutils": "^0.6.0",
+    "@jupyterlab/apputils": "^0.6.0",
     "@jupyterlab/docregistry": "^0.6.0",
     "@phosphor/commands": "^1.2.0",
     "@phosphor/coreutils": "^1.1.0",

+ 4 - 4
packages/imageviewer/src/index.ts

@@ -2,12 +2,12 @@
 // Distributed under the terms of the Modified BSD License.
 
 import {
-  Token
-} from '@phosphor/coreutils';
+  IInstanceTracker
+} from '@jupyterlab/apputils';
 
 import {
-  IInstanceTracker
-} from '@jupyterlab/coreutils';
+  Token
+} from '@phosphor/coreutils';
 
 import {
   ImageViewer

+ 4 - 3
packages/imageviewer/src/widget.ts

@@ -1,6 +1,10 @@
 // Copyright (c) Jupyter Development Team.
 // Distributed under the terms of the Modified BSD License.
 
+import {
+  ABCWidgetFactory, DocumentRegistry
+} from '@jupyterlab/docregistry';
+
 import {
   Message
 } from '@phosphor/messaging';
@@ -9,9 +13,6 @@ import {
   Widget
 } from '@phosphor/widgets';
 
-import {
-  ABCWidgetFactory, DocumentRegistry
-} from '@jupyterlab/docregistry';
 
 /**
  * The class name added to a imageviewer.

+ 0 - 1
packages/inspector-extension/package.json

@@ -14,7 +14,6 @@
   "dependencies": {
     "@jupyterlab/application": "^0.6.0",
     "@jupyterlab/apputils": "^0.6.0",
-    "@jupyterlab/coreutils": "^0.6.0",
     "@jupyterlab/console": "^0.6.0",
     "@jupyterlab/inspector": "^0.6.0",
     "@jupyterlab/notebook": "^0.6.0",

+ 1 - 5
packages/inspector-extension/src/index.ts

@@ -6,13 +6,9 @@ import {
 } from '@jupyterlab/application';
 
 import {
-  ICommandPalette, ILayoutRestorer
+  ICommandPalette, ILayoutRestorer, InstanceTracker
 } from '@jupyterlab/apputils';
 
-import {
-  InstanceTracker
-} from '@jupyterlab/coreutils';
-
 import {
   IConsoleTracker
 } from '@jupyterlab/console';

+ 4 - 4
packages/inspector-extension/src/manager.ts

@@ -1,14 +1,14 @@
 // Copyright (c) Jupyter Development Team.
 // Distributed under the terms of the Modified BSD License.
 
-import {
-  IDisposable
-} from '@phosphor/disposable';
-
 import {
   IInspector, InspectorPanel
 } from '@jupyterlab/inspector';
 
+import {
+  IDisposable
+} from '@phosphor/disposable';
+
 
 /**
  * A class that manages inspector widget instances and offers persistent

+ 0 - 1
packages/landing-extension/package.json

@@ -15,7 +15,6 @@
   "dependencies": {
     "@jupyterlab/application": "^0.6.0",
     "@jupyterlab/apputils": "^0.6.0",
-    "@jupyterlab/coreutils": "^0.6.0",
     "@jupyterlab/filebrowser": "^0.6.0",
     "@jupyterlab/services": "^0.45.0",
     "@phosphor/messaging": "^1.2.0",

+ 3 - 7
packages/landing-extension/src/index.ts

@@ -1,21 +1,17 @@
 // Copyright (c) Jupyter Development Team.
 // Distributed under the terms of the Modified BSD License.
 
-import {
-  IServiceManager
-} from '@jupyterlab/services';
-
 import {
   JupyterLab, JupyterLabPlugin
 } from '@jupyterlab/application';
 
 import {
-  ICommandLinker, ICommandPalette, ILayoutRestorer
+  ICommandLinker, ICommandPalette, ILayoutRestorer, InstanceTracker
 } from '@jupyterlab/apputils';
 
 import {
-  InstanceTracker
-} from '@jupyterlab/coreutils';
+  IServiceManager
+} from '@jupyterlab/services';
 
 import {
   LandingModel, LandingWidget

+ 4 - 4
packages/landing-extension/src/widget.ts

@@ -1,6 +1,10 @@
 // Copyright (c) Jupyter Development Team.
 // Distributed under the terms of the Modified BSD License.
 
+import {
+  ICommandLinker, VDomModel, VDomRenderer
+} from '@jupyterlab/apputils';
+
 import {
   JSONObject
 } from '@phosphor/coreutils';
@@ -13,10 +17,6 @@ import {
   h, VirtualNode
 } from '@phosphor/virtualdom';
 
-import {
-  ICommandLinker, VDomModel, VDomRenderer
-} from '@jupyterlab/apputils';
-
 
 /**
  * The class name added to the landing scroll wrapper.

+ 0 - 1
packages/markdownviewer-extension/package.json

@@ -14,7 +14,6 @@
   "dependencies": {
     "@jupyterlab/application": "^0.6.0",
     "@jupyterlab/apputils": "^0.6.0",
-    "@jupyterlab/coreutils": "^0.6.0",
     "@jupyterlab/docregistry": "^0.6.0",
     "@jupyterlab/markdownviewer": "^0.6.0",
     "@jupyterlab/rendermime": "^0.6.0"

+ 1 - 5
packages/markdownviewer-extension/src/index.ts

@@ -6,13 +6,9 @@ import {
 } from '@jupyterlab/application';
 
 import {
-  ILayoutRestorer
+  ILayoutRestorer, InstanceTracker
 } from '@jupyterlab/apputils';
 
-import {
-  InstanceTracker
-} from '@jupyterlab/coreutils';
-
 import {
   IDocumentRegistry
 } from '@jupyterlab/docregistry';

+ 8 - 8
packages/notebook/src/tracker.ts

@@ -2,20 +2,20 @@
 // Distributed under the terms of the Modified BSD License.
 
 import {
-  Token
-} from '@phosphor/coreutils';
+  IInstanceTracker, InstanceTracker
+} from '@jupyterlab/apputils';
 
 import {
-  ISignal, Signal
-} from '@phosphor/signaling';
+  Cell
+} from '@jupyterlab/cells';
 
 import {
-  IInstanceTracker, InstanceTracker
-} from '@jupyterlab/coreutils';
+  Token
+} from '@phosphor/coreutils';
 
 import {
-  Cell
-} from '@jupyterlab/cells';
+  ISignal, Signal
+} from '@phosphor/signaling';
 
 import {
   NotebookPanel, Notebook

+ 0 - 1
packages/terminal-extension/package.json

@@ -14,7 +14,6 @@
   "dependencies": {
     "@jupyterlab/application": "^0.6.0",
     "@jupyterlab/apputils": "^0.6.0",
-    "@jupyterlab/coreutils": "^0.6.0",
     "@jupyterlab/launcher": "^0.6.0",
     "@jupyterlab/services": "^0.45.0",
     "@jupyterlab/terminal": "^0.6.0",

+ 1 - 5
packages/terminal-extension/src/index.ts

@@ -6,13 +6,9 @@ import {
 } from '@jupyterlab/application';
 
 import {
-  ICommandPalette, ILayoutRestorer, IMainMenu
+  ICommandPalette, ILayoutRestorer, IMainMenu, InstanceTracker
 } from '@jupyterlab/apputils';
 
-import {
-  InstanceTracker
-} from '@jupyterlab/coreutils';
-
 import {
   ILauncher
 } from '@jupyterlab/launcher';

+ 1 - 1
packages/terminal/package.json

@@ -13,7 +13,7 @@
     "lib": "lib/"
   },
   "dependencies": {
-    "@jupyterlab/coreutils": "^0.6.0",
+    "@jupyterlab/apputils": "^0.6.0",
     "@jupyterlab/services": "^0.45.0",
     "@phosphor/commands": "^1.2.0",
     "@phosphor/coreutils": "^1.1.0",

+ 4 - 4
packages/terminal/src/index.ts

@@ -2,12 +2,12 @@
 // Distributed under the terms of the Modified BSD License.
 
 import {
-  Token
-} from '@phosphor/coreutils';
+  IInstanceTracker
+} from '@jupyterlab/apputils';
 
 import {
-  IInstanceTracker
-} from '@jupyterlab/coreutils';
+  Token
+} from '@phosphor/coreutils';
 
 import {
   Terminal

+ 4 - 4
test/src/apputils/instancetracker.spec.ts

@@ -3,6 +3,10 @@
 
 import expect = require('expect.js');
 
+import {
+  InstanceTracker
+} from '@jupyterlab/apputils';
+
 import {
   each
 } from '@phosphor/algorithm';
@@ -15,10 +19,6 @@ import {
   simulate
 } from 'simulate-event';
 
-import {
-  InstanceTracker
-} from '@jupyterlab/coreutils';
-
 
 const namespace = 'instance-tracker-test';
 

+ 2 - 2
test/src/apputils/layoutrestorer.spec.ts

@@ -8,11 +8,11 @@ import {
 } from '@jupyterlab/application';
 
 import {
-  LayoutRestorer
+  InstanceTracker, LayoutRestorer
 } from '@jupyterlab/apputils';
 
 import {
-  InstanceTracker, StateDB
+  StateDB
 } from '@jupyterlab/coreutils';
 
 import {