Skip to content

Commit

Permalink
Merge pull request #43 from timkpaine/prebuilt
Browse files Browse the repository at this point in the history
working on prebuilt extension
  • Loading branch information
timkpaine authored Nov 29, 2021
2 parents e0c73e7 + b475266 commit f183707
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,4 @@ docs/api
docs/index.md
python_junit.xml
*.tsbuildinfo
jupyterlab_commands/labextension
6 changes: 4 additions & 2 deletions js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"scripts": {
"build": "tsc",
"build:lab": "rimraf ../lab-dist && mkdirp ../lab-dist && cd ../lab-dist && npm pack ../js/",
"build:lab": "rimraf ../jupyterlab_commands/labextension && jupyter labextension build .",
"build:all": "npm run build && npm run build:lab",
"clean": "rimraf lib",
"fix": "yarn lint --fix",
Expand All @@ -24,7 +24,8 @@
"style/**/*.css"
],
"jupyterlab": {
"extension": true,
"extension": "lib/index.js",
"outputDir": "../jupyterlab_commands/labextension",
"discovery": {
"server": {
"base": {
Expand All @@ -50,6 +51,7 @@
},
"devDependencies": {
"@babel/preset-env": "^7.16.4",
"@jupyterlab/builder": "^3.2.0",
"@types/jest": "^27.0.3",
"@typescript-eslint/eslint-plugin": "^5.4.0",
"@typescript-eslint/eslint-plugin-tslint": "^5.4.0",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[build-system]
# Minimum requirements for the build system to execute.
requires = ["setuptools", "wheel", "jupyter-packaging"]
requires = ["setuptools", "wheel", "jupyter-packaging", "jupyterlab>=3"]
12 changes: 10 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@

data_spec = [
# Lab extension installed by default:
("share/jupyter/lab/extensions", "lab-dist", "jupyterlab_commands-*.tgz"),
(
"share/jupyter/labextensions/jupyterlab_commands",
"jupyterlab_commands/labextension",
"**",
),
# Config to enable server extension by default:
("etc/jupyter/jupyter_server_config.d", "jupyter-config", "*.json"),
]
Expand All @@ -48,7 +52,11 @@
cmdclass["js"] = combine_commands(
install_npm(jshere, build_cmd="build:all"),
ensure_targets(
[pjoin(jshere, "lib", "index.js"), pjoin(jshere, "style", "index.css")]
[
pjoin(jshere, "lib", "index.js"),
pjoin(jshere, "style", "index.css"),
pjoin(here, "jupyterlab_commands", "labextension", "package.json"),
]
),
)

Expand Down

0 comments on commit f183707

Please sign in to comment.