diff --git a/.gitignore b/.gitignore index 806685a5..35cfbab0 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ node_modules/ **/node_modules/**/README.md static +labextension diff --git a/.prettierignore b/.prettierignore index 3a5875d7..5c6e45ce 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,4 +2,4 @@ node_modules **/node_modules **/lib **/package.json -**/static +**/labextension diff --git a/advanced/kernel-messaging/MANIFEST.in b/advanced/kernel-messaging/MANIFEST.in index a192a4cc..1ffdbd62 100644 --- a/advanced/kernel-messaging/MANIFEST.in +++ b/advanced/kernel-messaging/MANIFEST.in @@ -6,7 +6,7 @@ include jupyter-config/jupyterlab_examples_kernel_messaging.json include package.json include ts*.json -graft jupyterlab_examples_kernel_messaging/static +graft jupyterlab_examples_kernel_messaging/labextension # Javascript files graft src diff --git a/advanced/kernel-messaging/install.json b/advanced/kernel-messaging/install.json new file mode 100644 index 00000000..97ae33da --- /dev/null +++ b/advanced/kernel-messaging/install.json @@ -0,0 +1,5 @@ +{ + "packageManager": "python", + "packageName": "jupyterlab_examples_kernel_messaging", + "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlab_examples_kernel_messaging" +} diff --git a/advanced/kernel-messaging/jupyterlab_examples_kernel_messaging/__init__.py b/advanced/kernel-messaging/jupyterlab_examples_kernel_messaging/__init__.py index 819e43e0..353ab522 100644 --- a/advanced/kernel-messaging/jupyterlab_examples_kernel_messaging/__init__.py +++ b/advanced/kernel-messaging/jupyterlab_examples_kernel_messaging/__init__.py @@ -6,12 +6,12 @@ HERE = osp.abspath(osp.dirname(__file__)) -with open(osp.join(HERE, 'static', 'package.json')) as fid: +with open(osp.join(HERE, 'labextension', 'package.json')) as fid: data = json.load(fid) def _jupyter_labextension_paths(): return [{ - 'src': 'static', + 'src': 'labextension', 'dest': data['name'] }] diff --git a/advanced/kernel-messaging/package.json b/advanced/kernel-messaging/package.json index 72a984dd..0787719a 100644 --- a/advanced/kernel-messaging/package.json +++ b/advanced/kernel-messaging/package.json @@ -25,29 +25,30 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "jlpm run build:lib && jlpm run build:labextension", + "build": "jlpm run build:lib && jlpm run build:labextension:dev", "build:all": "jlpm run build:lib && jlpm run build:labextension", "build:labextension": "jupyter labextension build .", "build:labextension:dev": "jupyter labextension build --development True .", "build:lib": "tsc", + "build:prod": "jlpm run build:lib && jlpm run build:labextension", "clean": "jlpm run clean:lib", "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", - "clean:labextension": "rimraf jupyterlab_examples_kernel_messaging/static", + "clean:labextension": "rimraf jupyterlab_examples_kernel_messaging/labextension", "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", "install:extension": "jupyter labextension develop --overwrite .", - "prepare": "jlpm run clean && jlpm run build", + "prepare": "jlpm run clean && jlpm run build:prod", "watch": "run-p watch:src watch:labextension", "watch:labextension": "jupyter labextension watch .", "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^3.0.0-rc.2", - "@jupyterlab/launcher": "^3.0.0-rc.2", - "@jupyterlab/mainmenu": "^3.0.0-rc.2", - "@jupyterlab/nbformat": "^3.0.0-rc.2", - "@jupyterlab/translation": "^3.0.0-rc.2", + "@jupyterlab/application": "^3.0.0-rc.7", + "@jupyterlab/launcher": "^3.0.0-rc.7", + "@jupyterlab/mainmenu": "^3.0.0-rc.7", + "@jupyterlab/nbformat": "^3.0.0-rc.7", + "@jupyterlab/translation": "^3.0.0-rc.7", "@lumino/algorithm": "^1.3.3", "@lumino/coreutils": "^1.5.3", "@lumino/datagrid": "^0.5.2", @@ -55,7 +56,7 @@ "@lumino/widgets": "^1.14.0" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-rc.2", + "@jupyterlab/builder": "^3.0.0-rc.7", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", @@ -73,6 +74,6 @@ ], "jupyterlab": { "extension": true, - "outputDir": "jupyterlab_examples_kernel_messaging/static" + "outputDir": "jupyterlab_examples_kernel_messaging/labextension" } } \ No newline at end of file diff --git a/advanced/kernel-messaging/setup.py b/advanced/kernel-messaging/setup.py index 74f5d69b..754f3005 100644 --- a/advanced/kernel-messaging/setup.py +++ b/advanced/kernel-messaging/setup.py @@ -1,6 +1,7 @@ """ jupyterlab_examples_kernel_messaging setup """ +import json import os from jupyter_packaging import ( @@ -15,14 +16,15 @@ name="jupyterlab_examples_kernel_messaging" # Get our version -version = get_version(os.path.join(name, "_version.py")) +with open(os.path.join(HERE, 'package.json')) as f: + version = json.load(f)['version'] -lab_path = os.path.join(HERE, name, "static") +lab_path = os.path.join(HERE, name, "labextension") # Representative files that should exist after a successful build jstargets = [ os.path.join(HERE, "lib", "index.js"), - os.path.join(HERE, name, "static", "package.json"), + os.path.join(lab_path, "package.json"), ] package_data_spec = { @@ -34,7 +36,8 @@ labext_name = "@jupyterlab-examples/kernel-messaging" data_files_spec = [ - ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "**"), + ("share/jupyter/labextensions/%s" % labext_name, HERE, "install.json"), ] cmdclass = create_cmdclass("jsdeps", @@ -43,7 +46,7 @@ ) cmdclass["jsdeps"] = combine_commands( - install_npm(HERE, build_cmd="build", npm=["jlpm"]), + install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]), ensure_targets(jstargets), ) diff --git a/advanced/kernel-output/MANIFEST.in b/advanced/kernel-output/MANIFEST.in index fbb66f9d..d67f9240 100644 --- a/advanced/kernel-output/MANIFEST.in +++ b/advanced/kernel-output/MANIFEST.in @@ -6,7 +6,7 @@ include jupyter-config/jupyterlab_examples_kernel_output.json include package.json include ts*.json -graft jupyterlab_examples_kernel_output/static +graft jupyterlab_examples_kernel_output/labextension # Javascript files graft src diff --git a/advanced/kernel-output/install.json b/advanced/kernel-output/install.json new file mode 100644 index 00000000..4b8ad737 --- /dev/null +++ b/advanced/kernel-output/install.json @@ -0,0 +1,5 @@ +{ + "packageManager": "python", + "packageName": "jupyterlab_examples_kernel_output", + "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlab_examples_kernel_output" +} diff --git a/advanced/kernel-output/jupyterlab_examples_kernel_output/__init__.py b/advanced/kernel-output/jupyterlab_examples_kernel_output/__init__.py index 819e43e0..353ab522 100644 --- a/advanced/kernel-output/jupyterlab_examples_kernel_output/__init__.py +++ b/advanced/kernel-output/jupyterlab_examples_kernel_output/__init__.py @@ -6,12 +6,12 @@ HERE = osp.abspath(osp.dirname(__file__)) -with open(osp.join(HERE, 'static', 'package.json')) as fid: +with open(osp.join(HERE, 'labextension', 'package.json')) as fid: data = json.load(fid) def _jupyter_labextension_paths(): return [{ - 'src': 'static', + 'src': 'labextension', 'dest': data['name'] }] diff --git a/advanced/kernel-output/package.json b/advanced/kernel-output/package.json index 51c833ef..8f7a53d2 100644 --- a/advanced/kernel-output/package.json +++ b/advanced/kernel-output/package.json @@ -25,36 +25,37 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "jlpm run build:lib && jlpm run build:labextension", + "build": "jlpm run build:lib && jlpm run build:labextension:dev", "build:all": "jlpm run build:lib && jlpm run build:labextension", "build:labextension": "jupyter labextension build .", "build:labextension:dev": "jupyter labextension build --development True .", "build:lib": "tsc", + "build:prod": "jlpm run build:lib && jlpm run build:labextension", "clean": "jlpm run clean:lib", "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", - "clean:labextension": "rimraf jupyterlab_examples_kernel_output/static", + "clean:labextension": "rimraf jupyterlab_examples_kernel_output/labextension", "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", "install:extension": "jupyter labextension develop --overwrite .", - "prepare": "jlpm run clean && jlpm run build", + "prepare": "jlpm run clean && jlpm run build:prod", "watch": "run-p watch:src watch:labextension", "watch:labextension": "jupyter labextension watch .", "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^3.0.0-rc.2", - "@jupyterlab/launcher": "^3.0.0-rc.2", - "@jupyterlab/mainmenu": "^3.0.0-rc.2", - "@jupyterlab/outputarea": "^3.0.0-rc.2", - "@jupyterlab/translation": "^3.0.0-rc.2", + "@jupyterlab/application": "^3.0.0-rc.7", + "@jupyterlab/launcher": "^3.0.0-rc.7", + "@jupyterlab/mainmenu": "^3.0.0-rc.7", + "@jupyterlab/outputarea": "^3.0.0-rc.7", + "@jupyterlab/translation": "^3.0.0-rc.7", "@lumino/algorithm": "^1.3.3", "@lumino/coreutils": "^1.5.3", "@lumino/datagrid": "^0.3.1", "@lumino/disposable": "^1.4.3" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-rc.2", + "@jupyterlab/builder": "^3.0.0-rc.7", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", @@ -72,6 +73,6 @@ ], "jupyterlab": { "extension": true, - "outputDir": "jupyterlab_examples_kernel_output/static" + "outputDir": "jupyterlab_examples_kernel_output/labextension" } } \ No newline at end of file diff --git a/advanced/kernel-output/setup.py b/advanced/kernel-output/setup.py index 6882deef..246977cd 100644 --- a/advanced/kernel-output/setup.py +++ b/advanced/kernel-output/setup.py @@ -1,6 +1,7 @@ """ jupyterlab_examples_kernel_output setup """ +import json import os from jupyter_packaging import ( @@ -15,14 +16,15 @@ name="jupyterlab_examples_kernel_output" # Get our version -version = get_version(os.path.join(name, "_version.py")) +with open(os.path.join(HERE, 'package.json')) as f: + version = json.load(f)['version'] -lab_path = os.path.join(HERE, name, "static") +lab_path = os.path.join(HERE, name, "labextension") # Representative files that should exist after a successful build jstargets = [ os.path.join(HERE, "lib", "index.js"), - os.path.join(HERE, name, "static", "package.json"), + os.path.join(lab_path, "package.json"), ] package_data_spec = { @@ -34,7 +36,8 @@ labext_name = "@jupyterlab-examples/kernel-output" data_files_spec = [ - ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "**"), + ("share/jupyter/labextensions/%s" % labext_name, HERE, "install.json"), ] cmdclass = create_cmdclass("jsdeps", @@ -43,7 +46,7 @@ ) cmdclass["jsdeps"] = combine_commands( - install_npm(HERE, build_cmd="build", npm=["jlpm"]), + install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]), ensure_targets(jstargets), ) diff --git a/advanced/server-extension/MANIFEST.in b/advanced/server-extension/MANIFEST.in index 549e2d7f..dbff3582 100644 --- a/advanced/server-extension/MANIFEST.in +++ b/advanced/server-extension/MANIFEST.in @@ -7,7 +7,7 @@ include jupyter-config/jlab_ext_example.json include package.json include ts*.json include jlab_ext_example/labextension/*.tgz -graft jlab_ext_example/static +graft jlab_ext_example/labextension # Javascript files graft src diff --git a/advanced/server-extension/README.md b/advanced/server-extension/README.md index 6cef50f6..39b2e20c 100644 --- a/advanced/server-extension/README.md +++ b/advanced/server-extension/README.md @@ -296,7 +296,7 @@ if (launcher) { } ``` -Invoking the command (via the command palette or the launcher) will open a new tab with +Invoking the command (via the command palette or the launcher) will open a new tab with an `IFrame` that will display static content fetched from the server extension. **Note** @@ -312,14 +312,14 @@ an `IFrame` that will display static content fetched from the server extension. The server part of the extension is going to be presented in this section. -You first need to install the python source code. The following will install +You first need to install the python source code. The following will install the `jlab_ext_example` package in dev mode: ```bash pip install -e . ``` -Then you need to enable the package at the Jupyter level +Then you need to enable the package at the Jupyter level so that it becomes a server extension. ```bash @@ -340,12 +340,12 @@ from ._version import __version__ HERE = osp.abspath(osp.dirname(__file__)) -with open(osp.join(HERE, 'static', 'package.json')) as fid: +with open(osp.join(HERE, 'labextension', 'package.json')) as fid: data = json.load(fid) def _jupyter_labextension_paths(): return [{ - 'src': 'static', + 'src': 'labextension', 'dest': data['name'] }] @@ -450,7 +450,7 @@ input_data = self.get_json_body() data = {"greetings": "Hello {}, enjoy JupyterLab!".format(input_data["name"])} ``` -The part responsible to serve static content with a `StaticFileHandler` handler +The part responsible to serve static content with a `StaticFileHandler` handler is the following: ```py @@ -486,7 +486,7 @@ through package managers like `pip`. > Note: In particular, [`jupyter-packaging`](https://github.com/jupyter/jupyter-packaging) provides helpers to package and install JS files > with a Python package for Jupyter frontends (classical notebook, -> JupyterLab,...). +> JupyterLab,...). > As this package is a setup requirement, it needs to be specified in the `pyproject.toml` to be installed by `pip`. The `setup.py` file is the entry point to describe package metadata: @@ -497,6 +497,7 @@ The `setup.py` file is the entry point to describe package metadata: """ jlab_ext_example setup """ +import json import os from jupyter_packaging import ( @@ -511,14 +512,15 @@ HERE = os.path.abspath(os.path.dirname(__file__)) name="jlab_ext_example" # Get our version -version = get_version(os.path.join(name, "_version.py")) +with open(os.path.join(HERE, 'package.json')) as f: + version = json.load(f)['version'] -lab_path = os.path.join(HERE, name, "static") +lab_path = os.path.join(HERE, name, "labextension") # Representative files that should exist after a successful build jstargets = [ os.path.join(HERE, "lib", "index.js"), - os.path.join(HERE, name, "static", "package.json"), + os.path.join(lab_path, "package.json"), ] package_data_spec = { @@ -530,7 +532,8 @@ package_data_spec = { labext_name = "@jupyterlab-examples/server-extension" data_files_spec = [ - ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"),("etc/jupyter/jupyter_server_config.d", + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "**"), + ("share/jupyter/labextensions/%s" % labext_name, HERE, "install.json"),("etc/jupyter/jupyter_server_config.d", "jupyter-config", "jlab_ext_example.json"), ] @@ -541,7 +544,7 @@ cmdclass = create_cmdclass("jsdeps", ) cmdclass["jsdeps"] = combine_commands( - install_npm(HERE, build_cmd="build", npm=["jlpm"]), + install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]), ensure_targets(jstargets), ) @@ -590,7 +593,7 @@ the frontend NPM package needs to be built and inserted in the Python package. T done using a special `cmdclass`: ```py -# setup.py#L42-L50 +# setup.py#L45-L53 cmdclass = create_cmdclass("jsdeps", package_data_spec=package_data_spec, @@ -598,7 +601,7 @@ cmdclass = create_cmdclass("jsdeps", ) cmdclass["jsdeps"] = combine_commands( - install_npm(HERE, build_cmd="build", npm=["jlpm"]), + install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]), ensure_targets(jstargets), ) ``` @@ -606,19 +609,19 @@ cmdclass["jsdeps"] = combine_commands( Basically it will build the frontend NPM package: ```py -# setup.py#L48-L48 +# setup.py#L51-L51 -install_npm(HERE, build_cmd="build", npm=["jlpm"]), +install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]), ``` It will ensure one of the generated JS files is `lib/jlabextexample.js`: ```py -# setup.py#L23-L26 +# setup.py#L25-L28 jstargets = [ os.path.join(HERE, "lib", "index.js"), - os.path.join(HERE, name, "static", "package.json"), + os.path.join(lab_path, "package.json"), ] ``` @@ -663,9 +666,8 @@ user about that dependency by adding the `discovery` metadata to your `package.j file: ```json5 -// package.json#L68-L78 +// package.json#L70-L80 -], "jupyterlab": { "discovery": { "server": { @@ -676,12 +678,13 @@ file: "name": "jlab_ext_example" } } + }, ``` In this example, the extension requires a `server` extension: ```json5 -// package.json#L70-L70 +// package.json#L71-L71 "discovery": { ``` @@ -689,7 +692,7 @@ In this example, the extension requires a `server` extension: And that server extension is available through `pip`: ```json5 -// package.json#L71-L73 +// package.json#L72-L74 "server": { "managers": [ diff --git a/advanced/server-extension/install.json b/advanced/server-extension/install.json new file mode 100644 index 00000000..772fb6ad --- /dev/null +++ b/advanced/server-extension/install.json @@ -0,0 +1,5 @@ +{ + "packageManager": "python", + "packageName": "jlab_ext_example", + "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jlab_ext_example" +} diff --git a/advanced/server-extension/jlab_ext_example/__init__.py b/advanced/server-extension/jlab_ext_example/__init__.py index bee278f8..c6bf4615 100644 --- a/advanced/server-extension/jlab_ext_example/__init__.py +++ b/advanced/server-extension/jlab_ext_example/__init__.py @@ -6,12 +6,12 @@ HERE = osp.abspath(osp.dirname(__file__)) -with open(osp.join(HERE, 'static', 'package.json')) as fid: +with open(osp.join(HERE, 'labextension', 'package.json')) as fid: data = json.load(fid) def _jupyter_labextension_paths(): return [{ - 'src': 'static', + 'src': 'labextension', 'dest': data['name'] }] diff --git a/advanced/server-extension/package.json b/advanced/server-extension/package.json index 2c08b6d8..0dc896d8 100644 --- a/advanced/server-extension/package.json +++ b/advanced/server-extension/package.json @@ -25,31 +25,32 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "jlpm run build:lib && jlpm run build:labextension", + "build": "jlpm run build:lib && jlpm run build:labextension:dev", "build:all": "jlpm run build:lib && jlpm run build:labextension", "build:labextension": "jupyter labextension build .", "build:labextension:dev": "jupyter labextension build --development True .", "build:lib": "tsc", + "build:prod": "jlpm run build:lib && jlpm run build:labextension", "clean": "jlpm run clean:lib", "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", - "clean:labextension": "rimraf jlab_ext_example/static", + "clean:labextension": "rimraf jlab_ext_example/labextension", "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", "install:extension": "jupyter labextension develop --overwrite .", - "prepare": "jlpm run clean && jlpm run build", + "prepare": "jlpm run clean && jlpm run build:prod", "watch": "run-p watch:src watch:labextension", "watch:labextension": "jupyter labextension watch .", "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^3.0.0-rc.2", - "@jupyterlab/coreutils": "^5.0.0-rc.2", - "@jupyterlab/launcher": "^3.0.0-rc.2", - "@jupyterlab/services": "^6.0.0-rc.2" + "@jupyterlab/application": "^3.0.0-rc.7", + "@jupyterlab/coreutils": "^5.0.0-rc.7", + "@jupyterlab/launcher": "^3.0.0-rc.7", + "@jupyterlab/services": "^6.0.0-rc.7" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-rc.2", + "@jupyterlab/builder": "^3.0.0-rc.7", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", @@ -78,6 +79,6 @@ } }, "extension": true, - "outputDir": "jlab_ext_example/static" + "outputDir": "jlab_ext_example/labextension" } } \ No newline at end of file diff --git a/advanced/server-extension/setup.py b/advanced/server-extension/setup.py index 7ab40eb3..88abcd2d 100644 --- a/advanced/server-extension/setup.py +++ b/advanced/server-extension/setup.py @@ -1,6 +1,7 @@ """ jlab_ext_example setup """ +import json import os from jupyter_packaging import ( @@ -15,14 +16,15 @@ name="jlab_ext_example" # Get our version -version = get_version(os.path.join(name, "_version.py")) +with open(os.path.join(HERE, 'package.json')) as f: + version = json.load(f)['version'] -lab_path = os.path.join(HERE, name, "static") +lab_path = os.path.join(HERE, name, "labextension") # Representative files that should exist after a successful build jstargets = [ os.path.join(HERE, "lib", "index.js"), - os.path.join(HERE, name, "static", "package.json"), + os.path.join(lab_path, "package.json"), ] package_data_spec = { @@ -34,7 +36,8 @@ labext_name = "@jupyterlab-examples/server-extension" data_files_spec = [ - ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"),("etc/jupyter/jupyter_server_config.d", + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "**"), + ("share/jupyter/labextensions/%s" % labext_name, HERE, "install.json"),("etc/jupyter/jupyter_server_config.d", "jupyter-config", "jlab_ext_example.json"), ] @@ -45,7 +48,7 @@ ) cmdclass["jsdeps"] = combine_commands( - install_npm(HERE, build_cmd="build", npm=["jlpm"]), + install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]), ensure_targets(jstargets), ) diff --git a/basics/datagrid/MANIFEST.in b/basics/datagrid/MANIFEST.in index ef85b8ba..a2f60e5c 100644 --- a/basics/datagrid/MANIFEST.in +++ b/basics/datagrid/MANIFEST.in @@ -6,7 +6,7 @@ include jupyter-config/jupyterlab_examples_datagrid.json include package.json include ts*.json -graft jupyterlab_examples_datagrid/static +graft jupyterlab_examples_datagrid/labextension # Javascript files graft src diff --git a/basics/datagrid/install.json b/basics/datagrid/install.json new file mode 100644 index 00000000..d35e2f7a --- /dev/null +++ b/basics/datagrid/install.json @@ -0,0 +1,5 @@ +{ + "packageManager": "python", + "packageName": "jupyterlab_examples_datagrid", + "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlab_examples_datagrid" +} diff --git a/basics/datagrid/jupyterlab_examples_datagrid/__init__.py b/basics/datagrid/jupyterlab_examples_datagrid/__init__.py index 819e43e0..353ab522 100644 --- a/basics/datagrid/jupyterlab_examples_datagrid/__init__.py +++ b/basics/datagrid/jupyterlab_examples_datagrid/__init__.py @@ -6,12 +6,12 @@ HERE = osp.abspath(osp.dirname(__file__)) -with open(osp.join(HERE, 'static', 'package.json')) as fid: +with open(osp.join(HERE, 'labextension', 'package.json')) as fid: data = json.load(fid) def _jupyter_labextension_paths(): return [{ - 'src': 'static', + 'src': 'labextension', 'dest': data['name'] }] diff --git a/basics/datagrid/package.json b/basics/datagrid/package.json index 41b0325c..885d633f 100644 --- a/basics/datagrid/package.json +++ b/basics/datagrid/package.json @@ -25,34 +25,35 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "jlpm run build:lib && jlpm run build:labextension", + "build": "jlpm run build:lib && jlpm run build:labextension:dev", "build:all": "jlpm run build:lib && jlpm run build:labextension", "build:labextension": "jupyter labextension build .", "build:labextension:dev": "jupyter labextension build --development True .", "build:lib": "tsc", + "build:prod": "jlpm run build:lib && jlpm run build:labextension", "clean": "jlpm run clean:lib", "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", - "clean:labextension": "rimraf jupyterlab_examples_datagrid/static", + "clean:labextension": "rimraf jupyterlab_examples_datagrid/labextension", "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", "install:extension": "jupyter labextension develop --overwrite .", - "prepare": "jlpm run clean && jlpm run build", + "prepare": "jlpm run clean && jlpm run build:prod", "watch": "run-p watch:src watch:labextension", "watch:labextension": "jupyter labextension watch .", "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^3.0.0-rc.2", - "@jupyterlab/mainmenu": "^3.0.0-rc.2", - "@jupyterlab/translation": "^3.0.0-rc.2", + "@jupyterlab/application": "^3.0.0-rc.7", + "@jupyterlab/mainmenu": "^3.0.0-rc.7", + "@jupyterlab/translation": "^3.0.0-rc.7", "@lumino/algorithm": "^1.3.3", "@lumino/coreutils": "^1.5.3", "@lumino/datagrid": "^0.5.2", "@lumino/disposable": "^1.4.3" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-rc.2", + "@jupyterlab/builder": "^3.0.0-rc.7", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", @@ -70,6 +71,6 @@ ], "jupyterlab": { "extension": true, - "outputDir": "jupyterlab_examples_datagrid/static" + "outputDir": "jupyterlab_examples_datagrid/labextension" } } \ No newline at end of file diff --git a/basics/datagrid/setup.py b/basics/datagrid/setup.py index 6b444e10..0f69870b 100644 --- a/basics/datagrid/setup.py +++ b/basics/datagrid/setup.py @@ -1,6 +1,7 @@ """ jupyterlab_examples_datagrid setup """ +import json import os from jupyter_packaging import ( @@ -15,14 +16,15 @@ name="jupyterlab_examples_datagrid" # Get our version -version = get_version(os.path.join(name, "_version.py")) +with open(os.path.join(HERE, 'package.json')) as f: + version = json.load(f)['version'] -lab_path = os.path.join(HERE, name, "static") +lab_path = os.path.join(HERE, name, "labextension") # Representative files that should exist after a successful build jstargets = [ os.path.join(HERE, "lib", "index.js"), - os.path.join(HERE, name, "static", "package.json"), + os.path.join(lab_path, "package.json"), ] package_data_spec = { @@ -34,7 +36,8 @@ labext_name = "@jupyterlab-examples/datagrid" data_files_spec = [ - ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "**"), + ("share/jupyter/labextensions/%s" % labext_name, HERE, "install.json"), ] cmdclass = create_cmdclass("jsdeps", @@ -43,7 +46,7 @@ ) cmdclass["jsdeps"] = combine_commands( - install_npm(HERE, build_cmd="build", npm=["jlpm"]), + install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]), ensure_targets(jstargets), ) diff --git a/basics/hello-world/MANIFEST.in b/basics/hello-world/MANIFEST.in index a766c6f4..041b2fd7 100644 --- a/basics/hello-world/MANIFEST.in +++ b/basics/hello-world/MANIFEST.in @@ -6,7 +6,7 @@ include jupyter-config/jupyterlab_examples_hello_world.json include package.json include ts*.json -graft jupyterlab_examples_hello_world/static +graft jupyterlab_examples_hello_world/labextension # Javascript files graft src diff --git a/basics/hello-world/README.md b/basics/hello-world/README.md index ea946b4a..5f5b3969 100644 --- a/basics/hello-world/README.md +++ b/basics/hello-world/README.md @@ -93,9 +93,9 @@ package is declared in the file `package.json`: ```json5 // package.json#L44-L46 + "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^3.0.0-rc.2" ``` With this basic import setup, you can move on to construct a new instance diff --git a/basics/hello-world/install.json b/basics/hello-world/install.json new file mode 100644 index 00000000..c867999e --- /dev/null +++ b/basics/hello-world/install.json @@ -0,0 +1,5 @@ +{ + "packageManager": "python", + "packageName": "jupyterlab_examples_hello_world", + "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlab_examples_hello_world" +} diff --git a/basics/hello-world/jupyterlab_examples_hello_world/__init__.py b/basics/hello-world/jupyterlab_examples_hello_world/__init__.py index 819e43e0..353ab522 100644 --- a/basics/hello-world/jupyterlab_examples_hello_world/__init__.py +++ b/basics/hello-world/jupyterlab_examples_hello_world/__init__.py @@ -6,12 +6,12 @@ HERE = osp.abspath(osp.dirname(__file__)) -with open(osp.join(HERE, 'static', 'package.json')) as fid: +with open(osp.join(HERE, 'labextension', 'package.json')) as fid: data = json.load(fid) def _jupyter_labextension_paths(): return [{ - 'src': 'static', + 'src': 'labextension', 'dest': data['name'] }] diff --git a/basics/hello-world/package.json b/basics/hello-world/package.json index 04c013cf..63abe87d 100644 --- a/basics/hello-world/package.json +++ b/basics/hello-world/package.json @@ -25,28 +25,29 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "jlpm run build:lib && jlpm run build:labextension", + "build": "jlpm run build:lib && jlpm run build:labextension:dev", "build:all": "jlpm run build:lib && jlpm run build:labextension", "build:labextension": "jupyter labextension build .", "build:labextension:dev": "jupyter labextension build --development True .", "build:lib": "tsc", + "build:prod": "jlpm run build:lib && jlpm run build:labextension", "clean": "jlpm run clean:lib", "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", - "clean:labextension": "rimraf jupyterlab_examples_hello_world/static", + "clean:labextension": "rimraf jupyterlab_examples_hello_world/labextension", "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", "install:extension": "jupyter labextension develop --overwrite .", - "prepare": "jlpm run clean && jlpm run build", + "prepare": "jlpm run clean && jlpm run build:prod", "watch": "run-p watch:src watch:labextension", "watch:labextension": "jupyter labextension watch .", "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^3.0.0-rc.2" + "@jupyterlab/application": "^3.0.0-rc.7" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-rc.2", + "@jupyterlab/builder": "^3.0.0-rc.7", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", @@ -64,6 +65,6 @@ ], "jupyterlab": { "extension": true, - "outputDir": "jupyterlab_examples_hello_world/static" + "outputDir": "jupyterlab_examples_hello_world/labextension" } } \ No newline at end of file diff --git a/basics/hello-world/setup.py b/basics/hello-world/setup.py index ee01a2bd..ebe26d4f 100644 --- a/basics/hello-world/setup.py +++ b/basics/hello-world/setup.py @@ -1,6 +1,7 @@ """ jupyterlab_examples_hello_world setup """ +import json import os from jupyter_packaging import ( @@ -15,14 +16,15 @@ name="jupyterlab_examples_hello_world" # Get our version -version = get_version(os.path.join(name, "_version.py")) +with open(os.path.join(HERE, 'package.json')) as f: + version = json.load(f)['version'] -lab_path = os.path.join(HERE, name, "static") +lab_path = os.path.join(HERE, name, "labextension") # Representative files that should exist after a successful build jstargets = [ os.path.join(HERE, "lib", "index.js"), - os.path.join(HERE, name, "static", "package.json"), + os.path.join(lab_path, "package.json"), ] package_data_spec = { @@ -34,7 +36,8 @@ labext_name = "@jupyterlab-examples/hello-world" data_files_spec = [ - ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "**"), + ("share/jupyter/labextensions/%s" % labext_name, HERE, "install.json"), ] cmdclass = create_cmdclass("jsdeps", @@ -43,7 +46,7 @@ ) cmdclass["jsdeps"] = combine_commands( - install_npm(HERE, build_cmd="build", npm=["jlpm"]), + install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]), ensure_targets(jstargets), ) diff --git a/basics/signals/MANIFEST.in b/basics/signals/MANIFEST.in index 01de20c5..d65867cc 100644 --- a/basics/signals/MANIFEST.in +++ b/basics/signals/MANIFEST.in @@ -6,7 +6,7 @@ include jupyter-config/jupyterlab_examples_signals.json include package.json include ts*.json -graft jupyterlab_examples_signals/static +graft jupyterlab_examples_signals/labextension # Javascript files graft src diff --git a/basics/signals/install.json b/basics/signals/install.json new file mode 100644 index 00000000..81d834da --- /dev/null +++ b/basics/signals/install.json @@ -0,0 +1,5 @@ +{ + "packageManager": "python", + "packageName": "jupyterlab_examples_signals", + "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlab_examples_signals" +} diff --git a/basics/signals/jupyterlab_examples_signals/__init__.py b/basics/signals/jupyterlab_examples_signals/__init__.py index 819e43e0..353ab522 100644 --- a/basics/signals/jupyterlab_examples_signals/__init__.py +++ b/basics/signals/jupyterlab_examples_signals/__init__.py @@ -6,12 +6,12 @@ HERE = osp.abspath(osp.dirname(__file__)) -with open(osp.join(HERE, 'static', 'package.json')) as fid: +with open(osp.join(HERE, 'labextension', 'package.json')) as fid: data = json.load(fid) def _jupyter_labextension_paths(): return [{ - 'src': 'static', + 'src': 'labextension', 'dest': data['name'] }] diff --git a/basics/signals/package.json b/basics/signals/package.json index 5b47fecf..ca64321a 100644 --- a/basics/signals/package.json +++ b/basics/signals/package.json @@ -25,35 +25,36 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "jlpm run build:lib && jlpm run build:labextension", + "build": "jlpm run build:lib && jlpm run build:labextension:dev", "build:all": "jlpm run build:lib && jlpm run build:labextension", "build:labextension": "jupyter labextension build .", "build:labextension:dev": "jupyter labextension build --development True .", "build:lib": "tsc", + "build:prod": "jlpm run build:lib && jlpm run build:labextension", "clean": "jlpm run clean:lib", "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", - "clean:labextension": "rimraf jupyterlab_examples_signals/static", + "clean:labextension": "rimraf jupyterlab_examples_signals/labextension", "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", "install:extension": "jupyter labextension develop --overwrite .", - "prepare": "jlpm run clean && jlpm run build", + "prepare": "jlpm run clean && jlpm run build:prod", "watch": "run-p watch:src watch:labextension", "watch:labextension": "jupyter labextension watch .", "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^3.0.0-rc.2", - "@jupyterlab/launcher": "^3.0.0-rc.2", - "@jupyterlab/mainmenu": "^3.0.0-rc.2", - "@jupyterlab/translation": "^3.0.0-rc.2", + "@jupyterlab/application": "^3.0.0-rc.7", + "@jupyterlab/launcher": "^3.0.0-rc.7", + "@jupyterlab/mainmenu": "^3.0.0-rc.7", + "@jupyterlab/translation": "^3.0.0-rc.7", "@lumino/algorithm": "^1.3.3", "@lumino/coreutils": "^1.5.3", "@lumino/datagrid": "^0.3.1", "@lumino/disposable": "^1.4.3" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-rc.2", + "@jupyterlab/builder": "^3.0.0-rc.7", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", @@ -71,6 +72,6 @@ ], "jupyterlab": { "extension": true, - "outputDir": "jupyterlab_examples_signals/static" + "outputDir": "jupyterlab_examples_signals/labextension" } } \ No newline at end of file diff --git a/basics/signals/setup.py b/basics/signals/setup.py index 0a33d3cf..80747814 100644 --- a/basics/signals/setup.py +++ b/basics/signals/setup.py @@ -1,6 +1,7 @@ """ jupyterlab_examples_signals setup """ +import json import os from jupyter_packaging import ( @@ -15,14 +16,15 @@ name="jupyterlab_examples_signals" # Get our version -version = get_version(os.path.join(name, "_version.py")) +with open(os.path.join(HERE, 'package.json')) as f: + version = json.load(f)['version'] -lab_path = os.path.join(HERE, name, "static") +lab_path = os.path.join(HERE, name, "labextension") # Representative files that should exist after a successful build jstargets = [ os.path.join(HERE, "lib", "index.js"), - os.path.join(HERE, name, "static", "package.json"), + os.path.join(lab_path, "package.json"), ] package_data_spec = { @@ -34,7 +36,8 @@ labext_name = "@jupyterlab-examples/signals" data_files_spec = [ - ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "**"), + ("share/jupyter/labextensions/%s" % labext_name, HERE, "install.json"), ] cmdclass = create_cmdclass("jsdeps", @@ -43,7 +46,7 @@ ) cmdclass["jsdeps"] = combine_commands( - install_npm(HERE, build_cmd="build", npm=["jlpm"]), + install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]), ensure_targets(jstargets), ) diff --git a/command-palette/MANIFEST.in b/command-palette/MANIFEST.in index cabb5aa7..31fb6283 100644 --- a/command-palette/MANIFEST.in +++ b/command-palette/MANIFEST.in @@ -6,7 +6,7 @@ include jupyter-config/jupyterlab_examples_command_palette.json include package.json include ts*.json -graft jupyterlab_examples_command_palette/static +graft jupyterlab_examples_command_palette/labextension # Javascript files graft src diff --git a/command-palette/install.json b/command-palette/install.json new file mode 100644 index 00000000..c7c38a01 --- /dev/null +++ b/command-palette/install.json @@ -0,0 +1,5 @@ +{ + "packageManager": "python", + "packageName": "jupyterlab_examples_command_palette", + "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlab_examples_command_palette" +} diff --git a/command-palette/jupyterlab_examples_command_palette/__init__.py b/command-palette/jupyterlab_examples_command_palette/__init__.py index 819e43e0..353ab522 100644 --- a/command-palette/jupyterlab_examples_command_palette/__init__.py +++ b/command-palette/jupyterlab_examples_command_palette/__init__.py @@ -6,12 +6,12 @@ HERE = osp.abspath(osp.dirname(__file__)) -with open(osp.join(HERE, 'static', 'package.json')) as fid: +with open(osp.join(HERE, 'labextension', 'package.json')) as fid: data = json.load(fid) def _jupyter_labextension_paths(): return [{ - 'src': 'static', + 'src': 'labextension', 'dest': data['name'] }] diff --git a/command-palette/package.json b/command-palette/package.json index c7f98c3e..10106f82 100644 --- a/command-palette/package.json +++ b/command-palette/package.json @@ -25,28 +25,29 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "jlpm run build:lib && jlpm run build:labextension", + "build": "jlpm run build:lib && jlpm run build:labextension:dev", "build:all": "jlpm run build:lib && jlpm run build:labextension", "build:labextension": "jupyter labextension build .", "build:labextension:dev": "jupyter labextension build --development True .", "build:lib": "tsc", + "build:prod": "jlpm run build:lib && jlpm run build:labextension", "clean": "jlpm run clean:lib", "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", - "clean:labextension": "rimraf jupyterlab_examples_command_palette/static", + "clean:labextension": "rimraf jupyterlab_examples_command_palette/labextension", "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", "install:extension": "jupyter labextension develop --overwrite .", - "prepare": "jlpm run clean && jlpm run build", + "prepare": "jlpm run clean && jlpm run build:prod", "watch": "run-p watch:src watch:labextension", "watch:labextension": "jupyter labextension watch .", "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^3.0.0-rc.2" + "@jupyterlab/application": "^3.0.0-rc.7" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-rc.2", + "@jupyterlab/builder": "^3.0.0-rc.7", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", @@ -64,6 +65,6 @@ ], "jupyterlab": { "extension": true, - "outputDir": "jupyterlab_examples_command_palette/static" + "outputDir": "jupyterlab_examples_command_palette/labextension" } } \ No newline at end of file diff --git a/command-palette/setup.py b/command-palette/setup.py index b8831a51..ff21cfb1 100644 --- a/command-palette/setup.py +++ b/command-palette/setup.py @@ -1,6 +1,7 @@ """ jupyterlab_examples_command_palette setup """ +import json import os from jupyter_packaging import ( @@ -15,14 +16,15 @@ name="jupyterlab_examples_command_palette" # Get our version -version = get_version(os.path.join(name, "_version.py")) +with open(os.path.join(HERE, 'package.json')) as f: + version = json.load(f)['version'] -lab_path = os.path.join(HERE, name, "static") +lab_path = os.path.join(HERE, name, "labextension") # Representative files that should exist after a successful build jstargets = [ os.path.join(HERE, "lib", "index.js"), - os.path.join(HERE, name, "static", "package.json"), + os.path.join(lab_path, "package.json"), ] package_data_spec = { @@ -34,7 +36,8 @@ labext_name = "@jupyterlab-examples/command-palette" data_files_spec = [ - ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "**"), + ("share/jupyter/labextensions/%s" % labext_name, HERE, "install.json"), ] cmdclass = create_cmdclass("jsdeps", @@ -43,7 +46,7 @@ ) cmdclass["jsdeps"] = combine_commands( - install_npm(HERE, build_cmd="build", npm=["jlpm"]), + install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]), ensure_targets(jstargets), ) diff --git a/commands/MANIFEST.in b/commands/MANIFEST.in index c27952a3..88b2f920 100644 --- a/commands/MANIFEST.in +++ b/commands/MANIFEST.in @@ -6,7 +6,7 @@ include jupyter-config/jupyterlab_examples_commands.json include package.json include ts*.json -graft jupyterlab_examples_commands/static +graft jupyterlab_examples_commands/labextension # Javascript files graft src diff --git a/commands/install.json b/commands/install.json new file mode 100644 index 00000000..ea862194 --- /dev/null +++ b/commands/install.json @@ -0,0 +1,5 @@ +{ + "packageManager": "python", + "packageName": "jupyterlab_examples_commands", + "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlab_examples_commands" +} diff --git a/commands/jupyterlab_examples_commands/__init__.py b/commands/jupyterlab_examples_commands/__init__.py index 819e43e0..353ab522 100644 --- a/commands/jupyterlab_examples_commands/__init__.py +++ b/commands/jupyterlab_examples_commands/__init__.py @@ -6,12 +6,12 @@ HERE = osp.abspath(osp.dirname(__file__)) -with open(osp.join(HERE, 'static', 'package.json')) as fid: +with open(osp.join(HERE, 'labextension', 'package.json')) as fid: data = json.load(fid) def _jupyter_labextension_paths(): return [{ - 'src': 'static', + 'src': 'labextension', 'dest': data['name'] }] diff --git a/commands/package.json b/commands/package.json index d72495b2..0eae889d 100644 --- a/commands/package.json +++ b/commands/package.json @@ -25,28 +25,29 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "jlpm run build:lib && jlpm run build:labextension", + "build": "jlpm run build:lib && jlpm run build:labextension:dev", "build:all": "jlpm run build:lib && jlpm run build:labextension", "build:labextension": "jupyter labextension build .", "build:labextension:dev": "jupyter labextension build --development True .", "build:lib": "tsc", + "build:prod": "jlpm run build:lib && jlpm run build:labextension", "clean": "jlpm run clean:lib", "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", - "clean:labextension": "rimraf jupyterlab_examples_commands/static", + "clean:labextension": "rimraf jupyterlab_examples_commands/labextension", "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", "install:extension": "jupyter labextension develop --overwrite .", - "prepare": "jlpm run clean && jlpm run build", + "prepare": "jlpm run clean && jlpm run build:prod", "watch": "run-p watch:src watch:labextension", "watch:labextension": "jupyter labextension watch .", "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^3.0.0-rc.2" + "@jupyterlab/application": "^3.0.0-rc.7" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-rc.2", + "@jupyterlab/builder": "^3.0.0-rc.7", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", @@ -64,6 +65,6 @@ ], "jupyterlab": { "extension": true, - "outputDir": "jupyterlab_examples_commands/static" + "outputDir": "jupyterlab_examples_commands/labextension" } } \ No newline at end of file diff --git a/commands/setup.py b/commands/setup.py index b1ffd560..826e28c4 100644 --- a/commands/setup.py +++ b/commands/setup.py @@ -1,6 +1,7 @@ """ jupyterlab_examples_commands setup """ +import json import os from jupyter_packaging import ( @@ -15,14 +16,15 @@ name="jupyterlab_examples_commands" # Get our version -version = get_version(os.path.join(name, "_version.py")) +with open(os.path.join(HERE, 'package.json')) as f: + version = json.load(f)['version'] -lab_path = os.path.join(HERE, name, "static") +lab_path = os.path.join(HERE, name, "labextension") # Representative files that should exist after a successful build jstargets = [ os.path.join(HERE, "lib", "index.js"), - os.path.join(HERE, name, "static", "package.json"), + os.path.join(lab_path, "package.json"), ] package_data_spec = { @@ -34,7 +36,8 @@ labext_name = "@jupyterlab-examples/commands" data_files_spec = [ - ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "**"), + ("share/jupyter/labextensions/%s" % labext_name, HERE, "install.json"), ] cmdclass = create_cmdclass("jsdeps", @@ -43,7 +46,7 @@ ) cmdclass["jsdeps"] = combine_commands( - install_npm(HERE, build_cmd="build", npm=["jlpm"]), + install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]), ensure_targets(jstargets), ) diff --git a/context-menu/MANIFEST.in b/context-menu/MANIFEST.in index 64369514..84b5924d 100644 --- a/context-menu/MANIFEST.in +++ b/context-menu/MANIFEST.in @@ -6,7 +6,7 @@ include jupyter-config/jupyterlab_examples_context_menu.json include package.json include ts*.json -graft jupyterlab_examples_context_menu/static +graft jupyterlab_examples_context_menu/labextension # Javascript files graft src diff --git a/context-menu/install.json b/context-menu/install.json new file mode 100644 index 00000000..db8ba8e6 --- /dev/null +++ b/context-menu/install.json @@ -0,0 +1,5 @@ +{ + "packageManager": "python", + "packageName": "jupyterlab_examples_context_menu", + "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlab_examples_context_menu" +} diff --git a/context-menu/jupyterlab_examples_context_menu/__init__.py b/context-menu/jupyterlab_examples_context_menu/__init__.py index 819e43e0..353ab522 100644 --- a/context-menu/jupyterlab_examples_context_menu/__init__.py +++ b/context-menu/jupyterlab_examples_context_menu/__init__.py @@ -6,12 +6,12 @@ HERE = osp.abspath(osp.dirname(__file__)) -with open(osp.join(HERE, 'static', 'package.json')) as fid: +with open(osp.join(HERE, 'labextension', 'package.json')) as fid: data = json.load(fid) def _jupyter_labextension_paths(): return [{ - 'src': 'static', + 'src': 'labextension', 'dest': data['name'] }] diff --git a/context-menu/package.json b/context-menu/package.json index 4960b14e..297371db 100644 --- a/context-menu/package.json +++ b/context-menu/package.json @@ -25,31 +25,32 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "jlpm run build:lib && jlpm run build:labextension", + "build": "jlpm run build:lib && jlpm run build:labextension:dev", "build:all": "jlpm run build:lib && jlpm run build:labextension", "build:labextension": "jupyter labextension build .", "build:labextension:dev": "jupyter labextension build --development True .", "build:lib": "tsc", + "build:prod": "jlpm run build:lib && jlpm run build:labextension", "clean": "jlpm run clean:lib", "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", - "clean:labextension": "rimraf jupyterlab_examples_context_menu/static", + "clean:labextension": "rimraf jupyterlab_examples_context_menu/labextension", "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", "install:extension": "jupyter labextension develop --overwrite .", - "prepare": "jlpm run clean && jlpm run build", + "prepare": "jlpm run clean && jlpm run build:prod", "watch": "run-p watch:src watch:labextension", "watch:labextension": "jupyter labextension watch .", "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^3.0.0-rc.2", - "@jupyterlab/apputils": "^3.0.0-rc.2", - "@jupyterlab/filebrowser": "^3.0.0-rc.2", - "@jupyterlab/ui-components": "^3.0.0-rc.2" + "@jupyterlab/application": "^3.0.0-rc.7", + "@jupyterlab/apputils": "^3.0.0-rc.7", + "@jupyterlab/filebrowser": "^3.0.0-rc.7", + "@jupyterlab/ui-components": "^3.0.0-rc.7" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-rc.2", + "@jupyterlab/builder": "^3.0.0-rc.7", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", @@ -67,6 +68,6 @@ ], "jupyterlab": { "extension": true, - "outputDir": "jupyterlab_examples_context_menu/static" + "outputDir": "jupyterlab_examples_context_menu/labextension" } } \ No newline at end of file diff --git a/context-menu/setup.py b/context-menu/setup.py index 21e5b00c..f7420e5e 100644 --- a/context-menu/setup.py +++ b/context-menu/setup.py @@ -1,6 +1,7 @@ """ jupyterlab_examples_context_menu setup """ +import json import os from jupyter_packaging import ( @@ -15,14 +16,15 @@ name="jupyterlab_examples_context_menu" # Get our version -version = get_version(os.path.join(name, "_version.py")) +with open(os.path.join(HERE, 'package.json')) as f: + version = json.load(f)['version'] -lab_path = os.path.join(HERE, name, "static") +lab_path = os.path.join(HERE, name, "labextension") # Representative files that should exist after a successful build jstargets = [ os.path.join(HERE, "lib", "index.js"), - os.path.join(HERE, name, "static", "package.json"), + os.path.join(lab_path, "package.json"), ] package_data_spec = { @@ -34,7 +36,8 @@ labext_name = "@jupyterlab-examples/context-menu" data_files_spec = [ - ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "**"), + ("share/jupyter/labextensions/%s" % labext_name, HERE, "install.json"), ] cmdclass = create_cmdclass("jsdeps", @@ -43,7 +46,7 @@ ) cmdclass["jsdeps"] = combine_commands( - install_npm(HERE, build_cmd="build", npm=["jlpm"]), + install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]), ensure_targets(jstargets), ) diff --git a/launcher/MANIFEST.in b/launcher/MANIFEST.in index f95674be..0551ee1f 100644 --- a/launcher/MANIFEST.in +++ b/launcher/MANIFEST.in @@ -6,7 +6,7 @@ include jupyter-config/jupyterlab_examples_launcher.json include package.json include ts*.json -graft jupyterlab_examples_launcher/static +graft jupyterlab_examples_launcher/labextension # Javascript files graft src diff --git a/launcher/install.json b/launcher/install.json new file mode 100644 index 00000000..26ec5ef7 --- /dev/null +++ b/launcher/install.json @@ -0,0 +1,5 @@ +{ + "packageManager": "python", + "packageName": "jupyterlab_examples_launcher", + "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlab_examples_launcher" +} diff --git a/launcher/jupyterlab_examples_launcher/__init__.py b/launcher/jupyterlab_examples_launcher/__init__.py index 819e43e0..353ab522 100644 --- a/launcher/jupyterlab_examples_launcher/__init__.py +++ b/launcher/jupyterlab_examples_launcher/__init__.py @@ -6,12 +6,12 @@ HERE = osp.abspath(osp.dirname(__file__)) -with open(osp.join(HERE, 'static', 'package.json')) as fid: +with open(osp.join(HERE, 'labextension', 'package.json')) as fid: data = json.load(fid) def _jupyter_labextension_paths(): return [{ - 'src': 'static', + 'src': 'labextension', 'dest': data['name'] }] diff --git a/launcher/package.json b/launcher/package.json index a2563a78..f67c680e 100644 --- a/launcher/package.json +++ b/launcher/package.json @@ -25,31 +25,32 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "jlpm run build:lib && jlpm run build:labextension", + "build": "jlpm run build:lib && jlpm run build:labextension:dev", "build:all": "jlpm run build:lib && jlpm run build:labextension", "build:labextension": "jupyter labextension build .", "build:labextension:dev": "jupyter labextension build --development True .", "build:lib": "tsc", + "build:prod": "jlpm run build:lib && jlpm run build:labextension", "clean": "jlpm run clean:lib", "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", - "clean:labextension": "rimraf jupyterlab_examples_launcher/static", + "clean:labextension": "rimraf jupyterlab_examples_launcher/labextension", "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", "install:extension": "jupyter labextension develop --overwrite .", - "prepare": "jlpm run clean && jlpm run build", + "prepare": "jlpm run clean && jlpm run build:prod", "watch": "run-p watch:src watch:labextension", "watch:labextension": "jupyter labextension watch .", "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^3.0.0-rc.2", - "@jupyterlab/filebrowser": "^3.0.0-rc.2", - "@jupyterlab/launcher": "^3.0.0-rc.2", - "@jupyterlab/mainmenu": "^3.0.0-rc.2" + "@jupyterlab/application": "^3.0.0-rc.7", + "@jupyterlab/filebrowser": "^3.0.0-rc.7", + "@jupyterlab/launcher": "^3.0.0-rc.7", + "@jupyterlab/mainmenu": "^3.0.0-rc.7" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-rc.2", + "@jupyterlab/builder": "^3.0.0-rc.7", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", @@ -68,6 +69,6 @@ ], "jupyterlab": { "extension": true, - "outputDir": "jupyterlab_examples_launcher/static" + "outputDir": "jupyterlab_examples_launcher/labextension" } } \ No newline at end of file diff --git a/launcher/setup.py b/launcher/setup.py index e480e930..3e645018 100644 --- a/launcher/setup.py +++ b/launcher/setup.py @@ -1,6 +1,7 @@ """ jupyterlab_examples_launcher setup """ +import json import os from jupyter_packaging import ( @@ -15,14 +16,15 @@ name="jupyterlab_examples_launcher" # Get our version -version = get_version(os.path.join(name, "_version.py")) +with open(os.path.join(HERE, 'package.json')) as f: + version = json.load(f)['version'] -lab_path = os.path.join(HERE, name, "static") +lab_path = os.path.join(HERE, name, "labextension") # Representative files that should exist after a successful build jstargets = [ os.path.join(HERE, "lib", "index.js"), - os.path.join(HERE, name, "static", "package.json"), + os.path.join(lab_path, "package.json"), ] package_data_spec = { @@ -34,7 +36,8 @@ labext_name = "@jupyterlab-examples/launcher" data_files_spec = [ - ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "**"), + ("share/jupyter/labextensions/%s" % labext_name, HERE, "install.json"), ] cmdclass = create_cmdclass("jsdeps", @@ -43,7 +46,7 @@ ) cmdclass["jsdeps"] = combine_commands( - install_npm(HERE, build_cmd="build", npm=["jlpm"]), + install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]), ensure_targets(jstargets), ) diff --git a/log-console/custom-log-console/MANIFEST.in b/log-console/custom-log-console/MANIFEST.in index 2f4f46ff..2133e4ee 100644 --- a/log-console/custom-log-console/MANIFEST.in +++ b/log-console/custom-log-console/MANIFEST.in @@ -6,7 +6,7 @@ include jupyter-config/jupyterlab_examples_custom_log_console.json include package.json include ts*.json -graft jupyterlab_examples_custom_log_console/static +graft jupyterlab_examples_custom_log_console/labextension # Javascript files graft src diff --git a/log-console/custom-log-console/install.json b/log-console/custom-log-console/install.json new file mode 100644 index 00000000..5e894618 --- /dev/null +++ b/log-console/custom-log-console/install.json @@ -0,0 +1,5 @@ +{ + "packageManager": "python", + "packageName": "jupyterlab_examples_custom_log_console", + "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlab_examples_custom_log_console" +} diff --git a/log-console/custom-log-console/jupyterlab_examples_custom_log_console/__init__.py b/log-console/custom-log-console/jupyterlab_examples_custom_log_console/__init__.py index 819e43e0..353ab522 100644 --- a/log-console/custom-log-console/jupyterlab_examples_custom_log_console/__init__.py +++ b/log-console/custom-log-console/jupyterlab_examples_custom_log_console/__init__.py @@ -6,12 +6,12 @@ HERE = osp.abspath(osp.dirname(__file__)) -with open(osp.join(HERE, 'static', 'package.json')) as fid: +with open(osp.join(HERE, 'labextension', 'package.json')) as fid: data = json.load(fid) def _jupyter_labextension_paths(): return [{ - 'src': 'static', + 'src': 'labextension', 'dest': data['name'] }] diff --git a/log-console/custom-log-console/package.json b/log-console/custom-log-console/package.json index 5b7a69f6..1ca19094 100644 --- a/log-console/custom-log-console/package.json +++ b/log-console/custom-log-console/package.json @@ -25,37 +25,38 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "jlpm run build:lib && jlpm run build:labextension", + "build": "jlpm run build:lib && jlpm run build:labextension:dev", "build:all": "jlpm run build:lib && jlpm run build:labextension", "build:labextension": "jupyter labextension build .", "build:labextension:dev": "jupyter labextension build --development True .", "build:lib": "tsc", + "build:prod": "jlpm run build:lib && jlpm run build:labextension", "clean": "jlpm run clean:lib", "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", - "clean:labextension": "rimraf jupyterlab_examples_custom_log_console/static", + "clean:labextension": "rimraf jupyterlab_examples_custom_log_console/labextension", "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", "install:extension": "jupyter labextension develop --overwrite .", - "prepare": "jlpm run clean && jlpm run build", + "prepare": "jlpm run clean && jlpm run build:prod", "watch": "run-p watch:src watch:labextension", "watch:labextension": "jupyter labextension watch .", "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^3.0.0-rc.2", - "@jupyterlab/apputils": "^3.0.0-rc.2", - "@jupyterlab/coreutils": "^5.0.0-rc.2", - "@jupyterlab/logconsole": "^3.0.0-rc.2", - "@jupyterlab/mainmenu": "^3.0.0-rc.2", - "@jupyterlab/nbformat": "^3.0.0-rc.2", - "@jupyterlab/rendermime": "^3.0.0-rc.2", - "@jupyterlab/ui-components": "^3.0.0-rc.2", + "@jupyterlab/application": "^3.0.0-rc.7", + "@jupyterlab/apputils": "^3.0.0-rc.7", + "@jupyterlab/coreutils": "^5.0.0-rc.7", + "@jupyterlab/logconsole": "^3.0.0-rc.7", + "@jupyterlab/mainmenu": "^3.0.0-rc.7", + "@jupyterlab/nbformat": "^3.0.0-rc.7", + "@jupyterlab/rendermime": "^3.0.0-rc.7", + "@jupyterlab/ui-components": "^3.0.0-rc.7", "@lumino/coreutils": "^1.5.3", "@lumino/widgets": "^1.14.0" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-rc.2", + "@jupyterlab/builder": "^3.0.0-rc.7", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", @@ -73,6 +74,6 @@ ], "jupyterlab": { "extension": true, - "outputDir": "jupyterlab_examples_custom_log_console/static" + "outputDir": "jupyterlab_examples_custom_log_console/labextension" } } \ No newline at end of file diff --git a/log-console/custom-log-console/setup.py b/log-console/custom-log-console/setup.py index aaccffd6..d496aad8 100644 --- a/log-console/custom-log-console/setup.py +++ b/log-console/custom-log-console/setup.py @@ -1,6 +1,7 @@ """ jupyterlab_examples_custom_log_console setup """ +import json import os from jupyter_packaging import ( @@ -15,14 +16,15 @@ name="jupyterlab_examples_custom_log_console" # Get our version -version = get_version(os.path.join(name, "_version.py")) +with open(os.path.join(HERE, 'package.json')) as f: + version = json.load(f)['version'] -lab_path = os.path.join(HERE, name, "static") +lab_path = os.path.join(HERE, name, "labextension") # Representative files that should exist after a successful build jstargets = [ os.path.join(HERE, "lib", "index.js"), - os.path.join(HERE, name, "static", "package.json"), + os.path.join(lab_path, "package.json"), ] package_data_spec = { @@ -34,7 +36,8 @@ labext_name = "@jupyterlab-examples/custom-log-console" data_files_spec = [ - ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "**"), + ("share/jupyter/labextensions/%s" % labext_name, HERE, "install.json"), ] cmdclass = create_cmdclass("jsdeps", @@ -43,7 +46,7 @@ ) cmdclass["jsdeps"] = combine_commands( - install_npm(HERE, build_cmd="build", npm=["jlpm"]), + install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]), ensure_targets(jstargets), ) diff --git a/log-console/log-messages/MANIFEST.in b/log-console/log-messages/MANIFEST.in index d3382d09..37ebc43a 100644 --- a/log-console/log-messages/MANIFEST.in +++ b/log-console/log-messages/MANIFEST.in @@ -6,7 +6,7 @@ include jupyter-config/jupyterlab_examples_log_messages.json include package.json include ts*.json -graft jupyterlab_examples_log_messages/static +graft jupyterlab_examples_log_messages/labextension # Javascript files graft src diff --git a/log-console/log-messages/install.json b/log-console/log-messages/install.json new file mode 100644 index 00000000..be850e33 --- /dev/null +++ b/log-console/log-messages/install.json @@ -0,0 +1,5 @@ +{ + "packageManager": "python", + "packageName": "jupyterlab_examples_log_messages", + "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlab_examples_log_messages" +} diff --git a/log-console/log-messages/jupyterlab_examples_log_messages/__init__.py b/log-console/log-messages/jupyterlab_examples_log_messages/__init__.py index 819e43e0..353ab522 100644 --- a/log-console/log-messages/jupyterlab_examples_log_messages/__init__.py +++ b/log-console/log-messages/jupyterlab_examples_log_messages/__init__.py @@ -6,12 +6,12 @@ HERE = osp.abspath(osp.dirname(__file__)) -with open(osp.join(HERE, 'static', 'package.json')) as fid: +with open(osp.join(HERE, 'labextension', 'package.json')) as fid: data = json.load(fid) def _jupyter_labextension_paths(): return [{ - 'src': 'static', + 'src': 'labextension', 'dest': data['name'] }] diff --git a/log-console/log-messages/package.json b/log-console/log-messages/package.json index 733ae095..a5800d6c 100644 --- a/log-console/log-messages/package.json +++ b/log-console/log-messages/package.json @@ -25,38 +25,39 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "jlpm run build:lib && jlpm run build:labextension", + "build": "jlpm run build:lib && jlpm run build:labextension:dev", "build:all": "jlpm run build:lib && jlpm run build:labextension", "build:labextension": "jupyter labextension build .", "build:labextension:dev": "jupyter labextension build --development True .", "build:lib": "tsc", + "build:prod": "jlpm run build:lib && jlpm run build:labextension", "clean": "jlpm run clean:lib", "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", - "clean:labextension": "rimraf jupyterlab_examples_log_messages/static", + "clean:labextension": "rimraf jupyterlab_examples_log_messages/labextension", "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", "install:extension": "jupyter labextension develop --overwrite .", - "prepare": "jlpm run clean && jlpm run build", + "prepare": "jlpm run clean && jlpm run build:prod", "watch": "run-p watch:src watch:labextension", "watch:labextension": "jupyter labextension watch .", "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^3.0.0-rc.2", - "@jupyterlab/apputils": "^3.0.0-rc.2", - "@jupyterlab/coreutils": "^5.0.0-rc.2", - "@jupyterlab/logconsole": "^3.0.0-rc.2", - "@jupyterlab/mainmenu": "^3.0.0-rc.2", - "@jupyterlab/nbformat": "^3.0.0-rc.2", - "@jupyterlab/notebook": "^3.0.0-rc.2", - "@jupyterlab/rendermime": "^3.0.0-rc.2", - "@jupyterlab/ui-components": "^3.0.0-rc.2", + "@jupyterlab/application": "^3.0.0-rc.7", + "@jupyterlab/apputils": "^3.0.0-rc.7", + "@jupyterlab/coreutils": "^5.0.0-rc.7", + "@jupyterlab/logconsole": "^3.0.0-rc.7", + "@jupyterlab/mainmenu": "^3.0.0-rc.7", + "@jupyterlab/nbformat": "^3.0.0-rc.7", + "@jupyterlab/notebook": "^3.0.0-rc.7", + "@jupyterlab/rendermime": "^3.0.0-rc.7", + "@jupyterlab/ui-components": "^3.0.0-rc.7", "@lumino/coreutils": "^1.5.3", "@lumino/widgets": "^1.14.0" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-rc.2", + "@jupyterlab/builder": "^3.0.0-rc.7", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", @@ -74,6 +75,6 @@ ], "jupyterlab": { "extension": true, - "outputDir": "jupyterlab_examples_log_messages/static" + "outputDir": "jupyterlab_examples_log_messages/labextension" } } \ No newline at end of file diff --git a/log-console/log-messages/setup.py b/log-console/log-messages/setup.py index c3126dc0..2fecb102 100644 --- a/log-console/log-messages/setup.py +++ b/log-console/log-messages/setup.py @@ -1,6 +1,7 @@ """ jupyterlab_examples_log_messages setup """ +import json import os from jupyter_packaging import ( @@ -15,14 +16,15 @@ name="jupyterlab_examples_log_messages" # Get our version -version = get_version(os.path.join(name, "_version.py")) +with open(os.path.join(HERE, 'package.json')) as f: + version = json.load(f)['version'] -lab_path = os.path.join(HERE, name, "static") +lab_path = os.path.join(HERE, name, "labextension") # Representative files that should exist after a successful build jstargets = [ os.path.join(HERE, "lib", "index.js"), - os.path.join(HERE, name, "static", "package.json"), + os.path.join(lab_path, "package.json"), ] package_data_spec = { @@ -34,7 +36,8 @@ labext_name = "@jupyterlab-examples/log-messages" data_files_spec = [ - ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "**"), + ("share/jupyter/labextensions/%s" % labext_name, HERE, "install.json"), ] cmdclass = create_cmdclass("jsdeps", @@ -43,7 +46,7 @@ ) cmdclass["jsdeps"] = combine_commands( - install_npm(HERE, build_cmd="build", npm=["jlpm"]), + install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]), ensure_targets(jstargets), ) diff --git a/main-menu/MANIFEST.in b/main-menu/MANIFEST.in index 31c840a3..1a2c9e9a 100644 --- a/main-menu/MANIFEST.in +++ b/main-menu/MANIFEST.in @@ -6,7 +6,7 @@ include jupyter-config/jupyterlab_examples_main_menu.json include package.json include ts*.json -graft jupyterlab_examples_main_menu/static +graft jupyterlab_examples_main_menu/labextension # Javascript files graft src diff --git a/main-menu/README.md b/main-menu/README.md index 3c765702..4fc7e3df 100644 --- a/main-menu/README.md +++ b/main-menu/README.md @@ -87,11 +87,11 @@ After the execution of that command, `package.json` should list them in the ```json5 // package.json#L44-L48 + "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^3.0.0-rc.2", - "@jupyterlab/mainmenu": "^3.0.0-rc.2", - "@lumino/widgets": "^1.14.0" + "@jupyterlab/application": "^3.0.0-rc.7", + "@jupyterlab/mainmenu": "^3.0.0-rc.7", ``` With this extension installed, a new menu _Main Menu Example_ should be present. And when diff --git a/main-menu/install.json b/main-menu/install.json new file mode 100644 index 00000000..0749265a --- /dev/null +++ b/main-menu/install.json @@ -0,0 +1,5 @@ +{ + "packageManager": "python", + "packageName": "jupyterlab_examples_main_menu", + "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlab_examples_main_menu" +} diff --git a/main-menu/jupyterlab_examples_main_menu/__init__.py b/main-menu/jupyterlab_examples_main_menu/__init__.py index 819e43e0..353ab522 100644 --- a/main-menu/jupyterlab_examples_main_menu/__init__.py +++ b/main-menu/jupyterlab_examples_main_menu/__init__.py @@ -6,12 +6,12 @@ HERE = osp.abspath(osp.dirname(__file__)) -with open(osp.join(HERE, 'static', 'package.json')) as fid: +with open(osp.join(HERE, 'labextension', 'package.json')) as fid: data = json.load(fid) def _jupyter_labextension_paths(): return [{ - 'src': 'static', + 'src': 'labextension', 'dest': data['name'] }] diff --git a/main-menu/package.json b/main-menu/package.json index ddd1d4aa..1d137409 100644 --- a/main-menu/package.json +++ b/main-menu/package.json @@ -25,30 +25,31 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "jlpm run build:lib && jlpm run build:labextension", + "build": "jlpm run build:lib && jlpm run build:labextension:dev", "build:all": "jlpm run build:lib && jlpm run build:labextension", "build:labextension": "jupyter labextension build .", "build:labextension:dev": "jupyter labextension build --development True .", "build:lib": "tsc", + "build:prod": "jlpm run build:lib && jlpm run build:labextension", "clean": "jlpm run clean:lib", "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", - "clean:labextension": "rimraf jupyterlab_examples_main_menu/static", + "clean:labextension": "rimraf jupyterlab_examples_main_menu/labextension", "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", "install:extension": "jupyter labextension develop --overwrite .", - "prepare": "jlpm run clean && jlpm run build", + "prepare": "jlpm run clean && jlpm run build:prod", "watch": "run-p watch:src watch:labextension", "watch:labextension": "jupyter labextension watch .", "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^3.0.0-rc.2", - "@jupyterlab/mainmenu": "^3.0.0-rc.2", + "@jupyterlab/application": "^3.0.0-rc.7", + "@jupyterlab/mainmenu": "^3.0.0-rc.7", "@lumino/widgets": "^1.14.0" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-rc.2", + "@jupyterlab/builder": "^3.0.0-rc.7", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", @@ -66,6 +67,6 @@ ], "jupyterlab": { "extension": true, - "outputDir": "jupyterlab_examples_main_menu/static" + "outputDir": "jupyterlab_examples_main_menu/labextension" } } \ No newline at end of file diff --git a/main-menu/setup.py b/main-menu/setup.py index c05e19b0..17fc7229 100644 --- a/main-menu/setup.py +++ b/main-menu/setup.py @@ -1,6 +1,7 @@ """ jupyterlab_examples_main_menu setup """ +import json import os from jupyter_packaging import ( @@ -15,14 +16,15 @@ name="jupyterlab_examples_main_menu" # Get our version -version = get_version(os.path.join(name, "_version.py")) +with open(os.path.join(HERE, 'package.json')) as f: + version = json.load(f)['version'] -lab_path = os.path.join(HERE, name, "static") +lab_path = os.path.join(HERE, name, "labextension") # Representative files that should exist after a successful build jstargets = [ os.path.join(HERE, "lib", "index.js"), - os.path.join(HERE, name, "static", "package.json"), + os.path.join(lab_path, "package.json"), ] package_data_spec = { @@ -34,7 +36,8 @@ labext_name = "@jupyterlab-examples/main-menu" data_files_spec = [ - ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "**"), + ("share/jupyter/labextensions/%s" % labext_name, HERE, "install.json"), ] cmdclass = create_cmdclass("jsdeps", @@ -43,7 +46,7 @@ ) cmdclass["jsdeps"] = combine_commands( - install_npm(HERE, build_cmd="build", npm=["jlpm"]), + install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]), ensure_targets(jstargets), ) diff --git a/react/react-widget/MANIFEST.in b/react/react-widget/MANIFEST.in index 558067e8..6444b9ab 100644 --- a/react/react-widget/MANIFEST.in +++ b/react/react-widget/MANIFEST.in @@ -6,7 +6,7 @@ include jupyter-config/jupyterlab_examples_react_widget.json include package.json include ts*.json -graft jupyterlab_examples_react_widget/static +graft jupyterlab_examples_react_widget/labextension # Javascript files graft src diff --git a/react/react-widget/install.json b/react/react-widget/install.json new file mode 100644 index 00000000..add866c4 --- /dev/null +++ b/react/react-widget/install.json @@ -0,0 +1,5 @@ +{ + "packageManager": "python", + "packageName": "jupyterlab_examples_react_widget", + "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlab_examples_react_widget" +} diff --git a/react/react-widget/jupyterlab_examples_react_widget/__init__.py b/react/react-widget/jupyterlab_examples_react_widget/__init__.py index 819e43e0..353ab522 100644 --- a/react/react-widget/jupyterlab_examples_react_widget/__init__.py +++ b/react/react-widget/jupyterlab_examples_react_widget/__init__.py @@ -6,12 +6,12 @@ HERE = osp.abspath(osp.dirname(__file__)) -with open(osp.join(HERE, 'static', 'package.json')) as fid: +with open(osp.join(HERE, 'labextension', 'package.json')) as fid: data = json.load(fid) def _jupyter_labextension_paths(): return [{ - 'src': 'static', + 'src': 'labextension', 'dest': data['name'] }] diff --git a/react/react-widget/package.json b/react/react-widget/package.json index f173083e..43906051 100644 --- a/react/react-widget/package.json +++ b/react/react-widget/package.json @@ -25,30 +25,31 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "jlpm run build:lib && jlpm run build:labextension", + "build": "jlpm run build:lib && jlpm run build:labextension:dev", "build:all": "jlpm run build:lib && jlpm run build:labextension", "build:labextension": "jupyter labextension build .", "build:labextension:dev": "jupyter labextension build --development True .", "build:lib": "tsc", + "build:prod": "jlpm run build:lib && jlpm run build:labextension", "clean": "jlpm run clean:lib", "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", - "clean:labextension": "rimraf jupyterlab_examples_react_widget/static", + "clean:labextension": "rimraf jupyterlab_examples_react_widget/labextension", "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", "install:extension": "jupyter labextension develop --overwrite .", - "prepare": "jlpm run clean && jlpm run build", + "prepare": "jlpm run clean && jlpm run build:prod", "watch": "run-p watch:src watch:labextension", "watch:labextension": "jupyter labextension watch .", "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^3.0.0-rc.2", - "@jupyterlab/launcher": "^3.0.0-rc.2", - "@jupyterlab/ui-components": "^3.0.0-rc.2" + "@jupyterlab/application": "^3.0.0-rc.7", + "@jupyterlab/launcher": "^3.0.0-rc.7", + "@jupyterlab/ui-components": "^3.0.0-rc.7" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-rc.2", + "@jupyterlab/builder": "^3.0.0-rc.7", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", @@ -66,6 +67,6 @@ ], "jupyterlab": { "extension": true, - "outputDir": "jupyterlab_examples_react_widget/static" + "outputDir": "jupyterlab_examples_react_widget/labextension" } } \ No newline at end of file diff --git a/react/react-widget/setup.py b/react/react-widget/setup.py index 773bf515..be65051f 100644 --- a/react/react-widget/setup.py +++ b/react/react-widget/setup.py @@ -1,6 +1,7 @@ """ jupyterlab_examples_react_widget setup """ +import json import os from jupyter_packaging import ( @@ -15,14 +16,15 @@ name="jupyterlab_examples_react_widget" # Get our version -version = get_version(os.path.join(name, "_version.py")) +with open(os.path.join(HERE, 'package.json')) as f: + version = json.load(f)['version'] -lab_path = os.path.join(HERE, name, "static") +lab_path = os.path.join(HERE, name, "labextension") # Representative files that should exist after a successful build jstargets = [ os.path.join(HERE, "lib", "index.js"), - os.path.join(HERE, name, "static", "package.json"), + os.path.join(lab_path, "package.json"), ] package_data_spec = { @@ -34,7 +36,8 @@ labext_name = "@jupyterlab-examples/react-widget" data_files_spec = [ - ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "**"), + ("share/jupyter/labextensions/%s" % labext_name, HERE, "install.json"), ] cmdclass = create_cmdclass("jsdeps", @@ -43,7 +46,7 @@ ) cmdclass["jsdeps"] = combine_commands( - install_npm(HERE, build_cmd="build", npm=["jlpm"]), + install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]), ensure_targets(jstargets), ) diff --git a/settings/MANIFEST.in b/settings/MANIFEST.in index 72283e74..be45817b 100644 --- a/settings/MANIFEST.in +++ b/settings/MANIFEST.in @@ -6,7 +6,7 @@ include jupyter-config/jupyterlab_examples_settings.json include package.json include ts*.json -graft jupyterlab_examples_settings/static +graft jupyterlab_examples_settings/labextension # Javascript files graft src diff --git a/settings/README.md b/settings/README.md index b0b27dbc..f4ad6939 100644 --- a/settings/README.md +++ b/settings/README.md @@ -111,9 +111,9 @@ the `package.json` file in the `jupyterlab` section (here `schema`): ```json5 // package.json#L68-L70 + "style/*.css" ], "jupyterlab": { - "extension": true, ``` diff --git a/settings/install.json b/settings/install.json new file mode 100644 index 00000000..2e20e5d1 --- /dev/null +++ b/settings/install.json @@ -0,0 +1,5 @@ +{ + "packageManager": "python", + "packageName": "jupyterlab_examples_settings", + "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlab_examples_settings" +} diff --git a/settings/jupyterlab_examples_settings/__init__.py b/settings/jupyterlab_examples_settings/__init__.py index 819e43e0..353ab522 100644 --- a/settings/jupyterlab_examples_settings/__init__.py +++ b/settings/jupyterlab_examples_settings/__init__.py @@ -6,12 +6,12 @@ HERE = osp.abspath(osp.dirname(__file__)) -with open(osp.join(HERE, 'static', 'package.json')) as fid: +with open(osp.join(HERE, 'labextension', 'package.json')) as fid: data = json.load(fid) def _jupyter_labextension_paths(): return [{ - 'src': 'static', + 'src': 'labextension', 'dest': data['name'] }] diff --git a/settings/package.json b/settings/package.json index fff20af3..380f5294 100644 --- a/settings/package.json +++ b/settings/package.json @@ -26,31 +26,32 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "jlpm run build:lib && jlpm run build:labextension", + "build": "jlpm run build:lib && jlpm run build:labextension:dev", "build:all": "jlpm run build:lib && jlpm run build:labextension", "build:labextension": "jupyter labextension build .", "build:labextension:dev": "jupyter labextension build --development True .", "build:lib": "tsc", + "build:prod": "jlpm run build:lib && jlpm run build:labextension", "clean": "jlpm run clean:lib", "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", - "clean:labextension": "rimraf jupyterlab_examples_settings/static", + "clean:labextension": "rimraf jupyterlab_examples_settings/labextension", "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", "install:extension": "jupyter labextension develop --overwrite .", - "prepare": "jlpm run clean && jlpm run build", + "prepare": "jlpm run clean && jlpm run build:prod", "watch": "run-p watch:src watch:labextension", "watch:labextension": "jupyter labextension watch .", "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^3.0.0-rc.2", - "@jupyterlab/mainmenu": "^3.0.0-rc.2", - "@jupyterlab/settingregistry": "^3.0.0-rc.2", + "@jupyterlab/application": "^3.0.0-rc.7", + "@jupyterlab/mainmenu": "^3.0.0-rc.7", + "@jupyterlab/settingregistry": "^3.0.0-rc.7", "@lumino/widgets": "^1.14.0" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-rc.2", + "@jupyterlab/builder": "^3.0.0-rc.7", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", @@ -69,6 +70,6 @@ "jupyterlab": { "extension": true, "schemaDir": "schema", - "outputDir": "jupyterlab_examples_settings/static" + "outputDir": "jupyterlab_examples_settings/labextension" } } \ No newline at end of file diff --git a/settings/setup.py b/settings/setup.py index 089c8447..9e9a2d91 100644 --- a/settings/setup.py +++ b/settings/setup.py @@ -1,6 +1,7 @@ """ jupyterlab_examples_settings setup """ +import json import os from jupyter_packaging import ( @@ -15,14 +16,15 @@ name="jupyterlab_examples_settings" # Get our version -version = get_version(os.path.join(name, "_version.py")) +with open(os.path.join(HERE, 'package.json')) as f: + version = json.load(f)['version'] -lab_path = os.path.join(HERE, name, "static") +lab_path = os.path.join(HERE, name, "labextension") # Representative files that should exist after a successful build jstargets = [ os.path.join(HERE, "lib", "index.js"), - os.path.join(HERE, name, "static", "package.json"), + os.path.join(lab_path, "package.json"), ] package_data_spec = { @@ -34,7 +36,8 @@ labext_name = "@jupyterlab-examples/settings" data_files_spec = [ - ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "**"), + ("share/jupyter/labextensions/%s" % labext_name, HERE, "install.json"), ] cmdclass = create_cmdclass("jsdeps", @@ -43,7 +46,7 @@ ) cmdclass["jsdeps"] = combine_commands( - install_npm(HERE, build_cmd="build", npm=["jlpm"]), + install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]), ensure_targets(jstargets), ) diff --git a/state/MANIFEST.in b/state/MANIFEST.in index 5f1c8b43..2faf7778 100644 --- a/state/MANIFEST.in +++ b/state/MANIFEST.in @@ -6,7 +6,7 @@ include jupyter-config/jupyterlab_examples_state.json include package.json include ts*.json -graft jupyterlab_examples_state/static +graft jupyterlab_examples_state/labextension # Javascript files graft src diff --git a/state/install.json b/state/install.json new file mode 100644 index 00000000..e61b1e70 --- /dev/null +++ b/state/install.json @@ -0,0 +1,5 @@ +{ + "packageManager": "python", + "packageName": "jupyterlab_examples_state", + "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlab_examples_state" +} diff --git a/state/jupyterlab_examples_state/__init__.py b/state/jupyterlab_examples_state/__init__.py index 819e43e0..353ab522 100644 --- a/state/jupyterlab_examples_state/__init__.py +++ b/state/jupyterlab_examples_state/__init__.py @@ -6,12 +6,12 @@ HERE = osp.abspath(osp.dirname(__file__)) -with open(osp.join(HERE, 'static', 'package.json')) as fid: +with open(osp.join(HERE, 'labextension', 'package.json')) as fid: data = json.load(fid) def _jupyter_labextension_paths(): return [{ - 'src': 'static', + 'src': 'labextension', 'dest': data['name'] }] diff --git a/state/package.json b/state/package.json index 13d14ec8..bec7960b 100644 --- a/state/package.json +++ b/state/package.json @@ -25,31 +25,32 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "jlpm run build:lib && jlpm run build:labextension", + "build": "jlpm run build:lib && jlpm run build:labextension:dev", "build:all": "jlpm run build:lib && jlpm run build:labextension", "build:labextension": "jupyter labextension build .", "build:labextension:dev": "jupyter labextension build --development True .", "build:lib": "tsc", + "build:prod": "jlpm run build:lib && jlpm run build:labextension", "clean": "jlpm run clean:lib", "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", - "clean:labextension": "rimraf jupyterlab_examples_state/static", + "clean:labextension": "rimraf jupyterlab_examples_state/labextension", "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", "install:extension": "jupyter labextension develop --overwrite .", - "prepare": "jlpm run clean && jlpm run build", + "prepare": "jlpm run clean && jlpm run build:prod", "watch": "run-p watch:src watch:labextension", "watch:labextension": "jupyter labextension watch .", "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^3.0.0-rc.2", - "@jupyterlab/apputils": "^3.0.0-rc.2", - "@jupyterlab/statedb": "^3.0.0-rc.2", + "@jupyterlab/application": "^3.0.0-rc.7", + "@jupyterlab/apputils": "^3.0.0-rc.7", + "@jupyterlab/statedb": "^3.0.0-rc.7", "@lumino/coreutils": "^1.5.3" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-rc.2", + "@jupyterlab/builder": "^3.0.0-rc.7", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", @@ -67,6 +68,6 @@ ], "jupyterlab": { "extension": true, - "outputDir": "jupyterlab_examples_state/static" + "outputDir": "jupyterlab_examples_state/labextension" } } \ No newline at end of file diff --git a/state/setup.py b/state/setup.py index 281ed5bd..6d9c10ed 100644 --- a/state/setup.py +++ b/state/setup.py @@ -1,6 +1,7 @@ """ jupyterlab_examples_state setup """ +import json import os from jupyter_packaging import ( @@ -15,14 +16,15 @@ name="jupyterlab_examples_state" # Get our version -version = get_version(os.path.join(name, "_version.py")) +with open(os.path.join(HERE, 'package.json')) as f: + version = json.load(f)['version'] -lab_path = os.path.join(HERE, name, "static") +lab_path = os.path.join(HERE, name, "labextension") # Representative files that should exist after a successful build jstargets = [ os.path.join(HERE, "lib", "index.js"), - os.path.join(HERE, name, "static", "package.json"), + os.path.join(lab_path, "package.json"), ] package_data_spec = { @@ -34,7 +36,8 @@ labext_name = "@jupyterlab-examples/state" data_files_spec = [ - ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "**"), + ("share/jupyter/labextensions/%s" % labext_name, HERE, "install.json"), ] cmdclass = create_cmdclass("jsdeps", @@ -43,7 +46,7 @@ ) cmdclass["jsdeps"] = combine_commands( - install_npm(HERE, build_cmd="build", npm=["jlpm"]), + install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]), ensure_targets(jstargets), ) diff --git a/widget-tracker/widgets/MANIFEST.in b/widget-tracker/widgets/MANIFEST.in index 216005e6..04b6c5db 100644 --- a/widget-tracker/widgets/MANIFEST.in +++ b/widget-tracker/widgets/MANIFEST.in @@ -6,7 +6,7 @@ include jupyter-config/jupyterlab_examples_widgets.json include package.json include ts*.json -graft jupyterlab_examples_widgets/static +graft jupyterlab_examples_widgets/labextension # Javascript files graft src diff --git a/widget-tracker/widgets/install.json b/widget-tracker/widgets/install.json new file mode 100644 index 00000000..947119e8 --- /dev/null +++ b/widget-tracker/widgets/install.json @@ -0,0 +1,5 @@ +{ + "packageManager": "python", + "packageName": "jupyterlab_examples_widgets", + "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlab_examples_widgets" +} diff --git a/widget-tracker/widgets/jupyterlab_examples_widgets/__init__.py b/widget-tracker/widgets/jupyterlab_examples_widgets/__init__.py index 819e43e0..353ab522 100644 --- a/widget-tracker/widgets/jupyterlab_examples_widgets/__init__.py +++ b/widget-tracker/widgets/jupyterlab_examples_widgets/__init__.py @@ -6,12 +6,12 @@ HERE = osp.abspath(osp.dirname(__file__)) -with open(osp.join(HERE, 'static', 'package.json')) as fid: +with open(osp.join(HERE, 'labextension', 'package.json')) as fid: data = json.load(fid) def _jupyter_labextension_paths(): return [{ - 'src': 'static', + 'src': 'labextension', 'dest': data['name'] }] diff --git a/widget-tracker/widgets/package.json b/widget-tracker/widgets/package.json index 913884df..13fada03 100644 --- a/widget-tracker/widgets/package.json +++ b/widget-tracker/widgets/package.json @@ -25,32 +25,33 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "jlpm run build:lib && jlpm run build:labextension", + "build": "jlpm run build:lib && jlpm run build:labextension:dev", "build:all": "jlpm run build:lib && jlpm run build:labextension", "build:labextension": "jupyter labextension build .", "build:labextension:dev": "jupyter labextension build --development True .", "build:lib": "tsc", + "build:prod": "jlpm run build:lib && jlpm run build:labextension", "clean": "jlpm run clean:lib", "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", - "clean:labextension": "rimraf jupyterlab_examples_widgets/static", + "clean:labextension": "rimraf jupyterlab_examples_widgets/labextension", "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", "install:extension": "jupyter labextension develop --overwrite .", - "prepare": "jlpm run clean && jlpm run build", + "prepare": "jlpm run clean && jlpm run build:prod", "watch": "run-p watch:src watch:labextension", "watch:labextension": "jupyter labextension watch .", "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^3.0.0-rc.2", - "@jupyterlab/mainmenu": "^3.0.0-rc.2", + "@jupyterlab/application": "^3.0.0-rc.7", + "@jupyterlab/mainmenu": "^3.0.0-rc.7", "@lumino/algorithm": "^1.3.3", "@lumino/coreutils": "^1.5.3", "@lumino/disposable": "^1.4.3" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-rc.2", + "@jupyterlab/builder": "^3.0.0-rc.7", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", @@ -68,6 +69,6 @@ ], "jupyterlab": { "extension": true, - "outputDir": "jupyterlab_examples_widgets/static" + "outputDir": "jupyterlab_examples_widgets/labextension" } } \ No newline at end of file diff --git a/widget-tracker/widgets/setup.py b/widget-tracker/widgets/setup.py index e28251d0..440090ee 100644 --- a/widget-tracker/widgets/setup.py +++ b/widget-tracker/widgets/setup.py @@ -1,6 +1,7 @@ """ jupyterlab_examples_widgets setup """ +import json import os from jupyter_packaging import ( @@ -15,14 +16,15 @@ name="jupyterlab_examples_widgets" # Get our version -version = get_version(os.path.join(name, "_version.py")) +with open(os.path.join(HERE, 'package.json')) as f: + version = json.load(f)['version'] -lab_path = os.path.join(HERE, name, "static") +lab_path = os.path.join(HERE, name, "labextension") # Representative files that should exist after a successful build jstargets = [ os.path.join(HERE, "lib", "index.js"), - os.path.join(HERE, name, "static", "package.json"), + os.path.join(lab_path, "package.json"), ] package_data_spec = { @@ -34,7 +36,8 @@ labext_name = "@jupyterlab-examples/widgets" data_files_spec = [ - ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "**"), + ("share/jupyter/labextensions/%s" % labext_name, HERE, "install.json"), ] cmdclass = create_cmdclass("jsdeps", @@ -43,7 +46,7 @@ ) cmdclass["jsdeps"] = combine_commands( - install_npm(HERE, build_cmd="build", npm=["jlpm"]), + install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]), ensure_targets(jstargets), )