Skip to content

Commit 06d5600

Browse files
committed
refactor: downgrade internal logs to debug and remove obsolete npm and simulation files
1 parent 64586d6 commit 06d5600

9 files changed

Lines changed: 57 additions & 226 deletions

File tree

apps/ui/src/components/AddNodeButton.vue

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -334,22 +334,8 @@ watchEffect(() => {
334334
watchDebounced(
335335
search,
336336
async (newQuery) => {
337-
const q = newQuery.trim();
338-
if (!q) {
339-
registryResults.value = [];
340-
return;
341-
}
342-
searchingRegistry.value = true;
343-
try {
344-
const res = await api.execute("plugin:search", { query: q });
345-
if (res.type === "success") {
346-
registryResults.value = res.result.results;
347-
}
348-
} catch (e) {
349-
console.error("Registry search error:", e);
350-
} finally {
351-
searchingRegistry.value = false;
352-
}
337+
// Disable remote registry search for now
338+
registryResults.value = [];
353339
},
354340
{ debounce: 500 },
355341
);

assets/asset-electron/template/.npmrc

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/core-node/scratch/simulate-updates.ts

Lines changed: 0 additions & 120 deletions
This file was deleted.

packages/core-node/src/handlers/plugins.ts

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -271,27 +271,12 @@ export const registerPluginsHandlers = (context: PipelabContext) => {
271271
});
272272

273273
if (isRegistered) {
274-
continue; // already loaded, nothing to do
274+
loaded.push(packageName);
275+
continue;
275276
}
276277

277-
try {
278-
console.log(
279-
`[Plugins] JIT loading plugin "${packageName}@${mappedVersion}" for pipeline...`,
280-
);
281-
const plugin = await loadCustomPlugin(packageName, mappedVersion, { context });
282-
if (plugin) {
283-
registerPlugins([plugin]);
284-
webSocketServer.broadcast("plugin:loaded", { plugin });
285-
loaded.push(packageName);
286-
console.log(`[Plugins] JIT loaded "${packageName}" successfully.`);
287-
} else {
288-
console.warn(`[Plugins] JIT load for "${packageName}" returned no plugin.`);
289-
failed.push(packageName);
290-
}
291-
} catch (e: any) {
292-
console.error(`[Plugins] JIT load failed for "${packageName}":`, e);
293-
failed.push(packageName);
294-
}
278+
console.warn(`[Plugins] Plugin "${packageName}" is required but not loaded at startup.`);
279+
failed.push(packageName);
295280
}
296281

297282
send({

packages/core-node/src/plugins-registry.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,21 +80,20 @@ export const loadPipelabPlugin = async (id: string, options: { context: PipelabC
8080
);
8181
const fetchDuration = Date.now() - fetchStart;
8282

83-
console.log(`[Plugins] [${id}] Attempting to import from: ${entryPoint}`);
83+
console.debug(`[Plugins] [${id}] Attempting to import from: ${entryPoint}`);
8484
if (!existsSync(entryPoint)) {
8585
console.error(`[Plugins] [${id}] CRITICAL: Plugin entry point not found at ${entryPoint}`);
8686
try {
8787
const files = await readdir(packageDir, { recursive: true });
88-
console.log(`[Plugins] [${id}] Directory contents:`, files);
88+
console.debug(`[Plugins] [${id}] Directory contents:`, files);
8989
} catch (e) {}
9090
}
9191

9292
const importStart = Date.now();
9393
const pluginModule = await import(pathToFileURL(entryPoint).href);
9494
const importDuration = Date.now() - importStart;
9595
const totalDuration = Date.now() - start;
96-
console.log(
97-
`[Plugins] [${id}] Successfully loaded from: ${packageDir} (fetch: ${fetchDuration}ms, import: ${importDuration}ms, total: ${totalDuration}ms)`,
96+
console.debug(`[Plugins] [${id}] Successfully loaded from: ${packageDir} (fetch: ${fetchDuration}ms, import: ${importDuration}ms, total: ${totalDuration}ms)`,
9897
);
9998

10099
const plugin = pluginModule.default;
@@ -125,8 +124,7 @@ export const loadCustomPlugin = async (
125124
});
126125
const fetchDuration = Date.now() - fetchStart;
127126

128-
console.log(
129-
`[Plugins] [${packageName}] Attempting to import custom plugin from: ${entryPoint}`,
127+
console.debug(`[Plugins] [${packageName}] Attempting to import custom plugin from: ${entryPoint}`,
130128
);
131129
if (!existsSync(entryPoint)) {
132130
console.error(
@@ -139,8 +137,7 @@ export const loadCustomPlugin = async (
139137
const pluginModule = await import(pathToFileURL(entryPoint).href);
140138
const importDuration = Date.now() - importStart;
141139
const totalDuration = Date.now() - start;
142-
console.log(
143-
`[Plugins] [${packageName}] Successfully loaded custom plugin from: ${packageDir} (fetch: ${fetchDuration}ms, import: ${importDuration}ms, total: ${totalDuration}ms)`,
140+
console.debug(`[Plugins] [${packageName}] Successfully loaded custom plugin from: ${packageDir} (fetch: ${fetchDuration}ms, import: ${importDuration}ms, total: ${totalDuration}ms)`,
144141
);
145142

146143
const plugin = pluginModule.default;
@@ -204,13 +201,13 @@ export async function findInstalledPlugins(
204201
}
205202

206203
export const builtInPlugins = async (options: { context: PipelabContext }): Promise<void> => {
207-
console.log("[Plugins] Starting background plugin loading...");
204+
console.debug("[Plugins] Starting background plugin loading...");
208205

209206
// Pre-ensure Node.js and PNPM once in parallel so plugins don't have to wait for them
210207
sendStartupProgress("Preparing environment...");
211208
const envStart = Date.now();
212209
await Promise.all([ensureNodeJS(options.context), ensurePNPM(options.context)]);
213-
console.log(`[Plugins] Environment preparation took ${Date.now() - envStart}ms`);
210+
console.debug(`[Plugins] Environment preparation took ${Date.now() - envStart}ms`);
214211

215212
const { usePlugins } = await import("@pipelab/shared");
216213
const { registerPlugins } = usePlugins();
@@ -296,7 +293,10 @@ export const builtInPlugins = async (options: { context: PipelabContext }): Prom
296293
console.error(`[Plugins] Failed to load settings config on startup:`, e);
297294
}
298295

299-
console.log(`[Plugins] Total plugins to load on startup:`, Array.from(pluginsToLoad.entries()));
296+
const pluginList = Array.from(pluginsToLoad.keys())
297+
.map((p) => ` - ${p}`)
298+
.join("\n");
299+
console.log(`\n[Plugins] Loading plugins in background:\n${pluginList}\n`);
300300

301301
// Now load all collected plugins in parallel
302302
const loadPromises = Array.from(pluginsToLoad.entries()).map(async ([packageName, version]) => {
@@ -307,8 +307,7 @@ export const builtInPlugins = async (options: { context: PipelabContext }): Prom
307307
if (plugin) {
308308
registerPlugins([plugin]);
309309
webSocketServer.broadcast("plugin:loaded", { plugin });
310-
console.log(
311-
`[Plugins] Loaded ${packageName}@${version} in ${Date.now() - pluginStart}ms`,
310+
console.debug(`[Plugins] Loaded ${packageName}@${version} in ${Date.now() - pluginStart}ms`,
312311
);
313312
}
314313
} catch (err) {
@@ -317,7 +316,7 @@ export const builtInPlugins = async (options: { context: PipelabContext }): Prom
317316
});
318317
await Promise.all(loadPromises);
319318

320-
console.log(`[Plugins] All startup plugins loaded in ${Date.now() - totalStart}ms.`);
319+
console.log(`\n[Plugins] All startup plugins loaded in ${Date.now() - totalStart}ms.\n`);
321320
sendStartupProgress("All plugins loaded.");
322321
setTimeout(() => {
323322
webSocketServer.broadcast("startup:progress", { type: "done" });

packages/core-node/src/server.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export interface ServeOptions {
2121
}
2222

2323
export const sendStartupProgress = (message: string) => {
24-
console.log(`[Startup Progress] ${message}`);
2524
webSocketServer.broadcast("startup:progress", {
2625
type: "progress",
2726
data: { message },

packages/core-node/src/utils.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,25 +129,26 @@ export const executeGraphWithHistory = async ({
129129

130130
// Ensure all plugins used in the graph are downloaded and registered
131131
const { registerPlugins, plugins: registeredPlugins } = usePlugins();
132+
// JIT loading is intentionally removed here so plugins must be loaded at app startup.
133+
// Fail-fast if any required plugin is not loaded
132134
const pluginIds = new Set(
133135
graph.map((node: any) => node.origin?.pluginId).filter(Boolean),
134136
) as Set<string>;
135137

138+
const missingPlugins: string[] = [];
136139
for (const pluginId of pluginIds) {
137140
const isRegistered = registeredPlugins.value.some((p) => p.id === pluginId);
138141
if (!isRegistered) {
139-
logger().info(`[Runner] Plugin "${pluginId}" not found, attempting to load...`);
140-
const pluginDefinition = await loadPipelabPlugin(pluginId, { context: ctx });
141-
142-
if (pluginDefinition) {
143-
registerPlugins([pluginDefinition]);
144-
logger().info(`[Runner] Plugin "${pluginId}" loaded and registered successfully`);
145-
} else {
146-
logger().error(`[Runner] Failed to load or register plugin "${pluginId}"`);
147-
}
142+
missingPlugins.push(pluginId);
148143
}
149144
}
150145

146+
if (missingPlugins.length > 0) {
147+
const errorMsg = `Fail-fast: The following required plugins are not loaded: ${missingPlugins.join(", ")}. Please ensure they are installed and enabled in settings.`;
148+
logger().error(`[Runner] ${errorMsg}`);
149+
throw new Error(errorMsg);
150+
}
151+
151152
logger().info(`[Sandbox] Execution sandbox created at: ${sandboxPath}`);
152153
const settingsFile = await setupSettingsConfigFile(ctx);
153154
const config = await settingsFile.getConfig();

0 commit comments

Comments
 (0)