@dreamkit/app 0.0.2 → 0.0.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/lib/App.d.ts +17 -0
- package/lib/App.d.ts.map +1 -1
- package/lib/App.js +115 -1
- package/lib/RequestUrl.d.ts +4 -0
- package/lib/RequestUrl.d.ts.map +1 -0
- package/lib/RequestUrl.js +10 -0
- package/lib/index.d.ts +4 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -1
- package/lib/objects/$route.d.ts +3 -0
- package/lib/objects/$route.d.ts.map +1 -0
- package/lib/objects/$route.js +2 -0
- package/lib/objects/middleware.d.ts +8 -0
- package/lib/objects/middleware.d.ts.map +1 -0
- package/lib/objects/middleware.js +9 -0
- package/lib/objects/service.d.ts +20 -0
- package/lib/objects/service.d.ts.map +1 -0
- package/lib/objects/service.js +13 -0
- package/lib/utils/log.d.ts +3 -0
- package/lib/utils/log.d.ts.map +1 -0
- package/lib/utils/log.js +2 -0
- package/package.json +6 -3
- package/lib/$route.d.ts +0 -3
- package/lib/$route.d.ts.map +0 -1
- package/lib/$route.js +0 -2
package/lib/App.d.ts
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { Route } from "./builders/RouteBuilder.js";
|
|
2
|
+
import { MiddlewareConstructor } from "./objects/middleware.js";
|
|
3
|
+
import { AppService, ServiceConstructor } from "./objects/service.js";
|
|
4
|
+
import { IocContext } from "@dreamkit/ioc";
|
|
2
5
|
export declare class App {
|
|
6
|
+
static instanceKey: string;
|
|
7
|
+
readonly started = false;
|
|
8
|
+
readonly context: IocContext;
|
|
3
9
|
readonly objects: Map<string, any>;
|
|
4
10
|
readonly routes: Set<Route>;
|
|
11
|
+
readonly services: Set<AppService>;
|
|
12
|
+
readonly middlewares: Set<MiddlewareConstructor>;
|
|
5
13
|
protected listeners: {
|
|
6
14
|
add: Set<(data: {
|
|
7
15
|
id: string;
|
|
@@ -18,6 +26,8 @@ export declare class App {
|
|
|
18
26
|
}) => any>;
|
|
19
27
|
};
|
|
20
28
|
constructor();
|
|
29
|
+
static instance(): App;
|
|
30
|
+
static saveInstance(instance: App): void;
|
|
21
31
|
on(event: "add" | "remove", cb: (data: {
|
|
22
32
|
id: string;
|
|
23
33
|
value: unknown;
|
|
@@ -28,7 +38,14 @@ export declare class App {
|
|
|
28
38
|
action: "add" | "remove";
|
|
29
39
|
}) => any): this;
|
|
30
40
|
off(event: "add" | "remove" | "change", cb: any): this;
|
|
41
|
+
getObjectId(value: unknown): string;
|
|
31
42
|
remove(ids: string[]): Promise<void>;
|
|
43
|
+
protected addService(service: ServiceConstructor): AppService;
|
|
44
|
+
protected startService(item: AppService): Promise<void>;
|
|
45
|
+
protected stopService(item: AppService): Promise<void>;
|
|
32
46
|
add(objects: Record<string, any>): Promise<void>;
|
|
47
|
+
request(request: Request): Promise<Response | undefined>;
|
|
48
|
+
start(): Promise<void>;
|
|
49
|
+
stop(): Promise<void>;
|
|
33
50
|
}
|
|
34
51
|
//# sourceMappingURL=App.d.ts.map
|
package/lib/App.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAgB,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EACL,UAAU,EAEV,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAW,UAAU,EAAE,MAAM,eAAe,CAAC;AAEpD,qBAAa,GAAG;IACd,MAAM,CAAC,WAAW,SAAY;IAC9B,QAAQ,CAAC,OAAO,SAAS;IACzB,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7B,QAAQ,CAAC,OAAO,mBAA0B;IAC1C,QAAQ,CAAC,MAAM,aAAoB;IACnC,QAAQ,CAAC,QAAQ,kBAAyB;IAC1C,QAAQ,CAAC,WAAW,6BAAoC;IACxD,SAAS,CAAC,SAAS;wBACG;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,OAAO,CAAA;SAAE,KAAK,GAAG;2BACnC;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,OAAO,CAAA;SAAE,KAAK,GAAG;2BAEpD;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,OAAO,CAAC;YAAC,MAAM,EAAE,KAAK,GAAG,QAAQ,CAAA;SAAE,KAAK,GAAG;MAEzE;;IAIF,MAAM,CAAC,QAAQ,IAAI,GAAG;IAKtB,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,GAAG;IAGjC,EAAE,CACA,KAAK,EAAE,KAAK,GAAG,QAAQ,EACvB,EAAE,EAAE,CAAC,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,KAAK,GAAG,GAChD,IAAI;IACP,EAAE,CACA,KAAK,EAAE,QAAQ,EACf,EAAE,EAAE,CAAC,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,KAAK,GAAG,QAAQ,CAAA;KAAE,KAAK,GAAG,GAC1E,IAAI;IAKP,GAAG,CAAC,KAAK,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,EAAE,EAAE,EAAE,GAAG,GAAG,IAAI;IAItD,WAAW,CAAC,KAAK,EAAE,OAAO;IAMpB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE;IAmB1B,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,kBAAkB,GAAG,UAAU;cAU7C,YAAY,CAAC,IAAI,EAAE,UAAU;cAU7B,WAAW,CAAC,IAAI,EAAE,UAAU;IAQtC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAsBhC,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC;IAcxD,KAAK;IAKL,IAAI;CAiBX"}
|
package/lib/App.js
CHANGED
|
@@ -1,13 +1,34 @@
|
|
|
1
|
+
import { RequestUrl } from "./RequestUrl.js";
|
|
2
|
+
import { isMiddleware } from "./objects/middleware.js";
|
|
3
|
+
import { isService, } from "./objects/service.js";
|
|
1
4
|
import { isRoute } from "./utils/kind.js";
|
|
5
|
+
import { log } from "./utils/log.js";
|
|
6
|
+
import { context } from "@dreamkit/ioc";
|
|
2
7
|
export class App {
|
|
8
|
+
static instanceKey = "dk:app";
|
|
9
|
+
started = false;
|
|
10
|
+
context;
|
|
3
11
|
objects = new Map();
|
|
4
12
|
routes = new Set();
|
|
13
|
+
services = new Set();
|
|
14
|
+
middlewares = new Set();
|
|
5
15
|
listeners = {
|
|
6
16
|
add: new Set(),
|
|
7
17
|
remove: new Set(),
|
|
8
18
|
change: new Set(),
|
|
9
19
|
};
|
|
10
|
-
constructor() {
|
|
20
|
+
constructor() {
|
|
21
|
+
this.context = context.fork();
|
|
22
|
+
}
|
|
23
|
+
static instance() {
|
|
24
|
+
const value = globalThis[App.instanceKey];
|
|
25
|
+
if (!value)
|
|
26
|
+
throw new Error("App instance not found");
|
|
27
|
+
return value;
|
|
28
|
+
}
|
|
29
|
+
static saveInstance(instance) {
|
|
30
|
+
globalThis[App.instanceKey] = instance;
|
|
31
|
+
}
|
|
11
32
|
on(event, cb) {
|
|
12
33
|
this.listeners[event].add(cb);
|
|
13
34
|
return this;
|
|
@@ -16,6 +37,13 @@ export class App {
|
|
|
16
37
|
this.listeners[event].delete(cb);
|
|
17
38
|
return this;
|
|
18
39
|
}
|
|
40
|
+
getObjectId(value) {
|
|
41
|
+
for (const [id, subject] of this.objects) {
|
|
42
|
+
if (subject === value)
|
|
43
|
+
return id;
|
|
44
|
+
}
|
|
45
|
+
throw new Error("Object not found");
|
|
46
|
+
}
|
|
19
47
|
async remove(ids) {
|
|
20
48
|
for (const id of ids) {
|
|
21
49
|
const value = this.objects.get(id);
|
|
@@ -24,6 +52,15 @@ export class App {
|
|
|
24
52
|
if (isRoute(value)) {
|
|
25
53
|
this.routes.delete(value);
|
|
26
54
|
}
|
|
55
|
+
else if (isService(value)) {
|
|
56
|
+
const item = [...this.services].find((item) => item.service === value);
|
|
57
|
+
if (!item)
|
|
58
|
+
throw new Error(`Service not found: ${id}`);
|
|
59
|
+
await this.stopService(item);
|
|
60
|
+
}
|
|
61
|
+
else if (isMiddleware(value)) {
|
|
62
|
+
this.middlewares.delete(value);
|
|
63
|
+
}
|
|
27
64
|
for (const cb of this.listeners.remove)
|
|
28
65
|
await cb({ id, value });
|
|
29
66
|
for (const cb of this.listeners.change)
|
|
@@ -31,16 +68,93 @@ export class App {
|
|
|
31
68
|
this.objects.delete(id);
|
|
32
69
|
}
|
|
33
70
|
}
|
|
71
|
+
addService(service) {
|
|
72
|
+
const item = {
|
|
73
|
+
name: service.prototype.name ?? service.name ?? "anonymous",
|
|
74
|
+
service,
|
|
75
|
+
started: false,
|
|
76
|
+
};
|
|
77
|
+
this.services.add(item);
|
|
78
|
+
return item;
|
|
79
|
+
}
|
|
80
|
+
async startService(item) {
|
|
81
|
+
const name = item.name;
|
|
82
|
+
log("starting service", { name });
|
|
83
|
+
const cb = await this.context.resolve(item.service).onStart();
|
|
84
|
+
const shutdown = typeof cb === "function";
|
|
85
|
+
item.started = true;
|
|
86
|
+
log("service started", { name, ...(shutdown && { shutdown: true }) });
|
|
87
|
+
if (shutdown)
|
|
88
|
+
item.shutdown = cb;
|
|
89
|
+
}
|
|
90
|
+
async stopService(item) {
|
|
91
|
+
const name = item.name;
|
|
92
|
+
log("stopping service", { name });
|
|
93
|
+
await item.shutdown?.();
|
|
94
|
+
item.started = false;
|
|
95
|
+
log("service stopped", { name });
|
|
96
|
+
}
|
|
34
97
|
async add(objects) {
|
|
98
|
+
const services = [];
|
|
35
99
|
for (const [id, value] of Object.entries(objects)) {
|
|
36
100
|
if (isRoute(value)) {
|
|
37
101
|
this.routes.add(value);
|
|
38
102
|
}
|
|
103
|
+
else if (isService(value)) {
|
|
104
|
+
const item = this.addService(value);
|
|
105
|
+
services.push(item);
|
|
106
|
+
this.services.add(item);
|
|
107
|
+
}
|
|
108
|
+
else if (isMiddleware(value)) {
|
|
109
|
+
this.middlewares.add(value);
|
|
110
|
+
}
|
|
39
111
|
this.objects.set(id, value);
|
|
40
112
|
for (const cb of this.listeners.add)
|
|
41
113
|
await cb({ id, value });
|
|
42
114
|
for (const cb of this.listeners.change)
|
|
43
115
|
await cb({ id, value, action: "add" });
|
|
44
116
|
}
|
|
117
|
+
if (this.started) {
|
|
118
|
+
for (const service of services)
|
|
119
|
+
await this.startService(service);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
async request(request) {
|
|
123
|
+
const url = new RequestUrl(request.url, "http://localhost");
|
|
124
|
+
log("request", url.pathname);
|
|
125
|
+
const context = this.context
|
|
126
|
+
.fork()
|
|
127
|
+
.register(Request, { value: request })
|
|
128
|
+
.register(Headers, { value: request.headers })
|
|
129
|
+
.register(RequestUrl, { value: url });
|
|
130
|
+
for (const middleware of this.middlewares) {
|
|
131
|
+
const $md = context.resolve(middleware);
|
|
132
|
+
const response = await $md.onRequest();
|
|
133
|
+
if (response)
|
|
134
|
+
return response;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
async start() {
|
|
138
|
+
log("starting app");
|
|
139
|
+
this.started = true;
|
|
140
|
+
for (const item of this.services)
|
|
141
|
+
await this.startService(item);
|
|
142
|
+
}
|
|
143
|
+
async stop() {
|
|
144
|
+
const errors = [];
|
|
145
|
+
const services = [...this.services].filter((item) => item.started && typeof item.shutdown === "function");
|
|
146
|
+
log("stopping services", { services: services.length });
|
|
147
|
+
for (const item of services) {
|
|
148
|
+
try {
|
|
149
|
+
await this.stopService(item);
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
log("service stopped", { name, error });
|
|
153
|
+
errors.push(error);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
if (errors.length)
|
|
157
|
+
throw new AggregateError(errors, "App stop failed");
|
|
158
|
+
this.started = false;
|
|
45
159
|
}
|
|
46
160
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequestUrl.d.ts","sourceRoot":"","sources":["../src/RequestUrl.ts"],"names":[],"mappings":"AAEA,qBAAa,UAAU,CAAC,CAAC,GAAG,MAAM,CAAE,SAAQ,GAAG;IAI7C,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,OAAO;CAInC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
export { RequestUrl } from "./RequestUrl.js";
|
|
1
2
|
export { isRoute, isApp } from "./utils/kind.js";
|
|
2
3
|
export { App } from "./App.js";
|
|
3
|
-
export { $route } from "./$route.js";
|
|
4
4
|
export { RouteBuilder, type RouteOptions, type Route, type RouteData, type RouteProps, } from "./builders/RouteBuilder.js";
|
|
5
5
|
export { defineRoutePath, routePath } from "./routePath.js";
|
|
6
|
+
export { $route } from "./objects/$route.js";
|
|
7
|
+
export { Middleware, MiddlewareClass, isMiddleware, } from "./objects/middleware.js";
|
|
8
|
+
export { Service, ServiceClass, type ServiceStop, isService, } from "./objects/service.js";
|
|
6
9
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EACL,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,KAAK,EACV,KAAK,SAAS,EACd,KAAK,UAAU,GAChB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACL,UAAU,EACV,eAAe,EACf,YAAY,GACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,OAAO,EACP,YAAY,EACZ,KAAK,WAAW,EAChB,SAAS,GACV,MAAM,sBAAsB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
export { RequestUrl } from "./RequestUrl.js";
|
|
1
2
|
export { isRoute, isApp } from "./utils/kind.js";
|
|
2
3
|
export { App } from "./App.js";
|
|
3
|
-
export { $route } from "./$route.js";
|
|
4
4
|
export { RouteBuilder, } from "./builders/RouteBuilder.js";
|
|
5
5
|
export { defineRoutePath, routePath } from "./routePath.js";
|
|
6
|
+
// objects
|
|
7
|
+
export { $route } from "./objects/$route.js";
|
|
8
|
+
export { Middleware, MiddlewareClass, isMiddleware, } from "./objects/middleware.js";
|
|
9
|
+
export { Service, ServiceClass, isService, } from "./objects/service.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"$route.d.ts","sourceRoot":"","sources":["../../src/objects/$route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,eAAO,MAAM,MAAM,kBAAqC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Constructor } from "@dreamkit/utils/ts.js";
|
|
2
|
+
export declare const kindMiddleware: (input: object, name?: string) => void, isMiddleware: (input: unknown) => input is MiddlewareConstructor;
|
|
3
|
+
export type MiddlewareConstructor = Constructor<Middleware>;
|
|
4
|
+
export declare abstract class Middleware {
|
|
5
|
+
abstract onRequest(): any;
|
|
6
|
+
}
|
|
7
|
+
export declare const MiddlewareClass: <P extends import("@dreamkit/ioc").IocParamsUserConfig = {}>(params: P) => import("@dreamkit/ioc").IocClass<P, Middleware, never, import("@dreamkit/ioc").IocParams<P>>;
|
|
8
|
+
//# sourceMappingURL=middleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/objects/middleware.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,eAAO,MAAO,cAAc,0CAAE,YAAY,oDAEzC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;AAC5D,8BAAsB,UAAU;IAI9B,QAAQ,CAAC,SAAS,IAAI,GAAG;CAC1B;AAED,eAAO,MAAM,eAAe,yKAA6B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createIocClass } from "@dreamkit/ioc";
|
|
2
|
+
import { createKind } from "@dreamkit/kind";
|
|
3
|
+
export const [kindMiddleware, isMiddleware] = createKind("@dreamkit/app/middleware");
|
|
4
|
+
export class Middleware {
|
|
5
|
+
static {
|
|
6
|
+
kindMiddleware(this);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export const MiddlewareClass = createIocClass(Middleware);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Constructor } from "@dreamkit/utils/ts.js";
|
|
2
|
+
export declare const kindService: (input: object, name?: string) => void, isService: (input: unknown) => input is ServiceConstructor;
|
|
3
|
+
type SyncOrAsync<T> = T | Promise<T>;
|
|
4
|
+
export type Shutdown = () => SyncOrAsync<void>;
|
|
5
|
+
export type AppService = {
|
|
6
|
+
name: string;
|
|
7
|
+
service: ServiceConstructor;
|
|
8
|
+
started: boolean;
|
|
9
|
+
shutdown?: Shutdown;
|
|
10
|
+
};
|
|
11
|
+
export type ServiceStop = SyncOrAsync<void> | Shutdown;
|
|
12
|
+
export type ServiceConstructor = Constructor<Service>;
|
|
13
|
+
export declare abstract class Service {
|
|
14
|
+
get name(): string | undefined;
|
|
15
|
+
abstract onStart(): ServiceStop;
|
|
16
|
+
onStop(): any;
|
|
17
|
+
}
|
|
18
|
+
export declare const ServiceClass: <P extends import("@dreamkit/ioc").IocParamsUserConfig = {}>(params: P) => import("@dreamkit/ioc").IocClass<P, Service, never, import("@dreamkit/ioc").IocParams<P>>;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/objects/service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,eAAO,MAAO,WAAW,0CAAE,SAAS,iDAEnC,CAAC;AAEF,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AACrC,MAAM,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC;AAC/C,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,kBAAkB,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,CAAC;AACF,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC;AACvD,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;AACtD,8BAAsB,OAAO;IAI3B,IAAI,IAAI,IAAI,MAAM,GAAG,SAAS,CAE7B;IACD,QAAQ,CAAC,OAAO,IAAI,WAAW;IAC/B,MAAM,IAAI,GAAG;CACd;AAED,eAAO,MAAM,YAAY,sKAA0B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createIocClass } from "@dreamkit/ioc";
|
|
2
|
+
import { createKind } from "@dreamkit/kind";
|
|
3
|
+
export const [kindService, isService] = createKind("@dreamkit/app/service");
|
|
4
|
+
export class Service {
|
|
5
|
+
static {
|
|
6
|
+
kindService(this);
|
|
7
|
+
}
|
|
8
|
+
get name() {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
onStop() { }
|
|
12
|
+
}
|
|
13
|
+
export const ServiceClass = createIocClass(Service);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/utils/log.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAO,MAAM,GAAG,gBAAkB,CAAC"}
|
package/lib/utils/log.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dreamkit/app",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Set of utils to create applications.",
|
|
5
5
|
"homepage": "https://dreamkit.dev",
|
|
6
6
|
"repository": {
|
|
@@ -26,11 +26,14 @@
|
|
|
26
26
|
"lib"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
+
"debug": "^4.3.7",
|
|
30
|
+
"@dreamkit/ioc": "0.0.1",
|
|
29
31
|
"@dreamkit/kind": "0.0.2",
|
|
30
|
-
"@dreamkit/schema": "0.0.
|
|
31
|
-
"@dreamkit/utils": "0.0.
|
|
32
|
+
"@dreamkit/schema": "0.0.3",
|
|
33
|
+
"@dreamkit/utils": "0.0.3"
|
|
32
34
|
},
|
|
33
35
|
"devDependencies": {
|
|
36
|
+
"@types/debug": "^4.1.12",
|
|
34
37
|
"@dreamkit/tsconfig": "0.0.1"
|
|
35
38
|
},
|
|
36
39
|
"x-dreamkit": {
|
package/lib/$route.d.ts
DELETED
package/lib/$route.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"$route.d.ts","sourceRoot":"","sources":["../src/$route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,eAAO,MAAM,MAAM,kBAAqC,CAAC"}
|
package/lib/$route.js
DELETED