@tailor-platform/create-sdk 2.19.0 → 2.20.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 +4 -0
- package/dist/index.js +23 -25
- package/package.json +3 -3
- package/templates/executor/package.json +1 -1
- package/templates/generators/package.json +1 -1
- package/templates/hello-world/package.json +1 -1
- package/templates/inventory-management/package.json +1 -1
- package/templates/multi-application/package.json +1 -1
- package/templates/resolver/package.json +1 -1
- package/templates/static-web-site/package.json +1 -1
- package/templates/tailordb/package.json +1 -1
- package/templates/workflow/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { chdir } from "node:process";
|
|
3
|
-
import { cancel, intro, log, outro, select, spinner, text } from "@clack/prompts";
|
|
3
|
+
import { cancel, intro, isCancel, log, outro, select, spinner, text } from "@clack/prompts";
|
|
4
4
|
import { arg, defineCommand, runMain } from "@politty/zod";
|
|
5
5
|
import pc from "picocolors";
|
|
6
6
|
import { readPackageJSON } from "pkg-types";
|
|
@@ -36,17 +36,6 @@ 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 unwrapPromptResult = (value) => {
|
|
40
|
-
if (typeof value === "symbol") {
|
|
41
|
-
cancel("Operation cancelled");
|
|
42
|
-
process.exit(0);
|
|
43
|
-
}
|
|
44
|
-
return value;
|
|
45
|
-
};
|
|
46
|
-
const requireValue = (value, message) => {
|
|
47
|
-
if (!value) throw new Error(message);
|
|
48
|
-
return value;
|
|
49
|
-
};
|
|
50
39
|
const collectContext = async (opts) => {
|
|
51
40
|
let { name, template } = opts;
|
|
52
41
|
if (name) {
|
|
@@ -63,28 +52,37 @@ const collectContext = async (opts) => {
|
|
|
63
52
|
process.exit(1);
|
|
64
53
|
}
|
|
65
54
|
}
|
|
66
|
-
if (!name)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
55
|
+
if (!name) {
|
|
56
|
+
const ret = await text({
|
|
57
|
+
message: "📝 What's your project name?",
|
|
58
|
+
validate: validateName
|
|
59
|
+
});
|
|
60
|
+
if (isCancel(ret)) {
|
|
61
|
+
cancel("Operation cancelled");
|
|
62
|
+
process.exit(0);
|
|
63
|
+
}
|
|
64
|
+
name = ret;
|
|
65
|
+
} else log.info(`📦 Project: ${name}`);
|
|
71
66
|
if (!template) {
|
|
72
67
|
const options = (await availableTemplates()).map((value) => ({
|
|
73
68
|
value,
|
|
74
69
|
hint: templateHints[value]
|
|
75
70
|
}));
|
|
76
|
-
|
|
71
|
+
const ret = await select({
|
|
77
72
|
message: "🎨 Choose your template",
|
|
78
73
|
options
|
|
79
|
-
})
|
|
74
|
+
});
|
|
75
|
+
if (isCancel(ret)) {
|
|
76
|
+
cancel("Operation cancelled");
|
|
77
|
+
process.exit(0);
|
|
78
|
+
}
|
|
79
|
+
template = ret;
|
|
80
80
|
} else log.info(`🎯 Template: ${template}`);
|
|
81
|
-
const projectName = requireValue(name, "Project name is required.");
|
|
82
|
-
const templateName = requireValue(template, "Template is required.");
|
|
83
81
|
return {
|
|
84
|
-
projectName,
|
|
85
|
-
projectDir: resolve(
|
|
86
|
-
templateName,
|
|
87
|
-
templateDir: resolve(templatesDir(),
|
|
82
|
+
projectName: name,
|
|
83
|
+
projectDir: resolve(name),
|
|
84
|
+
templateName: template,
|
|
85
|
+
templateDir: resolve(templatesDir(), template)
|
|
88
86
|
};
|
|
89
87
|
};
|
|
90
88
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tailor-platform/create-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.20.0",
|
|
4
4
|
"description": "A CLI tool to quickly create a new Tailor Platform SDK project",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
],
|
|
21
21
|
"type": "module",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@clack/prompts": "1.8.
|
|
23
|
+
"@clack/prompts": "1.8.1",
|
|
24
24
|
"@politty/zod": "0.2.1",
|
|
25
25
|
"execa": "10.0.1",
|
|
26
26
|
"picocolors": "1.1.1",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/node": "24.13.4",
|
|
32
|
-
"eslint-plugin-zod": "4.
|
|
32
|
+
"eslint-plugin-zod": "4.13.1",
|
|
33
33
|
"oxlint": "1.82.0",
|
|
34
34
|
"oxlint-tsgolint": "7.0.2001",
|
|
35
35
|
"tsdown": "0.23.0",
|