Skip to content

Mark protocol versions as generated#872

Draft
kvz wants to merge 124 commits into
mainfrom
tus-gen
Draft

Mark protocol versions as generated#872
kvz wants to merge 124 commits into
mainfrom
tus-gen

Conversation

@kvz
Copy link
Copy Markdown
Member

@kvz kvz commented May 26, 2026

Experimental Status

Experimental work: this PR is part of an exploratory contract/generated docs and SDK effort, and is intentionally kept as a Draft while the approach is validated.

Why

This is the first tiny generated island for the API2-owned TUS protocol SDK generator. It lets the API2 generator rewrite and byte-for-byte compare the protocol version constants before expanding into default options and upload behavior.

What

  • Mark protocol version constants in lib/options.ts with generated-region markers.
  • Keep the generated protocol-version output byte-for-byte identical to the existing constants, aside from markers and the ownership notice.
  • Add a generated protocol contract fixture derived from API2 TUS operation contracts, wire version metadata, and client feature metadata.
  • Add a real Upload lifecycle test that consumes the generated fixture to assert the generated createTusUpload and patchTusUpload steps against tus-js-client behavior.

Verification

  • npm run build-transpile
  • npm run test-node
  • From API2: api2/bin/cli.ts contracts tus-sdks --platform typescript --sdk-root ../tus-js-client --rewrite-sdk --compare-existing --no-motd

Companion PRs (tus org only)

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.

1 participant