Merge pull request #2011 from minrk/unwebpack
unwebpackify
commit
666ecbf35c
@ -1,11 +0,0 @@
|
||||
// Copyright (c) Jupyter Development Team.
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
// TODO: Remove me in 6.0!
|
||||
|
||||
define([], function() {
|
||||
console.warn(['Importing jquery and associated libraries, such as',
|
||||
'bootstrap, is deprecated. This functionality will be remove in the',
|
||||
'notebook 6.0 in favor of a fully loaded jQuery global'].join(' '));
|
||||
return window.$;
|
||||
});
|
||||
@ -1,10 +0,0 @@
|
||||
// Copyright (c) Jupyter Development Team.
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
// TODO: Remove me in 6.0!
|
||||
|
||||
define([], function() {
|
||||
console.warn(['Importing bootstrap tour is deprecated. This feature will',
|
||||
'be remove in the notebook 6.0 in favor of the Tour global object.'].join(' '));
|
||||
return window.Tour;
|
||||
});
|
||||
@ -1,12 +0,0 @@
|
||||
// Copyright (c) Jupyter Development Team.
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
// TODO: Remove me in 6.0!
|
||||
|
||||
define([], function() {
|
||||
console.warn(['Importing typeahead is deprecated because it is associated',
|
||||
'with a global jquery variable. This feature will be removed in the',
|
||||
'notebook 6.0 in favor of a jquery global. Alternatively use',
|
||||
'typeahead via `$.typeahead.`'].join(' '));
|
||||
return $.typeahead;
|
||||
});
|
||||
@ -1,79 +0,0 @@
|
||||
// Copyright (c) Jupyter Development Team.
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
// TODO: Remove me in notebook version 6.0
|
||||
|
||||
[
|
||||
'edit/js/savewidget',
|
||||
'edit/js/main',
|
||||
'edit/js/menubar',
|
||||
'edit/js/editor',
|
||||
'edit/js/notificationarea',
|
||||
'base/js/keyboard',
|
||||
'base/js/dialog',
|
||||
'base/js/notificationwidget',
|
||||
'base/js/namespace',
|
||||
'base/js/utils',
|
||||
'base/js/notificationarea',
|
||||
'base/js/events',
|
||||
'base/js/security',
|
||||
'base/js/page',
|
||||
'auth/js/main',
|
||||
'auth/js/logoutmain',
|
||||
'auth/js/loginmain',
|
||||
'auth/js/loginwidget',
|
||||
'terminal/js/main',
|
||||
'terminal/js/terminado',
|
||||
'notebook/js/toolbar',
|
||||
'notebook/js/savewidget',
|
||||
'notebook/js/main',
|
||||
'notebook/js/completer',
|
||||
'notebook/js/contexthint',
|
||||
'notebook/js/textcell',
|
||||
'notebook/js/cell',
|
||||
'notebook/js/tour',
|
||||
'notebook/js/menubar',
|
||||
'notebook/js/mathjaxutils',
|
||||
'notebook/js/codecell',
|
||||
'notebook/js/codemirror-ipython',
|
||||
'notebook/js/kernelselector',
|
||||
'notebook/js/codemirror-ipythongfm',
|
||||
'notebook/js/celltoolbarpresets/example',
|
||||
'notebook/js/celltoolbarpresets/default',
|
||||
'notebook/js/celltoolbarpresets/slideshow',
|
||||
'notebook/js/celltoolbarpresets/rawcell',
|
||||
'notebook/js/tooltip',
|
||||
'notebook/js/maintoolbar',
|
||||
'notebook/js/about',
|
||||
'notebook/js/notificationarea',
|
||||
'notebook/js/quickhelp',
|
||||
'notebook/js/actions',
|
||||
'notebook/js/pager',
|
||||
'notebook/js/searchandreplace',
|
||||
'notebook/js/keyboardmanager',
|
||||
'notebook/js/notebook',
|
||||
'notebook/js/scrollmanager',
|
||||
'notebook/js/outputarea',
|
||||
'notebook/js/celltoolbar',
|
||||
'notebook/js/commandpalette',
|
||||
'tree/js/sessionlist',
|
||||
'tree/js/main',
|
||||
'tree/js/kernellist',
|
||||
'tree/js/newnotebook',
|
||||
'tree/js/terminallist',
|
||||
'tree/js/notebooklist',
|
||||
'services/sessions/session',
|
||||
'services/contents',
|
||||
'services/kernels/serialize',
|
||||
'services/kernels/comm',
|
||||
'services/kernels/kernel',
|
||||
'services/config'
|
||||
].forEach(function (modulePath) {
|
||||
define(modulePath, ['notebook'], function(notebookApp) {
|
||||
console.warn(["Direct module require deprecated. Instead of using",
|
||||
"`define(['" + modulePath + "'], function(module) {});`, use",
|
||||
"`define(['notebook'], function(notebookApp) { var module = ",
|
||||
"notebookApp['" + modulePath + "']});`"].join(' '));
|
||||
return notebookApp[modulePath];
|
||||
});
|
||||
});
|
||||
@ -1,70 +0,0 @@
|
||||
// Copyright (c) Jupyter Development Team.
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
__webpack_public_path__ = window['staticURL'] + 'built/';
|
||||
|
||||
module.exports = {
|
||||
'edit/js/savewidget': require('./edit/js/savewidget.js'),
|
||||
// 'edit/js/main': require('./edit/js/main.js'),
|
||||
'edit/js/menubar': require('./edit/js/menubar.js'),
|
||||
'edit/js/editor': require('./edit/js/editor.js'),
|
||||
'edit/js/notificationarea': require('./edit/js/notificationarea.js'),
|
||||
'base/js/keyboard': require('./base/js/keyboard.js'),
|
||||
'base/js/dialog': require('./base/js/dialog.js'),
|
||||
'base/js/notificationwidget': require('./base/js/notificationwidget.js'),
|
||||
'base/js/namespace': require('./base/js/namespace.js'),
|
||||
'base/js/utils': require('./base/js/utils.js'),
|
||||
'base/js/notificationarea': require('./base/js/notificationarea.js'),
|
||||
'base/js/events': require('./base/js/events.js'),
|
||||
'base/js/security': require('./base/js/security.js'),
|
||||
'base/js/page': require('./base/js/page.js'),
|
||||
'auth/js/main': require('./auth/js/main.js'),
|
||||
'auth/js/logoutmain': require('./auth/js/logoutmain.js'),
|
||||
'auth/js/loginmain': require('./auth/js/loginmain.js'),
|
||||
'auth/js/loginwidget': require('./auth/js/loginwidget.js'),
|
||||
// 'terminal/js/main': require('./terminal/js/main.js'),
|
||||
'terminal/js/terminado': require('./terminal/js/terminado.js'),
|
||||
'notebook/js/toolbar': require('./notebook/js/toolbar.js'),
|
||||
'notebook/js/savewidget': require('./notebook/js/savewidget.js'),
|
||||
// 'notebook/js/main': require('./notebook/js/main.js'),
|
||||
'notebook/js/completer': require('./notebook/js/completer.js'),
|
||||
'notebook/js/contexthint': require('./notebook/js/contexthint.js'),
|
||||
'notebook/js/textcell': require('./notebook/js/textcell.js'),
|
||||
'notebook/js/cell': require('./notebook/js/cell.js'),
|
||||
'notebook/js/tour': require('./notebook/js/tour.js'),
|
||||
'notebook/js/menubar': require('./notebook/js/menubar.js'),
|
||||
'notebook/js/mathjaxutils': require('./notebook/js/mathjaxutils.js'),
|
||||
'notebook/js/codecell': require('./notebook/js/codecell.js'),
|
||||
'notebook/js/codemirror-ipython': require('./notebook/js/codemirror-ipython.js'),
|
||||
'notebook/js/kernelselector': require('./notebook/js/kernelselector.js'),
|
||||
'notebook/js/codemirror-ipythongfm': require('./notebook/js/codemirror-ipythongfm.js'),
|
||||
'notebook/js/celltoolbarpresets/example': require('./notebook/js/celltoolbarpresets/example.js'),
|
||||
'notebook/js/celltoolbarpresets/default': require('./notebook/js/celltoolbarpresets/default.js'),
|
||||
'notebook/js/celltoolbarpresets/slideshow': require('./notebook/js/celltoolbarpresets/slideshow.js'),
|
||||
'notebook/js/celltoolbarpresets/rawcell': require('./notebook/js/celltoolbarpresets/rawcell.js'),
|
||||
'notebook/js/tooltip': require('./notebook/js/tooltip.js'),
|
||||
'notebook/js/maintoolbar': require('./notebook/js/maintoolbar.js'),
|
||||
'notebook/js/about': require('./notebook/js/about.js'),
|
||||
'notebook/js/notificationarea': require('./notebook/js/notificationarea.js'),
|
||||
'notebook/js/quickhelp': require('./notebook/js/quickhelp.js'),
|
||||
'notebook/js/actions': require('./notebook/js/actions.js'),
|
||||
'notebook/js/pager': require('./notebook/js/pager.js'),
|
||||
'notebook/js/searchandreplace': require('./notebook/js/searchandreplace.js'),
|
||||
'notebook/js/keyboardmanager': require('./notebook/js/keyboardmanager.js'),
|
||||
'notebook/js/notebook': require('./notebook/js/notebook.js'),
|
||||
'notebook/js/scrollmanager': require('./notebook/js/scrollmanager.js'),
|
||||
'notebook/js/outputarea': require('./notebook/js/outputarea.js'),
|
||||
'notebook/js/celltoolbar': require('./notebook/js/celltoolbar.js'),
|
||||
'notebook/js/commandpalette': require('./notebook/js/commandpalette.js'),
|
||||
'tree/js/sessionlist': require('./tree/js/sessionlist.js'),
|
||||
// 'tree/js/main': require('./tree/js/main.js'),
|
||||
'tree/js/kernellist': require('./tree/js/kernellist.js'),
|
||||
'tree/js/newnotebook': require('./tree/js/newnotebook.js'),
|
||||
'tree/js/terminallist': require('./tree/js/terminallist.js'),
|
||||
'tree/js/notebooklist': require('./tree/js/notebooklist.js'),
|
||||
'services/sessions/session': require('./services/sessions/session.js'),
|
||||
'services/contents': require('./services/contents.js'),
|
||||
'services/kernels/serialize': require('./services/kernels/serialize.js'),
|
||||
'services/kernels/comm': require('./services/kernels/comm.js'),
|
||||
'services/kernels/kernel': require('./services/kernels/kernel.js'),
|
||||
'services/config': require('./services/config.js'),
|
||||
};
|
||||
@ -1,100 +0,0 @@
|
||||
/**
|
||||
* This module tests the deprecated requirejs module path based loading API
|
||||
*/
|
||||
|
||||
// TODO: Remove these tests in notebook 6.0!
|
||||
|
||||
function guid() {
|
||||
return Math.random().toString(36).replace(/[^a-z]+/g, '');
|
||||
}
|
||||
|
||||
casper.notebook_test(function () {
|
||||
var that = this;
|
||||
|
||||
[
|
||||
'edit/js/savewidget',
|
||||
// 'edit/js/main',
|
||||
'edit/js/menubar',
|
||||
'edit/js/editor',
|
||||
'edit/js/notificationarea',
|
||||
'base/js/keyboard',
|
||||
'base/js/dialog',
|
||||
'base/js/notificationwidget',
|
||||
'base/js/namespace',
|
||||
'base/js/utils',
|
||||
'base/js/notificationarea',
|
||||
'base/js/events',
|
||||
'base/js/security',
|
||||
'base/js/page',
|
||||
'auth/js/main',
|
||||
'auth/js/logoutmain',
|
||||
'auth/js/loginmain',
|
||||
'auth/js/loginwidget',
|
||||
// 'terminal/js/main',
|
||||
'terminal/js/terminado',
|
||||
'notebook/js/toolbar',
|
||||
'notebook/js/savewidget',
|
||||
// 'notebook/js/main',
|
||||
'notebook/js/completer',
|
||||
'notebook/js/contexthint',
|
||||
'notebook/js/textcell',
|
||||
'notebook/js/cell',
|
||||
'notebook/js/tour',
|
||||
'notebook/js/menubar',
|
||||
'notebook/js/mathjaxutils',
|
||||
'notebook/js/codecell',
|
||||
'notebook/js/codemirror-ipython',
|
||||
'notebook/js/kernelselector',
|
||||
'notebook/js/codemirror-ipythongfm',
|
||||
'notebook/js/celltoolbarpresets/example',
|
||||
'notebook/js/celltoolbarpresets/default',
|
||||
'notebook/js/celltoolbarpresets/slideshow',
|
||||
'notebook/js/celltoolbarpresets/rawcell',
|
||||
'notebook/js/tooltip',
|
||||
'notebook/js/maintoolbar',
|
||||
'notebook/js/about',
|
||||
'notebook/js/notificationarea',
|
||||
'notebook/js/quickhelp',
|
||||
'notebook/js/actions',
|
||||
'notebook/js/pager',
|
||||
'notebook/js/searchandreplace',
|
||||
'notebook/js/keyboardmanager',
|
||||
'notebook/js/notebook',
|
||||
'notebook/js/scrollmanager',
|
||||
'notebook/js/outputarea',
|
||||
'notebook/js/celltoolbar',
|
||||
'notebook/js/commandpalette',
|
||||
'tree/js/sessionlist',
|
||||
// 'tree/js/main',
|
||||
'tree/js/kernellist',
|
||||
'tree/js/newnotebook',
|
||||
'tree/js/terminallist',
|
||||
'tree/js/notebooklist',
|
||||
'services/sessions/session',
|
||||
'services/contents',
|
||||
'services/kernels/serialize',
|
||||
'services/kernels/comm',
|
||||
'services/kernels/kernel',
|
||||
'services/config'
|
||||
].forEach(function (name) {
|
||||
var guid = that.evaluate(function(name) {
|
||||
var guid = Math.random().toString(36).replace(/[^a-z]+/g, '');
|
||||
require(['notebook', name], function(notebookApp, module) {
|
||||
window[guid] = (notebookApp[name] === module);
|
||||
});
|
||||
return guid;
|
||||
}, {name: name});
|
||||
|
||||
that.waitFor(function() {
|
||||
return this.evaluate(function(guid) {
|
||||
return window[guid] !== undefined;
|
||||
}, {guid: guid});
|
||||
});
|
||||
|
||||
that.then(function() {
|
||||
this.test.assertEquals(this.evaluate(function(guid) {
|
||||
return window[guid];
|
||||
}, {guid: guid}), true, name + ' can be loaded directly with requirejs');
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,68 @@
|
||||
// build main.min.js
|
||||
// spawned by gulp to allow parallelism
|
||||
|
||||
var rjs = require('requirejs').optimize;
|
||||
|
||||
var name = process.argv[2];
|
||||
|
||||
var rjs_config = {
|
||||
name: name + '/js/main',
|
||||
out: './notebook/static/' + name + '/js/main.min.js',
|
||||
baseUrl: 'notebook/static',
|
||||
preserveLicenseComments: false, // license comments conflict with sourcemap generation
|
||||
generateSourceMaps: true,
|
||||
optimize: "none",
|
||||
paths: {
|
||||
underscore : 'components/underscore/underscore-min',
|
||||
backbone : 'components/backbone/backbone-min',
|
||||
jquery: 'components/jquery/jquery.min',
|
||||
bootstrap: 'components/bootstrap/js/bootstrap.min',
|
||||
bootstraptour: 'components/bootstrap-tour/build/js/bootstrap-tour.min',
|
||||
"jquery-ui": 'components/jquery-ui/ui/minified/jquery-ui.min',
|
||||
moment: 'components/moment/moment',
|
||||
codemirror: 'components/codemirror',
|
||||
xterm: 'components/xterm.js/dist/xterm',
|
||||
typeahead: 'components/jquery-typeahead/dist/jquery.typeahead',
|
||||
contents: 'empty:',
|
||||
custom: 'empty:',
|
||||
},
|
||||
map: { // for backward compatibility
|
||||
"*": {
|
||||
"jqueryui": "jquery-ui",
|
||||
}
|
||||
},
|
||||
shim: {
|
||||
typeahead: {
|
||||
deps: ["jquery"],
|
||||
exports: "typeahead"
|
||||
},
|
||||
underscore: {
|
||||
exports: '_'
|
||||
},
|
||||
backbone: {
|
||||
deps: ["underscore", "jquery"],
|
||||
exports: "Backbone"
|
||||
},
|
||||
bootstrap: {
|
||||
deps: ["jquery"],
|
||||
exports: "bootstrap"
|
||||
},
|
||||
bootstraptour: {
|
||||
deps: ["bootstrap"],
|
||||
exports: "Tour"
|
||||
},
|
||||
"jquery-ui": {
|
||||
deps: ["jquery"],
|
||||
exports: "$"
|
||||
},
|
||||
},
|
||||
|
||||
exclude: [
|
||||
"custom/custom",
|
||||
]
|
||||
};
|
||||
|
||||
rjs(rjs_config, console.log, function (err) {
|
||||
console.log("Failed to build", name, err);
|
||||
process.exit(1);
|
||||
});
|
||||
@ -1,93 +0,0 @@
|
||||
// Copyright (c) Jupyter Development Team.
|
||||
// Distributed under the terms of the Modified BSD License.
|
||||
|
||||
// See https://github.com/webpack/css-loader/issues/144
|
||||
var webpack = require('webpack');
|
||||
var _ = require('underscore');
|
||||
var path = require('path');
|
||||
var sourcemaps = 'inline-source-map';
|
||||
|
||||
if(process.argv.indexOf('-w') !== -1 || process.argv.indexOf('-w') !== -1 ){
|
||||
console.log('watch mode detected, will switch to cheap sourcemaps');
|
||||
sourcemaps = 'eval-source-map';
|
||||
|
||||
}
|
||||
var commonConfig = {
|
||||
resolve: {
|
||||
root: [
|
||||
'.', /* allows npm packages to be loaded */
|
||||
'./notebook/static'
|
||||
].map(function(p) {return path.resolve(p);}),
|
||||
modulesDirectories: [
|
||||
"components", /* bower */
|
||||
"node_modules" /* npm */
|
||||
]
|
||||
},
|
||||
bail: true,
|
||||
module: {
|
||||
loaders: [
|
||||
{ test: /\.js$/, exclude: /node_modules|\/notebook\/static\/component/, loader: "babel-loader"},
|
||||
{ test: /\.css$/, loader: "style-loader!css-loader" },
|
||||
{ test: /\.json$/, loader: "json-loader" },
|
||||
// jquery-ui loads some images
|
||||
{ test: /\.(jpg|png|gif)$/, loader: "file" },
|
||||
// required to load font-awesome
|
||||
{ test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&minetype=application/font-woff" },
|
||||
{ test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&minetype=application/font-woff" },
|
||||
{ test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&minetype=application/octet-stream" },
|
||||
{ test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file" },
|
||||
{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&minetype=image/svg+xml" }
|
||||
]
|
||||
},
|
||||
externals: {
|
||||
jquery: '$',
|
||||
bootstrap: '$',
|
||||
bootstraptour: 'Tour',
|
||||
'jquery-ui': '$',
|
||||
typeahead: '$.typeahead',
|
||||
'codemirror': 'CodeMirror',
|
||||
'codemirror/lib/codemirror': 'CodeMirror',
|
||||
'codemirror/mode/meta': 'CodeMirror',
|
||||
// Account for relative paths from other CodeMirror files
|
||||
'../../lib/codemirror': 'CodeMirror',
|
||||
'../lib/codemirror': 'CodeMirror'
|
||||
},
|
||||
};
|
||||
|
||||
function buildConfig(appName) {
|
||||
if (typeof appName !== 'string') return appName;
|
||||
return _.extend({}, commonConfig, {
|
||||
entry: ['es6-promise/auto','./notebook/static/' + appName + '/js/main.js'],
|
||||
output: {
|
||||
filename: 'main.min.js',
|
||||
path: path.join(__dirname, 'notebook', 'static', appName, 'js', 'built')
|
||||
},
|
||||
devtool: sourcemaps,
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = [
|
||||
'auth',
|
||||
'edit',
|
||||
'terminal',
|
||||
'tree',
|
||||
'notebook',
|
||||
_.extend({}, commonConfig, {
|
||||
entry: ['es6-promise/auto', './notebook/static/services/contents.js'],
|
||||
output: {
|
||||
filename: 'contents.js',
|
||||
path: path.join(__dirname, 'notebook', 'static', 'services', 'built'),
|
||||
libraryTarget: 'amd'
|
||||
},
|
||||
devtool: sourcemaps,
|
||||
}),
|
||||
_.extend({}, commonConfig, {
|
||||
entry: ['es6-promise/auto', './notebook/static/index.js'],
|
||||
output: {
|
||||
filename: 'index.js',
|
||||
path: path.join(__dirname, 'notebook', 'static', 'built'),
|
||||
libraryTarget: 'amd'
|
||||
},
|
||||
devtool: sourcemaps,
|
||||
}),
|
||||
].map(buildConfig);
|
||||
Loading…
Reference in new issue