@tailor-platform/sdk 2.1.0 → 2.3.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.
Files changed (98) hide show
  1. package/CHANGELOG.md +199 -0
  2. package/{dist/cli/index.mjs → bin/tailor.mjs} +1 -1
  3. package/dist/application-BZfk4HKm.mjs +3 -0
  4. package/dist/{application-D77KJFKD.mjs → application-F-nl107y.mjs} +121 -27
  5. package/dist/application-F-nl107y.mjs.map +1 -0
  6. package/dist/cli/commands/deploy/tailordb/index.d.mts +2 -1
  7. package/dist/cli/commands/deploy/types.d.mts +2 -1
  8. package/dist/cli/commands/tailordb/migrate/diff-calculator.d.mts +52 -22
  9. package/dist/cli/commands/tailordb/migrate/file-state.d.mts +1 -0
  10. package/dist/cli/commands/tailordb/migrate/generate.d.mts +6 -0
  11. package/dist/cli/commands/tailordb/migrate/rename-detection.d.mts +22 -0
  12. package/dist/cli/commands/tailordb/migrate/schema-checks.d.mts +2 -2
  13. package/dist/cli/commands/tailordb/migrate/snapshot-types.d.mts +9 -2
  14. package/dist/cli/commands/tailordb/migrate/snapshot.d.mts +30 -9
  15. package/dist/cli/lib.d.mts +4 -4
  16. package/dist/cli/lib.mjs +3 -482
  17. package/dist/cli/lib.mjs.map +1 -1
  18. package/dist/cli/main.mjs +1151 -208
  19. package/dist/cli/main.mjs.map +1 -1
  20. package/dist/cli/ts-hook.mjs +52 -7
  21. package/dist/completion/zsh-worker.zsh +167 -4
  22. package/dist/configure/index.d.mts +3 -3
  23. package/dist/configure/index.mjs +90 -23
  24. package/dist/configure/index.mjs.map +1 -1
  25. package/dist/configure/services/index.d.mts +3 -2
  26. package/dist/configure/services/tailordb/index.d.mts +2 -1
  27. package/dist/configure/services/tailordb/schema.d.mts +46 -46
  28. package/dist/configure/services/tailordb/types.d.mts +30 -4
  29. package/dist/configure/services/workflow/index.d.mts +2 -2
  30. package/dist/configure/services/workflow/wait-point.d.mts +72 -13
  31. package/dist/{crashreport-B5LqCTfF.mjs → crashreport-CIIfLnoO.mjs} +2 -2
  32. package/dist/{crashreport-B5LqCTfF.mjs.map → crashreport-CIIfLnoO.mjs.map} +1 -1
  33. package/dist/{crashreport-eI7ty7ok.mjs → crashreport-CINZ5dVN.mjs} +1 -1
  34. package/dist/errors-BVb6vYGy.mjs +89 -0
  35. package/dist/errors-BVb6vYGy.mjs.map +1 -0
  36. package/dist/kysely/index.d.mts +53 -5
  37. package/dist/kysely/index.mjs +7 -2
  38. package/dist/kysely/index.mjs.map +1 -1
  39. package/dist/{logger-CXQq9YIp.mjs → logger-DSdExfor.mjs} +83 -42
  40. package/dist/logger-DSdExfor.mjs.map +1 -0
  41. package/dist/plugin/builtin/seed/index.mjs +1 -1
  42. package/dist/{register-ts-hook-BU18uU44.mjs → register-ts-hook-ClI226n2.mjs} +3541 -703
  43. package/dist/register-ts-hook-ClI226n2.mjs.map +1 -0
  44. package/dist/schema--xYWRGfe.mjs.map +1 -1
  45. package/dist/seed/index.d.mts +52 -3
  46. package/dist/seed/index.mjs +200 -44
  47. package/dist/seed/index.mjs.map +1 -1
  48. package/dist/{seed-B-yckgQY.mjs → seed-xqM9WIHP.mjs} +8 -8
  49. package/dist/seed-xqM9WIHP.mjs.map +1 -0
  50. package/dist/{service-k1xy_A5G.mjs → service-C_WpbKHu.mjs} +39 -5
  51. package/dist/service-C_WpbKHu.mjs.map +1 -0
  52. package/dist/service-D1RCdzIL.mjs +3 -0
  53. package/dist/{service-B5WynBHQ.mjs → service-hZskxZmg.mjs} +3 -3
  54. package/dist/{service-B5WynBHQ.mjs.map → service-hZskxZmg.mjs.map} +1 -1
  55. package/dist/{service_pb-D5--My_M.mjs → service_pb-BEWj1pOV.mjs} +2 -2
  56. package/dist/{service_pb-D5--My_M.mjs.map → service_pb-BEWj1pOV.mjs.map} +1 -1
  57. package/dist/{service_pb-i8CmnQP4.mjs → service_pb-BjlhvK9E.mjs} +1 -1
  58. package/dist/utils/test/index.d.mts +6 -3
  59. package/dist/utils/test/index.mjs +25 -13
  60. package/dist/utils/test/index.mjs.map +1 -1
  61. package/dist/vitest/index.d.mts +2 -1
  62. package/dist/vitest/index.mjs +167 -3
  63. package/dist/vitest/index.mjs.map +1 -1
  64. package/dist/vitest/mocks/workflow.d.mts +13 -1
  65. package/dist/vitest/pglite-kysely.d.mts +43 -0
  66. package/dist/wait-point-invoker-__oE88_P.mjs +148 -0
  67. package/dist/wait-point-invoker-__oE88_P.mjs.map +1 -0
  68. package/dist/wait-point-registry-TL99zotw.mjs +47 -0
  69. package/dist/wait-point-registry-TL99zotw.mjs.map +1 -0
  70. package/dist/{workspace_resource_pb-DXnO2AT-.mjs → workspace_resource_pb-HNIL_Vfj.mjs} +10 -2
  71. package/dist/{workspace_resource_pb-DXnO2AT-.mjs.map → workspace_resource_pb-HNIL_Vfj.mjs.map} +1 -1
  72. package/docs/cli/setup.md +14 -1
  73. package/docs/cli/tailordb.md +96 -28
  74. package/docs/cli-reference.md +15 -12
  75. package/docs/configuration.md +1 -1
  76. package/docs/github-actions.md +73 -28
  77. package/docs/migration/v2.md +55 -1
  78. package/docs/plugin/custom.md +48 -48
  79. package/docs/plugin/index.md +24 -24
  80. package/docs/services/auth.md +10 -10
  81. package/docs/services/executor.md +1 -1
  82. package/docs/services/resolver.md +2 -2
  83. package/docs/services/tailordb-migration.md +485 -84
  84. package/docs/services/tailordb.md +28 -28
  85. package/docs/services/workflow.md +52 -2
  86. package/docs/testing.md +14 -0
  87. package/package.json +12 -7
  88. package/dist/application-Af1zIqSI.mjs +0 -3
  89. package/dist/application-D77KJFKD.mjs.map +0 -1
  90. package/dist/errors-D7583Zz7.mjs +0 -58
  91. package/dist/errors-D7583Zz7.mjs.map +0 -1
  92. package/dist/logger-CXQq9YIp.mjs.map +0 -1
  93. package/dist/register-ts-hook-BU18uU44.mjs.map +0 -1
  94. package/dist/seed-B-yckgQY.mjs.map +0 -1
  95. package/dist/service-M7OYziQP.mjs +0 -3
  96. package/dist/service-k1xy_A5G.mjs.map +0 -1
  97. package/dist/test-env-key-D7UkZp99.mjs +0 -75
  98. package/dist/test-env-key-D7UkZp99.mjs.map +0 -1
package/docs/cli/setup.md CHANGED
@@ -4,7 +4,7 @@ Commands for setting up project infrastructure.
4
4
 
5
5
  ## setup
6
6
 
7
- Generate CI deploy workflows for your project. (beta)
7
+ Set up repository automation for your project. (beta)
8
8
 
9
9
  **Usage**
10
10
 
@@ -23,6 +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 renovate`](#setup-renovate) | Generate a Renovate config for Tailor dependency and workflow updates. |
26
27
  | [`setup check`](#setup-check) | Audit generated workflows for drift against the current config/repo (read-only). |
27
28
  | [`setup delete`](#setup-delete) | Delete managed workflow/action file(s) and their .github/tailor.lock entries. |
28
29
 
@@ -159,6 +160,18 @@ tailor setup preview [options]
159
160
 
160
161
  See [Global Options](../cli-reference.md#global-options) for options available to all commands.
161
162
 
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
+
162
175
  ### setup tag
163
176
 
164
177
  Generate a tag-target deploy workflow (tag push triggers deploy).
@@ -94,14 +94,16 @@ tailor tailordb migration <command>
94
94
 
95
95
  **Commands**
96
96
 
97
- | Command | Description |
98
- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
99
- | [`tailordb migration generate`](#tailordb-migration-generate) | Generate migration files by detecting schema differences between current local types and the previous migration snapshot. |
100
- | [`tailordb migration script`](#tailordb-migration-script) | Add a migration script (migrate.ts) template to an existing migration directory, or record with --no-script that a migration intentionally has none. |
101
- | [`tailordb migration set`](#tailordb-migration-set) | Set migration checkpoint to a specific number. |
102
- | [`tailordb migration status`](#tailordb-migration-status) | Show the current migration status for TailorDB namespaces, including applied and pending migrations. |
103
- | [`tailordb migration sync`](#tailordb-migration-sync) | Sync remote TailorDB schema to a specific migration snapshot (recovery from --no-schema-check drift). |
104
- | [`tailordb migration validate`](#tailordb-migration-validate) | Validate the full migration history and detect schema drift (local types vs. migration snapshot, remote schema vs. migration checkpoint) without deploying. This includes the migration and schema-drift checks used by 'deploy' and exits with a non-zero code when issues are found. |
97
+ | Command | Description |
98
+ | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
99
+ | [`tailordb migration generate`](#tailordb-migration-generate) | Generate migration files by detecting schema differences between current local types and the previous migration snapshot. |
100
+ | [`tailordb migration rebaseline`](#tailordb-migration-rebaseline) | Collapse the full migration history into a new 0000 baseline. |
101
+ | [`tailordb migration script`](#tailordb-migration-script) | Add a migration script (migrate.ts) template to an existing migration directory, or record with --no-script that a migration intentionally has none. |
102
+ | [`tailordb migration set`](#tailordb-migration-set) | Set migration checkpoint to a specific number. |
103
+ | [`tailordb migration status`](#tailordb-migration-status) | Show the current migration status for TailorDB namespaces, including applied and pending migrations. |
104
+ | [`tailordb migration sync`](#tailordb-migration-sync) | Sync remote TailorDB schema to a specific migration snapshot (recovery from --no-schema-check drift). |
105
+ | [`tailordb migration test`](#tailordb-migration-test) | Test pending migrations with seed fixtures or cloned data in a temporary workspace. |
106
+ | [`tailordb migration validate`](#tailordb-migration-validate) | Validate the full migration history, unreviewed generated migration scripts, and schema drift (local types vs. migration snapshot, remote schema vs. migration checkpoint) without deploying. This includes the migration and schema-drift checks used by 'deploy' and exits with a non-zero code when issues are found. |
105
107
 
106
108
  See [Global Options](../cli-reference.md#global-options) for options available to all commands.
107
109
 
@@ -117,15 +119,44 @@ tailor tailordb migration generate [options]
117
119
 
118
120
  **Options**
119
121
 
120
- | Option | Alias | Description | Required | Default | Env |
121
- | ------------------- | ----- | ------------------------------------------ | -------- | -------------------- | -------------------- |
122
- | `--yes` | `-y` | Skip confirmation prompts | No | `false` | - |
123
- | `--config <CONFIG>` | `-c` | Path to Tailor config file | No | `"tailor.config.ts"` | `TAILOR_CONFIG_PATH` |
124
- | `--name <NAME>` | `-n` | Optional description for the migration | No | - | - |
125
- | `--init` | - | Delete existing migrations and start fresh | No | `false` | - |
122
+ | Option | Alias | Description | Required | Default | Env |
123
+ | ------------------------------------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------------------- | -------------------- |
124
+ | `--yes` | `-y` | Skip confirmation prompts | No | `false` | - |
125
+ | `--config <CONFIG>` | `-c` | Path to Tailor config file | No | `"tailor.config.ts"` | `TAILOR_CONFIG_PATH` |
126
+ | `--name <NAME>` | `-n` | Optional description for the migration | No | - | - |
127
+ | `--init` | - | Delete existing migrations and start fresh | No | `false` | - |
128
+ | `--rename <RENAME>` | - | Record a field or type rename instead of remove + add (format: "Type.oldField:newField" or "OldType:NewType"; repeatable). Renames require a migration script that copies the data. | No | - | - |
129
+ | `--drop <DROP>` | - | Confirm that a removed field or type is a genuine removal, not a rename (format: "Type.field" or "Type"; repeatable). Required in non-interactive runs for a removal with rename candidates. | No | - | - |
130
+ | `--expand-contract <EXPAND_CONTRACT>` | - | Convert a field type through a temporary field (format: "Type.field"; repeatable). Generates two migrations. | No | - | - |
126
131
 
127
132
  See [Global Options](../cli-reference.md#global-options) for options available to all commands.
128
133
 
134
+ #### tailordb migration rebaseline
135
+
136
+ Collapse the full migration history into a new 0000 baseline.
137
+
138
+ **Usage**
139
+
140
+ ```
141
+ tailor tailordb migration rebaseline [options]
142
+ ```
143
+
144
+ **Options**
145
+
146
+ | Option | Alias | Description | Required | Default | Env |
147
+ | ------------------------------- | ----- | ----------------------------------------------------------------- | -------- | -------------------- | ------------------------------ |
148
+ | `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - | `TAILOR_PLATFORM_WORKSPACE_ID` |
149
+ | `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
150
+ | `--config <CONFIG>` | `-c` | Path to Tailor config file | No | `"tailor.config.ts"` | `TAILOR_CONFIG_PATH` |
151
+ | `--yes` | `-y` | Skip confirmation prompts | No | `false` | - |
152
+ | `--namespace <NAMESPACE>` | `-n` | Target TailorDB namespace (required if multiple namespaces exist) | No | - | - |
153
+
154
+ See [Global Options](../cli-reference.md#global-options) for options available to all commands.
155
+
156
+ **Notes**
157
+
158
+ Re-baselining removes migrations after 0000 from the working tree, records a new migration history ID, and resets the connected workspace checkpoint without changing its schema or data. Every environment must already have applied the latest migration before you run this command.
159
+
129
160
  #### tailordb migration script
130
161
 
131
162
  Add a migration script (migrate.ts) template to an existing migration directory, or record with --no-script that a migration intentionally has none.
@@ -144,15 +175,20 @@ tailor tailordb migration script [options] <number>
144
175
 
145
176
  **Options**
146
177
 
147
- | Option | Alias | Description | Required | Default | Env |
148
- | ------------------------- | ----- | -------------------------------------------------------------------------------------------- | -------- | -------------------- | -------------------- |
149
- | `--config <CONFIG>` | `-c` | Path to Tailor config file | No | `"tailor.config.ts"` | `TAILOR_CONFIG_PATH` |
150
- | `--namespace <NAMESPACE>` | `-n` | Target TailorDB namespace (required if multiple namespaces exist) | No | - | - |
151
- | `--no-script` | - | Record that this migration intentionally runs without a migration script (requires --reason) | No | - | - |
152
- | `--reason <REASON>` | - | Reason why no migration script is needed (used with --no-script) | No | - | - |
178
+ | Option | Alias | Description | Required | Default | Env |
179
+ | ------------------------- | ----- | ----------------------------------------------------------------------------------------------------- | -------- | -------------------- | -------------------- |
180
+ | `--config <CONFIG>` | `-c` | Path to Tailor config file | No | `"tailor.config.ts"` | `TAILOR_CONFIG_PATH` |
181
+ | `--namespace <NAMESPACE>` | `-n` | Target TailorDB namespace (required if multiple namespaces exist) | No | - | - |
182
+ | `--no-script` | - | Record that this migration intentionally runs without a migration script (requires --reason) | No | - | - |
183
+ | `--reason <REASON>` | - | Reason why no migration script is needed (used with --no-script) | No | - | - |
184
+ | `--with-test` | - | Also add a migrate.test.ts unit-test scaffold; when migrate.ts already exists, only the test is added | No | - | - |
153
185
 
154
186
  See [Global Options](../cli-reference.md#global-options) for options available to all commands.
155
187
 
188
+ **Notes**
189
+
190
+ When `migrate.ts` already exists, running the command clears a previously recorded `--no-script` acknowledgment.
191
+
156
192
  #### tailordb migration set
157
193
 
158
194
  Set migration checkpoint to a specific number.
@@ -210,7 +246,7 @@ See [Global Options](../cli-reference.md#global-options) for options available t
210
246
 
211
247
  **Notes**
212
248
 
213
- Metadata lookup failures (authentication, permission, or network errors) are reported per namespace and make the command exit non-zero; only a not-yet-deployed namespace is treated as having no applied migrations.
249
+ Every local migration file is checked for a compatible format version, and deployed migration history IDs must match the local baseline. Compatibility errors, history mismatches, and metadata lookup failures are reported per namespace and make the command exit non-zero; only a not-yet-deployed namespace is treated as having no applied migrations.
214
250
 
215
251
  #### tailordb migration sync
216
252
 
@@ -240,9 +276,40 @@ tailor tailordb migration sync [options] <number>
240
276
 
241
277
  See [Global Options](../cli-reference.md#global-options) for options available to all commands.
242
278
 
279
+ #### tailordb migration test
280
+
281
+ Test pending migrations with seed fixtures or cloned data in a temporary workspace.
282
+
283
+ **Usage**
284
+
285
+ ```
286
+ tailor tailordb migration test [options]
287
+ ```
288
+
289
+ **Options**
290
+
291
+ | Option | Alias | Description | Required | Default | Env |
292
+ | --------------------------------------------- | ----- | ---------------------------------------------------------------------- | -------- | -------------------- | ------------------------------ |
293
+ | `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - | `TAILOR_PLATFORM_WORKSPACE_ID` |
294
+ | `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
295
+ | `--config <CONFIG>` | `-c` | Path to Tailor config file | No | `"tailor.config.ts"` | `TAILOR_CONFIG_PATH` |
296
+ | `--yes` | `-y` | Acknowledge that a designated target workspace may be overwritten | No | `false` | - |
297
+ | `--data <DATA>` | - | Data source for the migration test (seed or clone) | No | `"seed"` | - |
298
+ | `--target-workspace-id <TARGET_WORKSPACE_ID>` | - | Existing throwaway workspace to retain after the test (requires --yes) | No | - | - |
299
+ | `--keep` | - | Keep the automatically created workspace after the test | No | `false` | - |
300
+ | `--assert <ASSERT>` | - | Path to a TypeScript assertion script to run after migrations | No | - | - |
301
+ | `--assert-namespace <ASSERT_NAMESPACE>` | - | TailorDB namespace exposed to the assertion script | No | - | - |
302
+ | `--machine-user <MACHINE_USER>` | - | Machine user for seed and assertion script execution | No | - | - |
303
+
304
+ See [Global Options](../cli-reference.md#global-options) for options available to all commands.
305
+
306
+ **Notes**
307
+
308
+ The source workspace is read-only. Without --target-workspace-id, the command creates a workspace in the source workspace's region and deletes it after success or failure; pass --keep to retain it for inspection. A designated target is retained and requires --yes. Clone mode copies TailorDB records only; it does not copy IdP users or file blobs.
309
+
243
310
  #### tailordb migration validate
244
311
 
245
- Validate the full migration history and detect schema drift (local types vs. migration snapshot, remote schema vs. migration checkpoint) without deploying. This includes the migration and schema-drift checks used by 'deploy' and exits with a non-zero code when issues are found.
312
+ Validate the full migration history, unreviewed generated migration scripts, and schema drift (local types vs. migration snapshot, remote schema vs. migration checkpoint) without deploying. This includes the migration and schema-drift checks used by 'deploy' and exits with a non-zero code when issues are found.
246
313
 
247
314
  **Usage**
248
315
 
@@ -252,12 +319,13 @@ tailor tailordb migration validate [options]
252
319
 
253
320
  **Options**
254
321
 
255
- | Option | Alias | Description | Required | Default | Env |
256
- | ------------------------------- | ----- | --------------------------------------------------------------------- | -------- | -------------------- | ------------------------------ |
257
- | `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - | `TAILOR_PLATFORM_WORKSPACE_ID` |
258
- | `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
259
- | `--config <CONFIG>` | `-c` | Path to Tailor config file | No | `"tailor.config.ts"` | `TAILOR_CONFIG_PATH` |
260
- | `--namespace <NAMESPACE>` | `-n` | Target TailorDB namespace (validates all namespaces if not specified) | No | - | - |
322
+ | Option | Alias | Description | Required | Default | Env |
323
+ | ------------------------------- | ----- | -------------------------------------------------------------------------- | -------- | -------------------- | ------------------------------ |
324
+ | `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - | `TAILOR_PLATFORM_WORKSPACE_ID` |
325
+ | `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
326
+ | `--config <CONFIG>` | `-c` | Path to Tailor config file | No | `"tailor.config.ts"` | `TAILOR_CONFIG_PATH` |
327
+ | `--namespace <NAMESPACE>` | `-n` | Target TailorDB namespace (validates all namespaces if not specified) | No | - | - |
328
+ | `--strict` | - | Also fail when a pending migration can drop data without an acknowledgment | No | `false` | - |
261
329
 
262
330
  See [Global Options](../cli-reference.md#global-options) for options available to all commands.
263
331
 
@@ -200,17 +200,19 @@ Commands for managing Tailor Platform applications (work with `tailor.config.ts`
200
200
 
201
201
  Commands for managing TailorDB tables, data, and schema migrations.
202
202
 
203
- | Command | Description |
204
- | ---------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
205
- | [tailordb](./cli/tailordb.md#tailordb) | Manage TailorDB tables and data. |
206
- | [tailordb truncate](./cli/tailordb.md#tailordb-truncate) | Truncate (delete all records from) TailorDB tables. |
207
- | [tailordb migration](./cli/tailordb.md#tailordb-migration) | Manage TailorDB schema migrations. |
208
- | [tailordb migration generate](./cli/tailordb.md#tailordb-migration-generate) | Generate migration files by detecting schema differences between current local types and the previous migration snapshot. |
209
- | [tailordb migration script](./cli/tailordb.md#tailordb-migration-script) | Add a migration script (migrate.ts) template to an existing migration directory, or record with --no-script that a migration intentionally has none. |
210
- | [tailordb migration set](./cli/tailordb.md#tailordb-migration-set) | Set migration checkpoint to a specific number. |
211
- | [tailordb migration status](./cli/tailordb.md#tailordb-migration-status) | Show the current migration status for TailorDB namespaces, including applied and pending migrations. |
212
- | [tailordb migration sync](./cli/tailordb.md#tailordb-migration-sync) | Sync remote TailorDB schema to a specific migration snapshot (recovery from --no-schema-check drift). |
213
- | [tailordb migration validate](./cli/tailordb.md#tailordb-migration-validate) | Validate the full migration history and detect schema drift (local types vs. migration snapshot, remote schema vs. migration checkpoint) without deploying. This includes the migration and schema-drift checks used by 'deploy' and exits with a non-zero code when issues are found. |
203
+ | Command | Description |
204
+ | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
205
+ | [tailordb](./cli/tailordb.md#tailordb) | Manage TailorDB tables and data. |
206
+ | [tailordb truncate](./cli/tailordb.md#tailordb-truncate) | Truncate (delete all records from) TailorDB tables. |
207
+ | [tailordb migration](./cli/tailordb.md#tailordb-migration) | Manage TailorDB schema migrations. |
208
+ | [tailordb migration generate](./cli/tailordb.md#tailordb-migration-generate) | Generate migration files by detecting schema differences between current local types and the previous migration snapshot. |
209
+ | [tailordb migration rebaseline](./cli/tailordb.md#tailordb-migration-rebaseline) | Collapse the full migration history into a new 0000 baseline. |
210
+ | [tailordb migration script](./cli/tailordb.md#tailordb-migration-script) | Add a migration script (migrate.ts) template to an existing migration directory, or record with --no-script that a migration intentionally has none. |
211
+ | [tailordb migration set](./cli/tailordb.md#tailordb-migration-set) | Set migration checkpoint to a specific number. |
212
+ | [tailordb migration status](./cli/tailordb.md#tailordb-migration-status) | Show the current migration status for TailorDB namespaces, including applied and pending migrations. |
213
+ | [tailordb migration sync](./cli/tailordb.md#tailordb-migration-sync) | Sync remote TailorDB schema to a specific migration snapshot (recovery from --no-schema-check drift). |
214
+ | [tailordb migration test](./cli/tailordb.md#tailordb-migration-test) | Test pending migrations with seed fixtures or cloned data in a temporary workspace. |
215
+ | [tailordb migration validate](./cli/tailordb.md#tailordb-migration-validate) | Validate the full migration history, unreviewed generated migration scripts, and schema drift (local types vs. migration snapshot, remote schema vs. migration checkpoint) without deploying. This includes the migration and schema-drift checks used by 'deploy' and exits with a non-zero code when issues are found. |
214
216
 
215
217
  ### [Query Commands](./cli/query.md)
216
218
 
@@ -389,13 +391,14 @@ Commands for setting up project infrastructure.
389
391
 
390
392
  | Command | Description |
391
393
  | --------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
392
- | [setup](./cli/setup.md#setup) | Generate CI deploy workflows for your project. (beta) |
394
+ | [setup](./cli/setup.md#setup) | Set up repository automation for your project. (beta) |
393
395
  | [setup action](./cli/setup.md#setup-action) | Generate a per-app composite action for use with setup coordinate (monorepo multi-app deploys). |
394
396
  | [setup branch](./cli/setup.md#setup-branch) | Generate a branch-target deploy workflow (push to branch triggers deploy). |
395
397
  | [setup check](./cli/setup.md#setup-check) | Audit generated workflows for drift against the current config/repo (read-only). |
396
398
  | [setup coordinate](./cli/setup.md#setup-coordinate) | Generate a coordinator workflow that orchestrates multiple --action-generated composite actions. |
397
399
  | [setup delete](./cli/setup.md#setup-delete) | Delete managed workflow/action file(s) and their .github/tailor.lock entries. |
398
400
  | [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. |
399
402
  | [setup tag](./cli/setup.md#setup-tag) | Generate a tag-target deploy workflow (tag push triggers deploy). |
400
403
 
401
404
  ### [Upgrade Commands](./cli/upgrade.md)
@@ -129,7 +129,7 @@ When using external resources:
129
129
  - The resource itself is not deployed by this project
130
130
  - The resource must be deployed and available before referencing it
131
131
  - You can combine external resources with locally-defined resources
132
- - TailorDB type names must remain unique across local and external TailorDB namespaces; `deploy` checks external TailorDB type names before applying changes
132
+ - TailorDB table names must remain unique across local and external TailorDB namespaces; `deploy` checks external TailorDB table names before applying changes
133
133
  - Destructive operations like `tailordb truncate` (and `tailor seed apply --truncate`) automatically exclude external resources to prevent accidental data loss in shared resources
134
134
  - Subscribing an executor to an external resource's events requires the config that owns the resource in the same `deploy`. Publishing is then enabled automatically, and `deploy` records the dependency so a later deploy without that config asks for confirmation instead of silently turning publishing off
135
135
 
@@ -1,7 +1,7 @@
1
1
  # GitHub Actions Integration
2
2
 
3
- `tailor setup` generates a GitHub Actions workflow that deploys your
4
- Tailor Platform application automatically on push or tag.
3
+ `tailor setup` generates GitHub repository automation for your Tailor Platform
4
+ application, including deploy workflows and Renovate configuration.
5
5
 
6
6
  > **Beta:** This command is under active development. CLI flags, the generated
7
7
  > workflow, and the `.github/tailor.lock` schema may change before general
@@ -14,16 +14,13 @@ lives):
14
14
 
15
15
  ```bash
16
16
  # Branch target: deploy to stg on every push to main
17
- tailor setup -n my-app-stg
17
+ tailor setup branch --name my-app-stg
18
18
 
19
19
  # Tag target: deploy to production when a tag is pushed, with an approval gate
20
- tailor setup -n my-app-prod \
21
- --tag --branch main --environment production
20
+ tailor setup tag --name my-app-prod \
21
+ --branch main --environment production
22
22
  ```
23
23
 
24
- `setup` defaults to the GitHub provider; `--provider github` (`-p github`) is
25
- accepted but optional, and other providers are not yet supported.
26
-
27
24
  After running the command, follow the **Next steps** printed to the terminal to
28
25
  set the required secrets, set the `TAILOR_PLATFORM_WORKSPACE_ID` variable, and
29
26
  commit the generated files.
@@ -44,9 +41,9 @@ The branch target fires on pull requests and pushes to the branch you specify
44
41
  (defaulting to the repository's default branch when `--branch` is omitted):
45
42
 
46
43
  ```bash
47
- tailor setup -n my-app-stg
44
+ tailor setup branch --name my-app-stg
48
45
  # Equivalent to:
49
- tailor setup -n my-app-stg --branch main
46
+ tailor setup branch --name my-app-stg --branch main
50
47
  ```
51
48
 
52
49
  What it does:
@@ -69,7 +66,7 @@ Pass `--erd-preview` on a branch target to add TailorDB ERD preview artifacts
69
66
  to pull requests:
70
67
 
71
68
  ```bash
72
- tailor setup -n my-app-stg --erd-preview
69
+ tailor setup branch --name my-app-stg --erd-preview
73
70
  ```
74
71
 
75
72
  The generated workflow runs `tailor tailordb erd`, which is provided by the
@@ -90,11 +87,10 @@ ERD preview does not use Tailor Platform credentials. Fork pull requests still
90
87
  build artifacts, but the comment step is skipped because fork tokens cannot
91
88
  write PR comments.
92
89
 
93
- `--erd-preview` is only available for branch targets with the plan job enabled;
94
- it cannot be combined with `--tag` or `--no-plan`. The namespace list is
95
- recorded in `.github/tailor.lock`; the pull request workflow compares the
96
- head and base lock files so newly added or removed namespaces can still produce
97
- all-added or all-removed viewer artifacts. Re-run `setup` after adding or
90
+ `--erd-preview` is only available for branch targets. The namespace list is
91
+ recorded in `.github/tailor.lock`; the pull request workflow compares the head
92
+ and base lock files so newly added or removed namespaces can still produce
93
+ all-added or all-removed viewer artifacts. Re-run `setup branch` after adding or
98
94
  removing TailorDB namespaces. `setup check` reports drift when the recorded ERD
99
95
  preview namespaces no longer match the current config.
100
96
 
@@ -104,8 +100,8 @@ The tag target fires when a tag matching `--tag-pattern` (default `v*`) is
104
100
  pushed:
105
101
 
106
102
  ```bash
107
- tailor setup -n my-app-prod \
108
- --tag --tag-pattern "v*" --branch main --environment production
103
+ tailor setup tag --name my-app-prod \
104
+ --tag-pattern "v*" --branch main --environment production
109
105
  ```
110
106
 
111
107
  What it does:
@@ -131,7 +127,7 @@ What it does:
131
127
  | Branch | The branch that triggers the workflow (push + PR base). Defaults to the repo's default branch. |
132
128
  | Tag | The branch whose history the tag must be reachable from. Omit to disable the guard entirely. |
133
129
 
134
- The workspace name (`--workspace-name`, or the config `name` when omitted) must
130
+ The workspace name (`--name`, or the config `name` when omitted) must
135
131
  be 3–63 characters of lowercase letters, numbers, and hyphens, and cannot start
136
132
  or end with a hyphen. It is used for the generated file name, the workflow
137
133
  `name:`, the plan label, and the default GitHub Environment name; it does not
@@ -174,7 +170,7 @@ environment is planned.)
174
170
 
175
171
  ## Generated files
176
172
 
177
- Running `setup` creates or updates:
173
+ Running a workflow setup subcommand creates or updates:
178
174
 
179
175
  ### `.github/workflows/tailor-<workspace-name>.yml`
180
176
 
@@ -276,7 +272,7 @@ you can deploy any commit regardless of branch membership.
276
272
  For a monorepo where your SDK app lives in a subdirectory, pass `--dir`:
277
273
 
278
274
  ```bash
279
- tailor setup -n my-app --dir apps/backend
275
+ tailor setup branch --name my-app --dir apps/backend
280
276
  ```
281
277
 
282
278
  The generated workflow adds a `paths` filter on `apps/backend/**` so the
@@ -341,11 +337,11 @@ A typical setup with staging and production:
341
337
 
342
338
  ```bash
343
339
  # Staging: main → stg (deploy on every push to main)
344
- tailor setup -n my-app-stg
340
+ tailor setup branch --name my-app-stg
345
341
 
346
342
  # Production: tagged commits → prod, with approval gate and branch guard
347
- tailor setup -n my-app-prod \
348
- --tag --branch main --environment production
343
+ tailor setup tag --name my-app-prod \
344
+ --branch main --environment production
349
345
  ```
350
346
 
351
347
  Then provision each workspace and set its id on the matching environment (the
@@ -364,6 +360,41 @@ gh secret set TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET --env production
364
360
 
365
361
  Commit both workflow files and `.github/tailor.lock`.
366
362
 
363
+ ## Keeping dependencies and actions updated
364
+
365
+ Run this command once from the repository root to add Renovate configuration:
366
+
367
+ ```bash
368
+ tailor setup renovate
369
+ ```
370
+
371
+ It generates `renovate.json`, which extends Tailor's shared Renovate preset. The
372
+ preset groups `@tailor-platform/*` package updates into one pull request and
373
+ lets Renovate update the SHA-pinned GitHub Actions used by generated workflows.
374
+ Enable Renovate for the repository by following the
375
+ [Renovate onboarding guide](https://docs.renovatebot.com/getting-started/installing-onboarding/),
376
+ then commit the generated file.
377
+
378
+ If the repository already has Renovate configuration, the command adds
379
+ `github>tailor-inc/renovate-config` to its `extends` array in place instead of
380
+ writing a new file, leaving your other settings untouched. It checks Renovate's
381
+ standard root, `.github`, `.gitlab`, and `.renovaterc` locations, including the
382
+ deprecated `package.json` configuration. When that configuration already extends
383
+ the preset, the command reports that Renovate is set up and changes nothing.
384
+
385
+ Configuration written in JSON5 or JSONC — with comments or trailing commas —
386
+ cannot be edited without losing those comments, so the command leaves it
387
+ unchanged and asks you to add the preset to its `extends` array yourself.
388
+
389
+ `renovate.json` is yours to edit — it is not tracked in `.github/tailor.lock`.
390
+ Add your own rules freely; re-running `tailor setup renovate` does not overwrite
391
+ them. To remove it, delete the file.
392
+
393
+ Renovate updates the SDK dependency and action pins, but it does not regenerate
394
+ the workflow template. After an SDK update, `tailor setup check --ci` reports a
395
+ template-version warning until you re-run the relevant workflow setup
396
+ subcommand.
397
+
367
398
  ## Checking for drift
368
399
 
369
400
  `tailor setup check` audits the workflows recorded in
@@ -374,12 +405,26 @@ newer template is available, `tailor.config.ts` is no longer under the recorded
374
405
  trigger. It exits non-zero when it finds drift, so you can run it in CI. Each
375
406
  finding names a stable rule key for future suppression.
376
407
 
408
+ Workflows generated by `setup branch`, `setup tag`, `setup preview`, and
409
+ `setup coordinate` self-audit: each contains a `tailor-drift-check` step that
410
+ runs the check in CI. Preview workflows run it alongside each preview deploy,
411
+ so pull requests that deploy no preview (drafts, fork PRs, and unlabeled PRs
412
+ in label-triggered mode) skip the check. A single run audits every target
413
+ recorded in `.github/tailor.lock`, so per-app composite actions generated by
414
+ `setup action` are covered by their coordinator's step and do not carry one of
415
+ their own.
416
+
417
+ Drift findings are advisory by default. Set the repository variable
418
+ `TAILOR_PLATFORM_FAIL_ON_DRIFT` to `true` to make unsuppressed findings fail
419
+ the job. Execution and configuration errors fail regardless of this variable.
420
+
377
421
  ## Updating the generated workflow
378
422
 
379
- When you upgrade the SDK, re-run `setup` with the same flags to pick up
380
- template improvements. If the SDK detects that you have hand-edited a managed
381
- section, it stops and asks you to use `--force` to overwrite your edits, or to
382
- move your customizations into your own steps before regenerating.
423
+ When you upgrade the SDK, re-run the relevant workflow setup subcommand with
424
+ the same flags to pick up template improvements. If the SDK detects that you
425
+ have hand-edited a managed section, it stops and asks you to use `--force` to
426
+ overwrite your edits, or to move your customizations into your own steps before
427
+ regenerating.
383
428
 
384
429
  The `.github/tailor.lock` file records the flags used at generation time,
385
430
  so you can check what arguments were used previously.
@@ -8,6 +8,60 @@ 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
+ ## Type-only imports → `import type`
12
+
13
+ **Migration:** Manual
14
+
15
+ The v2 CLI runs TypeScript by stripping types from each file in isolation,
16
+ with no cross-file type information. A plain (non-`type`) import of a
17
+ type-only export therefore survives stripping and fails when the module
18
+ loads:
19
+
20
+ ```
21
+ SyntaxError: The requested module './types.ts' does not provide an export named 'Row'
22
+ ```
23
+
24
+ `tailor generate` / `tailor deploy` stop at this error before doing any work.
25
+ Import types with `import type` (or the inline `type` modifier), and
26
+ re-export them with `export type`, in every module the CLI loads. Generated
27
+ Kysely types (`DB`, `Insertable`, `Selectable`, table row types) are almost
28
+ entirely type-only, so v1 projects typically hit this in many files at once.
29
+ Set `"verbatimModuleSyntax": true` in tsconfig.json to catch every violation
30
+ at typecheck; projects scaffolded by v2 `tailor init` enable it by default.
31
+
32
+ Before:
33
+
34
+ ```ts
35
+ import { DB, getDB } from "./generated/db";
36
+ ```
37
+
38
+ After:
39
+
40
+ ```ts
41
+ import { type DB, getDB } from "./generated/db";
42
+ ```
43
+
44
+ <details>
45
+ <summary>Prompt for an AI agent (to perform this migration)</summary>
46
+
47
+ ```text
48
+ In Tailor SDK v2 the CLI loads TypeScript by stripping types from each file
49
+ in isolation, so type-only exports do not exist at runtime and plain imports
50
+ of them fail to load with "does not provide an export named '<name>'".
51
+ Migrate the project so every type-only import and re-export is marked:
52
+
53
+ 1. Add `"verbatimModuleSyntax": true` to compilerOptions in tsconfig.json.
54
+ 2. Run `tsc --noEmit` and fix every reported violation: add the `type`
55
+ modifier to type-only named imports (`import type { Row }` or
56
+ `import { type Row, marker }`) and change type-only re-exports to
57
+ `export type { ... }`.
58
+
59
+ Only add `type` modifiers; do not reorder, remove, or otherwise change
60
+ imports that are used as values.
61
+ ```
62
+
63
+ </details>
64
+
11
65
  ## defineGenerators → definePlugins
12
66
 
13
67
  **Migration:** Partially automatic
@@ -675,7 +729,7 @@ already pass a plain value unchanged.
675
729
 
676
730
  **Migration:** Partially automatic
677
731
 
678
- Rename the `defineIdp` option `publishUserEvents` to `publishEvents`, matching the field name TailorDB types, resolvers, and workflows already use.
732
+ Rename the `defineIdp` option `publishUserEvents` to `publishEvents`, matching the field name that TailorDB tables, resolvers, and workflows already use.
679
733
 
680
734
  Before:
681
735