@tailor-platform/create-sdk 2.3.0 → 2.5.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 +22 -0
- package/dist/index.js +11 -8
- package/package.json +4 -3
- package/templates/executor/package.json +4 -5
- package/templates/executor/tailor.d.ts +3 -0
- package/templates/generators/.oxfmtrc.json +1 -1
- package/templates/generators/package.json +5 -6
- package/templates/generators/tailor.d.ts +3 -0
- package/templates/hello-world/package.json +4 -5
- package/templates/hello-world/tailor.d.ts +1 -0
- package/templates/inventory-management/package.json +4 -5
- package/templates/inventory-management/tailor.d.ts +3 -0
- package/templates/multi-application/package.json +4 -5
- package/templates/resolver/package.json +4 -5
- package/templates/resolver/tailor.d.ts +3 -0
- package/templates/static-web-site/package.json +4 -5
- package/templates/static-web-site/tailor.d.ts +3 -0
- package/templates/tailordb/README.md +1 -1
- package/templates/tailordb/package.json +4 -5
- package/templates/tailordb/src/db/task.test.ts +5 -5
- package/templates/tailordb/tailor.d.ts +3 -0
- package/templates/workflow/package.json +4 -5
- package/templates/workflow/tailor.d.ts +3 -0
- package/templates/generators/.prettierignore +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @tailor-platform/create-sdk
|
|
2
2
|
|
|
3
|
+
## 2.5.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#2125](https://github.com/tailor-platform/sdk/pull/2125) [`17f449b`](https://github.com/tailor-platform/sdk/commit/17f449bac29a78d5a6084260a73a39c10b47e05e) Thanks [@dqn](https://github.com/dqn)! - Keep generated seed data excluded from Oxfmt in newly created projects.
|
|
8
|
+
|
|
9
|
+
- [#2107](https://github.com/tailor-platform/sdk/pull/2107) [`ff35c1e`](https://github.com/tailor-platform/sdk/commit/ff35c1e0f3ac0ce0db0b7fc6d9fde4ff1dc854f6) Thanks [@dqn](https://github.com/dqn)! - Internal error-handling and prompt-flow cleanups surfaced by newly enabled async-correctness lint rules; no behavior change.
|
|
10
|
+
|
|
11
|
+
## 2.4.0
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#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).
|
|
16
|
+
|
|
17
|
+
- [#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.
|
|
18
|
+
|
|
19
|
+
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.
|
|
20
|
+
|
|
21
|
+
The positional is now named `entities`, so `--help` shows `[entities]` instead of `[types]`. Positionals are matched by argv order, so existing invocations are unaffected.
|
|
22
|
+
|
|
23
|
+
- [#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.
|
|
24
|
+
|
|
3
25
|
## 2.3.0
|
|
4
26
|
|
|
5
27
|
### Patch 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
|
|
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)",
|
|
@@ -36,7 +36,8 @@ const validateTemplate = async (template) => {
|
|
|
36
36
|
const availables = await availableTemplates();
|
|
37
37
|
if (!availables.includes(template)) return `Template "${template}" is not available. Available templates are: ${availables.join(", ")}.`;
|
|
38
38
|
};
|
|
39
|
-
const collectContext = async (
|
|
39
|
+
const collectContext = async (opts) => {
|
|
40
|
+
let { name, template } = opts;
|
|
40
41
|
if (name) {
|
|
41
42
|
const err = validateName(name);
|
|
42
43
|
if (err) {
|
|
@@ -63,12 +64,13 @@ const collectContext = async ({ name, template }) => {
|
|
|
63
64
|
name = ret;
|
|
64
65
|
} else log.info(`📦 Project: ${name}`);
|
|
65
66
|
if (!template) {
|
|
67
|
+
const options = (await availableTemplates()).map((value) => ({
|
|
68
|
+
value,
|
|
69
|
+
hint: templateHints[value]
|
|
70
|
+
}));
|
|
66
71
|
const ret = await select({
|
|
67
72
|
message: "🎨 Choose your template",
|
|
68
|
-
options
|
|
69
|
-
value,
|
|
70
|
-
hint: templateHints[value]
|
|
71
|
-
}))
|
|
73
|
+
options
|
|
72
74
|
});
|
|
73
75
|
if (isCancel(ret)) {
|
|
74
76
|
cancel("Operation cancelled");
|
|
@@ -154,7 +156,7 @@ const initProject = async () => {
|
|
|
154
156
|
//#region src/index.ts
|
|
155
157
|
const main = async () => {
|
|
156
158
|
const packageJson = await readPackageJSON(import.meta.url);
|
|
157
|
-
|
|
159
|
+
const cmd = defineCommand({
|
|
158
160
|
name: packageJson.name ?? "create-sdk",
|
|
159
161
|
description: packageJson.description,
|
|
160
162
|
args: z.object({
|
|
@@ -179,7 +181,8 @@ const main = async () => {
|
|
|
179
181
|
|
|
180
182
|
` + pc.dim("Learn more: https://docs.tailor.tech"));
|
|
181
183
|
}
|
|
182
|
-
})
|
|
184
|
+
});
|
|
185
|
+
await runMain(cmd, { version: packageJson.version });
|
|
183
186
|
};
|
|
184
187
|
await main();
|
|
185
188
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tailor-platform/create-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"description": "A CLI tool to quickly create a new Tailor Platform SDK project",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "24.13.3",
|
|
29
|
-
"eslint-plugin-zod": "4.9.
|
|
30
|
-
"oxlint": "1.
|
|
29
|
+
"eslint-plugin-zod": "4.9.1",
|
|
30
|
+
"oxlint": "1.78.0",
|
|
31
31
|
"oxlint-tsgolint": "7.0.2001",
|
|
32
32
|
"tsdown": "0.22.14",
|
|
33
33
|
"typescript": "6.0.3"
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"build": "tsdown",
|
|
37
37
|
"lint": "oxlint --type-aware . --ignore-pattern \"templates/**\"",
|
|
38
38
|
"lint:fix": "oxlint --type-aware . --ignore-pattern \"templates/**\" --fix",
|
|
39
|
+
"knip": "knip",
|
|
39
40
|
"typecheck": "tsc --noEmit",
|
|
40
41
|
"prepublish": "node scripts/prepare-templates.js && pnpm run build",
|
|
41
42
|
"publint": "publint --strict"
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "executor",
|
|
3
|
-
"version": "0.0.0",
|
|
4
3
|
"private": true,
|
|
5
4
|
"type": "module",
|
|
6
5
|
"scripts": {
|
|
@@ -15,11 +14,11 @@
|
|
|
15
14
|
"typecheck": "tsc --noEmit"
|
|
16
15
|
},
|
|
17
16
|
"devDependencies": {
|
|
18
|
-
"@tailor-platform/eslint-plugin-sdk": "0.2.
|
|
19
|
-
"@tailor-platform/sdk": "2.
|
|
17
|
+
"@tailor-platform/eslint-plugin-sdk": "0.2.3",
|
|
18
|
+
"@tailor-platform/sdk": "2.5.0",
|
|
20
19
|
"@types/node": "24.13.3",
|
|
21
|
-
"oxfmt": "0.
|
|
22
|
-
"oxlint": "1.
|
|
20
|
+
"oxfmt": "0.63.0",
|
|
21
|
+
"oxlint": "1.78.0",
|
|
23
22
|
"oxlint-tsgolint": "7.0.2001",
|
|
24
23
|
"typescript": "6.0.3",
|
|
25
24
|
"vitest": "4.1.10"
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "generators",
|
|
3
|
-
"version": "0.0.0",
|
|
4
3
|
"private": true,
|
|
5
4
|
"type": "module",
|
|
6
5
|
"scripts": {
|
|
@@ -18,12 +17,12 @@
|
|
|
18
17
|
"typecheck": "tsc --noEmit"
|
|
19
18
|
},
|
|
20
19
|
"devDependencies": {
|
|
21
|
-
"@tailor-platform/eslint-plugin-sdk": "0.2.
|
|
22
|
-
"@tailor-platform/sdk": "2.
|
|
23
|
-
"@tailor-platform/sdk-plugin-seed": "0.2.
|
|
20
|
+
"@tailor-platform/eslint-plugin-sdk": "0.2.3",
|
|
21
|
+
"@tailor-platform/sdk": "2.5.0",
|
|
22
|
+
"@tailor-platform/sdk-plugin-seed": "0.2.3",
|
|
24
23
|
"@types/node": "24.13.3",
|
|
25
|
-
"oxfmt": "0.
|
|
26
|
-
"oxlint": "1.
|
|
24
|
+
"oxfmt": "0.63.0",
|
|
25
|
+
"oxlint": "1.78.0",
|
|
27
26
|
"oxlint-tsgolint": "7.0.2001",
|
|
28
27
|
"typescript": "6.0.3",
|
|
29
28
|
"vitest": "4.1.10"
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hello-world",
|
|
3
|
-
"version": "0.0.0",
|
|
4
3
|
"private": true,
|
|
5
4
|
"type": "module",
|
|
6
5
|
"scripts": {
|
|
@@ -13,11 +12,11 @@
|
|
|
13
12
|
"typecheck": "tsc --noEmit"
|
|
14
13
|
},
|
|
15
14
|
"devDependencies": {
|
|
16
|
-
"@tailor-platform/eslint-plugin-sdk": "0.2.
|
|
17
|
-
"@tailor-platform/sdk": "2.
|
|
15
|
+
"@tailor-platform/eslint-plugin-sdk": "0.2.3",
|
|
16
|
+
"@tailor-platform/sdk": "2.5.0",
|
|
18
17
|
"@types/node": "24.13.3",
|
|
19
|
-
"oxfmt": "0.
|
|
20
|
-
"oxlint": "1.
|
|
18
|
+
"oxfmt": "0.63.0",
|
|
19
|
+
"oxlint": "1.78.0",
|
|
21
20
|
"oxlint-tsgolint": "7.0.2001",
|
|
22
21
|
"typescript": "6.0.3"
|
|
23
22
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "inventory-management",
|
|
3
|
-
"version": "0.0.0",
|
|
4
3
|
"private": true,
|
|
5
4
|
"type": "module",
|
|
6
5
|
"scripts": {
|
|
@@ -13,11 +12,11 @@
|
|
|
13
12
|
"typecheck": "tsc --noEmit"
|
|
14
13
|
},
|
|
15
14
|
"devDependencies": {
|
|
16
|
-
"@tailor-platform/eslint-plugin-sdk": "0.2.
|
|
17
|
-
"@tailor-platform/sdk": "2.
|
|
15
|
+
"@tailor-platform/eslint-plugin-sdk": "0.2.3",
|
|
16
|
+
"@tailor-platform/sdk": "2.5.0",
|
|
18
17
|
"@types/node": "24.13.3",
|
|
19
|
-
"oxfmt": "0.
|
|
20
|
-
"oxlint": "1.
|
|
18
|
+
"oxfmt": "0.63.0",
|
|
19
|
+
"oxlint": "1.78.0",
|
|
21
20
|
"oxlint-tsgolint": "7.0.2001",
|
|
22
21
|
"typescript": "6.0.3"
|
|
23
22
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "multi-application",
|
|
3
|
-
"version": "0.0.0",
|
|
4
3
|
"private": true,
|
|
5
4
|
"type": "module",
|
|
6
5
|
"scripts": {
|
|
@@ -14,11 +13,11 @@
|
|
|
14
13
|
"typecheck": "tsc --noEmit"
|
|
15
14
|
},
|
|
16
15
|
"devDependencies": {
|
|
17
|
-
"@tailor-platform/eslint-plugin-sdk": "0.2.
|
|
18
|
-
"@tailor-platform/sdk": "2.
|
|
16
|
+
"@tailor-platform/eslint-plugin-sdk": "0.2.3",
|
|
17
|
+
"@tailor-platform/sdk": "2.5.0",
|
|
19
18
|
"@types/node": "24.13.3",
|
|
20
|
-
"oxfmt": "0.
|
|
21
|
-
"oxlint": "1.
|
|
19
|
+
"oxfmt": "0.63.0",
|
|
20
|
+
"oxlint": "1.78.0",
|
|
22
21
|
"oxlint-tsgolint": "7.0.2001",
|
|
23
22
|
"typescript": "6.0.3"
|
|
24
23
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "resolver",
|
|
3
|
-
"version": "0.0.0",
|
|
4
3
|
"private": true,
|
|
5
4
|
"type": "module",
|
|
6
5
|
"scripts": {
|
|
@@ -15,11 +14,11 @@
|
|
|
15
14
|
"typecheck": "tsc --noEmit"
|
|
16
15
|
},
|
|
17
16
|
"devDependencies": {
|
|
18
|
-
"@tailor-platform/eslint-plugin-sdk": "0.2.
|
|
19
|
-
"@tailor-platform/sdk": "2.
|
|
17
|
+
"@tailor-platform/eslint-plugin-sdk": "0.2.3",
|
|
18
|
+
"@tailor-platform/sdk": "2.5.0",
|
|
20
19
|
"@types/node": "24.13.3",
|
|
21
|
-
"oxfmt": "0.
|
|
22
|
-
"oxlint": "1.
|
|
20
|
+
"oxfmt": "0.63.0",
|
|
21
|
+
"oxlint": "1.78.0",
|
|
23
22
|
"oxlint-tsgolint": "7.0.2001",
|
|
24
23
|
"typescript": "6.0.3",
|
|
25
24
|
"vitest": "4.1.10"
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "static-web-site",
|
|
3
|
-
"version": "0.0.0",
|
|
4
3
|
"private": true,
|
|
5
4
|
"type": "module",
|
|
6
5
|
"scripts": {
|
|
@@ -13,11 +12,11 @@
|
|
|
13
12
|
"typecheck": "tsc --noEmit"
|
|
14
13
|
},
|
|
15
14
|
"devDependencies": {
|
|
16
|
-
"@tailor-platform/eslint-plugin-sdk": "0.2.
|
|
17
|
-
"@tailor-platform/sdk": "2.
|
|
15
|
+
"@tailor-platform/eslint-plugin-sdk": "0.2.3",
|
|
16
|
+
"@tailor-platform/sdk": "2.5.0",
|
|
18
17
|
"@types/node": "24.13.3",
|
|
19
|
-
"oxfmt": "0.
|
|
20
|
-
"oxlint": "1.
|
|
18
|
+
"oxfmt": "0.63.0",
|
|
19
|
+
"oxlint": "1.78.0",
|
|
21
20
|
"oxlint-tsgolint": "7.0.2001",
|
|
22
21
|
"typescript": "6.0.3"
|
|
23
22
|
}
|
|
@@ -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
|
|
9
|
+
- Validations (field-level and table-level)
|
|
10
10
|
- Hooks (computed fields)
|
|
11
11
|
- File attachments
|
|
12
12
|
- Composite indexes
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tailordb",
|
|
3
|
-
"version": "0.0.0",
|
|
4
3
|
"private": true,
|
|
5
4
|
"type": "module",
|
|
6
5
|
"scripts": {
|
|
@@ -15,11 +14,11 @@
|
|
|
15
14
|
"typecheck": "tsc --noEmit"
|
|
16
15
|
},
|
|
17
16
|
"devDependencies": {
|
|
18
|
-
"@tailor-platform/eslint-plugin-sdk": "0.2.
|
|
19
|
-
"@tailor-platform/sdk": "2.
|
|
17
|
+
"@tailor-platform/eslint-plugin-sdk": "0.2.3",
|
|
18
|
+
"@tailor-platform/sdk": "2.5.0",
|
|
20
19
|
"@types/node": "24.13.3",
|
|
21
|
-
"oxfmt": "0.
|
|
22
|
-
"oxlint": "1.
|
|
20
|
+
"oxfmt": "0.63.0",
|
|
21
|
+
"oxlint": "1.78.0",
|
|
23
22
|
"oxlint-tsgolint": "7.0.2001",
|
|
24
23
|
"typescript": "6.0.3",
|
|
25
24
|
"vitest": "4.1.10"
|
|
@@ -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
|
|
8
|
-
test("task
|
|
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
|
|
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
|
|
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
|
|
34
|
+
test("comment table has expected fields", () => {
|
|
35
35
|
const { fields } = comment;
|
|
36
36
|
expect(fields).toHaveProperty("body");
|
|
37
37
|
expect(fields).toHaveProperty("taskId");
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "workflow",
|
|
3
|
-
"version": "0.0.0",
|
|
4
3
|
"private": true,
|
|
5
4
|
"type": "module",
|
|
6
5
|
"scripts": {
|
|
@@ -16,13 +15,13 @@
|
|
|
16
15
|
"typecheck": "tsc --noEmit"
|
|
17
16
|
},
|
|
18
17
|
"devDependencies": {
|
|
19
|
-
"@tailor-platform/eslint-plugin-sdk": "0.2.
|
|
20
|
-
"@tailor-platform/sdk": "2.
|
|
18
|
+
"@tailor-platform/eslint-plugin-sdk": "0.2.3",
|
|
19
|
+
"@tailor-platform/sdk": "2.5.0",
|
|
21
20
|
"@types/node": "24.13.3",
|
|
22
21
|
"graphql": "17.0.2",
|
|
23
22
|
"graphql-request": "7.4.0",
|
|
24
|
-
"oxfmt": "0.
|
|
25
|
-
"oxlint": "1.
|
|
23
|
+
"oxfmt": "0.63.0",
|
|
24
|
+
"oxlint": "1.78.0",
|
|
26
25
|
"oxlint-tsgolint": "7.0.2001",
|
|
27
26
|
"typescript": "6.0.3",
|
|
28
27
|
"vitest": "4.1.10"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
src/seed/
|