@singhak/nodeui-nestjs 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/README.md +65 -0
- package/dist/index.cjs +105 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +38 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.mjs +77 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +76 -0
package/README.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# @singhak/nodeui-nestjs
|
|
2
|
+
|
|
3
|
+
NestJS module adapter for the NodeUI developer console. Registers the core
|
|
4
|
+
middleware for every route, serving the bundled React console and its API under
|
|
5
|
+
`{path}` (default `/nodeui`) and recording app requests in the request-log
|
|
6
|
+
panel.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @singhak/nodeui-nestjs
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Peer dependencies: `@nestjs/common`, `@nestjs/core`, `reflect-metadata`,
|
|
15
|
+
`rxjs`.
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { Module } from '@nestjs/common';
|
|
21
|
+
import { NodeUIModule } from '@singhak/nodeui-nestjs';
|
|
22
|
+
|
|
23
|
+
@Module({ imports: [NodeUIModule.register()] })
|
|
24
|
+
export class AppModule {}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
// main.ts
|
|
29
|
+
import 'reflect-metadata';
|
|
30
|
+
import { NestFactory } from '@nestjs/core';
|
|
31
|
+
import { NodeUIService } from '@singhak/nodeui-nestjs';
|
|
32
|
+
import { AppModule } from './app.module';
|
|
33
|
+
|
|
34
|
+
async function bootstrap(): Promise<void> {
|
|
35
|
+
const app = await NestFactory.create(AppModule);
|
|
36
|
+
await app.listen(3000, '127.0.0.1');
|
|
37
|
+
app.get(NodeUIService).mark('listening');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
void bootstrap();
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Open `http://127.0.0.1:3000/nodeui` for the console and
|
|
44
|
+
`http://127.0.0.1:3000/nodeui/api/config` for the API.
|
|
45
|
+
|
|
46
|
+
## NodeUIService
|
|
47
|
+
|
|
48
|
+
Injectable handle to the underlying server:
|
|
49
|
+
|
|
50
|
+
- `mark(name)` — record a startup timing mark.
|
|
51
|
+
- `config` — the effective configuration.
|
|
52
|
+
- `shutdown()` — stop all sampling and timers.
|
|
53
|
+
|
|
54
|
+
## Options
|
|
55
|
+
|
|
56
|
+
`NodeUIModule.register(options?)` accepts any `@singhak/nodeui-core` `NodeUIOptions`.
|
|
57
|
+
See the `@singhak/nodeui-core` README for the configuration table and safety model.
|
|
58
|
+
|
|
59
|
+
## Development
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
npm run typecheck
|
|
63
|
+
npm test
|
|
64
|
+
npm run build
|
|
65
|
+
```
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
21
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
22
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
23
|
+
if (decorator = decorators[i])
|
|
24
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
25
|
+
if (kind && result) __defProp(target, key, result);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
var __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
NODEUI_SERVER: () => NODEUI_SERVER,
|
|
34
|
+
NodeUIModule: () => NodeUIModule,
|
|
35
|
+
NodeUIService: () => NodeUIService
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(index_exports);
|
|
38
|
+
|
|
39
|
+
// src/nodeui.module.ts
|
|
40
|
+
var import_common2 = require("@nestjs/common");
|
|
41
|
+
var import_nodeui_core = require("@singhak/nodeui-core");
|
|
42
|
+
|
|
43
|
+
// src/nodeui.service.ts
|
|
44
|
+
var import_common = require("@nestjs/common");
|
|
45
|
+
|
|
46
|
+
// src/tokens.ts
|
|
47
|
+
var NODEUI_SERVER = /* @__PURE__ */ Symbol("NODEUI_SERVER");
|
|
48
|
+
|
|
49
|
+
// src/nodeui.service.ts
|
|
50
|
+
var NodeUIService = class {
|
|
51
|
+
constructor(server) {
|
|
52
|
+
this.server = server;
|
|
53
|
+
}
|
|
54
|
+
server;
|
|
55
|
+
mark(name) {
|
|
56
|
+
this.server.mark(name);
|
|
57
|
+
}
|
|
58
|
+
get config() {
|
|
59
|
+
return this.server.config;
|
|
60
|
+
}
|
|
61
|
+
shutdown() {
|
|
62
|
+
this.server.shutdown();
|
|
63
|
+
}
|
|
64
|
+
addLogSource(entry) {
|
|
65
|
+
this.server.addLogSource(entry);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
NodeUIService = __decorateClass([
|
|
69
|
+
(0, import_common.Injectable)(),
|
|
70
|
+
__decorateParam(0, (0, import_common.Inject)(NODEUI_SERVER))
|
|
71
|
+
], NodeUIService);
|
|
72
|
+
|
|
73
|
+
// src/nodeui.module.ts
|
|
74
|
+
var NodeUIModule = class {
|
|
75
|
+
constructor(server) {
|
|
76
|
+
this.server = server;
|
|
77
|
+
}
|
|
78
|
+
server;
|
|
79
|
+
static register(options) {
|
|
80
|
+
const server = (0, import_nodeui_core.createNodeUI)(options);
|
|
81
|
+
return {
|
|
82
|
+
module: NodeUIModule,
|
|
83
|
+
providers: [{ provide: NODEUI_SERVER, useValue: server }, NodeUIService],
|
|
84
|
+
exports: [NodeUIService, NODEUI_SERVER]
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
configure(consumer) {
|
|
88
|
+
consumer.apply(this.server.middleware()).forRoutes("*");
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
NodeUIModule = __decorateClass([
|
|
92
|
+
(0, import_common2.Module)({}),
|
|
93
|
+
__decorateParam(0, (0, import_common2.Inject)(NODEUI_SERVER))
|
|
94
|
+
], NodeUIModule);
|
|
95
|
+
|
|
96
|
+
// src/index.ts
|
|
97
|
+
__reExport(index_exports, require("@singhak/nodeui-core"), module.exports);
|
|
98
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
99
|
+
0 && (module.exports = {
|
|
100
|
+
NODEUI_SERVER,
|
|
101
|
+
NodeUIModule,
|
|
102
|
+
NodeUIService,
|
|
103
|
+
...require("@singhak/nodeui-core")
|
|
104
|
+
});
|
|
105
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/nodeui.module.ts","../src/nodeui.service.ts","../src/tokens.ts"],"sourcesContent":["/**\n * @nodeui/nestjs — NestJS adapter for the NodeUI developer console.\n */\n\nexport { NodeUIModule } from './nodeui.module';\nexport { NodeUIService } from './nodeui.service';\nexport { NODEUI_SERVER } from './tokens';\nexport * from '@singhak/nodeui-core';\n","import { DynamicModule, Inject, MiddlewareConsumer, Module, NestModule } from '@nestjs/common';\nimport { createNodeUI, type NodeUIOptions, type NodeUIServer } from '@singhak/nodeui-core';\nimport { NodeUIService } from './nodeui.service';\nimport { NODEUI_SERVER } from './tokens';\n\n/**\n * NestJS adapter for the NodeUI developer console. Mounts the core middleware\n * for every route; the console and its API live under `NODEUI_PATH` (default\n * `/nodeui`) and app requests are recorded in the request log.\n *\n * @example\n * @Module({ imports: [NodeUIModule.register()] })\n * export class AppModule {}\n */\n@Module({})\nexport class NodeUIModule implements NestModule {\n static register(options?: NodeUIOptions): DynamicModule {\n const server = createNodeUI(options);\n return {\n module: NodeUIModule,\n providers: [{ provide: NODEUI_SERVER, useValue: server }, NodeUIService],\n exports: [NodeUIService, NODEUI_SERVER],\n };\n }\n\n constructor(@Inject(NODEUI_SERVER) private readonly server: NodeUIServer) {}\n\n configure(consumer: MiddlewareConsumer): void {\n consumer.apply(this.server.middleware()).forRoutes('*');\n }\n}\n","import { Inject, Injectable } from '@nestjs/common';\nimport type { NodeUIServer } from '@singhak/nodeui-core';\nimport { NODEUI_SERVER } from './tokens';\n\n/** Injectable handle to the NodeUI server: record startup marks, read config. */\n@Injectable()\nexport class NodeUIService {\n constructor(@Inject(NODEUI_SERVER) private readonly server: NodeUIServer) {}\n\n mark(name: string): void {\n this.server.mark(name);\n }\n\n get config() {\n return this.server.config;\n }\n\n shutdown(): void {\n this.server.shutdown();\n }\n\n addLogSource(entry: { level: 'debug' | 'info' | 'warn' | 'error'; message: string }): void {\n this.server.addLogSource(entry);\n }\n}\n","/** Injection token for the underlying NodeUIServer instance. */\nexport const NODEUI_SERVER = Symbol('NODEUI_SERVER');\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,iBAA8E;AAC9E,yBAAoE;;;ACDpE,oBAAmC;;;ACC5B,IAAM,gBAAgB,uBAAO,eAAe;;;ADK5C,IAAM,gBAAN,MAAoB;AAAA,EACzB,YAAoD,QAAsB;AAAtB;AAAA,EAAuB;AAAA,EAAvB;AAAA,EAEpD,KAAK,MAAoB;AACvB,SAAK,OAAO,KAAK,IAAI;AAAA,EACvB;AAAA,EAEA,IAAI,SAAS;AACX,WAAO,KAAK,OAAO;AAAA,EACrB;AAAA,EAEA,WAAiB;AACf,SAAK,OAAO,SAAS;AAAA,EACvB;AAAA,EAEA,aAAa,OAA8E;AACzF,SAAK,OAAO,aAAa,KAAK;AAAA,EAChC;AACF;AAlBa,gBAAN;AAAA,MADN,0BAAW;AAAA,EAEG,6CAAO,aAAa;AAAA,GADtB;;;ADSN,IAAM,eAAN,MAAyC;AAAA,EAU9C,YAAoD,QAAsB;AAAtB;AAAA,EAAuB;AAAA,EAAvB;AAAA,EATpD,OAAO,SAAS,SAAwC;AACtD,UAAM,aAAS,iCAAa,OAAO;AACnC,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,WAAW,CAAC,EAAE,SAAS,eAAe,UAAU,OAAO,GAAG,aAAa;AAAA,MACvE,SAAS,CAAC,eAAe,aAAa;AAAA,IACxC;AAAA,EACF;AAAA,EAIA,UAAU,UAAoC;AAC5C,aAAS,MAAM,KAAK,OAAO,WAAW,CAAC,EAAE,UAAU,GAAG;AAAA,EACxD;AACF;AAfa,eAAN;AAAA,MADN,uBAAO,CAAC,CAAC;AAAA,EAWK,8CAAO,aAAa;AAAA,GAVtB;;;ADRb,0BAAc,iCAPd;","names":["import_common"]}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { NestModule, DynamicModule, MiddlewareConsumer } from '@nestjs/common';
|
|
2
|
+
import * as _singhak_nodeui_core from '@singhak/nodeui-core';
|
|
3
|
+
import { NodeUIOptions, NodeUIServer } from '@singhak/nodeui-core';
|
|
4
|
+
export * from '@singhak/nodeui-core';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* NestJS adapter for the NodeUI developer console. Mounts the core middleware
|
|
8
|
+
* for every route; the console and its API live under `NODEUI_PATH` (default
|
|
9
|
+
* `/nodeui`) and app requests are recorded in the request log.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* @Module({ imports: [NodeUIModule.register()] })
|
|
13
|
+
* export class AppModule {}
|
|
14
|
+
*/
|
|
15
|
+
declare class NodeUIModule implements NestModule {
|
|
16
|
+
private readonly server;
|
|
17
|
+
static register(options?: NodeUIOptions): DynamicModule;
|
|
18
|
+
constructor(server: NodeUIServer);
|
|
19
|
+
configure(consumer: MiddlewareConsumer): void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Injectable handle to the NodeUI server: record startup marks, read config. */
|
|
23
|
+
declare class NodeUIService {
|
|
24
|
+
private readonly server;
|
|
25
|
+
constructor(server: NodeUIServer);
|
|
26
|
+
mark(name: string): void;
|
|
27
|
+
get config(): _singhak_nodeui_core.NodeUIConfig;
|
|
28
|
+
shutdown(): void;
|
|
29
|
+
addLogSource(entry: {
|
|
30
|
+
level: 'debug' | 'info' | 'warn' | 'error';
|
|
31
|
+
message: string;
|
|
32
|
+
}): void;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Injection token for the underlying NodeUIServer instance. */
|
|
36
|
+
declare const NODEUI_SERVER: unique symbol;
|
|
37
|
+
|
|
38
|
+
export { NODEUI_SERVER, NodeUIModule, NodeUIService };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { NestModule, DynamicModule, MiddlewareConsumer } from '@nestjs/common';
|
|
2
|
+
import * as _singhak_nodeui_core from '@singhak/nodeui-core';
|
|
3
|
+
import { NodeUIOptions, NodeUIServer } from '@singhak/nodeui-core';
|
|
4
|
+
export * from '@singhak/nodeui-core';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* NestJS adapter for the NodeUI developer console. Mounts the core middleware
|
|
8
|
+
* for every route; the console and its API live under `NODEUI_PATH` (default
|
|
9
|
+
* `/nodeui`) and app requests are recorded in the request log.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* @Module({ imports: [NodeUIModule.register()] })
|
|
13
|
+
* export class AppModule {}
|
|
14
|
+
*/
|
|
15
|
+
declare class NodeUIModule implements NestModule {
|
|
16
|
+
private readonly server;
|
|
17
|
+
static register(options?: NodeUIOptions): DynamicModule;
|
|
18
|
+
constructor(server: NodeUIServer);
|
|
19
|
+
configure(consumer: MiddlewareConsumer): void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Injectable handle to the NodeUI server: record startup marks, read config. */
|
|
23
|
+
declare class NodeUIService {
|
|
24
|
+
private readonly server;
|
|
25
|
+
constructor(server: NodeUIServer);
|
|
26
|
+
mark(name: string): void;
|
|
27
|
+
get config(): _singhak_nodeui_core.NodeUIConfig;
|
|
28
|
+
shutdown(): void;
|
|
29
|
+
addLogSource(entry: {
|
|
30
|
+
level: 'debug' | 'info' | 'warn' | 'error';
|
|
31
|
+
message: string;
|
|
32
|
+
}): void;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Injection token for the underlying NodeUIServer instance. */
|
|
36
|
+
declare const NODEUI_SERVER: unique symbol;
|
|
37
|
+
|
|
38
|
+
export { NODEUI_SERVER, NodeUIModule, NodeUIService };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
+
if (decorator = decorators[i])
|
|
7
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
+
if (kind && result) __defProp(target, key, result);
|
|
9
|
+
return result;
|
|
10
|
+
};
|
|
11
|
+
var __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index);
|
|
12
|
+
|
|
13
|
+
// src/nodeui.module.ts
|
|
14
|
+
import { Inject as Inject2, Module } from "@nestjs/common";
|
|
15
|
+
import { createNodeUI } from "@singhak/nodeui-core";
|
|
16
|
+
|
|
17
|
+
// src/nodeui.service.ts
|
|
18
|
+
import { Inject, Injectable } from "@nestjs/common";
|
|
19
|
+
|
|
20
|
+
// src/tokens.ts
|
|
21
|
+
var NODEUI_SERVER = /* @__PURE__ */ Symbol("NODEUI_SERVER");
|
|
22
|
+
|
|
23
|
+
// src/nodeui.service.ts
|
|
24
|
+
var NodeUIService = class {
|
|
25
|
+
constructor(server) {
|
|
26
|
+
this.server = server;
|
|
27
|
+
}
|
|
28
|
+
server;
|
|
29
|
+
mark(name) {
|
|
30
|
+
this.server.mark(name);
|
|
31
|
+
}
|
|
32
|
+
get config() {
|
|
33
|
+
return this.server.config;
|
|
34
|
+
}
|
|
35
|
+
shutdown() {
|
|
36
|
+
this.server.shutdown();
|
|
37
|
+
}
|
|
38
|
+
addLogSource(entry) {
|
|
39
|
+
this.server.addLogSource(entry);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
NodeUIService = __decorateClass([
|
|
43
|
+
Injectable(),
|
|
44
|
+
__decorateParam(0, Inject(NODEUI_SERVER))
|
|
45
|
+
], NodeUIService);
|
|
46
|
+
|
|
47
|
+
// src/nodeui.module.ts
|
|
48
|
+
var NodeUIModule = class {
|
|
49
|
+
constructor(server) {
|
|
50
|
+
this.server = server;
|
|
51
|
+
}
|
|
52
|
+
server;
|
|
53
|
+
static register(options) {
|
|
54
|
+
const server = createNodeUI(options);
|
|
55
|
+
return {
|
|
56
|
+
module: NodeUIModule,
|
|
57
|
+
providers: [{ provide: NODEUI_SERVER, useValue: server }, NodeUIService],
|
|
58
|
+
exports: [NodeUIService, NODEUI_SERVER]
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
configure(consumer) {
|
|
62
|
+
consumer.apply(this.server.middleware()).forRoutes("*");
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
NodeUIModule = __decorateClass([
|
|
66
|
+
Module({}),
|
|
67
|
+
__decorateParam(0, Inject2(NODEUI_SERVER))
|
|
68
|
+
], NodeUIModule);
|
|
69
|
+
|
|
70
|
+
// src/index.ts
|
|
71
|
+
export * from "@singhak/nodeui-core";
|
|
72
|
+
export {
|
|
73
|
+
NODEUI_SERVER,
|
|
74
|
+
NodeUIModule,
|
|
75
|
+
NodeUIService
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/nodeui.module.ts","../src/nodeui.service.ts","../src/tokens.ts","../src/index.ts"],"sourcesContent":["import { DynamicModule, Inject, MiddlewareConsumer, Module, NestModule } from '@nestjs/common';\nimport { createNodeUI, type NodeUIOptions, type NodeUIServer } from '@singhak/nodeui-core';\nimport { NodeUIService } from './nodeui.service';\nimport { NODEUI_SERVER } from './tokens';\n\n/**\n * NestJS adapter for the NodeUI developer console. Mounts the core middleware\n * for every route; the console and its API live under `NODEUI_PATH` (default\n * `/nodeui`) and app requests are recorded in the request log.\n *\n * @example\n * @Module({ imports: [NodeUIModule.register()] })\n * export class AppModule {}\n */\n@Module({})\nexport class NodeUIModule implements NestModule {\n static register(options?: NodeUIOptions): DynamicModule {\n const server = createNodeUI(options);\n return {\n module: NodeUIModule,\n providers: [{ provide: NODEUI_SERVER, useValue: server }, NodeUIService],\n exports: [NodeUIService, NODEUI_SERVER],\n };\n }\n\n constructor(@Inject(NODEUI_SERVER) private readonly server: NodeUIServer) {}\n\n configure(consumer: MiddlewareConsumer): void {\n consumer.apply(this.server.middleware()).forRoutes('*');\n }\n}\n","import { Inject, Injectable } from '@nestjs/common';\nimport type { NodeUIServer } from '@singhak/nodeui-core';\nimport { NODEUI_SERVER } from './tokens';\n\n/** Injectable handle to the NodeUI server: record startup marks, read config. */\n@Injectable()\nexport class NodeUIService {\n constructor(@Inject(NODEUI_SERVER) private readonly server: NodeUIServer) {}\n\n mark(name: string): void {\n this.server.mark(name);\n }\n\n get config() {\n return this.server.config;\n }\n\n shutdown(): void {\n this.server.shutdown();\n }\n\n addLogSource(entry: { level: 'debug' | 'info' | 'warn' | 'error'; message: string }): void {\n this.server.addLogSource(entry);\n }\n}\n","/** Injection token for the underlying NodeUIServer instance. */\nexport const NODEUI_SERVER = Symbol('NODEUI_SERVER');\n","/**\n * @nodeui/nestjs — NestJS adapter for the NodeUI developer console.\n */\n\nexport { NodeUIModule } from './nodeui.module';\nexport { NodeUIService } from './nodeui.service';\nexport { NODEUI_SERVER } from './tokens';\nexport * from '@singhak/nodeui-core';\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAwB,UAAAA,SAA4B,cAA0B;AAC9E,SAAS,oBAA2D;;;ACDpE,SAAS,QAAQ,kBAAkB;;;ACC5B,IAAM,gBAAgB,uBAAO,eAAe;;;ADK5C,IAAM,gBAAN,MAAoB;AAAA,EACzB,YAAoD,QAAsB;AAAtB;AAAA,EAAuB;AAAA,EAAvB;AAAA,EAEpD,KAAK,MAAoB;AACvB,SAAK,OAAO,KAAK,IAAI;AAAA,EACvB;AAAA,EAEA,IAAI,SAAS;AACX,WAAO,KAAK,OAAO;AAAA,EACrB;AAAA,EAEA,WAAiB;AACf,SAAK,OAAO,SAAS;AAAA,EACvB;AAAA,EAEA,aAAa,OAA8E;AACzF,SAAK,OAAO,aAAa,KAAK;AAAA,EAChC;AACF;AAlBa,gBAAN;AAAA,EADN,WAAW;AAAA,EAEG,0BAAO,aAAa;AAAA,GADtB;;;ADSN,IAAM,eAAN,MAAyC;AAAA,EAU9C,YAAoD,QAAsB;AAAtB;AAAA,EAAuB;AAAA,EAAvB;AAAA,EATpD,OAAO,SAAS,SAAwC;AACtD,UAAM,SAAS,aAAa,OAAO;AACnC,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,WAAW,CAAC,EAAE,SAAS,eAAe,UAAU,OAAO,GAAG,aAAa;AAAA,MACvE,SAAS,CAAC,eAAe,aAAa;AAAA,IACxC;AAAA,EACF;AAAA,EAIA,UAAU,UAAoC;AAC5C,aAAS,MAAM,KAAK,OAAO,WAAW,CAAC,EAAE,UAAU,GAAG;AAAA,EACxD;AACF;AAfa,eAAN;AAAA,EADN,OAAO,CAAC,CAAC;AAAA,EAWK,mBAAAC,QAAO,aAAa;AAAA,GAVtB;;;AGRb,cAAc;","names":["Inject","Inject"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@singhak/nodeui-nestjs",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "NestJS module adapter for the NodeUI developer console.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.mjs",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.mjs",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
},
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"sideEffects": false,
|
|
21
|
+
"keywords": [
|
|
22
|
+
"nestjs",
|
|
23
|
+
"module",
|
|
24
|
+
"console",
|
|
25
|
+
"developer-tools",
|
|
26
|
+
"observability",
|
|
27
|
+
"debugging"
|
|
28
|
+
],
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=18.0.0"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "https://github.com/Singhak/nodeui.git"
|
|
38
|
+
},
|
|
39
|
+
"homepage": "https://github.com/Singhak/nodeui#readme",
|
|
40
|
+
"bugs": {
|
|
41
|
+
"url": "https://github.com/Singhak/nodeui/issues"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"prepublishOnly": "npm run build",
|
|
45
|
+
"build": "tsup",
|
|
46
|
+
"typecheck": "tsc -p tsconfig.typecheck.json",
|
|
47
|
+
"test": "vitest run"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@singhak/nodeui-core": "^0.1.0"
|
|
51
|
+
},
|
|
52
|
+
"peerDependencies": {
|
|
53
|
+
"@nestjs/common": "^11.0.0",
|
|
54
|
+
"@nestjs/core": "^11.0.0",
|
|
55
|
+
"reflect-metadata": "^0.2.0",
|
|
56
|
+
"rxjs": "^7.8.0"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@nestjs/common": "^11.2.1",
|
|
60
|
+
"@nestjs/core": "^11.2.1",
|
|
61
|
+
"@nestjs/platform-express": "^11.2.1",
|
|
62
|
+
"@nestjs/testing": "^11.2.1",
|
|
63
|
+
"@types/express": "^5.0.0",
|
|
64
|
+
"@types/node": "^22.19.0",
|
|
65
|
+
"@types/supertest": "^6.0.2",
|
|
66
|
+
"express": "^5.2.1",
|
|
67
|
+
"reflect-metadata": "^0.2.2",
|
|
68
|
+
"rxjs": "^7.8.2",
|
|
69
|
+
"supertest": "^7.1.0",
|
|
70
|
+
"tsup": "^8.5.0",
|
|
71
|
+
"typescript": "^5.9.3",
|
|
72
|
+
"vitest": "^3.2.4"
|
|
73
|
+
},
|
|
74
|
+
"author": "Anil Kumar",
|
|
75
|
+
"type": "commonjs"
|
|
76
|
+
}
|