@kanian77/choux 0.2.3 → 0.2.4
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/core/ChouxFacade.d.ts +17 -0
- package/dist/core/ChouxFacade.d.ts.map +1 -0
- package/dist/core/ChouxFacade.js +133 -0
- package/dist/core/ChouxFacade.js.map +1 -0
- package/dist/core/IChouxFacade.d.ts +4 -0
- package/dist/core/IChouxFacade.d.ts.map +1 -0
- package/dist/core/IChouxFacade.js +2 -0
- package/dist/core/IChouxFacade.js.map +1 -0
- package/dist/lib/types/tokens.d.ts +1 -0
- package/dist/lib/types/tokens.d.ts.map +1 -1
- package/dist/lib/types/tokens.js +1 -0
- package/dist/lib/types/tokens.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HookFn, LoadedPlugin, PluginModule } from '../lib/types';
|
|
2
|
+
import { IChouxFacade } from './IChouxFacade';
|
|
3
|
+
export declare class ChouxFacade implements IChouxFacade {
|
|
4
|
+
private readonly pluginManager;
|
|
5
|
+
private readonly hookRegistry;
|
|
6
|
+
initializePlugin(pluginModule: PluginModule): Promise<LoadedPlugin>;
|
|
7
|
+
initializePlugins(pluginModules: PluginModule[]): Promise<void>;
|
|
8
|
+
shutdown(): Promise<void>;
|
|
9
|
+
getPlugin(name: string): LoadedPlugin | undefined;
|
|
10
|
+
getAllPlugins(): LoadedPlugin[];
|
|
11
|
+
register(name: string, fn: HookFn): void;
|
|
12
|
+
trigger(name: string, ...args: any[]): Promise<void>;
|
|
13
|
+
unregister(name: string, fn?: HookFn): void;
|
|
14
|
+
getHooks(name: string): HookFn[];
|
|
15
|
+
clear(): void;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=ChouxFacade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChouxFacade.d.ts","sourceRoot":"","sources":["../../src/core/ChouxFacade.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,MAAM,EAGN,YAAY,EAEZ,YAAY,EACb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,qBACa,WAAY,YAAW,YAAY;IAE9C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAkB;IAEhD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAiB;IAGxC,gBAAgB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;IAInE,iBAAiB,CAAC,aAAa,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/D,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAI/B,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;IAIjD,aAAa,IAAI,YAAY,EAAE;IAK/B,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IAIlC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1D,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;IAI3C,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE;IAIhC,KAAK,IAAI,IAAI;CAGd"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
+
var _, done = false;
|
|
7
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
+
var context = {};
|
|
9
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
+
if (kind === "accessor") {
|
|
14
|
+
if (result === void 0) continue;
|
|
15
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
+
}
|
|
20
|
+
else if (_ = accept(result)) {
|
|
21
|
+
if (kind === "field") initializers.unshift(_);
|
|
22
|
+
else descriptor[key] = _;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
+
done = true;
|
|
27
|
+
};
|
|
28
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
+
var useValue = arguments.length > 2;
|
|
30
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
+
}
|
|
33
|
+
return useValue ? value : void 0;
|
|
34
|
+
};
|
|
35
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
45
|
+
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
46
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
47
|
+
};
|
|
48
|
+
import { Inject, Service } from '@kanian77/tject';
|
|
49
|
+
import { CHOUX_FACADE_TOKEN, HOOK_REGISTRY_TOKEN, PLUGIN_MANAGER_TOKEN, } from '../lib/types';
|
|
50
|
+
let ChouxFacade = (() => {
|
|
51
|
+
let _classDecorators = [Service({ token: CHOUX_FACADE_TOKEN, lifecycle: 'singleton' })];
|
|
52
|
+
let _classDescriptor;
|
|
53
|
+
let _classExtraInitializers = [];
|
|
54
|
+
let _classThis;
|
|
55
|
+
let _pluginManager_decorators;
|
|
56
|
+
let _pluginManager_initializers = [];
|
|
57
|
+
let _pluginManager_extraInitializers = [];
|
|
58
|
+
let _hookRegistry_decorators;
|
|
59
|
+
let _hookRegistry_initializers = [];
|
|
60
|
+
let _hookRegistry_extraInitializers = [];
|
|
61
|
+
var ChouxFacade = _classThis = class {
|
|
62
|
+
// IPluginManager methods
|
|
63
|
+
initializePlugin(pluginModule) {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
return yield this.pluginManager.initializePlugin(pluginModule);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
initializePlugins(pluginModules) {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
return yield this.pluginManager.initializePlugins(pluginModules);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
shutdown() {
|
|
74
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
return yield this.pluginManager.shutdown();
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
getPlugin(name) {
|
|
79
|
+
return this.pluginManager.getPlugin(name);
|
|
80
|
+
}
|
|
81
|
+
getAllPlugins() {
|
|
82
|
+
return this.pluginManager.getAllPlugins();
|
|
83
|
+
}
|
|
84
|
+
// IHookRegistry methods
|
|
85
|
+
register(name, fn) {
|
|
86
|
+
return this.hookRegistry.register(name, fn);
|
|
87
|
+
}
|
|
88
|
+
trigger(name, ...args) {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
return yield this.hookRegistry.trigger(name, ...args);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
unregister(name, fn) {
|
|
94
|
+
return this.hookRegistry.unregister(name, fn);
|
|
95
|
+
}
|
|
96
|
+
getHooks(name) {
|
|
97
|
+
return this.hookRegistry.getHooks(name);
|
|
98
|
+
}
|
|
99
|
+
clear() {
|
|
100
|
+
return this.hookRegistry.clear();
|
|
101
|
+
}
|
|
102
|
+
constructor() {
|
|
103
|
+
Object.defineProperty(this, "pluginManager", {
|
|
104
|
+
enumerable: true,
|
|
105
|
+
configurable: true,
|
|
106
|
+
writable: true,
|
|
107
|
+
value: __runInitializers(this, _pluginManager_initializers, void 0)
|
|
108
|
+
});
|
|
109
|
+
Object.defineProperty(this, "hookRegistry", {
|
|
110
|
+
enumerable: true,
|
|
111
|
+
configurable: true,
|
|
112
|
+
writable: true,
|
|
113
|
+
value: (__runInitializers(this, _pluginManager_extraInitializers), __runInitializers(this, _hookRegistry_initializers, void 0))
|
|
114
|
+
});
|
|
115
|
+
__runInitializers(this, _hookRegistry_extraInitializers);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
__setFunctionName(_classThis, "ChouxFacade");
|
|
119
|
+
(() => {
|
|
120
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
121
|
+
_pluginManager_decorators = [Inject({ token: PLUGIN_MANAGER_TOKEN })];
|
|
122
|
+
_hookRegistry_decorators = [Inject({ token: HOOK_REGISTRY_TOKEN })];
|
|
123
|
+
__esDecorate(null, null, _pluginManager_decorators, { kind: "field", name: "pluginManager", static: false, private: false, access: { has: obj => "pluginManager" in obj, get: obj => obj.pluginManager, set: (obj, value) => { obj.pluginManager = value; } }, metadata: _metadata }, _pluginManager_initializers, _pluginManager_extraInitializers);
|
|
124
|
+
__esDecorate(null, null, _hookRegistry_decorators, { kind: "field", name: "hookRegistry", static: false, private: false, access: { has: obj => "hookRegistry" in obj, get: obj => obj.hookRegistry, set: (obj, value) => { obj.hookRegistry = value; } }, metadata: _metadata }, _hookRegistry_initializers, _hookRegistry_extraInitializers);
|
|
125
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
126
|
+
ChouxFacade = _classThis = _classDescriptor.value;
|
|
127
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
128
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
129
|
+
})();
|
|
130
|
+
return ChouxFacade = _classThis;
|
|
131
|
+
})();
|
|
132
|
+
export { ChouxFacade };
|
|
133
|
+
//# sourceMappingURL=ChouxFacade.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChouxFacade.js","sourceRoot":"","sources":["../../src/core/ChouxFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EAKnB,oBAAoB,GAErB,MAAM,cAAc,CAAC;IAIT,WAAW;4BADvB,OAAO,CAAC,EAAE,KAAK,EAAE,kBAA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;;;;;;;qCAH7C,MAAM,CAAC,EAAE,KAAK,EAAE,oBAAoB,EAAE,CAAC;oCAEvC,MAAM,CAAC,EAAE,KAAK,EAAE,mBAAmB,EAAE,CAAC;QADvC,yLAAiB,aAAa,6BAAb,aAAa,qGAAkB;QAEhD,sLAAiB,YAAY,6BAAZ,YAAY,mGAAiB;QAJhD,6KA+CC;;;QA/CY,uDAAW;;;;SAAX,WAAW"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IChouxFacade.d.ts","sourceRoot":"","sources":["../../src/core/IChouxFacade.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE7D,MAAM,WAAW,YAAa,SAAQ,aAAa,EAAE,cAAc;CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IChouxFacade.js","sourceRoot":"","sources":["../../src/core/IChouxFacade.ts"],"names":[],"mappings":""}
|
|
@@ -2,4 +2,5 @@ export declare const PLUGIN_MANAGER_TOKEN: unique symbol;
|
|
|
2
2
|
export declare const HOOK_REGISTRY_TOKEN: unique symbol;
|
|
3
3
|
export declare const PLUGIN_METADATA_TOKEN: unique symbol;
|
|
4
4
|
export declare const HOOK_METADATA_KEY: unique symbol;
|
|
5
|
+
export declare const CHOUX_FACADE_TOKEN: unique symbol;
|
|
5
6
|
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../src/lib/types/tokens.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,eAA0B,CAAC;AAC5D,eAAO,MAAM,mBAAmB,eAAyB,CAAC;AAC1D,eAAO,MAAM,qBAAqB,eAA2B,CAAC;AAC9D,eAAO,MAAM,iBAAiB,eAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../src/lib/types/tokens.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,eAA0B,CAAC;AAC5D,eAAO,MAAM,mBAAmB,eAAyB,CAAC;AAC1D,eAAO,MAAM,qBAAqB,eAA2B,CAAC;AAC9D,eAAO,MAAM,iBAAiB,eAAyB,CAAC;AACxD,eAAO,MAAM,kBAAkB,eAAwB,CAAC"}
|
package/dist/lib/types/tokens.js
CHANGED
|
@@ -2,4 +2,5 @@ export const PLUGIN_MANAGER_TOKEN = Symbol('PluginManager');
|
|
|
2
2
|
export const HOOK_REGISTRY_TOKEN = Symbol('HookRegistry');
|
|
3
3
|
export const PLUGIN_METADATA_TOKEN = Symbol('PluginMetadata');
|
|
4
4
|
export const HOOK_METADATA_KEY = Symbol('hookMetadata');
|
|
5
|
+
export const CHOUX_FACADE_TOKEN = Symbol('ChouxFacade');
|
|
5
6
|
//# sourceMappingURL=tokens.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../src/lib/types/tokens.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAC5D,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AAC1D,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAC9D,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../src/lib/types/tokens.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAC5D,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AAC1D,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAC9D,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AACxD,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC"}
|