diff --git a/jupyterlab-ihaskell/labextension/package.json b/jupyterlab-ihaskell/labextension/package.json index 613fe517..ed409e07 100644 --- a/jupyterlab-ihaskell/labextension/package.json +++ b/jupyterlab-ihaskell/labextension/package.json @@ -34,8 +34,7 @@ "@jupyterlab/apputils": ">=3.0.0", "@jupyterlab/docregistry": ">=3.0.0", "@jupyterlab/notebook": ">=3.0.0", - "@jupyterlab/services": ">=6.0.0", - "@lumino/disposable": "^1.7.2" + "@jupyterlab/services": ">=6.0.0" }, "devDependencies": { "rimraf": "^3.0.0", @@ -46,8 +45,9 @@ "jupyterlab": { "extension": true, "outputDir": "labextension", + "webpackConfig": "./webpack.config.js", "_build": { - "load": "static/remoteEntry.9c17ba2cf8c8da4e9ea7.js", + "load": "static/remoteEntry-ddc4c9d791a676e50bb9.js", "extension": "./extension" } } diff --git a/jupyterlab-ihaskell/labextension/static/568.1b6fb876268b3f3be3f4.js b/jupyterlab-ihaskell/labextension/static/568-1b6fb876268b3f3be3f4.js similarity index 100% rename from jupyterlab-ihaskell/labextension/static/568.1b6fb876268b3f3be3f4.js rename to jupyterlab-ihaskell/labextension/static/568-1b6fb876268b3f3be3f4.js diff --git a/jupyterlab-ihaskell/labextension/static/remoteEntry-ddc4c9d791a676e50bb9.js b/jupyterlab-ihaskell/labextension/static/remoteEntry-ddc4c9d791a676e50bb9.js new file mode 100644 index 00000000..5132548e --- /dev/null +++ b/jupyterlab-ihaskell/labextension/static/remoteEntry-ddc4c9d791a676e50bb9.js @@ -0,0 +1 @@ +var _JUPYTERLAB;(()=>{"use strict";var e,r,t,n,o,a,i,l,u,s,f,p,h,c,d,v={494:(e,r,t)=>{var n={"./index":()=>t.e(568).then((()=>()=>t(568))),"./extension":()=>t.e(568).then((()=>()=>t(568)))},o=(e,r)=>(t.R=r,r=t.o(n,e)?n[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),t.R=void 0,r),a=(e,r)=>{if(t.S){var n=t.S.default,o="default";if(n&&n!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[o]=e,t.I(o,r)}};t.d(r,{get:()=>o,init:()=>a})}},b={};function g(e){var r=b[e];if(void 0!==r)return r.exports;var t=b[e]={exports:{}};return v[e].call(t.exports,t,t.exports,g),t.exports}g.m=v,g.c=b,g.d=(e,r)=>{for(var t in r)g.o(r,t)&&!g.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},g.f={},g.e=e=>Promise.all(Object.keys(g.f).reduce(((r,t)=>(g.f[t](e,r),r)),[])),g.u=e=>e+"-1b6fb876268b3f3be3f4.js",g.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),g.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="jupyterlab-ihaskell:",g.l=(t,n,o,a)=>{if(e[t])e[t].push(n);else{var i,l;if(void 0!==o)for(var u=document.getElementsByTagName("script"),s=0;s{i.onerror=i.onload=null,clearTimeout(h);var o=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),r)return r(n)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=p.bind(null,i.onerror),i.onload=p.bind(null,i.onload),l&&document.head.appendChild(i)}},(()=>{g.S={};var e={},r={};g.I=(t,n)=>{n||(n=[]);var o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];g.o(g.S,t)||(g.S[t]={});var a=g.S[t],i="jupyterlab-ihaskell",l=[];switch(t){case"default":((e,r,t,n)=>{var o=a[e]=a[e]||{},l=o[r];(!l||!l.loaded&&(1!=!l.eager?n:i>l.from))&&(o[r]={get:()=>g.e(568).then((()=>()=>g(568))),from:i,eager:!1})})("jupyterlab-ihaskell","0.0.14")}return e[t]=l.length?Promise.all(l).then((()=>e[t]=1)):1}}})(),(()=>{var e;g.g.importScripts&&(e=g.g.location+"");var r=g.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),g.p=e})(),t=e=>{var r=e=>e.split(".").map((e=>+e==e?+e:e)),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=t[1]?r(t[1]):[];return t[2]&&(n.length++,n.push.apply(n,r(t[2]))),t[3]&&(n.push([]),n.push.apply(n,r(t[3]))),n},n=(e,r)=>{e=t(e),r=t(r);for(var n=0;;){if(n>=e.length)return n=r.length)return"u"==a;var i=r[n],l=(typeof i)[0];if(a!=l)return"o"==a&&"n"==l||"s"==l||"u"==a;if("o"!=a&&"u"!=a&&o!=i)return o{var r=e[0],t="";if(1===e.length)return"*";if(r+.5){t+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var n=1,a=1;a0?".":"")+(n=2,l);return t}var i=[];for(a=1;a{if(0 in e){r=t(r);var n=e[0],o=n<0;o&&(n=-n-1);for(var i=0,l=1,u=!0;;l++,i++){var s,f,p=l=r.length||"o"==(f=(typeof(s=r[i]))[0]))return!u||("u"==p?l>n&&!o:""==p!=o);if("u"==f){if(!u||"u"!=p)return!1}else if(u)if(p==f)if(l<=n){if(s!=e[l])return!1}else{if(o?s>e[l]:s{var t=g.S[e];if(!t||!g.o(t,r))throw new Error("Shared module "+r+" doesn't exist in shared scope "+e);return t},l=(e,r)=>{var t=e[r];return Object.keys(t).reduce(((e,r)=>!e||!t[e].loaded&&n(e,r)?r:e),0)},u=(e,r,t)=>"Unsatisfied version "+r+" of shared singleton module "+e+" (required "+o(t)+")",s=(e,r,t,n)=>{var o=l(e,t);return a(n,o)||"undefined"!=typeof console&&console.warn&&console.warn(u(t,o,n)),f(e[t][o])},f=e=>(e.loaded=1,e.get()),p=(e=>function(r,t,n,o){var a=g.I(r);return a&&a.then?a.then(e.bind(e,r,g.S[r],t,n,o)):e(r,g.S[r],t,n)})(((e,r,t,n)=>(i(e,t),s(r,0,t,n)))),h={},c={36:()=>p("default","@jupyterlab/codemirror",[1,3,0,7])},d={568:[36]},g.f.consumes=(e,r)=>{g.o(d,e)&&d[e].forEach((e=>{if(g.o(h,e))return r.push(h[e]);var t=r=>{h[e]=0,g.m[e]=t=>{delete g.c[e],t.exports=r()}},n=r=>{delete h[e],g.m[e]=t=>{throw delete g.c[e],r}};try{var o=c[e]();o.then?r.push(h[e]=o.then(t).catch(n)):t(o)}catch(e){n(e)}}))},(()=>{var e={589:0};g.f.j=(r,t)=>{var n=g.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var o=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=o);var a=g.p+g.u(r),i=new Error;g.l(a,(t=>{if(g.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+o+": "+a+")",i.name="ChunkLoadError",i.type=o,i.request=a,n[1](i)}}),"chunk-"+r,r)}};var r=(r,t)=>{var n,o,[a,i,l]=t,u=0;if(a.some((r=>0!==e[r]))){for(n in i)g.o(i,n)&&(g.m[n]=i[n]);l&&l(g)}for(r&&r(t);u{"use strict";var e,r,t,n,a,o,i,l,u,s,f,p,c,h,d,v={494:(e,r,t)=>{var n={"./index":()=>t.e(568).then((()=>()=>t(568))),"./extension":()=>t.e(568).then((()=>()=>t(568)))},a=(e,r)=>(t.R=r,r=t.o(n,e)?n[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),t.R=void 0,r),o=(e,r)=>{if(t.S){var n=t.S.default,a="default";if(n&&n!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[a]=e,t.I(a,r)}};t.d(r,{get:()=>a,init:()=>o})}},b={};function g(e){var r=b[e];if(void 0!==r)return r.exports;var t=b[e]={exports:{}};return v[e].call(t.exports,t,t.exports,g),t.exports}g.m=v,g.c=b,g.d=(e,r)=>{for(var t in r)g.o(r,t)&&!g.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},g.f={},g.e=e=>Promise.all(Object.keys(g.f).reduce(((r,t)=>(g.f[t](e,r),r)),[])),g.u=e=>e+".1b6fb876268b3f3be3f4.js?v=1b6fb876268b3f3be3f4",g.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),g.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="jupyterlab-ihaskell:",g.l=(t,n,a,o)=>{if(e[t])e[t].push(n);else{var i,l;if(void 0!==a)for(var u=document.getElementsByTagName("script"),s=0;s{i.onerror=i.onload=null,clearTimeout(c);var a=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),a&&a.forEach((e=>e(n))),r)return r(n)},c=setTimeout(p.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=p.bind(null,i.onerror),i.onload=p.bind(null,i.onload),l&&document.head.appendChild(i)}},(()=>{g.S={};var e={},r={};g.I=(t,n)=>{n||(n=[]);var a=r[t];if(a||(a=r[t]={}),!(n.indexOf(a)>=0)){if(n.push(a),e[t])return e[t];g.o(g.S,t)||(g.S[t]={});var o=g.S[t],i="jupyterlab-ihaskell",l=[];switch(t){case"default":((e,r,t,n)=>{var a=o[e]=o[e]||{},l=a[r];(!l||!l.loaded&&(1!=!l.eager?n:i>l.from))&&(a[r]={get:()=>g.e(568).then((()=>()=>g(568))),from:i,eager:!1})})("jupyterlab-ihaskell","0.0.14")}return e[t]=l.length?Promise.all(l).then((()=>e[t]=1)):1}}})(),(()=>{var e;g.g.importScripts&&(e=g.g.location+"");var r=g.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),g.p=e})(),t=e=>{var r=e=>e.split(".").map((e=>+e==e?+e:e)),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=t[1]?r(t[1]):[];return t[2]&&(n.length++,n.push.apply(n,r(t[2]))),t[3]&&(n.push([]),n.push.apply(n,r(t[3]))),n},n=(e,r)=>{e=t(e),r=t(r);for(var n=0;;){if(n>=e.length)return n=r.length)return"u"==o;var i=r[n],l=(typeof i)[0];if(o!=l)return"o"==o&&"n"==l||"s"==l||"u"==o;if("o"!=o&&"u"!=o&&a!=i)return a{var r=e[0],t="";if(1===e.length)return"*";if(r+.5){t+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var n=1,o=1;o0?".":"")+(n=2,l);return t}var i=[];for(o=1;o{if(0 in e){r=t(r);var n=e[0],a=n<0;a&&(n=-n-1);for(var i=0,l=1,u=!0;;l++,i++){var s,f,p=l=r.length||"o"==(f=(typeof(s=r[i]))[0]))return!u||("u"==p?l>n&&!a:""==p!=a);if("u"==f){if(!u||"u"!=p)return!1}else if(u)if(p==f)if(l<=n){if(s!=e[l])return!1}else{if(a?s>e[l]:s{var t=g.S[e];if(!t||!g.o(t,r))throw new Error("Shared module "+r+" doesn't exist in shared scope "+e);return t},l=(e,r)=>{var t=e[r];return Object.keys(t).reduce(((e,r)=>!e||!t[e].loaded&&n(e,r)?r:e),0)},u=(e,r,t)=>"Unsatisfied version "+r+" of shared singleton module "+e+" (required "+a(t)+")",s=(e,r,t,n)=>{var a=l(e,t);return o(n,a)||"undefined"!=typeof console&&console.warn&&console.warn(u(t,a,n)),f(e[t][a])},f=e=>(e.loaded=1,e.get()),p=(e=>function(r,t,n,a){var o=g.I(r);return o&&o.then?o.then(e.bind(e,r,g.S[r],t,n,a)):e(r,g.S[r],t,n)})(((e,r,t,n)=>(i(e,t),s(r,0,t,n)))),c={},h={36:()=>p("default","@jupyterlab/codemirror",[1,3,0,7])},d={568:[36]},g.f.consumes=(e,r)=>{g.o(d,e)&&d[e].forEach((e=>{if(g.o(c,e))return r.push(c[e]);var t=r=>{c[e]=0,g.m[e]=t=>{delete g.c[e],t.exports=r()}},n=r=>{delete c[e],g.m[e]=t=>{throw delete g.c[e],r}};try{var a=h[e]();a.then?r.push(c[e]=a.then(t).catch(n)):t(a)}catch(e){n(e)}}))},(()=>{var e={589:0};g.f.j=(r,t)=>{var n=g.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var a=new Promise(((t,a)=>n=e[r]=[t,a]));t.push(n[2]=a);var o=g.p+g.u(r),i=new Error;g.l(o,(t=>{if(g.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var a=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+a+": "+o+")",i.name="ChunkLoadError",i.type=a,i.request=o,n[1](i)}}),"chunk-"+r,r)}};var r=(r,t)=>{var n,a,[o,i,l]=t,u=0;if(o.some((r=>0!==e[r]))){for(n in i)g.o(i,n)&&(g.m[n]=i[n]);l&&l(g)}for(r&&r(t);u {}; +in nixpkgs.mkShell { buildInputs = [ (nixpkgs.python3.withPackages (p: [ p.jupyterlab ] )) nixpkgs.nodejs ]; } diff --git a/jupyterlab-ihaskell/webpack.config.js b/jupyterlab-ihaskell/webpack.config.js new file mode 100644 index 00000000..c176b0d7 --- /dev/null +++ b/jupyterlab-ihaskell/webpack.config.js @@ -0,0 +1,30 @@ +const fs = require('fs-extra'); +const path = require('path'); + +const packagePath = '.'; +const data = fs.readJSONSync(path.join(packagePath, 'package.json')); +const outputPath = path.join(packagePath, data.jupyterlab['outputDir']); + +class FixupEntryPoint { + apply(compiler) { + compiler.hooks.done.tap('FixupEntryPoint', (stats) => { + + const data = fs.readJSONSync(path.join(outputPath, "package.json")); + const remoteEntry = data.jupyterlab._build.load; + const remoteEntryRe = /static\/remoteEntry\.(.*)\.js/; + const remoteEntryDash = remoteEntry.replace(remoteEntryRe, "static/remoteEntry-$1.js"); + fs.moveSync(path.join(outputPath, remoteEntry), path.join(outputPath, remoteEntryDash)); + data.jupyterlab._build.load = remoteEntryDash; + fs.writeJSONSync(path.join(outputPath, "package.json"), data, { spaces: 2 }); + }); + }; +}; + +module.exports = { + output: { + filename: "[name]-[contenthash].js" + }, + plugins: [ + new FixupEntryPoint() + ] +}