Browse Source

wip clean up launching

Steven Silvester 8 years ago
parent
commit
a402ecc2df
6 changed files with 3 additions and 195 deletions
  1. 0 1
      MANIFEST.in
  2. 0 30
      jupyterlab/build.js
  3. 0 56
      jupyterlab/error.html
  4. 0 72
      jupyterlab/lab.html
  5. 3 5
      jupyterlab/package.json
  6. 0 31
      jupyterlab/webpack.config.js

+ 0 - 1
MANIFEST.in

@@ -1,6 +1,5 @@
 recursive-include jupyterlab/build *
 
-include jupyterlab/lab.html
 include package.json
 include LICENSE
 include CONTRIBUTING.md

+ 0 - 30
jupyterlab/build.js

@@ -1,30 +0,0 @@
-// Populate the git description and version of the package.json.
-var childProcess = require('child_process');
-var fs = require('fs-extra');
-var package_data = require('./package.json');
-
-
-// Get the git description.
-try {
-  var notice = childProcess.execSync('git describe', { encoding: 'utf8' });
-} catch (e) {
-  var notice = 'unknown';
-}
-
-
-// Get the python package version.
-var cwd = process.cwd();
-process.chdir('..');
-try {
-  var version = childProcess.execSync('python setup.py --version', { encoding: 'utf8' });
-} catch (e) {
-  var version = 'unknown';
-}
-process.chdir(cwd);
-
-
-package_data.jupyterlab.version = version.trim();
-package_data.jupyterlab.gitDescription = notice.trim();
-
-var pkg = JSON.stringify(package_data, null, 2);
-fs.writeFileSync('./package.json',  pkg + '\n');

+ 0 - 56
jupyterlab/error.html

@@ -1,56 +0,0 @@
-<!DOCTYPE html>
-<!--
-Copyright (c) Jupyter Development Team.
-Distributed under the terms of the Modified BSD License.
--->
-<html>
-
-<head>
-  <meta charset="utf-8">
-
-  <title>{% block title %}{{page_title}}{% endblock %}</title>
-
-  {% block favicon %}<link rel="shortcut icon" type="image/x-icon" href="/static/base/images/favicon.ico">{% endblock %}
-
-</head>
-
-<body>
-
-{% block stylesheet %}
-<style type="text/css">
-/* disable initial hide */
-div#header, div#site {
-    display: block;
-}
-</style>
-{% endblock %}
-{% block site %}
-
-<div class="error">
-    {% block h1_error %}
-    <h1>{{status_code}} : {{status_message}}</h1>
-    {% endblock h1_error %}
-    {% block error_detail %}
-    {% if message %}
-    <p>The error was:</p>
-    <div class="traceback-wrapper">
-    <pre class="traceback">{{message}}</pre>
-    </div>
-    {% endif %}
-    {% endblock %}
-</header>
-
-{% endblock %}
-
-{% block script %}
-<script type='text/javascript'>
-window.onload = function () {
-  var tb = document.getElementsByClassName('traceback')[0];
-  tb.scrollTop = tb.scrollHeight;
-};
-</script>
-{% endblock script %}
-
-</body>
-
-</html>

+ 0 - 72
jupyterlab/lab.html

@@ -1,72 +0,0 @@
-<!DOCTYPE html>
-<!--
-Copyright (c) Jupyter Development Team.
-Distributed under the terms of the Modified BSD License.
--->
-<html>
-
-<head>
-  <meta charset="utf-8">
-
-  <title>{% block title %}{{page_title}}{% endblock %}</title>
-
-  {% block stylesheet %}
-    {% for css_file in jupyterlab_css %}
-      <link href="{{ css_file }}" rel="stylesheet">
-    {% endfor %}
-  {% endblock %}
-
-  <script id="jupyter-config-data" type="application/json">{
-    {% for key, value in jupyterlab_config.items() -%}
-    "{{ key }}": "{{ value }}",
-    {% endfor -%}
-    "baseUrl": "{{base_url | urlencode}}",
-    "wsUrl": "{{ws_url | urlencode}}"
-  }</script>
-
-  {% block favicon %}<link rel="shortcut icon" type="image/x-icon" href="{{ base_url }}static/base/images/favicon.ico">{% endblock %}
-
-  {% for bundle_file in jupyterlab_bundles %}
-  <script src="{{ bundle_file }}" type="text/javascript" charset="utf-8"></script>
-  {% endfor %}
-
-  {% if mathjax_url %}
-  <script type="text/javascript" src="{{mathjax_url}}?config={{mathjax_config}}&amp;delayStartupUntil=configured" charset="utf-8"></script>
-  {% endif %}
-
-  {% block meta %}
-  {% endblock %}
-
-</head>
-
-<body>
-
-<script type="text/javascript">
-  function _remove_token_from_url() {
-    if (window.location.search.length <= 1) {
-      return;
-    }
-    var search_parameters = window.location.search.slice(1).split('&');
-    for (var i = 0; i < search_parameters.length; i++) {
-      if (search_parameters[i].split('=')[0] === 'token') {
-        // remote token from search parameters
-        search_parameters.splice(i, 1);
-        var new_search = '';
-        if (search_parameters.length) {
-          new_search = '?' + search_parameters.join('&');
-        }
-        var new_url = window.location.origin +
-                      window.location.pathname +
-                      new_search +
-                      window.location.hash;
-        window.history.replaceState({}, "", new_url);
-        return;
-      }
-    }
-  }
-  _remove_token_from_url();
-</script>
-
-</body>
-
-</html>

+ 3 - 5
jupyterlab/package.json

@@ -1,8 +1,8 @@
 {
   "private": true,
-  "name": "@jupyterlab/application-top",
+  "name": "@jupyterlab/dev-application",
   "scripts": {
-    "build": "node build.js && webpack"
+    "build": "webpack"
   },
   "dependencies": {
     "@jupyterlab/about-extension": "^0.3.1",
@@ -76,9 +76,7 @@
       "@jupyterlab/tabmanager-extension",
       "@jupyterlab/terminal-extension",
       "@jupyterlab/tooltip-extension"
-    ],
-    "version": "0.20.1",
-    "gitDescription": "v0.18.0-0-941-gb0fff0c4"
+    ]
   },
   "version": "0.1.2"
 }

+ 0 - 31
jupyterlab/webpack.config.js

@@ -1,4 +1,3 @@
-var childProcess = require('child_process');
 var webpack = require('webpack');
 var path = require('path');
 var fs = require('fs-extra');
@@ -26,30 +25,6 @@ hash.update(fs.readFileSync('./package.json'));
 fs.writeFileSync('build/hash.md5', hash.digest('hex'));
 
 
-// Get the version and git description if needed
-if (!package_data.jupyterlab.version) {
-  try {
-    var notice = childProcess.execSync('git describe', { encoding: 'utf8' });
-  } catch (e) {
-    var notice = 'unknown';
-  }
-
-
-  // Get the python package version.
-  var cwd = process.cwd();
-  process.chdir('..');
-  try {
-    var version = childProcess.execSync('python setup.py --version', { encoding: 'utf8' });
-  } catch (e) {
-    var version = 'unknown';
-  }
-  process.chdir(cwd);
-
-  package_data.jupyterlab.version = version;
-  package_data.jupyterlab.gitDescription = notice;
-}
-
-
 // Note that we have to use an explicit local public path
 // otherwise the urls in the extracted CSS will point to the wrong
 // location.
@@ -88,12 +63,6 @@ module.exports = {
   bail: true,
   devtool: 'source-map',
   plugins: [
-      new webpack.DefinePlugin({
-        'process.env': {
-          'GIT_DESCRIPTION': '"' + package_data.jupyterlab.gitDescription + '"',
-          'JUPYTERLAB_VERSION': '"' + package_data.jupyterlab.version + '"'
-        }
-      }),
       new ExtractTextPlugin('[name].css')
     ]
 }