@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 +39 -19
- package/dist/index.js +689 -558
- package/dist/init.js +7 -4
- package/dist/inject.js +7 -4
- package/package.json +1 -1
package/dist/create.js
CHANGED
|
@@ -190,21 +190,39 @@ dist/
|
|
|
190
190
|
`
|
|
191
191
|
);
|
|
192
192
|
}
|
|
193
|
-
function
|
|
194
|
-
|
|
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
|
-
|
|
200
|
+
fn();
|
|
201
|
+
clearInterval(id);
|
|
202
|
+
process.stderr.write(`\r \u2713 ${message}
|
|
203
|
+
`);
|
|
197
204
|
} catch {
|
|
198
|
-
|
|
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("
|
|
206
|
-
log("
|
|
207
|
-
log("
|
|
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
|
-
|
|
231
|
-
log(
|
|
232
|
-
log(
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
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) => {
|