Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

style(plugins): keep the runtime and the SDK within their size baselines

Mauriceba043cb1c074
diff --git a/server/src/nest/plugins/plugin-runtime.service.ts b/server/src/nest/plugins/plugin-runtime.service.ts
index e5179e98b..ce32ba8f1 100644
--- a/server/src/nest/plugins/plugin-runtime.service.ts
+++ b/server/src/nest/plugins/plugin-runtime.service.ts
@@ -435,7 +435,7 @@ export class PluginRuntimeService implements OnApplicationBootstrap, OnModuleDes
// errors (each body is wrapped in try/catch); the .catch below is defense-in-
// depth against a future regression, same shape as the pruneErrorLog call in
// the onLog hook above.
- void this.fireDueScheduled().catch(() => { /* fireDueScheduled already handles its own errors — this is a backstop */ });
+ void this.fireDueScheduled().catch(() => { /* a backstop: fireDueScheduled handles its own errors */ });
void this.drainUserErasures();
});
}
@@ -1020,7 +1020,7 @@ export class PluginRuntimeService implements OnApplicationBootstrap, OnModuleDes
this.stopWatch(id);
removePluginCodeEntry(dest); // drop any prior link — never follows into the author's source
fs.mkdirSync(path.dirname(dest), { recursive: true });
- fs.symlinkSync(sourceDir, dest, 'junction'); // Windows junction (no elevation); POSIX ignores the type -> dir symlink
+ fs.symlinkSync(sourceDir, dest, 'junction'); // Windows junction (no elevation); POSIX: a dir symlink
await discoverPlugins(this.discoveryRepos); // registers/updates the row from the linked manifest, INACTIVE
// Same as a sideload: the plugin has left the registry trust model, so a block that
// described a refused REGISTRY update no longer describes the code that will run.
@@ -1161,7 +1161,7 @@ export class PluginRuntimeService implements OnApplicationBootstrap, OnModuleDes
invoke(id: string, method: string, params: Record<string, unknown>, actingUserId?: number): Promise<unknown> {
return this.supervisor.invoke(id, method, params, { actingUserId });
}
- /** Ids of active plugins implementing a provider hook (e.g. 'placeDetailProvider'), or one optional function of it. */
+ /** Ids of active plugins implementing a provider hook ('placeDetailProvider'), or one optional function of it. */
providersOf(hook: string, fn?: string): string[] {
return this.supervisor.providersOf(hook, fn);
}
diff --git a/server/src/nest/plugins/runtime/plugin-sdk.ts b/server/src/nest/plugins/runtime/plugin-sdk.ts
index 3b848bbd0..7a29cc324 100644
--- a/server/src/nest/plugins/runtime/plugin-sdk.ts
+++ b/server/src/nest/plugins/runtime/plugin-sdk.ts
@@ -127,7 +127,7 @@ export interface PluginContext {
listNotes(tripId: number): Promise<unknown[]>;
/** A trip's polls (with options + voters). Needs 'db:read:collab'. */
listPolls(tripId: number): Promise<unknown[]>;
- /** A trip's chat messages (newest 100, oldest first; `before` = a message id to page back). Needs 'db:read:collab'. */
+ /** A trip's chat messages: newest 100, oldest first; `before` pages back from a message. Needs 'db:read:collab'. */
listMessages(tripId: number, before?: number): Promise<unknown[]>;
createNote(tripId: number, input: { title: string; content?: string; category?: string; color?: string; website?: string; pinned?: boolean }): Promise<unknown>;
createPoll(tripId: number, input: { question: string; options: unknown[]; multiple?: boolean; deadline?: string }): Promise<unknown>;
@@ -175,7 +175,7 @@ export interface PluginContext {
};
/** Exchange rates (tenant-free, cached upstream). Needs 'rates:read'. */
rates: {
- /** A map of quote → rate relative to `base` (e.g. base 'EUR' → { USD: 1.08, ... }). `null` on an upstream failure. */
+ /** A map of quote → rate relative to `base` (base 'EUR' → { USD: 1.08 }). `null` on an upstream failure. */
get(base: string): Promise<Record<string, number> | null>;
};
/** The global place-category reference list (read-only). Needs 'db:read:categories'. */
@@ -450,7 +450,7 @@ export interface SearchRequest {
}
export interface SearchProvider {
search(request: SearchRequest, ctx: PluginContext): Promise<SearchResultPlace[]>;
- /** Optional: the same question while it is typed (#2221). The host only calls it when the child reported it at load. */
+ /** Optional: the same question while it is typed (#2221). The host calls it only if the child reported it at load. */
suggest?(request: SearchRequest, ctx: PluginContext): Promise<SearchResultPlace[]>;
}
/**