@tailor-platform/create-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 (31) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +1 -1
  3. package/package.json +1 -1
  4. package/templates/executor/package.json +2 -2
  5. package/templates/executor/tsconfig.json +1 -0
  6. package/templates/executor/vitest.config.ts +1 -1
  7. package/templates/generators/package.json +4 -3
  8. package/templates/generators/src/seed/data/Category.schema.ts +2 -2
  9. package/templates/generators/src/seed/data/Order.schema.ts +2 -2
  10. package/templates/generators/src/seed/data/Product.schema.ts +2 -2
  11. package/templates/generators/src/seed/data/User.schema.ts +2 -2
  12. package/templates/generators/tsconfig.json +1 -0
  13. package/templates/generators/vitest.config.ts +1 -1
  14. package/templates/hello-world/package.json +2 -2
  15. package/templates/hello-world/tsconfig.json +1 -0
  16. package/templates/inventory-management/package.json +2 -2
  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/tsconfig.json +1 -0
  22. package/templates/resolver/vitest.config.ts +1 -1
  23. package/templates/static-web-site/package.json +2 -2
  24. package/templates/static-web-site/tsconfig.json +1 -0
  25. package/templates/tailordb/README.md +1 -1
  26. package/templates/tailordb/package.json +2 -2
  27. package/templates/tailordb/tsconfig.json +1 -0
  28. package/templates/tailordb/vitest.config.ts +1 -1
  29. package/templates/workflow/package.json +2 -2
  30. package/templates/workflow/tsconfig.json +1 -0
  31. package/templates/workflow/vitest.config.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,56 @@
1
1
  # @tailor-platform/create-sdk
2
2
 
3
+ ## 2.3.0
4
+
5
+ ### Patch Changes
6
+
7
+ - [#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`.
8
+
9
+ - [#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.
10
+
11
+ - 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.
12
+ - Projects scaffolded by `tailor init` now enable `verbatimModuleSyntax` in their tsconfig.json, so new projects catch violations at typecheck instead of at load time.
13
+ - 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.
14
+
15
+ ## 2.2.0
16
+
17
+ ### Minor Changes
18
+
19
+ - [#1975](https://github.com/tailor-platform/sdk/pull/1975) [`b5ca25b`](https://github.com/tailor-platform/sdk/commit/b5ca25b796e8a5e4262ea2e3527973d77cab766a) Thanks [@toiroakr](https://github.com/toiroakr)! - Add `tailor seed fill` to fill in the values a record gets on create for the JSONL seed data rows that are missing them. It fills `id` by default, so rows can reference each other by id, and `--fields` names any other create-time field:
20
+
21
+ ```bash
22
+ # ./seed/data/Customer.jsonl: {"name":"Acme Corporation"}
23
+ tailor seed fill
24
+ # ./seed/data/Customer.jsonl: {"id":"0b6b6f5e-...","name":"Acme Corporation"}
25
+
26
+ # also stamp a creation time on rows that have none
27
+ tailor seed fill --fields id,createdAt
28
+ ```
29
+
30
+ The values come from the type itself — its `id`, its field defaults, its create hooks — applied to each row on its own. Nothing is validated, so a row can be filled while a required field is still missing or while another file references an id that does not exist yet; that is the point, since the ids are what you need in order to write the rows that reference them. Run `tailor seed validate` when the data is ready.
31
+
32
+ Only the named fields are written, and only into a row that has no value for them, so a value already in the file is never replaced. A line that gains nothing is left byte for byte as it was; a line that takes a value is written with its keys in the order the type declares its fields, so a filled-in `id` lands at the front. A field the type gives no value to is skipped, so `--fields id` covers a whole data directory and leaves the IdP `_User` data alone, and naming a field the platform assigns — a `serial` field, for instance — fills nothing and says so.
33
+
34
+ `tailor seed apply --upsert` now points at the command when a row has no `id`, since that is the run it blocks, and newly scaffolded projects get a `seed:fill` script next to `seed:validate`.
35
+
36
+ The generated seed schema files now export the type's create hook, which is where the values come from. Run `tailor generate` after upgrading; until then `tailor seed fill` reports which file needs regenerating.
37
+
38
+ `createTailorDBHook` from `@tailor-platform/sdk/test` no longer runs the type's own `validate`. Computing the values a record gets on create and deciding whether a record is acceptable are separate jobs, and the second one now sits where the field-level validation already was: `createStandardSchema` takes the type as a third argument and reports type-level issues through its result.
39
+
40
+ `tailor seed validate` also stops printing two markers on the header of a failed run (`\u2716 \u2717 Found 2 error(s) in ...`), now that it hands the CLI a report that is already formatted.
41
+
42
+ That also fixes how `tailor seed validate` reports them. A type-level `validate` failure used to end the run at the first offending row with a bare message; it now lands in the same report as every other issue, naming the file and every row that fails.
43
+
44
+ A test calling `createTailorDBHook` directly to assert a type-level `validate` throws needs to go through `createStandardSchema` instead.
45
+
46
+ The same operation is available as `fillSeedData` from `@tailor-platform/sdk/seed`.
47
+
48
+ ### Patch Changes
49
+
50
+ - [#2008](https://github.com/tailor-platform/sdk/pull/2008) [`f2135ab`](https://github.com/tailor-platform/sdk/commit/f2135ab6dd3d130d88803b9829a26024de930ed3) Thanks [@toiroakr](https://github.com/toiroakr)! - Consistently call a TailorDB schema definition a "table" instead of a "type" across the docs, matching the `db.type()` → `db.table()` rename. Also fix three leftover `db.type(...)` code samples in `docs/services/tailordb.md` that should have read `db.table(...)`.
51
+
52
+ Update the `v2/idp-publish-events-rename` codemod registry description to say "tables" instead of "types", matching the same wording fix.
53
+
3
54
  ## 2.1.0
4
55
 
5
56
  ## 2.0.1
package/README.md CHANGED
@@ -48,7 +48,7 @@ A complete inventory management system demonstrating real-world patterns.
48
48
 
49
49
  **Includes:**
50
50
 
51
- - TailorDB types: User, Product, Category, Order, Inventory, Contact, Notification
51
+ - TailorDB tables: User, Product, Category, Order, Inventory, Contact, Notification
52
52
  - Role-based permissions (Manager, Staff)
53
53
  - Custom resolver for order registration with inventory updates
54
54
  - Executor for inventory threshold monitoring
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-platform/create-sdk",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
4
4
  "description": "A CLI tool to quickly create a new Tailor Platform SDK project",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -15,8 +15,8 @@
15
15
  "typecheck": "tsc --noEmit"
16
16
  },
17
17
  "devDependencies": {
18
- "@tailor-platform/eslint-plugin-sdk": "0.2.0",
19
- "@tailor-platform/sdk": "2.1.0",
18
+ "@tailor-platform/eslint-plugin-sdk": "0.2.2",
19
+ "@tailor-platform/sdk": "2.3.0",
20
20
  "@types/node": "24.13.3",
21
21
  "oxfmt": "0.61.0",
22
22
  "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,
@@ -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
  ],
@@ -7,6 +7,7 @@
7
7
  "generate": "tailor generate",
8
8
  "deploy": "tailor deploy",
9
9
  "seed": "tailor seed apply",
10
+ "seed:fill": "tailor seed fill",
10
11
  "seed:validate": "tailor seed validate",
11
12
  "test": "vitest --project unit",
12
13
  "test:unit": "vitest --project unit",
@@ -17,9 +18,9 @@
17
18
  "typecheck": "tsc --noEmit"
18
19
  },
19
20
  "devDependencies": {
20
- "@tailor-platform/eslint-plugin-sdk": "0.2.0",
21
- "@tailor-platform/sdk": "2.1.0",
22
- "@tailor-platform/sdk-plugin-seed": "0.1.1",
21
+ "@tailor-platform/eslint-plugin-sdk": "0.2.2",
22
+ "@tailor-platform/sdk": "2.3.0",
23
+ "@tailor-platform/sdk-plugin-seed": "0.2.1",
23
24
  "@types/node": "24.13.3",
24
25
  "oxfmt": "0.61.0",
25
26
  "oxlint": "1.76.0",
@@ -8,10 +8,10 @@ const schemaType = t.object({
8
8
  ...category.omitFields(["id"]),
9
9
  });
10
10
 
11
- const hook = createTailorDBHook(category);
11
+ export const hook = createTailorDBHook(category);
12
12
 
13
13
  export const schema = defineSchema(
14
- createStandardSchema(schemaType, hook),
14
+ createStandardSchema(schemaType, hook, category),
15
15
  {
16
16
  foreignKeys: [
17
17
  {"column":"parentCategoryId","references":{"table":"Category","column":"id"}},
@@ -8,10 +8,10 @@ const schemaType = t.object({
8
8
  ...order.omitFields(["id"]),
9
9
  });
10
10
 
11
- const hook = createTailorDBHook(order);
11
+ export const hook = createTailorDBHook(order);
12
12
 
13
13
  export const schema = defineSchema(
14
- createStandardSchema(schemaType, hook),
14
+ createStandardSchema(schemaType, hook, order),
15
15
  {
16
16
  foreignKeys: [
17
17
  {"column":"productId","references":{"table":"Product","column":"id"}},
@@ -8,10 +8,10 @@ const schemaType = t.object({
8
8
  ...product.omitFields(["id"]),
9
9
  });
10
10
 
11
- const hook = createTailorDBHook(product);
11
+ export const hook = createTailorDBHook(product);
12
12
 
13
13
  export const schema = defineSchema(
14
- createStandardSchema(schemaType, hook),
14
+ createStandardSchema(schemaType, hook, product),
15
15
  {
16
16
  foreignKeys: [
17
17
  {"column":"categoryId","references":{"table":"Category","column":"id"}},
@@ -8,10 +8,10 @@ const schemaType = t.object({
8
8
  ...user.omitFields(["id"]),
9
9
  });
10
10
 
11
- const hook = createTailorDBHook(user);
11
+ export const hook = createTailorDBHook(user);
12
12
 
13
13
  export const schema = defineSchema(
14
- createStandardSchema(schemaType, hook),
14
+ createStandardSchema(schemaType, hook, user),
15
15
  {
16
16
  indexes: [
17
17
  {"name":"user_email_unique_idx","columns":["email"],"unique":true},
@@ -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.0",
17
- "@tailor-platform/sdk": "2.1.0",
16
+ "@tailor-platform/eslint-plugin-sdk": "0.2.2",
17
+ "@tailor-platform/sdk": "2.3.0",
18
18
  "@types/node": "24.13.3",
19
19
  "oxfmt": "0.61.0",
20
20
  "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,
@@ -13,8 +13,8 @@
13
13
  "typecheck": "tsc --noEmit"
14
14
  },
15
15
  "devDependencies": {
16
- "@tailor-platform/eslint-plugin-sdk": "0.2.0",
17
- "@tailor-platform/sdk": "2.1.0",
16
+ "@tailor-platform/eslint-plugin-sdk": "0.2.2",
17
+ "@tailor-platform/sdk": "2.3.0",
18
18
  "@types/node": "24.13.3",
19
19
  "oxfmt": "0.61.0",
20
20
  "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,
@@ -14,8 +14,8 @@
14
14
  "typecheck": "tsc --noEmit"
15
15
  },
16
16
  "devDependencies": {
17
- "@tailor-platform/eslint-plugin-sdk": "0.2.0",
18
- "@tailor-platform/sdk": "2.1.0",
17
+ "@tailor-platform/eslint-plugin-sdk": "0.2.2",
18
+ "@tailor-platform/sdk": "2.3.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.0",
19
- "@tailor-platform/sdk": "2.1.0",
18
+ "@tailor-platform/eslint-plugin-sdk": "0.2.2",
19
+ "@tailor-platform/sdk": "2.3.0",
20
20
  "@types/node": "24.13.3",
21
21
  "oxfmt": "0.61.0",
22
22
  "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,
@@ -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.0",
17
- "@tailor-platform/sdk": "2.1.0",
16
+ "@tailor-platform/eslint-plugin-sdk": "0.2.2",
17
+ "@tailor-platform/sdk": "2.3.0",
18
18
  "@types/node": "24.13.3",
19
19
  "oxfmt": "0.61.0",
20
20
  "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,
@@ -1,6 +1,6 @@
1
1
  # TailorDB Template
2
2
 
3
- Comprehensive TailorDB type definitions demonstrating all features of `db.table()`.
3
+ Comprehensive TailorDB table definitions demonstrating all features of `db.table()`.
4
4
 
5
5
  ## Features
6
6
 
@@ -15,8 +15,8 @@
15
15
  "typecheck": "tsc --noEmit"
16
16
  },
17
17
  "devDependencies": {
18
- "@tailor-platform/eslint-plugin-sdk": "0.2.0",
19
- "@tailor-platform/sdk": "2.1.0",
18
+ "@tailor-platform/eslint-plugin-sdk": "0.2.2",
19
+ "@tailor-platform/sdk": "2.3.0",
20
20
  "@types/node": "24.13.3",
21
21
  "oxfmt": "0.61.0",
22
22
  "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,
@@ -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.0",
20
- "@tailor-platform/sdk": "2.1.0",
19
+ "@tailor-platform/eslint-plugin-sdk": "0.2.2",
20
+ "@tailor-platform/sdk": "2.3.0",
21
21
  "@types/node": "24.13.3",
22
22
  "graphql": "17.0.2",
23
23
  "graphql-request": "7.4.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,
@@ -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
  {