[Pkg-javascript-devel] packaging and debuging of the javascript part of ipywidgets

picca picca at debian.org
Wed Dec 25 10:39:02 GMT 2024


Ok, now I just try to build the widgetsnbextension which are located 
here using your already packaged node jupyter widgets files comming from 
ipydatagrid). Let's start simple :)

picca at page:~/debian/python-team/packages/ipywidgets$ ls -l 
python/widgetsnbextension/
total 48
-rw-rw-r-- 1 picca picca   647 23 déc.  09:16 amd-public-path.js
-rw-rw-r-- 1 picca picca  1513 23 déc.  09:16 LICENSE
-rw-rw-r-- 1 picca picca   137 23 déc.  09:16 MANIFEST.in
-rw-rw-r-- 1 picca picca  1324 23 déc.  09:16 package.json
-rw-rw-r-- 1 picca picca   594 23 déc.  09:16 pyproject.toml
-rw-rw-r-- 1 picca picca   499 23 déc.  09:16 README.md
-rw-rw-r-- 1 picca picca  1201 23 déc.  09:16 setup.cfg
-rw-rw-r-- 1 picca sbuild  880 24 déc.  09:20 setup.py
drwxrwxr-x 2 picca picca  4096 23 déc.  09:16 src
-rw-rw-r-- 1 picca picca   674 23 déc.  09:16 webpack.config.js
drwxrwxr-x 2 picca picca  4096 25 déc.  10:27 widgetsnbextension
-rw-rw-r-- 1 picca picca    72 23 déc.  09:16 widgetsnbextension.json

It contains one of these build files known by dh-nodejs as build command 
  (webpack.config.js)

So I am starting small and add  these sequences for the build and 
dh-sequence-nodejs-no-lerna

override_dh_auto_XXX:
         # XXX javascript part
         dh_auto_XXX --buildsystem=nodejs 
--sourcedirectory=python/widgetsnbextension

The build process still complaining that it find a lerna.conf file and 
no build command

# build widgetsnbextension
dh_auto_build --buildsystem=nodejs 
--sourcedirectory=python/widgetsnbextension
/!\ examples/embed-amd/package.json not found
Unable to load examples/embed-amd
./lerna.json found

workspaces field found in package.json

Found debian/nodejs/additional_components
Adding component(s): packages/base
Adding component(s): packages/base-manager
Adding component(s): packages/controls
Adding component(s): packages/html-manager
No build command found, searching known files


the package.json of the extension is has simple

{
   "name": "@jupyter-widgets/notebook-manager",
   "version": "8.0.13",
   "private": true,
   "description": "Jupyter Widgets nbextension",
   "homepage": "https://github.com/jupyter-widgets/ipywidgets#readme",
   "bugs": {
     "url": "https://github.com/jupyter-widgets/ipywidgets/issues"
   },
   "repository": {
     "type": "git",
     "url": "git+https://github.com/jupyter-widgets/ipywidgets.git"
   },
   "license": "BSD-3-Clause",
   "author": "Jupyter Project",
   "main": "src/extension.js",
   "scripts": {
     "build": "npm run build:nbextension",
     "build:nbextension": "webpack",
     "clean": "rimraf widgetsnbextension/static",
     "prepublish": "npm run clean && npm run build",
     "watch": "npm run build --watch"
   },
   "dependencies": {
     "@jupyter-widgets/base": "^6.0.10",
     "@jupyter-widgets/base-manager": "^1.0.11",
     "@jupyter-widgets/controls": "^5.0.11",
     "@jupyter-widgets/html-manager": "^1.0.13",
     "@jupyter-widgets/output": "^6.0.10",
     "@jupyterlab/services": "^6.0.0 || ^7.0.0",
     "@lumino/messaging": "^1.10.1 || ^2.1",
     "@lumino/widgets": "^1.30.0 || ^2.1",
     "backbone": "1.4.0"
   },
   "devDependencies": {
     "css-loader": "^6.5.1",
     "requirejs": "^2.3.6",
     "rimraf": "^3.0.2",
     "style-loader": "^3.3.1",
     "webpack": "^5.65.0",
     "webpack-cli": "^4.7.2"
   }
}

It is like the nodejs sequence do not honor the --sourcedirectory.

Is it a bug in dh-nodejs ?

Fred



More information about the Pkg-javascript-devel mailing list