test: cover package root import in git-dependency smoke test#288
Closed
VascoSch92 wants to merge 1 commit into
Closed
test: cover package root import in git-dependency smoke test#288VascoSch92 wants to merge 1 commit into
VascoSch92 wants to merge 1 commit into
Conversation
The ERR_IMPORT_ATTRIBUTE_MISSING regression that blocked issue #135 affected the package root import ('.') specifically: the barrel transitively loads models/acp.js, which imports acp-providers.json and must carry a 'with { type: json }' attribute in published ESM. The git-dependency smoke test only exercised subpath exports, leaving that exact failure path uncovered. Add the root import and touch the JSON-backed ACP_PROVIDERS export so the smoke test fails if the attribute regresses. Co-authored-by: openhands <openhands@all-hands.dev>
4 tasks
Contributor
Endpoint audit❌ 40 off-contract call(s) — not on the agent-server · classifiers: cloud
❌ Not on agent-server (gated, 40)⛔ (no known backend) — served by no backend we can see (15)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Issue #135 ("Publish
@openhands/typescript-clientas an npm package") is functionally resolved as of@openhands/typescript-client@1.34.0: the package is published to the public npm registry, thevendor/directory andfile:reference are gone, and a clean Node ESM project cannpm installit and import the root plus every subpath export.The last blocker was the package root import failing with
ERR_IMPORT_ATTRIBUTE_MISSING. The root barrel transitively loadsmodels/acp.js, which importsacp-providers.json; in published ESM that import must carry awith { type: 'json' }attribute (added byscripts/rewrite-relative-imports.mjsduring the build). That fix is already in the tree and verified in the build output (dist/models/acp.js), but the existing git-dependency smoke test only exercised the subpath exports (./clients,./client/http-client,./events/remote-events-list,./workspace/remote-workspace) — never the root., which was the exact import that used to crash. That left the regression uncovered.This PR closes that coverage gap so the fix can't silently regress.
Summary
import { ACP_PROVIDERS } from '@openhands/typescript-client') toscripts/smoke-test-git-dependency.mjs.ACP_PROVIDERSexport (and assert it loaded) so the smoke test fails loudly if thewith { type: 'json' }attribute regresses and the root import throwsERR_IMPORT_ATTRIBUTE_MISSINGagain.Issue Number
Fixes #135
How to Test
The smoke test installs the package as a git dependency into a temp ESM project and imports the root + all subpaths. It prints the resolved export types and the ACP provider count, and throws if the root import fails to load the JSON-backed registry.
Additionally verified manually against a packed tarball in a clean
type: moduleproject:Full local check suite also passes:
npm run lint(0 errors),npm run format:check,npm run build, andnpm run test(290 tests).Type
Notes
This is a test-only change; no runtime/library code is modified. The underlying JSON import-attribute fix already shipped in
1.34.0— this simply pins the regression so future changes to the build/rewrite step keep the root import working.This PR was created by an AI agent (OpenHands) on behalf of the user.
@VascoSch92 can click here to continue refining the PR