@antelopejs/interface-core 0.0.11 → 0.0.13
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/index.d.ts +4 -12
- package/dist/index.js +5 -17
- package/dist/index.js.map +1 -1
- package/dist/internal.js.map +1 -1
- package/dist/logging/index.js +0 -1
- package/dist/logging/index.js.map +1 -1
- package/dist/modules.d.ts +1 -1
- package/dist/modules.js +34 -15
- package/dist/modules.js.map +1 -1
- package/dist/proxies.d.ts +2 -0
- package/dist/proxies.js +9 -1
- package/dist/proxies.js.map +1 -1
- package/dist/runtime.js +3 -3
- package/dist/runtime.js.map +1 -1
- package/dist/tests/async-proxy-call.test.js.map +1 -1
- package/dist/tests/generation-cleanup.test.js +1 -1
- package/dist/tests/generation-cleanup.test.js.map +1 -1
- package/dist/tests/implement-interface-validation.test.js +2 -2
- package/dist/tests/implement-interface-validation.test.js.map +1 -1
- package/dist/tests/interface-connections.test.js +1 -1
- package/dist/tests/interface-connections.test.js.map +1 -1
- package/dist/tests/module-ownership-context.test.js +2 -2
- package/dist/tests/module-ownership-context.test.js.map +1 -1
- package/dist/tests/modules.test.js +2 -2
- package/dist/tests/modules.test.js.map +1 -1
- package/dist/tests/provider-context.test.js +1 -1
- package/dist/tests/provider-context.test.js.map +1 -1
- package/dist/tests/provider-routing.test.js +1 -1
- package/dist/tests/provider-routing.test.js.map +1 -1
- package/dist/tests/queue-and-cleanup.test.js +2 -2
- package/dist/tests/queue-and-cleanup.test.js.map +1 -1
- package/dist/tests/registering-proxy-replay.test.js.map +1 -1
- package/dist/tests/responsible-module.test.js +25 -25
- package/dist/tests/responsible-module.test.js.map +1 -1
- package/dist/tests/root-declarations.test.d.ts +1 -0
- package/dist/tests/root-declarations.test.js +94 -0
- package/dist/tests/root-declarations.test.js.map +1 -0
- package/dist/tests/runtime-protocol.test.js +3 -3
- package/dist/tests/runtime-protocol.test.js.map +1 -1
- package/dist/tests/runtime.test.js +1 -1
- package/dist/tests/runtime.test.js.map +1 -1
- package/dist/tests/stub-mode.test.js +2 -2
- package/dist/tests/stub-mode.test.js.map +1 -1
- package/dist/tests/teardown-module-context.test.d.ts +1 -0
- package/dist/tests/teardown-module-context.test.js +53 -0
- package/dist/tests/teardown-module-context.test.js.map +1 -0
- package/docs/1.introduction.md +14 -3
- package/docs/2.proxies.md +19 -5
- package/docs/3.decorators.md +32 -20
- package/docs/4.metadata.md +9 -5
- package/docs/5.modules.md +12 -12
- package/docs/6.logging.md +14 -13
- package/docs/7.configuration.md +38 -30
- package/docs/8.runtime.md +5 -5
- package/package.json +54 -45
- package/skills/core-interface/SKILL.md +44 -8
package/docs/2.proxies.md
CHANGED
|
@@ -57,7 +57,8 @@ Manually removes the attached callback. After detaching, subsequent calls are qu
|
|
|
57
57
|
import { InterfaceFunction } from "@antelopejs/interface-core";
|
|
58
58
|
|
|
59
59
|
// Declare a typed interface function
|
|
60
|
-
const GetUser =
|
|
60
|
+
const GetUser =
|
|
61
|
+
InterfaceFunction<(id: string) => { name: string; email: string }>();
|
|
61
62
|
|
|
62
63
|
// Call it like a regular async function
|
|
63
64
|
const user = await GetUser("user-123");
|
|
@@ -106,7 +107,9 @@ Removes a specific handler by function reference.
|
|
|
106
107
|
```ts
|
|
107
108
|
import { RegisteringProxy } from "@antelopejs/interface-core";
|
|
108
109
|
|
|
109
|
-
const routeRegistry = new RegisteringProxy<
|
|
110
|
+
const routeRegistry = new RegisteringProxy<
|
|
111
|
+
(id: string, path: string, handler: Function) => void
|
|
112
|
+
>();
|
|
110
113
|
|
|
111
114
|
// Register entries - queued if no callback is attached yet
|
|
112
115
|
routeRegistry.register("home", "/", homeHandler);
|
|
@@ -154,7 +157,12 @@ Manually removes both the register and unregister callbacks. Registered entries
|
|
|
154
157
|
`ImplementInterface` connects an interface declaration to its implementation. It iterates over the declaration object and wires up each proxy to the corresponding implementation function.
|
|
155
158
|
|
|
156
159
|
```ts
|
|
157
|
-
import {
|
|
160
|
+
import {
|
|
161
|
+
InterfaceFunction,
|
|
162
|
+
EventProxy,
|
|
163
|
+
RegisteringProxy,
|
|
164
|
+
ImplementInterface,
|
|
165
|
+
} from "@antelopejs/interface-core";
|
|
158
166
|
|
|
159
167
|
// Declaration
|
|
160
168
|
const GetItem = InterfaceFunction<(id: string) => { name: string }>();
|
|
@@ -188,7 +196,10 @@ In test stub mode, using a proxy that has no provider attached fails with a `Mis
|
|
|
188
196
|
This error is the supported way to detect the "no provider" condition. The contract is the type and its stable `code` property (`"ERR_NO_PROVIDER"`, exported as `MISSING_PROVIDER_CODE`) - never the message text, which may change between versions.
|
|
189
197
|
|
|
190
198
|
```ts
|
|
191
|
-
import {
|
|
199
|
+
import {
|
|
200
|
+
isMissingProviderError,
|
|
201
|
+
MissingProviderError,
|
|
202
|
+
} from "@antelopejs/interface-core";
|
|
192
203
|
|
|
193
204
|
try {
|
|
194
205
|
registry.register("my-entry", data);
|
|
@@ -205,7 +216,10 @@ Prefer the `isMissingProviderError` guard over `instanceof`: it checks the `code
|
|
|
205
216
|
These functions retrieve information about active interface connections for the current module.
|
|
206
217
|
|
|
207
218
|
```ts
|
|
208
|
-
import {
|
|
219
|
+
import {
|
|
220
|
+
GetInterfaceInstances,
|
|
221
|
+
GetInterfaceInstance,
|
|
222
|
+
} from "@antelopejs/interface-core";
|
|
209
223
|
|
|
210
224
|
// Get all connections for an interface
|
|
211
225
|
const connections = GetInterfaceInstances("database");
|
package/docs/3.decorators.md
CHANGED
|
@@ -54,11 +54,13 @@ Creates a decorator factory that targets properties. The handler receives the ta
|
|
|
54
54
|
```ts
|
|
55
55
|
import { MakePropertyDecorator } from "@antelopejs/interface-core/decorators";
|
|
56
56
|
|
|
57
|
-
const Column = MakePropertyDecorator(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
const Column = MakePropertyDecorator(
|
|
58
|
+
(target: any, key: PropertyKey, columnName: string) => {
|
|
59
|
+
const columns = Reflect.getOwnMetadata("columns", target) || [];
|
|
60
|
+
columns.push({ key, columnName });
|
|
61
|
+
Reflect.defineMetadata("columns", columns, target);
|
|
62
|
+
},
|
|
63
|
+
);
|
|
62
64
|
|
|
63
65
|
class User {
|
|
64
66
|
@Column("user_name")
|
|
@@ -74,7 +76,12 @@ Creates a decorator factory that targets methods and accessors. The handler rece
|
|
|
74
76
|
import { MakeMethodDecorator } from "@antelopejs/interface-core/decorators";
|
|
75
77
|
|
|
76
78
|
const Log = MakeMethodDecorator(
|
|
77
|
-
(
|
|
79
|
+
(
|
|
80
|
+
target: any,
|
|
81
|
+
key: PropertyKey,
|
|
82
|
+
descriptor: PropertyDescriptor,
|
|
83
|
+
level: string,
|
|
84
|
+
) => {
|
|
78
85
|
const original = descriptor.value;
|
|
79
86
|
descriptor.value = function (...args: any[]) {
|
|
80
87
|
console.log(`[${level}] Calling ${String(key)}`);
|
|
@@ -117,19 +124,19 @@ class Controller {
|
|
|
117
124
|
|
|
118
125
|
For decorators that apply to multiple targets, the module provides combined factory functions. These detect the decorator context automatically based on the number and types of arguments received.
|
|
119
126
|
|
|
120
|
-
| Factory
|
|
121
|
-
|
|
|
122
|
-
| `MakePropertyAndClassDecorator`
|
|
123
|
-
| `MakeMethodAndClassDecorator`
|
|
124
|
-
| `MakeMethodAndPropertyDecorator`
|
|
125
|
-
| `MakeMethodAndPropertyAndClassDecorator`
|
|
126
|
-
| `MakeParameterAndClassDecorator`
|
|
127
|
-
| `MakeParameterAndPropertyDecorator`
|
|
128
|
-
| `MakeParameterAndPropertyAndClassDecorator`
|
|
129
|
-
| `MakeParameterAndMethodDecorator`
|
|
130
|
-
| `MakeParameterAndMethodAndClassDecorator`
|
|
131
|
-
| `MakeParameterAndMethodAndPropertyDecorator`
|
|
132
|
-
| `MakeParameterAndMethodAndPropertyAndClassDecorator
|
|
127
|
+
| Factory | Targets |
|
|
128
|
+
| ---------------------------------------------------- | ---------------------------------------- |
|
|
129
|
+
| `MakePropertyAndClassDecorator` | Properties and classes |
|
|
130
|
+
| `MakeMethodAndClassDecorator` | Methods and classes |
|
|
131
|
+
| `MakeMethodAndPropertyDecorator` | Methods and properties |
|
|
132
|
+
| `MakeMethodAndPropertyAndClassDecorator` | Methods, properties, and classes |
|
|
133
|
+
| `MakeParameterAndClassDecorator` | Parameters and classes |
|
|
134
|
+
| `MakeParameterAndPropertyDecorator` | Parameters and properties |
|
|
135
|
+
| `MakeParameterAndPropertyAndClassDecorator` | Parameters, properties, and classes |
|
|
136
|
+
| `MakeParameterAndMethodDecorator` | Parameters and methods |
|
|
137
|
+
| `MakeParameterAndMethodAndClassDecorator` | Parameters, methods, and classes |
|
|
138
|
+
| `MakeParameterAndMethodAndPropertyDecorator` | Parameters, methods, and properties |
|
|
139
|
+
| `MakeParameterAndMethodAndPropertyAndClassDecorator` | Parameters, methods, properties, classes |
|
|
133
140
|
|
|
134
141
|
### Example: method and class decorator
|
|
135
142
|
|
|
@@ -137,7 +144,12 @@ For decorators that apply to multiple targets, the module provides combined fact
|
|
|
137
144
|
import { MakeMethodAndClassDecorator } from "@antelopejs/interface-core/decorators";
|
|
138
145
|
|
|
139
146
|
const Track = MakeMethodAndClassDecorator(
|
|
140
|
-
(
|
|
147
|
+
(
|
|
148
|
+
target: any,
|
|
149
|
+
key: PropertyKey | undefined,
|
|
150
|
+
descriptor: PropertyDescriptor | undefined,
|
|
151
|
+
category: string,
|
|
152
|
+
) => {
|
|
141
153
|
if (descriptor) {
|
|
142
154
|
// Applied to a method
|
|
143
155
|
const original = descriptor.value;
|
package/docs/4.metadata.md
CHANGED
|
@@ -13,16 +13,20 @@ import { GetMetadata } from "@antelopejs/interface-core";
|
|
|
13
13
|
## `GetMetadata`
|
|
14
14
|
|
|
15
15
|
```ts
|
|
16
|
-
function GetMetadata<T, U>(
|
|
16
|
+
function GetMetadata<T, U>(
|
|
17
|
+
target: U,
|
|
18
|
+
meta: Class<T, [U]> & { key: symbol },
|
|
19
|
+
inherit?: boolean,
|
|
20
|
+
): T;
|
|
17
21
|
```
|
|
18
22
|
|
|
19
23
|
### Parameters
|
|
20
24
|
|
|
21
|
-
| Parameter | Type
|
|
22
|
-
| --------- |
|
|
23
|
-
| `target` | `U`
|
|
25
|
+
| Parameter | Type | Default | Description |
|
|
26
|
+
| --------- | --------------------------------- | ------- | ---------------------------------------------------- |
|
|
27
|
+
| `target` | `U` | - | The object to retrieve or create metadata for |
|
|
24
28
|
| `meta` | `Class<T, [U]> & { key: symbol }` | - | A metadata class with a static `key` symbol |
|
|
25
|
-
| `inherit` | `boolean`
|
|
29
|
+
| `inherit` | `boolean` | `true` | Whether to inherit metadata from the prototype chain |
|
|
26
30
|
|
|
27
31
|
### Return value
|
|
28
32
|
|
package/docs/5.modules.md
CHANGED
|
@@ -28,12 +28,12 @@ loaded -> constructed -> active -> constructed -> loaded
|
|
|
28
28
|
(stopped) (destroyed)
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
| State | Description
|
|
32
|
-
| ------------- |
|
|
33
|
-
| `loaded` | Module code is loaded but no instance exists
|
|
34
|
-
| `constructed` | Module instance is created but not started
|
|
35
|
-
| `active` | Module is fully started and providing services
|
|
36
|
-
| `unknown` | Module status cannot be determined
|
|
31
|
+
| State | Description |
|
|
32
|
+
| ------------- | ---------------------------------------------- |
|
|
33
|
+
| `loaded` | Module code is loaded but no instance exists |
|
|
34
|
+
| `constructed` | Module instance is created but not started |
|
|
35
|
+
| `active` | Module is fully started and providing services |
|
|
36
|
+
| `unknown` | Module status cannot be determined |
|
|
37
37
|
|
|
38
38
|
## Module execution context
|
|
39
39
|
|
|
@@ -180,12 +180,12 @@ await ReloadModule("my-module");
|
|
|
180
180
|
|
|
181
181
|
The configuration object for defining a module.
|
|
182
182
|
|
|
183
|
-
| Property
|
|
184
|
-
|
|
|
185
|
-
| `source`
|
|
186
|
-
| `config`
|
|
187
|
-
| `importOverrides`
|
|
188
|
-
| `disabledExports`
|
|
183
|
+
| Property | Type | Description |
|
|
184
|
+
| ----------------- | -------------------------------- | ------------------------------------------------- |
|
|
185
|
+
| `source` | `{ type: string } & Record<...>` | Source location and loading mechanism |
|
|
186
|
+
| `config` | `unknown` | Optional configuration data for the module |
|
|
187
|
+
| `importOverrides` | `Record<string, string[]>` | Optional mapping of import paths to alternatives |
|
|
188
|
+
| `disabledExports` | `string[]` | Optional list of exports to hide from this module |
|
|
189
189
|
|
|
190
190
|
## `ModuleInfo`
|
|
191
191
|
|
package/docs/6.logging.md
CHANGED
|
@@ -14,14 +14,14 @@ import { Logging } from "@antelopejs/interface-core/logging";
|
|
|
14
14
|
|
|
15
15
|
The `Logging.Level` enum defines the available severity levels:
|
|
16
16
|
|
|
17
|
-
| Level | Value | Purpose
|
|
18
|
-
| ----------- | ----- |
|
|
19
|
-
| `ERROR` | 40 | Critical errors that may cause failure
|
|
20
|
-
| `WARN` | 30 | Issues that do not prevent operation
|
|
21
|
-
| `INFO` | 20 | General status updates and information
|
|
22
|
-
| `DEBUG` | 10 | Detailed information for debugging
|
|
23
|
-
| `TRACE` | 0 | Highly detailed tracing information
|
|
24
|
-
| `NO_PREFIX` | -1 | Messages displayed without a level prefix
|
|
17
|
+
| Level | Value | Purpose |
|
|
18
|
+
| ----------- | ----- | ----------------------------------------- |
|
|
19
|
+
| `ERROR` | 40 | Critical errors that may cause failure |
|
|
20
|
+
| `WARN` | 30 | Issues that do not prevent operation |
|
|
21
|
+
| `INFO` | 20 | General status updates and information |
|
|
22
|
+
| `DEBUG` | 10 | Detailed information for debugging |
|
|
23
|
+
| `TRACE` | 0 | Highly detailed tracing information |
|
|
24
|
+
| `NO_PREFIX` | -1 | Messages displayed without a level prefix |
|
|
25
25
|
|
|
26
26
|
## Log to the main channel
|
|
27
27
|
|
|
@@ -77,10 +77,10 @@ Each log entry emitted through the event system has the following structure:
|
|
|
77
77
|
|
|
78
78
|
```ts
|
|
79
79
|
interface Log {
|
|
80
|
-
time: number;
|
|
81
|
-
channel: string;
|
|
82
|
-
levelId: number;
|
|
83
|
-
args: any[];
|
|
80
|
+
time: number; // Timestamp in milliseconds since epoch
|
|
81
|
+
channel: string; // Channel name (e.g., "main", "database")
|
|
82
|
+
levelId: number; // Numeric severity level
|
|
83
|
+
args: any[]; // The logged values
|
|
84
84
|
}
|
|
85
85
|
```
|
|
86
86
|
|
|
@@ -93,7 +93,8 @@ import eventLog from "@antelopejs/interface-core/logging/listener";
|
|
|
93
93
|
|
|
94
94
|
eventLog.register((log) => {
|
|
95
95
|
const date = new Date(log.time).toISOString();
|
|
96
|
-
const level =
|
|
96
|
+
const level =
|
|
97
|
+
log.levelId >= 40 ? "ERROR" : log.levelId >= 30 ? "WARN" : "INFO";
|
|
97
98
|
console.log(`[${date}] [${level}] [${log.channel}]`, ...log.args);
|
|
98
99
|
});
|
|
99
100
|
```
|
package/docs/7.configuration.md
CHANGED
|
@@ -34,7 +34,11 @@ export default defineConfig({
|
|
|
34
34
|
database: "@antelopejs/database",
|
|
35
35
|
auth: {
|
|
36
36
|
version: "1.0.0",
|
|
37
|
-
source: {
|
|
37
|
+
source: {
|
|
38
|
+
type: "package",
|
|
39
|
+
package: "@antelopejs/auth",
|
|
40
|
+
version: "1.0.0",
|
|
41
|
+
},
|
|
38
42
|
config: { secret: "my-secret" },
|
|
39
43
|
},
|
|
40
44
|
},
|
|
@@ -48,7 +52,11 @@ export default defineConfig((ctx) => {
|
|
|
48
52
|
name: "my-project",
|
|
49
53
|
modules: {
|
|
50
54
|
database: {
|
|
51
|
-
source: {
|
|
55
|
+
source: {
|
|
56
|
+
type: "package",
|
|
57
|
+
package: "@antelopejs/database",
|
|
58
|
+
version: "1.0.0",
|
|
59
|
+
},
|
|
52
60
|
config: {
|
|
53
61
|
host: ctx.env === "production" ? "db.prod.internal" : "localhost",
|
|
54
62
|
},
|
|
@@ -62,15 +70,15 @@ export default defineConfig((ctx) => {
|
|
|
62
70
|
|
|
63
71
|
The root configuration object for an AntelopeJS project.
|
|
64
72
|
|
|
65
|
-
| Property
|
|
66
|
-
|
|
|
67
|
-
| `name`
|
|
68
|
-
| `cacheFolder`
|
|
69
|
-
| `modules`
|
|
70
|
-
| `logging`
|
|
71
|
-
| `envOverrides`
|
|
72
|
-
| `environments`
|
|
73
|
-
| `test`
|
|
73
|
+
| Property | Type | Description |
|
|
74
|
+
| -------------- | ------------------------------------------------ | ----------------------------------------- |
|
|
75
|
+
| `name` | `string` | Project name |
|
|
76
|
+
| `cacheFolder` | `string` | Optional custom cache directory |
|
|
77
|
+
| `modules` | `Record<string, string \| AntelopeModuleConfig>` | Module definitions (shorthand or full) |
|
|
78
|
+
| `logging` | `AntelopeLogging` | Optional logging configuration |
|
|
79
|
+
| `envOverrides` | `Record<string, string \| string[]>` | Optional environment variable overrides |
|
|
80
|
+
| `environments` | `Record<string, Partial<AntelopeConfig>>` | Optional per-environment config overrides |
|
|
81
|
+
| `test` | `AntelopeTestConfig` | Optional test configuration |
|
|
74
82
|
|
|
75
83
|
## Module sources
|
|
76
84
|
|
|
@@ -146,35 +154,35 @@ Like the local source, `local-folder` also accepts an optional `reloadCommand` t
|
|
|
146
154
|
|
|
147
155
|
Full module configuration within the project config.
|
|
148
156
|
|
|
149
|
-
| Property | Type
|
|
150
|
-
| ----------------- |
|
|
151
|
-
| `version` | `string`
|
|
152
|
-
| `source` | `ModuleSource*`
|
|
153
|
-
| `config` | `unknown`
|
|
154
|
-
| `importOverrides` | `ImportOverride[] \| Record<string, string>`
|
|
155
|
-
| `disabledExports` | `string[]`
|
|
157
|
+
| Property | Type | Description |
|
|
158
|
+
| ----------------- | -------------------------------------------- | ----------------------------------------------------- |
|
|
159
|
+
| `version` | `string` | Optional version constraint |
|
|
160
|
+
| `source` | `ModuleSource*` | Source definition (local, git, package, local-folder) |
|
|
161
|
+
| `config` | `unknown` | Optional runtime configuration |
|
|
162
|
+
| `importOverrides` | `ImportOverride[] \| Record<string, string>` | Optional import path redirections |
|
|
163
|
+
| `disabledExports` | `string[]` | Optional list of exports to disable |
|
|
156
164
|
|
|
157
165
|
## `AntelopeLogging`
|
|
158
166
|
|
|
159
167
|
Logging configuration within the project config.
|
|
160
168
|
|
|
161
|
-
| Property
|
|
162
|
-
|
|
|
163
|
-
| `enabled`
|
|
164
|
-
| `moduleTracking`
|
|
165
|
-
| `channelFilter`
|
|
166
|
-
| `formatter`
|
|
167
|
-
| `dateFormat`
|
|
169
|
+
| Property | Type | Description |
|
|
170
|
+
| ---------------- | ---------------------------------- | ------------------------------------------------- |
|
|
171
|
+
| `enabled` | `boolean` | Enable or disable logging |
|
|
172
|
+
| `moduleTracking` | `object` | Track module-level logging with includes/excludes |
|
|
173
|
+
| `channelFilter` | `Record<string, number \| string>` | Filter log output by channel and level |
|
|
174
|
+
| `formatter` | `Record<string, string>` | Custom formatters per channel |
|
|
175
|
+
| `dateFormat` | `string` | Date format string for log timestamps |
|
|
168
176
|
|
|
169
177
|
## `AntelopeTestConfig`
|
|
170
178
|
|
|
171
179
|
Test configuration for the project.
|
|
172
180
|
|
|
173
|
-
| Property | Type
|
|
174
|
-
| --------- |
|
|
175
|
-
| `folder` | `string`
|
|
176
|
-
| `setup` | `Function`
|
|
177
|
-
| `cleanup` | `Function`
|
|
181
|
+
| Property | Type | Description |
|
|
182
|
+
| --------- | ---------- | ------------------------------------------------------ |
|
|
183
|
+
| `folder` | `string` | Optional test folder path |
|
|
184
|
+
| `setup` | `Function` | Optional async setup function returning partial config |
|
|
185
|
+
| `cleanup` | `Function` | Optional async cleanup function |
|
|
178
186
|
|
|
179
187
|
## Next steps
|
|
180
188
|
|
package/docs/8.runtime.md
CHANGED
|
@@ -23,11 +23,11 @@ const info = await GetRuntimeInfo();
|
|
|
23
23
|
// { dev: true, projectPath: "/path/to/project", env: "default" }
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
| Field | Description
|
|
27
|
-
| ------------- |
|
|
28
|
-
| `dev` | `true` when running under `ajs project dev`, `false` otherwise
|
|
29
|
-
| `projectPath` | Absolute path to the root of the running project
|
|
30
|
-
| `env` | Name of the active configuration environment
|
|
26
|
+
| Field | Description |
|
|
27
|
+
| ------------- | -------------------------------------------------------------- |
|
|
28
|
+
| `dev` | `true` when running under `ajs project dev`, `false` otherwise |
|
|
29
|
+
| `projectPath` | Absolute path to the root of the running project |
|
|
30
|
+
| `env` | Name of the active configuration environment |
|
|
31
31
|
|
|
32
32
|
## `RegisterDevServer`
|
|
33
33
|
|
package/package.json
CHANGED
|
@@ -1,48 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/interface-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"description": "AntelopeJS core interface primitives - proxies, decorators, interface functions, and logging",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antelopejs",
|
|
7
|
-
"
|
|
8
|
-
"
|
|
7
|
+
"core",
|
|
8
|
+
"interface"
|
|
9
9
|
],
|
|
10
|
+
"license": "Apache-2.0",
|
|
10
11
|
"repository": {
|
|
11
12
|
"type": "git",
|
|
12
13
|
"url": "git+https://github.com/AntelopeJS/interface-core.git"
|
|
13
14
|
},
|
|
14
|
-
"license": "Apache-2.0",
|
|
15
|
-
"packageManager": "pnpm@10.6.5",
|
|
16
|
-
"main": "dist/index.js",
|
|
17
|
-
"types": "dist/index.d.ts",
|
|
18
15
|
"files": [
|
|
19
16
|
"dist",
|
|
20
17
|
"docs",
|
|
21
18
|
"skills"
|
|
22
19
|
],
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
"types": "./dist/index.d.ts",
|
|
26
|
-
"default": "./dist/index.js"
|
|
27
|
-
},
|
|
28
|
-
"./*": {
|
|
29
|
-
"types": "./dist/*.d.ts",
|
|
30
|
-
"default": "./dist/*.js"
|
|
31
|
-
},
|
|
32
|
-
"./config": {
|
|
33
|
-
"types": "./dist/config.d.ts",
|
|
34
|
-
"default": "./dist/config.js"
|
|
35
|
-
},
|
|
36
|
-
"./logging": {
|
|
37
|
-
"types": "./dist/logging/index.d.ts",
|
|
38
|
-
"default": "./dist/logging/index.js"
|
|
39
|
-
},
|
|
40
|
-
"./logging/*": {
|
|
41
|
-
"types": "./dist/logging/*.d.ts",
|
|
42
|
-
"default": "./dist/logging/*.js"
|
|
43
|
-
},
|
|
44
|
-
"./package.json": "./package.json"
|
|
45
|
-
},
|
|
20
|
+
"main": "dist/index.js",
|
|
21
|
+
"types": "dist/index.d.ts",
|
|
46
22
|
"typesVersions": {
|
|
47
23
|
"*": {
|
|
48
24
|
"decorators": [
|
|
@@ -71,37 +47,70 @@
|
|
|
71
47
|
]
|
|
72
48
|
}
|
|
73
49
|
},
|
|
50
|
+
"exports": {
|
|
51
|
+
".": {
|
|
52
|
+
"types": "./dist/index.d.ts",
|
|
53
|
+
"default": "./dist/index.js"
|
|
54
|
+
},
|
|
55
|
+
"./*": {
|
|
56
|
+
"types": "./dist/*.d.ts",
|
|
57
|
+
"default": "./dist/*.js"
|
|
58
|
+
},
|
|
59
|
+
"./config": {
|
|
60
|
+
"types": "./dist/config.d.ts",
|
|
61
|
+
"default": "./dist/config.js"
|
|
62
|
+
},
|
|
63
|
+
"./logging": {
|
|
64
|
+
"types": "./dist/logging/index.d.ts",
|
|
65
|
+
"default": "./dist/logging/index.js"
|
|
66
|
+
},
|
|
67
|
+
"./logging/*": {
|
|
68
|
+
"types": "./dist/logging/*.d.ts",
|
|
69
|
+
"default": "./dist/logging/*.js"
|
|
70
|
+
},
|
|
71
|
+
"./package.json": "./package.json"
|
|
72
|
+
},
|
|
73
|
+
"publishConfig": {
|
|
74
|
+
"access": "public",
|
|
75
|
+
"provenance": true
|
|
76
|
+
},
|
|
74
77
|
"scripts": {
|
|
75
78
|
"build": "rimraf dist && tsc",
|
|
76
|
-
"format": "
|
|
77
|
-
"lint:fix": "
|
|
78
|
-
"lint": "
|
|
79
|
+
"format": "oxfmt .",
|
|
80
|
+
"lint:fix": "oxlint --fix",
|
|
81
|
+
"lint": "oxlint",
|
|
79
82
|
"prepack": "pnpm run build",
|
|
80
|
-
"release": "pnpm run lint && pnpm run prepack && release-it",
|
|
81
|
-
"test": "pnpm run build &&
|
|
82
|
-
"test:package": "node test/package-consumer.mjs"
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
"test": "src/antelope.test.ts",
|
|
86
|
-
"skills": [
|
|
87
|
-
"./skills"
|
|
88
|
-
]
|
|
83
|
+
"release": "pnpm run lint && pnpm run test && pnpm run test:package && pnpm run prepack && release-it",
|
|
84
|
+
"test": "pnpm run build && mocha 'dist/tests/**/*.test.js'",
|
|
85
|
+
"test:package": "node test/package-consumer.mjs",
|
|
86
|
+
"format:check": "oxfmt --check .",
|
|
87
|
+
"knip": "knip"
|
|
89
88
|
},
|
|
90
89
|
"dependencies": {
|
|
91
90
|
"reflect-metadata": "^0.2.2"
|
|
92
91
|
},
|
|
93
92
|
"devDependencies": {
|
|
94
|
-
"@
|
|
93
|
+
"@antelopejs/tooling-configs": "^0.0.4",
|
|
95
94
|
"@types/chai": "^4.3.20",
|
|
96
95
|
"@types/mocha": "^10.0.10",
|
|
97
96
|
"@types/node": "^22.19.15",
|
|
98
97
|
"chai": "^4.5.0",
|
|
98
|
+
"eslint-plugin-perfectionist": "^5.11.0",
|
|
99
|
+
"knip": "^6.34.0",
|
|
100
|
+
"mocha": "^11.7.5",
|
|
101
|
+
"oxfmt": "^0.66.0",
|
|
102
|
+
"oxlint": "1.81.0",
|
|
103
|
+
"oxlint-tsgolint": "^7.0.2001",
|
|
99
104
|
"release-it": "^19.2.4",
|
|
100
105
|
"release-it-changelogen": "^0.1.0",
|
|
101
106
|
"rimraf": "^6.1.3",
|
|
102
107
|
"typescript": "^5.9.3"
|
|
103
108
|
},
|
|
104
|
-
"
|
|
105
|
-
|
|
109
|
+
"packageManager": "pnpm@10.6.5",
|
|
110
|
+
"antelopeJs": {
|
|
111
|
+
"test": "src/antelope.test.ts",
|
|
112
|
+
"skills": [
|
|
113
|
+
"./skills"
|
|
114
|
+
]
|
|
106
115
|
}
|
|
107
116
|
}
|
|
@@ -16,12 +16,48 @@ factories, `GetMetadata`, and config types are ordinary consumer-side helpers (n
|
|
|
16
16
|
## Import paths
|
|
17
17
|
|
|
18
18
|
```ts
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
import {
|
|
20
|
+
InterfaceFunction,
|
|
21
|
+
ImplementInterface,
|
|
22
|
+
GetMetadata,
|
|
23
|
+
GetInterfaceInstances,
|
|
24
|
+
GetInterfaceInstance,
|
|
25
|
+
AsyncProxy,
|
|
26
|
+
EventProxy,
|
|
27
|
+
RegisteringProxy,
|
|
28
|
+
GetResponsibleModule,
|
|
29
|
+
} from "@antelopejs/interface-core";
|
|
30
|
+
import {
|
|
31
|
+
MakeClassDecorator,
|
|
32
|
+
MakeMethodDecorator,
|
|
33
|
+
MakePropertyDecorator,
|
|
34
|
+
MakeParameterDecorator,
|
|
35
|
+
} from "@antelopejs/interface-core/decorators"; // + many combined variants
|
|
36
|
+
import {
|
|
37
|
+
Events,
|
|
38
|
+
ListModules,
|
|
39
|
+
GetModuleInfo,
|
|
40
|
+
LoadModule,
|
|
41
|
+
StartModule,
|
|
42
|
+
StopModule,
|
|
43
|
+
DestroyModule,
|
|
44
|
+
ReloadModule,
|
|
45
|
+
} from "@antelopejs/interface-core/modules";
|
|
46
|
+
import {
|
|
47
|
+
AsyncProxy,
|
|
48
|
+
EventProxy,
|
|
49
|
+
RegisteringProxy,
|
|
50
|
+
} from "@antelopejs/interface-core/proxies"; // same classes the root entry re-exports; pick one import site
|
|
51
|
+
import {
|
|
52
|
+
GetRuntimeInfo,
|
|
53
|
+
RegisterDevServer,
|
|
54
|
+
DEV_REGISTRY_PATH,
|
|
55
|
+
} from "@antelopejs/interface-core/runtime";
|
|
56
|
+
import {
|
|
57
|
+
defineConfig,
|
|
58
|
+
type AntelopeConfig,
|
|
59
|
+
type AntelopeModuleConfig,
|
|
60
|
+
} from "@antelopejs/interface-core/config";
|
|
25
61
|
import { Logging } from "@antelopejs/interface-core/logging";
|
|
26
62
|
```
|
|
27
63
|
|
|
@@ -65,8 +101,8 @@ implemented; providers `emit` on them, consumers `register`/`unregister` handler
|
|
|
65
101
|
```ts
|
|
66
102
|
import { Logging } from "@antelopejs/interface-core/logging";
|
|
67
103
|
|
|
68
|
-
Logging.Info("hello");
|
|
69
|
-
const ch = new Logging.Channel("database");
|
|
104
|
+
Logging.Info("hello"); // main channel; also Error/Warn/Debug/Trace
|
|
105
|
+
const ch = new Logging.Channel("database"); // named channel
|
|
70
106
|
ch.Debug("query", { ms: 12 });
|
|
71
107
|
```
|
|
72
108
|
|