@tailor-platform/sdk 2.4.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +103 -0
- package/dist/aigateway-DsWDjzk4.mjs +2 -0
- package/dist/{aigateway-DR4Kwuik.mjs.map → aigateway-DsWDjzk4.mjs.map} +1 -1
- package/dist/application-DFOUovmN.mjs +1 -0
- package/dist/application-D_4vg1KR.mjs +192 -0
- package/dist/application-D_4vg1KR.mjs.map +1 -0
- package/dist/assert-WeXvmG4j.mjs +2 -0
- package/dist/{assert-DBxo8jPo.mjs.map → assert-WeXvmG4j.mjs.map} +1 -1
- package/dist/authconnection-CynFBIv8.mjs +2 -0
- package/dist/{authconnection-CZvi9ANm.mjs.map → authconnection-CynFBIv8.mjs.map} +1 -1
- package/dist/brand-C8nMKhJC.mjs +2 -0
- package/dist/{brand-Eo4pLXPJ.mjs.map → brand-C8nMKhJC.mjs.map} +1 -1
- package/dist/cli/commands/deploy/deploy.d.mts +2 -2
- package/dist/cli/commands/deploy/deployment-target.d.mts +2 -0
- package/dist/cli/commands/deploy/event-subscriptions.d.mts +3 -0
- package/dist/cli/commands/deploy/tailordb/apply.d.mts +3 -0
- package/dist/cli/commands/deploy/tailordb/index.d.mts +3 -10
- package/dist/cli/commands/deploy/tailordb/migration-validation.d.mts +5 -0
- package/dist/cli/commands/deploy/tailordb/plan.d.mts +8 -0
- package/dist/cli/commands/executor/jobs.d.mts +1 -1
- package/dist/cli/commands/generate/seed/bundler.d.mts +2 -2
- package/dist/cli/commands/show.d.mts +1 -1
- package/dist/cli/commands/tailordb/migrate/diff-calculator.d.mts +11 -11
- package/dist/cli/commands/tailordb/migrate/generate.d.mts +4 -0
- package/dist/cli/commands/tailordb/migrate/rename-detection.d.mts +1 -1
- package/dist/cli/commands/tailordb/migrate/snapshot-comparison.d.mts +43 -0
- package/dist/cli/commands/tailordb/migrate/snapshot-files.d.mts +62 -0
- package/dist/cli/commands/tailordb/migrate/snapshot-local.d.mts +12 -0
- package/dist/cli/commands/tailordb/migrate/snapshot-migrations.d.mts +12 -0
- package/dist/cli/commands/tailordb/migrate/snapshot-remote.d.mts +1 -0
- package/dist/cli/commands/tailordb/migrate/snapshot-types.d.mts +3 -1
- package/dist/cli/commands/tailordb/migrate/snapshot.d.mts +5 -117
- package/dist/cli/lib.d.mts +8 -4
- package/dist/cli/lib.mjs +1 -9
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/main.mjs +1170 -7754
- package/dist/cli/main.mjs.map +1 -1
- package/dist/cli/shared/seed-chunker.d.mts +5 -5
- package/dist/completion/zsh-worker.zsh +82 -9
- package/dist/configure/config/index.d.mts +1 -1
- package/dist/configure/config/types.d.mts +2 -2
- package/dist/configure/index.d.mts +48 -12
- package/dist/configure/index.mjs +1 -1267
- package/dist/configure/index.mjs.map +1 -1
- package/dist/configure/services/auth/types.d.mts +1 -1
- package/dist/configure/services/idp/types.d.mts +1 -1
- package/dist/configure/services/tailordb/schema.d.mts +4 -8
- package/dist/configure/services/tailordb/types.d.mts +1 -1
- package/dist/configure/services/workflow/execution-policy.d.mts +3 -3
- package/dist/configure/services/workflow/job.d.mts +12 -2
- package/dist/configure/types/field.types.d.mts +1 -1
- package/dist/configure/types/permission-operand.types.d.mts +1 -1
- package/dist/context-D0QjfxzD.mjs +2 -0
- package/dist/{context-DYQVYWqZ.mjs.map → context-D0QjfxzD.mjs.map} +1 -1
- package/dist/crashreport-B-_HTKLr.mjs +42 -0
- package/dist/{crashreport-Q0pDAlrj.mjs.map → crashreport-B-_HTKLr.mjs.map} +1 -1
- package/dist/crashreport-BmsRIdpy.mjs +1 -0
- package/dist/errors-DSEXKRVD.mjs +2 -0
- package/dist/errors-DSEXKRVD.mjs.map +1 -0
- package/dist/file-COPYfju_.mjs +2 -0
- package/dist/file-COPYfju_.mjs.map +1 -0
- package/dist/globals-CMHSnj4w.mjs +2 -0
- package/dist/{globals-B2nlxBrz.mjs.map → globals-CMHSnj4w.mjs.map} +1 -1
- package/dist/iconv-DlFMt2gW.mjs +2 -0
- package/dist/{iconv-QWaZh0TT.mjs.map → iconv-DlFMt2gW.mjs.map} +1 -1
- package/dist/idp-G_ojPBB5.mjs +2 -0
- package/dist/{idp-RA_swu-h.mjs.map → idp-G_ojPBB5.mjs.map} +1 -1
- package/dist/interceptor-DQg3cR_9.mjs +2 -0
- package/dist/{interceptor-e33JtsC-.mjs.map → interceptor-DQg3cR_9.mjs.map} +1 -1
- package/dist/kysely/index.mjs +1 -32
- package/dist/kysely/index.mjs.map +1 -1
- package/dist/kysely-type-BTi3BMtL.mjs +43 -0
- package/dist/kysely-type-BTi3BMtL.mjs.map +1 -0
- package/dist/logger-BcGy-u7G.mjs +9 -0
- package/dist/{logger-D0bEznPv.mjs.map → logger-BcGy-u7G.mjs.map} +1 -1
- package/dist/logger-DP2BjQ93.mjs +2 -0
- package/dist/{logger-BtX0suGY.mjs.map → logger-DP2BjQ93.mjs.map} +1 -1
- package/dist/multiline-EyzjEwn9.mjs +3 -0
- package/dist/{multiline-sfHpTZZK.mjs.map → multiline-EyzjEwn9.mjs.map} +1 -1
- package/dist/node-builtins-oBl7EbyV.mjs +2 -0
- package/dist/{node-builtins-CmaL2Cbq.mjs.map → node-builtins-oBl7EbyV.mjs.map} +1 -1
- package/dist/package-json-C690ceex.mjs +2 -0
- package/dist/{package-json-8b0O9TlX.mjs.map → package-json-C690ceex.mjs.map} +1 -1
- package/dist/package-json-CmqhDJ__.mjs +1 -0
- package/dist/parser/service/tailordb/type-source.d.mts +5 -5
- package/dist/parser/service/tailordb/types.d.mts +4 -4
- package/dist/platform-serialize-DkiTdHOt.mjs +2 -0
- package/dist/{platform-serialize-RoRtBS0v.mjs.map → platform-serialize-DkiTdHOt.mjs.map} +1 -1
- package/dist/plugin/builtin/enum-constants/index.mjs +5 -114
- package/dist/plugin/builtin/enum-constants/index.mjs.map +1 -1
- package/dist/plugin/builtin/file-utils/index.mjs +22 -104
- package/dist/plugin/builtin/file-utils/index.mjs.map +1 -1
- package/dist/plugin/builtin/kysely-type/index.d.mts +8 -1
- package/dist/plugin/builtin/kysely-type/index.mjs +1 -275
- package/dist/plugin/builtin/seed/index.d.mts +5 -0
- package/dist/plugin/builtin/seed/index.mjs +1 -3
- package/dist/plugin/builtin/seed/seed-type-processor.d.mts +0 -2
- package/dist/plugin/{get-generated-type.d.mts → get-generated-table.d.mts} +5 -5
- package/dist/plugin/index.d.mts +3 -2
- package/dist/plugin/index.mjs +1 -251
- package/dist/plugin/index.mjs.map +1 -1
- package/dist/plugin/types.d.mts +30 -23
- package/dist/plugin/with-context.d.mts +3 -3
- package/dist/register-ts-hook-Drnaproy.mjs +640 -0
- package/dist/register-ts-hook-Drnaproy.mjs.map +1 -0
- package/dist/registry-HlEaGvl5.mjs +2 -0
- package/dist/{registry-BIGVUrMB.mjs.map → registry-HlEaGvl5.mjs.map} +1 -1
- package/dist/repl-editor-BG1aDOfH.mjs +2 -0
- package/dist/{repl-editor-F9LotMNx.mjs.map → repl-editor-BG1aDOfH.mjs.map} +1 -1
- package/dist/runtime/aigateway.mjs +1 -3
- package/dist/runtime/authconnection.mjs +1 -3
- package/dist/runtime/context.mjs +1 -3
- package/dist/runtime/file.d.mts +21 -21
- package/dist/runtime/file.mjs +1 -3
- package/dist/runtime/globals.mjs +1 -1
- package/dist/runtime/iconv.mjs +1 -3
- package/dist/runtime/idp.mjs +1 -3
- package/dist/runtime/index.mjs +1 -11
- package/dist/runtime/logger.mjs +1 -3
- package/dist/runtime/secretmanager.mjs +1 -3
- package/dist/runtime/types.d.mts +1 -1
- package/dist/runtime/workflow.mjs +1 -3
- package/dist/schema-Ze_dI5VX.mjs +2 -0
- package/dist/schema-Ze_dI5VX.mjs.map +1 -0
- package/dist/secret-file-C9wp_FCX.mjs +2 -0
- package/dist/{secret-file-C3J4Gy8r.mjs.map → secret-file-C9wp_FCX.mjs.map} +1 -1
- package/dist/secretmanager-5olfnI1b.mjs +2 -0
- package/dist/{secretmanager-IY4UvinW.mjs.map → secretmanager-5olfnI1b.mjs.map} +1 -1
- package/dist/secretmanager-vHQoXdQz.mjs +2 -0
- package/dist/{secretmanager-CYlpffsz.mjs.map → secretmanager-vHQoXdQz.mjs.map} +1 -1
- package/dist/seed/index.mjs +8 -244
- package/dist/seed/index.mjs.map +1 -1
- package/dist/seed-DwqRFdqP.mjs +207 -0
- package/dist/seed-DwqRFdqP.mjs.map +1 -0
- package/dist/service-BVe9u2Rt.mjs +7 -0
- package/dist/service-BVe9u2Rt.mjs.map +1 -0
- package/dist/service-CpZELSBa.mjs +1 -0
- package/dist/service-DlgaUO4V.mjs +2 -0
- package/dist/{service-LTfp03ZZ.mjs.map → service-DlgaUO4V.mjs.map} +1 -1
- package/dist/service_pb-DGKCLuAs.mjs +2 -0
- package/dist/{service_pb-BEWj1pOV.mjs.map → service_pb-DGKCLuAs.mjs.map} +1 -1
- package/dist/service_pb-_aeFE-Nv.mjs +1 -0
- package/dist/telemetry-Bklv9kQY.mjs +2 -0
- package/dist/{telemetry-BRVdwh14.mjs.map → telemetry-Bklv9kQY.mjs.map} +1 -1
- package/dist/telemetry-DXHP3VVi.mjs +1 -0
- package/dist/type-source--ZNcV8RJ.mjs +2 -0
- package/dist/type-source--ZNcV8RJ.mjs.map +1 -0
- package/dist/types/executor.generated.d.mts +1 -1
- package/dist/user-agent-vdHYF3QL.mjs +2 -0
- package/dist/{user-agent-Bgsszb5I.mjs.map → user-agent-vdHYF3QL.mjs.map} +1 -1
- package/dist/utils/test/index.mjs +1 -109
- package/dist/utils/test/index.mjs.map +1 -1
- package/dist/vitest/environment.mjs +1 -41
- package/dist/vitest/environment.mjs.map +1 -1
- package/dist/vitest/index.mjs +1 -1986
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/mocks/file.d.mts +8 -8
- package/dist/vitest/setup.mjs +1 -140
- package/dist/vitest/setup.mjs.map +1 -1
- package/dist/wait-point-invoker-eiP-IIux.mjs +2 -0
- package/dist/wait-point-invoker-eiP-IIux.mjs.map +1 -0
- package/dist/wait-point-registry-BrkwfyjS.mjs +2 -0
- package/dist/{wait-point-registry-TL99zotw.mjs.map → wait-point-registry-BrkwfyjS.mjs.map} +1 -1
- package/dist/workflow-Cs9ISw6j.mjs +2 -0
- package/dist/{workflow-Bamae_Yc.mjs.map → workflow-Cs9ISw6j.mjs.map} +1 -1
- package/dist/workspace_resource_pb--GeYQPXu.mjs +2 -0
- package/dist/{workspace_resource_pb-HNIL_Vfj.mjs.map → workspace_resource_pb--GeYQPXu.mjs.map} +1 -1
- package/docs/cli/function.md +66 -6
- package/docs/cli/setup.md +24 -14
- package/docs/cli/tailordb.md +2 -0
- package/docs/cli-reference.md +9 -8
- package/docs/github-actions.md +10 -9
- package/docs/migration/v2.md +13 -1
- package/docs/migration/v3.md +82 -0
- package/docs/plugin/custom.md +130 -85
- package/docs/plugin/index.md +3 -3
- package/docs/services/tailordb-migration.md +21 -7
- package/docs/services/workflow.md +10 -9
- package/package.json +11 -11
- package/postinstall.mjs +1 -1
- package/dist/aigateway-DR4Kwuik.mjs +0 -9
- package/dist/application-C8a0UJ-z.mjs +0 -6071
- package/dist/application-C8a0UJ-z.mjs.map +0 -1
- package/dist/application-D4zOiLLa.mjs +0 -3
- package/dist/assert-DBxo8jPo.mjs +0 -9
- package/dist/authconnection-CZvi9ANm.mjs +0 -9
- package/dist/brand-Eo4pLXPJ.mjs +0 -36
- package/dist/context-DYQVYWqZ.mjs +0 -23
- package/dist/crashreport-Cd4TqfZq.mjs +0 -3
- package/dist/crashreport-Q0pDAlrj.mjs +0 -427
- package/dist/errors-Bxut5_Sy.mjs +0 -89
- package/dist/errors-Bxut5_Sy.mjs.map +0 -1
- package/dist/file-BUcmVIH2.mjs +0 -58
- package/dist/file-BUcmVIH2.mjs.map +0 -1
- package/dist/globals-B2nlxBrz.mjs +0 -126
- package/dist/iconv-QWaZh0TT.mjs +0 -38
- package/dist/idp-RA_swu-h.mjs +0 -82
- package/dist/interceptor-e33JtsC-.mjs +0 -33
- package/dist/logger-BtX0suGY.mjs +0 -48
- package/dist/logger-D0bEznPv.mjs +0 -362
- package/dist/multiline-sfHpTZZK.mjs +0 -38
- package/dist/node-builtins-CmaL2Cbq.mjs +0 -36
- package/dist/package-json-8b0O9TlX.mjs +0 -17
- package/dist/package-json-Cv2Z-TqQ.mjs +0 -3
- package/dist/platform-serialize-RoRtBS0v.mjs +0 -46
- package/dist/plugin/builtin/kysely-type/index.mjs.map +0 -1
- package/dist/plugin/builtin/seed/types.d.mts +0 -2
- package/dist/register-ts-hook-Vqjza10T.mjs +0 -25679
- package/dist/register-ts-hook-Vqjza10T.mjs.map +0 -1
- package/dist/registry-BIGVUrMB.mjs +0 -54
- package/dist/repl-editor-F9LotMNx.mjs +0 -252
- package/dist/schema-D4TC4BC3.mjs +0 -640
- package/dist/schema-D4TC4BC3.mjs.map +0 -1
- package/dist/secret-file-C3J4Gy8r.mjs +0 -64
- package/dist/secretmanager-CYlpffsz.mjs +0 -13
- package/dist/secretmanager-IY4UvinW.mjs +0 -131
- package/dist/seed-Cibjmtry.mjs +0 -489
- package/dist/seed-Cibjmtry.mjs.map +0 -1
- package/dist/service-2grcAOCJ.mjs +0 -898
- package/dist/service-2grcAOCJ.mjs.map +0 -1
- package/dist/service-CaBPNDIZ.mjs +0 -3
- package/dist/service-LTfp03ZZ.mjs +0 -133
- package/dist/service_pb-BEWj1pOV.mjs +0 -167
- package/dist/service_pb-BjlhvK9E.mjs +0 -3
- package/dist/telemetry-BRVdwh14.mjs +0 -84
- package/dist/telemetry-CkbkeJxl.mjs +0 -3
- package/dist/type-source-DH_LH20p.mjs +0 -13
- package/dist/type-source-DH_LH20p.mjs.map +0 -1
- package/dist/user-agent-Bgsszb5I.mjs +0 -28
- package/dist/wait-point-invoker-__oE88_P.mjs +0 -148
- package/dist/wait-point-invoker-__oE88_P.mjs.map +0 -1
- package/dist/wait-point-registry-TL99zotw.mjs +0 -47
- package/dist/workflow-Bamae_Yc.mjs +0 -34
- package/dist/workspace_resource_pb-HNIL_Vfj.mjs +0 -860
package/docs/cli/function.md
CHANGED
|
@@ -16,12 +16,13 @@ See [Global Options](../cli-reference.md#global-options) for options available t
|
|
|
16
16
|
|
|
17
17
|
**Commands**
|
|
18
18
|
|
|
19
|
-
| Command
|
|
20
|
-
|
|
|
21
|
-
| [`function get`](#function-get)
|
|
22
|
-
| [`function list`](#function-list)
|
|
23
|
-
| [`function logs`](#function-logs)
|
|
24
|
-
| [`function run`](#function-run)
|
|
19
|
+
| Command | Aliases | Description |
|
|
20
|
+
| ------------------------------------- | ---------- | --------------------------------------------------------------- |
|
|
21
|
+
| [`function get`](#function-get) | - | Get a function registry by name |
|
|
22
|
+
| [`function list`](#function-list) | - | List function registries in a workspace |
|
|
23
|
+
| [`function logs`](#function-logs) | - | List or get function execution logs. |
|
|
24
|
+
| [`function run`](#function-run) | `test-run` | Run a function on the Tailor Platform server without deploying. |
|
|
25
|
+
| [`function script`](#function-script) | - | Scaffold a one-off script to run with `function run`. |
|
|
25
26
|
|
|
26
27
|
### function get
|
|
27
28
|
|
|
@@ -151,6 +152,7 @@ tailor function run [options] <file>
|
|
|
151
152
|
| `--arg <ARG>` | `-a` | JSON argument to pass to the function | No | - | - |
|
|
152
153
|
| `--machine-user <MACHINE_USER>` | `-m` | Machine user name for authentication. Falls back to the active profile's default machine user. | No | - | `TAILOR_PLATFORM_MACHINE_USER_NAME` |
|
|
153
154
|
| `--config <CONFIG>` | `-c` | Path to SDK config file | No | `"tailor.config.ts"` | - |
|
|
155
|
+
| `--allow-schema-drift` | - | Run a scaffolded script even when its schema snapshot no longer matches | No | `false` | - |
|
|
154
156
|
|
|
155
157
|
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
156
158
|
|
|
@@ -179,8 +181,66 @@ $ tailor function run build/resolvers/add.js --arg '{"a":1,"b":2}'
|
|
|
179
181
|
You can pass either a source file (`.ts`) or a pre-bundled file (`.js`).
|
|
180
182
|
When a `.js` file is provided, detection and bundling are skipped and the file is executed as-is.
|
|
181
183
|
|
|
184
|
+
A script scaffolded by `function script` with a generated `db.ts` is checked against its `db.snapshot.json` before execution and refused on schema drift; pass `--allow-schema-drift` to run it anyway. The check compares table and field structure; hook and validator code changes are not detected.
|
|
185
|
+
|
|
182
186
|
`test-run` is a deprecated alias of this command and will be removed in v3.
|
|
183
187
|
|
|
184
188
|
> [!WARNING]
|
|
185
189
|
> Workflow job `.start()` calls do not work in this mode.
|
|
186
190
|
> Started jobs are not executed; only the target job's `body` function runs in isolation.
|
|
191
|
+
|
|
192
|
+
### function script
|
|
193
|
+
|
|
194
|
+
Scaffold a one-off script to run with `function run`.
|
|
195
|
+
|
|
196
|
+
**Usage**
|
|
197
|
+
|
|
198
|
+
```
|
|
199
|
+
tailor function script [options] <file>
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
**Arguments**
|
|
203
|
+
|
|
204
|
+
| Argument | Description | Required |
|
|
205
|
+
| -------- | ------------------------------------------------ | -------- |
|
|
206
|
+
| `file` | Path to create the script at (must end with .ts) | Yes |
|
|
207
|
+
|
|
208
|
+
**Options**
|
|
209
|
+
|
|
210
|
+
| Option | Alias | Description | Required | Default | Env |
|
|
211
|
+
| ------------------------------- | ----- | --------------------------------------------------------------------- | -------- | -------------------- | ------------------------------ |
|
|
212
|
+
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - | `TAILOR_PLATFORM_WORKSPACE_ID` |
|
|
213
|
+
| `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
|
|
214
|
+
| `--config <CONFIG>` | `-c` | Path to Tailor config file | No | `"tailor.config.ts"` | `TAILOR_CONFIG_PATH` |
|
|
215
|
+
| `--namespace <NAMESPACE>` | - | Target TailorDB namespace (required when the config does not pin one) | No | - | - |
|
|
216
|
+
| `--remote` | - | Generate script-scoped DB types from the deployed schema | No | `false` | - |
|
|
217
|
+
|
|
218
|
+
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
219
|
+
|
|
220
|
+
**Examples**
|
|
221
|
+
|
|
222
|
+
**Scaffold a one-off script (single-namespace project)**
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
$ tailor function script scripts/fix-prices.ts
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
**Scaffold a script targeting a specific namespace**
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
$ tailor function script scripts/fix-prices.ts --namespace tailordb
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
**Scaffold from a deployed or external namespace**
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
$ tailor function script scripts/fix-prices.ts --namespace shared --remote
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
**Notes**
|
|
241
|
+
|
|
242
|
+
The scaffolded script is a plain default-exported function; execute it with `tailor function run <file>`.
|
|
243
|
+
|
|
244
|
+
By default, when the project configures `kyselyTypePlugin`, the skeleton imports `getDB()` from the plugin's generated types. Without the plugin, the command uses the namespace's local table definitions to write a script-scoped `db.ts` plus a `db.snapshot.json` next to the script; `function run` refuses to run the script when that snapshot no longer matches the deployed or locally defined table and field structure.
|
|
245
|
+
|
|
246
|
+
Pass `--remote` to generate the script-scoped files from the deployed schema instead, even when `kyselyTypePlugin` is configured. This is required for an external namespace. Re-running the command refreshes `db.ts` and `db.snapshot.json` from the selected source and leaves the script itself untouched.
|
package/docs/cli/setup.md
CHANGED
|
@@ -23,7 +23,7 @@ See [Global Options](../cli-reference.md#global-options) for options available t
|
|
|
23
23
|
| [`setup preview`](#setup-preview) | Generate a preview workflow (PR open/sync triggers deploy to a per-PR workspace). |
|
|
24
24
|
| [`setup action`](#setup-action) | Generate a per-app composite action for use with setup coordinate (monorepo multi-app deploys). |
|
|
25
25
|
| [`setup coordinate`](#setup-coordinate) | Generate a coordinator workflow that orchestrates multiple --action-generated composite actions. |
|
|
26
|
-
| [`setup
|
|
26
|
+
| [`setup deps`](#setup-deps) | Generate a dependency update config for Tailor dependency and workflow updates. |
|
|
27
27
|
| [`setup check`](#setup-check) | Audit generated workflows for drift against the current config/repo (read-only). |
|
|
28
28
|
| [`setup delete`](#setup-delete) | Delete managed workflow/action file(s) and their .github/tailor.lock entries. |
|
|
29
29
|
|
|
@@ -63,7 +63,7 @@ tailor setup branch [options]
|
|
|
63
63
|
| Option | Alias | Description | Required | Default |
|
|
64
64
|
| ----------------------------- | ----- | ------------------------------------------------------------------------------ | -------- | ------- |
|
|
65
65
|
| `--name <NAME>` | `-n` | Name (defaults to the config 'name') | No | - |
|
|
66
|
-
| `--
|
|
66
|
+
| `--target <TARGET>` | - | Deploy trigger branch (defaults to the detected default branch) | No | - |
|
|
67
67
|
| `--environment <ENVIRONMENT>` | - | GitHub Environment for the plan/deploy jobs (defaults to the workspace name) | No | - |
|
|
68
68
|
| `--erd-preview` | - | Add PR ERD viewer artifacts with current/diff previews for TailorDB namespaces | No | `false` |
|
|
69
69
|
| `--dir <DIR>` | `-d` | App directory (for monorepo setups) | No | `"."` |
|
|
@@ -71,6 +71,10 @@ tailor setup branch [options]
|
|
|
71
71
|
|
|
72
72
|
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
73
73
|
|
|
74
|
+
**Notes**
|
|
75
|
+
|
|
76
|
+
`--branch` is a deprecated alias of `--target` and will be removed in v3.
|
|
77
|
+
|
|
74
78
|
### setup check
|
|
75
79
|
|
|
76
80
|
Audit generated workflows for drift against the current config/repo (read-only).
|
|
@@ -136,6 +140,24 @@ tailor setup delete [options] <files>
|
|
|
136
140
|
|
|
137
141
|
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
138
142
|
|
|
143
|
+
### setup deps
|
|
144
|
+
|
|
145
|
+
Generate a dependency update config for Tailor dependency and workflow updates.
|
|
146
|
+
|
|
147
|
+
**Usage**
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
tailor setup deps [options]
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**Options**
|
|
154
|
+
|
|
155
|
+
| Option | Alias | Description | Required | Default |
|
|
156
|
+
| ----------------------- | ----- | --------------------------------------- | -------- | ------------ |
|
|
157
|
+
| `--provider <PROVIDER>` | - | Dependency update provider to configure | No | `"renovate"` |
|
|
158
|
+
|
|
159
|
+
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
160
|
+
|
|
139
161
|
### setup preview
|
|
140
162
|
|
|
141
163
|
Generate a preview workflow (PR open/sync triggers deploy to a per-PR workspace).
|
|
@@ -160,18 +182,6 @@ tailor setup preview [options]
|
|
|
160
182
|
|
|
161
183
|
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
162
184
|
|
|
163
|
-
### setup renovate
|
|
164
|
-
|
|
165
|
-
Generate a Renovate config for Tailor dependency and workflow updates.
|
|
166
|
-
|
|
167
|
-
**Usage**
|
|
168
|
-
|
|
169
|
-
```
|
|
170
|
-
tailor setup renovate
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
174
|
-
|
|
175
185
|
### setup tag
|
|
176
186
|
|
|
177
187
|
Generate a tag-target deploy workflow (tag push triggers deploy).
|
package/docs/cli/tailordb.md
CHANGED
|
@@ -125,6 +125,8 @@ tailor tailordb migration generate [options]
|
|
|
125
125
|
| `--config <CONFIG>` | `-c` | Path to Tailor config file | No | `"tailor.config.ts"` | `TAILOR_CONFIG_PATH` |
|
|
126
126
|
| `--name <NAME>` | `-n` | Optional description for the migration | No | - | - |
|
|
127
127
|
| `--init` | - | Delete existing migrations and start fresh | No | `false` | - |
|
|
128
|
+
| `--data-only` | - | Create a migration with no schema changes whose migration script runs a standalone data transformation | No | `false` | - |
|
|
129
|
+
| `--namespace <NAMESPACE>` | - | Target TailorDB namespace for --data-only (required if multiple namespaces exist) | No | - | - |
|
|
128
130
|
| `--rename <RENAME>` | - | Record a field or table rename instead of remove + add (format: "Table.oldField:newField" or "OldTable:NewTable"; repeatable). Renames require a migration script that copies the data. | No | - | - |
|
|
129
131
|
| `--drop <DROP>` | - | Confirm that a removed field or table is a genuine removal, not a rename (format: "Table.field" or "Table"; repeatable). Required in non-interactive runs for a removal with rename candidates. | No | - | - |
|
|
130
132
|
| `--expand-contract <EXPAND_CONTRACT>` | - | Convert a field type through a temporary field (format: "Table.field"; repeatable). Generates two migrations. | No | - | - |
|
package/docs/cli-reference.md
CHANGED
|
@@ -323,13 +323,14 @@ Commands for managing workflows and executions.
|
|
|
323
323
|
|
|
324
324
|
Commands for managing function registries and viewing function execution logs.
|
|
325
325
|
|
|
326
|
-
| Command
|
|
327
|
-
|
|
|
328
|
-
| [function](./cli/function.md#function)
|
|
329
|
-
| [function get](./cli/function.md#function-get)
|
|
330
|
-
| [function list](./cli/function.md#function-list)
|
|
331
|
-
| [function logs](./cli/function.md#function-logs)
|
|
332
|
-
| [function run](./cli/function.md#function-run)
|
|
326
|
+
| Command | Description |
|
|
327
|
+
| ---------------------------------------------------- | --------------------------------------------------------------- |
|
|
328
|
+
| [function](./cli/function.md#function) | Manage functions |
|
|
329
|
+
| [function get](./cli/function.md#function-get) | Get a function registry by name |
|
|
330
|
+
| [function list](./cli/function.md#function-list) | List function registries in a workspace |
|
|
331
|
+
| [function logs](./cli/function.md#function-logs) | List or get function execution logs. |
|
|
332
|
+
| [function run](./cli/function.md#function-run) | Run a function on the Tailor Platform server without deploying. |
|
|
333
|
+
| [function script](./cli/function.md#function-script) | Scaffold a one-off script to run with `function run`. |
|
|
333
334
|
|
|
334
335
|
### [Executor Commands](./cli/executor.md)
|
|
335
336
|
|
|
@@ -397,8 +398,8 @@ Commands for setting up project infrastructure.
|
|
|
397
398
|
| [setup check](./cli/setup.md#setup-check) | Audit generated workflows for drift against the current config/repo (read-only). |
|
|
398
399
|
| [setup coordinate](./cli/setup.md#setup-coordinate) | Generate a coordinator workflow that orchestrates multiple --action-generated composite actions. |
|
|
399
400
|
| [setup delete](./cli/setup.md#setup-delete) | Delete managed workflow/action file(s) and their .github/tailor.lock entries. |
|
|
401
|
+
| [setup deps](./cli/setup.md#setup-deps) | Generate a dependency update config for Tailor dependency and workflow updates. |
|
|
400
402
|
| [setup preview](./cli/setup.md#setup-preview) | Generate a preview workflow (PR open/sync triggers deploy to a per-PR workspace). |
|
|
401
|
-
| [setup renovate](./cli/setup.md#setup-renovate) | Generate a Renovate config for Tailor dependency and workflow updates. |
|
|
402
403
|
| [setup tag](./cli/setup.md#setup-tag) | Generate a tag-target deploy workflow (tag push triggers deploy). |
|
|
403
404
|
|
|
404
405
|
### [Upgrade Commands](./cli/upgrade.md)
|
package/docs/github-actions.md
CHANGED
|
@@ -38,12 +38,13 @@ Run `setup` once per target.
|
|
|
38
38
|
### Branch target (recommended for staging)
|
|
39
39
|
|
|
40
40
|
The branch target fires on pull requests and pushes to the branch you specify
|
|
41
|
-
(defaulting to the repository's default branch when `--
|
|
41
|
+
(defaulting to the repository's default branch when `--target` is
|
|
42
|
+
omitted):
|
|
42
43
|
|
|
43
44
|
```bash
|
|
44
45
|
tailor setup branch --name my-app-stg
|
|
45
46
|
# Equivalent to:
|
|
46
|
-
tailor setup branch --name my-app-stg --
|
|
47
|
+
tailor setup branch --name my-app-stg --target main
|
|
47
48
|
```
|
|
48
49
|
|
|
49
50
|
What it does:
|
|
@@ -120,12 +121,12 @@ What it does:
|
|
|
120
121
|
|
|
121
122
|
### Choosing `--branch` for the tag target
|
|
122
123
|
|
|
123
|
-
|
|
124
|
+
The branch each target reads plays a different role, under a different flag:
|
|
124
125
|
|
|
125
|
-
| Target | Role
|
|
126
|
-
| ------ | ---------------------------------------------------------------------------------------------- |
|
|
127
|
-
| Branch | The branch that triggers the workflow (push + PR base). Defaults to the repo's default branch. |
|
|
128
|
-
| Tag | The branch whose history the tag must be reachable from. Omit to disable the guard entirely. |
|
|
126
|
+
| Target | Flag | Role |
|
|
127
|
+
| ------ | ---------- | ---------------------------------------------------------------------------------------------- |
|
|
128
|
+
| Branch | `--target` | The branch that triggers the workflow (push + PR base). Defaults to the repo's default branch. |
|
|
129
|
+
| Tag | `--branch` | The branch whose history the tag must be reachable from. Omit to disable the guard entirely. |
|
|
129
130
|
|
|
130
131
|
The workspace name (`--name`, or the config `name` when omitted) must
|
|
131
132
|
be 3–63 characters of lowercase letters, numbers, and hyphens, and cannot start
|
|
@@ -365,7 +366,7 @@ Commit both workflow files and `.github/tailor.lock`.
|
|
|
365
366
|
Run this command once from the repository root to add Renovate configuration:
|
|
366
367
|
|
|
367
368
|
```bash
|
|
368
|
-
tailor setup
|
|
369
|
+
tailor setup deps
|
|
369
370
|
```
|
|
370
371
|
|
|
371
372
|
It generates `renovate.json`, which extends Tailor's shared Renovate preset. The
|
|
@@ -387,7 +388,7 @@ cannot be edited without losing those comments, so the command leaves it
|
|
|
387
388
|
unchanged and asks you to add the preset to its `extends` array yourself.
|
|
388
389
|
|
|
389
390
|
`renovate.json` is yours to edit — it is not tracked in `.github/tailor.lock`.
|
|
390
|
-
Add your own rules freely; re-running `tailor setup
|
|
391
|
+
Add your own rules freely; re-running `tailor setup deps` does not overwrite
|
|
391
392
|
them. To remove it, delete the file.
|
|
392
393
|
|
|
393
394
|
Renovate updates the SDK dependency and action pins, but it does not regenerate
|
package/docs/migration/v2.md
CHANGED
|
@@ -878,6 +878,10 @@ Also review, and migrate by hand:
|
|
|
878
878
|
- An invoker option passed via a variable or spread (not a literal object) —
|
|
879
879
|
the codemod only inspects literal object arguments; rename the invoker key
|
|
880
880
|
to authInvoker in the options object's own definition.
|
|
881
|
+
- A renamed triggerJobFunction call whose target is another workflow job —
|
|
882
|
+
rewrite it further to that job's own .start() method (e.g. worker.start(args)).
|
|
883
|
+
Calling execJobFunction directly is not detected as a build-time dependency
|
|
884
|
+
and fails the build.
|
|
881
885
|
```
|
|
882
886
|
|
|
883
887
|
</details>
|
|
@@ -924,6 +928,10 @@ Also review, and migrate by hand:
|
|
|
924
928
|
instead; the alias was the same mock function.
|
|
925
929
|
- A file that already imports ExecJobFunctionOptions alongside the removed type —
|
|
926
930
|
rename the remaining references by hand and drop the duplicate specifier.
|
|
931
|
+
- A renamed call whose target is another workflow job — rewrite it further to
|
|
932
|
+
that job's own .start() method (e.g. worker.start(args)). Calling
|
|
933
|
+
execJobFunction directly is not detected as a build-time dependency and fails
|
|
934
|
+
the build.
|
|
927
935
|
```
|
|
928
936
|
|
|
929
937
|
</details>
|
|
@@ -1663,8 +1671,12 @@ The CLI stores human users by their stable subject ID instead of email (email is
|
|
|
1663
1671
|
|
|
1664
1672
|
### Node.js minimum version raised to 22.15.0
|
|
1665
1673
|
|
|
1666
|
-
v2 requires Node.js **22.15.0** or later. This is the first version that includes `module.registerHooks()`, which the SDK uses to register its TypeScript loader hook synchronously in the main thread. The actual floor is now **22.18.0**: Node 22.15.0–22.17.x has a bug
|
|
1674
|
+
v2 requires Node.js **22.15.0** or later. This is the first version that includes `module.registerHooks()`, which the SDK uses to register its TypeScript loader hook synchronously in the main thread. The actual floor is now **22.18.0**: Node 22.15.0–22.17.x has a bug that crashes `tailor seed validate` when requiring `node:`-scheme-only builtins such as `node:sqlite`, fixed upstream by [nodejs/node#58612](https://github.com/nodejs/node/pull/58612) in 22.18.0. No source change is required; ensure your environment runs Node.js 22.18.0+.
|
|
1667
1675
|
|
|
1668
1676
|
### Legacy bundle artifact cleanup removed from deploy
|
|
1669
1677
|
|
|
1670
1678
|
`tailor deploy` no longer deletes on-disk bundle artifacts (`.entry.js` files, workflow-job bundles, and the `hooks-validate-scripts/` directory) left in the SDK output directory (`.tailor` by default) by SDK versions that predate the current in-memory bundling approach. Current bundlers no longer write these files. No source change is required; if such stale files remain from a very old SDK version, delete only those specific files/directories manually — do not delete the output directory itself, since it also holds deploy state (e.g. `secrets-state/`, `*.context.json`) that existing secrets and Auth Connections depend on.
|
|
1679
|
+
|
|
1680
|
+
### First v2 deploy to a v1-deployed environment needs migration sync
|
|
1681
|
+
|
|
1682
|
+
The pre-v2 CLI never wrote a script hash into deployed schemas, so the first `tailor deploy` against an environment last deployed with it reports `Remote schema drift detected` with every scripted type showing `has no script hash on remote`. Run `tailor tailordb migration sync <current migration number>` once for that environment to write the missing hashes, then `tailor deploy` as usual. Preview/PR workspaces don't hit this, since they're built with v2 from the start. No source change is required.
|
package/docs/migration/v3.md
CHANGED
|
@@ -8,6 +8,55 @@ Run the codemods, then finish anything reported as not migrated automatically:
|
|
|
8
8
|
npx @tailor-platform/sdk-codemod --from <current-version> --to <target-version>
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
## workflow.execJobFunction (imported) removed — use job.start()
|
|
12
|
+
|
|
13
|
+
**Migration:** Manual
|
|
14
|
+
|
|
15
|
+
`execJobFunction` on the `workflow` value imported from @tailor-platform/sdk/runtime(/workflow) is removed in v3. Calling it directly from a workflow job body to reach another job is not detected as a build-time dependency and has no working use; the target job's own `.start()` method is the only supported way to call it. This does not affect the ambient `tailor.workflow.execJobFunction` global — that's what `.start()` itself compiles down to at build time, and it remains fully supported.
|
|
16
|
+
|
|
17
|
+
Before:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { workflow } from "@tailor-platform/sdk/runtime";
|
|
21
|
+
|
|
22
|
+
await workflow.execJobFunction("worker", { id: 1 });
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
After:
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import { worker } from "./jobs/worker";
|
|
29
|
+
|
|
30
|
+
await worker.start({ id: 1 });
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
<details>
|
|
34
|
+
<summary>Prompt for an AI agent (to perform this migration)</summary>
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
workflow.execJobFunction — the value imported from
|
|
38
|
+
@tailor-platform/sdk/runtime or @tailor-platform/sdk/runtime/workflow — is
|
|
39
|
+
removed in v3. Replace each call with the target job's own .start() method:
|
|
40
|
+
import the WorkflowJob the call names and call <job>.start(args, options)
|
|
41
|
+
instead of workflow.execJobFunction("<job-name>", args, options).
|
|
42
|
+
|
|
43
|
+
This only removes the re-export from @tailor-platform/sdk/runtime. It does
|
|
44
|
+
not affect the ambient tailor.workflow.execJobFunction global, which stays
|
|
45
|
+
fully supported and is what .start() itself compiles down to at build time.
|
|
46
|
+
This codemod does not rewrite ambient tailor.workflow.execJobFunction(...)
|
|
47
|
+
call sites, since removing the import re-export does not affect them — but
|
|
48
|
+
if such a call site sits inside workflow job source and calls another job
|
|
49
|
+
by name, a separate build-time check already rejects it; migrate that call
|
|
50
|
+
to the target job's own .start() method too.
|
|
51
|
+
|
|
52
|
+
If the job name passed to execJobFunction is not a string literal (a truly
|
|
53
|
+
dynamic dispatch), there is currently no supported replacement — .start()
|
|
54
|
+
only targets a statically known job. Flag this case for a human instead of
|
|
55
|
+
guessing a rewrite.
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
</details>
|
|
59
|
+
|
|
11
60
|
## function test-run → function run
|
|
12
61
|
|
|
13
62
|
**Migration:** Partially automatic
|
|
@@ -39,3 +88,36 @@ unchanged unless it documents a command to type.
|
|
|
39
88
|
```
|
|
40
89
|
|
|
41
90
|
</details>
|
|
91
|
+
|
|
92
|
+
## setup branch --branch → --target
|
|
93
|
+
|
|
94
|
+
**Migration:** Partially automatic
|
|
95
|
+
|
|
96
|
+
Rename the `--branch` option of `tailor setup branch` invocations to `--target`. `--branch` remains as a deprecated alias until it is removed in v3. The `--branch` option of `setup tag`, `setup preview`, and `setup coordinate` is unchanged.
|
|
97
|
+
|
|
98
|
+
Before:
|
|
99
|
+
|
|
100
|
+
```sh
|
|
101
|
+
tailor setup branch --name my-app-stg --branch main
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
After:
|
|
105
|
+
|
|
106
|
+
```sh
|
|
107
|
+
tailor setup branch --name my-app-stg --target main
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
<details>
|
|
111
|
+
<summary>Prompt for an AI agent (to finish the cases the codemod could not migrate)</summary>
|
|
112
|
+
|
|
113
|
+
```text
|
|
114
|
+
The `--branch` option of `tailor setup branch` is renamed to `--target`;
|
|
115
|
+
the old spelling is removed in v3. Replace any remaining `--branch` options of
|
|
116
|
+
`setup branch` invocations the codemod did not rewrite (e.g. wrapped across
|
|
117
|
+
lines or invoked through a package runner such as `npx @tailor-platform/sdk`)
|
|
118
|
+
with `--target`. Do not touch the `--branch` option of `setup tag`,
|
|
119
|
+
`setup preview`, or `setup coordinate`, which keeps its name, and leave prose
|
|
120
|
+
that merely mentions the option unchanged unless it documents a command to type.
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
</details>
|