@effect/platform-bun 0.9.0 → 0.10.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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var Http_Server_dist_effectPlatformBunHttpServer = require('../../../dist/Server-34dfe607.cjs.dev.js');
5
+ var Http_Server_dist_effectPlatformBunHttpServer = require('../../../dist/Server-99adb7b9.cjs.dev.js');
6
6
  var Server = require('@effect/platform/Http/Server');
7
7
  require('@effect/platform-node/Http/FormData');
8
8
  require('@effect/platform/Http/App');
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var Http_Server_dist_effectPlatformBunHttpServer = require('../../../dist/Server-02fab035.cjs.prod.js');
5
+ var Http_Server_dist_effectPlatformBunHttpServer = require('../../../dist/Server-dff22c83.cjs.prod.js');
6
6
  var Server = require('@effect/platform/Http/Server');
7
7
  require('@effect/platform-node/Http/FormData');
8
8
  require('@effect/platform/Http/App');
@@ -1,4 +1,4 @@
1
- export { l as layer, a as layerConfig, m as make } from '../../../dist/Server-c31fa7a9.esm.js';
1
+ export { l as layer, a as layerConfig, m as make } from '../../../dist/Server-3dc46e32.esm.js';
2
2
  export * from '@effect/platform/Http/Server';
3
3
  import '@effect/platform-node/Http/FormData';
4
4
  import '@effect/platform/Http/App';
@@ -13,7 +13,7 @@ var Error = require('@effect/platform/Http/ServerError');
13
13
  var ServerRequest = require('@effect/platform/Http/ServerRequest');
14
14
  var ServerResponse = require('@effect/platform/Http/ServerResponse');
15
15
  var UrlParams = require('@effect/platform/Http/UrlParams');
16
- var Http_Server_dist_effectPlatformBunHttpServer = require('../../dist/Server-34dfe607.cjs.dev.js');
16
+ var Http_Server_dist_effectPlatformBunHttpServer = require('../../dist/Server-99adb7b9.cjs.dev.js');
17
17
  require('@effect/platform/Http/IncomingMessage');
18
18
  require('@effect/platform/Http/Server');
19
19
  require('effect/Cause');
@@ -13,7 +13,7 @@ var Error = require('@effect/platform/Http/ServerError');
13
13
  var ServerRequest = require('@effect/platform/Http/ServerRequest');
14
14
  var ServerResponse = require('@effect/platform/Http/ServerResponse');
15
15
  var UrlParams = require('@effect/platform/Http/UrlParams');
16
- var Http_Server_dist_effectPlatformBunHttpServer = require('../../dist/Server-02fab035.cjs.prod.js');
16
+ var Http_Server_dist_effectPlatformBunHttpServer = require('../../dist/Server-dff22c83.cjs.prod.js');
17
17
  require('@effect/platform/Http/IncomingMessage');
18
18
  require('@effect/platform/Http/Server');
19
19
  require('effect/Cause');
@@ -20,7 +20,7 @@ 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
- export { S as server } from '../../dist/Server-c31fa7a9.esm.js';
23
+ export { S as server } from '../../dist/Server-3dc46e32.esm.js';
24
24
  import '@effect/platform/Http/IncomingMessage';
25
25
  import '@effect/platform/Http/Server';
26
26
  import 'effect/Cause';
@@ -63,7 +63,6 @@ const make$1 = options => Effect.gen(function* (_) {
63
63
  }))), Effect.flatMap(([runtime, fiberId]) => Effect.async(() => {
64
64
  const runFork = Runtime.runFork(runtime);
65
65
  function handler(request, _server) {
66
- console.log(request);
67
66
  return new Promise((resolve, reject) => {
68
67
  const fiber = runFork(Effect.provideService(app, ServerRequest.ServerRequest, new ServerRequestImpl(request, resolve, reject, removeHost(request.url))));
69
68
  request.signal.addEventListener("abort", () => {
@@ -100,7 +100,6 @@ const make$1 = options => Effect__namespace.gen(function* (_) {
100
100
  }))), Effect__namespace.flatMap(([runtime, fiberId]) => Effect__namespace.async(() => {
101
101
  const runFork = Runtime__namespace.runFork(runtime);
102
102
  function handler(request, _server) {
103
- console.log(request);
104
103
  return new Promise((resolve, reject) => {
105
104
  const fiber = runFork(Effect__namespace.provideService(app, ServerRequest__namespace.ServerRequest, new ServerRequestImpl(request, resolve, reject, removeHost(request.url))));
106
105
  request.signal.addEventListener("abort", () => {
@@ -100,7 +100,6 @@ const make$1 = options => Effect__namespace.gen(function* (_) {
100
100
  }))), Effect__namespace.flatMap(([runtime, fiberId]) => Effect__namespace.async(() => {
101
101
  const runFork = Runtime__namespace.runFork(runtime);
102
102
  function handler(request, _server) {
103
- console.log(request);
104
103
  return new Promise((resolve, reject) => {
105
104
  const fiber = runFork(Effect__namespace.provideService(app, ServerRequest__namespace.ServerRequest, new ServerRequestImpl(request, resolve, reject, removeHost(request.url))));
106
105
  request.signal.addEventListener("abort", () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect/platform-bun",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
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",
@@ -30,16 +30,16 @@
30
30
  "license": "MIT",
31
31
  "sideEffects": false,
32
32
  "dependencies": {
33
- "@effect/platform": "^0.20.0",
34
- "@effect/platform-node": "^0.21.0"
33
+ "@effect/platform": "^0.21.0",
34
+ "@effect/platform-node": "^0.22.0"
35
35
  },
36
36
  "devDependencies": {
37
- "@effect/schema": "^0.41.0",
38
- "bun-types": "1.0.5-canary.20231005T140125",
39
- "effect": "2.0.0-next.46"
37
+ "@effect/schema": "^0.43.0",
38
+ "bun-types": "1.0.5-canary.20231009T140142",
39
+ "effect": "2.0.0-next.48"
40
40
  },
41
41
  "peerDependencies": {
42
- "effect": "^2.0.0-next.46"
42
+ "effect": "2.0.0-next.48"
43
43
  },
44
44
  "files": [
45
45
  "src",
@@ -161,7 +161,7 @@
161
161
  "scripts": {
162
162
  "example": "ts-node --project tsconfig.examples.json",
163
163
  "lint": "eslint src/**/*.ts test/**/*.ts",
164
- "tc": "tsc --noEmit",
164
+ "tc": "tsc -b",
165
165
  "test": "vitest",
166
166
  "coverage": "vitest run --coverage"
167
167
  }
@@ -65,7 +65,6 @@ export const make = (
65
65
  Effect.async<never, Error.ServeError, never>(() => {
66
66
  const runFork = Runtime.runFork(runtime)
67
67
  function handler(request: Request, _server: BunServer) {
68
- console.log(request)
69
68
  return new Promise<Response>((resolve, reject) => {
70
69
  const fiber = runFork(Effect.provideService(
71
70
  app,
@@ -112,7 +111,7 @@ const makeResponse = (request: ServerRequest.ServerRequest, response: ServerResp
112
111
  })
113
112
  }
114
113
  case "FormData": {
115
- return new Response(body.formData, {
114
+ return new Response(body.formData as any, {
116
115
  status: response.status,
117
116
  statusText: response.statusText,
118
117
  headers: response.headers
@@ -213,7 +212,7 @@ class ServerRequestImpl implements ServerRequest.ServerRequest {
213
212
 
214
213
  get stream(): Stream.Stream<never, Error.RequestError, Uint8Array> {
215
214
  return this.source.body
216
- ? Stream.fromReadableStream(() => this.source.body!, (_) =>
215
+ ? Stream.fromReadableStream(() => this.source.body as any, (_) =>
217
216
  Error.RequestError({
218
217
  request: this,
219
218
  reason: "Decode",
@@ -0,0 +1,48 @@
1
+ {
2
+ "compilerOptions": {
3
+ "moduleDetection": "force",
4
+ "downlevelIteration": true,
5
+ "resolveJsonModule": true,
6
+ "esModuleInterop": true,
7
+ "skipLibCheck": true,
8
+ "emitDecoratorMetadata": true,
9
+ "experimentalDecorators": true,
10
+ "preserveSymlinks": true,
11
+ "moduleResolution": "NodeNext",
12
+ "lib": [
13
+ "ES2021",
14
+ "DOM",
15
+ "DOM.Iterable"
16
+ ],
17
+ "sourceMap": true,
18
+ "strict": true,
19
+ "noImplicitReturns": false,
20
+ "noUnusedLocals": true,
21
+ "noUnusedParameters": false,
22
+ "noFallthroughCasesInSwitch": true,
23
+ "noEmitOnError": false,
24
+ "allowJs": false,
25
+ "checkJs": false,
26
+ "forceConsistentCasingInFileNames": true,
27
+ "stripInternal": true,
28
+ "noImplicitAny": true,
29
+ "noImplicitThis": true,
30
+ "noUncheckedIndexedAccess": false,
31
+ "strictNullChecks": true,
32
+ "target": "ES2021",
33
+ "module": "NodeNext",
34
+ "incremental": true,
35
+ "removeComments": false,
36
+ "paths": {
37
+ "@effect/platform-bun": [
38
+ "./index.ts"
39
+ ],
40
+ "@effect/platform-bun/*": [
41
+ "./*.ts"
42
+ ]
43
+ }
44
+ },
45
+ "include": [
46
+ "**/*"
47
+ ]
48
+ }