@objectstack/core 1.0.6 → 1.0.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@objectstack/core",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Microkernel Core for ObjectStack",
6
6
  "type": "module",
@@ -15,7 +15,7 @@
15
15
  "pino": "^10.3.0",
16
16
  "pino-pretty": "^13.1.3",
17
17
  "zod": "^4.3.6",
18
- "@objectstack/spec": "1.0.6"
18
+ "@objectstack/spec": "1.0.8"
19
19
  },
20
20
  "peerDependencies": {
21
21
  "pino": "^8.0.0"
@@ -64,6 +64,7 @@ export function createApiRegistryPlugin(
64
64
 
65
65
  return {
66
66
  name: 'com.objectstack.core.api-registry',
67
+ type: 'standard',
67
68
  version: '1.0.0',
68
69
 
69
70
  init: async (ctx: PluginContext) => {
@@ -349,10 +349,15 @@ export class PluginLoader {
349
349
  // Private helper methods
350
350
 
351
351
  private toPluginMetadata(plugin: Plugin): PluginMetadata {
352
- return {
353
- ...plugin,
354
- version: plugin.version || '0.0.0',
355
- } as PluginMetadata;
352
+ // Fix: Do not use object spread {...plugin} as it destroys the prototype chain for Class-based plugins.
353
+ // Instead, cast the original object and inject default values if missing.
354
+ const metadata = plugin as PluginMetadata;
355
+
356
+ if (!metadata.version) {
357
+ metadata.version = '0.0.0';
358
+ }
359
+
360
+ return metadata;
356
361
  }
357
362
 
358
363
  private validatePluginStructure(plugin: PluginMetadata): void {
package/src/types.ts CHANGED
@@ -73,6 +73,12 @@ export interface Plugin {
73
73
  */
74
74
  version?: string;
75
75
 
76
+ /**
77
+ * Plugin type (standard, ui, driver, server, app, theme, agent)
78
+ * @default 'standard'
79
+ */
80
+ type?: string;
81
+
76
82
  /**
77
83
  * List of other plugin names that this plugin depends on.
78
84
  * The kernel ensures these plugins are initialized before this one.