Skip to content

test: make V2 smoke test copy-out-and-run (.mjs, plain node) - #73

Merged
tian-lan-landing merged 1 commit into
mainfrom
chore/v2-smoke-test-mjs
Jul 10, 2026
Merged

test: make V2 smoke test copy-out-and-run (.mjs, plain node)#73
tian-lan-landing merged 1 commit into
mainfrom
chore/v2-smoke-test-mjs

Conversation

@tian-lan-landing

Copy link
Copy Markdown
Collaborator

Follow-up to #72. The V2 smoke test was a .ts runnable only via the repo's yarn tsn (ts-node). A QA person who just npm install github:landing-ai/ade-typescript#...'d the package into their own project couldn't run it without adding a TypeScript toolchain (ts-node/tsx + tsconfig).

This converts examples/v2_smoke_test.tsexamples/v2_smoke_test.mjs (plain ESM JavaScript), so it mirrors ade-python's examples/v2_smoke_test.py: install the package, drop the file into any project, and node v2_smoke_test.mjs — no TS toolchain, no repo checkout.

  • Runtime logic is unchanged (only type annotations stripped); it uses the same import LandingAIADE from 'landingai-ade' default-import pattern the built package already ships for V1 users.
  • Type safety is still covered by the SDK's tsc (CI), the jest suite, and the shipped .d.ts.
  • The .ts version (identical logic) passed 7/7 live against api.ade.staging in feat: V2 parse & extract SDK support (client.v2) #72.

🤖 Generated with Claude Code

The smoke test was a .ts that only ran via the repo's ts-node (yarn tsn) — a
QA person who just `npm install github:...`'d the package couldn't run it
without adding a TS toolchain. Convert it to plain ESM JavaScript so it works
like ade-python's: install the package, drop the file into any project, and
`node v2_smoke_test.mjs`. Runtime logic is unchanged (types stripped); typing
is still covered by the SDK's tsc + jest + shipped .d.ts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tian-lan-landing

Copy link
Copy Markdown
Collaborator Author

Consumer-install validation ✅

Simulated a real consumer in a fresh project (not the repo checkout):

  1. npm install github:landing-ai/ade-typescript#chore/v2-smoke-test-mjs → resolved from git (…#3defc30) and built via the package's prepare step (npm ls shows the git URL, not a local/link install).
  2. Copied examples/v2_smoke_test.mjs into the project and ran it with plain node (no ts-node/tsx):
node v2_smoke_test.mjs --only files,extract
V2 base: https://api.ade.staging.landing.ai
  PASS  files.upload   → file_ref=storage-ref:…
  PASS  v2.extract      → {"company":"Acme Inc.","revenue":"$1,250,000"}  version=extract-20260630
0 failed / 2 run   (exit 0)

Real staging round-trips — confirms the copy-out-and-run flow works with plain node, matching ade-python's example.

Note: the built entrypoint installs at the package root (node_modules/landingai-ade/index.mjs) per the flat git-swap publish layout; import LandingAIADE from 'landingai-ade' resolves via exports, so consumers are unaffected.

🤖 Generated with Claude Code

@tian-lan-landing
tian-lan-landing merged commit ee7b0e5 into main Jul 10, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants