@pipelab/core-node 1.0.0-beta.16 → 1.0.0-beta.17
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/CHANGELOG.md +9 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +24 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/plugins-registry.ts +19 -16
- package/src/utils/github.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipelab/core-node",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.17",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Pipelab automation engine for Node.js",
|
|
6
6
|
"license": "FSL-1.1-MIT",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"type-fest": "4.39.0",
|
|
41
41
|
"ws": "8.18.3",
|
|
42
42
|
"yauzl": "2.10.0",
|
|
43
|
-
"@pipelab/constants": "1.0.0-beta.
|
|
44
|
-
"@pipelab/shared": "1.0.0-beta.
|
|
43
|
+
"@pipelab/constants": "1.0.0-beta.15",
|
|
44
|
+
"@pipelab/shared": "1.0.0-beta.13"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/adm-zip": "0.5.7",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"tsdown": "0.21.2",
|
|
57
57
|
"typescript": "^5.0.0",
|
|
58
58
|
"vitest": "3.1.4",
|
|
59
|
-
"@pipelab/tsconfig": "1.0.0-beta.
|
|
59
|
+
"@pipelab/tsconfig": "1.0.0-beta.13"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"build": "tsdown",
|
package/src/plugins-registry.ts
CHANGED
|
@@ -298,23 +298,26 @@ export const builtInPlugins = async (options: { context: PipelabContext }): Prom
|
|
|
298
298
|
|
|
299
299
|
console.log(`[Plugins] Total plugins to load on startup:`, Array.from(pluginsToLoad.entries()));
|
|
300
300
|
|
|
301
|
-
// Now load all collected plugins
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
301
|
+
// Now load all collected plugins in parallel
|
|
302
|
+
const loadPromises = Array.from(pluginsToLoad.entries()).map(
|
|
303
|
+
async ([packageName, version]) => {
|
|
304
|
+
sendStartupProgress(`Loading plugin: ${packageName}`);
|
|
305
|
+
const pluginStart = Date.now();
|
|
306
|
+
try {
|
|
307
|
+
const plugin = await loadCustomPlugin(packageName, version, options);
|
|
308
|
+
if (plugin) {
|
|
309
|
+
registerPlugins([plugin]);
|
|
310
|
+
webSocketServer.broadcast("plugin:loaded", { plugin });
|
|
311
|
+
console.log(
|
|
312
|
+
`[Plugins] Loaded ${packageName}@${version} in ${Date.now() - pluginStart}ms`,
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
} catch (err) {
|
|
316
|
+
console.error(`[Plugins] Failed to load plugin ${packageName} at startup:`, err);
|
|
313
317
|
}
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
}
|
|
318
|
+
},
|
|
319
|
+
);
|
|
320
|
+
await Promise.all(loadPromises);
|
|
318
321
|
|
|
319
322
|
console.log(`[Plugins] All startup plugins loaded in ${Date.now() - totalStart}ms.`);
|
|
320
323
|
sendStartupProgress("All plugins loaded.");
|
package/src/utils/github.ts
CHANGED
|
@@ -38,6 +38,7 @@ export async function fetchPackageReleases(
|
|
|
38
38
|
"User-Agent": "Pipelab-Desktop-Updater",
|
|
39
39
|
Accept: "application/vnd.github.v3+json",
|
|
40
40
|
},
|
|
41
|
+
signal: AbortSignal.timeout(10000),
|
|
41
42
|
},
|
|
42
43
|
);
|
|
43
44
|
if (response.ok) {
|
|
@@ -55,6 +56,7 @@ export async function fetchPackageReleases(
|
|
|
55
56
|
"User-Agent": "Pipelab-Desktop-Updater",
|
|
56
57
|
Accept: "application/vnd.github.v3+json",
|
|
57
58
|
},
|
|
59
|
+
signal: AbortSignal.timeout(10000),
|
|
58
60
|
});
|
|
59
61
|
|
|
60
62
|
if (!response.ok) {
|
|
@@ -104,6 +106,7 @@ export async function fetchPackageReleases(
|
|
|
104
106
|
"User-Agent": "Pipelab-Desktop-Updater",
|
|
105
107
|
Accept: "application/vnd.github.v3+json",
|
|
106
108
|
},
|
|
109
|
+
signal: AbortSignal.timeout(10000),
|
|
107
110
|
},
|
|
108
111
|
);
|
|
109
112
|
|