@wild-framework/core 0.1.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/LICENSE +21 -0
- package/README.md +32 -0
- package/dist/application.d.ts +74 -0
- package/dist/application.d.ts.map +1 -0
- package/dist/application.js +166 -0
- package/dist/application.js.map +1 -0
- package/dist/contracts.d.ts +50 -0
- package/dist/contracts.d.ts.map +1 -0
- package/dist/contracts.js +2 -0
- package/dist/contracts.js.map +1 -0
- package/dist/errors.d.ts +37 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +55 -0
- package/dist/errors.js.map +1 -0
- package/dist/factory.d.ts +9 -0
- package/dist/factory.d.ts.map +1 -0
- package/dist/factory.js +11 -0
- package/dist/factory.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/state.d.ts +22 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/state.js +23 -0
- package/dist/state.js.map +1 -0
- package/package.json +40 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Wild Framework contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# @wild-framework/core
|
|
2
|
+
|
|
3
|
+
Application lifecycle and provider system for [Wild Framework](https://github.com/your-org/wild-framework).
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @wild-framework/core
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { createApplication } from "@wild-framework/core";
|
|
15
|
+
|
|
16
|
+
const app = createApplication();
|
|
17
|
+
app.register(DatabaseProvider);
|
|
18
|
+
await app.boot();
|
|
19
|
+
await app.listen(3000);
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## API
|
|
23
|
+
|
|
24
|
+
- `createApplication()` — create the app
|
|
25
|
+
- `app.register(ProviderClass)` — register a provider
|
|
26
|
+
- `app.boot()` / `app.shutdown()` — lifecycle
|
|
27
|
+
- `app.resolve(T)` — resolve from the container
|
|
28
|
+
- `app.listen(port)` — start the HTTP server
|
|
29
|
+
|
|
30
|
+
## License
|
|
31
|
+
|
|
32
|
+
MIT
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { ProviderConstructor, Resolver, Server } from "./contracts.js";
|
|
2
|
+
/**
|
|
3
|
+
* The Application orchestrates the framework lifecycle.
|
|
4
|
+
*
|
|
5
|
+
* It owns provider registration, boot sequencing, and delegation
|
|
6
|
+
* to infrastructure implementations (Resolver, Server).
|
|
7
|
+
*
|
|
8
|
+
* Application is a plain class — no inheritance, no decorators.
|
|
9
|
+
*/
|
|
10
|
+
export declare class Application {
|
|
11
|
+
private state;
|
|
12
|
+
/** Provider constructors in FIFO registration order. */
|
|
13
|
+
private providerConstructors;
|
|
14
|
+
/** Instantiated providers, keyed by constructor. Populated during boot. */
|
|
15
|
+
private providerInstances;
|
|
16
|
+
/** Providers that successfully completed `boot()`. */
|
|
17
|
+
private bootedProviders;
|
|
18
|
+
/** Providers that completed `register()` (superset of bootedProviders). Used by shutdown to clean up. */
|
|
19
|
+
private liveProviders;
|
|
20
|
+
private resolver;
|
|
21
|
+
private server;
|
|
22
|
+
/**
|
|
23
|
+
* Register a provider for boot.
|
|
24
|
+
*
|
|
25
|
+
* Accepts a provider **class** (constructor), not an instance.
|
|
26
|
+
* Must be called before `boot()`. Throws on duplicate or if already booted.
|
|
27
|
+
*/
|
|
28
|
+
register(providerCtor: ProviderConstructor): void;
|
|
29
|
+
/**
|
|
30
|
+
* Boot the application.
|
|
31
|
+
*
|
|
32
|
+
* Instantiates each provider, runs `register()` on all (FIFO),
|
|
33
|
+
* then `boot()` on all (FIFO). Idempotent in Booted and Shutdown states.
|
|
34
|
+
* On failure, transitions to BootFailed and rethrows.
|
|
35
|
+
*/
|
|
36
|
+
boot(): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Shut down the application.
|
|
39
|
+
*
|
|
40
|
+
* Calls `shutdown()` on all booted providers in LIFO order,
|
|
41
|
+
* then transitions to Shutdown.
|
|
42
|
+
*/
|
|
43
|
+
shutdown(): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Register the dependency resolver.
|
|
46
|
+
* Called by ContainerProvider during its `register()` phase.
|
|
47
|
+
* Throws if a resolver is already set.
|
|
48
|
+
*/
|
|
49
|
+
setResolver(resolver: Resolver): void;
|
|
50
|
+
/**
|
|
51
|
+
* Resolve a class constructor — type is inferred from the token.
|
|
52
|
+
*/
|
|
53
|
+
resolve<T>(token: abstract new (...args: any[]) => T): T;
|
|
54
|
+
/**
|
|
55
|
+
* Resolve an arbitrary token — type must be explicit.
|
|
56
|
+
*/
|
|
57
|
+
resolve<T>(token: unknown): T;
|
|
58
|
+
/**
|
|
59
|
+
* Register the HTTP server.
|
|
60
|
+
* Called by HttpProvider during its `register()` phase.
|
|
61
|
+
* Throws if a server is already set.
|
|
62
|
+
*/
|
|
63
|
+
setServer(server: Server): void;
|
|
64
|
+
/**
|
|
65
|
+
* Start listening for HTTP requests.
|
|
66
|
+
* Delegates to the registered Server. Throws if none is registered.
|
|
67
|
+
*/
|
|
68
|
+
listen(port: number): Promise<void>;
|
|
69
|
+
/** Whether the application has successfully booted. */
|
|
70
|
+
isBooted(): boolean;
|
|
71
|
+
/** Whether the application has been shut down. */
|
|
72
|
+
isShutdown(): boolean;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=application.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../src/application.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,mBAAmB,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAWtF;;;;;;;GAOG;AACH,qBAAa,WAAW;IACpB,OAAO,CAAC,KAAK,CAA8C;IAE3D,wDAAwD;IACxD,OAAO,CAAC,oBAAoB,CAA6B;IAEzD,2EAA2E;IAC3E,OAAO,CAAC,iBAAiB,CAA4C;IAErE,sDAAsD;IACtD,OAAO,CAAC,eAAe,CAAkC;IAEzD,yGAAyG;IACzG,OAAO,CAAC,aAAa,CAAkC;IAEvD,OAAO,CAAC,QAAQ,CAAyB;IACzC,OAAO,CAAC,MAAM,CAAuB;IAMrC;;;;;OAKG;IACH,QAAQ,CAAC,YAAY,EAAE,mBAAmB,GAAG,IAAI;IAgBjD;;;;;;OAMG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAwC3B;;;;;OAKG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IA0B/B;;;;OAIG;IACH,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAOrC;;OAEG;IACH,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC;IACxD;;OAEG;IACH,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,CAAC;IAiB7B;;;;OAIG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAO/B;;;OAGG;IACG,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAWzC,uDAAuD;IACvD,QAAQ,IAAI,OAAO;IAInB,kDAAkD;IAClD,UAAU,IAAI,OAAO;CAGxB"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { ApplicationState } from "./state.js";
|
|
2
|
+
import { ApplicationAlreadyBootedError, ApplicationBootFailedError, DuplicateProviderError, DuplicateRegistrationError, NoResolverRegisteredError, NoServerRegisteredError, } from "./errors.js";
|
|
3
|
+
/**
|
|
4
|
+
* The Application orchestrates the framework lifecycle.
|
|
5
|
+
*
|
|
6
|
+
* It owns provider registration, boot sequencing, and delegation
|
|
7
|
+
* to infrastructure implementations (Resolver, Server).
|
|
8
|
+
*
|
|
9
|
+
* Application is a plain class — no inheritance, no decorators.
|
|
10
|
+
*/
|
|
11
|
+
export class Application {
|
|
12
|
+
state = ApplicationState.Created;
|
|
13
|
+
/** Provider constructors in FIFO registration order. */
|
|
14
|
+
providerConstructors = [];
|
|
15
|
+
/** Instantiated providers, keyed by constructor. Populated during boot. */
|
|
16
|
+
providerInstances = new Map();
|
|
17
|
+
/** Providers that successfully completed `boot()`. */
|
|
18
|
+
bootedProviders = new Set();
|
|
19
|
+
/** Providers that completed `register()` (superset of bootedProviders). Used by shutdown to clean up. */
|
|
20
|
+
liveProviders = new Set();
|
|
21
|
+
resolver = null;
|
|
22
|
+
server = null;
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
// Provider registration
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
/**
|
|
27
|
+
* Register a provider for boot.
|
|
28
|
+
*
|
|
29
|
+
* Accepts a provider **class** (constructor), not an instance.
|
|
30
|
+
* Must be called before `boot()`. Throws on duplicate or if already booted.
|
|
31
|
+
*/
|
|
32
|
+
register(providerCtor) {
|
|
33
|
+
if (this.state !== ApplicationState.Created) {
|
|
34
|
+
throw new ApplicationAlreadyBootedError();
|
|
35
|
+
}
|
|
36
|
+
if (this.providerConstructors.includes(providerCtor)) {
|
|
37
|
+
throw new DuplicateProviderError(providerCtor.name);
|
|
38
|
+
}
|
|
39
|
+
this.providerConstructors.push(providerCtor);
|
|
40
|
+
}
|
|
41
|
+
// ---------------------------------------------------------------------------
|
|
42
|
+
// Lifecycle
|
|
43
|
+
// ---------------------------------------------------------------------------
|
|
44
|
+
/**
|
|
45
|
+
* Boot the application.
|
|
46
|
+
*
|
|
47
|
+
* Instantiates each provider, runs `register()` on all (FIFO),
|
|
48
|
+
* then `boot()` on all (FIFO). Idempotent in Booted and Shutdown states.
|
|
49
|
+
* On failure, transitions to BootFailed and rethrows.
|
|
50
|
+
*/
|
|
51
|
+
async boot() {
|
|
52
|
+
if (this.state === ApplicationState.Booted || this.state === ApplicationState.Shutdown) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (this.state === ApplicationState.BootFailed) {
|
|
56
|
+
throw new ApplicationBootFailedError();
|
|
57
|
+
}
|
|
58
|
+
try {
|
|
59
|
+
// Phase 1: instantiate and register all providers (FIFO)
|
|
60
|
+
for (const ctor of this.providerConstructors) {
|
|
61
|
+
const instance = new ctor();
|
|
62
|
+
this.providerInstances.set(ctor, instance);
|
|
63
|
+
if (instance.register) {
|
|
64
|
+
await instance.register(this);
|
|
65
|
+
}
|
|
66
|
+
this.liveProviders.add(ctor);
|
|
67
|
+
}
|
|
68
|
+
// Phase 2: boot all providers (FIFO)
|
|
69
|
+
for (const ctor of this.providerConstructors) {
|
|
70
|
+
const instance = this.providerInstances.get(ctor);
|
|
71
|
+
if (instance.boot) {
|
|
72
|
+
await instance.boot(this);
|
|
73
|
+
}
|
|
74
|
+
this.bootedProviders.add(ctor);
|
|
75
|
+
}
|
|
76
|
+
this.state = ApplicationState.Booted;
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
this.state = ApplicationState.BootFailed;
|
|
80
|
+
throw error;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Shut down the application.
|
|
85
|
+
*
|
|
86
|
+
* Calls `shutdown()` on all booted providers in LIFO order,
|
|
87
|
+
* then transitions to Shutdown.
|
|
88
|
+
*/
|
|
89
|
+
async shutdown() {
|
|
90
|
+
if (this.state === ApplicationState.Shutdown) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
// Iterate in reverse (LIFO), only providers that completed register()
|
|
94
|
+
for (let i = this.providerConstructors.length - 1; i >= 0; i--) {
|
|
95
|
+
const ctor = this.providerConstructors[i];
|
|
96
|
+
if (!this.liveProviders.has(ctor)) {
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
const instance = this.providerInstances.get(ctor);
|
|
100
|
+
if (instance?.shutdown) {
|
|
101
|
+
await instance.shutdown(this);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
this.state = ApplicationState.Shutdown;
|
|
105
|
+
}
|
|
106
|
+
// ---------------------------------------------------------------------------
|
|
107
|
+
// Delegation — Resolver
|
|
108
|
+
// ---------------------------------------------------------------------------
|
|
109
|
+
/**
|
|
110
|
+
* Register the dependency resolver.
|
|
111
|
+
* Called by ContainerProvider during its `register()` phase.
|
|
112
|
+
* Throws if a resolver is already set.
|
|
113
|
+
*/
|
|
114
|
+
setResolver(resolver) {
|
|
115
|
+
if (this.resolver) {
|
|
116
|
+
throw new DuplicateRegistrationError("resolver");
|
|
117
|
+
}
|
|
118
|
+
this.resolver = resolver;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Resolve a dependency from the container.
|
|
122
|
+
* Delegates to the registered Resolver. Throws if none is registered.
|
|
123
|
+
*/
|
|
124
|
+
resolve(token) {
|
|
125
|
+
if (!this.resolver) {
|
|
126
|
+
throw new NoResolverRegisteredError();
|
|
127
|
+
}
|
|
128
|
+
return this.resolver.resolve(token);
|
|
129
|
+
}
|
|
130
|
+
// ---------------------------------------------------------------------------
|
|
131
|
+
// Delegation — Server
|
|
132
|
+
// ---------------------------------------------------------------------------
|
|
133
|
+
/**
|
|
134
|
+
* Register the HTTP server.
|
|
135
|
+
* Called by HttpProvider during its `register()` phase.
|
|
136
|
+
* Throws if a server is already set.
|
|
137
|
+
*/
|
|
138
|
+
setServer(server) {
|
|
139
|
+
if (this.server) {
|
|
140
|
+
throw new DuplicateRegistrationError("server");
|
|
141
|
+
}
|
|
142
|
+
this.server = server;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Start listening for HTTP requests.
|
|
146
|
+
* Delegates to the registered Server. Throws if none is registered.
|
|
147
|
+
*/
|
|
148
|
+
async listen(port) {
|
|
149
|
+
if (!this.server) {
|
|
150
|
+
throw new NoServerRegisteredError();
|
|
151
|
+
}
|
|
152
|
+
await this.server.listen(port);
|
|
153
|
+
}
|
|
154
|
+
// ---------------------------------------------------------------------------
|
|
155
|
+
// State queries
|
|
156
|
+
// ---------------------------------------------------------------------------
|
|
157
|
+
/** Whether the application has successfully booted. */
|
|
158
|
+
isBooted() {
|
|
159
|
+
return this.state === ApplicationState.Booted;
|
|
160
|
+
}
|
|
161
|
+
/** Whether the application has been shut down. */
|
|
162
|
+
isShutdown() {
|
|
163
|
+
return this.state === ApplicationState.Shutdown;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=application.js.map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E,CAAC;YACd,MAAM,IAAI,0BAA0B,CAAC,QAAQ,CAAC,CAAC;QACnD,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,MAAM,CAAC,IAAY;QACrB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACf,MAAM,IAAI,uBAAuB,EAAE,CAAC;QACxC,CAAC;QACD,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,8EAA8E;IAC9E,gBAAgB;IAChB,8EAA8E;IAE9E,uDAAuD;IACvD,QAAQ;QACJ,OAAO,IAAI,CAAC,KAAK,KAAK,gBAAgB,CAAC,MAAM,CAAC;IAClD,CAAC;IAED,kDAAkD;IAClD,UAAU;QACN,OAAO,IAAI,CAAC,KAAK,KAAK,gBAAgB,CAAC,QAAQ,CAAC;IACpD,CAAC;CACJ"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Application } from "./application.js";
|
|
2
|
+
/**
|
|
3
|
+
* Provider contract that every Wild Framework package implements.
|
|
4
|
+
*
|
|
5
|
+
* Core instantiates provider classes via `new` — providers must have
|
|
6
|
+
* a no-arg constructor. Dependencies are obtained via `app.resolve()`
|
|
7
|
+
* inside lifecycle methods, not via constructor injection.
|
|
8
|
+
*
|
|
9
|
+
* All three lifecycle methods are optional — a provider may implement
|
|
10
|
+
* any subset.
|
|
11
|
+
*/
|
|
12
|
+
export interface Provider {
|
|
13
|
+
/**
|
|
14
|
+
* Called during `app.boot()`.
|
|
15
|
+
* Register services into the container, set the resolver/server, etc.
|
|
16
|
+
*/
|
|
17
|
+
register?(app: Application): void | Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Called after all providers have been registered.
|
|
20
|
+
* Start listeners, connect to databases, schedule jobs, etc.
|
|
21
|
+
*/
|
|
22
|
+
boot?(app: Application): void | Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Called during `app.shutdown()` in reverse registration order.
|
|
25
|
+
* Only called for providers that successfully completed `boot()`.
|
|
26
|
+
*/
|
|
27
|
+
shutdown?(app: Application): void | Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Constructor type for providers. `app.register()` accepts the class,
|
|
31
|
+
* not an instance. Core calls `new` internally.
|
|
32
|
+
*/
|
|
33
|
+
export type ProviderConstructor = new () => Provider;
|
|
34
|
+
/**
|
|
35
|
+
* Dependency injection contract. Implemented by @wild-framework/container.
|
|
36
|
+
*/
|
|
37
|
+
export interface Resolver {
|
|
38
|
+
/** Resolve a class constructor — type is inferred from the token. */
|
|
39
|
+
resolve<T>(token: abstract new (...args: any[]) => T): T;
|
|
40
|
+
/** Resolve an arbitrary token (string, Symbol, etc.) — type must be explicit. */
|
|
41
|
+
resolve<T>(token: unknown): T;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* HTTP server contract. Implemented by @wild-framework/http.
|
|
45
|
+
*/
|
|
46
|
+
export interface Server {
|
|
47
|
+
listen(port: number): Promise<void>;
|
|
48
|
+
shutdown(): Promise<void>;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=contracts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;;;;;;;;GASG;AACH,MAAM,WAAW,QAAQ;IACrB;;;OAGG;IACH,QAAQ,CAAC,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD;;;OAGG;IACH,IAAI,CAAC,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9C;;;OAGG;IACH,QAAQ,CAAC,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACrD;AAED;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,UAAU,QAAQ,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,QAAQ;IACrB,qEAAqE;IACrE,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACzD,iFAAiF;IACjF,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,CAAC,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACnB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":""}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thrown when the same provider constructor is registered more than once.
|
|
3
|
+
*/
|
|
4
|
+
export declare class DuplicateProviderError extends Error {
|
|
5
|
+
constructor(providerName: string);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Thrown when `register()` is called after `boot()` has been invoked.
|
|
9
|
+
*/
|
|
10
|
+
export declare class ApplicationAlreadyBootedError extends Error {
|
|
11
|
+
constructor();
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Thrown when `boot()` is called while the application is in the BootFailed state.
|
|
15
|
+
*/
|
|
16
|
+
export declare class ApplicationBootFailedError extends Error {
|
|
17
|
+
constructor();
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Thrown when `app.resolve()` is called before a Resolver has been registered.
|
|
21
|
+
*/
|
|
22
|
+
export declare class NoResolverRegisteredError extends Error {
|
|
23
|
+
constructor();
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Thrown when `app.listen()` is called before a Server has been registered.
|
|
27
|
+
*/
|
|
28
|
+
export declare class NoServerRegisteredError extends Error {
|
|
29
|
+
constructor();
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Thrown when a Resolver or Server is set more than once.
|
|
33
|
+
*/
|
|
34
|
+
export declare class DuplicateRegistrationError extends Error {
|
|
35
|
+
constructor(kind: string);
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,KAAK;gBACjC,YAAY,EAAE,MAAM;CAInC;AAED;;GAEG;AACH,qBAAa,6BAA8B,SAAQ,KAAK;;CAKvD;AAED;;GAEG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;;CAKpD;AAED;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,KAAK;;CAKnD;AAED;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;;CAKjD;AAED;;GAEG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;gBACrC,IAAI,EAAE,MAAM;CAI3B"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thrown when the same provider constructor is registered more than once.
|
|
3
|
+
*/
|
|
4
|
+
export class DuplicateProviderError extends Error {
|
|
5
|
+
constructor(providerName) {
|
|
6
|
+
super(`Provider "${providerName}" is already registered.`);
|
|
7
|
+
this.name = "DuplicateProviderError";
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Thrown when `register()` is called after `boot()` has been invoked.
|
|
12
|
+
*/
|
|
13
|
+
export class ApplicationAlreadyBootedError extends Error {
|
|
14
|
+
constructor() {
|
|
15
|
+
super("Cannot register providers after the application has been booted.");
|
|
16
|
+
this.name = "ApplicationAlreadyBootedError";
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Thrown when `boot()` is called while the application is in the BootFailed state.
|
|
21
|
+
*/
|
|
22
|
+
export class ApplicationBootFailedError extends Error {
|
|
23
|
+
constructor() {
|
|
24
|
+
super("Cannot boot — the application is in a failed state. Call shutdown() to recover.");
|
|
25
|
+
this.name = "ApplicationBootFailedError";
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Thrown when `app.resolve()` is called before a Resolver has been registered.
|
|
30
|
+
*/
|
|
31
|
+
export class NoResolverRegisteredError extends Error {
|
|
32
|
+
constructor() {
|
|
33
|
+
super("No resolver has been registered. Register a ContainerProvider before calling resolve().");
|
|
34
|
+
this.name = "NoResolverRegisteredError";
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Thrown when `app.listen()` is called before a Server has been registered.
|
|
39
|
+
*/
|
|
40
|
+
export class NoServerRegisteredError extends Error {
|
|
41
|
+
constructor() {
|
|
42
|
+
super("No server has been registered. Register an HttpProvider before calling listen().");
|
|
43
|
+
this.name = "NoServerRegisteredError";
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Thrown when a Resolver or Server is set more than once.
|
|
48
|
+
*/
|
|
49
|
+
export class DuplicateRegistrationError extends Error {
|
|
50
|
+
constructor(kind) {
|
|
51
|
+
super(`A ${kind} has already been registered. Only one ${kind} is allowed.`);
|
|
52
|
+
this.name = "DuplicateRegistrationError";
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAC7C,YAAY,YAAoB;QAC5B,KAAK,CAAC,aAAa,YAAY,0BAA0B,CAAC,CAAC;QAC3D,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;IACzC,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,6BAA8B,SAAQ,KAAK;IACpD;QACI,KAAK,CAAC,kEAAkE,CAAC,CAAC;QAC1E,IAAI,CAAC,IAAI,GAAG,+BAA+B,CAAC;IAChD,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IACjD;QACI,KAAK,CAAC,iFAAiF,CAAC,CAAC;QACzF,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAC;IAC7C,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IAChD;QACI,KAAK,CAAC,yFAAyF,CAAC,CAAC;QACjG,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;IAC5C,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAC9C;QACI,KAAK,CAAC,kFAAkF,CAAC,CAAC;QAC1F,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;IAC1C,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IACjD,YAAY,IAAY;QACpB,KAAK,CAAC,KAAK,IAAI,0CAA0C,IAAI,cAAc,CAAC,CAAC;QAC7E,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAC;IAC7C,CAAC;CACJ"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Application } from "./application.js";
|
|
2
|
+
/**
|
|
3
|
+
* Create a new Wild Framework application.
|
|
4
|
+
*
|
|
5
|
+
* Returns an Application instance in the Created state.
|
|
6
|
+
* Register providers, then call `app.boot()`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createApplication(): Application;
|
|
9
|
+
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,WAAW,CAE/C"}
|
package/dist/factory.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Application } from "./application.js";
|
|
2
|
+
/**
|
|
3
|
+
* Create a new Wild Framework application.
|
|
4
|
+
*
|
|
5
|
+
* Returns an Application instance in the Created state.
|
|
6
|
+
* Register providers, then call `app.boot()`.
|
|
7
|
+
*/
|
|
8
|
+
export function createApplication() {
|
|
9
|
+
return new Application();
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB;IAC7B,OAAO,IAAI,WAAW,EAAE,CAAC;AAC7B,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Application } from "./application.js";
|
|
2
|
+
export type { Provider, ProviderConstructor, Resolver, Server } from "./contracts.js";
|
|
3
|
+
export { ApplicationAlreadyBootedError, ApplicationBootFailedError, DuplicateProviderError, DuplicateRegistrationError, NoResolverRegisteredError, NoServerRegisteredError, } from "./errors.js";
|
|
4
|
+
export { createApplication } from "./factory.js";
|
|
5
|
+
export { ApplicationState } from "./state.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EAAE,QAAQ,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACtF,OAAO,EACH,6BAA6B,EAC7B,0BAA0B,EAC1B,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,uBAAuB,GAC1B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Application } from "./application.js";
|
|
2
|
+
export { ApplicationAlreadyBootedError, ApplicationBootFailedError, DuplicateProviderError, DuplicateRegistrationError, NoResolverRegisteredError, NoServerRegisteredError, } from "./errors.js";
|
|
3
|
+
export { createApplication } from "./factory.js";
|
|
4
|
+
export { ApplicationState } from "./state.js";
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EACH,6BAA6B,EAC7B,0BAA0B,EAC1B,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,uBAAuB,GAC1B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/state.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Application is always in exactly one of these states.
|
|
3
|
+
*
|
|
4
|
+
* ```
|
|
5
|
+
* Created ──boot()──▶ Booted ──shutdown()──▶ Shutdown
|
|
6
|
+
* │ │
|
|
7
|
+
* └──boot() throws────▶ BootFailed
|
|
8
|
+
* │
|
|
9
|
+
* └──shutdown()──▶ Shutdown
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export declare enum ApplicationState {
|
|
13
|
+
/** Initial state. Providers may be registered. */
|
|
14
|
+
Created = "created",
|
|
15
|
+
/** All providers registered and booted successfully. */
|
|
16
|
+
Booted = "booted",
|
|
17
|
+
/** `boot()` threw. Some providers may have booted, some did not. */
|
|
18
|
+
BootFailed = "boot_failed",
|
|
19
|
+
/** Terminal state. All booted providers have been shut down. */
|
|
20
|
+
Shutdown = "shutdown"
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,oBAAY,gBAAgB;IACxB,kDAAkD;IAClD,OAAO,YAAY;IAEnB,wDAAwD;IACxD,MAAM,WAAW;IAEjB,oEAAoE;IACpE,UAAU,gBAAgB;IAE1B,gEAAgE;IAChE,QAAQ,aAAa;CACxB"}
|
package/dist/state.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Application is always in exactly one of these states.
|
|
3
|
+
*
|
|
4
|
+
* ```
|
|
5
|
+
* Created ──boot()──▶ Booted ──shutdown()──▶ Shutdown
|
|
6
|
+
* │ │
|
|
7
|
+
* └──boot() throws────▶ BootFailed
|
|
8
|
+
* │
|
|
9
|
+
* └──shutdown()──▶ Shutdown
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export var ApplicationState;
|
|
13
|
+
(function (ApplicationState) {
|
|
14
|
+
/** Initial state. Providers may be registered. */
|
|
15
|
+
ApplicationState["Created"] = "created";
|
|
16
|
+
/** All providers registered and booted successfully. */
|
|
17
|
+
ApplicationState["Booted"] = "booted";
|
|
18
|
+
/** `boot()` threw. Some providers may have booted, some did not. */
|
|
19
|
+
ApplicationState["BootFailed"] = "boot_failed";
|
|
20
|
+
/** Terminal state. All booted providers have been shut down. */
|
|
21
|
+
ApplicationState["Shutdown"] = "shutdown";
|
|
22
|
+
})(ApplicationState || (ApplicationState = {}));
|
|
23
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,CAAN,IAAY,gBAYX;AAZD,WAAY,gBAAgB;IACxB,kDAAkD;IAClD,uCAAmB,CAAA;IAEnB,wDAAwD;IACxD,qCAAiB,CAAA;IAEjB,oEAAoE;IACpE,8CAA0B,CAAA;IAE1B,gEAAgE;IAChE,yCAAqB,CAAA;AACzB,CAAC,EAZW,gBAAgB,KAAhB,gBAAgB,QAY3B"}
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@wild-framework/core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"author": "Sphah",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/KhandaSoftware/wild-framework.git"
|
|
24
|
+
},
|
|
25
|
+
"description": "Application lifecycle and provider system for Wild Framework.",
|
|
26
|
+
"keywords": [
|
|
27
|
+
"wild",
|
|
28
|
+
"framework",
|
|
29
|
+
"express",
|
|
30
|
+
"lifecycle",
|
|
31
|
+
"providers"
|
|
32
|
+
],
|
|
33
|
+
"dependencies": {},
|
|
34
|
+
"devDependencies": {},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsc",
|
|
37
|
+
"clean": "rm -rf dist",
|
|
38
|
+
"test": "vitest run"
|
|
39
|
+
}
|
|
40
|
+
}
|