@tailor-platform/create-sdk 1.6.1 → 1.6.3
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/README.md +3 -1
- package/dist/index.js +13 -20
- package/package.json +4 -3
- 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/testing/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -5,13 +5,15 @@
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm create @tailor-platform/sdk [OPTIONS] [NAME]
|
|
8
|
+
npm create @tailor-platform/sdk -- [OPTIONS] [NAME]
|
|
9
9
|
# OR
|
|
10
10
|
yarn create @tailor-platform/sdk [OPTIONS] [NAME]
|
|
11
11
|
# OR
|
|
12
12
|
pnpm create @tailor-platform/sdk [OPTIONS] [NAME]
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
Note: npm 7+ requires `--` before create-sdk options (for example, `--template`).
|
|
16
|
+
|
|
15
17
|
### Arguments
|
|
16
18
|
|
|
17
19
|
- `NAME`: (Optional) The name of your new project. If not provided, you'll be prompted to enter one.
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { chdir } from "node:process";
|
|
3
3
|
import { cancel, intro, isCancel, log, outro, select, spinner, text } from "@clack/prompts";
|
|
4
|
-
import { defineCommand, runMain } from "citty";
|
|
5
4
|
import pc from "picocolors";
|
|
6
5
|
import { readPackageJSON } from "pkg-types";
|
|
6
|
+
import { arg, defineCommand, runMain } from "politty";
|
|
7
|
+
import { z } from "zod";
|
|
7
8
|
import { existsSync } from "node:fs";
|
|
8
9
|
import { cp, readdir, rename } from "node:fs/promises";
|
|
9
10
|
import { join, resolve } from "node:path";
|
|
@@ -141,24 +142,16 @@ const initProject = async () => {
|
|
|
141
142
|
const main = async () => {
|
|
142
143
|
const packageJson = await readPackageJSON(import.meta.url);
|
|
143
144
|
await runMain(defineCommand({
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
},
|
|
155
|
-
template: {
|
|
156
|
-
type: "string",
|
|
157
|
-
description: "Template name",
|
|
158
|
-
required: false
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
async run({ args }) {
|
|
145
|
+
name: packageJson.name ?? "create-sdk",
|
|
146
|
+
description: packageJson.description,
|
|
147
|
+
args: z.object({
|
|
148
|
+
name: arg(z.string().optional(), {
|
|
149
|
+
positional: true,
|
|
150
|
+
description: "Project name"
|
|
151
|
+
}),
|
|
152
|
+
template: arg(z.string().optional(), { description: "Template name" })
|
|
153
|
+
}),
|
|
154
|
+
async run(args) {
|
|
162
155
|
intro(pc.bold(pc.cyan("✨ Welcome to Tailor Platform SDK")));
|
|
163
156
|
const ctx = await collectContext({
|
|
164
157
|
name: args.name,
|
|
@@ -173,7 +166,7 @@ const main = async () => {
|
|
|
173
166
|
|
|
174
167
|
` + pc.dim("Learn more: https://docs.tailor.tech"));
|
|
175
168
|
}
|
|
176
|
-
}));
|
|
169
|
+
}), { version: packageJson.version });
|
|
177
170
|
};
|
|
178
171
|
await main();
|
|
179
172
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tailor-platform/create-sdk",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.3",
|
|
4
4
|
"description": "A CLI tool to quickly create a new Tailor Platform SDK project",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -19,10 +19,11 @@
|
|
|
19
19
|
"type": "module",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@clack/prompts": "0.11.0",
|
|
22
|
-
"citty": "0.1.6",
|
|
23
22
|
"execa": "9.6.1",
|
|
24
23
|
"picocolors": "1.1.1",
|
|
25
|
-
"pkg-types": "2.3.0"
|
|
24
|
+
"pkg-types": "2.3.0",
|
|
25
|
+
"politty": "^0.1.1",
|
|
26
|
+
"zod": "4.3.5"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
28
29
|
"@eslint/js": "9.39.2",
|