@celljs/vercel-adapter 4.1.0 → 4.2.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/esm/node/http-application-entry.js +2 -9
- package/esm/node/http-application-entry.js.map +1 -1
- package/esm/node/module.d.ts +1 -1
- package/lib/node/http-application-entry.js +2 -12
- package/lib/node/http-application-entry.js.map +1 -1
- package/lib/node/module.d.ts +1 -1
- package/package.json +6 -4
- package/src/node/http-application-entry.ts +2 -10
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { container } from '@celljs/core/lib/common/container/dynamic-container';
|
|
2
|
-
import {
|
|
3
|
-
import express from 'express';
|
|
2
|
+
import { HttpServerUtil } from '@celljs/web/lib/node/server';
|
|
4
3
|
import { DEFAULT_SERVER_OPTIONS } from './context.js';
|
|
5
4
|
import { ContainerProvider, Application, ConfigProvider } from '@celljs/core';
|
|
6
5
|
container.then(async (c) => {
|
|
@@ -8,13 +7,7 @@ container.then(async (c) => {
|
|
|
8
7
|
await c.get(Application).start();
|
|
9
8
|
const configProvider = c.get(ConfigProvider);
|
|
10
9
|
const { port } = configProvider.get('cell.server', DEFAULT_SERVER_OPTIONS);
|
|
11
|
-
|
|
12
|
-
app.all('*', async (req, res) => {
|
|
13
|
-
const dispatcher = c.get(Dispatcher);
|
|
14
|
-
const httpContext = new Context(req, res);
|
|
15
|
-
Context.run(() => dispatcher.dispatch(httpContext));
|
|
16
|
-
});
|
|
17
|
-
app.listen(port);
|
|
10
|
+
HttpServerUtil.createHttpServer(HttpServerUtil.createHandler(c)).listen(port);
|
|
18
11
|
console.log(`serve ${port}`);
|
|
19
12
|
});
|
|
20
13
|
//# sourceMappingURL=http-application-entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-application-entry.js","sourceRoot":"","sources":["../../src/node/http-application-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qDAAqD,CAAC;AAChF,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"http-application-entry.js","sourceRoot":"","sources":["../../src/node/http-application-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qDAAqD,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9E,SAAS,CAAC,IAAI,CAAC,KAAK,EAAC,CAAC,EAAC,EAAE;IACrB,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACzB,MAAM,CAAC,CAAC,GAAG,CAAc,WAAW,CAAC,CAAC,KAAK,EAAE,CAAC;IAC9C,MAAM,cAAc,GAAG,CAAC,CAAC,GAAG,CAAiB,cAAc,CAAC,CAAC;IAC7D,MAAM,EAAE,IAAI,EAAE,GAAG,cAAc,CAAC,GAAG,CAAM,aAAa,EAAE,sBAAsB,CAAC,CAAC;IAChF,cAAc,CAAC,gBAAgB,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC9E,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;AACjC,CAAC,CAAC,CAAC"}
|
package/esm/node/module.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("
|
|
1
|
+
declare const _default: import("@celljs/core").ContainerModule;
|
|
2
2
|
export default _default;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
const dynamic_container_1 = require("@celljs/core/lib/common/container/dynamic-container");
|
|
7
|
-
const
|
|
8
|
-
const express_1 = __importDefault(require("express"));
|
|
4
|
+
const server_1 = require("@celljs/web/lib/node/server");
|
|
9
5
|
const context_1 = require("./context");
|
|
10
6
|
const core_1 = require("@celljs/core");
|
|
11
7
|
dynamic_container_1.container.then(async (c) => {
|
|
@@ -13,13 +9,7 @@ dynamic_container_1.container.then(async (c) => {
|
|
|
13
9
|
await c.get(core_1.Application).start();
|
|
14
10
|
const configProvider = c.get(core_1.ConfigProvider);
|
|
15
11
|
const { port } = configProvider.get('cell.server', context_1.DEFAULT_SERVER_OPTIONS);
|
|
16
|
-
|
|
17
|
-
app.all('*', async (req, res) => {
|
|
18
|
-
const dispatcher = c.get(node_1.Dispatcher);
|
|
19
|
-
const httpContext = new node_1.Context(req, res);
|
|
20
|
-
node_1.Context.run(() => dispatcher.dispatch(httpContext));
|
|
21
|
-
});
|
|
22
|
-
app.listen(port);
|
|
12
|
+
server_1.HttpServerUtil.createHttpServer(server_1.HttpServerUtil.createHandler(c)).listen(port);
|
|
23
13
|
console.log(`serve ${port}`);
|
|
24
14
|
});
|
|
25
15
|
//# sourceMappingURL=http-application-entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-application-entry.js","sourceRoot":"","sources":["../../src/node/http-application-entry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"http-application-entry.js","sourceRoot":"","sources":["../../src/node/http-application-entry.ts"],"names":[],"mappings":";;AAAA,2FAAgF;AAChF,wDAA6D;AAC7D,uCAAmD;AACnD,uCAA8E;AAE9E,6BAAS,CAAC,IAAI,CAAC,KAAK,EAAC,CAAC,EAAC,EAAE;IACrB,wBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACzB,MAAM,CAAC,CAAC,GAAG,CAAc,kBAAW,CAAC,CAAC,KAAK,EAAE,CAAC;IAC9C,MAAM,cAAc,GAAG,CAAC,CAAC,GAAG,CAAiB,qBAAc,CAAC,CAAC;IAC7D,MAAM,EAAE,IAAI,EAAE,GAAG,cAAc,CAAC,GAAG,CAAM,aAAa,EAAE,gCAAsB,CAAC,CAAC;IAChF,uBAAc,CAAC,gBAAgB,CAAC,uBAAc,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC9E,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;AACjC,CAAC,CAAC,CAAC"}
|
package/lib/node/module.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celljs/vercel-adapter",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cell-component"
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
"url": "https://github.com/cellbang/cell.git"
|
|
15
15
|
},
|
|
16
16
|
"license": "MIT",
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=18.0.0"
|
|
19
|
+
},
|
|
17
20
|
"main": "lib/node/index.js",
|
|
18
21
|
"typings": "lib/node/index.d.ts",
|
|
19
22
|
"files": [
|
|
@@ -29,9 +32,8 @@
|
|
|
29
32
|
"watch": "tsc -b -w --preserveWatchOutput"
|
|
30
33
|
},
|
|
31
34
|
"dependencies": {
|
|
32
|
-
"@celljs/core": "4.
|
|
33
|
-
"@celljs/web": "4.
|
|
34
|
-
"express": "^4.22.3"
|
|
35
|
+
"@celljs/core": "4.2.0",
|
|
36
|
+
"@celljs/web": "4.2.0"
|
|
35
37
|
},
|
|
36
38
|
"publishConfig": {
|
|
37
39
|
"access": "public"
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { container } from '@celljs/core/lib/common/container/dynamic-container';
|
|
2
|
-
import {
|
|
3
|
-
import express from 'express';
|
|
2
|
+
import { HttpServerUtil } from '@celljs/web/lib/node/server';
|
|
4
3
|
import { DEFAULT_SERVER_OPTIONS } from './context';
|
|
5
4
|
import { ContainerProvider, Application, ConfigProvider } from '@celljs/core';
|
|
6
5
|
|
|
@@ -9,13 +8,6 @@ container.then(async c => {
|
|
|
9
8
|
await c.get<Application>(Application).start();
|
|
10
9
|
const configProvider = c.get<ConfigProvider>(ConfigProvider);
|
|
11
10
|
const { port } = configProvider.get<any>('cell.server', DEFAULT_SERVER_OPTIONS);
|
|
12
|
-
|
|
13
|
-
const app = express();
|
|
14
|
-
app.all('*', async (req: any, res: any) => {
|
|
15
|
-
const dispatcher = c.get<Dispatcher<Context>>(Dispatcher);
|
|
16
|
-
const httpContext = new Context(req, res);
|
|
17
|
-
Context.run(() => dispatcher.dispatch(httpContext));
|
|
18
|
-
});
|
|
19
|
-
app.listen(port);
|
|
11
|
+
HttpServerUtil.createHttpServer(HttpServerUtil.createHandler(c)).listen(port);
|
|
20
12
|
console.log(`serve ${port}`);
|
|
21
13
|
});
|