jupyterlab-ihaskell: use dashes instead of multiple dots to work around cabal behaviour

This commit is contained in:
Vaibhav Sagar 2021-09-10 15:25:30 +10:00
parent eab3291ed8
commit c475d15cec
8 changed files with 39 additions and 6 deletions

View File

@ -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"
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "jupyterlab-ihaskell",
"version": "0.0.13",
"version": "0.0.14",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -44,6 +44,7 @@
},
"jupyterlab": {
"extension": true,
"outputDir": "labextension"
"outputDir": "labextension",
"webpackConfig": "./webpack.config.js"
}
}

View File

@ -0,0 +1,2 @@
let nixpkgs = import <nixpkgs> {};
in nixpkgs.mkShell { buildInputs = [ (nixpkgs.python3.withPackages (p: [ p.jupyterlab ] )) nixpkgs.nodejs ]; }

View File

@ -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()
]
}