@fluojs/platform-nodejs 1.0.0-beta.4 → 1.0.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.ko.md CHANGED
@@ -11,6 +11,7 @@ fluo 런타임을 위한 raw Node.js HTTP 어댑터 패키지입니다.
11
11
  - [빠른 시작](#빠른-시작)
12
12
  - [주요 패턴](#주요-패턴)
13
13
  - [동작 계약](#동작-계약)
14
+ - [Conformance 커버리지](#conformance-커버리지)
14
15
  - [공개 API 개요](#공개-api-개요)
15
16
  - [관련 패키지](#관련-패키지)
16
17
  - [예제 소스](#예제-소스)
@@ -57,6 +58,8 @@ const adapter = createNodejsAdapter({
57
58
 
58
59
  `maxBodySize`는 바이트 수를 나타내는 숫자만 받습니다. 이 값은 raw Node 요청 바디가 아직 스트리밍되는 동안 바로 강제되며, 부트스트랩 시 `multipart.maxTotalSize`를 따로 재정의하지 않으면 같은 값이 멀티파트 전체 페이로드 한도의 기본값으로도 사용됩니다.
59
60
 
61
+ `createNodejsAdapter()`는 기본 port로 `3000`을 사용하고 `process.env.PORT`를 무시하며, `port` 또는 `maxBodySize`가 잘못되면 throw합니다. 기본 request body cap은 `1 MiB`입니다.
62
+
60
63
  ### 직접 애플리케이션 실행
61
64
  `runNodejsApplication`을 사용하여 graceful shutdown 및 로깅이 포함된 보일러플레이트 없는 시작이 가능합니다.
62
65
 
@@ -73,14 +76,28 @@ await runNodejsApplication(AppModule, {
73
76
  });
74
77
  ```
75
78
 
79
+ Listener를 시작하지 않고 애플리케이션만 만들고 싶다면 `bootstrapNodejsApplication(...)`을 사용하세요:
80
+
81
+ ```typescript
82
+ const app = await bootstrapNodejsApplication(AppModule, { port: 3000 });
83
+ await app.listen();
84
+ ```
85
+
76
86
  ## 동작 계약
77
87
 
78
88
  - `createNodejsAdapter(options)`는 Node 내장 `http` 또는 `https` 서버 primitive 위에서 fluo를 직접 실행하는 adapter-first 진입점입니다.
79
- - `maxBodySize`는 바이트 수를 나타내는 숫자만 받으며, raw Node 요청 바이트가 아직 스트리밍되는 동안 강제되고, 부트스트랩/실행 헬퍼에서 `multipart.maxTotalSize`를 명시적으로 제공하지 않으면 멀티파트 전체 크기 한도의 기본값이 됩니다.
89
+ - `maxBodySize`는 0 이상의 정수 바이트 수만 받으며, raw Node 요청 바이트가 아직 스트리밍되는 동안 강제되고, 부트스트랩/실행 헬퍼에서 `multipart.maxTotalSize`를 명시적으로 제공하지 않으면 멀티파트 전체 크기 한도의 기본값이 됩니다.
90
+ - Raw Node adapter는 대소문자가 섞인 JSON 및 multipart `content-type` 값을 normalize하고, request body가 `maxBodySize`를 넘으면 `413`을 반환하며, `getServer()` / `getRealtimeCapability()`를 통해 server-backed realtime capability를 노출합니다.
80
91
  - `bootstrapNodejsApplication(module, options)`는 raw Node 어댑터가 포함된 애플리케이션을 만들지만 리스닝은 시작하지 않으므로 이후 `app.listen()`과 `app.close()` 생명주기는 호출자가 소유합니다.
81
92
  - `runNodejsApplication(module, options)`는 부트스트랩, 리스닝 시작, graceful shutdown 배선을 함께 수행합니다. 시그널 기반 종료가 타임아웃되거나 실패하면 해당 상태를 로그와 `process.exitCode`로 보고하며, 최종 프로세스 종료는 호스트 프로세스가 계속 소유합니다.
82
93
  - 고급 압축 및 shutdown 유틸리티 함수는 이 기본 platform startup surface가 아니라 `@fluojs/runtime/node` 또는 runtime 내부 seam에 남아 있습니다.
83
94
 
95
+ ## Conformance 커버리지
96
+
97
+ `packages/platform-nodejs/src/index.test.ts`는 문서화된 Node.js 계약을 위한 package-local regression target입니다. 이 파일은 공유 `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을 검증합니다.
98
+
99
+ 같은 파일은 package-specific public surface, type alias, adapter-first startup, `maxBodySize` failure, 대소문자가 섞인 JSON 및 multipart content-type parsing, server-backed realtime capability 노출도 함께 다룹니다. Startup behavior를 바꿀 때는 README 예제 포인터를 아래 테스트 파일 및 Node.js 챕터 예제와 맞춰 유지하세요.
100
+
84
101
  ## 공개 API 개요
85
102
 
86
103
  - `createNodejsAdapter(options)`: raw Node.js HTTP 어댑터를 위한 기본 팩토리입니다.
@@ -101,4 +118,4 @@ await runNodejsApplication(AppModule, {
101
118
  ## 예제 소스
102
119
 
103
120
  - `packages/platform-nodejs/src/index.test.ts`
104
- - `examples/minimal/src/main.ts` (Fastify 기반이지만 구조적으로 유사함)
121
+ - `book/intermediate/ch21-express-node.ko.md`
package/README.md CHANGED
@@ -11,6 +11,7 @@ Raw Node.js HTTP adapter package for the fluo runtime.
11
11
  - [Quick Start](#quick-start)
12
12
  - [Common Patterns](#common-patterns)
13
13
  - [Behavioral Contracts](#behavioral-contracts)
14
+ - [Conformance Coverage](#conformance-coverage)
14
15
  - [Public API Overview](#public-api-overview)
15
16
  - [Related Packages](#related-packages)
16
17
  - [Example Sources](#example-sources)
@@ -57,6 +58,8 @@ const adapter = createNodejsAdapter({
57
58
 
58
59
  `maxBodySize` accepts a byte count number. It is enforced while the raw Node request body is still streaming, and the same limit becomes the default total multipart payload cap unless you override `multipart.maxTotalSize` during bootstrap.
59
60
 
61
+ `createNodejsAdapter()` defaults to port `3000`, ignores `process.env.PORT`, and throws when `port` or `maxBodySize` are invalid. The default request body cap is `1 MiB`.
62
+
60
63
  ### Direct Application Execution
61
64
  You can use `runNodejsApplication` for a zero-boilerplate startup that includes graceful shutdown and logging.
62
65
 
@@ -73,14 +76,28 @@ await runNodejsApplication(AppModule, {
73
76
  });
74
77
  ```
75
78
 
79
+ Use `bootstrapNodejsApplication(...)` when you want to create the application without starting the listener:
80
+
81
+ ```typescript
82
+ const app = await bootstrapNodejsApplication(AppModule, { port: 3000 });
83
+ await app.listen();
84
+ ```
85
+
76
86
  ## Behavioral Contracts
77
87
 
78
88
  - `createNodejsAdapter(options)` is the adapter-first entrypoint for running fluo directly on Node's built-in `http` or `https` server primitives.
79
- - `maxBodySize` accepts a byte count number, is enforced while raw Node request bytes are still streaming, and becomes the default multipart total-size cap unless `multipart.maxTotalSize` is explicitly provided through the bootstrap/run helpers.
89
+ - `maxBodySize` accepts a non-negative integer byte count, is enforced while raw Node request bytes are still streaming, and becomes the default multipart total-size cap unless `multipart.maxTotalSize` is explicitly provided through the bootstrap/run helpers.
90
+ - The raw Node adapter normalizes mixed-case JSON and multipart `content-type` values, returns `413` when request bodies exceed `maxBodySize`, and exposes a server-backed realtime capability through `getServer()` / `getRealtimeCapability()`.
80
91
  - `bootstrapNodejsApplication(module, options)` creates an application with the raw Node adapter but does not start listening, so the caller owns the subsequent `app.listen()` and `app.close()` lifecycle.
81
92
  - `runNodejsApplication(module, options)` bootstraps, starts, and wires graceful shutdown. When signal-driven shutdown times out or fails, it logs the condition and sets `process.exitCode`; final process termination remains owned by the host process.
82
93
  - Advanced compression and shutdown utility functions remain on `@fluojs/runtime/node` or internal runtime seams rather than this primary platform startup surface.
83
94
 
95
+ ## Conformance Coverage
96
+
97
+ `packages/platform-nodejs/src/index.test.ts` is the package-local regression target for the documented Node.js contract. It 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.
98
+
99
+ The same file also covers the package-specific public surface, type aliases, adapter-first startup, `maxBodySize` failures, mixed-case JSON and multipart content-type parsing, and server-backed realtime capability exposure. Keep README example pointers aligned with that test file and the Node.js chapter examples below when changing startup behavior.
100
+
84
101
  ## Public API Overview
85
102
 
86
103
  - `createNodejsAdapter(options)`: Primary factory for the raw Node.js HTTP adapter.
@@ -101,4 +118,4 @@ await runNodejsApplication(AppModule, {
101
118
  ## Example Sources
102
119
 
103
120
  - `packages/platform-nodejs/src/index.test.ts`
104
- - `examples/minimal/src/main.ts` (Fastify-based, but structurally similar)
121
+ - `book/intermediate/ch21-express-node.md`
File without changes
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "platform",
10
10
  "server"
11
11
  ],
12
- "version": "1.0.0-beta.4",
12
+ "version": "1.0.0",
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": "^1.0.0-beta.5",
40
- "@fluojs/runtime": "^1.0.0-beta.7"
39
+ "@fluojs/http": "^1.0.0",
40
+ "@fluojs/runtime": "^1.0.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "vitest": "^3.2.4"