mirror of
https://github.com/MadsLorentzen/ai-job-search.git
synced 2026-11-02 13:12:50 +00:00
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:
6 files changed
+56
-6
No files matched your search
@@ -20,6 +20,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/bun": "1.3.14",
|
"@types/bun": "1.3.14",
|
||||||
|
"@types/node": "26.6.5",
|
||||||
"typescript": "^5.4.0"
|
"typescript": "^5.4.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,8 @@
|
|||||||
"zod": "^3.23.0"
|
"zod": "^3.23.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"typescript": "^5.4.0",
|
"@types/bun": "1.3.14",
|
||||||
"@types/bun": "1.3.14"
|
"@types/node": "26.6.5",
|
||||||
|
"typescript": "^5.4.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,8 @@
|
|||||||
"zod": "^3.23.0"
|
"zod": "^3.23.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"typescript": "^5.4.0",
|
"@types/bun": "1.3.14",
|
||||||
"@types/bun": "1.3.14"
|
"@types/node": "26.6.5",
|
||||||
|
"typescript": "^5.4.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -18,7 +18,8 @@
|
|||||||
"zod": "^3.23.0"
|
"zod": "^3.23.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"typescript": "^5.4.0",
|
"@types/bun": "1.3.14",
|
||||||
"@types/bun": "1.3.14"
|
"@types/node": "26.6.5",
|
||||||
|
"typescript": "^5.4.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -54,6 +54,17 @@ per-file diff commands.
|
|||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
- **The four `@bunli/core` portal CLIs typecheck on a clean install again** (#768, closes #765,
|
||||||
|
`.agents/skills/{jobbank,jobdanmark,jobindex,jobnet}-search/cli/package.json`,
|
||||||
|
`tests/test_portal_cli_types.py`) - `bun-types` accepts any `@types/node`, while `@bunli/core`
|
||||||
|
reaches `image-q`, which pins `@types/node` 16.9.1 exactly. bun 1.4.4 satisfies the open range
|
||||||
|
with that hoisted 16.9.1, whose globals have no `fetch`, `Response`, `URL` or `Headers`, so
|
||||||
|
`bun run typecheck` failed with TS2339/TS2749 errors in CI (which installs the latest bun and has
|
||||||
|
no committed lockfile) where bun 1.4.3 had hoisted a current `@types/node`. Each of the four CLIs
|
||||||
|
now declares `@types/node` 26.6.5 directly, so the top-level version no longer depends on the
|
||||||
|
resolver's placement, and a Python test fails if a CLI depending on `@bunli/core` drops the pin.
|
||||||
|
`freehire-search` and `linkedin-search` never pull `image-q` and are untouched.
|
||||||
|
|
||||||
- **`freehire-search detail` no longer asks the API for a slug cut out of a URL on another
|
- **`freehire-search detail` no longer asks the API for a slug cut out of a URL on another
|
||||||
host** (#623, fixes #622, `.agents/skills/freehire-search/cli/src/helpers.ts`, `tests/parsing.test.ts`,
|
host** (#623, fixes #622, `.agents/skills/freehire-search/cli/src/helpers.ts`, `tests/parsing.test.ts`,
|
||||||
`tests/commands.test.ts`, `SKILL.md`) - `normalizeSlug` took the segment after `/jobs/` from
|
`tests/commands.test.ts`, `SKILL.md`) - `normalizeSlug` took the segment after `/jobs/` from
|
||||||
|
|||||||
@@ -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()
|
||||||
Reference in new issue
Block a user