[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "qsharp-widgets"
version = "0.0.0"
readme = "README.md"
dependencies = ["anywidget"]

[project.optional-dependencies]
dev = ["watchfiles", "jupyterlab"]

# automatically add the dev feature to the default env (e.g., hatch shell)
[tool.hatch.envs.default]
features = ["dev"]

[tool.hatch.build]
only-packages = true
artifacts = ["src/qsharp_widgets/static/*"]

[tool.hatch.build.hooks.jupyter-builder]
build-function = "hatch_jupyter_builder.npm_builder"
ensured-targets = ["src/qsharp_widgets/static/index.js"]
# skip-if-exists = ["src/qsharp_widgets/static/index.js"]
dependencies = ["hatch-jupyter-builder>=0.5.0"]

[tool.hatch.build.hooks.jupyter-builder.build-kwargs]
npm = "npm"
build_cmd = "build"
