소스 검색

Merge branch 'master' into pr/blink1073/6219

Jason Grout 6 년 전
부모
커밋
559b69e3e0

+ 12 - 4
docs/source/user/extensions.rst

@@ -230,6 +230,14 @@ rebuild, you can run the command:
 
     jupyter lab build
 
+
+**Note**
+If using Windows, you may encounter a `FileNotFoundError` due to the default PATH length on
+Windows.  Node modules are stored in a nested file structure, so the path can get quite
+long.  If you have administrative access and are on Windows 8 or 10, you can update the
+registry setting using these instructions: https://stackoverflow.com/a/37528731.
+
+
 Disabling Extensions
 ^^^^^^^^^^^^^^^^^^^^
 
@@ -335,16 +343,16 @@ The following configurations may be present in this file:
 
 1. ``terminalsAvailable`` identifies whether a terminal (i.e. ``bash/tsch``
    on Mac/Linux OR ``PowerShell`` on Windows) is available to be launched
-   via the Launcher. (This configuration was predominantly required for 
+   via the Launcher. (This configuration was predominantly required for
    Windows prior to PowerShell access being enabled in Jupyter Lab.) The
    value for this field is a Boolean: ``true`` or ``false``.
 2. ``disabledExtensions`` controls which extensions should not load at all.
-3. ``deferredExtensions`` controls which extensions should not load until 
-   they are required by something, irrespective of whether they set 
+3. ``deferredExtensions`` controls which extensions should not load until
+   they are required by something, irrespective of whether they set
    ``autostart`` to ``true``.
 
 The value for the ``disabledExtensions`` and ``deferredExtensions`` fields
-are an array of strings. The following sequence of checks are performed 
+are an array of strings. The following sequence of checks are performed
 against the patterns in ``disabledExtensions`` and ``deferredExtensions``.
 
 -  If an identical string match occurs between a config value and a

+ 1 - 4
jupyterlab/labapp.py

@@ -26,12 +26,9 @@ build_aliases = dict(base_aliases)
 build_aliases['app-dir'] = 'LabBuildApp.app_dir'
 build_aliases['name'] = 'LabBuildApp.name'
 build_aliases['version'] = 'LabBuildApp.version'
+build_aliases['dev-build'] = 'LabBuildApp.dev_build'
 
 build_flags = dict(flags)
-build_flags['dev'] = (
-    {'LabBuildApp': {'dev_build': True}},
-    "Build in Development mode"
-)
 
 version = __version__
 app_version = get_app_version()

+ 1 - 4
jupyterlab/labextensions.py

@@ -26,10 +26,6 @@ flags['no-build'] = (
     {'BaseExtensionApp': {'should_build': False}},
     "Defer building the app after the action."
 )
-flags['dev-build'] = (
-    {'BaseExtensionApp': {'dev_build': True}},
-    "Build in Development mode"
-)
 flags['clean'] = (
     {'BaseExtensionApp': {'should_clean': True}},
     "Cleanup intermediate files after the action."
@@ -55,6 +51,7 @@ uninstall_flags['all'] = (
 
 aliases = dict(base_aliases)
 aliases['app-dir'] = 'BaseExtensionApp.app_dir'
+aliases['dev-build'] = 'BaseExtensionApp.dev_build'
 
 VERSION = get_app_version()
 

+ 1 - 1
package.json

@@ -76,7 +76,7 @@
     "lerna": "^3.13.2",
     "lint-staged": "^8.1.5",
     "opn-cli": "^4.1.0",
-    "prettier": "^1.16.4",
+    "prettier": "^1.17.0",
     "tslint": "^5.15.0",
     "tslint-config-prettier": "^1.18.0",
     "tslint-plugin-prettier": "^2.0.1",

+ 5 - 2
packages/console-extension/src/index.ts

@@ -39,7 +39,7 @@ import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
 
 import { find } from '@phosphor/algorithm';
 
-import { ReadonlyJSONObject } from '@phosphor/coreutils';
+import { ReadonlyJSONObject, JSONObject } from '@phosphor/coreutils';
 
 import { DisposableSet } from '@phosphor/disposable';
 
@@ -460,7 +460,10 @@ async function activateConsole(
           if (args['activate'] !== false) {
             shell.activateById(widget.id);
           }
-          void widget.console.inject(args['code'] as string);
+          void widget.console.inject(
+            args['code'] as string,
+            args['metadata'] as JSONObject
+          );
           return true;
         }
         return false;

+ 5 - 2
packages/console/src/widget.ts

@@ -28,7 +28,7 @@ import { KernelMessage } from '@jupyterlab/services';
 
 import { each } from '@phosphor/algorithm';
 
-import { MimeData } from '@phosphor/coreutils';
+import { MimeData, JSONObject } from '@phosphor/coreutils';
 
 import { Drag } from '@phosphor/dragdrop';
 
@@ -337,9 +337,12 @@ export class CodeConsole extends Widget {
    *
    * @returns A promise that indicates when the injected cell's execution ends.
    */
-  inject(code: string): Promise<void> {
+  inject(code: string, metadata: JSONObject = {}): Promise<void> {
     let cell = this.createCodeCell();
     cell.model.value.text = code;
+    for (let key of Object.keys(metadata)) {
+      cell.model.metadata.set(key, metadata[key]);
+    }
     this.addCell(cell);
     return this._execute(cell);
   }

+ 3 - 1
packages/notebook-extension/src/index.ts

@@ -956,6 +956,7 @@ function addCommands(
       const { context, content } = current;
 
       let cell = content.activeCell;
+      let metadata = cell.model.metadata.toJSON();
       let path = context.path;
       // ignore action in non-code cell
       if (!cell || cell.model.type !== 'code') {
@@ -997,7 +998,8 @@ function addCommands(
       await commands.execute('console:inject', {
         activate: false,
         code,
-        path
+        path,
+        metadata
       });
     },
     isEnabled

+ 1 - 2
tsconfigbase.json

@@ -6,7 +6,6 @@
     "esModuleInterop": true,
     "incremental": true,
     "jsx": "react",
-    "lib": ["dom", "es2015"],
     "module": "esnext",
     "moduleResolution": "node",
     "noEmitOnError": true,
@@ -14,7 +13,7 @@
     "noUnusedLocals": true,
     "preserveWatchOutput": true,
     "resolveJsonModule": true,
-    "target": "es2015",
+    "target": "es2017",
     "types": []
   }
 }

+ 4 - 4
yarn.lock

@@ -8355,10 +8355,10 @@ prettier-linter-helpers@^1.0.0:
   dependencies:
     fast-diff "^1.1.2"
 
-prettier@^1.16.4:
-  version "1.16.4"
-  resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.16.4.tgz#73e37e73e018ad2db9c76742e2647e21790c9717"
-  integrity sha512-ZzWuos7TI5CKUeQAtFd6Zhm2s6EpAD/ZLApIhsF9pRvRtM1RFo61dM/4MSRUA0SuLugA/zgrZD8m0BaY46Og7g==
+prettier@^1.17.0:
+  version "1.17.0"
+  resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.17.0.tgz#53b303676eed22cc14a9f0cec09b477b3026c008"
+  integrity sha512-sXe5lSt2WQlCbydGETgfm1YBShgOX4HxQkFPvbxkcwgDvGDeqVau8h+12+lmSVlP3rHPz0oavfddSZg/q+Szjw==
 
 pretty-error@^2.0.2:
   version "2.1.1"