[Python-modules-commits] [jupyter-notebook] 01/02: Use a requirejs-importable shim for preact

Gordon Ball chronitis-guest at moszumanska.debian.org
Tue Jun 27 19:20:50 UTC 2017


This is an automated email from the git hooks/post-receive script.

chronitis-guest pushed a commit to branch master
in repository jupyter-notebook.

commit b508dc12e2f5a090f73ee5eb0003bb9b179491fd
Author: Gordon Ball <gordon at chronitis.net>
Date:   Tue Jun 27 20:46:17 2017 +0200

    Use a requirejs-importable shim for preact
---
 debian/rules   | 10 ++++++----
 debian/shim.js | 15 +++++++++++++++
 2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/debian/rules b/debian/rules
index d9469ae..cd64805 100755
--- a/debian/rules
+++ b/debian/rules
@@ -96,10 +96,12 @@ override_dh_auto_configure:
 	mkdir -p $(COMP)/preact
 	mkdir -p $(COMP)/preact-compat
 	mkdir -p $(COMP)/proptypes
-	touch $(COMP)/preact/index.js
-	touch $(COMP)/preact-compat/index.js
-	touch $(COMP)/proptypes/index.js
-
+	cp debian/shim.js $(COMP)/preact/index.js
+	cp debian/shim.js $(COMP)/preact-compat/index.js
+	cp debian/shim.js $(COMP)/proptypes/index.js
+	sed -i $(COMP)/preact/index.js -e 's/#MODNAME#/preact/g'
+	sed -i $(COMP)/preact-compat/index.js -e 's/#MODNAME#/preactCompat/g'
+	sed -i $(COMP)/proptypes/index.js -e 's/#MODNAME#/PropTypes/g'
 	dh_auto_configure
 
 
diff --git a/debian/shim.js b/debian/shim.js
new file mode 100644
index 0000000..fa87aab
--- /dev/null
+++ b/debian/shim.js
@@ -0,0 +1,15 @@
+(function(global, factory) {
+    if (typeof define === 'function' && define.amd) {
+        define('#MODNAME#', ['exports', 'module'], factory);
+    } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {
+        factory(exports, module);
+    } else {
+        var mod = {
+            exports: {}
+        };
+        factory(mod.exports, mod);
+        global.#MODNAME# = mod.exports;
+    }
+})(this, function(exports, module) {
+    module.exports = {};
+});

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/jupyter-notebook.git



More information about the Python-modules-commits mailing list