@transight-design/cli 0.4.0 → 0.5.1
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 +24 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -93,7 +93,7 @@ var initCommand = new Command("init").description("Transight Design System \uBC8
|
|
|
93
93
|
dryRun: options.dryRun
|
|
94
94
|
});
|
|
95
95
|
if (code === 0 && !options.dryRun) {
|
|
96
|
-
const agentInstruction =
|
|
96
|
+
const agentInstruction = '\uB8E8\uD2B8 \uC5D0\uC774\uC804\uD2B8 \uC9C0\uC2DC \uD30C\uC77C(AGENTS.md/AGENT.md/CLAUDE.md/.cursor/rules)\uC5D0 "UI \uC791\uC5C5 \uC804 transight-design.AGENT.md\uB97C \uBC18\uB4DC\uC2DC \uC77D\uACE0 \uB530\uB978\uB2E4"\uB97C \uCD94\uAC00\uD574\uC918';
|
|
97
97
|
console.log("");
|
|
98
98
|
console.log(pc2.green("\u2713 \uC124\uCE58 \uC644\uB8CC"));
|
|
99
99
|
console.log("");
|
|
@@ -101,7 +101,7 @@ var initCommand = new Command("init").description("Transight Design System \uBC8
|
|
|
101
101
|
console.log("");
|
|
102
102
|
console.log(" " + pc2.cyan(pc2.bold(agentInstruction)));
|
|
103
103
|
console.log("");
|
|
104
|
-
console.log(pc2.dim("(\
|
|
104
|
+
console.log(pc2.dim("(\uC5D0\uC774\uC804\uD2B8\uAC00 \uD56D\uC0C1 \uC77D\uB294 \uD504\uB85C\uC81D\uD2B8 \uADDC\uCE59 \uD30C\uC77C\uC5D0 \uB514\uC790\uC778 \uC2DC\uC2A4\uD15C \uCC38\uC870\uB97C \uACE0\uC815\uD569\uB2C8\uB2E4)"));
|
|
105
105
|
console.log("");
|
|
106
106
|
}
|
|
107
107
|
process.exit(code);
|
|
@@ -139,6 +139,12 @@ import { access, mkdir, writeFile } from "fs/promises";
|
|
|
139
139
|
import { dirname, resolve, sep } from "path";
|
|
140
140
|
import { Command as Command4 } from "commander";
|
|
141
141
|
import pc5 from "picocolors";
|
|
142
|
+
var localComponentName = (dep) => {
|
|
143
|
+
const prefix = `${GITHUB_REPO}/`;
|
|
144
|
+
if (!dep.startsWith(prefix)) return null;
|
|
145
|
+
const name = dep.slice(prefix.length);
|
|
146
|
+
return name.length > 0 ? name : null;
|
|
147
|
+
};
|
|
142
148
|
var DEFAULT_REF = "main";
|
|
143
149
|
var itemUrl = (name, ref) => {
|
|
144
150
|
const [owner, repo] = GITHUB_REPO.split("/");
|
|
@@ -184,12 +190,26 @@ var updateCommand = new Command4("update").description("\uC774\uBBF8 \uC124\uCE5
|
|
|
184
190
|
console.log(
|
|
185
191
|
pc5.bold(pc5.cyan("Transight Design System")) + ` \u2014 update ${pc5.yellow(components.join(", "))}`
|
|
186
192
|
);
|
|
193
|
+
const queue = [...components];
|
|
194
|
+
const visited = /* @__PURE__ */ new Set();
|
|
187
195
|
try {
|
|
188
|
-
|
|
196
|
+
while (queue.length > 0) {
|
|
197
|
+
const component = queue.shift();
|
|
198
|
+
if (visited.has(component)) continue;
|
|
199
|
+
visited.add(component);
|
|
189
200
|
const item = await fetchRegistryItem(component, options.ref);
|
|
190
201
|
const files = item.files ?? [];
|
|
191
202
|
if (files.length === 0) {
|
|
192
|
-
|
|
203
|
+
const deps = item.registryDependencies ?? [];
|
|
204
|
+
const expanded = deps.map(localComponentName).filter((name) => name !== null);
|
|
205
|
+
if (expanded.length === 0) {
|
|
206
|
+
throw new Error(`\uC5C5\uB370\uC774\uD2B8\uD560 \uD30C\uC77C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4: ${component}`);
|
|
207
|
+
}
|
|
208
|
+
console.log(
|
|
209
|
+
pc5.dim("bundle ") + pc5.cyan(component) + pc5.dim(` \u2192 ${expanded.length}\uAC1C \uCEF4\uD3EC\uB10C\uD2B8 \uD655\uC7A5`)
|
|
210
|
+
);
|
|
211
|
+
queue.push(...expanded);
|
|
212
|
+
continue;
|
|
193
213
|
}
|
|
194
214
|
for (const file of files) {
|
|
195
215
|
if (typeof file.content !== "string") {
|