@effect/platform-bun 0.9.0 → 0.10.1

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';
@@ -6,10 +6,22 @@ var Stream = require('@effect/platform-node/Stream');
6
6
 
7
7
 
8
8
 
9
+ Object.defineProperty(exports, 'fromDuplex', {
10
+ enumerable: true,
11
+ get: function () { return Stream.fromDuplex; }
12
+ });
9
13
  Object.defineProperty(exports, 'fromReadable', {
10
14
  enumerable: true,
11
15
  get: function () { return Stream.fromReadable; }
12
16
  });
17
+ Object.defineProperty(exports, 'pipeThroughDuplex', {
18
+ enumerable: true,
19
+ get: function () { return Stream.pipeThroughDuplex; }
20
+ });
21
+ Object.defineProperty(exports, 'pipeThroughSimple', {
22
+ enumerable: true,
23
+ get: function () { return Stream.pipeThroughSimple; }
24
+ });
13
25
  Object.defineProperty(exports, 'toString', {
14
26
  enumerable: true,
15
27
  get: function () { return Stream.toString; }
@@ -1,5 +1,8 @@
1
1
  export {
2
+ fromDuplex,
2
3
  fromReadable,
4
+ pipeThroughDuplex,
5
+ pipeThroughSimple,
3
6
  toString,
4
7
  toUint8Array
5
8
  } from "./effect-platform-bun-Stream.cjs.js";
@@ -6,10 +6,22 @@ var Stream = require('@effect/platform-node/Stream');
6
6
 
7
7
 
8
8
 
9
+ Object.defineProperty(exports, 'fromDuplex', {
10
+ enumerable: true,
11
+ get: function () { return Stream.fromDuplex; }
12
+ });
9
13
  Object.defineProperty(exports, 'fromReadable', {
10
14
  enumerable: true,
11
15
  get: function () { return Stream.fromReadable; }
12
16
  });
17
+ Object.defineProperty(exports, 'pipeThroughDuplex', {
18
+ enumerable: true,
19
+ get: function () { return Stream.pipeThroughDuplex; }
20
+ });
21
+ Object.defineProperty(exports, 'pipeThroughSimple', {
22
+ enumerable: true,
23
+ get: function () { return Stream.pipeThroughSimple; }
24
+ });
13
25
  Object.defineProperty(exports, 'toString', {
14
26
  enumerable: true,
15
27
  get: function () { return Stream.toString; }
@@ -1 +1 @@
1
- export { fromReadable, toString, toUint8Array } from '@effect/platform-node/Stream';
1
+ export { fromDuplex, fromReadable, pipeThroughDuplex, pipeThroughSimple, toString, toUint8Array } from '@effect/platform-node/Stream';
@@ -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", () => {
@@ -1,12 +1,6 @@
1
1
  /**
2
2
  * @since 1.0.0
3
3
  */
4
- export type {
5
- /**
6
- * @category model
7
- * @since 1.0.0
8
- */
9
- FromWritableOptions } from "@effect/platform-node/Sink";
10
4
  export {
11
5
  /**
12
6
  * @category constructor
@@ -1 +1 @@
1
- {"version":3,"file":"Sink.d.ts","sourceRoot":"../../../src","sources":["Sink.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,YAAY;AACV;;;GAGG;AACH,mBAAmB,EACpB,MAAM,4BAA4B,CAAA;AAEnC,OAAO;AACL;;;GAGG;AACH,YAAY,EACb,MAAM,4BAA4B,CAAA"}
1
+ {"version":3,"file":"Sink.d.ts","sourceRoot":"../../../src","sources":["Sink.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO;AACL;;;GAGG;AACH,YAAY,EACb,MAAM,4BAA4B,CAAA"}
@@ -6,13 +6,33 @@ export type {
6
6
  * @category models
7
7
  * @since 1.0.0
8
8
  */
9
- FromReadableOptions } from "@effect/platform-node/Stream";
9
+ FromReadableOptions,
10
+ /**
11
+ * @category models
12
+ * @since 1.0.0
13
+ */
14
+ FromWritableOptions } from "@effect/platform-node/Stream";
10
15
  export {
16
+ /**
17
+ * @category constructors
18
+ * @since 1.0.0
19
+ */
20
+ fromDuplex,
11
21
  /**
12
22
  * @category constructors
13
23
  * @since 1.0.0
14
24
  */
15
25
  fromReadable,
26
+ /**
27
+ * @category combinators
28
+ * @since 1.0.0
29
+ */
30
+ pipeThroughDuplex,
31
+ /**
32
+ * @category combinators
33
+ * @since 1.0.0
34
+ */
35
+ pipeThroughSimple,
16
36
  /**
17
37
  * @since 1.0.0
18
38
  * @category conversions
@@ -1 +1 @@
1
- {"version":3,"file":"Stream.d.ts","sourceRoot":"../../../src","sources":["Stream.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,YAAY;AACV;;;GAGG;AACH,mBAAmB,EACpB,MAAM,8BAA8B,CAAA;AAErC,OAAO;AACL;;;GAGG;AACH,YAAY;AACZ;;;GAGG;AACH,QAAQ;AACR;;;GAGG;AACH,YAAY,EACb,MAAM,8BAA8B,CAAA"}
1
+ {"version":3,"file":"Stream.d.ts","sourceRoot":"../../../src","sources":["Stream.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,YAAY;AACV;;;GAGG;AACH,mBAAmB;AACnB;;;GAGG;AACH,mBAAmB,EACpB,MAAM,8BAA8B,CAAA;AAErC,OAAO;AACL;;;GAGG;AACH,UAAU;AACV;;;GAGG;AACH,YAAY;AACZ;;;GAGG;AACH,iBAAiB;AACjB;;;GAGG;AACH,iBAAiB;AACjB;;;GAGG;AACH,QAAQ;AACR;;;GAGG;AACH,YAAY,EACb,MAAM,8BAA8B,CAAA"}
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.1",
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.1"
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
  }
package/src/Sink.ts CHANGED
@@ -2,14 +2,6 @@
2
2
  * @since 1.0.0
3
3
  */
4
4
 
5
- export type {
6
- /**
7
- * @category model
8
- * @since 1.0.0
9
- */
10
- FromWritableOptions
11
- } from "@effect/platform-node/Sink"
12
-
13
5
  export {
14
6
  /**
15
7
  * @category constructor
package/src/Stream.ts CHANGED
@@ -7,15 +7,35 @@ export type {
7
7
  * @category models
8
8
  * @since 1.0.0
9
9
  */
10
- FromReadableOptions
10
+ FromReadableOptions,
11
+ /**
12
+ * @category models
13
+ * @since 1.0.0
14
+ */
15
+ FromWritableOptions
11
16
  } from "@effect/platform-node/Stream"
12
17
 
13
18
  export {
19
+ /**
20
+ * @category constructors
21
+ * @since 1.0.0
22
+ */
23
+ fromDuplex,
14
24
  /**
15
25
  * @category constructors
16
26
  * @since 1.0.0
17
27
  */
18
28
  fromReadable,
29
+ /**
30
+ * @category combinators
31
+ * @since 1.0.0
32
+ */
33
+ pipeThroughDuplex,
34
+ /**
35
+ * @category combinators
36
+ * @since 1.0.0
37
+ */
38
+ pipeThroughSimple,
19
39
  /**
20
40
  * @since 1.0.0
21
41
  * @category conversions
@@ -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
+ }