@effect/platform-browser 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.
@@ -1,32 +1,5 @@
1
- import { make as make$1, tag, layer as layer$1 } from '../../internal/clipboard.esm.js';
2
-
3
- /**
4
- * @since 1.0.0
5
- */
6
-
7
- /**
8
- * @since 1.0.0
9
- * @category interface
10
- */
11
-
12
- /**
13
- * @since 1.0.0
14
- * @category constructor
15
- */
16
- const make = make$1;
17
-
18
- /**
19
- * @since 1.0.0
20
- * @category tag
21
- */
22
- const Clipboard = tag;
23
-
24
- /**
25
- * A layer that directly interfaces with the navigator.clipboard api
26
- *
27
- * @since 1.0.0
28
- * @category layers
29
- */
30
- const layer = layer$1;
31
-
32
- export { Clipboard, layer, make };
1
+ export { a as Clipboard, l as layer, m as make } from '../../dist/Clipboard-f4a0489a.esm.js';
2
+ import '@effect/platform/Error';
3
+ import 'effect/Context';
4
+ import 'effect/Effect';
5
+ import 'effect/Layer';
@@ -1,5 +1 @@
1
1
  export { effectify } from '@effect/platform/Effectify';
2
-
3
- /**
4
- * @since 1.0.0
5
- */
@@ -1,5 +1 @@
1
1
  export { BadArgument, PlatformError, PlatformErrorTypeId, SystemError, SystemErrorReason } from '@effect/platform/Error';
2
-
3
- /**
4
- * @since 1.0.0
5
- */
@@ -12,7 +12,3 @@ import * as Headers from '@effect/platform/Http/Headers';
12
12
  export { Headers as headers };
13
13
  import * as UrlParams from '@effect/platform/Http/UrlParams';
14
14
  export { UrlParams as urlParams };
15
-
16
- /**
17
- * @since 1.0.0
18
- */
@@ -1,27 +1,6 @@
1
- import { layerLocalStorage as layerLocalStorage$1, layerSessionStorage as layerSessionStorage$1 } from '../../internal/keyValueStore.esm.js';
2
- import * as KeyValueStore$1 from '@effect/platform/KeyValueStore';
1
+ export { l as layerLocalStorage, a as layerSessionStorage } from '../../dist/KeyValueStore-db2cee39.esm.js';
3
2
  export * from '@effect/platform/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
- */
10
-
11
- /**
12
- * Creates a KeyValueStore layer that uses the browser's localStorage api. Values are stored between sessions.
13
- *
14
- * @since 1.0.0
15
- * @category models
16
- */
17
- const layerLocalStorage = layerLocalStorage$1;
18
-
19
- /**
20
- * Creates a KeyValueStore layer that uses the browser's sessionStorage api. Values are stored only for the current session.
21
- *
22
- * @since 1.0.0
23
- * @category models
24
- */
25
- const layerSessionStorage = layerSessionStorage$1;
26
-
27
- export { layerLocalStorage, layerSessionStorage };
3
+ import '@effect/platform/Error';
4
+ import 'effect/Effect';
5
+ import 'effect/Layer';
6
+ import 'effect/Option';
@@ -1,8 +1 @@
1
- import * as Path$1 from '@effect/platform/Path';
2
1
  export * from '@effect/platform/Path';
3
-
4
- /**
5
- * @since 1.0.0
6
- *
7
- * Also includes exports from [`@effect/platform/Path`](https://effect-ts.github.io/platform/platform/Path.ts.html).
8
- */
@@ -1,13 +1,3 @@
1
- import { runMain as runMain$1 } from '../../internal/runtime.esm.js';
2
-
3
- /**
4
- * @since 1.0.0
5
- */
6
-
7
- /**
8
- * @since 1.0.0
9
- * @category runtime
10
- */
11
- const runMain = runMain$1;
12
-
13
- export { runMain };
1
+ export { r as runMain } from '../../dist/Runtime-95b50d4a.esm.js';
2
+ import 'effect/Effect';
3
+ import 'effect/Fiber';
@@ -7,7 +7,7 @@ import * as Layer from 'effect/Layer';
7
7
  const tag = /*#__PURE__*/Tag("@effect/platform-browser/Clipboard");
8
8
 
9
9
  /** @internal */
10
- const make = impl => tag.of({
10
+ const make$1 = impl => tag.of({
11
11
  ...impl,
12
12
  clear: impl.writeString(""),
13
13
  writeBlob: blob => impl.write([new ClipboardItem({
@@ -23,7 +23,7 @@ const clipboardError = props => PlatformError.SystemError({
23
23
  });
24
24
 
25
25
  /** @internal */
26
- const layer = /*#__PURE__*/Layer.succeed(tag, /*#__PURE__*/make({
26
+ const layer$1 = /*#__PURE__*/Layer.succeed(tag, /*#__PURE__*/make$1({
27
27
  read: /*#__PURE__*/Effect.tryPromise({
28
28
  try: navigator.clipboard.read,
29
29
  catch: () => clipboardError({
@@ -58,4 +58,40 @@ const layer = /*#__PURE__*/Layer.succeed(tag, /*#__PURE__*/make({
58
58
  })
59
59
  }));
60
60
 
61
- export { layer, make, tag };
61
+ /**
62
+ * @since 1.0.0
63
+ */
64
+
65
+ /**
66
+ * @since 1.0.0
67
+ * @category interface
68
+ */
69
+
70
+ /**
71
+ * @since 1.0.0
72
+ * @category constructor
73
+ */
74
+ const make = make$1;
75
+
76
+ /**
77
+ * @since 1.0.0
78
+ * @category tag
79
+ */
80
+ const Clipboard = tag;
81
+
82
+ /**
83
+ * A layer that directly interfaces with the navigator.clipboard api
84
+ *
85
+ * @since 1.0.0
86
+ * @category layers
87
+ */
88
+ const layer = layer$1;
89
+
90
+ var Clipboard$1 = /*#__PURE__*/Object.freeze({
91
+ __proto__: null,
92
+ make: make,
93
+ Clipboard: Clipboard,
94
+ layer: layer
95
+ });
96
+
97
+ export { Clipboard$1 as C, Clipboard as a, layer as l, make as m };
@@ -0,0 +1,12 @@
1
+ import { effectify } from '@effect/platform/Effectify';
2
+
3
+ /**
4
+ * @since 1.0.0
5
+ */
6
+
7
+ var Effectify = /*#__PURE__*/Object.freeze({
8
+ __proto__: null,
9
+ effectify: effectify
10
+ });
11
+
12
+ export { Effectify as E };
@@ -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,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 };
@@ -1,9 +1,24 @@
1
1
  import * as PlatformError from '@effect/platform/Error';
2
- import * as KeyValueStore from '@effect/platform/KeyValueStore';
2
+ import * as KeyValueStore$1 from '@effect/platform/KeyValueStore';
3
3
  import * as Effect from 'effect/Effect';
4
4
  import * as Layer from 'effect/Layer';
5
5
  import * as Option from 'effect/Option';
6
6
 
7
+ function _mergeNamespaces(n, m) {
8
+ m.forEach(function (e) {
9
+ e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
10
+ if (k !== 'default' && !(k in n)) {
11
+ var d = Object.getOwnPropertyDescriptor(e, k);
12
+ Object.defineProperty(n, k, d.get ? d : {
13
+ enumerable: true,
14
+ get: function () { return e[k]; }
15
+ });
16
+ }
17
+ });
18
+ });
19
+ return Object.freeze(n);
20
+ }
21
+
7
22
  const storageError = props => PlatformError.SystemError({
8
23
  reason: "PermissionDenied",
9
24
  module: "KeyValueStore",
@@ -11,7 +26,7 @@ const storageError = props => PlatformError.SystemError({
11
26
  });
12
27
 
13
28
  /** @internal */
14
- const layerLocalStorage = /*#__PURE__*/Layer.succeed(KeyValueStore.KeyValueStore, /*#__PURE__*/KeyValueStore.make({
29
+ const layerLocalStorage$1 = /*#__PURE__*/Layer.succeed(KeyValueStore$1.KeyValueStore, /*#__PURE__*/KeyValueStore$1.make({
15
30
  get: key => Effect.try({
16
31
  try: () => Option.fromNullable(localStorage.getItem(key)),
17
32
  catch: () => storageError({
@@ -55,7 +70,7 @@ const layerLocalStorage = /*#__PURE__*/Layer.succeed(KeyValueStore.KeyValueStore
55
70
  }));
56
71
 
57
72
  /** @internal */
58
- const layerSessionStorage = /*#__PURE__*/Layer.succeed(KeyValueStore.KeyValueStore, /*#__PURE__*/KeyValueStore.make({
73
+ const layerSessionStorage$1 = /*#__PURE__*/Layer.succeed(KeyValueStore$1.KeyValueStore, /*#__PURE__*/KeyValueStore$1.make({
59
74
  get: key => Effect.try({
60
75
  try: () => Option.fromNullable(sessionStorage.getItem(key)),
61
76
  catch: () => storageError({
@@ -98,4 +113,32 @@ const layerSessionStorage = /*#__PURE__*/Layer.succeed(KeyValueStore.KeyValueSto
98
113
  })
99
114
  }));
100
115
 
101
- export { layerLocalStorage, layerSessionStorage };
116
+ /**
117
+ * @since 1.0.0
118
+ *
119
+ * Also includes exports from [`@effect/platform/KeyValueStore`](https://effect-ts.github.io/platform/platform/KeyValueStore.ts.html).
120
+ */
121
+
122
+ /**
123
+ * Creates a KeyValueStore layer that uses the browser's localStorage api. Values are stored between sessions.
124
+ *
125
+ * @since 1.0.0
126
+ * @category models
127
+ */
128
+ const layerLocalStorage = layerLocalStorage$1;
129
+
130
+ /**
131
+ * Creates a KeyValueStore layer that uses the browser's sessionStorage api. Values are stored only for the current session.
132
+ *
133
+ * @since 1.0.0
134
+ * @category models
135
+ */
136
+ const layerSessionStorage = layerSessionStorage$1;
137
+
138
+ var KeyValueStore = /*#__PURE__*/_mergeNamespaces({
139
+ __proto__: null,
140
+ layerLocalStorage: layerLocalStorage,
141
+ layerSessionStorage: layerSessionStorage
142
+ }, [KeyValueStore$1]);
143
+
144
+ export { KeyValueStore as K, layerSessionStorage as a, layerLocalStorage as l };
@@ -0,0 +1,28 @@
1
+ import * as Path$1 from '@effect/platform/Path';
2
+
3
+ function _mergeNamespaces(n, m) {
4
+ m.forEach(function (e) {
5
+ e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
6
+ if (k !== 'default' && !(k in n)) {
7
+ var d = Object.getOwnPropertyDescriptor(e, k);
8
+ Object.defineProperty(n, k, d.get ? d : {
9
+ enumerable: true,
10
+ get: function () { return e[k]; }
11
+ });
12
+ }
13
+ });
14
+ });
15
+ return Object.freeze(n);
16
+ }
17
+
18
+ /**
19
+ * @since 1.0.0
20
+ *
21
+ * Also includes exports from [`@effect/platform/Path`](https://effect-ts.github.io/platform/platform/Path.ts.html).
22
+ */
23
+
24
+ var Path = /*#__PURE__*/_mergeNamespaces({
25
+ __proto__: null
26
+ }, [Path$1]);
27
+
28
+ export { Path as P };
@@ -2,7 +2,7 @@ import * as Effect from 'effect/Effect';
2
2
  import * as Fiber from 'effect/Fiber';
3
3
 
4
4
  /** @internal */
5
- const runMain = effect => {
5
+ const runMain$1 = effect => {
6
6
  const fiber = Effect.runFork(effect);
7
7
  fiber.addObserver(() => {
8
8
  Effect.runFork(interruptAll(fiber.id()));
@@ -13,4 +13,19 @@ const runMain = effect => {
13
13
  };
14
14
  const interruptAll = id => Effect.flatMap(Fiber.roots, roots => Fiber.interruptAllAs(roots, id));
15
15
 
16
- export { runMain };
16
+ /**
17
+ * @since 1.0.0
18
+ */
19
+
20
+ /**
21
+ * @since 1.0.0
22
+ * @category runtime
23
+ */
24
+ const runMain = runMain$1;
25
+
26
+ var Runtime = /*#__PURE__*/Object.freeze({
27
+ __proto__: null,
28
+ runMain: runMain
29
+ });
30
+
31
+ export { Runtime as R, runMain as r };
@@ -1,14 +1,23 @@
1
- import * as Clipboard_dist_effectPlatformBrowserClipboard from '../Clipboard/dist/effect-platform-browser-Clipboard.esm.js';
2
- export { Clipboard_dist_effectPlatformBrowserClipboard as Clipboard };
3
- import * as Effectify_dist_effectPlatformBrowserEffectify from '../Effectify/dist/effect-platform-browser-Effectify.esm.js';
4
- export { Effectify_dist_effectPlatformBrowserEffectify as Effectify };
5
- import * as Error_dist_effectPlatformBrowserError from '../Error/dist/effect-platform-browser-Error.esm.js';
6
- export { Error_dist_effectPlatformBrowserError as Error };
7
- import * as HttpClient_dist_effectPlatformBrowserHttpClient from '../HttpClient/dist/effect-platform-browser-HttpClient.esm.js';
8
- export { HttpClient_dist_effectPlatformBrowserHttpClient as HttpClient };
9
- import * as KeyValueStore_dist_effectPlatformBrowserKeyValueStore from '../KeyValueStore/dist/effect-platform-browser-KeyValueStore.esm.js';
10
- export { KeyValueStore_dist_effectPlatformBrowserKeyValueStore as KeyValueStore };
11
- import * as Path_dist_effectPlatformBrowserPath from '../Path/dist/effect-platform-browser-Path.esm.js';
12
- export { Path_dist_effectPlatformBrowserPath as Path };
13
- import * as Runtime_dist_effectPlatformBrowserRuntime from '../Runtime/dist/effect-platform-browser-Runtime.esm.js';
14
- export { Runtime_dist_effectPlatformBrowserRuntime as Runtime };
1
+ export { C as Clipboard } from './Clipboard-f4a0489a.esm.js';
2
+ export { E as Effectify } from './Effectify-632740e0.esm.js';
3
+ export { E as Error } from './Error-0fa4dba0.esm.js';
4
+ export { H as HttpClient } from './HttpClient-654b6b51.esm.js';
5
+ export { K as KeyValueStore } from './KeyValueStore-db2cee39.esm.js';
6
+ export { P as Path } from './Path-61602feb.esm.js';
7
+ export { R as Runtime } from './Runtime-95b50d4a.esm.js';
8
+ import '@effect/platform/Error';
9
+ import 'effect/Context';
10
+ import 'effect/Effect';
11
+ import 'effect/Layer';
12
+ import '@effect/platform/Effectify';
13
+ import '@effect/platform/Http/Body';
14
+ import '@effect/platform/Http/Client';
15
+ import '@effect/platform/Http/ClientError';
16
+ import '@effect/platform/Http/ClientRequest';
17
+ import '@effect/platform/Http/ClientResponse';
18
+ import '@effect/platform/Http/Headers';
19
+ import '@effect/platform/Http/UrlParams';
20
+ import '@effect/platform/KeyValueStore';
21
+ import 'effect/Option';
22
+ import '@effect/platform/Path';
23
+ import 'effect/Fiber';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect/platform-browser",
3
- "version": "0.7.4",
3
+ "version": "0.7.6",
4
4
  "description": "Unified interfaces for common platform-specific services",
5
5
  "main": "dist/effect-platform-browser.cjs.js",
6
6
  "module": "dist/effect-platform-browser.esm.js",
@@ -26,7 +26,7 @@
26
26
  "license": "MIT",
27
27
  "sideEffects": false,
28
28
  "dependencies": {
29
- "@effect/platform": "^0.18.4"
29
+ "@effect/platform": "^0.18.6"
30
30
  },
31
31
  "devDependencies": {
32
32
  "effect": "2.0.0-next.40",
@@ -38,7 +38,6 @@
38
38
  "files": [
39
39
  "src",
40
40
  "dist",
41
- "internal",
42
41
  "Clipboard",
43
42
  "Effectify",
44
43
  "Error",