Skip to content

Commit

Permalink
Merge pull request #64 from timkpaine/prebuilt
Browse files Browse the repository at this point in the history
dist prebuilt extension
  • Loading branch information
timkpaine authored Mar 15, 2022
2 parents 71676a9 + eb7552f commit c519c05
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 43 deletions.
38 changes: 22 additions & 16 deletions js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,9 @@
"type": "git",
"url": "https://github.com/timkpaine/ipydagred3"
},
"jupyterlab": {
"extension": "lib/plugin.js",
"outputDir": "../ipydagred3/labextension",
"discovery": {
"server": {
"base": {
"name": "ipydagred3"
},
"managers": [
"pip"
]
}
}
},
"scripts": {
"build": "npm run build:lib && npm run build:nbextension && npm run build:labextension",
"build:labextension": "npm run clean:labextension && mkdirp ../ipydagred3/labextension && cd ../ipydagred3/labextension && npm pack ../../js",
"build:labextension": "yarn clean:labextension && jupyter labextension build .",
"build:lib": "babel src/ --source-maps --out-dir ./lib/",
"build:nbextension": "webpack --mode=production",
"build:all": "npm run build:lib && npm run build:labextension && npm run build:nbextension",
Expand All @@ -56,9 +42,23 @@
"prepack": "npm run build:lib",
"test": "jest --coverage --collectCoverageFrom=src/*.{js}",
"watch": "npm-run-all -p watch:*",
"watch:lib": "tsc -w",
"watch:lib": "yarn build:lib --watch",
"watch:nbextension": "webpack --watch"
},
"jupyterlab": {
"extension": "lib/plugin.js",
"outputDir": "../ipydagred3/labextension",
"discovery": {
"server": {
"base": {
"name": "ipydagred3"
},
"managers": [
"pip"
]
}
}
},
"dependencies": {
"@jupyter-widgets/base": "^3.0.0 || ^4.0.0",
"d3": "^5.15.0",
Expand All @@ -85,16 +85,22 @@
"eslint-plugin-prefer-arrow": "^1.2.3",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-unicorn": "^36.0.0",
"expect.js": "^0.3.1",
"fs-extra": "^10.0.0",
"isomorphic-fetch": "^3.0.0",
"jest": "^27.1.1",
"jest-transform-css": "^2.0.0",
"mkdirp": "^1.0.4",
"mocha": "^9.1.1",
"npm-run-all": "^4.1.3",
"prettier": "^2.5.1",
"rimraf": "^3.0.2",
"source-map-loader": "^3.0.0",
"style-loader": "^3.2.1",
"webpack": "^5.52.1",
"webpack-cli": "^4.8.0"
},
"resolutions": {
"kind-of": "^6.0.3"
}
}
27 changes: 25 additions & 2 deletions js/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4025,6 +4025,11 @@ exit@^0.1.2:
resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c"
integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=

expect.js@^0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/expect.js/-/expect.js-0.3.1.tgz#b0a59a0d2eff5437544ebf0ceaa6015841d09b5b"
integrity sha1-sKWaDS7/VDdUTr8M6qYBWEHQm1s=

expect@^27.5.0:
version "27.5.0"
resolved "https://registry.yarnpkg.com/expect/-/expect-27.5.0.tgz#ea2fbebb483c274043098c34a53923a0aee493f0"
Expand Down Expand Up @@ -5035,6 +5040,14 @@ isobject@^3.0.1:
resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"
integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8=

isomorphic-fetch@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz#0267b005049046d2421207215d45d6a262b8b8b4"
integrity sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==
dependencies:
node-fetch "^2.6.1"
whatwg-fetch "^3.4.1"

isstream@~0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
Expand Down Expand Up @@ -5751,7 +5764,7 @@ keyv@^3.0.0:
dependencies:
json-buffer "3.0.0"

kind-of@^6.0.2:
kind-of@^6.0.2, kind-of@^6.0.3:
version "6.0.3"
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd"
integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==
Expand Down Expand Up @@ -6286,7 +6299,7 @@ nice-try@^1.0.4:
resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366"
integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==

node-fetch@2.6.7, node-fetch@^2.6.0:
node-fetch@2.6.7, node-fetch@^2.6.0, node-fetch@^2.6.1:
version "2.6.7"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad"
integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==
Expand Down Expand Up @@ -6858,6 +6871,11 @@ prettier-linter-helpers@^1.0.0:
dependencies:
fast-diff "^1.1.2"

prettier@^2.5.1:
version "2.5.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.5.1.tgz#fff75fa9d519c54cf0fce328c1017d94546bc56a"
integrity sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==

prettier@~2.1.1:
version "2.1.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.1.2.tgz#3050700dae2e4c8b67c4c3f666cdb8af405e1ce5"
Expand Down Expand Up @@ -8530,6 +8548,11 @@ whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.5:
dependencies:
iconv-lite "0.4.24"

whatwg-fetch@^3.4.1:
version "3.6.2"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz#dced24f37f2624ed0281725d51d0e2e3fe677f8c"
integrity sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA==

whatwg-mimetype@^2.2.0, whatwg-mimetype@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf"
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"]
57 changes: 33 additions & 24 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# *****************************************************************************
#
# Copyright (c) 2020, the ipydagred3 authors.
#
# This file is part of the ipydagred3 library, distributed under the terms of
# the Apache License 2.0. The full license can be found in the LICENSE file.
#
from codecs import open
from os import path

from jupyter_packaging import (
Expand All @@ -18,10 +26,12 @@
with open(path.join(here, "README.md"), encoding="utf-8") as f:
long_description = f.read().replace("\r\n", "\n")

requires = ["ipywidgets>=7.5.1"]
requires = [
"ipywidgets>=7.5.1",
]

requires_dev = requires + [
"black>=20.",
"black>=20.8b1",
"bump2version>=1.0.0",
"flake8>=3.7.8",
"flake8-black>=0.2.1",
Expand All @@ -41,24 +51,32 @@
pjoin(jshere, "lib", "index.js"),
]

package_data_spec = {name: ["nbextension/static/*.*js*", "labextension/*.tgz"]}

data_files_spec = [
data_spec = [
# Lab extension installed by default:
("share/jupyter/nbextensions/ipydagred3", nb_path, "*.js*"),
("share/jupyter/lab/extensions", lab_path, "*.tgz"),
("etc/jupyter/nbconfig/notebook.d", here, "ipydagred3.json"),
(
"share/jupyter/labextensions/ipydagred3",
"ipydagred3/labextension",
"**",
),
# Config to enable server extension by default:
("etc/jupyter/jupyter_server_config.d", "jupyter-config", "*.json"),
]


cmdclass = create_cmdclass(
"jsdeps", package_data_spec=package_data_spec, data_files_spec=data_files_spec
)
cmdclass["jsdeps"] = combine_commands(
cmdclass = create_cmdclass("js", data_files_spec=data_spec)
cmdclass["js"] = combine_commands(
install_npm(jshere, build_cmd="build:all"),
ensure_targets(jstargets),
ensure_targets(
[
pjoin(jshere, "lib", "index.js"),
pjoin(jshere, "style", "index.css"),
pjoin(here, "ipydagred3", "labextension", "package.json"),
]
),
)


setup(
name=name,
version=version,
Expand Down Expand Up @@ -88,19 +106,10 @@
]
),
install_requires=requires,
extras_require={"dev": requires_dev},
extras_require={
"dev": requires_dev,
},
include_package_data=True,
data_files=[
(
"share/jupyter/nbextensions/ipydagred3",
[
"ipydagred3/nbextension/static/extension.js",
"ipydagred3/nbextension/static/index.js",
"ipydagred3/nbextension/static/index.js.map",
],
),
("etc/jupyter/nbconfig/notebook.d", ["ipydagred3.json"]),
],
zip_safe=False,
python_requires=">=3.7",
)

0 comments on commit c519c05

Please sign in to comment.