Commit 95deb93
committed
refactor(sdk): name the v0 modules for the surface they serve
Every SDK ended 0.6.0 with the v1 code in `*_v1` files and the v0 code still
in the unsuffixed ones it had before there was anything to distinguish it
from. So "unsuffixed file" meant v0 while "unsuffixed class" meant v1, and a
reader opening `dstack_client.rs` landed on the legacy surface.
The v0 modules now say so: `dstack_client.rs` -> `dstack_client_v0.rs` and
types `dstack.rs` -> `dstack_v0.rs` in Rust, `dstack_client.py` ->
`dstack_client_v0.py` in Python, `client.go` -> `client_v0.go` in Go. The JS
SDK had both clients and their shared helpers in one `index.ts`; it is split
into `client-v0.ts`, `client-v1.ts` and `shared.ts`, with `index.ts` kept as
a barrel exporting exactly what it exported before.
No compatibility aliases for the old module paths. 0.6.0 is already the
release where the unsuffixed client name changed meaning, and the whole point
of that decision was that an unmigrated caller fails at build time rather
than silently binding the frozen surface; a module alias would reopen the
hole the rename closes.
Deprecation is now visible to each language's tooling rather than only to a
reader. Go and JS already carried `// Deprecated:` and `@deprecated`; Rust
had no attribute at all and Python only a docstring note. `DstackClientV0`
and `TappdClient` now carry `#[deprecated]`, with `#[allow(deprecated)]` at
the internal use sites so the attribute reaches downstream callers instead of
being blanket-suppressed, and the Python v0 clients warn at construction
through the helper the file already had for `TappdClient`. Two tests pin that
warning, which nothing did before.
`.claude/agents/sdk-sync-checker.md` listed the old paths and now lists both
surfaces' files, since a rename that leaves the agent looking at the wrong
file makes it quietly useless.1 parent ea43576 commit 95deb93
34 files changed
Lines changed: 1135 additions & 978 deletions
File tree
- .claude/agents
- sdk
- go/dstack
- js/src
- python
- src/dstack_sdk
- tests
- rust
- examples
- src
- tests
- types
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
575 | 575 | | |
576 | 576 | | |
577 | 577 | | |
| 578 | + | |
578 | 579 | | |
579 | 580 | | |
580 | 581 | | |
581 | 582 | | |
582 | 583 | | |
583 | 584 | | |
| 585 | + | |
584 | 586 | | |
585 | 587 | | |
586 | 588 | | |
| |||
601 | 603 | | |
602 | 604 | | |
603 | 605 | | |
| 606 | + | |
604 | 607 | | |
605 | 608 | | |
606 | 609 | | |
| |||
632 | 635 | | |
633 | 636 | | |
634 | 637 | | |
| 638 | + | |
635 | 639 | | |
636 | 640 | | |
637 | 641 | | |
| |||
661 | 665 | | |
662 | 666 | | |
663 | 667 | | |
| 668 | + | |
664 | 669 | | |
665 | 670 | | |
666 | 671 | | |
| |||
File renamed without changes.
0 commit comments