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(`
|
console.log(`
|
||||||
${colors.bright}🚀 Vega Providers Auto-Development Environment${colors.reset}
|
${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}
|
${colors.yellow}Press Ctrl+C to stop${colors.reset}
|
||||||
`);
|
`);
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class ProviderBuilder {
|
|||||||
fs.rmSync(DIST_DIR, { recursive: true, force: true });
|
fs.rmSync(DIST_DIR, { recursive: true, force: true });
|
||||||
}
|
}
|
||||||
fs.mkdirSync(DIST_DIR, { recursive: 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",
|
encoding: "utf8",
|
||||||
});
|
});
|
||||||
|
|
||||||
log.success("TypeScript compilation completed");
|
// log.success("TypeScript compilation completed");
|
||||||
return true;
|
return true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log.error("TypeScript compilation failed:");
|
log.error("TypeScript compilation failed:");
|
||||||
@@ -127,7 +127,7 @@ class ProviderBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (fileCount > 0) {
|
if (fileCount > 0) {
|
||||||
log.success(` ${provider}: ${fileCount} modules ready`);
|
// log.success(` ${provider}: ${fileCount} modules ready`);
|
||||||
} else {
|
} else {
|
||||||
log.warning(` ${provider}: No modules found`);
|
log.warning(` ${provider}: No modules found`);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ const cors = require("cors");
|
|||||||
const path = require("path");
|
const path = require("path");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const { execSync } = require("child_process");
|
const { execSync } = require("child_process");
|
||||||
|
const os = require("os");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Local development server for testing providers
|
* Local development server for testing providers
|
||||||
@@ -144,24 +145,28 @@ class DevServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
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", () => {
|
this.app.listen(this.port, "0.0.0.0", () => {
|
||||||
console.log(`
|
console.log(`
|
||||||
🚀 Vega Providers Dev Server Started!
|
🚀 Vega Providers Dev Server Started!
|
||||||
|
|
||||||
📡 Server URL: http://localhost:${this.port}
|
📡 Server URL: http://localhost:${this.port}
|
||||||
📱 Mobile URL: http://<your-ip>:${this.port}
|
📱 Mobile URL: http://${localIp}:${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
|
|
||||||
|
|
||||||
💡 Usage:
|
💡 Usage:
|
||||||
1. Run 'node build.js' to build providers
|
1. Run 'npm run auto' to to start the dev server ☑️
|
||||||
2. Update vega app to use: http://localhost:${this.port}
|
2. Update vega app to use: http://${localIp}:${this.port}
|
||||||
3. Test your providers!
|
3. Test your providers!
|
||||||
|
|
||||||
🔄 Auto-rebuild: POST to /build to rebuild after changes
|
🔄 Auto-rebuild: POST to /build to rebuild after changes
|
||||||
|
|||||||
Reference in New Issue
Block a user