@hamak/microkernel-impl 0.1.0 → 0.2.0
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/dist/runtime/di.d.ts +1 -1
- package/dist/runtime/di.d.ts.map +1 -1
- package/dist/runtime/host.d.ts +2 -2
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/loader.d.ts +2 -2
- package/dist/runtime/loader.d.ts.map +1 -1
- package/dist/runtime/registries.d.ts +1 -1
- package/dist/runtime/registries.d.ts.map +1 -1
- package/dist/ui/adapter.d.ts +1 -1
- package/dist/ui/adapter.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/runtime/di.ts +1 -1
- package/src/runtime/host.ts +2 -2
- package/src/runtime/loader.ts +2 -2
- package/src/runtime/registries.ts +1 -1
- package/src/ui/adapter.ts +1 -1
package/dist/runtime/di.d.ts
CHANGED
package/dist/runtime/di.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"di.d.ts","sourceRoot":"","sources":["../../src/runtime/di.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"di.d.ts","sourceRoot":"","sources":["../../src/runtime/di.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAE9D,wBAAgB,UAAU,CAAC,IAAI,GAAE,KAAK,EAAO,GAAG,cAAc,CAA2D;AACzH,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAC,CAAY;IAAC,OAAO,CAAC,SAAS,CAA8B;IAAC,OAAO,CAAC,SAAS,CAAyB;gBAC1G,MAAM,CAAC,EAAE,SAAS;IAC9B,WAAW,IAAI,SAAS;IACxB,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI;IACnC,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC;CAY/B"}
|
package/dist/runtime/host.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ActivateContext, IChildHost, IHost, PluginManifest, Provider } from '@
|
|
1
|
+
import type { ActivateContext, IChildHost, IHost, PluginManifest, Provider } from '@hamak/microkernel-api';
|
|
2
2
|
import { Container } from './di';
|
|
3
|
-
import type { PluginModule } from '@
|
|
3
|
+
import type { PluginModule } from '@hamak/microkernel-spi';
|
|
4
4
|
export declare class Host implements IHost {
|
|
5
5
|
readonly root: Container;
|
|
6
6
|
private readonly _registry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../src/runtime/host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAwC,MAAM,
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../src/runtime/host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAwC,MAAM,wBAAwB,CAAC;AACjJ,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAGjC,OAAO,KAAK,EAAyB,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAoDlF,qBAAa,IAAK,YAAW,KAAK;IAChC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAiB;IAC3C,OAAO,CAAC,GAAG,CAAC,CAAsB;IAClC,iBAAiB,CAAC,EAAE,eAAe,CAAC;gBAExB,gBAAgB,GAAE,QAAQ,EAAO,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAOlE,WAAW,CAAC,SAAS,EAAE,KAAK,CAAC,MAAM,GAAC,cAAc,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzE;;;;;OAKG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI;IAIlF;;;;OAIG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAInD;;;OAGG;IACH,WAAW,IAAI,cAAc,EAAE;IAIzB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IAkCzC,eAAe,CAAC,SAAS,GAAE,QAAQ,EAAO,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,UAAU;CAMnF"}
|
package/dist/runtime/loader.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PluginManifest } from '@
|
|
2
|
-
import type { PluginModule } from '@
|
|
1
|
+
import type { PluginManifest } from '@hamak/microkernel-api';
|
|
2
|
+
import type { PluginModule } from '@hamak/microkernel-spi';
|
|
3
3
|
declare class PluginRecord {
|
|
4
4
|
manifest: PluginManifest;
|
|
5
5
|
module?: PluginModule | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/runtime/loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/runtime/loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAG3D,cAAM,YAAY;IACG,QAAQ,EAAE,cAAc;IAAS,MAAM,CAAC;gBAAxC,QAAQ,EAAE,cAAc,EAAS,MAAM,CAAC,0BAAc;CAC1E;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAmC;IAEjD;;OAEG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM;IAIhB;;OAEG;IACH,IAAI;IAIJ;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI;IAI5E;;OAEG;IACG,aAAa,CAAC,cAAc,EAAE,KAAK,CAAC,MAAM,GAAG,cAAc,CAAC;IAiBlE;;OAEG;IACH,iBAAiB,CAAC,KAAK,GAAE,MAAM,EAAE,GAAG,KAAa;CAKlD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CommandRegistry, Hooks, ViewRegistry } from '@
|
|
1
|
+
import type { CommandRegistry, Hooks, ViewRegistry } from '@hamak/microkernel-api';
|
|
2
2
|
export declare function createHooks(): Hooks;
|
|
3
3
|
export declare function createCommandRegistry(): CommandRegistry;
|
|
4
4
|
export declare function createViewRegistry(): ViewRegistry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registries.d.ts","sourceRoot":"","sources":["../../src/runtime/registries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"registries.d.ts","sourceRoot":"","sources":["../../src/runtime/registries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACnF,wBAAgB,WAAW,IAAI,KAAK,CAA2T;AAC/V,wBAAgB,qBAAqB,IAAI,eAAe,CAAmR;AAC3U,wBAAgB,kBAAkB,IAAI,YAAY,CAAiM"}
|
package/dist/ui/adapter.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ProvidedServices } from '@
|
|
1
|
+
import type { ProvidedServices } from '@hamak/microkernel-api';
|
|
2
2
|
export declare const UI: {
|
|
3
3
|
registerView(ctx: ProvidedServices, slot: string, viewFactory: any): void;
|
|
4
4
|
getViews(ctx: ProvidedServices, slot: string): any[];
|
package/dist/ui/adapter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/ui/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/ui/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,eAAO,MAAM,EAAE;sBAAuB,gBAAgB,QAAQ,MAAM,eAAe,GAAG;kBAA2D,gBAAgB,QAAQ,MAAM;CAAmC,CAAC"}
|
package/package.json
CHANGED
package/src/runtime/di.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Provider, Token } from '@
|
|
1
|
+
import type { Provider, Token } from '@hamak/microkernel-api';
|
|
2
2
|
const INJECT_KEY = Symbol('di:inject');
|
|
3
3
|
export function Injectable(deps: Token[] = []): ClassDecorator { return (t: any) => { (t as any)[INJECT_KEY] = deps; }; }
|
|
4
4
|
export class Container {
|
package/src/runtime/host.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { ActivateContext, IChildHost, IHost, PluginManifest, Provider, CommandRegistry, ViewRegistry, Hooks } from '@
|
|
1
|
+
import type { ActivateContext, IChildHost, IHost, PluginManifest, Provider, CommandRegistry, ViewRegistry, Hooks } from '@hamak/microkernel-api';
|
|
2
2
|
import { Container } from './di';
|
|
3
3
|
import { createCommandRegistry, createHooks, createViewRegistry } from './registries';
|
|
4
4
|
import { PluginRegistry } from './loader';
|
|
5
|
-
import type { InitializationContext, PluginModule } from '@
|
|
5
|
+
import type { InitializationContext, PluginModule } from '@hamak/microkernel-spi';
|
|
6
6
|
|
|
7
7
|
type SharedRegistries = {
|
|
8
8
|
commands: CommandRegistry;
|
package/src/runtime/loader.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PluginManifest } from '@
|
|
2
|
-
import type { PluginModule } from '@
|
|
1
|
+
import type { PluginManifest } from '@hamak/microkernel-api';
|
|
2
|
+
import type { PluginModule } from '@hamak/microkernel-spi';
|
|
3
3
|
import { topologicalSort } from './graph-utils';
|
|
4
4
|
|
|
5
5
|
class PluginRecord {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CommandRegistry, Hooks, ViewRegistry } from '@
|
|
1
|
+
import type { CommandRegistry, Hooks, ViewRegistry } from '@hamak/microkernel-api';
|
|
2
2
|
export function createHooks(): Hooks { const map = new Map<string, Set<(...a:any[])=>void>>(); return { on(e: string,f: (...a: any[]) => void){ if(!map.has(e)) map.set(e,new Set()); map.get(e)!.add(f); }, off(e: string,f: (...a: any[]) => void){ map.get(e)?.delete(f); }, emit(e: string,...a: any[]){ for(const fn of map.get(e) ?? []) fn(...a); } }; }
|
|
3
3
|
export function createCommandRegistry(): CommandRegistry { const h=new Map<string,(...a:any[])=>any>(); return { register(id: string,fn: (...a:any[])=>any){h.set(id,fn);}, run(id: string,...a: any[]){const fn=h.get(id); if(!fn) throw new Error(`Command not found: ${id}`); return fn(...a);}, has(id: string){return h.has(id);} }; }
|
|
4
4
|
export function createViewRegistry(): ViewRegistry { const s=new Map<string,any[]>(); return { register(slot: string,v: any){ const arr=s.get(slot)??[]; arr.push(v); s.set(slot,arr); }, list(slot: string){ return [...(s.get(slot)??[])]; } }; }
|
package/src/ui/adapter.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ProvidedServices } from '@
|
|
1
|
+
import type { ProvidedServices } from '@hamak/microkernel-api';
|
|
2
2
|
export const UI = { registerView(ctx: ProvidedServices, slot: string, viewFactory: any){ ctx.views.register(slot, viewFactory); }, getViews(ctx: ProvidedServices, slot: string){ return ctx.views.list(slot); } };
|