@tailor-platform/sdk 2.0.0-next.9 → 2.0.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 +611 -0
- package/dist/{application-D_oSqto2.mjs → application-CM6hKnSK.mjs} +489 -118
- package/dist/application-CM6hKnSK.mjs.map +1 -0
- package/dist/application-CXNaUNhv.mjs +3 -0
- package/dist/cli/commands/deploy/aigateway.d.mts +1 -1
- package/dist/cli/commands/deploy/application.d.mts +1 -1
- package/dist/cli/commands/deploy/auth.d.mts +1 -1
- package/dist/cli/commands/deploy/deploy.d.mts +1 -0
- package/dist/cli/commands/deploy/executor.d.mts +1 -1
- package/dist/cli/commands/deploy/function-registry.d.mts +1 -2
- package/dist/cli/commands/deploy/idp.d.mts +1 -1
- package/dist/cli/commands/deploy/label.d.mts +2 -0
- package/dist/cli/commands/deploy/resolver.d.mts +1 -1
- package/dist/cli/commands/deploy/staticwebsite.d.mts +1 -1
- package/dist/cli/commands/deploy/tailordb/index.d.mts +3 -1
- package/dist/cli/commands/deploy/types.d.mts +2 -1
- package/dist/cli/commands/deploy/workflow-execution-policy.d.mts +1 -2
- package/dist/cli/commands/deploy/workflow.d.mts +1 -1
- package/dist/cli/commands/executor/get.d.mts +1 -10
- package/dist/cli/commands/executor/jobs.d.mts +1 -38
- package/dist/cli/commands/executor/trigger.d.mts +1 -11
- package/dist/cli/commands/generate/seed/bundler.d.mts +2 -1
- package/dist/cli/commands/tailordb/migrate/bundler.d.mts +3 -2
- package/dist/cli/commands/tailordb/migrate/diff-calculator.d.mts +11 -1
- package/dist/cli/commands/tailordb/migrate/schema-checks.d.mts +5 -0
- package/dist/cli/commands/tailordb/migrate/snapshot.d.mts +1 -1
- package/dist/cli/commands/workflow/executions.d.mts +1 -13
- package/dist/cli/commands/workflow/get.d.mts +1 -10
- package/dist/cli/commands/workflow/start.d.mts +2 -14
- package/dist/cli/index.mjs +12 -6561
- package/dist/cli/lib.d.mts +9 -12
- package/dist/cli/lib.mjs +99 -42
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/{index.d.mts → main.d.mts} +1 -1
- package/dist/cli/main.mjs +6777 -0
- package/dist/cli/main.mjs.map +1 -0
- package/dist/cli/services/http-adapter/bundler.d.mts +1 -0
- package/dist/cli/services/workflow/bundler.d.mts +2 -1
- package/dist/cli/shared/client.d.mts +28 -3
- package/dist/cli/shared/config-loader.d.mts +11 -4
- package/dist/cli/shared/error-json.d.mts +23 -0
- package/dist/cli/shared/tsconfig-paths-plugin.d.mts +2 -0
- package/dist/cli/shared/type-generator.d.mts +4 -3
- package/dist/completion/zsh-worker.zsh +85 -22
- package/dist/configure/config/types.d.mts +29 -4
- package/dist/configure/index.d.mts +4 -3
- package/dist/configure/index.mjs +183 -6
- package/dist/configure/index.mjs.map +1 -1
- package/dist/configure/services/executor/index.d.mts +2 -2
- package/dist/configure/services/executor/trigger/event.d.mts +245 -2
- package/dist/configure/services/executor/trigger/index.d.mts +3 -3
- package/dist/configure/services/idp/index.d.mts +2 -2
- package/dist/configure/services/idp/permission.d.mts +1 -16
- package/dist/configure/services/idp/types.d.mts +5 -1
- package/dist/configure/services/index.d.mts +4 -3
- package/dist/configure/services/resolver/index.d.mts +2 -1
- package/dist/configure/services/resolver/permission.d.mts +64 -0
- package/dist/configure/services/resolver/resolver.d.mts +14 -2
- package/dist/configure/services/tailordb/index.d.mts +0 -1
- package/dist/configure/services/tailordb/permission.d.mts +1 -16
- package/dist/configure/services/workflow/execution-policy.d.mts +3 -3
- package/dist/configure/services/workflow/execution-policy.types.d.mts +1 -1
- package/dist/configure/services/workflow/job.d.mts +11 -2
- package/dist/configure/services/workflow/workflow.d.mts +10 -0
- package/dist/configure/types/permission-operand.types.d.mts +20 -0
- package/dist/{crashreport-CxHne11E.mjs → crashreport-B5LqCTfF.mjs} +2 -2
- package/dist/{crashreport-CxHne11E.mjs.map → crashreport-B5LqCTfF.mjs.map} +1 -1
- package/dist/{crashreport-0ioNRZ4K.mjs → crashreport-eI7ty7ok.mjs} +1 -1
- package/dist/{errors-DfnF4ibq.mjs → errors-D7583Zz7.mjs} +2 -44
- package/dist/errors-D7583Zz7.mjs.map +1 -0
- package/dist/{globals-CBZ0egXT.mjs → globals-TfAVItuK.mjs} +21 -5
- package/dist/globals-TfAVItuK.mjs.map +1 -0
- package/dist/logger-BtX0suGY.mjs +48 -0
- package/dist/logger-BtX0suGY.mjs.map +1 -0
- package/dist/{logger-BwS4ppwO.mjs → logger-CXQq9YIp.mjs} +110 -13
- package/dist/logger-CXQq9YIp.mjs.map +1 -0
- package/dist/node-builtins-CmaL2Cbq.mjs +36 -0
- package/dist/node-builtins-CmaL2Cbq.mjs.map +1 -0
- package/dist/plugin/builtin/enum-constants/index.mjs +115 -2
- package/dist/plugin/builtin/enum-constants/index.mjs.map +1 -0
- package/dist/plugin/builtin/file-utils/index.mjs +149 -2
- package/dist/plugin/builtin/file-utils/index.mjs.map +1 -0
- package/dist/plugin/builtin/kysely-type/index.mjs +274 -2
- package/dist/plugin/builtin/kysely-type/index.mjs.map +1 -0
- package/dist/plugin/builtin/seed/index.mjs +1 -1
- package/dist/plugin/builtin/seed/seed-type-processor.d.mts +2 -0
- package/dist/{register-ts-hook-DgnmGTCt.mjs → register-ts-hook-LYV7zH-e.mjs} +2949 -1001
- package/dist/register-ts-hook-LYV7zH-e.mjs.map +1 -0
- package/dist/{registry-i7EdJ-D5.mjs → registry-BIGVUrMB.mjs} +3 -3
- package/dist/registry-BIGVUrMB.mjs.map +1 -0
- package/dist/runtime/globals.d.mts +7 -0
- package/dist/runtime/index.d.mts +3 -1
- package/dist/runtime/index.mjs +3 -2
- package/dist/runtime/logger.d.mts +98 -0
- package/dist/runtime/logger.mjs +3 -0
- package/dist/runtime/workflow.d.mts +15 -7
- package/dist/runtime/workflow.mjs +1 -1
- package/dist/{seed-LUVr7jHL.mjs → seed-B-yckgQY.mjs} +42 -3
- package/dist/seed-B-yckgQY.mjs.map +1 -0
- package/dist/{service-DaeJlBoH.mjs → service-B5WynBHQ.mjs} +3 -3
- package/dist/{service-DaeJlBoH.mjs.map → service-B5WynBHQ.mjs.map} +1 -1
- package/dist/service-M7OYziQP.mjs +3 -0
- package/dist/{service-CXFce28G.mjs → service-k1xy_A5G.mjs} +30 -3
- package/dist/{service-CXFce28G.mjs.map → service-k1xy_A5G.mjs.map} +1 -1
- package/dist/{service_pb-BoLM0X4K.mjs → service_pb-D5--My_M.mjs} +5 -5
- package/dist/service_pb-D5--My_M.mjs.map +1 -0
- package/dist/{service_pb-r1T7kpJc.mjs → service_pb-i8CmnQP4.mjs} +1 -1
- package/dist/tailor-proto/src/tailor/v1/application_pb.d.mts +106 -1
- package/dist/tailor-proto/src/tailor/v1/executor_resource_pb.d.mts +24 -1
- package/dist/tailor-proto/src/tailor/v1/function_pb.d.mts +49 -1
- package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +89 -6
- package/dist/tailor-proto/src/tailor/v1/telemetryrouter_resource_pb.d.mts +26 -1
- package/dist/tailor-proto/src/tailor/v1/workflow_pb.d.mts +101 -1
- package/dist/tailor-proto/src/tailor/v1/workflow_resource_pb.d.mts +22 -1
- package/dist/types/auth.generated.d.mts +14 -2
- package/dist/types/executor.generated.d.mts +45 -3
- package/dist/types/http-adapter.generated.d.mts +5 -0
- package/dist/types/idp.generated.d.mts +31 -1
- package/dist/types/resolver.generated.d.mts +30 -2
- package/dist/types/tailordb.generated.d.mts +15 -1
- package/dist/utils/test/index.d.mts +1 -2
- package/dist/utils/test/index.mjs +1 -169
- package/dist/utils/test/index.mjs.map +1 -1
- package/dist/vitest/environment.mjs +1 -1
- package/dist/vitest/index.d.mts +6 -4
- package/dist/vitest/index.mjs +112 -62
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/mock.d.mts +2 -1
- package/dist/vitest/mocks/logger.d.mts +45 -0
- package/dist/vitest/mocks/workflow.d.mts +8 -8
- package/dist/vitest/setup.mjs +1 -1
- package/dist/{workflow-CsBvRE3g.mjs → workflow-Bamae_Yc.mjs} +5 -5
- package/dist/workflow-Bamae_Yc.mjs.map +1 -0
- package/dist/{workspace_resource_pb-Db3fv68L.mjs → workspace_resource_pb-DXnO2AT-.mjs} +13 -8
- package/dist/workspace_resource_pb-DXnO2AT-.mjs.map +1 -0
- package/docs/cli/application.md +5 -1
- package/docs/cli/tailordb.md +47 -13
- package/docs/cli-reference.md +31 -30
- package/docs/configuration.md +53 -1
- package/docs/github-actions.md +2 -2
- package/docs/migration/v2.md +307 -10
- package/docs/runtime.md +5 -1
- package/docs/services/executor.md +83 -3
- package/docs/services/idp.md +8 -6
- package/docs/services/resolver.md +60 -4
- package/docs/services/tailordb-migration.md +31 -7
- package/docs/services/tailordb.md +7 -5
- package/docs/services/workflow.md +33 -3
- package/docs/testing.md +34 -7
- package/package.json +31 -24
- package/dist/application-CtuzFhg8.mjs +0 -3
- package/dist/application-D_oSqto2.mjs.map +0 -1
- package/dist/cli/index.mjs.map +0 -1
- package/dist/enum-constants-j9QBF0cB.mjs +0 -116
- package/dist/enum-constants-j9QBF0cB.mjs.map +0 -1
- package/dist/errors-DfnF4ibq.mjs.map +0 -1
- package/dist/file-utils-yEiIS4nJ.mjs +0 -150
- package/dist/file-utils-yEiIS4nJ.mjs.map +0 -1
- package/dist/globals-CBZ0egXT.mjs.map +0 -1
- package/dist/kysely-type-DqIRgDYR.mjs +0 -275
- package/dist/kysely-type-DqIRgDYR.mjs.map +0 -1
- package/dist/logger-BwS4ppwO.mjs.map +0 -1
- package/dist/register-ts-hook-DgnmGTCt.mjs.map +0 -1
- package/dist/registry-i7EdJ-D5.mjs.map +0 -1
- package/dist/seed-LUVr7jHL.mjs.map +0 -1
- package/dist/service-DjhjpJpm.mjs +0 -3
- package/dist/service_pb-BoLM0X4K.mjs.map +0 -1
- package/dist/utils/test/mock.d.mts +0 -86
- package/dist/workflow-CsBvRE3g.mjs.map +0 -1
- package/dist/workspace_resource_pb-Db3fv68L.mjs.map +0 -1
|
@@ -305,12 +305,12 @@ createResolver({
|
|
|
305
305
|
**Behavior:**
|
|
306
306
|
|
|
307
307
|
- When `publishEvents: true`, resolver execution events are published
|
|
308
|
-
- When not specified, it
|
|
309
|
-
- When explicitly set to `false` while an executor
|
|
308
|
+
- When not specified, `deploy` sets it from the executors taking part in the same run: `true` while one of them uses this resolver with `resolverExecutedTrigger`, and `false` once none does. Removing the last such trigger turns publishing back off on the next `deploy`
|
|
309
|
+
- When explicitly set to `false` while an executor taking part in the same run uses this resolver, `deploy` fails
|
|
310
310
|
|
|
311
311
|
**Use cases:**
|
|
312
312
|
|
|
313
|
-
1. **Auto-detection (recommended)**: Don't set `publishEvents` -
|
|
313
|
+
1. **Auto-detection (recommended)**: Don't set `publishEvents` - `deploy` enables it while an executor taking part in the same run needs it
|
|
314
314
|
|
|
315
315
|
```typescript
|
|
316
316
|
// publishEvents is automatically enabled because an executor uses this resolver
|
|
@@ -339,7 +339,7 @@ createResolver({
|
|
|
339
339
|
});
|
|
340
340
|
```
|
|
341
341
|
|
|
342
|
-
3. **Explicit disable**: Disable event publishing for a resolver that doesn't need it (error if executor uses it)
|
|
342
|
+
3. **Explicit disable**: Disable event publishing for a resolver that doesn't need it (error if an executor taking part in the same run uses it)
|
|
343
343
|
|
|
344
344
|
```typescript
|
|
345
345
|
createResolver({
|
|
@@ -350,6 +350,62 @@ createResolver({
|
|
|
350
350
|
});
|
|
351
351
|
```
|
|
352
352
|
|
|
353
|
+
**Sharing a resolver across configs:** an executor in another config auto-enables publishing the same way, as long as both configs take part in the same `deploy` (`--config a,b`). `deploy` records that dependency, so deploying the owning config alone later asks for confirmation instead of silently turning publishing off — it fails outright in a non-interactive environment. Set `publishEvents: true` on the resolver to keep it on regardless of which configs take part.
|
|
354
|
+
|
|
355
|
+
## Permissions
|
|
356
|
+
|
|
357
|
+
### Access Requirement (`permission`)
|
|
358
|
+
|
|
359
|
+
By default, a resolver with no in-body check is reachable by an anonymous (unauthenticated) caller. Set `permission` to reject callers that don't match a condition, evaluated before `body` runs:
|
|
360
|
+
|
|
361
|
+
```typescript
|
|
362
|
+
import { createResolver, t } from "@tailor-platform/sdk";
|
|
363
|
+
|
|
364
|
+
export default createResolver({
|
|
365
|
+
name: "getMyOrders",
|
|
366
|
+
operation: "query",
|
|
367
|
+
permission: [{ conditions: [[{ user: "_loggedIn" }, "=", true]], permit: true }],
|
|
368
|
+
output: t.object({ count: t.int() }),
|
|
369
|
+
body: async (context) => {
|
|
370
|
+
// context.user is guaranteed to be an authenticated caller here
|
|
371
|
+
return { count: 0 };
|
|
372
|
+
},
|
|
373
|
+
});
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
`permission` uses the same `conditions`/`permit` notation as TailorDB's `.permission()` — an array of policies, restricted to `user` operands (a resolver has no associated record to compare against) with equality (`=`/`!=`) comparisons:
|
|
377
|
+
|
|
378
|
+
- `{ user: "_loggedIn" }` — whether the caller is authenticated
|
|
379
|
+
- `{ user: "id" }` — the caller's user ID
|
|
380
|
+
- `{ user: "someAttribute" }` — any string or boolean attribute enabled in `auth.userProfile.attributes` (or `auth.machineUserAttributes` for machine users); array attributes aren't supported, since conditions only compare against a single string/boolean value
|
|
381
|
+
|
|
382
|
+
Multiple conditions within the same policy's `conditions` array are combined with AND. `permit` is required, with no implicit default. At least one `permit: true` policy is required: `permission` is an allow-list, denied by default and granted only by a matching `permit: true` policy. This lets you express different eligibility paths, e.g. allowing machine-user callers unconditionally while gating regular users behind a role check:
|
|
383
|
+
|
|
384
|
+
```typescript
|
|
385
|
+
permission: [
|
|
386
|
+
{ conditions: [[{ user: "isServiceAccount" }, "=", true]], permit: true },
|
|
387
|
+
{ conditions: [[{ user: "role" }, "=", "ADMIN"]], permit: true },
|
|
388
|
+
],
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
A `permit: false` policy always denies matching callers, even ones another policy would otherwise allow. Combine it with a `permit: true` policy to carve out an explicit exception, e.g. granting access broadly but rejecting one banned role:
|
|
392
|
+
|
|
393
|
+
```typescript
|
|
394
|
+
permission: [
|
|
395
|
+
{ conditions: [[{ user: "_loggedIn" }, "=", true]], permit: true },
|
|
396
|
+
{ conditions: [[{ user: "role" }, "=", "BANNED"]], permit: false },
|
|
397
|
+
],
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
A policy array made up of only `permit: false` policies is rejected: since none of its conditions apply to a caller presenting no user attributes at all, it wouldn't actually keep anyone out who's willing to drop their credentials, so it can't stand in for an allow-list.
|
|
401
|
+
|
|
402
|
+
Besides a policy array, `permission` also accepts:
|
|
403
|
+
|
|
404
|
+
- `"allowAnonymous"` — explicitly documents that anonymous callers are allowed. Behaves the same as omitting `permission`, but records the decision so it isn't mistaken for an oversight.
|
|
405
|
+
- Omitted (default) — unchanged: anonymous callers can still reach the resolver.
|
|
406
|
+
|
|
407
|
+
This check is based on `context.user`, the original caller, so it still applies even when `authInvoker` swaps in a machine user for database access.
|
|
408
|
+
|
|
353
409
|
## Authentication
|
|
354
410
|
|
|
355
411
|
Specify an `invoker` to execute the resolver with machine user credentials. Pass the machine user name as a plain string — it is type-narrowed to the names you defined in your auth config:
|
|
@@ -131,6 +131,16 @@ tailor tailordb migration script 0002
|
|
|
131
131
|
|
|
132
132
|
This writes `migrations/0002/migrate.ts` and `migrations/0002/db.ts` next to the existing `diff.json`. The removed field stays readable inside `migrate.ts` because the pre-migration phase keeps it on the type until the script finishes (see [Per-migration phases](#per-migration-phases)). The next `tailor deploy` runs the script automatically — `migrate.ts` is executed whenever the file exists on disk, regardless of whether the diff itself required it.
|
|
133
133
|
|
|
134
|
+
### Breaking changes without a script
|
|
135
|
+
|
|
136
|
+
Breaking changes require `migrate.ts`. If it is missing at deploy time (for example, the generated script was deleted), `tailor deploy` fails before applying the migration or anything after it. When there is genuinely nothing to migrate — say, the affected type holds no data yet — record an explicit acknowledgment instead of keeping an empty script:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
tailor tailordb migration script 0002 --no-script --reason "no data yet, safe to skip"
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
This stores the reason in `migrations/0002/diff.json` (commit the change). The next `tailor deploy` applies the schema change as usual, skips only the script step, and logs the recorded reason. The command refuses to record a skip while `migrate.ts` exists — delete the script first. If `migrate.ts` is added back later, the script takes precedence over the acknowledgment and runs.
|
|
143
|
+
|
|
134
144
|
## Configuration
|
|
135
145
|
|
|
136
146
|
```typescript
|
|
@@ -220,10 +230,13 @@ The `env` values are injected at bundle time (the same mechanism as resolvers/ex
|
|
|
220
230
|
| Remove field | No | Optional | Warning tier — no script is auto-generated, but you can add one with `tailordb migration script` to preserve data before the field is dropped. The field stays readable from `migrate.ts` during Pre-migration and is dropped in Post-migration. |
|
|
221
231
|
| Change optional → required | Yes | Yes | Script sets defaults for null values |
|
|
222
232
|
| Change required → optional | No | No | Schema change only |
|
|
223
|
-
| Add index
|
|
224
|
-
|
|
|
233
|
+
| Add index (non-unique) | No | No | Schema change only |
|
|
234
|
+
| Add unique index | Yes | Yes | Script must resolve duplicate value combinations across the index fields |
|
|
235
|
+
| Change unique index fields | Yes | Yes | Treated like adding a new unique constraint over the new field set |
|
|
236
|
+
| Remove index | No | No | Schema change only (removing the unique constraint from an index is also non-breaking) |
|
|
225
237
|
| Add unique constraint | Yes | Yes | Script must resolve duplicate values |
|
|
226
238
|
| Remove unique constraint | No | No | Schema change only |
|
|
239
|
+
| Change decimal scale | Yes | Yes | Auto-generated script re-saves existing rows under the new scale. Decreasing scale rounds values half-up and can lose precision. If the same change adds a unique constraint, duplicate handling runs after re-saving. |
|
|
227
240
|
| Add enum value | No | No | Schema change only |
|
|
228
241
|
| Remove enum value | Yes | Yes | Script migrates records with removed values |
|
|
229
242
|
| Add type | No | No | Schema change only |
|
|
@@ -251,8 +264,8 @@ When you run `tailor deploy`, the SDK detects pending migrations (anything past
|
|
|
251
264
|
|
|
252
265
|
For each pending migration:
|
|
253
266
|
|
|
254
|
-
1. **Pre-migration**: Type changes that would be breaking are applied in a relaxed form first. Newly-required fields are added as optional; fields whose `optional → required` transition is breaking are temporarily kept optional. Fields that are being removed in this migration are temporarily kept on the type so that `migrate.ts` can still read them (for example, to `innerJoin` through a foreign key that is about to be dropped). Non-breaking changes that are part of the same migration are also applied here.
|
|
255
|
-
2. **Script execution**: If `migrate.ts` exists on disk for this migration, it is bundled and sent to the platform via the script execution API and runs as the configured machine user inside a transaction. The script is hard-required for breaking changes (`diff.requiresMigrationScript`)
|
|
267
|
+
1. **Pre-migration**: Type changes that would be breaking are applied in a relaxed form first. Newly-required fields are added as optional; fields whose `optional → required` transition is breaking are temporarily kept optional. Fields that are being removed in this migration are temporarily kept on the type so that `migrate.ts` can still read them (for example, to `innerJoin` through a foreign key that is about to be dropped). Breaking type-level index changes are relaxed the same way: a newly-added unique index is withheld, and an index gaining a unique constraint (or a unique index changing its field set) keeps its previous definition, so `migrate.ts` can resolve duplicates first. Non-breaking changes that are part of the same migration are also applied here.
|
|
268
|
+
2. **Script execution**: If `migrate.ts` exists on disk for this migration, it is bundled and sent to the platform via the script execution API and runs as the configured machine user inside a transaction. The script is hard-required for breaking changes (`diff.requiresMigrationScript`) — deploy fails if the file is missing, unless a `--no-script` acknowledgment was recorded (see [Breaking changes without a script](#breaking-changes-without-a-script)). It is also executed when present for warning-tier diffs — see [Warnings and optional migration scripts](#warnings-and-optional-migration-scripts).
|
|
256
269
|
3. **Post-migration**: Required constraints are enforced; field and type deletions are applied (the columns/tables are physically dropped here); the `sdk-migration` label is bumped to this migration's number.
|
|
257
270
|
|
|
258
271
|
This split is what allows existing rows to be backfilled before the database starts rejecting nulls, and what lets `migrate.ts` traverse foreign-key fields that the same migration removes.
|
|
@@ -277,7 +290,15 @@ Namespace: tailordb
|
|
|
277
290
|
|
|
278
291
|
The error also points you at `migration status`, `migration generate`, `migration sync`, and `migration set` — see [Remote schema drift detected](#remote-schema-drift-detected) for which one applies.
|
|
279
292
|
|
|
280
|
-
To
|
|
293
|
+
To run the same checks without deploying — plus migration file integrity (numbering, parseable contents, and a `migrate.ts` or a recorded `--no-script` acknowledgment for every migration that requires a script):
|
|
294
|
+
|
|
295
|
+
```bash
|
|
296
|
+
tailor tailordb migration validate
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
It reports issues per namespace, exits with a non-zero code when any check fails, and supports `--json` for machine-readable output.
|
|
300
|
+
|
|
301
|
+
To bypass both checks during deploy (not recommended outside of recovery scenarios):
|
|
281
302
|
|
|
282
303
|
```bash
|
|
283
304
|
tailor deploy --no-schema-check
|
|
@@ -301,6 +322,8 @@ tailor deploy --no-schema-check
|
|
|
301
322
|
|
|
302
323
|
`tailor tailordb migration set <N>` updates the `sdk-migration` label on the deployed namespace's metadata. **It does not modify any data or schema.** It only changes which migrations the next `apply` will consider pending.
|
|
303
324
|
|
|
325
|
+
The migration number is validated before anything is sent to the remote: it must be a 4-digit value (e.g. `0001`) or a bare integer (e.g. `1`) within 0–9999, and must exist in the working tree's migration history, which is itself validated (a gapped history is rejected). `0` is always accepted as the baseline (even when no migrations directory exists yet), provided the history passes validation.
|
|
326
|
+
|
|
304
327
|
| Movement | Effect on next `apply` | Effect on data |
|
|
305
328
|
| -------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------- |
|
|
306
329
|
| Forward (e.g., `0001` → `0003`) | Migrations `0002` and `0003` are skipped — they will not run. | None. |
|
|
@@ -342,7 +365,8 @@ Migration numbers are assigned sequentially, so two developers branching off the
|
|
|
342
365
|
### CI / CD
|
|
343
366
|
|
|
344
367
|
- For non-interactive environments, pass `--yes` to `migration generate` and `--yes` to `apply`. `apply` runs migrations automatically when the `migrations/` directory is configured.
|
|
345
|
-
- Run `tailor tailordb migration
|
|
368
|
+
- Run `tailor tailordb migration validate` in CI to catch uncommitted migrations, broken migration files, and remote schema drift before deploying. It exits with a non-zero code when validation fails and supports `--json`.
|
|
369
|
+
- `tailor tailordb migration status` shows applied and pending migrations for a human-readable comparison. Its exit code is non-zero only on errors, so check the output.
|
|
346
370
|
- Avoid running migrations in parallel against the same workspace — there is no locking. Serialize deploys per environment.
|
|
347
371
|
|
|
348
372
|
### Resetting a deployed project
|
|
@@ -479,4 +503,4 @@ For genuinely different schemas across environments, prefer separate workspaces
|
|
|
479
503
|
|
|
480
504
|
**Cause:** `diff.requiresMigrationScript` is true but `migrate.ts` is missing from the migration directory.
|
|
481
505
|
|
|
482
|
-
**Resolution:**
|
|
506
|
+
**Resolution:** Restore the file from version control, or create it with `tailor tailordb migration script <N> --namespace <namespace>`. If the migration intentionally needs no data transformation, record that decision with `tailor tailordb migration script <N> --namespace <namespace> --no-script --reason "<why no data migration is needed>"` instead.
|
|
@@ -515,12 +515,12 @@ db.table("User", {
|
|
|
515
515
|
**Behavior:**
|
|
516
516
|
|
|
517
517
|
- When `publishEvents: true`, record creation/update/deletion events are published
|
|
518
|
-
- When not specified, it
|
|
519
|
-
- When explicitly set to `false` while an executor
|
|
518
|
+
- When not specified, `deploy` sets it from the executors taking part in the same run: `true` while one of them uses this type with `recordCreatedTrigger`, `recordUpdatedTrigger`, or `recordDeletedTrigger`, and `false` once none does. Removing the last such trigger turns publishing back off on the next `deploy`
|
|
519
|
+
- When explicitly set to `false` while an executor taking part in the same run uses this type, `deploy` fails
|
|
520
520
|
|
|
521
521
|
**Use cases:**
|
|
522
522
|
|
|
523
|
-
1. **Auto-detection (recommended)**: Don't set `publishEvents` -
|
|
523
|
+
1. **Auto-detection (recommended)**: Don't set `publishEvents` - `deploy` enables it while an executor taking part in the same run needs it
|
|
524
524
|
|
|
525
525
|
```typescript
|
|
526
526
|
// publishEvents is automatically enabled because an executor uses this type
|
|
@@ -545,7 +545,7 @@ db.table("User", {
|
|
|
545
545
|
});
|
|
546
546
|
```
|
|
547
547
|
|
|
548
|
-
3. **Explicit disable**: Disable event publishing for a type that doesn't need it (error if executor uses it)
|
|
548
|
+
3. **Explicit disable**: Disable event publishing for a type that doesn't need it (error if an executor taking part in the same run uses it)
|
|
549
549
|
|
|
550
550
|
```typescript
|
|
551
551
|
db.table("TempData", {
|
|
@@ -555,6 +555,8 @@ db.table("User", {
|
|
|
555
555
|
});
|
|
556
556
|
```
|
|
557
557
|
|
|
558
|
+
**Sharing a type across configs:** an executor in another config auto-enables publishing the same way, as long as both configs take part in the same `deploy` (`--config a,b`). `deploy` records that dependency, so deploying the owning config alone later asks for confirmation instead of silently turning publishing off — it fails outright in a non-interactive environment. Set `publishEvents: true` on the type to keep it on regardless of which configs take part.
|
|
559
|
+
|
|
558
560
|
#### GraphQL Operations
|
|
559
561
|
|
|
560
562
|
Control which GraphQL operations (`create`, `update`, `delete`, `read`) are exposed for a type. All operations are enabled by default.
|
|
@@ -595,7 +597,7 @@ export default defineConfig({
|
|
|
595
597
|
});
|
|
596
598
|
```
|
|
597
599
|
|
|
598
|
-
This default is re-evaluated on every `tailor
|
|
600
|
+
This default is re-evaluated on every `tailor deploy`, so changing it also updates types that already exist on the platform, not only newly created ones.
|
|
599
601
|
|
|
600
602
|
### Field Extraction (`pickFields` / `omitFields`)
|
|
601
603
|
|
|
@@ -201,6 +201,36 @@ export default createWorkflow({
|
|
|
201
201
|
});
|
|
202
202
|
```
|
|
203
203
|
|
|
204
|
+
## Execution Events
|
|
205
|
+
|
|
206
|
+
Workflows can publish execution lifecycle events for executors. When an executor subscribes to a workflow's events, `deploy` enables publishing automatically. A `workflowExecution*` trigger enables it on the workflow, and a `workflowJobExecution*` trigger enables it on every job that workflow runs. See [Workflow Execution Triggers](./executor.md#workflow-execution-triggers).
|
|
207
|
+
|
|
208
|
+
Publishing follows the subscription in both directions: removing the last subscribing trigger turns it back off on the next `deploy`.
|
|
209
|
+
|
|
210
|
+
Set `publishEvents` explicitly to pin the value instead. Use `true` to publish workflow-level events with no subscribing executor:
|
|
211
|
+
|
|
212
|
+
```typescript
|
|
213
|
+
export default createWorkflow({
|
|
214
|
+
name: "order-processing",
|
|
215
|
+
mainJob: processOrder,
|
|
216
|
+
publishEvents: true,
|
|
217
|
+
});
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
A job takes the same field for its own execution events:
|
|
221
|
+
|
|
222
|
+
```typescript
|
|
223
|
+
export const processOrder = createWorkflowJob({
|
|
224
|
+
name: "process-order",
|
|
225
|
+
publishEvents: true,
|
|
226
|
+
body: async () => ({ processed: true }),
|
|
227
|
+
});
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Use `false` to keep publishing off. `deploy` fails if an executor subscribes to events the value opts out of, so the subscription cannot silently go unfulfilled.
|
|
231
|
+
|
|
232
|
+
**Subscribing from another config:** an executor in another config auto-enables publishing the same way, as long as both configs take part in the same `deploy` (`--config a,b`). The workflow a `workflowExecution*` or `workflowJobExecution*` trigger names must be declared by a config in the run; `deploy` fails otherwise rather than creating an executor whose events never arrive. `deploy` records the dependency on the workflow itself, so deploying that config alone later asks for confirmation instead of silently turning publishing off. Declaring `publishEvents` clears the record: a declared value no longer depends on which configs are deployed together, so there is nothing left to warn about.
|
|
233
|
+
|
|
204
234
|
## Wait Points
|
|
205
235
|
|
|
206
236
|
Wait points allow a workflow job to suspend execution and wait for an external signal before resuming. This enables human-in-the-loop patterns such as approvals, reviews, and manual confirmations.
|
|
@@ -357,7 +387,7 @@ Execution policies apply a per-key concurrency cap to workflow job function disp
|
|
|
357
387
|
|
|
358
388
|
### Declaring Policies
|
|
359
389
|
|
|
360
|
-
Use `defineWorkflowExecutionPolicies` with a builder callback. Property names supply the workspace-unique name and default key prefix verbatim, matching the mental model of `
|
|
390
|
+
Use `defineWorkflowExecutionPolicies` with a builder callback. Property names supply the workspace-unique name and default key prefix verbatim, matching the mental model of `createWaitPoints`. Override `name` or `key` in the body when the property identifier is not valid execution policy grammar or the key prefix needs to differ. Set `matchType: "prefix"` to register the prefix as a wildcard that matches every dispatch key starting with it (the default, `"exact"`, matches only a dispatch key equal to it).
|
|
361
391
|
|
|
362
392
|
```typescript
|
|
363
393
|
import { defineWorkflowExecutionPolicies } from "@tailor-platform/sdk";
|
|
@@ -401,7 +431,7 @@ An exact-key policy applies to dispatches whose runtime key equals the policy ke
|
|
|
401
431
|
|
|
402
432
|
### Referencing a Policy from a Workflow
|
|
403
433
|
|
|
404
|
-
Pass the runtime key through the `executionPolicyKey` option on `job.start()` or `tailor.workflow.
|
|
434
|
+
Pass the runtime key through the `executionPolicyKey` option on `job.start()` or `tailor.workflow.execJobFunction()`. For exact-key policies, use `<policy>.key` directly — it's typed so only a value that came from a declared policy can be passed. For wildcard policies (`matchType: "prefix"`), there is no `<policy>.key` — call `<policy>.keyFor(suffix)` to build the concrete key. `keyFor` joins the prefix and suffix with `.` by default; override it with `separator` — the second argument to `defineWorkflowExecutionPolicies` (applies to every policy in the group), or a `def` field on a single `defineWorkflowExecutionPolicy`.
|
|
405
435
|
|
|
406
436
|
```typescript
|
|
407
437
|
import { createWorkflowJob } from "@tailor-platform/sdk";
|
|
@@ -427,7 +457,7 @@ export const mainJob = createWorkflowJob({
|
|
|
427
457
|
});
|
|
428
458
|
```
|
|
429
459
|
|
|
430
|
-
The same `executionPolicyKey` option is available on `tailor.workflow.
|
|
460
|
+
The same `executionPolicyKey` option is available on `tailor.workflow.execJobFunction(name, args, options)` for jobs invoked by name.
|
|
431
461
|
|
|
432
462
|
## Starting a Workflow from a Resolver
|
|
433
463
|
|
package/docs/testing.md
CHANGED
|
@@ -26,7 +26,7 @@ Platform API mocks under `@tailor-platform/sdk/vitest` (for use with the [`tailo
|
|
|
26
26
|
- `mockTailordb` — TailorDB query stubs and call recording
|
|
27
27
|
- `mockWorkflow` — `tailor.workflow` job / wait / resolve mocks
|
|
28
28
|
- `runWorkflowLocally` — local full-chain workflow runner
|
|
29
|
-
- `mockSecretmanager`, `mockAuthconnection`, `mockIdp`, `mockFile`, `mockIconv`, `mockAigateway` — corresponding platform API mocks
|
|
29
|
+
- `mockSecretmanager`, `mockAuthconnection`, `mockIdp`, `mockFile`, `mockIconv`, `mockAigateway`, `mockLogger` — corresponding platform API mocks
|
|
30
30
|
|
|
31
31
|
For tighter alignment with the production runtime — Node.js module blocking, Web-only globals, and platform API mocks — pair the resolver helpers with the [`tailor-runtime` Vitest environment](#runtime-environment-emulation-beta) below.
|
|
32
32
|
|
|
@@ -63,7 +63,7 @@ export default defineConfig({
|
|
|
63
63
|
|
|
64
64
|
### Acquiring mocks with `using`
|
|
65
65
|
|
|
66
|
-
Each mock controller (`mockTailordb`, `mockWorkflow`, `mockSecretmanager`, `mockAuthconnection`, `mockIdp`, `mockFile`, `mockIconv`, `mockAigateway`) is a **factory function**. Acquire it inside a test with a [`using` declaration](https://github.com/tc39/proposal-explicit-resource-management) — its state is reset automatically when the test scope exits, so you no longer need `beforeEach(() => mock.reset())`:
|
|
66
|
+
Each mock controller (`mockTailordb`, `mockWorkflow`, `mockSecretmanager`, `mockAuthconnection`, `mockIdp`, `mockFile`, `mockIconv`, `mockAigateway`, `mockLogger`) is a **factory function**. Acquire it inside a test with a [`using` declaration](https://github.com/tc39/proposal-explicit-resource-management) — its state is reset automatically when the test scope exits, so you no longer need `beforeEach(() => mock.reset())`:
|
|
67
67
|
|
|
68
68
|
```typescript
|
|
69
69
|
import { mockTailordb } from "@tailor-platform/sdk/vitest";
|
|
@@ -166,7 +166,7 @@ test("workflow starts jobs", async () => {
|
|
|
166
166
|
});
|
|
167
167
|
```
|
|
168
168
|
|
|
169
|
-
Unconfigured definition mocks continue to run their real implementations. The lower-level `
|
|
169
|
+
Unconfigured definition mocks continue to run their real implementations. The lower-level `execJobFunction`, `startWorkflow`, `resumeWorkflowExecution`, `wait`, and `resolve` mocks and the existing `setJobHandler`, `enqueueResult`, `enqueueResults`, and call-record helpers remain available.
|
|
170
170
|
|
|
171
171
|
Use `waitPoint(definition)` for typed wait-point control:
|
|
172
172
|
|
|
@@ -321,6 +321,27 @@ test("resolves an AI Gateway URL", async () => {
|
|
|
321
321
|
|
|
322
322
|
Calling `get` for a name that has not been registered throws. `setUrls` remains available when replacing the complete URL fixture.
|
|
323
323
|
|
|
324
|
+
### Logger Mock
|
|
325
|
+
|
|
326
|
+
Each method is a `vi.fn`, so assert on it directly. `calls` returns the emitted `debug`/`info`/`warn`/`error` entries in order.
|
|
327
|
+
|
|
328
|
+
```typescript
|
|
329
|
+
import { mockLogger } from "@tailor-platform/sdk/vitest";
|
|
330
|
+
|
|
331
|
+
test("logs the processed order", () => {
|
|
332
|
+
using logger = mockLogger();
|
|
333
|
+
|
|
334
|
+
tailor.logger.info("order processed", { orderId: "o-1" });
|
|
335
|
+
|
|
336
|
+
expect(logger.info).toHaveBeenCalledWith("order processed", { orderId: "o-1" });
|
|
337
|
+
expect(logger.calls).toEqual([
|
|
338
|
+
{ severity: "info", message: "order processed", attributes: { orderId: "o-1" } },
|
|
339
|
+
]);
|
|
340
|
+
});
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
Without an explicit `mockLogger()`, `tailor.logger.*` calls are no-ops in the `tailor-runtime` environment (they neither throw nor record).
|
|
344
|
+
|
|
324
345
|
### Loading Secrets from Config
|
|
325
346
|
|
|
326
347
|
Pass a config path to load `defineSecretManager()` values into the mock:
|
|
@@ -407,14 +428,16 @@ Stub the global `tailordb.Client` and queue raw query results in order. Best for
|
|
|
407
428
|
|
|
408
429
|
> If you are running with the [`tailor-runtime` Vitest environment](#runtime-environment-emulation-beta), acquire `using db = mockTailordb()` to install and drive the mock `tailordb.Client` instead of `vi.stubGlobal()`.
|
|
409
430
|
|
|
431
|
+
> The example below uses `aroundAll` / `aroundEach`, which require Vitest ≥ 4.1.
|
|
432
|
+
|
|
410
433
|
```typescript
|
|
411
|
-
import {
|
|
434
|
+
import { aroundAll, aroundEach, describe, expect, test, vi } from "vitest";
|
|
412
435
|
import resolver from "../src/resolver/incrementUserAge";
|
|
413
436
|
|
|
414
437
|
describe("incrementUserAge resolver", () => {
|
|
415
438
|
const mockQueryObject = vi.fn();
|
|
416
439
|
|
|
417
|
-
|
|
440
|
+
aroundAll(async (runSuite) => {
|
|
418
441
|
vi.stubGlobal("tailordb", {
|
|
419
442
|
Client: vi.fn(
|
|
420
443
|
class {
|
|
@@ -424,9 +447,13 @@ describe("incrementUserAge resolver", () => {
|
|
|
424
447
|
},
|
|
425
448
|
),
|
|
426
449
|
});
|
|
450
|
+
await runSuite();
|
|
451
|
+
vi.unstubAllGlobals();
|
|
452
|
+
});
|
|
453
|
+
aroundEach(async (runTest) => {
|
|
454
|
+
await runTest();
|
|
455
|
+
mockQueryObject.mockReset();
|
|
427
456
|
});
|
|
428
|
-
afterAll(() => vi.unstubAllGlobals());
|
|
429
|
-
afterEach(() => mockQueryObject.mockReset());
|
|
430
457
|
|
|
431
458
|
test("increments age inside a transaction", async () => {
|
|
432
459
|
// BEGIN → SELECT → UPDATE → COMMIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tailor-platform/sdk",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Tailor Platform SDK - The SDK to work with Tailor Platform",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -140,12 +140,17 @@
|
|
|
140
140
|
"types": "./dist/runtime/aigateway.d.mts",
|
|
141
141
|
"import": "./dist/runtime/aigateway.mjs",
|
|
142
142
|
"default": "./dist/runtime/aigateway.mjs"
|
|
143
|
+
},
|
|
144
|
+
"./runtime/logger": {
|
|
145
|
+
"types": "./dist/runtime/logger.d.mts",
|
|
146
|
+
"import": "./dist/runtime/logger.mjs",
|
|
147
|
+
"default": "./dist/runtime/logger.mjs"
|
|
143
148
|
}
|
|
144
149
|
},
|
|
145
150
|
"dependencies": {
|
|
146
|
-
"@0no-co/graphql.web": "1.3.
|
|
151
|
+
"@0no-co/graphql.web": "1.3.3",
|
|
147
152
|
"@badgateway/oauth2-client": "3.3.1",
|
|
148
|
-
"@bufbuild/protobuf": "2.
|
|
153
|
+
"@bufbuild/protobuf": "2.13.0",
|
|
149
154
|
"@bufbuild/protovalidate": "1.2.0",
|
|
150
155
|
"@connectrpc/connect": "2.1.2",
|
|
151
156
|
"@connectrpc/connect-node": "2.1.2",
|
|
@@ -154,11 +159,13 @@
|
|
|
154
159
|
"@jridgewell/trace-mapping": "0.3.31",
|
|
155
160
|
"@napi-rs/keyring": "1.3.0",
|
|
156
161
|
"@opentelemetry/api": "1.9.1",
|
|
157
|
-
"@opentelemetry/exporter-trace-otlp-proto": "0.
|
|
158
|
-
"@opentelemetry/resources": "2.
|
|
159
|
-
"@opentelemetry/sdk-trace-node": "2.
|
|
162
|
+
"@opentelemetry/exporter-trace-otlp-proto": "0.221.0",
|
|
163
|
+
"@opentelemetry/resources": "2.10.0",
|
|
164
|
+
"@opentelemetry/sdk-trace-node": "2.10.0",
|
|
160
165
|
"@opentelemetry/semantic-conventions": "1.43.0",
|
|
161
|
-
"@oxc-project/types": "0.
|
|
166
|
+
"@oxc-project/types": "0.142.0",
|
|
167
|
+
"@secretlint/core": "13.0.4",
|
|
168
|
+
"@secretlint/secretlint-rule-preset-recommend": "13.0.4",
|
|
162
169
|
"@standard-schema/spec": "1.1.0",
|
|
163
170
|
"@tailor-platform/function-kysely-tailordb": "0.1.3",
|
|
164
171
|
"@toiroakr/lines-db": "0.10.1",
|
|
@@ -168,48 +175,48 @@
|
|
|
168
175
|
"chalk": "5.6.2",
|
|
169
176
|
"confbox": "0.2.4",
|
|
170
177
|
"date-fns": "4.4.0",
|
|
171
|
-
"es-toolkit": "1.
|
|
178
|
+
"es-toolkit": "1.50.0",
|
|
172
179
|
"find-up-simple": "1.0.1",
|
|
173
|
-
"
|
|
180
|
+
"get-east-asian-width": "1.6.0",
|
|
181
|
+
"get-tsconfig": "4.14.0",
|
|
182
|
+
"globals": "17.8.0",
|
|
174
183
|
"graphql": "17.0.2",
|
|
175
184
|
"inflection": "3.0.2",
|
|
176
|
-
"kysely": "0.29.
|
|
185
|
+
"kysely": "0.29.4",
|
|
177
186
|
"mime-types": "3.0.2",
|
|
178
187
|
"open": "11.0.0",
|
|
179
|
-
"oxc-parser": "0.
|
|
180
|
-
"p-limit": "7.3.
|
|
188
|
+
"oxc-parser": "0.142.0",
|
|
189
|
+
"p-limit": "7.3.1",
|
|
181
190
|
"pathe": "2.0.3",
|
|
182
191
|
"pgsql-ast-parser": "12.0.2",
|
|
183
192
|
"pkg-types": "2.3.1",
|
|
184
|
-
"politty": "0.11.
|
|
185
|
-
"rolldown": "1.
|
|
193
|
+
"politty": "0.11.6",
|
|
194
|
+
"rolldown": "1.2.0",
|
|
186
195
|
"semver": "7.8.5",
|
|
187
196
|
"sql-highlight": "6.1.0",
|
|
188
197
|
"std-env": "4.2.0",
|
|
189
|
-
"table": "6.9.0",
|
|
190
198
|
"ts-cron-validator": "1.1.5",
|
|
191
199
|
"type-fest": "5.8.0",
|
|
192
|
-
"undici": "8.7.0",
|
|
193
200
|
"xdg-basedir": "5.1.0",
|
|
194
201
|
"zod": "4.4.3"
|
|
195
202
|
},
|
|
196
203
|
"devDependencies": {
|
|
197
|
-
"@opentelemetry/sdk-trace-base": "2.
|
|
204
|
+
"@opentelemetry/sdk-trace-base": "2.10.0",
|
|
198
205
|
"@types/mime-types": "3.0.1",
|
|
199
206
|
"@types/node": "24.13.3",
|
|
200
207
|
"@types/semver": "7.7.1",
|
|
201
208
|
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
202
209
|
"@vitest/coverage-v8": "4.1.10",
|
|
203
210
|
"eslint-plugin-zod": "4.7.0",
|
|
204
|
-
"oxfmt": "0.
|
|
205
|
-
"oxlint": "1.
|
|
206
|
-
"oxlint-tsgolint": "0.
|
|
211
|
+
"oxfmt": "0.61.0",
|
|
212
|
+
"oxlint": "1.76.0",
|
|
213
|
+
"oxlint-tsgolint": "7.0.2001",
|
|
207
214
|
"sonda": "0.14.0",
|
|
208
|
-
"tsdown": "0.22.
|
|
215
|
+
"tsdown": "0.22.14",
|
|
209
216
|
"typescript": "6.0.3",
|
|
210
217
|
"vitest": "4.1.10",
|
|
211
|
-
"zinfer": "0.2.
|
|
212
|
-
"@tailor-platform/tailor-proto": "^0.0.
|
|
218
|
+
"zinfer": "0.2.7",
|
|
219
|
+
"@tailor-platform/tailor-proto": "^0.0.1"
|
|
213
220
|
},
|
|
214
221
|
"peerDependencies": {
|
|
215
222
|
"vite": "^6.0.0 || ^7.0.0 || ^8.0.0",
|
|
@@ -234,7 +241,7 @@
|
|
|
234
241
|
"test:coverage": "vitest --coverage",
|
|
235
242
|
"docs:check": "vitest run --project=unit* src/cli/docs.test.ts",
|
|
236
243
|
"docs:update": "POLITTY_DOCS_UPDATE=true vitest run --project=unit* src/cli/docs.test.ts",
|
|
237
|
-
"build": "tsdown && politty generate-worker --bin dist/cli/
|
|
244
|
+
"build": "tsdown && politty generate-shim --entry ./main.mjs --program tailor && politty generate-worker --bin dist/cli/main.mjs --program tailor --shell zsh --verify",
|
|
238
245
|
"lint": "oxlint --type-aware .",
|
|
239
246
|
"check:public-api-jsdoc": "node --experimental-strip-types scripts/check-public-api-jsdoc.ts",
|
|
240
247
|
"check:zod-isolation": "node --experimental-strip-types scripts/check-zod-isolation.ts",
|