@antelopejs/interface-core 0.2.5 → 0.2.6
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/modules.d.ts +15 -0
- package/dist/modules.js +15 -0
- package/dist/modules.js.map +1 -1
- package/docs/5.modules.md +21 -1
- package/package.json +1 -1
- package/skills/core-interface/SKILL.md +1 -1
package/dist/modules.d.ts
CHANGED
|
@@ -49,6 +49,21 @@ export declare namespace Events {
|
|
|
49
49
|
* @param module Module ID
|
|
50
50
|
*/
|
|
51
51
|
const ModuleDestroyed: EventProxy<(module: string) => void>;
|
|
52
|
+
/**
|
|
53
|
+
* Event triggers once every module the core was asked to start has started.
|
|
54
|
+
*
|
|
55
|
+
* Fires after the last `start()` of a project start (or reload) completed
|
|
56
|
+
* successfully: the project as a whole is ready to serve. It does not fire
|
|
57
|
+
* when a module fails to start.
|
|
58
|
+
*/
|
|
59
|
+
const ModulesStarted: EventProxy<() => void>;
|
|
60
|
+
/**
|
|
61
|
+
* Event triggers before the first module stops.
|
|
62
|
+
*
|
|
63
|
+
* Fires once per stop following a {@link ModulesStarted}: stopping every
|
|
64
|
+
* module of a project, or reloading one, is a single "stopping".
|
|
65
|
+
*/
|
|
66
|
+
const ModulesStopping: EventProxy<() => void>;
|
|
52
67
|
}
|
|
53
68
|
/**
|
|
54
69
|
* Releases everything an owner that is not a module generation attached or
|
package/dist/modules.js
CHANGED
|
@@ -58,6 +58,21 @@ var Events;
|
|
|
58
58
|
* @param module Module ID
|
|
59
59
|
*/
|
|
60
60
|
Events.ModuleDestroyed = new proxies_1.EventProxy("modules.ModuleDestroyed");
|
|
61
|
+
/**
|
|
62
|
+
* Event triggers once every module the core was asked to start has started.
|
|
63
|
+
*
|
|
64
|
+
* Fires after the last `start()` of a project start (or reload) completed
|
|
65
|
+
* successfully: the project as a whole is ready to serve. It does not fire
|
|
66
|
+
* when a module fails to start.
|
|
67
|
+
*/
|
|
68
|
+
Events.ModulesStarted = new proxies_1.EventProxy("modules.ModulesStarted");
|
|
69
|
+
/**
|
|
70
|
+
* Event triggers before the first module stops.
|
|
71
|
+
*
|
|
72
|
+
* Fires once per stop following a {@link ModulesStarted}: stopping every
|
|
73
|
+
* module of a project, or reloading one, is a single "stopping".
|
|
74
|
+
*/
|
|
75
|
+
Events.ModulesStopping = new proxies_1.EventProxy("modules.ModulesStopping");
|
|
61
76
|
})(Events || (exports.Events = Events = {}));
|
|
62
77
|
function runCleanup(cleanup, module, operation) {
|
|
63
78
|
try {
|
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;
|
|
1
|
+
{"version":3,"file":"modules.js","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":";;;AAaA,oDAKC;AAGD,4CAEC;AAsKD,oCAEC;AA9LD,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,CAqEtB;AArED,WAAiB,MAAM;IACrB;;;;;;;OAOG;IACU,wBAAiB,GAAG,IAAI,oBAAU,CAC7C,2BAA2B,CAC5B,CAAC;IAEF;;;;;;;OAOG;IACU,oBAAa,GAAG,IAAI,oBAAU,CACzC,uBAAuB,CACxB,CAAC;IAEF;;;;;;;OAOG;IACU,oBAAa,GAAG,IAAI,oBAAU,CACzC,uBAAuB,CACxB,CAAC;IAEF;;;;;;;OAOG;IACU,sBAAe,GAAG,IAAI,oBAAU,CAC3C,yBAAyB,CAC1B,CAAC;IAEF;;;;;;O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;GAOG;AACU,QAAA,WAAW,GAAG,IAAA,2BAAiB,EAC1C,qBAAqB,CACtB,CAAC;AAEF;;;;;;;;GAQG;AACU,QAAA,aAAa,GAAG,IAAA,2BAAiB,EAC5C,uBAAuB,CACxB,CAAC;AAEF;;;;;;;;;GASG;AACU,QAAA,UAAU,GACrB,IAAA,2BAAiB,EAMf,oBAAoB,CAAC,CAAC;AAE1B;;;;;;;;GAQG;AACU,QAAA,WAAW,GAAG,IAAA,2BAAiB,EAC1C,qBAAqB,CACtB,CAAC;AAEF;;;;;;;;GAQG;AACU,QAAA,UAAU,GACrB,IAAA,2BAAiB,EAA2B,oBAAoB,CAAC,CAAC;AAEpE;;;;;;;;GAQG;AACU,QAAA,aAAa,GAAG,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/docs/5.modules.md
CHANGED
|
@@ -116,7 +116,27 @@ Events.ModuleDestroyed.register((moduleId: string) => {
|
|
|
116
116
|
});
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
-
The
|
|
119
|
+
The signature of these four events remains the module ID. When emitted inside `RunWithModuleContext`, cleanup targets that context's `owner`; without an explicit owner it retains the module-level behavior used by earlier releases.
|
|
120
|
+
|
|
121
|
+
### `Events.ModulesStarted`
|
|
122
|
+
|
|
123
|
+
Fires once every module the core was asked to start has started: the project as a whole is ready to serve. It does not fire when a module fails to start.
|
|
124
|
+
|
|
125
|
+
```ts
|
|
126
|
+
Events.ModulesStarted.register(() => {
|
|
127
|
+
console.log("All modules started");
|
|
128
|
+
});
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### `Events.ModulesStopping`
|
|
132
|
+
|
|
133
|
+
Fires before the first module stops, once per stop following `ModulesStarted`: stopping a project, or reloading one module, is a single "stopping".
|
|
134
|
+
|
|
135
|
+
```ts
|
|
136
|
+
Events.ModulesStopping.register(() => {
|
|
137
|
+
console.log("Modules are stopping");
|
|
138
|
+
});
|
|
139
|
+
```
|
|
120
140
|
|
|
121
141
|
## Management functions
|
|
122
142
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: core-interface
|
|
3
|
-
description: Provides the AntelopeJS core interface primitives - AsyncProxy/EventProxy/RegisteringProxy, InterfaceFunction, ImplementInterface, GetMetadata, decorator factories, module lifecycle events, structured Logging, and defineConfig. Use when importing from "@antelopejs/interface-core" (or its /decorators, /modules, /proxies, /runtime, /config, /logging subpaths), when declaring or implementing an AntelopeJS interface, wiring cross-module calls or events, building custom decorators, subscribing to ModuleStarted/ModuleDestroyed, writing logs via Logging.Info/Error, or authoring antelope.config with defineConfig.
|
|
3
|
+
description: Provides the AntelopeJS core interface primitives - AsyncProxy/EventProxy/RegisteringProxy, InterfaceFunction, ImplementInterface, GetMetadata, decorator factories, module lifecycle events, structured Logging, and defineConfig. Use when importing from "@antelopejs/interface-core" (or its /decorators, /modules, /proxies, /runtime, /config, /logging subpaths), when declaring or implementing an AntelopeJS interface, wiring cross-module calls or events, building custom decorators, subscribing to ModuleStarted/ModuleDestroyed or ModulesStarted/ModulesStopping, writing logs via Logging.Info/Error, or authoring antelope.config with defineConfig.
|
|
4
4
|
category: antelopejs-interface
|
|
5
5
|
tags: [antelopejs, interface, proxy, decorators, logging]
|
|
6
6
|
---
|