Skip to content

Commit 4f7e6ef

Browse files
committed
Refactor code structure for improved readability and maintainability
1 parent 17f5935 commit 4f7e6ef

25 files changed

Lines changed: 351 additions & 308 deletions

examples/app-host/src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ObjectKernel, DriverPlugin, AppPlugin } from '@objectstack/runtime';
1+
import { ObjectKernel, DriverPlugin, AppPlugin, createApiRegistryPlugin } from '@objectstack/runtime';
22
import { InMemoryDriver } from '@objectstack/driver-memory';
33
import { ObjectQLPlugin } from '@objectstack/objectql';
44
import { HonoServerPlugin } from '@objectstack/plugin-hono-server';
@@ -30,6 +30,9 @@ import BiPluginManifest from '@example/plugin-bi/objectstack.config';
3030
await kernel.use(new AppPlugin(TodoApp));
3131
await kernel.use(new AppPlugin(BiPluginManifest));
3232

33+
// Register API Registry (Required for Hono Server)
34+
await kernel.use(createApiRegistryPlugin());
35+
3336
// Load the Hono Server Plugin
3437
await kernel.use(new HonoServerPlugin({
3538
port: 3004,

packages/core/src/api-registry.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,8 +657,8 @@ describe('ApiRegistry', () => {
657657
});
658658

659659
const snapshot = registry.getRegistry();
660-
expect(snapshot.byType?.rest.length).toBe(2);
661-
expect(snapshot.byType?.graphql.length).toBe(1);
660+
expect(snapshot.byType?.rest?.length).toBe(2);
661+
expect(snapshot.byType?.graphql?.length).toBe(1);
662662
});
663663
});
664664

packages/core/src/dependency-resolver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type {
33
VersionConstraint,
44
CompatibilityLevel,
55
DependencyConflict
6-
} from '@objectstack/spec/system';
6+
} from '@objectstack/spec/kernel';
77
import type { ObjectLogger } from './logger.js';
88

99
/**

packages/core/src/health-monitor.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { describe, it, expect, beforeEach } from 'vitest';
22
import { PluginHealthMonitor } from './health-monitor.js';
33
import { createLogger } from './logger.js';
4-
import type { PluginHealthCheck } from '@objectstack/spec/system';
4+
import type { PluginHealthCheck } from '@objectstack/spec/kernel';
55

66
describe('PluginHealthMonitor', () => {
77
let monitor: PluginHealthMonitor;

packages/core/src/health-monitor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type {
22
PluginHealthStatus,
33
PluginHealthCheck,
44
PluginHealthReport
5-
} from '@objectstack/spec/system';
5+
} from '@objectstack/spec/kernel';
66
import type { ObjectLogger } from './logger.js';
77
import type { Plugin } from './types.js';
88

packages/core/src/hot-reload.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type {
22
HotReloadConfig,
33
PluginStateSnapshot
4-
} from '@objectstack/spec/system';
4+
} from '@objectstack/spec/kernel';
55
import type { ObjectLogger } from './logger.js';
66
import type { Plugin } from './types.js';
77

packages/core/src/security/permission-manager.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { describe, it, expect, beforeEach } from 'vitest';
22
import { PluginPermissionManager } from './permission-manager.js';
33
import { createLogger } from '../logger.js';
4-
import type { PermissionSet } from '@objectstack/spec/system';
4+
import type { PermissionSet } from '@objectstack/spec/kernel';
55

66
describe('PluginPermissionManager', () => {
77
let manager: PluginPermissionManager;

packages/core/src/security/permission-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type {
33
PermissionSet,
44
PermissionAction,
55
ResourceType
6-
} from '@objectstack/spec/system';
6+
} from '@objectstack/spec/kernel';
77
import type { ObjectLogger } from '../logger.js';
88

99
/**

packages/core/src/security/plugin-permission-enforcer.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { describe, it, expect, beforeEach } from 'vitest';
22
import { PluginPermissionEnforcer, SecurePluginContext } from './plugin-permission-enforcer.js';
33
import { createLogger } from '../logger.js';
4-
import type { PluginCapability } from '@objectstack/spec/system';
4+
import type { PluginCapability } from '@objectstack/spec/kernel';
55
import type { PluginContext } from '../types.js';
66

77
describe('PluginPermissionEnforcer', () => {

packages/core/src/security/plugin-permission-enforcer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Logger } from '@objectstack/spec/contracts';
2-
import type { PluginCapability } from '@objectstack/spec/system';
2+
import type { PluginCapability } from '@objectstack/spec/kernel';
33
import type { PluginContext } from '../types.js';
44

55
/**

0 commit comments

Comments
 (0)