@antelopejs/interface-core 0.2.2 → 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/README.md +86 -17
- package/dist/index.d.ts +4 -2
- package/dist/index.js +0 -8
- package/dist/index.js.map +1 -1
- package/dist/modules.d.ts +3 -2
- package/dist/modules.js +3 -3
- package/dist/modules.js.map +1 -1
- package/dist/proxies.d.ts +19 -20
- package/dist/proxies.js +20 -13
- package/dist/proxies.js.map +1 -1
- package/dist/tests/implement-interface-validation.test.js +0 -19
- package/dist/tests/implement-interface-validation.test.js.map +1 -1
- package/docs/2.proxies.md +63 -18
- package/docs/5.modules.md +8 -6
- package/docs/7.configuration.md +2 -0
- package/docs/tsconfig.json +16 -0
- package/package.json +11 -4
package/README.md
CHANGED
|
@@ -1,32 +1,101 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @antelopejs/interface-core
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
|
-
<a href="https://www.npmjs.com/package/@antelopejs/interface-core"><img src="https://img.shields.io/npm/v/@antelopejs/interface-core?style=for-the-badge&labelColor=000000&color=000000"
|
|
5
|
-
<a href="./LICENSE"><img alt="License" src="https://img.shields.io/
|
|
6
|
-
<a href="https://discord.gg/sjK28QHrA7"><img src="https://img.shields.io/badge/Discord-18181B?logo=discord&style=for-the-badge&color=000000"
|
|
7
|
-
<a href="
|
|
4
|
+
<a href="https://www.npmjs.com/package/@antelopejs/interface-core"><img alt="npm" src="https://img.shields.io/npm/v/@antelopejs/interface-core?style=for-the-badge&labelColor=000000&color=000000"></a>
|
|
5
|
+
<a href="./LICENSE"><img alt="License" src="https://img.shields.io/npm/l/@antelopejs/interface-core?style=for-the-badge&labelColor=000000&color=000000"></a>
|
|
6
|
+
<a href="https://discord.gg/sjK28QHrA7"><img alt="Discord" src="https://img.shields.io/badge/Discord-18181B?logo=discord&style=for-the-badge&color=000000"></a>
|
|
7
|
+
<a href="https://interfaces.antelopejs.com/docs/core"><img alt="Docs" src="https://img.shields.io/badge/Docs-18181B?style=for-the-badge&color=000000"></a>
|
|
8
8
|
</div>
|
|
9
9
|
|
|
10
|
-
The
|
|
10
|
+
The primitives every AntelopeJS interface is built from: proxies that cross module boundaries, decorator factories, module lifecycle events, structured logging and project configuration.
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## What it offers
|
|
13
|
+
|
|
14
|
+
- `InterfaceFunction` declares a contract function; `ImplementInterface` attaches a module's implementation to it. Calls made before the implementation attaches wait in a queue.
|
|
15
|
+
- `AsyncProxy`, `EventProxy` and `RegisteringProxy` carry calls, events and registrations between modules, and detach when a module unloads.
|
|
16
|
+
- `@antelopejs/interface-core/decorators` builds typed class, method, property and parameter decorators.
|
|
17
|
+
- `@antelopejs/interface-core/modules` exposes lifecycle events and module management functions.
|
|
18
|
+
- `@antelopejs/interface-core/logging` writes structured logs on named channels; `@antelopejs/interface-core/config` provides `defineConfig` for `antelope.config.ts`.
|
|
19
|
+
|
|
20
|
+
## Implementations
|
|
21
|
+
|
|
22
|
+
| Module | Notes |
|
|
23
|
+
| -------------------------------------------------------------- | ------------------------------------------------------------- |
|
|
24
|
+
| [`@antelopejs/core`](https://github.com/AntelopeJS/antelopejs) | The AntelopeJS runtime and `ajs` CLI implement this interface |
|
|
25
|
+
|
|
26
|
+
## Install
|
|
27
|
+
|
|
28
|
+
Add the package to any module that declares or implements an interface:
|
|
13
29
|
|
|
14
30
|
```bash
|
|
15
|
-
|
|
31
|
+
pnpm add @antelopejs/interface-core
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
No extra module is needed: the core provides the implementation.
|
|
35
|
+
|
|
36
|
+
## Quick start
|
|
37
|
+
|
|
38
|
+
Declare a contract:
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
// src/interface/index.ts
|
|
42
|
+
import { InterfaceFunction } from "@antelopejs/interface-core";
|
|
43
|
+
|
|
44
|
+
export const GetGreeting = InterfaceFunction<(name: string) => string>();
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Implement it and call it from a module:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
// src/index.ts
|
|
51
|
+
import { ImplementInterface } from "@antelopejs/interface-core";
|
|
52
|
+
import { Logging } from "@antelopejs/interface-core/logging";
|
|
53
|
+
import * as Greeting from "./interface";
|
|
54
|
+
|
|
55
|
+
export function construct() {
|
|
56
|
+
ImplementInterface(Greeting, {
|
|
57
|
+
GetGreeting: (name: string) => `Hello, ${name}`,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export async function start() {
|
|
62
|
+
Logging.Info(await Greeting.GetGreeting("Ada"));
|
|
63
|
+
}
|
|
16
64
|
```
|
|
17
65
|
|
|
66
|
+
An interface function always returns a promise, even when the implementation is synchronous.
|
|
67
|
+
|
|
18
68
|
## Documentation
|
|
19
69
|
|
|
20
|
-
|
|
70
|
+
- [Introduction](./docs/1.introduction.md)
|
|
71
|
+
- [Proxies, attachment leases and errors](./docs/2.proxies.md)
|
|
72
|
+
- [Decorators](./docs/3.decorators.md)
|
|
73
|
+
- [Metadata](./docs/4.metadata.md)
|
|
74
|
+
- [Modules](./docs/5.modules.md)
|
|
75
|
+
- [Logging](./docs/6.logging.md)
|
|
76
|
+
- [Configuration](./docs/7.configuration.md)
|
|
77
|
+
- [Runtime](./docs/8.runtime.md)
|
|
78
|
+
|
|
79
|
+
## Compatibility
|
|
21
80
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
81
|
+
`@antelopejs/core` implements this package. Use the line your core version declares:
|
|
82
|
+
|
|
83
|
+
| `@antelopejs/core` | `@antelopejs/interface-core` |
|
|
84
|
+
| -------------------- | ---------------------------- |
|
|
85
|
+
| `1.12.x` to `1.13.x` | `0.1.x` |
|
|
86
|
+
| `1.14.x` to `1.15.1` | `0.2.x` |
|
|
87
|
+
| `1.15.2` | `>=0.2.3 <0.3.0` |
|
|
88
|
+
|
|
89
|
+
## Contributing
|
|
90
|
+
|
|
91
|
+
Read [CONTRIBUTING.md](./CONTRIBUTING.md) before you open a pull request. The local checks are:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
pnpm install
|
|
95
|
+
pnpm lint
|
|
96
|
+
pnpm test
|
|
97
|
+
```
|
|
29
98
|
|
|
30
99
|
## License
|
|
31
100
|
|
|
32
|
-
|
|
101
|
+
[Apache-2.0](./LICENSE)
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { type InterfaceConnection } from "./internal";
|
|
|
4
4
|
import { type AsyncProxy, type EventProxy, type RegisteringProxy } from "./proxies";
|
|
5
5
|
export * from "./errors";
|
|
6
6
|
export type { InterfaceConnection } from "./internal";
|
|
7
|
-
export type { InterfaceFunctionOptions } from "./proxies";
|
|
8
7
|
export { AsyncProxy, EventProxy, GetInterfaceProxyIdentity, GetResponsibleModule, InterfaceFunction, IsInterfaceProxy, RegisteringProxy, RunWithResponsibleModule, } from "./proxies";
|
|
9
8
|
/**
|
|
10
9
|
* Gets metadata for a target object using the specified metadata class.
|
|
@@ -32,11 +31,14 @@ type InterfaceToImpl<T> = T extends infer P ? {
|
|
|
32
31
|
* Implements an interface with the provided implementation.
|
|
33
32
|
*
|
|
34
33
|
* Links a declared interface with its implementation, setting up the necessary proxies
|
|
35
|
-
*
|
|
34
|
+
* for cross-module communication. EventProxy declarations need no implementation.
|
|
35
|
+
* Validates all required handlers before attaching: async proxies need a function,
|
|
36
|
+
* and registering proxies need both register and unregister callbacks.
|
|
36
37
|
*
|
|
37
38
|
* @param declaration The interface declaration to implement
|
|
38
39
|
* @param implementation The implementation of the interface
|
|
39
40
|
* @returns An object containing the declaration and implementation
|
|
41
|
+
* @throws {TypeError} For malformed arguments, object cycles, or missing handlers.
|
|
40
42
|
*/
|
|
41
43
|
export declare function ImplementInterface<T extends Record<string, unknown>, T2 extends InterfaceToImpl<T>>(declaration: T, implementation: T2): {
|
|
42
44
|
declaration: T;
|
package/dist/index.js
CHANGED
|
@@ -106,19 +106,11 @@ function requireFunction(value, path) {
|
|
|
106
106
|
}
|
|
107
107
|
return value;
|
|
108
108
|
}
|
|
109
|
-
/** The callback of an optional function a provider leaves out. */
|
|
110
|
-
function notImplemented(path) {
|
|
111
|
-
return () => Promise.reject(new Error(`This provider does not implement ${path}: update it.`));
|
|
112
|
-
}
|
|
113
109
|
function planProxyAttachment(proxy, implementation, path) {
|
|
114
110
|
if ((0, proxies_1.IsInterfaceProxy)(proxy, "event")) {
|
|
115
111
|
return;
|
|
116
112
|
}
|
|
117
113
|
if ((0, proxies_1.IsInterfaceProxy)(proxy, "async")) {
|
|
118
|
-
const asyncProxy = proxy;
|
|
119
|
-
if (implementation === undefined && asyncProxy.optional) {
|
|
120
|
-
return { attach: () => asyncProxy.onCall(notImplemented(path)) };
|
|
121
|
-
}
|
|
122
114
|
const callback = requireFunction(implementation, path);
|
|
123
115
|
return {
|
|
124
116
|
attach: () => proxy.onCall(callback),
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAoDA,kCAuBC;AA0LD,gDAmBC;AAUD,sDAMC;AAWD,oDAUC;AA7TD,4BAA0B;AAE1B,uCAAoC;AAEpC,yCAAgE;AAChE,uCAMmB;AAEnB,2CAAyB;AAEzB,qCASmB;AARjB,qGAAA,UAAU,OAAA;AACV,qGAAA,UAAU,OAAA;AACV,oHAAA,yBAAyB,OAAA;AACzB,+GAAA,oBAAoB,OAAA;AACpB,4GAAA,iBAAiB,OAAA;AACjB,2GAAA,gBAAgB,OAAA;AAChB,2GAAA,gBAAgB,OAAA;AAChB,mHAAA,wBAAwB,OAAA;AAG1B,mBA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CAAC,MAAM,IAAI,mBAAQ,CAAC,oBAAoB,CAAC;QAAE,OAAO,EAAE,CAAC;IACrE,OAAO,mBAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;AAClE,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,oBAAoB,CAClC,WAAmB,EACnB,YAAoB;IAEpB,MAAM,MAAM,GAAG,IAAA,8BAAoB,GAAE,CAAC;IACtC,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,IAAI,mBAAQ,CAAC,oBAAoB,CAAC;QAAE,OAAO;IAClE,MAAM,WAAW,GAAG,mBAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAC1D,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAC1C,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,KAAK,YAAY,CAC/C,CAAC;AACJ,CAAC;AAED,4CAA0B;AAC1B,4CAA0B"}
|
package/dist/modules.d.ts
CHANGED
|
@@ -77,8 +77,9 @@ export interface ModuleDefinition {
|
|
|
77
77
|
*/
|
|
78
78
|
config?: unknown;
|
|
79
79
|
/**
|
|
80
|
-
*
|
|
81
|
-
*
|
|
80
|
+
* Runtime import override map with array values.
|
|
81
|
+
* This differs intentionally from AntelopeModuleConfig.importOverrides,
|
|
82
|
+
* the project-file contract used by defineConfig and SaveModuleDeclaration.
|
|
82
83
|
*/
|
|
83
84
|
importOverrides?: Record<string, string[]>;
|
|
84
85
|
/**
|
package/dist/modules.js
CHANGED
|
@@ -220,7 +220,7 @@ exports.ReloadModule = (0, proxies_1.InterfaceFunction)("modules.ReloadModule");
|
|
|
220
220
|
*
|
|
221
221
|
* @returns The declarations of the top-level `modules` of the file
|
|
222
222
|
*/
|
|
223
|
-
exports.ListModuleDeclarations = (0, proxies_1.InterfaceFunction)("modules.ListModuleDeclarations"
|
|
223
|
+
exports.ListModuleDeclarations = (0, proxies_1.InterfaceFunction)("modules.ListModuleDeclarations");
|
|
224
224
|
/**
|
|
225
225
|
* Write a module's declaration into the project's configuration file.
|
|
226
226
|
*
|
|
@@ -235,12 +235,12 @@ exports.ListModuleDeclarations = (0, proxies_1.InterfaceFunction)("modules.ListM
|
|
|
235
235
|
* @throws Error if the file has no `modules` object it can edit, such as a
|
|
236
236
|
* configuration built by a function
|
|
237
237
|
*/
|
|
238
|
-
exports.SaveModuleDeclaration = (0, proxies_1.InterfaceFunction)("modules.SaveModuleDeclaration"
|
|
238
|
+
exports.SaveModuleDeclaration = (0, proxies_1.InterfaceFunction)("modules.SaveModuleDeclaration");
|
|
239
239
|
/**
|
|
240
240
|
* Remove a module's entry from the project's configuration file, leaving the
|
|
241
241
|
* rest of the file as it was and the running project unrestarted.
|
|
242
242
|
*
|
|
243
243
|
* @param module The module's key in `modules`
|
|
244
244
|
*/
|
|
245
|
-
exports.RemoveModuleDeclaration = (0, proxies_1.InterfaceFunction)("modules.RemoveModuleDeclaration"
|
|
245
|
+
exports.RemoveModuleDeclaration = (0, proxies_1.InterfaceFunction)("modules.RemoveModuleDeclaration");
|
|
246
246
|
//# sourceMappingURL=modules.js.map
|
package/dist/modules.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modules.js","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":";;;AAaA,oDAKC;AAGD,4CAEC;AAiJD,oCAEC;AAzKD,uCAA0D;AAC1D,yCAQoB;AAEpB,oFAAoF;AACpF,SAAgB,oBAAoB,CAClC,OAA+B,EAC/B,QAAiB;IAEjB,OAAO,IAAA,+BAAoB,EAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AACjD,CAAC;AAED,kEAAkE;AAClE,SAAgB,gBAAgB;IAC9B,OAAO,IAAA,2BAAgB,GAAE,CAAC;AAC5B,CAAC;AAID;;;;;GAKG;AACH,IAAiB,MAAM,CAgDtB;AAhDD,WAAiB,MAAM;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,IAAA,2BAAiB,EAC5C,uBAAuB,CACxB,CAAC;AAEF;;;;;;;;;GASG;AACU,QAAA,YAAY,GAAG,IAAA,2BAAiB,EAC3C,sBAAsB,CACvB,CAAC;AAiBF;;;;;GAKG;AACU,QAAA,sBAAsB,GAAG,IAAA,2BAAiB,EAErD,gCAAgC,CAAC,CAAC;AAEpC;;;;;;;;;;;;;GAaG;AACU,QAAA,qBAAqB,GAAG,IAAA,2BAAiB,EAEpD,+BAA+B,CAAC,CAAC;AAEnC;;;;;GAKG;AACU,QAAA,uBAAuB,GAAG,IAAA,2BAAiB,EAEtD,iCAAiC,CAAC,CAAC"}
|
package/dist/proxies.d.ts
CHANGED
|
@@ -21,15 +21,9 @@ export declare function RunWithResponsibleModule<T>(module: string, callback: ()
|
|
|
21
21
|
/** Proxy for an asynchronous interface function, served by a single provider. */
|
|
22
22
|
export declare class AsyncProxy<T extends Func = Func, R = Awaited<ReturnType<T>>> {
|
|
23
23
|
readonly [PROXY_BRAND]: ProxyBrand;
|
|
24
|
-
/**
|
|
25
|
-
* Whether a provider may leave this function out: added to an interface
|
|
26
|
-
* after providers already implemented it, so an older provider still
|
|
27
|
-
* implements the interface, and a call rejects instead.
|
|
28
|
-
*/
|
|
29
|
-
readonly optional: boolean;
|
|
30
24
|
private attachment?;
|
|
31
25
|
private queue;
|
|
32
|
-
constructor(identity?: string
|
|
26
|
+
constructor(identity?: string);
|
|
33
27
|
/** Attaches the provider callback, replacing any previous one, and replays queued calls. */
|
|
34
28
|
onCall(callback: T, manualDetach?: boolean): AttachmentLease;
|
|
35
29
|
/** Detaches the leased attachment, or the current one when called without a lease. */
|
|
@@ -39,28 +33,33 @@ export declare class AsyncProxy<T extends Func = Func, R = Awaited<ReturnType<T>
|
|
|
39
33
|
private invoke;
|
|
40
34
|
private replayQueue;
|
|
41
35
|
}
|
|
42
|
-
/**
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
/** Creates an interface function backed by an asynchronous proxy. */
|
|
52
|
-
export declare function InterfaceFunction<T extends Func = Func, R = Awaited<ReturnType<T>>>(identity?: string, options?: InterfaceFunctionOptions): (...args: Parameters<T>) => Promise<R>;
|
|
36
|
+
/**
|
|
37
|
+
* Creates a callable interface function backed by an asynchronous proxy.
|
|
38
|
+
* The typed contract always returns a Promise. Use ImplementInterface to attach
|
|
39
|
+
* a provider; the runtime-only `.proxy` property is absent from the return type.
|
|
40
|
+
* Construct AsyncProxy directly when typed attachment/lease control is needed.
|
|
41
|
+
*
|
|
42
|
+
* @param identity Optional diagnostic name for the underlying proxy.
|
|
43
|
+
*/
|
|
44
|
+
export declare function InterfaceFunction<T extends Func = Func, R = Awaited<ReturnType<T>>>(identity?: string): (...args: Parameters<T>) => Promise<R>;
|
|
53
45
|
/** Proxy for register and unregister handlers, served by a single provider. */
|
|
54
46
|
export declare class RegisteringProxy<T extends RegisterFunction = RegisterFunction> {
|
|
55
47
|
readonly [PROXY_BRAND]: ProxyBrand;
|
|
56
48
|
private handlers;
|
|
57
49
|
private readonly registered;
|
|
58
50
|
constructor(identity?: string);
|
|
59
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* Attaches only the register callback, then replays stored registrations.
|
|
53
|
+
* Returns a lease for this callback; an existing unregister callback remains.
|
|
54
|
+
*/
|
|
60
55
|
onRegister(callback: T, manualDetach?: boolean): AttachmentLease;
|
|
61
56
|
/** Attaches an unregister callback, sharing the register callback's owner when it is the caller's. */
|
|
62
57
|
onUnregister(callback: (id: RID<T>) => void): AttachmentLease;
|
|
63
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* Installs both callbacks under one lease before replaying registrations.
|
|
60
|
+
* Replay reports synchronous failures and continues; provider side effects
|
|
61
|
+
* are not rolled back. Pass the returned lease to detach both callbacks safely.
|
|
62
|
+
*/
|
|
64
63
|
onHandlers(register: T, unregister: (id: RID<T>) => void, manualDetach?: boolean): AttachmentLease;
|
|
65
64
|
/** Detaches the leased handlers, or both handlers when called without a lease. */
|
|
66
65
|
detach(lease?: AttachmentLease): void;
|
package/dist/proxies.js
CHANGED
|
@@ -92,17 +92,10 @@ function RunWithResponsibleModule(module, callback) {
|
|
|
92
92
|
/** Proxy for an asynchronous interface function, served by a single provider. */
|
|
93
93
|
class AsyncProxy {
|
|
94
94
|
[PROXY_BRAND];
|
|
95
|
-
/**
|
|
96
|
-
* Whether a provider may leave this function out: added to an interface
|
|
97
|
-
* after providers already implemented it, so an older provider still
|
|
98
|
-
* implements the interface, and a call rejects instead.
|
|
99
|
-
*/
|
|
100
|
-
optional;
|
|
101
95
|
attachment;
|
|
102
96
|
queue = [];
|
|
103
|
-
constructor(identity
|
|
97
|
+
constructor(identity) {
|
|
104
98
|
this[PROXY_BRAND] = createBrand("async", identity);
|
|
105
|
-
this.optional = options.optional === true;
|
|
106
99
|
}
|
|
107
100
|
/** Attaches the provider callback, replacing any previous one, and replays queued calls. */
|
|
108
101
|
onCall(callback, manualDetach) {
|
|
@@ -162,9 +155,16 @@ class AsyncProxy {
|
|
|
162
155
|
}
|
|
163
156
|
}
|
|
164
157
|
exports.AsyncProxy = AsyncProxy;
|
|
165
|
-
/**
|
|
166
|
-
function
|
|
167
|
-
|
|
158
|
+
/**
|
|
159
|
+
* Creates a callable interface function backed by an asynchronous proxy.
|
|
160
|
+
* The typed contract always returns a Promise. Use ImplementInterface to attach
|
|
161
|
+
* a provider; the runtime-only `.proxy` property is absent from the return type.
|
|
162
|
+
* Construct AsyncProxy directly when typed attachment/lease control is needed.
|
|
163
|
+
*
|
|
164
|
+
* @param identity Optional diagnostic name for the underlying proxy.
|
|
165
|
+
*/
|
|
166
|
+
function InterfaceFunction(identity) {
|
|
167
|
+
const proxy = new AsyncProxy(identity);
|
|
168
168
|
const func = (...args) => proxy.call(...args);
|
|
169
169
|
func.proxy = proxy;
|
|
170
170
|
return func;
|
|
@@ -178,7 +178,10 @@ class RegisteringProxy {
|
|
|
178
178
|
this[PROXY_BRAND] = createBrand("registering", identity);
|
|
179
179
|
internal_1.internal.registeringProxies.add(this);
|
|
180
180
|
}
|
|
181
|
-
/**
|
|
181
|
+
/**
|
|
182
|
+
* Attaches only the register callback, then replays stored registrations.
|
|
183
|
+
* Returns a lease for this callback; an existing unregister callback remains.
|
|
184
|
+
*/
|
|
182
185
|
onRegister(callback, manualDetach) {
|
|
183
186
|
return this.attachRegister(bindProviderCallback(callback), {
|
|
184
187
|
owner: getAttachmentOwner(manualDetach),
|
|
@@ -198,7 +201,11 @@ class RegisteringProxy {
|
|
|
198
201
|
: { owner: getAttachmentOwner(), manualDetach: false };
|
|
199
202
|
return this.attachUnregister(bindProviderCallback(callback), options);
|
|
200
203
|
}
|
|
201
|
-
/**
|
|
204
|
+
/**
|
|
205
|
+
* Installs both callbacks under one lease before replaying registrations.
|
|
206
|
+
* Replay reports synchronous failures and continues; provider side effects
|
|
207
|
+
* are not rolled back. Pass the returned lease to detach both callbacks safely.
|
|
208
|
+
*/
|
|
202
209
|
onHandlers(register, unregister, manualDetach) {
|
|
203
210
|
const lease = createLease(getAttachmentOwner(manualDetach));
|
|
204
211
|
const boundRegister = bindProviderCallback(register);
|
package/dist/proxies.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxies.js","sourceRoot":"","sources":["../src/proxies.ts"],"names":[],"mappings":";;;AAgGA,4CAGC;AAGD,8DAEC;AA8DD,kEAEC;AAGD,4DAKC;AAkGD,8CAWC;AAoQD,oDAYC;AA7iBD,6DAA2D;AAC3D,qDAA2E;AAC3E,qCAAwE;AACxE,yCASoB;AAQpB,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;AACnE,MAAM,aAAa,GAAG,6CAA6C,CAAC;AA6CpE,SAAS,cAAc,CAAC,IAAe,EAAE,QAAiB;IACxD,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,GAAG,IAAI,IAAI,QAAQ,EAAE,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,KAAK,CAAC,KAAqC,CAAC;IAC1D,KAAK,CAAC,iBAAiB,GAAG,UAAU,CAAC;IACrC,KAAK,CAAC,eAAe,GAAG,QAAQ,CAAC;IACjC,OAAO,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;AACjC,CAAC;AAED,iFAAiF;AACjF,SAAgB,oBAAoB,CAAC,UAAU,GAAG,CAAC;IACjD,MAAM,aAAa,GAAG,IAAA,2BAAgB,GAAE,EAAE,MAAM,CAAC;IACjD,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,aAAa,CAAC;IACvB,CAAC;IACD,MAAM,KAAK,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAC3C,MAAM,WAAW,GAAG,IAAA,wCAAmB,EAAC,KAAK,CAAC,CAAC;IAC/C,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC;QACvB,OAAO,WAAW,CAAC,MAAM,CAAC;IAC5B,CAAC;IACD,mBAAQ,CAAC,oBAAoB,EAAE,CAAC,KAAK,CAAC,CAAC;IACvC,OAAO,WAAW,CAAC,aAAa,CAAC;AACnC,CAAC"}
|
|
@@ -18,25 +18,6 @@ describe("ImplementInterface validation", () => {
|
|
|
18
18
|
const error = await first.call().then(() => undefined, (reason) => reason);
|
|
19
19
|
(0, chai_1.expect)(error).to.be.instanceOf(Error);
|
|
20
20
|
});
|
|
21
|
-
it("lets a provider leave an optional function out, whose calls reject", async () => {
|
|
22
|
-
const declaration = {
|
|
23
|
-
present: (0, __1.InterfaceFunction)("test.optional.present"),
|
|
24
|
-
added: (0, __1.InterfaceFunction)("test.optional.added", {
|
|
25
|
-
optional: true,
|
|
26
|
-
}),
|
|
27
|
-
};
|
|
28
|
-
(0, __1.ImplementInterface)(declaration, { present: () => "here" });
|
|
29
|
-
(0, chai_1.expect)(await declaration.present()).to.equal("here");
|
|
30
|
-
const error = await declaration.added().then(() => undefined, (reason) => reason);
|
|
31
|
-
(0, chai_1.expect)(error).to.be.instanceOf(Error);
|
|
32
|
-
(0, chai_1.expect)(error.message).to.include("implementation.added");
|
|
33
|
-
});
|
|
34
|
-
it("still requires an optional function a provider gives as a non-function", () => {
|
|
35
|
-
const added = (0, __1.InterfaceFunction)("test.optional.malformed", {
|
|
36
|
-
optional: true,
|
|
37
|
-
});
|
|
38
|
-
(0, chai_1.expect)(() => (0, __1.ImplementInterface)({ added }, { added: "not a function" })).to.throw("implementation.added");
|
|
39
|
-
});
|
|
40
21
|
it("rejects malformed registering handlers atomically", () => {
|
|
41
22
|
const proxy = new __1.RegisteringProxy("test.malformed-registering");
|
|
42
23
|
(0, chai_1.expect)(() => (0, __1.ImplementInterface)({ proxy }, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implement-interface-validation.test.js","sourceRoot":"","sources":["../../src/tests/implement-interface-validation.test.ts"],"names":[],"mappings":";;AAAA,+BAA8B;AAC9B,qCAA0C;AAE1C,0CAAuC;AACvC,
|
|
1
|
+
{"version":3,"file":"implement-interface-validation.test.js","sourceRoot":"","sources":["../../src/tests/implement-interface-validation.test.ts"],"names":[],"mappings":";;AAAA,+BAA8B;AAC9B,qCAA0C;AAE1C,0CAAuC;AACvC,0BAAsE;AAEtE,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;IAC7C,SAAS,CAAC,GAAG,EAAE;QACb,mBAAQ,CAAC,YAAY,GAAG,KAAK,CAAC;IAChC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sDAAsD,EAAE,KAAK,IAAI,EAAE;QACpE,MAAM,KAAK,GAAG,IAAI,cAAU,CAAe,mBAAmB,CAAC,CAAC;QAChE,MAAM,MAAM,GAAG,IAAI,cAAU,CAAe,oBAAoB,CAAC,CAAC;QAElE,IAAA,aAAM,EAAC,GAAG,EAAE,CACV,IAAA,sBAAkB,EAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;YACpC,KAAK,EAAE,GAAG,EAAE,CAAC,UAAU;SACf,CAAC,CACZ,CAAC,EAAE,CAAC,KA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AE,CAAC,wDAAwD,EAAE,KAAK,IAAI,EAAE;QACtE,MAAM,KAAK,GAAG,IAAI,cAAU,CAAe,0BAA0B,CAAC,CAAC;QACvE,MAAM,WAAW,GAAG,IAAA,yBAAe,EAAC,wBAAwB,EAAE;YAC5D,KAAK,EAAE,EAAE,KAAK,EAAE;SACjB,CAAqD,CAAC;QACvD,MAAM,cAAc,GAAG,IAAA,yBAAe,EACpC,yCAAyC,EACzC,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE,EAAE,CACC,CAAC;QAE1C,MAAM,IAAA,sBAAkB,EAAC,WAAoB,EAAE,cAAuB,CAAC,CAAC;QACxE,IAAA,aAAM,EAAC,MAAM,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/docs/2.proxies.md
CHANGED
|
@@ -39,17 +39,35 @@ When attachment occurs inside `RunWithModuleContext`, calls execute in the captu
|
|
|
39
39
|
// Automatic cleanup (default) - detaches when the module unloads
|
|
40
40
|
proxy.onCall(myHandler);
|
|
41
41
|
|
|
42
|
-
// Manual cleanup -
|
|
43
|
-
proxy.onCall(myHandler, true);
|
|
42
|
+
// Manual cleanup - retain the lease for generation-safe detachment
|
|
43
|
+
const lease = proxy.onCall(myHandler, true);
|
|
44
|
+
// Later:
|
|
45
|
+
proxy.detach(lease);
|
|
44
46
|
```
|
|
45
47
|
|
|
48
|
+
`onCall` returns an `AttachmentLease` with `owner: string` and `generation: number`. Keep this handle unchanged and pass it to `detach(lease)` to remove only that attachment. A stale lease cannot detach a replacement provider. Import the type from `@antelopejs/interface-core/proxies`; it is not re-exported from the package root.
|
|
49
|
+
|
|
50
|
+
```ts docs-check
|
|
51
|
+
import { AsyncProxy } from "@antelopejs/interface-core";
|
|
52
|
+
import type { AttachmentLease } from "@antelopejs/interface-core/proxies";
|
|
53
|
+
|
|
54
|
+
const proxy = new AsyncProxy<() => string>("greeting");
|
|
55
|
+
const oldLease: AttachmentLease = proxy.onCall(() => "old", true);
|
|
56
|
+
const currentLease = proxy.onCall(() => "current", true);
|
|
57
|
+
proxy.detach(oldLease); // The current provider stays attached.
|
|
58
|
+
const greeting: string = await proxy.call(); // "current"
|
|
59
|
+
proxy.detach(currentLease);
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Manual detachment disables automatic attachment cleanup, not context capture or invalidation. A callback captured under a destroyed owner still rejects when invoked.
|
|
63
|
+
|
|
46
64
|
### `call(...args)`
|
|
47
65
|
|
|
48
66
|
Invokes the attached callback. If no callback is attached, the call returns a `Promise` that resolves once a callback is provided. In test stub mode, unattached calls reject with a [`MissingProviderError`](#missingprovidererror).
|
|
49
67
|
|
|
50
68
|
### `detach()`
|
|
51
69
|
|
|
52
|
-
|
|
70
|
+
`detach()` removes the current callback unconditionally; `detach(lease)` removes it only when the lease matches. After detaching, subsequent calls are queued again. Detaching does not cancel calls already executing.
|
|
53
71
|
|
|
54
72
|
## `InterfaceFunction`
|
|
55
73
|
|
|
@@ -66,7 +84,9 @@ const GetUser =
|
|
|
66
84
|
const user = await GetUser("user-123");
|
|
67
85
|
```
|
|
68
86
|
|
|
69
|
-
The
|
|
87
|
+
The typed return value is `(...args: Parameters<T>) => Promise<R>`, where `R` defaults to `Awaited<ReturnType<T>>`. Supply an optional identity string as `InterfaceFunction<T>("name")` for diagnostics.
|
|
88
|
+
|
|
89
|
+
The implementation attaches a `.proxy` property at runtime, but the declared return type does not expose it. Use `ImplementInterface({ GetUser }, { GetUser: handler })` for typed provider wiring. When you need direct attachment and lease control, construct an `AsyncProxy` as shown above instead of accessing `.proxy` on an interface function.
|
|
70
90
|
|
|
71
91
|
## `EventProxy`
|
|
72
92
|
|
|
@@ -94,7 +114,7 @@ Registers a handler for the event. Duplicate handlers (same function reference)
|
|
|
94
114
|
|
|
95
115
|
### `emit(...args)`
|
|
96
116
|
|
|
97
|
-
Calls all registered handlers with the provided arguments.
|
|
117
|
+
Calls all registered handlers synchronously with the provided arguments. Synchronous exceptions are reported through the runtime's error reporter without preventing later handlers from running. Emission does not await returned promises; asynchronous handlers must handle their own rejections.
|
|
98
118
|
|
|
99
119
|
### `unregister(func)`
|
|
100
120
|
|
|
@@ -117,42 +137,55 @@ const routeRegistry = new RegisteringProxy<
|
|
|
117
137
|
routeRegistry.register("home", "/", homeHandler);
|
|
118
138
|
routeRegistry.register("about", "/about", aboutHandler);
|
|
119
139
|
|
|
120
|
-
//
|
|
121
|
-
routeRegistry.
|
|
122
|
-
router.addRoute(path, handler)
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
routeRegistry.onUnregister((id) => {
|
|
126
|
-
router.removeRoute(id);
|
|
127
|
-
});
|
|
140
|
+
// Install both callbacks before replaying stored registrations.
|
|
141
|
+
const lease = routeRegistry.onHandlers(
|
|
142
|
+
(id, path, handler) => router.addRoute(path, handler),
|
|
143
|
+
(id) => router.removeRoute(id),
|
|
144
|
+
);
|
|
128
145
|
|
|
129
146
|
// Unregister by ID
|
|
130
147
|
routeRegistry.unregister("about");
|
|
131
148
|
```
|
|
132
149
|
|
|
150
|
+
### `onHandlers(register, unregister, manualDetach?)`
|
|
151
|
+
|
|
152
|
+
Attaches both callbacks under one lease before replaying stored registrations. Prefer this operation when replacing a provider: replay can safely call `unregister` because the matching unregister callback is already installed. It returns an `AttachmentLease` for both callbacks. `ImplementInterface` uses this operation for registering proxies.
|
|
153
|
+
|
|
154
|
+
Replay reports synchronous registration failures and continues to the next stored entry. This is not a transaction or a rollback of provider side effects. Direct `register` calls propagate synchronous callback failures to the caller.
|
|
155
|
+
|
|
133
156
|
### `onRegister(callback, manualDetach?)`
|
|
134
157
|
|
|
135
|
-
Attaches the register callback. Any previously registered entries replay through this callback immediately. Automatic module-aware detachment applies unless `manualDetach` is `true`.
|
|
158
|
+
Attaches only the register callback and returns its own lease. Any previously registered entries replay through this callback immediately. Automatic module-aware detachment applies unless `manualDetach` is `true`. An existing unregister callback remains attached.
|
|
136
159
|
|
|
137
160
|
Register replay and direct registration execute in the provider context captured when the callback attaches.
|
|
138
161
|
|
|
139
162
|
### `onUnregister(callback)`
|
|
140
163
|
|
|
141
|
-
Attaches the unregister callback.
|
|
164
|
+
Attaches only the unregister callback and returns a separate lease. It shares the owner and manual-detach setting of an existing attachment belonging to the active owner when available. Without an explicit context, it uses the existing unregister attachment, then the register attachment, if present. Otherwise it resolves ownership normally and enables automatic cleanup. It does not replay registrations or replace the register callback.
|
|
142
165
|
|
|
143
166
|
Unregistration executes in the context captured when this callback attaches.
|
|
144
167
|
|
|
145
168
|
### `register(id, ...args)`
|
|
146
169
|
|
|
147
|
-
Registers an entry with the given identifier. If a register callback is attached, it executes immediately. Otherwise, the entry is stored and replayed when a callback is attached. The calling module is tracked for automatic cleanup.
|
|
170
|
+
Registers an entry with the given identifier. If a register callback is attached, it executes immediately. Otherwise, the entry is stored and replayed when a callback is attached. The calling module is tracked for automatic cleanup. Registering the same ID replaces the stored arguments and ownership and calls the register callback again; it does not first call unregister.
|
|
148
171
|
|
|
149
172
|
### `unregister(id)`
|
|
150
173
|
|
|
151
|
-
Removes the entry with the given identifier and calls the unregister callback if one is attached.
|
|
174
|
+
Removes the entry with the given identifier and calls the unregister callback if one is attached. Unknown IDs are ignored. The stored entry is removed even if the callback throws.
|
|
152
175
|
|
|
153
176
|
### `detach()`
|
|
154
177
|
|
|
155
|
-
|
|
178
|
+
`detach()` removes both callbacks. `detach(lease)` removes only callbacks matching the lease: both for `onHandlers`, or one for separate `onRegister`/`onUnregister` attachments. Registered entries remain stored for replay; detaching callbacks does not unregister provider resources.
|
|
179
|
+
|
|
180
|
+
### Ownership cleanup
|
|
181
|
+
|
|
182
|
+
`RegisteringProxy` and `EventProxy` expose `unregisterModule(module)` and `unregisterOwner(owner)` to remove entries for a whole module or one generation. Normal module destruction invokes owner cleanup automatically; application consumers usually need only `unregister(id)` or `unregister(handler)`.
|
|
183
|
+
|
|
184
|
+
## Proxy identity helpers
|
|
185
|
+
|
|
186
|
+
All three proxy constructors accept an optional identity string. `GetInterfaceProxyIdentity(proxy)` returns a diagnostic identity prefixed by the proxy kind, for example `"async:greeting"`. Without an explicit name, the runtime generates an anonymous identity. Non-proxy values return `undefined`.
|
|
187
|
+
|
|
188
|
+
`IsInterfaceProxy(value, kind?)` checks the shared runtime protocol brand, optionally restricted to `"async"`, `"registering"`, or `"event"`. It works across compatible package copies where `instanceof` is unreliable, but returns a boolean rather than narrowing a TypeScript type. Both helpers operate on proxy objects, not on the callable return value of `InterfaceFunction`.
|
|
156
189
|
|
|
157
190
|
## Functions passed through a proxy
|
|
158
191
|
|
|
@@ -200,6 +233,8 @@ ImplementInterface(ItemInterface, {
|
|
|
200
233
|
|
|
201
234
|
`EventProxy` entries in the declaration are skipped during implementation wiring, as they are emitted from the declaring side, not implemented.
|
|
202
235
|
|
|
236
|
+
The synchronous overload returns `{ declaration, implementation }`. Every declared async proxy needs a function, and every registering proxy needs both `register` and `unregister`, even though the implementation type permits optional keys. Missing or malformed handlers, non-object arguments, and object cycles throw `TypeError`. Validation happens before attachment, but provider callback effects during attachment are not rolled back. Promise-like arguments use a deprecated asynchronous overload; prefer the synchronous form.
|
|
237
|
+
|
|
203
238
|
## `MissingProviderError`
|
|
204
239
|
|
|
205
240
|
In test stub mode, using a proxy that has no provider attached fails with a `MissingProviderError`: `AsyncProxy.call` rejects with it and `RegisteringProxy.register` throws it.
|
|
@@ -222,6 +257,16 @@ try {
|
|
|
222
257
|
|
|
223
258
|
Prefer the `isMissingProviderError` guard over `instanceof`: it checks the `code` property, so detection keeps working across realm boundaries and duplicated copies of the package where `instanceof` fails.
|
|
224
259
|
|
|
260
|
+
## Other public errors
|
|
261
|
+
|
|
262
|
+
Errors are exported from the package root. Use their stable `code` values rather than parsing messages.
|
|
263
|
+
|
|
264
|
+
| Error | Code constant | Code value | When it applies |
|
|
265
|
+
| ------------------------------- | --------------------------------- | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
266
|
+
| `ProviderQueueFullError` | `PROVIDER_QUEUE_FULL_CODE` | `ERR_PROVIDER_QUEUE_FULL` | An unattached async proxy reaches its pending-call limit (1,000 by default). |
|
|
267
|
+
| `ModuleContextInvalidatedError` | `MODULE_CONTEXT_INVALIDATED_CODE` | `ERR_MODULE_CONTEXT_INVALIDATED` | Work tries to use a destroyed ownership context. |
|
|
268
|
+
| `AmbiguousProviderError` | `AMBIGUOUS_PROVIDER_CODE` | `ERR_AMBIGUOUS_PROVIDER` | Exported to represent ambiguous provider routing. The current single-provider proxy classes do not themselves throw it or select between providers. |
|
|
269
|
+
|
|
225
270
|
## `GetInterfaceInstances` and `GetInterfaceInstance`
|
|
226
271
|
|
|
227
272
|
These functions retrieve information about active interface connections for the current module.
|
package/docs/5.modules.md
CHANGED
|
@@ -209,12 +209,14 @@ await RemoveModuleDeclaration("@acme/reports");
|
|
|
209
209
|
|
|
210
210
|
The configuration object for defining a module.
|
|
211
211
|
|
|
212
|
-
| Property | Type | Description
|
|
213
|
-
| ----------------- | -------------------------------- |
|
|
214
|
-
| `source` | `{ type: string } & Record<...>` | Source location and loading mechanism
|
|
215
|
-
| `config` | `unknown` | Optional configuration data for the module
|
|
216
|
-
| `importOverrides` | `Record<string, string[]>` | Optional
|
|
217
|
-
| `disabledExports` | `string[]` | Optional list of exports to hide from this module
|
|
212
|
+
| Property | Type | Description |
|
|
213
|
+
| ----------------- | -------------------------------- | ------------------------------------------------------ |
|
|
214
|
+
| `source` | `{ type: string } & Record<...>` | Source location and loading mechanism |
|
|
215
|
+
| `config` | `unknown` | Optional configuration data for the module |
|
|
216
|
+
| `importOverrides` | `Record<string, string[]>` | Optional runtime import override map with array values |
|
|
217
|
+
| `disabledExports` | `string[]` | Optional list of exports to hide from this module |
|
|
218
|
+
|
|
219
|
+
`ModuleDefinition` is the runtime management contract used by `LoadModule` and `GetModuleInfo`. It is not the project-file `AntelopeModuleConfig`: that type uses `ImportOverride[] | Record<string, string>` for declarative provider bindings and named connections. The different `importOverrides` shapes are intentional; do not copy one into the other or cast between them. `SaveModuleDeclaration` uses the project-file shape. See [project configuration](./7.configuration.md#antelopemoduleconfig) for that contract.
|
|
218
220
|
|
|
219
221
|
## `ModuleInfo`
|
|
220
222
|
|
package/docs/7.configuration.md
CHANGED
|
@@ -167,6 +167,8 @@ Full module configuration within the project config.
|
|
|
167
167
|
|
|
168
168
|
An `ImportOverride` is `{ interface, source?, id? }`. The first entry for an interface pins it to the `source` module; further entries are connections reached through `GetInterfaceInstance(interface, id)`. An entry for a standalone interface may omit `source`, declaring a connection to that self-hosted interface.
|
|
169
169
|
|
|
170
|
+
This project-file contract also applies to `SaveModuleDeclaration`. It differs intentionally from the runtime `ModuleDefinition.importOverrides: Record<string, string[]>` accepted by `LoadModule`; the two types are not interchangeable. Use the type of the API you are calling rather than changing or casting the override shape.
|
|
171
|
+
|
|
170
172
|
## `AntelopeLogging`
|
|
171
173
|
|
|
172
174
|
Logging configuration within the project config.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "node",
|
|
6
|
+
"rootDir": "..",
|
|
7
|
+
"composite": false,
|
|
8
|
+
"incremental": false,
|
|
9
|
+
"noEmit": true,
|
|
10
|
+
"paths": {
|
|
11
|
+
"@antelopejs/interface-core": ["../src/index.ts"],
|
|
12
|
+
"@antelopejs/interface-core/*": ["../src/*"]
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"include": ["../src", "./**/*.ts"]
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/interface-core",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "AntelopeJS core interface primitives
|
|
3
|
+
"version": "0.2.4",
|
|
4
|
+
"description": "AntelopeJS core interface primitives: proxies, interface functions, decorators, module lifecycle, logging and configuration",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antelopejs",
|
|
7
7
|
"core",
|
|
8
|
-
"
|
|
8
|
+
"decorators",
|
|
9
|
+
"interface",
|
|
10
|
+
"logging",
|
|
11
|
+
"proxy"
|
|
9
12
|
],
|
|
13
|
+
"homepage": "https://interfaces.antelopejs.com/docs/core",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/AntelopeJS/interface-core/issues"
|
|
16
|
+
},
|
|
10
17
|
"license": "Apache-2.0",
|
|
11
18
|
"repository": {
|
|
12
19
|
"type": "git",
|
|
@@ -90,7 +97,7 @@
|
|
|
90
97
|
"reflect-metadata": "^0.2.2"
|
|
91
98
|
},
|
|
92
99
|
"devDependencies": {
|
|
93
|
-
"@antelopejs/tooling-configs": "^0.0.
|
|
100
|
+
"@antelopejs/tooling-configs": "^0.0.9",
|
|
94
101
|
"@types/chai": "^4.3.20",
|
|
95
102
|
"@types/mocha": "^10.0.10",
|
|
96
103
|
"@types/node": "^22.19.15",
|