Skip to content

Commit 09dfbcc

Browse files
authored
docs(types): deprecate function-types in favor of @tailor-platform/sdk (#190)
1 parent 5154a28 commit 09dfbcc

2 files changed

Lines changed: 49 additions & 6 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@tailor-platform/function-types": patch
3+
---
4+
5+
Deprecate this package in favor of `@tailor-platform/sdk`, which now covers the same `tailor.*` / `tailordb.*` runtime surface. The README documents the deprecation and migration steps.

packages/types/README.md

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,56 @@
11
# @tailor-platform/function-types
22

3-
## Usage
3+
**Deprecated.** These types are now built into [`@tailor-platform/sdk`](https://www.npmjs.com/package/@tailor-platform/sdk), which exposes the same `tailor.*` / `tailordb.*` runtime surface plus typed wrappers you can import directly instead of relying on ambient globals. New projects should use `@tailor-platform/sdk` instead of this package; existing projects should migrate using the steps below.
4+
5+
This package will no longer receive updates for new runtime APIs (e.g. it never picked up `tailor.aigateway.get()`, while `@tailor-platform/sdk` will keep gaining new runtime APIs).
6+
7+
## Migrating to `@tailor-platform/sdk`
8+
9+
1. Add `@tailor-platform/sdk` and remove this package:
10+
11+
```sh
12+
npm i -D @tailor-platform/sdk
13+
npm uninstall @tailor-platform/function-types
14+
```
15+
16+
If your project already depends on `@tailor-platform/sdk` (e.g. for `tailor.config.ts`, resolvers, or workflows), you can skip the install step.
17+
18+
2. Update `tsconfig.json` to load the runtime globals from the SDK instead:
19+
20+
```diff
21+
{
22+
"compilerOptions": {
23+
- "types": ["@tailor-platform/function-types"]
24+
+ "types": ["@tailor-platform/sdk/runtime/globals"]
25+
}
26+
}
27+
```
28+
29+
3. No other code changes are required. The global `tailor.*` and `tailordb.*` identifiers keep the same names and shapes (including the legacy capitalized `Tailordb.Client`, which `@tailor-platform/sdk` also keeps around for compatibility with this package).
30+
31+
### Prefer typed imports over ambient globals (optional)
32+
33+
Instead of relying on the ambient `tailor` / `tailordb` globals, `@tailor-platform/sdk/runtime` exposes the same APIs as regular imports, which is easier to trace and doesn't require the `tsconfig.json` `types` change above:
34+
35+
```typescript
36+
import { iconv, secretmanager, idp, workflow, context, authconnection, file } from "@tailor-platform/sdk/runtime";
37+
38+
const secret = await secretmanager.getSecret("my-vault", "API_KEY");
39+
```
40+
41+
### Known gap: `tailor.aigateway`
42+
43+
`@tailor-platform/sdk` does not yet expose a runtime equivalent of `tailor.aigateway.get(name)`. If your code uses it, keep this package installed alongside `@tailor-platform/sdk` for that one namespace until the SDK adds support, or reach out to the SDK team if you need this migrated sooner.
44+
45+
## Legacy usage (this package)
446

5-
Install package.
647
```sh
748
npm i -D @tailor-platform/function-types
849
```
950

10-
Add types to `tsconfig.json`.
11-
```
51+
```json
1252
{
13-
...
1453
"compilerOptions": {
15-
...
1654
"types": ["@tailor-platform/function-types"]
1755
}
1856
}

0 commit comments

Comments
 (0)