@transight-design/cli 0.2.2 → 0.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.
- package/dist/index.js +20 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -73,10 +73,7 @@ var BUNDLE_CHOICES = [
|
|
|
73
73
|
}
|
|
74
74
|
];
|
|
75
75
|
var isBundleKey = (value) => value !== void 0 && value in BUNDLE_ITEMS;
|
|
76
|
-
var initCommand = new Command("init").description("Transight Design System \uBC88\uB4E4 \uC124\uCE58 (base / essential / all \uC911 \uC120\uD0DD)").option("--dry-run", "\uC2E4\uD589\uD558\uC9C0 \uC54A\uACE0 \uD638\uCD9C\uD560 \uBA85\uB839\uB9CC \uCD9C\uB825", false).option("--ref <ref>", "GitHub \uB808\uD37C\uB7F0\uC2A4 (\uBE0C\uB79C\uCE58\xB7\uD0DC\uADF8\xB7SHA)").option(
|
|
77
|
-
"--bundle <name>",
|
|
78
|
-
"\uB300\uD654 \uD504\uB86C\uD504\uD2B8 \uC0DD\uB7B5 \u2014 base | essential | all"
|
|
79
|
-
).action(async (options) => {
|
|
76
|
+
var initCommand = new Command("init").description("Transight Design System \uBC88\uB4E4 \uC124\uCE58 (base / essential / all \uC911 \uC120\uD0DD)").option("--dry-run", "\uC2E4\uD589\uD558\uC9C0 \uC54A\uACE0 \uD638\uCD9C\uD560 \uBA85\uB839\uB9CC \uCD9C\uB825", false).option("--ref <ref>", "GitHub \uB808\uD37C\uB7F0\uC2A4 (\uBE0C\uB79C\uCE58\xB7\uD0DC\uADF8\xB7SHA)").option("--bundle <name>", "\uB300\uD654 \uD504\uB86C\uD504\uD2B8 \uC0DD\uB7B5 \u2014 base | essential | all").action(async (options) => {
|
|
80
77
|
console.log(pc2.bold(pc2.cyan("Transight Design System")) + " \u2014 init");
|
|
81
78
|
let bundle = isBundleKey(options.bundle) ? options.bundle : void 0;
|
|
82
79
|
if (!bundle) {
|
|
@@ -92,17 +89,28 @@ var initCommand = new Command("init").description("Transight Design System \uBC8
|
|
|
92
89
|
bundle = selected;
|
|
93
90
|
}
|
|
94
91
|
const itemName = BUNDLE_ITEMS[bundle];
|
|
95
|
-
const code = await runShadcn(
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
)
|
|
92
|
+
const code = await runShadcn(["add", githubAddress(itemName, options.ref)], {
|
|
93
|
+
dryRun: options.dryRun
|
|
94
|
+
});
|
|
95
|
+
if (code === 0 && !options.dryRun) {
|
|
96
|
+
const agentInstruction = "transight-design.AGENT.md\uC5D0 \uB530\uB77C \uB514\uC790\uC778 \uC2DC\uC2A4\uD15C \uCD08\uAE30 \uC124\uC815\uC744 \uC801\uC6A9\uD574\uC918";
|
|
97
|
+
console.log("");
|
|
98
|
+
console.log(pc2.green("\u2713 \uC124\uCE58 \uC644\uB8CC"));
|
|
99
|
+
console.log("");
|
|
100
|
+
console.log(pc2.bold("\uB2E4\uC74C\uC73C\uB85C AI Agent\uC5D0\uAC8C \uC544\uB798 \uBB38\uAD6C\uB97C \uC9C0\uC2DC\uD558\uC138\uC694:"));
|
|
101
|
+
console.log("");
|
|
102
|
+
console.log(" " + pc2.cyan(pc2.bold(agentInstruction)));
|
|
103
|
+
console.log("");
|
|
104
|
+
console.log(pc2.dim("(\uC704 \uBB38\uAD6C\uB97C \uADF8\uB300\uB85C \uBCF5\uC0AC\uD574 \uD130\uBBF8\uB110\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694)"));
|
|
105
|
+
console.log("");
|
|
106
|
+
}
|
|
99
107
|
process.exit(code);
|
|
100
108
|
});
|
|
101
109
|
|
|
102
110
|
// src/commands/add.ts
|
|
103
111
|
import { Command as Command2 } from "commander";
|
|
104
112
|
import pc3 from "picocolors";
|
|
105
|
-
var addCommand = new Command2("add").description("\uCEF4\uD3EC\uB10C\uD2B8/\uD329 \uCD94\uAC00 (\uC608: transight-design add essential \uB610\uB294 button card dialog)").argument("<components...>", "\uC124\uCE58\uD560 \uCEF4\uD3EC\uB10C\uD2B8 \uB610\uB294 \uD329 \uC774\uB984\uB4E4").option("--dry-run", "\uC2E4\uD589\uD558\uC9C0 \uC54A\uACE0 \uD638\uCD9C\uD560 \uBA85\uB839\uB9CC \uCD9C\uB825", false).option("--ref <ref>", "GitHub \uB808\uD37C\uB7F0\uC2A4 (\uBE0C\uB79C\uCE58\xB7\uD0DC\uADF8\xB7SHA)").action(async (components, options) => {
|
|
113
|
+
var addCommand = new Command2("add").description("\uCEF4\uD3EC\uB10C\uD2B8/\uD329 \uCD94\uAC00 (\uC608: transight-design add essential \uB610\uB294 button card dialog)").argument("<components...>", "\uC124\uCE58\uD560 \uCEF4\uD3EC\uB10C\uD2B8 \uB610\uB294 \uD329 \uC774\uB984\uB4E4").option("--dry-run", "\uC2E4\uD589\uD558\uC9C0 \uC54A\uACE0 \uD638\uCD9C\uD560 \uBA85\uB839\uB9CC \uCD9C\uB825", false).option("--ref <ref>", "GitHub \uB808\uD37C\uB7F0\uC2A4 (\uBE0C\uB79C\uCE58\xB7\uD0DC\uADF8\xB7SHA)").option("--overwrite", "\uAE30\uC874 \uD30C\uC77C\uC744 prompt \uC5C6\uC774 \uB36E\uC5B4\uC4F0\uAE30 (\uC5C5\uB370\uC774\uD2B8 \uC6A9)", false).action(async (components, options) => {
|
|
106
114
|
if (components.length === 0) {
|
|
107
115
|
console.error(pc3.red("\uCEF4\uD3EC\uB10C\uD2B8 \uC774\uB984\uC744 \uD558\uB098 \uC774\uC0C1 \uC9C0\uC815\uD574\uC8FC\uC138\uC694."));
|
|
108
116
|
process.exit(1);
|
|
@@ -111,7 +119,9 @@ var addCommand = new Command2("add").description("\uCEF4\uD3EC\uB10C\uD2B8/\uD32
|
|
|
111
119
|
console.log(
|
|
112
120
|
pc3.bold(pc3.cyan("Transight Design System")) + ` \u2014 add ${pc3.yellow(components.join(", "))}`
|
|
113
121
|
);
|
|
114
|
-
const
|
|
122
|
+
const args = ["add", ...addresses];
|
|
123
|
+
if (options.overwrite) args.push("--overwrite");
|
|
124
|
+
const code = await runShadcn(args, { dryRun: options.dryRun });
|
|
115
125
|
process.exit(code);
|
|
116
126
|
});
|
|
117
127
|
|