mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 15:41:45 +00:00
refactor: remove success logs and update server URL display
This commit is contained in:
@@ -173,11 +173,6 @@ class AutoDev {
|
||||
console.log(`
|
||||
${colors.bright}🚀 Vega Providers Auto-Development Environment${colors.reset}
|
||||
|
||||
${colors.cyan}Features:${colors.reset}
|
||||
• 👀 Auto-watch TypeScript files in /providers
|
||||
• 🔨 Auto-rebuild on file changes
|
||||
• 🌐 Development server with hot-reload
|
||||
• 📊 Real-time build feedback
|
||||
|
||||
${colors.yellow}Press Ctrl+C to stop${colors.reset}
|
||||
`);
|
||||
|
||||
@@ -45,7 +45,7 @@ class ProviderBuilder {
|
||||
fs.rmSync(DIST_DIR, { recursive: true, force: true });
|
||||
}
|
||||
fs.mkdirSync(DIST_DIR, { recursive: true });
|
||||
log.success("Cleaned dist directory");
|
||||
// log.success("Cleaned dist directory");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -77,7 +77,7 @@ class ProviderBuilder {
|
||||
encoding: "utf8",
|
||||
});
|
||||
|
||||
log.success("TypeScript compilation completed");
|
||||
// log.success("TypeScript compilation completed");
|
||||
return true;
|
||||
} catch (error) {
|
||||
log.error("TypeScript compilation failed:");
|
||||
@@ -127,7 +127,7 @@ class ProviderBuilder {
|
||||
}
|
||||
|
||||
if (fileCount > 0) {
|
||||
log.success(` ${provider}: ${fileCount} modules ready`);
|
||||
// log.success(` ${provider}: ${fileCount} modules ready`);
|
||||
} else {
|
||||
log.warning(` ${provider}: No modules found`);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ const cors = require("cors");
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
const { execSync } = require("child_process");
|
||||
const os = require("os");
|
||||
|
||||
/**
|
||||
* Local development server for testing providers
|
||||
@@ -144,24 +145,28 @@ class DevServer {
|
||||
}
|
||||
|
||||
start() {
|
||||
// Get local IP address
|
||||
const interfaces = os.networkInterfaces();
|
||||
let localIp = "localhost";
|
||||
for (const name of Object.keys(interfaces)) {
|
||||
for (const iface of interfaces[name]) {
|
||||
if (iface.family === "IPv4" && !iface.internal) {
|
||||
localIp = iface.address;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (localIp !== "localhost") break;
|
||||
}
|
||||
this.app.listen(this.port, "0.0.0.0", () => {
|
||||
console.log(`
|
||||
🚀 Vega Providers Dev Server Started!
|
||||
|
||||
📡 Server URL: http://localhost:${this.port}
|
||||
📱 Mobile URL: http://<your-ip>:${this.port}
|
||||
|
||||
📋 Available endpoints:
|
||||
• GET /manifest.json - Provider manifest
|
||||
• GET /dist/:provider/:file - Provider modules
|
||||
• POST /build - Trigger rebuild
|
||||
• GET /status - Server status
|
||||
• GET /providers - List providers
|
||||
• GET /health - Health check
|
||||
📱 Mobile URL: http://${localIp}:${this.port}
|
||||
|
||||
💡 Usage:
|
||||
1. Run 'node build.js' to build providers
|
||||
2. Update vega app to use: http://localhost:${this.port}
|
||||
1. Run 'npm run auto' to to start the dev server ☑️
|
||||
2. Update vega app to use: http://${localIp}:${this.port}
|
||||
3. Test your providers!
|
||||
|
||||
🔄 Auto-rebuild: POST to /build to rebuild after changes
|
||||
|
||||
Reference in New Issue
Block a user