@solongate/proxy 0.1.3 → 0.1.5

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/create.js CHANGED
@@ -190,21 +190,39 @@ dist/
190
190
  `
191
191
  );
192
192
  }
193
- function installDeps(dir) {
194
- log(" Installing dependencies with npm...");
193
+ function withSpinner(message, fn) {
194
+ const frames = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
195
+ let i = 0;
196
+ const id = setInterval(() => {
197
+ process.stderr.write(`\r ${frames[i++ % frames.length]} ${message}`);
198
+ }, 80);
195
199
  try {
196
- execSync("npm install", { cwd: dir, stdio: "pipe" });
200
+ fn();
201
+ clearInterval(id);
202
+ process.stderr.write(`\r \u2713 ${message}
203
+ `);
197
204
  } catch {
198
- log(" npm install failed \u2014 run it manually.");
205
+ clearInterval(id);
206
+ process.stderr.write(`\r \u2717 ${message} \u2014 failed
207
+ `);
199
208
  }
200
209
  }
210
+ function installDeps(dir) {
211
+ withSpinner("Installing dependencies...", () => {
212
+ execSync("npm install", { cwd: dir, stdio: "pipe" });
213
+ });
214
+ }
201
215
  async function main() {
202
216
  const opts = parseCreateArgs(process.argv);
203
217
  const dir = resolve(opts.name);
204
218
  log("");
205
- log(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557");
206
- log(" \u2551 SolonGate \u2014 Create MCP Server \u2551");
207
- log(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D");
219
+ log(" ____ _ ____ _");
220
+ log(" / ___| ___ | | ___ _ __ / ___| __ _| |_ ___");
221
+ log(" \\___ \\ / _ \\| |/ _ \\| '_ \\| | _ / _` | __/ _ \\");
222
+ log(" ___) | (_) | | (_) | | | | |_| | (_| | || __/");
223
+ log(" |____/ \\___/|_|\\___/|_| |_|\\____|\\__,_|\\__\\___|");
224
+ log("");
225
+ log(" Create MCP Server");
208
226
  log("");
209
227
  if (existsSync(dir)) {
210
228
  log(` Error: Directory "${opts.name}" already exists.`);
@@ -227,18 +245,20 @@ async function main() {
227
245
  installDeps(dir);
228
246
  log("");
229
247
  }
230
- log(" \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510");
231
- log(" \u2502 Project created! \u2502");
232
- log(" \u2502 \u2502");
233
- log(` \u2502 cd ${opts.name.padEnd(39)}\u2502`);
234
- log(" \u2502 \u2502");
235
- log(" \u2502 npm run build # Build \u2502");
236
- log(" \u2502 npm run dev # Dev mode (tsx) \u2502");
237
- log(" \u2502 npm start # Run built server \u2502");
238
- log(" \u2502 \u2502");
239
- log(" \u2502 Set your API key: \u2502");
240
- log(" \u2502 export SOLONGATE_API_KEY=sg_live_xxx \u2502");
241
- log(" \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518");
248
+ const W = 46;
249
+ const line = (s) => log(` \u2502 ${s.padEnd(W)} \u2502`);
250
+ log(` \u250C${"\u2500".repeat(W + 2)}\u2510`);
251
+ line("Project created!");
252
+ line("");
253
+ line(`cd ${opts.name}`);
254
+ line("");
255
+ line("npm run build # Build");
256
+ line("npm run dev # Dev mode (tsx)");
257
+ line("npm start # Run built server");
258
+ line("");
259
+ line("Set your API key:");
260
+ line("export SOLONGATE_API_KEY=sg_live_xxx");
261
+ log(` \u2514${"\u2500".repeat(W + 2)}\u2518`);
242
262
  log("");
243
263
  }
244
264
  main().catch((err) => {