@tailor-platform/create-sdk 2.2.0 → 2.4.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 (36) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/index.js +9 -7
  3. package/package.json +2 -2
  4. package/templates/executor/package.json +2 -2
  5. package/templates/executor/tailor.d.ts +3 -0
  6. package/templates/executor/tsconfig.json +1 -0
  7. package/templates/executor/vitest.config.ts +1 -1
  8. package/templates/generators/package.json +3 -3
  9. package/templates/generators/tailor.d.ts +3 -0
  10. package/templates/generators/tsconfig.json +1 -0
  11. package/templates/generators/vitest.config.ts +1 -1
  12. package/templates/hello-world/package.json +2 -2
  13. package/templates/hello-world/tailor.d.ts +1 -0
  14. package/templates/hello-world/tsconfig.json +1 -0
  15. package/templates/inventory-management/package.json +2 -2
  16. package/templates/inventory-management/tailor.d.ts +3 -0
  17. package/templates/inventory-management/tsconfig.json +1 -0
  18. package/templates/multi-application/package.json +2 -2
  19. package/templates/multi-application/tsconfig.json +1 -0
  20. package/templates/resolver/package.json +2 -2
  21. package/templates/resolver/tailor.d.ts +3 -0
  22. package/templates/resolver/tsconfig.json +1 -0
  23. package/templates/resolver/vitest.config.ts +1 -1
  24. package/templates/static-web-site/package.json +2 -2
  25. package/templates/static-web-site/tailor.d.ts +3 -0
  26. package/templates/static-web-site/tsconfig.json +1 -0
  27. package/templates/tailordb/README.md +1 -1
  28. package/templates/tailordb/package.json +2 -2
  29. package/templates/tailordb/src/db/task.test.ts +5 -5
  30. package/templates/tailordb/tailor.d.ts +3 -0
  31. package/templates/tailordb/tsconfig.json +1 -0
  32. package/templates/tailordb/vitest.config.ts +1 -1
  33. package/templates/workflow/package.json +2 -2
  34. package/templates/workflow/tailor.d.ts +3 -0
  35. package/templates/workflow/tsconfig.json +1 -0
  36. package/templates/workflow/vitest.config.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # @tailor-platform/create-sdk
2
2
 
3
+ ## 2.4.0
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2069](https://github.com/tailor-platform/sdk/pull/2069) [`d07a120`](https://github.com/tailor-platform/sdk/commit/d07a120950c5bac0bd8b5d2e341ad80dd6694448) Thanks [@dqn](https://github.com/dqn)! - The remaining published docs that named a `db.table()` definition a type now say table: the migration guide's rebaseline description, the testing guide's executor trigger description, and the create-sdk `tailordb` template README's feature list (`field-level and table-level` validations).
8
+
9
+ - [#2062](https://github.com/tailor-platform/sdk/pull/2062) [`153a780`](https://github.com/tailor-platform/sdk/commit/153a78038c65f4376f2f9f75eec8a7a37ea3f6dc) Thanks [@dqn](https://github.com/dqn)! - `tailor seed` now calls a `db.table()` definition a table instead of a type, in its help, progress, and errors — `Seeding 3 tables via Kysely batch insert`. The `fillSeedData` documentation and the `create-sdk` template hint follow.
10
+
11
+ Messages that list the seed targets say entities rather than tables, because `_User` is an IdP entity rather than a TailorDB table and can appear in the same list.
12
+
13
+ The positional is now named `entities`, so `--help` shows `[entities]` instead of `[types]`. Positionals are matched by argv order, so existing invocations are unaffected.
14
+
15
+ - [#2063](https://github.com/tailor-platform/sdk/pull/2063) [`5d16dc9`](https://github.com/tailor-platform/sdk/commit/5d16dc918f77bd4c76d0d90811207ec15ac30f4e) Thanks [@dqn](https://github.com/dqn)! - The remaining docs and editor tooltips now describe a `db.table()` definition as a table instead of a type. The TailorDB docs say table-level (matching the sentences around them that already say table), the file-upload runtime API documents its `typeName` parameters as table names, and the create-sdk tailordb template's test titles follow suit.
16
+
17
+ ## 2.3.0
18
+
19
+ ### Patch Changes
20
+
21
+ - [#2025](https://github.com/tailor-platform/sdk/pull/2025) [`2574bdd`](https://github.com/tailor-platform/sdk/commit/2574bdd69947b0f6e050c3c0af224fc3f18c6435) Thanks [@dqn](https://github.com/dqn)! - Template Vitest configs now collect migration script tests (`migrations/**/*.test.ts`) scaffolded by `tailordb migration script --with-test`.
22
+
23
+ - [#2023](https://github.com/tailor-platform/sdk/pull/2023) [`9dc826f`](https://github.com/tailor-platform/sdk/commit/9dc826fc0a83aa926de5b07245513f67c1ace877) Thanks [@dqn](https://github.com/dqn)! - Guide users through the v2 type-only import requirement. The CLI loads TypeScript by stripping types from each file in isolation, so a plain import of a type-only export fails at load time with `SyntaxError: ... does not provide an export named '<name>'` and no indication that the import form is the cause.
24
+
25
+ - The CLI now appends a suggestion to that error: import the name with `import type` and set `"verbatimModuleSyntax": true` in tsconfig.json to catch violations at typecheck.
26
+ - Projects scaffolded by `tailor init` now enable `verbatimModuleSyntax` in their tsconfig.json, so new projects catch violations at typecheck instead of at load time.
27
+ - The v2 migration guide gains a `v2/type-only-imports` entry documenting the requirement, the failure mode, and the migration steps, offered by `tailor upgrade` when crossing the v2 boundary.
28
+
3
29
  ## 2.2.0
4
30
 
5
31
  ### Minor Changes
package/dist/index.js CHANGED
@@ -18,7 +18,7 @@ const templateHints = {
18
18
  "hello-world": "Initial project to get started with Tailor Platform SDK",
19
19
  "inventory-management": "Simple inventory management system",
20
20
  "multi-application": "Multi-application setup with shared databases",
21
- tailordb: "Comprehensive TailorDB type definitions with all features",
21
+ tailordb: "Comprehensive TailorDB table definitions with all features",
22
22
  resolver: "Resolver patterns with testing (simple, DB, env, user)",
23
23
  workflow: "Workflow patterns with job chaining and testing",
24
24
  executor: "Executor trigger types (record, resolver, schedule, webhook)",
@@ -63,12 +63,13 @@ const collectContext = async ({ name, template }) => {
63
63
  name = ret;
64
64
  } else log.info(`📦 Project: ${name}`);
65
65
  if (!template) {
66
+ const options = (await availableTemplates()).map((value) => ({
67
+ value,
68
+ hint: templateHints[value]
69
+ }));
66
70
  const ret = await select({
67
71
  message: "🎨 Choose your template",
68
- options: (await availableTemplates()).map((value) => ({
69
- value,
70
- hint: templateHints[value]
71
- }))
72
+ options
72
73
  });
73
74
  if (isCancel(ret)) {
74
75
  cancel("Operation cancelled");
@@ -154,7 +155,7 @@ const initProject = async () => {
154
155
  //#region src/index.ts
155
156
  const main = async () => {
156
157
  const packageJson = await readPackageJSON(import.meta.url);
157
- await runMain(defineCommand({
158
+ const cmd = defineCommand({
158
159
  name: packageJson.name ?? "create-sdk",
159
160
  description: packageJson.description,
160
161
  args: z.object({
@@ -179,7 +180,8 @@ const main = async () => {
179
180
 
180
181
  ` + pc.dim("Learn more: https://docs.tailor.tech"));
181
182
  }
182
- }), { version: packageJson.version });
183
+ });
184
+ await runMain(cmd, { version: packageJson.version });
183
185
  };
184
186
  await main();
185
187
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-platform/create-sdk",
3
- "version": "2.2.0",
3
+ "version": "2.4.0",
4
4
  "description": "A CLI tool to quickly create a new Tailor Platform SDK project",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/node": "24.13.3",
29
- "eslint-plugin-zod": "4.9.0",
29
+ "eslint-plugin-zod": "4.9.1",
30
30
  "oxlint": "1.76.0",
31
31
  "oxlint-tsgolint": "7.0.2001",
32
32
  "tsdown": "0.22.14",
@@ -15,8 +15,8 @@
15
15
  "typecheck": "tsc --noEmit"
16
16
  },
17
17
  "devDependencies": {
18
- "@tailor-platform/eslint-plugin-sdk": "0.2.1",
19
- "@tailor-platform/sdk": "2.2.0",
18
+ "@tailor-platform/eslint-plugin-sdk": "0.2.2",
19
+ "@tailor-platform/sdk": "2.4.0",
20
20
  "@types/node": "24.13.3",
21
21
  "oxfmt": "0.61.0",
22
22
  "oxlint": "1.76.0",
@@ -18,6 +18,9 @@ declare module "@tailor-platform/sdk" {
18
18
  }
19
19
  interface ConnectionNameRegistry {}
20
20
  interface AIGatewayNameRegistry {}
21
+ interface AuthNamespaceNameRegistry {
22
+ "main-auth": true;
23
+ }
21
24
  }
22
25
 
23
26
  export {};
@@ -7,6 +7,7 @@
7
7
  "esModuleInterop": true,
8
8
  "allowJs": true,
9
9
  "strict": true,
10
+ "verbatimModuleSyntax": true,
10
11
  "noEmit": true,
11
12
  "skipLibCheck": true,
12
13
  "resolveJsonModule": true,
@@ -11,7 +11,7 @@ export default defineConfig({
11
11
  test: {
12
12
  name: { label: "unit", color: "blue" },
13
13
  environment: "tailor-runtime",
14
- include: ["src/**/*.test.ts"],
14
+ include: ["src/**/*.test.ts", "migrations/**/*.test.ts"],
15
15
  },
16
16
  },
17
17
  ],
@@ -18,9 +18,9 @@
18
18
  "typecheck": "tsc --noEmit"
19
19
  },
20
20
  "devDependencies": {
21
- "@tailor-platform/eslint-plugin-sdk": "0.2.1",
22
- "@tailor-platform/sdk": "2.2.0",
23
- "@tailor-platform/sdk-plugin-seed": "0.2.0",
21
+ "@tailor-platform/eslint-plugin-sdk": "0.2.2",
22
+ "@tailor-platform/sdk": "2.4.0",
23
+ "@tailor-platform/sdk-plugin-seed": "0.2.2",
24
24
  "@types/node": "24.13.3",
25
25
  "oxfmt": "0.61.0",
26
26
  "oxlint": "1.76.0",
@@ -18,6 +18,9 @@ declare module "@tailor-platform/sdk" {
18
18
  }
19
19
  interface ConnectionNameRegistry {}
20
20
  interface AIGatewayNameRegistry {}
21
+ interface AuthNamespaceNameRegistry {
22
+ "main-auth": true;
23
+ }
21
24
  }
22
25
 
23
26
  export {};
@@ -7,6 +7,7 @@
7
7
  "esModuleInterop": true,
8
8
  "allowJs": true,
9
9
  "strict": true,
10
+ "verbatimModuleSyntax": true,
10
11
  "noEmit": true,
11
12
  "skipLibCheck": true,
12
13
  "resolveJsonModule": true,
@@ -11,7 +11,7 @@ export default defineConfig({
11
11
  test: {
12
12
  name: { label: "unit", color: "blue" },
13
13
  environment: "tailor-runtime",
14
- include: ["src/**/*.test.ts"],
14
+ include: ["src/**/*.test.ts", "migrations/**/*.test.ts"],
15
15
  },
16
16
  },
17
17
  ],
@@ -13,8 +13,8 @@
13
13
  "typecheck": "tsc --noEmit"
14
14
  },
15
15
  "devDependencies": {
16
- "@tailor-platform/eslint-plugin-sdk": "0.2.1",
17
- "@tailor-platform/sdk": "2.2.0",
16
+ "@tailor-platform/eslint-plugin-sdk": "0.2.2",
17
+ "@tailor-platform/sdk": "2.4.0",
18
18
  "@types/node": "24.13.3",
19
19
  "oxfmt": "0.61.0",
20
20
  "oxlint": "1.76.0",
@@ -12,6 +12,7 @@ declare module "@tailor-platform/sdk" {
12
12
  interface IdpNameRegistry {}
13
13
  interface ConnectionNameRegistry {}
14
14
  interface AIGatewayNameRegistry {}
15
+ interface AuthNamespaceNameRegistry {}
15
16
  }
16
17
 
17
18
  export {};
@@ -7,6 +7,7 @@
7
7
  "esModuleInterop": true,
8
8
  "allowJs": true,
9
9
  "strict": true,
10
+ "verbatimModuleSyntax": true,
10
11
  "noEmit": true,
11
12
  "skipLibCheck": true,
12
13
  "resolveJsonModule": true,
@@ -13,8 +13,8 @@
13
13
  "typecheck": "tsc --noEmit"
14
14
  },
15
15
  "devDependencies": {
16
- "@tailor-platform/eslint-plugin-sdk": "0.2.1",
17
- "@tailor-platform/sdk": "2.2.0",
16
+ "@tailor-platform/eslint-plugin-sdk": "0.2.2",
17
+ "@tailor-platform/sdk": "2.4.0",
18
18
  "@types/node": "24.13.3",
19
19
  "oxfmt": "0.61.0",
20
20
  "oxlint": "1.76.0",
@@ -17,6 +17,9 @@ declare module "@tailor-platform/sdk" {
17
17
  interface IdpNameRegistry {}
18
18
  interface ConnectionNameRegistry {}
19
19
  interface AIGatewayNameRegistry {}
20
+ interface AuthNamespaceNameRegistry {
21
+ "main-auth": true;
22
+ }
20
23
  }
21
24
 
22
25
  export {};
@@ -7,6 +7,7 @@
7
7
  "esModuleInterop": true,
8
8
  "allowJs": true,
9
9
  "strict": true,
10
+ "verbatimModuleSyntax": true,
10
11
  "noEmit": true,
11
12
  "skipLibCheck": true,
12
13
  "resolveJsonModule": true,
@@ -14,8 +14,8 @@
14
14
  "typecheck": "tsc --noEmit"
15
15
  },
16
16
  "devDependencies": {
17
- "@tailor-platform/eslint-plugin-sdk": "0.2.1",
18
- "@tailor-platform/sdk": "2.2.0",
17
+ "@tailor-platform/eslint-plugin-sdk": "0.2.2",
18
+ "@tailor-platform/sdk": "2.4.0",
19
19
  "@types/node": "24.13.3",
20
20
  "oxfmt": "0.61.0",
21
21
  "oxlint": "1.76.0",
@@ -7,6 +7,7 @@
7
7
  "esModuleInterop": true,
8
8
  "allowJs": true,
9
9
  "strict": true,
10
+ "verbatimModuleSyntax": true,
10
11
  "noEmit": true,
11
12
  "skipLibCheck": true,
12
13
  "resolveJsonModule": true,
@@ -15,8 +15,8 @@
15
15
  "typecheck": "tsc --noEmit"
16
16
  },
17
17
  "devDependencies": {
18
- "@tailor-platform/eslint-plugin-sdk": "0.2.1",
19
- "@tailor-platform/sdk": "2.2.0",
18
+ "@tailor-platform/eslint-plugin-sdk": "0.2.2",
19
+ "@tailor-platform/sdk": "2.4.0",
20
20
  "@types/node": "24.13.3",
21
21
  "oxfmt": "0.61.0",
22
22
  "oxlint": "1.76.0",
@@ -19,6 +19,9 @@ declare module "@tailor-platform/sdk" {
19
19
  interface IdpNameRegistry {}
20
20
  interface ConnectionNameRegistry {}
21
21
  interface AIGatewayNameRegistry {}
22
+ interface AuthNamespaceNameRegistry {
23
+ "main-auth": true;
24
+ }
22
25
  }
23
26
 
24
27
  export {};
@@ -7,6 +7,7 @@
7
7
  "esModuleInterop": true,
8
8
  "allowJs": true,
9
9
  "strict": true,
10
+ "verbatimModuleSyntax": true,
10
11
  "noEmit": true,
11
12
  "skipLibCheck": true,
12
13
  "resolveJsonModule": true,
@@ -11,7 +11,7 @@ export default defineConfig({
11
11
  test: {
12
12
  name: { label: "unit", color: "blue" },
13
13
  environment: "tailor-runtime",
14
- include: ["src/**/*.test.ts"],
14
+ include: ["src/**/*.test.ts", "migrations/**/*.test.ts"],
15
15
  },
16
16
  },
17
17
  ],
@@ -13,8 +13,8 @@
13
13
  "typecheck": "tsc --noEmit"
14
14
  },
15
15
  "devDependencies": {
16
- "@tailor-platform/eslint-plugin-sdk": "0.2.1",
17
- "@tailor-platform/sdk": "2.2.0",
16
+ "@tailor-platform/eslint-plugin-sdk": "0.2.2",
17
+ "@tailor-platform/sdk": "2.4.0",
18
18
  "@types/node": "24.13.3",
19
19
  "oxfmt": "0.61.0",
20
20
  "oxlint": "1.76.0",
@@ -18,6 +18,9 @@ declare module "@tailor-platform/sdk" {
18
18
  }
19
19
  interface ConnectionNameRegistry {}
20
20
  interface AIGatewayNameRegistry {}
21
+ interface AuthNamespaceNameRegistry {
22
+ "my-auth": true;
23
+ }
21
24
  }
22
25
 
23
26
  export {};
@@ -7,6 +7,7 @@
7
7
  "esModuleInterop": true,
8
8
  "allowJs": true,
9
9
  "strict": true,
10
+ "verbatimModuleSyntax": true,
10
11
  "noEmit": true,
11
12
  "skipLibCheck": true,
12
13
  "resolveJsonModule": true,
@@ -6,7 +6,7 @@ Comprehensive TailorDB table definitions demonstrating all features of `db.table
6
6
 
7
7
  - All field types (string, int, float, datetime, uuid, enum, boolean)
8
8
  - Relations (n-1, self-referential)
9
- - Validations (field-level and type-level)
9
+ - Validations (field-level and table-level)
10
10
  - Hooks (computed fields)
11
11
  - File attachments
12
12
  - Composite indexes
@@ -15,8 +15,8 @@
15
15
  "typecheck": "tsc --noEmit"
16
16
  },
17
17
  "devDependencies": {
18
- "@tailor-platform/eslint-plugin-sdk": "0.2.1",
19
- "@tailor-platform/sdk": "2.2.0",
18
+ "@tailor-platform/eslint-plugin-sdk": "0.2.2",
19
+ "@tailor-platform/sdk": "2.4.0",
20
20
  "@types/node": "24.13.3",
21
21
  "oxfmt": "0.61.0",
22
22
  "oxlint": "1.76.0",
@@ -4,8 +4,8 @@ import { user } from "./user";
4
4
  import { category } from "./category";
5
5
  import { comment } from "./comment";
6
6
 
7
- describe("TailorDB type definitions", () => {
8
- test("task type has expected fields", () => {
7
+ describe("TailorDB table definitions", () => {
8
+ test("task table has expected fields", () => {
9
9
  const { fields } = task;
10
10
  expect(fields).toHaveProperty("title");
11
11
  expect(fields).toHaveProperty("status");
@@ -16,7 +16,7 @@ describe("TailorDB type definitions", () => {
16
16
  expect(fields).toHaveProperty("isArchived");
17
17
  });
18
18
 
19
- test("user type has expected fields", () => {
19
+ test("user table has expected fields", () => {
20
20
  const { fields } = user;
21
21
  expect(fields).toHaveProperty("name");
22
22
  expect(fields).toHaveProperty("email");
@@ -24,14 +24,14 @@ describe("TailorDB type definitions", () => {
24
24
  expect(fields).toHaveProperty("bio");
25
25
  });
26
26
 
27
- test("category type has expected fields", () => {
27
+ test("category table has expected fields", () => {
28
28
  const { fields } = category;
29
29
  expect(fields).toHaveProperty("name");
30
30
  expect(fields).toHaveProperty("description");
31
31
  expect(fields).toHaveProperty("parentCategoryId");
32
32
  });
33
33
 
34
- test("comment type has expected fields", () => {
34
+ test("comment table has expected fields", () => {
35
35
  const { fields } = comment;
36
36
  expect(fields).toHaveProperty("body");
37
37
  expect(fields).toHaveProperty("taskId");
@@ -17,6 +17,9 @@ declare module "@tailor-platform/sdk" {
17
17
  interface IdpNameRegistry {}
18
18
  interface ConnectionNameRegistry {}
19
19
  interface AIGatewayNameRegistry {}
20
+ interface AuthNamespaceNameRegistry {
21
+ "main-auth": true;
22
+ }
20
23
  }
21
24
 
22
25
  export {};
@@ -7,6 +7,7 @@
7
7
  "esModuleInterop": true,
8
8
  "allowJs": true,
9
9
  "strict": true,
10
+ "verbatimModuleSyntax": true,
10
11
  "noEmit": true,
11
12
  "skipLibCheck": true,
12
13
  "resolveJsonModule": true,
@@ -11,7 +11,7 @@ export default defineConfig({
11
11
  test: {
12
12
  name: { label: "unit", color: "blue" },
13
13
  environment: "tailor-runtime",
14
- include: ["src/**/*.test.ts"],
14
+ include: ["src/**/*.test.ts", "migrations/**/*.test.ts"],
15
15
  },
16
16
  },
17
17
  ],
@@ -16,8 +16,8 @@
16
16
  "typecheck": "tsc --noEmit"
17
17
  },
18
18
  "devDependencies": {
19
- "@tailor-platform/eslint-plugin-sdk": "0.2.1",
20
- "@tailor-platform/sdk": "2.2.0",
19
+ "@tailor-platform/eslint-plugin-sdk": "0.2.2",
20
+ "@tailor-platform/sdk": "2.4.0",
21
21
  "@types/node": "24.13.3",
22
22
  "graphql": "17.0.2",
23
23
  "graphql-request": "7.4.0",
@@ -16,6 +16,9 @@ declare module "@tailor-platform/sdk" {
16
16
  interface IdpNameRegistry {}
17
17
  interface ConnectionNameRegistry {}
18
18
  interface AIGatewayNameRegistry {}
19
+ interface AuthNamespaceNameRegistry {
20
+ "main-auth": true;
21
+ }
19
22
  }
20
23
 
21
24
  export {};
@@ -7,6 +7,7 @@
7
7
  "esModuleInterop": true,
8
8
  "allowJs": true,
9
9
  "strict": true,
10
+ "verbatimModuleSyntax": true,
10
11
  "noEmit": true,
11
12
  "skipLibCheck": true,
12
13
  "resolveJsonModule": true,
@@ -11,7 +11,7 @@ export default defineConfig({
11
11
  test: {
12
12
  name: { label: "unit", color: "blue" },
13
13
  environment: "tailor-runtime",
14
- include: ["src/**/*.test.ts"],
14
+ include: ["src/**/*.test.ts", "migrations/**/*.test.ts"],
15
15
  },
16
16
  },
17
17
  {