@bbki.ng/site 5.5.10 → 5.5.11

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @bbki.ng/site
2
2
 
3
+ ## 5.5.11
4
+
5
+ ### Patch Changes
6
+
7
+ - ee1feb1: plugin loading error
8
+
3
9
  ## 5.5.10
4
10
 
5
11
  ### Patch Changes
package/index.d.ts CHANGED
@@ -1,2 +1,5 @@
1
1
  declare const GLOBAL_BBKING_VERSION: string;
2
2
  declare const GLOBAL_COMMIT_HASH: string;
3
+ interface ImportMeta {
4
+ glob: (pattern: string) => Record<string, () => Promise<any>>;
5
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbki.ng/site",
3
- "version": "5.5.10",
3
+ "version": "5.5.11",
4
4
  "description": "code behind bbki.ng",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -2,6 +2,7 @@ import { IHostContext } from '#/types/hostApi';
2
2
  import { registry } from './registry';
3
3
  import type { SlotName, HookPoint } from '#/types/slots';
4
4
  import { IPlugin } from '#/types/plugin';
5
+ const pluginModules = import.meta.glob('../plugins/*/index.ts');
5
6
 
6
7
  class PluginManager {
7
8
  private activePlugins: Map<string, IPlugin> = new Map();
@@ -41,8 +42,15 @@ class PluginManager {
41
42
  // try load plugin
42
43
  this.loading.add(pluginId);
43
44
 
45
+ const modulePath = `../plugins/${pluginId}/index.ts`;
46
+ const moduleLoader = pluginModules[modulePath];
47
+ if (!moduleLoader) {
48
+ console.error(`Plugin ${pluginId} not found in registry`);
49
+ return;
50
+ }
51
+
44
52
  try {
45
- const module = await import(`../plugins/${pluginId}`);
53
+ const module = await moduleLoader();
46
54
 
47
55
  const p: IPlugin = module.default;
48
56