Skip to content

Commit

Permalink
Use version_template for package.json (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Aug 28, 2022
1 parent b06fdc8 commit 5b13df4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion hatch_jupyter_builder/migrate/_migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,12 @@
text = package_json.read_text(encoding="utf-8")
npm_version = json.loads(text)["version"]
if npm_version == current_version:
tbump_table["file"].append(dict(src="package.json"))
tbump_table["file"].append(
dict(
src="package.json",
version_template='"version": "{major}.{minor}.{patch}{channel}{release}"',
)
)

# Add a setup.py shim.
shim_text = """# setup.py shim for use with applications that require it.
Expand Down
2 changes: 1 addition & 1 deletion tests/data/npm_builder/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ field = [
file = [
{ src = "pyproject.toml", version_template = "version = \"{major}.{minor}.{patch}{channel}{release}\"" },
{ src = "myextension/_version.py" },
{ src = "package.json" },
{ src = "package.json", version_template = '"version": "{major}.{minor}.{patch}{channel}{release}"' },
]

[tool.tbump.version]
Expand Down

0 comments on commit 5b13df4

Please sign in to comment.