@tailor-platform/create-sdk 1.51.2 → 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 CHANGED
@@ -1,5 +1,24 @@
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
+
3
22
  ## 1.51.2
4
23
 
5
24
  ## 1.51.1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-platform/create-sdk",
3
- "version": "1.51.2",
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.4.15",
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.61.0",
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,10 +14,10 @@
14
14
  "typecheck": "tsc --noEmit"
15
15
  },
16
16
  "devDependencies": {
17
- "@tailor-platform/sdk": "1.51.2",
17
+ "@tailor-platform/sdk": "1.52.0",
18
18
  "@types/node": "24.12.4",
19
- "oxfmt": "0.46.0",
20
- "oxlint": "1.61.0",
19
+ "oxfmt": "0.51.0",
20
+ "oxlint": "1.66.0",
21
21
  "oxlint-tsgolint": "0.23.0",
22
22
  "typescript": "5.9.3",
23
23
  "vitest": "4.1.7"
@@ -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
- const createAuditLog = vi.spyOn(shared, "createAuditLog").mockResolvedValue(undefined);
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,10 +14,10 @@
14
14
  "typecheck": "tsc --noEmit"
15
15
  },
16
16
  "devDependencies": {
17
- "@tailor-platform/sdk": "1.51.2",
17
+ "@tailor-platform/sdk": "1.52.0",
18
18
  "@types/node": "24.12.4",
19
- "oxfmt": "0.46.0",
20
- "oxlint": "1.61.0",
19
+ "oxfmt": "0.51.0",
20
+ "oxlint": "1.66.0",
21
21
  "oxlint-tsgolint": "0.23.0",
22
22
  "typescript": "5.9.3",
23
23
  "vitest": "4.1.7"
@@ -12,10 +12,10 @@
12
12
  "typecheck": "tsc --noEmit"
13
13
  },
14
14
  "devDependencies": {
15
- "@tailor-platform/sdk": "1.51.2",
15
+ "@tailor-platform/sdk": "1.52.0",
16
16
  "@types/node": "24.12.4",
17
- "oxfmt": "0.46.0",
18
- "oxlint": "1.61.0",
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.51.2",
15
+ "@tailor-platform/sdk": "1.52.0",
16
16
  "@types/node": "24.12.4",
17
- "oxfmt": "0.46.0",
18
- "oxlint": "1.61.0",
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.51.2",
16
+ "@tailor-platform/sdk": "1.52.0",
17
17
  "@types/node": "24.12.4",
18
- "oxfmt": "0.46.0",
19
- "oxlint": "1.61.0",
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,10 +14,10 @@
14
14
  "typecheck": "tsc --noEmit"
15
15
  },
16
16
  "devDependencies": {
17
- "@tailor-platform/sdk": "1.51.2",
17
+ "@tailor-platform/sdk": "1.52.0",
18
18
  "@types/node": "24.12.4",
19
- "oxfmt": "0.46.0",
20
- "oxlint": "1.61.0",
19
+ "oxfmt": "0.51.0",
20
+ "oxlint": "1.66.0",
21
21
  "oxlint-tsgolint": "0.23.0",
22
22
  "typescript": "5.9.3",
23
23
  "vitest": "4.1.7"
@@ -12,10 +12,10 @@
12
12
  "typecheck": "tsc --noEmit"
13
13
  },
14
14
  "devDependencies": {
15
- "@tailor-platform/sdk": "1.51.2",
15
+ "@tailor-platform/sdk": "1.52.0",
16
16
  "@types/node": "24.12.4",
17
- "oxfmt": "0.46.0",
18
- "oxlint": "1.61.0",
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,10 +14,10 @@
14
14
  "typecheck": "tsc --noEmit"
15
15
  },
16
16
  "devDependencies": {
17
- "@tailor-platform/sdk": "1.51.2",
17
+ "@tailor-platform/sdk": "1.52.0",
18
18
  "@types/node": "24.12.4",
19
- "oxfmt": "0.46.0",
20
- "oxlint": "1.61.0",
19
+ "oxfmt": "0.51.0",
20
+ "oxlint": "1.66.0",
21
21
  "oxlint-tsgolint": "0.23.0",
22
22
  "typescript": "5.9.3",
23
23
  "vitest": "4.1.7"
@@ -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 `WORKFLOW_TEST_ENV_KEY`
10
+ - Integration testing with `workflow.mainJob.trigger()`
11
11
 
12
12
  ## Getting Started
13
13
 
@@ -15,12 +15,12 @@
15
15
  "typecheck": "tsc --noEmit"
16
16
  },
17
17
  "devDependencies": {
18
- "@tailor-platform/sdk": "1.51.2",
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.46.0",
23
- "oxlint": "1.61.0",
22
+ "oxfmt": "0.51.0",
23
+ "oxlint": "1.66.0",
24
24
  "oxlint-tsgolint": "0.23.0",
25
25
  "typescript": "5.9.3",
26
26
  "vitest": "4.1.7"
@@ -1,4 +1,4 @@
1
- import { WORKFLOW_TEST_ENV_KEY } from "@tailor-platform/sdk/test";
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
- vi.unstubAllEnvs();
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,