Skip to content

Commit e22dc3a

Browse files
committed
docs(codemod): regenerate v2 migration guide from registry
1 parent b42b2ca commit e22dc3a

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

  • packages/sdk/docs/migration

packages/sdk/docs/migration/v2.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,11 @@ happen to use `--machineuser` alone.
217217

218218
</details>
219219

220-
## auth.invoker("name") → "name"
220+
## auth.invoker("name") → invoker: "name"
221221

222222
**Migration:** Partially automatic
223223

224-
Replace `auth.invoker("name")` calls with the bare `"name"` string and drop the `auth` import when no other reference remains. The `auth.invoker()` helper is deprecated in v2 because importing `auth` from `tailor.config.ts` into runtime files pulls Node-only modules into the bundle.
224+
Rename statically identified SDK `authInvoker` options to `invoker`, replace `auth.invoker("name")` there with the bare `"name"` string, and drop the `auth` import when no other reference remains. Ambiguous workflow `.trigger()` calls are left for manual review. The `auth.invoker()` helper is removed in v2 because importing `auth` from `tailor.config.ts` into runtime files pulls Node-only modules into the bundle.
225225

226226
Before:
227227

@@ -241,19 +241,21 @@ createResolver({ invoker: "manager" });
241241
```text
242242
In Tailor SDK v2 the auth.invoker() helper is removed; an invoker is now the
243243
machine user name passed directly as a string. The codemod already rewrote the
244-
string-literal form auth.invoker("name") to "name". These files still contain
245-
auth.invoker(...) because the argument is not a plain string literal (a variable,
246-
template literal, function call, or property access).
244+
statically identified SDK option form authInvoker: auth.invoker("name") to invoker: "name" and renamed supported authInvoker option keys. These files still contain
245+
auth.invoker(...) calls or authInvoker keys that need manual review.
247246
248247
For each remaining auth.invoker(<expr>) call:
249-
1. Replace the whole call with <expr> as-is (e.g. auth.invoker(name) becomes name).
250-
2. Make sure <expr> evaluates to the machine user name (a string); adjust it if it
251-
resolves to an object or an auth config value instead.
248+
1. Replace the whole call with <expr> only where the target option expects a
249+
machine user name string; platform/runtime authInvoker payloads still expect
250+
the object form.
251+
2. Rename remaining authInvoker option keys to invoker only for SDK resolver,
252+
executor, workflow.trigger(), or startWorkflow() options. Keep platform/runtime
253+
payload keys such as tailor.workflow.triggerWorkflow(..., { authInvoker: ... }).
252254
3. After removing every auth.invoker usage in a file, delete the now-unused auth
253255
import (keeping it pulls Node-only config modules into runtime bundles); leave
254256
the import if auth is still referenced elsewhere.
255257
256-
Do not change behavior beyond removing the auth.invoker() indirection.
258+
Do not change behavior beyond the SDK option rename and auth.invoker() removal.
257259
```
258260

259261
</details>

0 commit comments

Comments
 (0)