@fluojs/platform-nodejs 1.0.4 → 1.0.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/README.ko.md +9 -2
- package/README.md +9 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/testing-http-adapter-portability.d.js +0 -0
package/README.ko.md
CHANGED
|
@@ -22,6 +22,8 @@ fluo 런타임을 위한 raw Node.js HTTP 어댑터 패키지입니다.
|
|
|
22
22
|
npm install @fluojs/platform-nodejs
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
이 패키지는 Node.js 20 이상을 대상으로 합니다. 게시된 package manifest는 `engines.node >=20.0.0`을 선언하며, raw 어댑터는 비 Node fetch-style host가 아니라 Node.js `http`/`https` server primitive에 의존합니다.
|
|
26
|
+
|
|
25
27
|
## 사용 시점
|
|
26
28
|
|
|
27
29
|
Express나 Fastify와 같은 중간 프레임워크의 오버헤드 없이 Node.js 내장 `http` 또는 `https` 모듈에서 직접 fluo 애플리케이션을 실행하려는 경우에 사용합니다. 최소한의 리소스 사용, 저수준 최적화 또는 표준 Node API가 선호되는 환경에 이상적입니다.
|
|
@@ -65,6 +67,8 @@ const adapter = createNodejsAdapter({
|
|
|
65
67
|
|
|
66
68
|
시그널 기반 종료가 run-helper `forceExitTimeoutMs`를 넘기거나 실패하면 헬퍼는 해당 상태를 로그와 `process.exitCode`로 보고하지만, 최종 프로세스 종료는 호스트 프로세스 소유자에게 맡깁니다. Connection drain bound에는 adapter-level `shutdownTimeoutMs`를, signal handler completion bound에는 run-helper `forceExitTimeoutMs`를 사용하세요.
|
|
67
69
|
|
|
70
|
+
`bootstrapNodejsApplication(...)`과 `runNodejsApplication(...)`은 framework console logger를 기본으로 사용합니다. host나 portability test가 startup/shutdown diagnostics를 주입된 `ApplicationLogger`로 캡처해야 할 때는 `logger`를 전달하세요.
|
|
71
|
+
|
|
68
72
|
```typescript
|
|
69
73
|
import { runNodejsApplication } from '@fluojs/platform-nodejs';
|
|
70
74
|
import { AppModule } from './app.module';
|
|
@@ -94,9 +98,11 @@ await app.listen();
|
|
|
94
98
|
|
|
95
99
|
## Conformance 커버리지
|
|
96
100
|
|
|
97
|
-
`packages/platform-nodejs/src/index.test.ts`는 문서화된 Node.js 계약을 위한 package-local regression target입니다.
|
|
101
|
+
`packages/platform-nodejs/src/index.test.ts`와 `packages/platform-nodejs/src/lifecycle.test.ts`는 문서화된 Node.js 계약을 위한 package-local regression target입니다. Adapter portability suite는 공유 `createHttpAdapterPortabilityHarness(...)` 검사를 실행하여 malformed cookie 보존, JSON/text raw-body capture, byte-exact raw-body capture, multipart raw-body 제외, multipart 전체 크기 기본값, SSE framing, response stream drain settlement, host 및 HTTPS startup logging, shutdown signal listener cleanup을 검증합니다.
|
|
102
|
+
|
|
103
|
+
이 패키지는 `HttpApplicationAdapter`를 노출하며 `platform.components`에 등록되는 runtime-managed `PlatformComponent`가 아닙니다. 따라서 generic `createPlatformConformanceHarness(...)` component lifecycle 검사는 이 패키지의 지원 계약 범위에 포함되지 않고, `createHttpAdapterPortabilityHarness(...)`가 적용되는 공유 harness입니다.
|
|
98
104
|
|
|
99
|
-
같은
|
|
105
|
+
같은 regression target들은 package-specific public surface, type alias, adapter-first startup, lifecycle option validation, 실제로 관찰되는 listen retry, active-request bounded drain, 정상 및 실패 signal-driven shutdown, `process.env.PORT` isolation, zero/default `maxBodySize` boundary, idle keep-alive shutdown, 대소문자가 섞인 JSON 및 multipart content-type parsing, `x-correlation-id` request ID fallback, server-backed realtime capability 노출도 함께 다룹니다. Startup behavior를 바꿀 때는 README 예제 포인터를 아래 테스트 파일 및 Node.js 챕터 예제와 맞춰 유지하세요.
|
|
100
106
|
|
|
101
107
|
## 공개 API 개요
|
|
102
108
|
|
|
@@ -118,4 +124,5 @@ await app.listen();
|
|
|
118
124
|
## 예제 소스
|
|
119
125
|
|
|
120
126
|
- `packages/platform-nodejs/src/index.test.ts`
|
|
127
|
+
- `packages/platform-nodejs/src/lifecycle.test.ts`
|
|
121
128
|
- `book/intermediate/ch21-express-node.ko.md`
|
package/README.md
CHANGED
|
@@ -22,6 +22,8 @@ Raw Node.js HTTP adapter package for the fluo runtime.
|
|
|
22
22
|
npm install @fluojs/platform-nodejs
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
This package targets Node.js 20 or newer. The published package manifest declares `engines.node >=20.0.0`, and the raw adapter relies on the Node.js `http`/`https` server primitives rather than a non-Node fetch-style host.
|
|
26
|
+
|
|
25
27
|
## When to Use
|
|
26
28
|
|
|
27
29
|
Use this package when you want to run a fluo application directly on the Node.js built-in `http` or `https` modules without the overhead of an intermediate framework like Express or Fastify. It is ideal for minimal footprints, custom low-level optimizations, or environments where standard Node APIs are preferred.
|
|
@@ -65,6 +67,8 @@ You can use `runNodejsApplication` for a zero-boilerplate startup that includes
|
|
|
65
67
|
|
|
66
68
|
When signal-driven shutdown exceeds the run-helper `forceExitTimeoutMs` or fails, the helper logs the condition and sets `process.exitCode`, but leaves final process termination to the host process owner. Use adapter-level `shutdownTimeoutMs` for connection drain bounds and run-helper `forceExitTimeoutMs` for signal handler completion bounds.
|
|
67
69
|
|
|
70
|
+
`bootstrapNodejsApplication(...)` and `runNodejsApplication(...)` use the framework console logger by default. Pass `logger` when a host or portability test needs startup/shutdown diagnostics captured through an injected `ApplicationLogger`.
|
|
71
|
+
|
|
68
72
|
```typescript
|
|
69
73
|
import { runNodejsApplication } from '@fluojs/platform-nodejs';
|
|
70
74
|
import { AppModule } from './app.module';
|
|
@@ -94,9 +98,11 @@ await app.listen();
|
|
|
94
98
|
|
|
95
99
|
## Conformance Coverage
|
|
96
100
|
|
|
97
|
-
`packages/platform-nodejs/src/index.test.ts`
|
|
101
|
+
`packages/platform-nodejs/src/index.test.ts` and `packages/platform-nodejs/src/lifecycle.test.ts` are the package-local regression targets for the documented Node.js contract. The adapter portability suite runs the shared `createHttpAdapterPortabilityHarness(...)` checks for malformed cookie preservation, JSON/text raw-body capture, byte-exact raw-body capture, multipart raw-body exclusion, multipart total-size defaults, SSE framing, response stream drain settlement, host and HTTPS startup logging, and shutdown signal listener cleanup.
|
|
102
|
+
|
|
103
|
+
This package exposes an `HttpApplicationAdapter`; it is not a runtime-managed `PlatformComponent` registered under `platform.components`. Therefore the generic `createPlatformConformanceHarness(...)` component lifecycle checks are outside this package's supported contract, while `createHttpAdapterPortabilityHarness(...)` is the applicable shared harness.
|
|
98
104
|
|
|
99
|
-
The same
|
|
105
|
+
The same regression targets also cover the package-specific public surface, type aliases, adapter-first startup, lifecycle option validation, observed listen retries, active-request bounded drain, normal and failed signal-driven shutdown, `process.env.PORT` isolation, zero and default `maxBodySize` boundaries, idle keep-alive shutdown, mixed-case JSON and multipart content-type parsing, `x-correlation-id` request ID fallback, and server-backed realtime capability exposure. Keep README example pointers aligned with those test files and the Node.js chapter examples below when changing startup behavior.
|
|
100
106
|
|
|
101
107
|
## Public API Overview
|
|
102
108
|
|
|
@@ -118,4 +124,5 @@ The same file also covers the package-specific public surface, type aliases, ada
|
|
|
118
124
|
## Example Sources
|
|
119
125
|
|
|
120
126
|
- `packages/platform-nodejs/src/index.test.ts`
|
|
127
|
+
- `packages/platform-nodejs/src/lifecycle.test.ts`
|
|
121
128
|
- `book/intermediate/ch21-express-node.md`
|
package/dist/index.d.ts
CHANGED
|
@@ -67,7 +67,7 @@ export declare const bootstrapNodejsApplication: typeof bootstrapNodeApplication
|
|
|
67
67
|
* const adapter = createNodejsAdapter({ port: 3000 });
|
|
68
68
|
* ```
|
|
69
69
|
*/
|
|
70
|
-
export declare function createNodejsAdapter(options?:
|
|
70
|
+
export declare function createNodejsAdapter(options?: NodejsAdapterOptions): NodejsHttpApplicationAdapter;
|
|
71
71
|
/**
|
|
72
72
|
* Bootstrap and start a fluo module on the raw Node.js adapter with lifecycle shutdown wiring.
|
|
73
73
|
*
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,+BAA+B,EACpC,wBAAwB,EAExB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAE9B;;;;;;GAMG;AACH,MAAM,MAAM,iCAAiC,GAAG,+BAA+B,CAAC;AAEhF;;;;;;GAMG;AACH,MAAM,MAAM,uBAAuB,GAAG,qBAAqB,CAAC;AAE5D;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAE1D;;;;;;GAMG;AACH,MAAM,MAAM,4BAA4B,GAAG,0BAA0B,CAAC;AAEtE;;;;;;GAMG;AACH,MAAM,MAAM,2BAA2B,GAAG,yBAAyB,CAAC;AAEpE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,0BAA0B,EAAE,OAAO,wBAAmD,CAAC;AAEpG;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,GAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,+BAA+B,EACpC,wBAAwB,EAExB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAE9B;;;;;;GAMG;AACH,MAAM,MAAM,iCAAiC,GAAG,+BAA+B,CAAC;AAEhF;;;;;;GAMG;AACH,MAAM,MAAM,uBAAuB,GAAG,qBAAqB,CAAC;AAE5D;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAE1D;;;;;;GAMG;AACH,MAAM,MAAM,4BAA4B,GAAG,0BAA0B,CAAC;AAEtE;;;;;;GAMG;AACH,MAAM,MAAM,2BAA2B,GAAG,yBAAyB,CAAC;AAEpE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,0BAA0B,EAAE,OAAO,wBAAmD,CAAC;AAEpG;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,GAAE,oBAAyB,GACjC,4BAA4B,CAE9B;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB,EAAE,OAAO,kBAAuC,CAAC"}
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"platform",
|
|
10
10
|
"server"
|
|
11
11
|
],
|
|
12
|
-
"version": "1.0.
|
|
12
|
+
"version": "1.0.6",
|
|
13
13
|
"private": false,
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"repository": {
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"dist"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@fluojs/http": "^
|
|
40
|
-
"@fluojs/runtime": "^
|
|
39
|
+
"@fluojs/http": "^2.0.1",
|
|
40
|
+
"@fluojs/runtime": "^2.0.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"vitest": "^3.2.4"
|
|
File without changes
|