@effect/platform-bun 0.7.4 → 0.7.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/BunContext/dist/effect-platform-bun-BunContext.esm.js +6 -22
- package/Command/dist/effect-platform-bun-Command.esm.js +0 -4
- package/CommandExecutor/dist/effect-platform-bun-CommandExecutor.esm.js +0 -4
- package/Effectify/dist/effect-platform-bun-Effectify.esm.js +0 -4
- package/Error/dist/effect-platform-bun-Error.esm.js +0 -4
- package/FileSystem/dist/effect-platform-bun-FileSystem.esm.js +0 -4
- package/Http/Platform/dist/effect-platform-bun-Http-Platform.esm.js +31 -1
- package/Http/Server/dist/effect-platform-bun-Http-Server.esm.js +22 -28
- package/HttpClient/dist/effect-platform-bun-HttpClient.esm.js +0 -4
- package/HttpServer/dist/effect-platform-bun-HttpServer.esm.js +15 -6
- package/KeyValueStore/dist/effect-platform-bun-KeyValueStore.esm.js +0 -7
- package/Path/dist/effect-platform-bun-Path.esm.js +0 -4
- package/Runtime/dist/effect-platform-bun-Runtime.esm.js +0 -4
- package/Sink/dist/effect-platform-bun-Sink.esm.js +0 -4
- package/Stream/dist/effect-platform-bun-Stream.esm.js +0 -4
- package/dist/BunContext-d221b77e.esm.js +27 -0
- package/dist/Command-9e5827f0.esm.js +27 -0
- package/dist/CommandExecutor-0d9edb3d.esm.js +13 -0
- package/dist/Effectify-d2cee621.esm.js +12 -0
- package/dist/Error-1ebee51c.esm.js +16 -0
- package/dist/FileSystem-baa29214.esm.js +14 -0
- package/dist/HttpClient-ac0d4f82.esm.js +24 -0
- package/dist/HttpServer-4116a022.esm.js +34 -0
- package/dist/KeyValueStore-151c0d10.esm.js +30 -0
- package/dist/Path-42c3fda2.esm.js +15 -0
- package/dist/Runtime-e0c4ce6d.esm.js +13 -0
- package/{internal/http/server.esm.js → dist/Server-c2ad8a41.esm.js} +53 -7
- package/dist/Sink-3c75e467.esm.js +12 -0
- package/dist/Stream-997a923c.esm.js +14 -0
- package/dist/effect-platform-bun.esm.js +53 -26
- package/package.json +3 -4
- package/internal/http/platform.esm.js +0 -33
|
@@ -1,22 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @since 1.0.0
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @since 1.0.0
|
|
13
|
-
* @category models
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @since 1.0.0
|
|
18
|
-
* @category layer
|
|
19
|
-
*/
|
|
20
|
-
const layer = /*#__PURE__*/pipe(layer$1, /*#__PURE__*/Layer.merge(layer$2), /*#__PURE__*/Layer.merge( /*#__PURE__*/Layer.provideMerge(layer$1, layer$3)));
|
|
21
|
-
|
|
22
|
-
export { layer };
|
|
1
|
+
import 'effect/Function';
|
|
2
|
+
import 'effect/Layer';
|
|
3
|
+
import '@effect/platform-node/FileSystem';
|
|
4
|
+
import '@effect/platform-node/Path';
|
|
5
|
+
import '@effect/platform-node/CommandExecutor';
|
|
6
|
+
export { l as layer } from '../../dist/BunContext-d221b77e.esm.js';
|
|
@@ -1,5 +1,35 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Etag from '@effect/platform-node/Http/Etag';
|
|
2
|
+
import * as Platform from '@effect/platform/Http/Platform';
|
|
2
3
|
export * from '@effect/platform/Http/Platform';
|
|
4
|
+
import * as ServerResponse from '@effect/platform/Http/ServerResponse';
|
|
5
|
+
import { pipe } from 'effect/Function';
|
|
6
|
+
import * as Layer from 'effect/Layer';
|
|
7
|
+
import { layer as layer$2 } from '@effect/platform-node/FileSystem';
|
|
8
|
+
|
|
9
|
+
/** @internal */
|
|
10
|
+
const make$1 = /*#__PURE__*/Platform.make({
|
|
11
|
+
fileResponse(path, status, statusText, headers, start, end, _contentLength) {
|
|
12
|
+
let file = Bun.file(path);
|
|
13
|
+
if (start > 0 || end !== undefined) {
|
|
14
|
+
file = file.slice(start, end);
|
|
15
|
+
}
|
|
16
|
+
return ServerResponse.raw(file, {
|
|
17
|
+
headers,
|
|
18
|
+
status,
|
|
19
|
+
statusText
|
|
20
|
+
});
|
|
21
|
+
},
|
|
22
|
+
fileWebResponse(file, status, statusText, headers, _options) {
|
|
23
|
+
return ServerResponse.raw(file, {
|
|
24
|
+
headers,
|
|
25
|
+
status,
|
|
26
|
+
statusText
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
/** @internal */
|
|
32
|
+
const layer$1 = /*#__PURE__*/pipe( /*#__PURE__*/Layer.effect(Platform.Platform, make$1), /*#__PURE__*/Layer.use(layer$2), /*#__PURE__*/Layer.use(Etag.layer));
|
|
3
33
|
|
|
4
34
|
/**
|
|
5
35
|
* @since 1.0.0
|
|
@@ -1,29 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
import * as Server$1 from '@effect/platform/Http/Server';
|
|
1
|
+
export { l as layer, a as layerConfig, m as make } from '../../../dist/Server-c2ad8a41.esm.js';
|
|
3
2
|
export * from '@effect/platform/Http/Server';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
* @category layers
|
|
26
|
-
*/
|
|
27
|
-
const layerConfig = layerConfig$1;
|
|
28
|
-
|
|
29
|
-
export { layer, layerConfig, make };
|
|
3
|
+
import '@effect/platform-node/Http/FormData';
|
|
4
|
+
import '@effect/platform/Http/Headers';
|
|
5
|
+
import '@effect/platform/Http/IncomingMessage';
|
|
6
|
+
import '@effect/platform/Http/Middleware';
|
|
7
|
+
import '@effect/platform/Http/ServerError';
|
|
8
|
+
import '@effect/platform/Http/ServerRequest';
|
|
9
|
+
import '@effect/platform/Http/UrlParams';
|
|
10
|
+
import 'effect/Cause';
|
|
11
|
+
import 'effect/Config';
|
|
12
|
+
import 'effect/Effect';
|
|
13
|
+
import 'effect/Function';
|
|
14
|
+
import 'effect/Layer';
|
|
15
|
+
import 'effect/Option';
|
|
16
|
+
import 'effect/Runtime';
|
|
17
|
+
import 'effect/Stream';
|
|
18
|
+
import 'node:stream';
|
|
19
|
+
import '../../Platform/dist/effect-platform-bun-Http-Platform.esm.js';
|
|
20
|
+
import '@effect/platform-node/Http/Etag';
|
|
21
|
+
import '@effect/platform/Http/Platform';
|
|
22
|
+
import '@effect/platform/Http/ServerResponse';
|
|
23
|
+
import '@effect/platform-node/FileSystem';
|
|
@@ -20,9 +20,18 @@ import * as ServerResponse from '@effect/platform/Http/ServerResponse';
|
|
|
20
20
|
export { ServerResponse as response };
|
|
21
21
|
import * as UrlParams from '@effect/platform/Http/UrlParams';
|
|
22
22
|
export { UrlParams as urlParams };
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
export { S as server } from '../../dist/Server-c2ad8a41.esm.js';
|
|
24
|
+
import '@effect/platform/Http/IncomingMessage';
|
|
25
|
+
import '@effect/platform/Http/Server';
|
|
26
|
+
import 'effect/Cause';
|
|
27
|
+
import 'effect/Config';
|
|
28
|
+
import 'effect/Effect';
|
|
29
|
+
import 'effect/Function';
|
|
30
|
+
import 'effect/Layer';
|
|
31
|
+
import 'effect/Option';
|
|
32
|
+
import 'effect/Runtime';
|
|
33
|
+
import 'effect/Stream';
|
|
34
|
+
import 'node:stream';
|
|
35
|
+
import '../../Http/Platform/dist/effect-platform-bun-Http-Platform.esm.js';
|
|
36
|
+
import '@effect/platform/Http/Platform';
|
|
37
|
+
import '@effect/platform-node/FileSystem';
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
import * as KeyValueStore$1 from '@effect/platform/KeyValueStore';
|
|
2
1
|
export * from '@effect/platform/KeyValueStore';
|
|
3
2
|
export { layerFileSystem } from '@effect/platform-node/KeyValueStore';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @since 1.0.0
|
|
7
|
-
*
|
|
8
|
-
* Also includes exports from [`@effect/platform/KeyValueStore`](https://effect-ts.github.io/platform/platform/KeyValueStore.ts.html).
|
|
9
|
-
*/
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { pipe } from 'effect/Function';
|
|
2
|
+
import * as Layer from 'effect/Layer';
|
|
3
|
+
import { layer as layer$1 } from '@effect/platform-node/FileSystem';
|
|
4
|
+
import { layer as layer$2 } from '@effect/platform-node/Path';
|
|
5
|
+
import { layer as layer$3 } from '@effect/platform-node/CommandExecutor';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @since 1.0.0
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @since 1.0.0
|
|
13
|
+
* @category models
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @since 1.0.0
|
|
18
|
+
* @category layer
|
|
19
|
+
*/
|
|
20
|
+
const layer = /*#__PURE__*/pipe(layer$1, /*#__PURE__*/Layer.merge(layer$2), /*#__PURE__*/Layer.merge( /*#__PURE__*/Layer.provideMerge(layer$1, layer$3)));
|
|
21
|
+
|
|
22
|
+
var BunContext = /*#__PURE__*/Object.freeze({
|
|
23
|
+
__proto__: null,
|
|
24
|
+
layer: layer
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export { BunContext as B, layer as l };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { env, exitCode, feed, flatten, isCommand, lines, make, pipeTo, start, stderr, stdin, stdout, stream, streamLines, string, workingDirectory } from '@effect/platform/Command';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @since 1.0.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
var Command = /*#__PURE__*/Object.freeze({
|
|
8
|
+
__proto__: null,
|
|
9
|
+
env: env,
|
|
10
|
+
exitCode: exitCode,
|
|
11
|
+
feed: feed,
|
|
12
|
+
flatten: flatten,
|
|
13
|
+
isCommand: isCommand,
|
|
14
|
+
lines: lines,
|
|
15
|
+
make: make,
|
|
16
|
+
pipeTo: pipeTo,
|
|
17
|
+
start: start,
|
|
18
|
+
stderr: stderr,
|
|
19
|
+
stdin: stdin,
|
|
20
|
+
stdout: stdout,
|
|
21
|
+
stream: stream,
|
|
22
|
+
streamLines: streamLines,
|
|
23
|
+
string: string,
|
|
24
|
+
workingDirectory: workingDirectory
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export { Command as C };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CommandExecutor as CommandExecutor$1, layer } from '@effect/platform-node/CommandExecutor';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @since 1.0.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
var CommandExecutor = /*#__PURE__*/Object.freeze({
|
|
8
|
+
__proto__: null,
|
|
9
|
+
CommandExecutor: CommandExecutor$1,
|
|
10
|
+
layer: layer
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export { CommandExecutor as C };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BadArgument, PlatformError, PlatformErrorTypeId, SystemError, SystemErrorReason } from '@effect/platform/Error';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @since 1.0.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
var Error = /*#__PURE__*/Object.freeze({
|
|
8
|
+
__proto__: null,
|
|
9
|
+
BadArgument: BadArgument,
|
|
10
|
+
PlatformError: PlatformError,
|
|
11
|
+
PlatformErrorTypeId: PlatformErrorTypeId,
|
|
12
|
+
SystemError: SystemError,
|
|
13
|
+
SystemErrorReason: SystemErrorReason
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export { Error as E };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FileSystem as FileSystem$1, layer, Size } from '@effect/platform-node/FileSystem';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @since 1.0.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
var FileSystem = /*#__PURE__*/Object.freeze({
|
|
8
|
+
__proto__: null,
|
|
9
|
+
FileSystem: FileSystem$1,
|
|
10
|
+
layer: layer,
|
|
11
|
+
Size: Size
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export { FileSystem as F };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as Body from '@effect/platform/Http/Body';
|
|
2
|
+
import * as Client from '@effect/platform/Http/Client';
|
|
3
|
+
import * as ClientError from '@effect/platform/Http/ClientError';
|
|
4
|
+
import * as ClientRequest from '@effect/platform/Http/ClientRequest';
|
|
5
|
+
import * as ClientResponse from '@effect/platform/Http/ClientResponse';
|
|
6
|
+
import * as Headers from '@effect/platform/Http/Headers';
|
|
7
|
+
import * as UrlParams from '@effect/platform/Http/UrlParams';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @since 1.0.0
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
var HttpClient = /*#__PURE__*/Object.freeze({
|
|
14
|
+
__proto__: null,
|
|
15
|
+
body: Body,
|
|
16
|
+
client: Client,
|
|
17
|
+
error: ClientError,
|
|
18
|
+
headers: Headers,
|
|
19
|
+
request: ClientRequest,
|
|
20
|
+
response: ClientResponse,
|
|
21
|
+
urlParams: UrlParams
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export { HttpClient as H };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as Etag from '@effect/platform-node/Http/Etag';
|
|
2
|
+
import * as FormData from '@effect/platform-node/Http/FormData';
|
|
3
|
+
import * as App from '@effect/platform/Http/App';
|
|
4
|
+
import * as Body from '@effect/platform/Http/Body';
|
|
5
|
+
import * as Headers from '@effect/platform/Http/Headers';
|
|
6
|
+
import * as Middleware from '@effect/platform/Http/Middleware';
|
|
7
|
+
import * as Router from '@effect/platform/Http/Router';
|
|
8
|
+
import * as Error from '@effect/platform/Http/ServerError';
|
|
9
|
+
import * as ServerRequest from '@effect/platform/Http/ServerRequest';
|
|
10
|
+
import * as ServerResponse from '@effect/platform/Http/ServerResponse';
|
|
11
|
+
import * as UrlParams from '@effect/platform/Http/UrlParams';
|
|
12
|
+
import { S as Server } from './Server-c2ad8a41.esm.js';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @since 1.0.0
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
var HttpServer = /*#__PURE__*/Object.freeze({
|
|
19
|
+
__proto__: null,
|
|
20
|
+
app: App,
|
|
21
|
+
body: Body,
|
|
22
|
+
error: Error,
|
|
23
|
+
etag: Etag,
|
|
24
|
+
formData: FormData,
|
|
25
|
+
headers: Headers,
|
|
26
|
+
middleware: Middleware,
|
|
27
|
+
request: ServerRequest,
|
|
28
|
+
response: ServerResponse,
|
|
29
|
+
router: Router,
|
|
30
|
+
server: Server,
|
|
31
|
+
urlParams: UrlParams
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export { HttpServer as H };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as KeyValueStore$1 from '@effect/platform/KeyValueStore';
|
|
2
|
+
import { layerFileSystem } from '@effect/platform-node/KeyValueStore';
|
|
3
|
+
|
|
4
|
+
function _mergeNamespaces(n, m) {
|
|
5
|
+
m.forEach(function (e) {
|
|
6
|
+
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
7
|
+
if (k !== 'default' && !(k in n)) {
|
|
8
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
9
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return e[k]; }
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
return Object.freeze(n);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @since 1.0.0
|
|
21
|
+
*
|
|
22
|
+
* Also includes exports from [`@effect/platform/KeyValueStore`](https://effect-ts.github.io/platform/platform/KeyValueStore.ts.html).
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
var KeyValueStore = /*#__PURE__*/_mergeNamespaces({
|
|
26
|
+
__proto__: null,
|
|
27
|
+
layerFileSystem: layerFileSystem
|
|
28
|
+
}, [KeyValueStore$1]);
|
|
29
|
+
|
|
30
|
+
export { KeyValueStore as K };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { layer, layerPosix, layerWin32, Path as Path$1 } from '@effect/platform-node/Path';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @since 1.0.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
var Path = /*#__PURE__*/Object.freeze({
|
|
8
|
+
__proto__: null,
|
|
9
|
+
layer: layer,
|
|
10
|
+
layerPosix: layerPosix,
|
|
11
|
+
layerWin32: layerWin32,
|
|
12
|
+
Path: Path$1
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export { Path as P };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defaultTeardown, runMain } from '@effect/platform-node/Runtime';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @since 1.0.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
var Runtime = /*#__PURE__*/Object.freeze({
|
|
8
|
+
__proto__: null,
|
|
9
|
+
defaultTeardown: defaultTeardown,
|
|
10
|
+
runMain: runMain
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export { Runtime as R };
|
|
@@ -2,7 +2,7 @@ import * as FormData from '@effect/platform-node/Http/FormData';
|
|
|
2
2
|
import * as Headers from '@effect/platform/Http/Headers';
|
|
3
3
|
import * as IncomingMessage from '@effect/platform/Http/IncomingMessage';
|
|
4
4
|
import * as Middleware from '@effect/platform/Http/Middleware';
|
|
5
|
-
import * as Server from '@effect/platform/Http/Server';
|
|
5
|
+
import * as Server$1 from '@effect/platform/Http/Server';
|
|
6
6
|
import * as Error from '@effect/platform/Http/ServerError';
|
|
7
7
|
import * as ServerRequest from '@effect/platform/Http/ServerRequest';
|
|
8
8
|
import * as UrlParams from '@effect/platform/Http/UrlParams';
|
|
@@ -15,10 +15,25 @@ import * as Option from 'effect/Option';
|
|
|
15
15
|
import * as Runtime from 'effect/Runtime';
|
|
16
16
|
import * as Stream from 'effect/Stream';
|
|
17
17
|
import { Readable } from 'node:stream';
|
|
18
|
-
import { layer as layer$
|
|
18
|
+
import { layer as layer$2 } from '../Http/Platform/dist/effect-platform-bun-Http-Platform.esm.js';
|
|
19
|
+
|
|
20
|
+
function _mergeNamespaces(n, m) {
|
|
21
|
+
m.forEach(function (e) {
|
|
22
|
+
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
23
|
+
if (k !== 'default' && !(k in n)) {
|
|
24
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
25
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () { return e[k]; }
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
return Object.freeze(n);
|
|
33
|
+
}
|
|
19
34
|
|
|
20
35
|
/** @internal */
|
|
21
|
-
const make = options => Effect.gen(function* (_) {
|
|
36
|
+
const make$1 = options => Effect.gen(function* (_) {
|
|
22
37
|
const handlerStack = [function (_request, _server) {
|
|
23
38
|
return new Response("not found", {
|
|
24
39
|
status: 404
|
|
@@ -31,7 +46,7 @@ const make = options => Effect.gen(function* (_) {
|
|
|
31
46
|
yield* _(Effect.addFinalizer(() => Effect.sync(() => {
|
|
32
47
|
server.stop();
|
|
33
48
|
})));
|
|
34
|
-
return Server.make({
|
|
49
|
+
return Server$1.make({
|
|
35
50
|
address: {
|
|
36
51
|
_tag: "TcpAddress",
|
|
37
52
|
port: server.port,
|
|
@@ -117,10 +132,10 @@ const respond = /*#__PURE__*/Middleware.make(httpApp => Effect.flatMap(ServerReq
|
|
|
117
132
|
}))));
|
|
118
133
|
|
|
119
134
|
/** @internal */
|
|
120
|
-
const layer = options => Layer.merge(Layer.scoped(Server.Server, make(options)), layer$
|
|
135
|
+
const layer$1 = options => Layer.merge(Layer.scoped(Server$1.Server, make$1(options)), layer$2);
|
|
121
136
|
|
|
122
137
|
/** @internal */
|
|
123
|
-
const layerConfig = options => Layer.merge(Layer.scoped(Server.Server, Effect.flatMap(Effect.config(Config.unwrap(options)), make)), layer$
|
|
138
|
+
const layerConfig$1 = options => Layer.merge(Layer.scoped(Server$1.Server, Effect.flatMap(Effect.config(Config.unwrap(options)), make$1)), layer$2);
|
|
124
139
|
class ServerRequestImpl {
|
|
125
140
|
constructor(source, resolve, reject, url, headersOverride, remoteAddressOverride) {
|
|
126
141
|
this.source = source;
|
|
@@ -226,4 +241,35 @@ const removeHost = url => {
|
|
|
226
241
|
return index === -1 ? "/" : url.slice(index);
|
|
227
242
|
};
|
|
228
243
|
|
|
229
|
-
|
|
244
|
+
/**
|
|
245
|
+
* @since 1.0.0
|
|
246
|
+
*
|
|
247
|
+
* Also includes exports from [`@effect/platform/Http/Server`](https://effect-ts.github.io/platform/platform/Http/Server.ts.html).
|
|
248
|
+
*/
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* @since 1.0.0
|
|
252
|
+
* @category constructors
|
|
253
|
+
*/
|
|
254
|
+
const make = make$1;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* @since 1.0.0
|
|
258
|
+
* @category layers
|
|
259
|
+
*/
|
|
260
|
+
const layer = layer$1;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* @since 1.0.0
|
|
264
|
+
* @category layers
|
|
265
|
+
*/
|
|
266
|
+
const layerConfig = layerConfig$1;
|
|
267
|
+
|
|
268
|
+
var Server = /*#__PURE__*/_mergeNamespaces({
|
|
269
|
+
__proto__: null,
|
|
270
|
+
make: make,
|
|
271
|
+
layer: layer,
|
|
272
|
+
layerConfig: layerConfig
|
|
273
|
+
}, [Server$1]);
|
|
274
|
+
|
|
275
|
+
export { Server as S, layerConfig as a, layer as l, make as m };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { fromReadable, toString, toUint8Array } from '@effect/platform-node/Stream';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @since 1.0.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
var Stream = /*#__PURE__*/Object.freeze({
|
|
8
|
+
__proto__: null,
|
|
9
|
+
fromReadable: fromReadable,
|
|
10
|
+
toString: toString,
|
|
11
|
+
toUint8Array: toUint8Array
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export { Stream as S };
|
|
@@ -1,26 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
|
|
6
|
-
export {
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
|
|
12
|
-
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
import
|
|
20
|
-
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
import
|
|
24
|
-
|
|
25
|
-
import
|
|
26
|
-
|
|
1
|
+
export { B as BunContext } from './BunContext-d221b77e.esm.js';
|
|
2
|
+
export { C as Command } from './Command-9e5827f0.esm.js';
|
|
3
|
+
export { C as CommandExecutor } from './CommandExecutor-0d9edb3d.esm.js';
|
|
4
|
+
export { E as Effectify } from './Effectify-d2cee621.esm.js';
|
|
5
|
+
export { E as Error } from './Error-1ebee51c.esm.js';
|
|
6
|
+
export { F as FileSystem } from './FileSystem-baa29214.esm.js';
|
|
7
|
+
export { H as HttpClient } from './HttpClient-ac0d4f82.esm.js';
|
|
8
|
+
export { H as HttpServer } from './HttpServer-4116a022.esm.js';
|
|
9
|
+
export { K as KeyValueStore } from './KeyValueStore-151c0d10.esm.js';
|
|
10
|
+
export { P as Path } from './Path-42c3fda2.esm.js';
|
|
11
|
+
export { R as Runtime } from './Runtime-e0c4ce6d.esm.js';
|
|
12
|
+
export { S as Sink } from './Sink-3c75e467.esm.js';
|
|
13
|
+
export { S as Stream } from './Stream-997a923c.esm.js';
|
|
14
|
+
import 'effect/Function';
|
|
15
|
+
import 'effect/Layer';
|
|
16
|
+
import '@effect/platform-node/FileSystem';
|
|
17
|
+
import '@effect/platform-node/Path';
|
|
18
|
+
import '@effect/platform-node/CommandExecutor';
|
|
19
|
+
import '@effect/platform/Command';
|
|
20
|
+
import '@effect/platform/Effectify';
|
|
21
|
+
import '@effect/platform/Error';
|
|
22
|
+
import '@effect/platform/Http/Body';
|
|
23
|
+
import '@effect/platform/Http/Client';
|
|
24
|
+
import '@effect/platform/Http/ClientError';
|
|
25
|
+
import '@effect/platform/Http/ClientRequest';
|
|
26
|
+
import '@effect/platform/Http/ClientResponse';
|
|
27
|
+
import '@effect/platform/Http/Headers';
|
|
28
|
+
import '@effect/platform/Http/UrlParams';
|
|
29
|
+
import '@effect/platform-node/Http/Etag';
|
|
30
|
+
import '@effect/platform-node/Http/FormData';
|
|
31
|
+
import '@effect/platform/Http/App';
|
|
32
|
+
import '@effect/platform/Http/Middleware';
|
|
33
|
+
import '@effect/platform/Http/Router';
|
|
34
|
+
import '@effect/platform/Http/ServerError';
|
|
35
|
+
import '@effect/platform/Http/ServerRequest';
|
|
36
|
+
import '@effect/platform/Http/ServerResponse';
|
|
37
|
+
import './Server-c2ad8a41.esm.js';
|
|
38
|
+
import '@effect/platform/Http/IncomingMessage';
|
|
39
|
+
import '@effect/platform/Http/Server';
|
|
40
|
+
import 'effect/Cause';
|
|
41
|
+
import 'effect/Config';
|
|
42
|
+
import 'effect/Effect';
|
|
43
|
+
import 'effect/Option';
|
|
44
|
+
import 'effect/Runtime';
|
|
45
|
+
import 'effect/Stream';
|
|
46
|
+
import 'node:stream';
|
|
47
|
+
import '../Http/Platform/dist/effect-platform-bun-Http-Platform.esm.js';
|
|
48
|
+
import '@effect/platform/Http/Platform';
|
|
49
|
+
import '@effect/platform/KeyValueStore';
|
|
50
|
+
import '@effect/platform-node/KeyValueStore';
|
|
51
|
+
import '@effect/platform-node/Runtime';
|
|
52
|
+
import '@effect/platform-node/Sink';
|
|
53
|
+
import '@effect/platform-node/Stream';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect/platform-bun",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.6",
|
|
4
4
|
"description": "Unified interfaces for common platform-specific services",
|
|
5
5
|
"main": "dist/effect-platform-bun.cjs.js",
|
|
6
6
|
"module": "dist/effect-platform-bun.esm.js",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"sideEffects": false,
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@effect/platform": "^0.18.
|
|
31
|
-
"@effect/platform-node": "^0.19.
|
|
30
|
+
"@effect/platform": "^0.18.6",
|
|
31
|
+
"@effect/platform-node": "^0.19.6"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@effect/schema": "^0.39.2",
|
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
"files": [
|
|
42
42
|
"src",
|
|
43
43
|
"dist",
|
|
44
|
-
"internal",
|
|
45
44
|
"BunContext",
|
|
46
45
|
"Command",
|
|
47
46
|
"CommandExecutor",
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import * as Etag from '@effect/platform-node/Http/Etag';
|
|
2
|
-
import * as Platform from '@effect/platform/Http/Platform';
|
|
3
|
-
import * as ServerResponse from '@effect/platform/Http/ServerResponse';
|
|
4
|
-
import { pipe } from 'effect/Function';
|
|
5
|
-
import * as Layer from 'effect/Layer';
|
|
6
|
-
import { layer as layer$1 } from '@effect/platform-node/FileSystem';
|
|
7
|
-
|
|
8
|
-
/** @internal */
|
|
9
|
-
const make = /*#__PURE__*/Platform.make({
|
|
10
|
-
fileResponse(path, status, statusText, headers, start, end, _contentLength) {
|
|
11
|
-
let file = Bun.file(path);
|
|
12
|
-
if (start > 0 || end !== undefined) {
|
|
13
|
-
file = file.slice(start, end);
|
|
14
|
-
}
|
|
15
|
-
return ServerResponse.raw(file, {
|
|
16
|
-
headers,
|
|
17
|
-
status,
|
|
18
|
-
statusText
|
|
19
|
-
});
|
|
20
|
-
},
|
|
21
|
-
fileWebResponse(file, status, statusText, headers, _options) {
|
|
22
|
-
return ServerResponse.raw(file, {
|
|
23
|
-
headers,
|
|
24
|
-
status,
|
|
25
|
-
statusText
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
/** @internal */
|
|
31
|
-
const layer = /*#__PURE__*/pipe( /*#__PURE__*/Layer.effect(Platform.Platform, make), /*#__PURE__*/Layer.use(layer$1), /*#__PURE__*/Layer.use(Etag.layer));
|
|
32
|
-
|
|
33
|
-
export { layer, make };
|