fix(portal-clis): pin @types/node in the four @bunli/core CLIs so typecheck passes on a clean install (closes #765) (#768)

* fix(portal-clis): pin @types/node in the @bunli/core CLIs

image-q pins @types/node 16.9.1 exactly, and with bun 1.4.4 a clean
install hoists it, so fetch/Response/URL/Headers vanish from typecheck.
Declare @types/node 26.6.5 as a devDependency in jobbank-search,
jobdanmark-search, jobindex-search and jobnet-search, and add a guard
test that checks every @bunli/core CLI does so.

Closes #765

Generated by NightShift

* docs(changelog): note the @types/node pin for the @bunli/core CLIs (#768)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Mads Lorentzen <madslorentzen_17@hotmail.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
authored and GitHub committed 2026-10-26 15:56:54 +01:00
1 parent 7f9edf54c1
commit 4b109c20c3
6 files changed
+56 -6

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
"""Portal CLIs using @bunli/core must pin @types/node directly.
@bunli/core pulls in image-q, which pins @types/node 16.9.1 exactly. Without
a direct devDependency, bun 1.4.4 hoists that version and the web globals
(fetch, Response, URL, Headers) vanish from typecheck.
"""
import json
import re
import unittest
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent
class PortalCliTypesTests(unittest.TestCase):
def test_bunli_clis_pin_types_node(self):
manifests = sorted((ROOT / ".agents" / "skills").glob("*/cli/package.json"))
checked = 0
for path in manifests:
data = json.loads(path.read_text(encoding="utf-8"))
if "@bunli/core" not in data.get("dependencies", {}):
continue
checked += 1
version = data.get("devDependencies", {}).get("@types/node")
with self.subTest(cli=path.parent.parent.name):
self.assertIsNotNone(version, "missing @types/node devDependency")
self.assertRegex(version, r"^\d+(\.\d+)*$")
# image-q pins 16.9.1, which lacks fetch/Response/URL/Headers.
self.assertGreaterEqual(int(version.split(".")[0]), 18)
self.assertGreater(checked, 0)
if __name__ == "__main__":
unittest.main()