@tailor-platform/create-sdk 1.51.1 → 1.52.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 +21 -0
- package/package.json +5 -5
- package/templates/executor/package.json +4 -4
- package/templates/executor/src/executor/onUserCreated.test.ts +1 -1
- package/templates/generators/package.json +4 -4
- package/templates/hello-world/package.json +3 -3
- package/templates/inventory-management/package.json +3 -3
- package/templates/multi-application/package.json +3 -3
- package/templates/resolver/package.json +4 -4
- package/templates/static-web-site/package.json +3 -3
- package/templates/tailordb/package.json +4 -4
- package/templates/workflow/README.md +1 -1
- package/templates/workflow/package.json +4 -4
- package/templates/workflow/src/workflow/order-fulfillment.test.ts +8 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @tailor-platform/create-sdk
|
|
2
2
|
|
|
3
|
+
## 1.52.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1186](https://github.com/tailor-platform/sdk/pull/1186) [`57e00d6`](https://github.com/tailor-platform/sdk/commit/57e00d6bfc2f9602af0ac9c0235da6ec0e04b12e) Thanks [@toiroakr](https://github.com/toiroakr)! - Add `workflowMock.setEnv()` to control the `env` value passed to job bodies when `createWorkflowJob().trigger()` is invoked locally. Tests using the `tailor-runtime` Vitest environment can now configure the env through the same `workflowMock` helper they use for `setJobHandler` / `setWaitHandler`, without touching `process.env`.
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import { workflowMock } from "@tailor-platform/sdk/vitest";
|
|
11
|
+
|
|
12
|
+
afterEach(() => workflowMock.reset());
|
|
13
|
+
|
|
14
|
+
test("workflow.mainJob.trigger() executes all jobs", async () => {
|
|
15
|
+
workflowMock.setEnv({ STAGE: "test" });
|
|
16
|
+
await workflow.mainJob.trigger({ orderId: "order-1", amount: 100 });
|
|
17
|
+
});
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The previous env-var-based pattern is now deprecated. A non-breaking fallback is retained, but `workflowMock.setEnv()` takes priority when both are set.
|
|
21
|
+
|
|
22
|
+
## 1.51.2
|
|
23
|
+
|
|
3
24
|
## 1.51.1
|
|
4
25
|
|
|
5
26
|
## 1.51.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tailor-platform/create-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.52.0",
|
|
4
4
|
"description": "A CLI tool to quickly create a new Tailor Platform SDK project",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -21,20 +21,20 @@
|
|
|
21
21
|
"execa": "9.6.1",
|
|
22
22
|
"picocolors": "1.1.1",
|
|
23
23
|
"pkg-types": "2.3.1",
|
|
24
|
-
"politty": "0.
|
|
24
|
+
"politty": "0.5.0",
|
|
25
25
|
"zod": "4.4.3"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "24.12.4",
|
|
29
|
-
"oxlint": "1.
|
|
29
|
+
"oxlint": "1.66.0",
|
|
30
30
|
"oxlint-tsgolint": "0.23.0",
|
|
31
31
|
"tsdown": "0.22.0",
|
|
32
32
|
"typescript": "5.9.3"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "tsdown",
|
|
36
|
-
"lint": "oxlint --type-aware .",
|
|
37
|
-
"lint:fix": "oxlint --type-aware . --fix",
|
|
36
|
+
"lint": "oxlint --type-aware . --ignore-pattern \"templates/**\"",
|
|
37
|
+
"lint:fix": "oxlint --type-aware . --ignore-pattern \"templates/**\" --fix",
|
|
38
38
|
"typecheck": "tsc --noEmit",
|
|
39
39
|
"prepublish": "node scripts/prepare-templates.js && pnpm run build",
|
|
40
40
|
"publint": "publint --strict"
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"typecheck": "tsc --noEmit"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@tailor-platform/sdk": "1.
|
|
17
|
+
"@tailor-platform/sdk": "1.52.0",
|
|
18
18
|
"@types/node": "24.12.4",
|
|
19
|
-
"oxfmt": "0.
|
|
20
|
-
"oxlint": "1.
|
|
19
|
+
"oxfmt": "0.51.0",
|
|
20
|
+
"oxlint": "1.66.0",
|
|
21
21
|
"oxlint-tsgolint": "0.23.0",
|
|
22
22
|
"typescript": "5.9.3",
|
|
23
|
-
"vitest": "4.1.
|
|
23
|
+
"vitest": "4.1.7"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -4,7 +4,7 @@ import * as shared from "./shared";
|
|
|
4
4
|
|
|
5
5
|
describe("onUserCreated executor", () => {
|
|
6
6
|
test("creates an audit log with the new user's name and email", async () => {
|
|
7
|
-
|
|
7
|
+
using createAuditLog = vi.spyOn(shared, "createAuditLog").mockResolvedValue(undefined);
|
|
8
8
|
|
|
9
9
|
if (onUserCreated.operation.kind !== "function") {
|
|
10
10
|
throw new Error("expected function operation");
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"typecheck": "tsc --noEmit"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@tailor-platform/sdk": "1.
|
|
17
|
+
"@tailor-platform/sdk": "1.52.0",
|
|
18
18
|
"@types/node": "24.12.4",
|
|
19
|
-
"oxfmt": "0.
|
|
20
|
-
"oxlint": "1.
|
|
19
|
+
"oxfmt": "0.51.0",
|
|
20
|
+
"oxlint": "1.66.0",
|
|
21
21
|
"oxlint-tsgolint": "0.23.0",
|
|
22
22
|
"typescript": "5.9.3",
|
|
23
|
-
"vitest": "4.1.
|
|
23
|
+
"vitest": "4.1.7"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"typecheck": "tsc --noEmit"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@tailor-platform/sdk": "1.
|
|
15
|
+
"@tailor-platform/sdk": "1.52.0",
|
|
16
16
|
"@types/node": "24.12.4",
|
|
17
|
-
"oxfmt": "0.
|
|
18
|
-
"oxlint": "1.
|
|
17
|
+
"oxfmt": "0.51.0",
|
|
18
|
+
"oxlint": "1.66.0",
|
|
19
19
|
"oxlint-tsgolint": "0.23.0",
|
|
20
20
|
"typescript": "5.9.3"
|
|
21
21
|
}
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"typecheck": "tsc --noEmit"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@tailor-platform/sdk": "1.
|
|
15
|
+
"@tailor-platform/sdk": "1.52.0",
|
|
16
16
|
"@types/node": "24.12.4",
|
|
17
|
-
"oxfmt": "0.
|
|
18
|
-
"oxlint": "1.
|
|
17
|
+
"oxfmt": "0.51.0",
|
|
18
|
+
"oxlint": "1.66.0",
|
|
19
19
|
"oxlint-tsgolint": "0.23.0",
|
|
20
20
|
"typescript": "5.9.3"
|
|
21
21
|
}
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
"typecheck": "tsc --noEmit"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@tailor-platform/sdk": "1.
|
|
16
|
+
"@tailor-platform/sdk": "1.52.0",
|
|
17
17
|
"@types/node": "24.12.4",
|
|
18
|
-
"oxfmt": "0.
|
|
19
|
-
"oxlint": "1.
|
|
18
|
+
"oxfmt": "0.51.0",
|
|
19
|
+
"oxlint": "1.66.0",
|
|
20
20
|
"oxlint-tsgolint": "0.23.0",
|
|
21
21
|
"typescript": "5.9.3"
|
|
22
22
|
}
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"typecheck": "tsc --noEmit"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@tailor-platform/sdk": "1.
|
|
17
|
+
"@tailor-platform/sdk": "1.52.0",
|
|
18
18
|
"@types/node": "24.12.4",
|
|
19
|
-
"oxfmt": "0.
|
|
20
|
-
"oxlint": "1.
|
|
19
|
+
"oxfmt": "0.51.0",
|
|
20
|
+
"oxlint": "1.66.0",
|
|
21
21
|
"oxlint-tsgolint": "0.23.0",
|
|
22
22
|
"typescript": "5.9.3",
|
|
23
|
-
"vitest": "4.1.
|
|
23
|
+
"vitest": "4.1.7"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"typecheck": "tsc --noEmit"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@tailor-platform/sdk": "1.
|
|
15
|
+
"@tailor-platform/sdk": "1.52.0",
|
|
16
16
|
"@types/node": "24.12.4",
|
|
17
|
-
"oxfmt": "0.
|
|
18
|
-
"oxlint": "1.
|
|
17
|
+
"oxfmt": "0.51.0",
|
|
18
|
+
"oxlint": "1.66.0",
|
|
19
19
|
"oxlint-tsgolint": "0.23.0",
|
|
20
20
|
"typescript": "5.9.3"
|
|
21
21
|
}
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"typecheck": "tsc --noEmit"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@tailor-platform/sdk": "1.
|
|
17
|
+
"@tailor-platform/sdk": "1.52.0",
|
|
18
18
|
"@types/node": "24.12.4",
|
|
19
|
-
"oxfmt": "0.
|
|
20
|
-
"oxlint": "1.
|
|
19
|
+
"oxfmt": "0.51.0",
|
|
20
|
+
"oxlint": "1.66.0",
|
|
21
21
|
"oxlint-tsgolint": "0.23.0",
|
|
22
22
|
"typescript": "5.9.3",
|
|
23
|
-
"vitest": "4.1.
|
|
23
|
+
"vitest": "4.1.7"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -7,7 +7,7 @@ Demonstrates workflow patterns with job chaining, trigger testing, and dependenc
|
|
|
7
7
|
- Workflow with multiple jobs (`createWorkflow`, `createWorkflowJob`)
|
|
8
8
|
- Job chaining via `.trigger()`
|
|
9
9
|
- Database operations in workflow jobs (DI pattern)
|
|
10
|
-
- Integration testing with `
|
|
10
|
+
- Integration testing with `workflow.mainJob.trigger()`
|
|
11
11
|
|
|
12
12
|
## Getting Started
|
|
13
13
|
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
"typecheck": "tsc --noEmit"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@tailor-platform/sdk": "1.
|
|
18
|
+
"@tailor-platform/sdk": "1.52.0",
|
|
19
19
|
"@types/node": "24.12.4",
|
|
20
20
|
"graphql": "16.14.0",
|
|
21
21
|
"graphql-request": "7.4.0",
|
|
22
|
-
"oxfmt": "0.
|
|
23
|
-
"oxlint": "1.
|
|
22
|
+
"oxfmt": "0.51.0",
|
|
23
|
+
"oxlint": "1.66.0",
|
|
24
24
|
"oxlint-tsgolint": "0.23.0",
|
|
25
25
|
"typescript": "5.9.3",
|
|
26
|
-
"vitest": "4.1.
|
|
26
|
+
"vitest": "4.1.7"
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { workflowMock } from "@tailor-platform/sdk/vitest";
|
|
2
2
|
import { afterEach, describe, expect, test, vi } from "vitest";
|
|
3
3
|
import workflow, {
|
|
4
4
|
fulfillOrder,
|
|
@@ -9,8 +9,7 @@ import workflow, {
|
|
|
9
9
|
|
|
10
10
|
describe("order fulfillment workflow", () => {
|
|
11
11
|
afterEach(() => {
|
|
12
|
-
|
|
13
|
-
vi.restoreAllMocks();
|
|
12
|
+
workflowMock.reset();
|
|
14
13
|
});
|
|
15
14
|
|
|
16
15
|
describe("individual job tests with .body()", () => {
|
|
@@ -49,16 +48,16 @@ describe("order fulfillment workflow", () => {
|
|
|
49
48
|
|
|
50
49
|
describe("orchestration tests with mocked triggers", () => {
|
|
51
50
|
test("fulfillOrder chains all jobs", async () => {
|
|
52
|
-
vi.spyOn(validateOrder, "trigger").mockResolvedValue({
|
|
51
|
+
using _validateSpy = vi.spyOn(validateOrder, "trigger").mockResolvedValue({
|
|
53
52
|
valid: true,
|
|
54
53
|
orderId: "order-1",
|
|
55
54
|
});
|
|
56
|
-
vi.spyOn(processPayment, "trigger").mockResolvedValue({
|
|
55
|
+
using _paymentSpy = vi.spyOn(processPayment, "trigger").mockResolvedValue({
|
|
57
56
|
transactionId: "txn-order-1",
|
|
58
57
|
amount: 100,
|
|
59
58
|
status: "completed" as const,
|
|
60
59
|
});
|
|
61
|
-
vi.spyOn(sendConfirmation, "trigger").mockResolvedValue({
|
|
60
|
+
using _confirmSpy = vi.spyOn(sendConfirmation, "trigger").mockResolvedValue({
|
|
62
61
|
orderId: "order-1",
|
|
63
62
|
transactionId: "txn-order-1",
|
|
64
63
|
confirmed: true,
|
|
@@ -87,16 +86,16 @@ describe("order fulfillment workflow", () => {
|
|
|
87
86
|
});
|
|
88
87
|
|
|
89
88
|
test("workflow.mainJob.body() chains all jobs", async () => {
|
|
90
|
-
vi.spyOn(validateOrder, "trigger").mockResolvedValue({
|
|
89
|
+
using _validateSpy = vi.spyOn(validateOrder, "trigger").mockResolvedValue({
|
|
91
90
|
valid: true,
|
|
92
91
|
orderId: "order-2",
|
|
93
92
|
});
|
|
94
|
-
vi.spyOn(processPayment, "trigger").mockResolvedValue({
|
|
93
|
+
using _paymentSpy = vi.spyOn(processPayment, "trigger").mockResolvedValue({
|
|
95
94
|
transactionId: "txn-order-2",
|
|
96
95
|
amount: 200,
|
|
97
96
|
status: "completed" as const,
|
|
98
97
|
});
|
|
99
|
-
vi.spyOn(sendConfirmation, "trigger").mockResolvedValue({
|
|
98
|
+
using _confirmSpy = vi.spyOn(sendConfirmation, "trigger").mockResolvedValue({
|
|
100
99
|
orderId: "order-2",
|
|
101
100
|
transactionId: "txn-order-2",
|
|
102
101
|
confirmed: true,
|
|
@@ -115,8 +114,6 @@ describe("order fulfillment workflow", () => {
|
|
|
115
114
|
|
|
116
115
|
describe("integration tests with .trigger()", () => {
|
|
117
116
|
test("workflow.mainJob.trigger() executes all jobs", async () => {
|
|
118
|
-
vi.stubEnv(WORKFLOW_TEST_ENV_KEY, JSON.stringify({}));
|
|
119
|
-
|
|
120
117
|
const result = await workflow.mainJob.trigger({
|
|
121
118
|
orderId: "order-3",
|
|
122
119
|
amount: 300,
|