@effect/platform 0.18.6 → 0.19.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/Command/dist/effect-platform-Command.cjs.dev.js +419 -26
- package/Command/dist/effect-platform-Command.cjs.prod.js +419 -26
- package/Command/dist/effect-platform-Command.esm.js +382 -9
- package/CommandExecutor/dist/effect-platform-CommandExecutor.cjs.dev.js +72 -7
- package/CommandExecutor/dist/effect-platform-CommandExecutor.cjs.prod.js +72 -7
- package/CommandExecutor/dist/effect-platform-CommandExecutor.esm.js +71 -2
- package/Effectify/dist/effect-platform-Effectify.cjs.dev.js +55 -3
- package/Effectify/dist/effect-platform-Effectify.cjs.prod.js +55 -3
- package/Effectify/dist/effect-platform-Effectify.esm.js +38 -2
- package/Error/dist/effect-platform-Error.cjs.dev.js +87 -5
- package/Error/dist/effect-platform-Error.cjs.prod.js +87 -5
- package/Error/dist/effect-platform-Error.esm.js +68 -2
- package/FileSystem/dist/effect-platform-FileSystem.cjs.dev.js +287 -20
- package/FileSystem/dist/effect-platform-FileSystem.cjs.prod.js +287 -20
- package/FileSystem/dist/effect-platform-FileSystem.esm.js +256 -9
- package/Http/App/dist/effect-platform-Http-App.cjs.dev.js +15 -0
- package/Http/App/dist/effect-platform-Http-App.cjs.mjs +6 -1
- package/Http/App/dist/effect-platform-Http-App.cjs.prod.js +15 -0
- package/Http/App/dist/effect-platform-Http-App.esm.js +6 -1
- package/Http/Body/dist/effect-platform-Http-Body.cjs.dev.js +4 -4
- package/Http/Body/dist/effect-platform-Http-Body.cjs.prod.js +4 -4
- package/Http/Body/dist/effect-platform-Http-Body.esm.js +4 -4
- package/Http/Client/dist/effect-platform-Http-Client.cjs.dev.js +6 -6
- package/Http/Client/dist/effect-platform-Http-Client.cjs.prod.js +6 -6
- package/Http/Client/dist/effect-platform-Http-Client.esm.js +6 -6
- package/Http/ClientRequest/dist/effect-platform-Http-ClientRequest.cjs.dev.js +5 -5
- package/Http/ClientRequest/dist/effect-platform-Http-ClientRequest.cjs.prod.js +5 -5
- package/Http/ClientRequest/dist/effect-platform-Http-ClientRequest.esm.js +5 -5
- package/Http/ClientResponse/dist/effect-platform-Http-ClientResponse.cjs.dev.js +4 -4
- package/Http/ClientResponse/dist/effect-platform-Http-ClientResponse.cjs.prod.js +4 -4
- package/Http/ClientResponse/dist/effect-platform-Http-ClientResponse.esm.js +4 -4
- package/Http/FormData/dist/effect-platform-Http-FormData.cjs.dev.js +3 -3
- package/Http/FormData/dist/effect-platform-Http-FormData.cjs.prod.js +3 -3
- package/Http/FormData/dist/effect-platform-Http-FormData.esm.js +3 -3
- package/Http/IncomingMessage/dist/effect-platform-Http-IncomingMessage.cjs.dev.js +2 -2
- package/Http/IncomingMessage/dist/effect-platform-Http-IncomingMessage.cjs.prod.js +2 -2
- package/Http/IncomingMessage/dist/effect-platform-Http-IncomingMessage.esm.js +2 -2
- package/Http/Middleware/dist/effect-platform-Http-Middleware.cjs.dev.js +11 -11
- package/Http/Middleware/dist/effect-platform-Http-Middleware.cjs.mjs +0 -1
- package/Http/Middleware/dist/effect-platform-Http-Middleware.cjs.prod.js +11 -11
- package/Http/Middleware/dist/effect-platform-Http-Middleware.esm.js +11 -10
- package/Http/Platform/dist/effect-platform-Http-Platform.cjs.dev.js +3 -3
- package/Http/Platform/dist/effect-platform-Http-Platform.cjs.prod.js +3 -3
- package/Http/Platform/dist/effect-platform-Http-Platform.esm.js +2 -2
- package/Http/Router/dist/effect-platform-Http-Router.cjs.dev.js +5 -5
- package/Http/Router/dist/effect-platform-Http-Router.cjs.prod.js +5 -5
- package/Http/Router/dist/effect-platform-Http-Router.esm.js +5 -5
- package/Http/ServerRequest/dist/effect-platform-Http-ServerRequest.cjs.dev.js +4 -4
- package/Http/ServerRequest/dist/effect-platform-Http-ServerRequest.cjs.prod.js +4 -4
- package/Http/ServerRequest/dist/effect-platform-Http-ServerRequest.esm.js +4 -4
- package/Http/ServerResponse/dist/effect-platform-Http-ServerResponse.cjs.dev.js +4 -4
- package/Http/ServerResponse/dist/effect-platform-Http-ServerResponse.cjs.prod.js +4 -4
- package/Http/ServerResponse/dist/effect-platform-Http-ServerResponse.esm.js +4 -4
- package/HttpClient/dist/effect-platform-HttpClient.cjs.dev.js +9 -9
- package/HttpClient/dist/effect-platform-HttpClient.cjs.prod.js +9 -9
- package/HttpClient/dist/effect-platform-HttpClient.esm.js +9 -9
- package/HttpServer/dist/effect-platform-HttpServer.cjs.dev.js +15 -15
- package/HttpServer/dist/effect-platform-HttpServer.cjs.prod.js +15 -15
- package/HttpServer/dist/effect-platform-HttpServer.esm.js +15 -15
- package/KeyValueStore/dist/effect-platform-KeyValueStore.cjs.dev.js +227 -18
- package/KeyValueStore/dist/effect-platform-KeyValueStore.cjs.prod.js +227 -18
- package/KeyValueStore/dist/effect-platform-KeyValueStore.esm.js +199 -10
- package/Path/dist/effect-platform-Path.cjs.dev.js +142 -9
- package/Path/dist/effect-platform-Path.cjs.prod.js +142 -9
- package/Path/dist/effect-platform-Path.esm.js +122 -7
- package/Runtime/dist/effect-platform-Runtime.cjs.dev.js +44 -4
- package/Runtime/dist/effect-platform-Runtime.cjs.prod.js +44 -4
- package/Runtime/dist/effect-platform-Runtime.esm.js +26 -3
- package/dist/App-18152f12.cjs.dev.js +93 -0
- package/dist/App-1ca51fa7.esm.js +65 -0
- package/dist/App-d8b904fa.cjs.prod.js +93 -0
- package/dist/{Body-ec1353f9.esm.js → Body-40ced606.esm.js} +1 -1
- package/dist/{Body-86ef2922.cjs.dev.js → Body-4a7ad057.cjs.dev.js} +1 -1
- package/dist/{Body-b77eac75.cjs.prod.js → Body-c26fa93f.cjs.prod.js} +1 -1
- package/dist/{Client-7b851481.cjs.prod.js → Client-03fea3d9.cjs.prod.js} +3 -3
- package/dist/{Client-4659bda7.esm.js → Client-55ef15d5.esm.js} +3 -3
- package/dist/{Client-440a1019.cjs.dev.js → Client-c05eadcd.cjs.dev.js} +3 -3
- package/dist/{ClientRequest-fc429335.esm.js → ClientRequest-490c76cd.esm.js} +1 -1
- package/dist/{ClientRequest-750d8d59.cjs.prod.js → ClientRequest-a729f345.cjs.prod.js} +1 -1
- package/dist/{ClientRequest-00e89da8.cjs.dev.js → ClientRequest-c5336a28.cjs.dev.js} +1 -1
- package/dist/{ClientResponse-4524e99e.esm.js → ClientResponse-6e84da40.esm.js} +1 -1
- package/dist/{ClientResponse-fe4e69c8.cjs.prod.js → ClientResponse-c19fd519.cjs.prod.js} +1 -1
- package/dist/{ClientResponse-1476704c.cjs.dev.js → ClientResponse-df62564e.cjs.dev.js} +1 -1
- package/dist/{FormData-ee0b1cf2.cjs.dev.js → FormData-6d030595.cjs.prod.js} +1 -1
- package/dist/{FormData-902afd18.cjs.prod.js → FormData-7ea13198.cjs.dev.js} +1 -1
- package/dist/{FormData-f54de878.esm.js → FormData-bd727d2f.esm.js} +1 -1
- package/dist/{Middleware-f9a073d7.cjs.prod.js → Middleware-6de1c21d.cjs.prod.js} +14 -20
- package/dist/{Middleware-e2edf820.cjs.dev.js → Middleware-b1d126b4.cjs.dev.js} +14 -20
- package/dist/{Middleware-240f91f6.esm.js → Middleware-d38ef616.esm.js} +15 -20
- package/dist/{Router-bf32317a.esm.js → Router-2ee665b4.esm.js} +2 -2
- package/dist/{Router-bd2b3014.cjs.dev.js → Router-43e62bd9.cjs.dev.js} +2 -2
- package/dist/{Router-6c80a4c9.cjs.prod.js → Router-53ec1aea.cjs.prod.js} +2 -2
- package/dist/{ServerRequest-03161edc.esm.js → ServerRequest-a641c507.esm.js} +1 -1
- package/dist/{ServerRequest-8d9c2c6b.cjs.dev.js → ServerRequest-cb289dae.cjs.dev.js} +1 -1
- package/dist/{ServerRequest-938f3ed0.cjs.prod.js → ServerRequest-ec4da01b.cjs.prod.js} +1 -1
- package/dist/{ServerResponse-93038062.esm.js → ServerResponse-03c252ea.esm.js} +2 -2
- package/dist/{ServerResponse-b63b7192.cjs.dev.js → ServerResponse-9af42ecb.cjs.dev.js} +2 -2
- package/dist/{ServerResponse-eae85b08.cjs.prod.js → ServerResponse-db87bde2.cjs.prod.js} +2 -2
- package/dist/{body-33521da5.cjs.prod.js → body-95276637.cjs.prod.js} +3 -3
- package/dist/{body-c7d7a944.cjs.dev.js → body-cea7c1c9.cjs.dev.js} +3 -3
- package/dist/{body-20d78ec1.esm.js → body-db8cfb3d.esm.js} +1 -1
- package/dist/{clientRequest-3e72ec54.cjs.prod.js → clientRequest-539df396.cjs.prod.js} +1 -1
- package/dist/{clientRequest-1e9e0b0d.esm.js → clientRequest-6121a7f6.esm.js} +1 -1
- package/dist/{clientRequest-423fd562.cjs.dev.js → clientRequest-dae0c34e.cjs.dev.js} +1 -1
- package/dist/{clientResponse-8c2ec6a3.esm.js → clientResponse-0ace0007.esm.js} +2 -2
- package/dist/{clientResponse-79c84a64.cjs.dev.js → clientResponse-43bb73b9.cjs.dev.js} +2 -2
- package/dist/{clientResponse-f9c57e83.cjs.prod.js → clientResponse-82dae5d8.cjs.prod.js} +2 -2
- package/dist/declarations/src/Http/App.d.ts +28 -1
- package/dist/declarations/src/Http/App.d.ts.map +1 -1
- package/dist/declarations/src/Http/Middleware.d.ts +0 -5
- package/dist/declarations/src/Http/Middleware.d.ts.map +1 -1
- package/dist/declarations/src/index.d.ts.map +1 -1
- package/dist/effect-platform.cjs.dev.js +49 -68
- package/dist/effect-platform.cjs.prod.js +49 -68
- package/dist/effect-platform.esm.js +20 -58
- package/package.json +8 -5
- package/src/Http/App.ts +76 -3
- package/src/Http/Middleware.ts +0 -6
- package/src/index.ts +10 -10
- package/src/internal/http/clientResponse.ts +2 -2
- package/src/internal/http/middleware.ts +21 -19
- package/src/internal/http/router.ts +1 -1
- package/src/internal/http/serverResponse.ts +1 -1
- package/dist/App-0916639a.cjs.prod.js +0 -7
- package/dist/App-44aa3275.cjs.dev.js +0 -7
- package/dist/App-687366d8.esm.js +0 -5
- package/dist/Command-032c414c.cjs.dev.js +0 -446
- package/dist/Command-25ef5e94.cjs.prod.js +0 -446
- package/dist/Command-d8ab0c8d.esm.js +0 -403
- package/dist/CommandExecutor-158ea1d3.cjs.dev.js +0 -87
- package/dist/CommandExecutor-5807b66b.esm.js +0 -80
- package/dist/CommandExecutor-7fcae408.cjs.prod.js +0 -87
- package/dist/Effectify-2d8c3af9.cjs.dev.js +0 -66
- package/dist/Effectify-38757ba5.cjs.prod.js +0 -66
- package/dist/Effectify-e5a9d266.esm.js +0 -43
- package/dist/Error-09496a70.cjs.dev.js +0 -100
- package/dist/Error-2c4e6ce2.cjs.prod.js +0 -100
- package/dist/Error-3099667c.esm.js +0 -75
- package/dist/FileSystem-3d439a05.cjs.prod.js +0 -308
- package/dist/FileSystem-4c7daaf0.cjs.dev.js +0 -308
- package/dist/FileSystem-7e31dccd.esm.js +0 -271
- package/dist/HttpClient-4d23b1f5.cjs.dev.js +0 -26
- package/dist/HttpClient-88775b8e.cjs.prod.js +0 -26
- package/dist/HttpClient-9ca6050c.esm.js +0 -24
- package/dist/HttpServer-16159c3a.cjs.dev.js +0 -32
- package/dist/HttpServer-50f8df76.esm.js +0 -30
- package/dist/HttpServer-93c0fbb3.cjs.prod.js +0 -32
- package/dist/KeyValueStore-2f9a70bf.esm.js +0 -210
- package/dist/KeyValueStore-f6c5b981.cjs.prod.js +0 -244
- package/dist/KeyValueStore-f9c93610.cjs.dev.js +0 -244
- package/dist/Path-3574641f.cjs.prod.js +0 -154
- package/dist/Path-46f84ba7.esm.js +0 -128
- package/dist/Path-7ba7e370.cjs.dev.js +0 -154
- package/dist/Runtime-1edd577a.cjs.dev.js +0 -55
- package/dist/Runtime-515efccf.cjs.prod.js +0 -55
- package/dist/Runtime-7265fb98.esm.js +0 -31
|
@@ -2,35 +2,428 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('effect/
|
|
7
|
-
require('effect/
|
|
8
|
-
require('effect/
|
|
9
|
-
require('effect/
|
|
10
|
-
require('effect/
|
|
11
|
-
require('effect/
|
|
12
|
-
require('
|
|
13
|
-
require('../../dist/commandExecutor-fc92de95.cjs.dev.js');
|
|
5
|
+
var Chunk = require('effect/Chunk');
|
|
6
|
+
var Effect = require('effect/Effect');
|
|
7
|
+
var Function = require('effect/Function');
|
|
8
|
+
var HashMap = require('effect/HashMap');
|
|
9
|
+
var Option = require('effect/Option');
|
|
10
|
+
var Pipeable = require('effect/Pipeable');
|
|
11
|
+
var Stream = require('effect/Stream');
|
|
12
|
+
var commandExecutor = require('../../dist/commandExecutor-fc92de95.cjs.dev.js');
|
|
14
13
|
require('effect/Brand');
|
|
15
14
|
require('effect/Context');
|
|
16
15
|
require('effect/Sink');
|
|
17
16
|
|
|
17
|
+
function _interopNamespace(e) {
|
|
18
|
+
if (e && e.__esModule) return e;
|
|
19
|
+
var n = Object.create(null);
|
|
20
|
+
if (e) {
|
|
21
|
+
Object.keys(e).forEach(function (k) {
|
|
22
|
+
if (k !== 'default') {
|
|
23
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
24
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () { return e[k]; }
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
n["default"] = e;
|
|
32
|
+
return Object.freeze(n);
|
|
33
|
+
}
|
|
18
34
|
|
|
35
|
+
var Chunk__namespace = /*#__PURE__*/_interopNamespace(Chunk);
|
|
36
|
+
var Effect__namespace = /*#__PURE__*/_interopNamespace(Effect);
|
|
37
|
+
var HashMap__namespace = /*#__PURE__*/_interopNamespace(HashMap);
|
|
38
|
+
var Option__namespace = /*#__PURE__*/_interopNamespace(Option);
|
|
39
|
+
var Stream__namespace = /*#__PURE__*/_interopNamespace(Stream);
|
|
19
40
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
41
|
+
/** @internal */
|
|
42
|
+
const CommandTypeId$1 = /*#__PURE__*/Symbol.for("@effect/platform/Command");
|
|
43
|
+
|
|
44
|
+
/** @internal */
|
|
45
|
+
const isCommand$1 = u => typeof u === "object" && u != null && CommandTypeId$1 in u;
|
|
46
|
+
|
|
47
|
+
/** @internal */
|
|
48
|
+
const env$1 = /*#__PURE__*/Function.dual(2, (self, environment) => {
|
|
49
|
+
switch (self._tag) {
|
|
50
|
+
case "StandardCommand":
|
|
51
|
+
{
|
|
52
|
+
return {
|
|
53
|
+
...self,
|
|
54
|
+
env: HashMap__namespace.union(self.env, HashMap__namespace.fromIterable(Object.entries(environment)))
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
case "PipedCommand":
|
|
58
|
+
{
|
|
59
|
+
return pipeTo$1(env$1(self.left, environment), env$1(self.right, environment));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
/** @internal */
|
|
65
|
+
const exitCode$1 = self => Effect__namespace.flatMap(commandExecutor.CommandExecutor, executor => executor.exitCode(self));
|
|
66
|
+
|
|
67
|
+
/** @internal */
|
|
68
|
+
const feed$1 = /*#__PURE__*/Function.dual(2, (self, input) => stdin$1(self, Stream__namespace.fromChunk(Chunk__namespace.of(new TextEncoder().encode(input)))));
|
|
69
|
+
|
|
70
|
+
/** @internal */
|
|
71
|
+
const flatten$1 = self => Array.from(flattenLoop(self));
|
|
72
|
+
|
|
73
|
+
/** @internal */
|
|
74
|
+
const flattenLoop = self => {
|
|
75
|
+
switch (self._tag) {
|
|
76
|
+
case "StandardCommand":
|
|
77
|
+
{
|
|
78
|
+
return Chunk__namespace.of(self);
|
|
79
|
+
}
|
|
80
|
+
case "PipedCommand":
|
|
81
|
+
{
|
|
82
|
+
return Chunk__namespace.appendAll(flattenLoop(self.left), flattenLoop(self.right));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/** @internal */
|
|
88
|
+
const lines$1 = (command, encoding = "utf-8") => Effect__namespace.flatMap(commandExecutor.CommandExecutor, executor => executor.lines(command, encoding));
|
|
89
|
+
|
|
90
|
+
/** @internal */
|
|
91
|
+
const make$1 = (command, ...args) => ({
|
|
92
|
+
[CommandTypeId$1]: CommandTypeId$1,
|
|
93
|
+
_tag: "StandardCommand",
|
|
94
|
+
command,
|
|
95
|
+
args,
|
|
96
|
+
env: HashMap__namespace.empty(),
|
|
97
|
+
cwd: Option__namespace.none(),
|
|
98
|
+
// The initial process input here does not matter, we just want the child
|
|
99
|
+
// process to default to `"pipe"` for the stdin stream.
|
|
100
|
+
stdin: Option__namespace.some(Stream__namespace.empty),
|
|
101
|
+
stdout: "pipe",
|
|
102
|
+
stderr: "pipe",
|
|
103
|
+
gid: Option__namespace.none(),
|
|
104
|
+
uid: Option__namespace.none(),
|
|
105
|
+
pipe() {
|
|
106
|
+
return Pipeable.pipeArguments(this, arguments);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
/** @internal */
|
|
111
|
+
const pipeTo$1 = /*#__PURE__*/Function.dual(2, (self, into) => ({
|
|
112
|
+
[CommandTypeId$1]: CommandTypeId$1,
|
|
113
|
+
_tag: "PipedCommand",
|
|
114
|
+
left: self,
|
|
115
|
+
right: into,
|
|
116
|
+
pipe() {
|
|
117
|
+
return Pipeable.pipeArguments(this, arguments);
|
|
118
|
+
}
|
|
119
|
+
}));
|
|
120
|
+
|
|
121
|
+
/** @internal */
|
|
122
|
+
const stderr$1 = /*#__PURE__*/Function.dual(2, (self, output) => {
|
|
123
|
+
switch (self._tag) {
|
|
124
|
+
case "StandardCommand":
|
|
125
|
+
{
|
|
126
|
+
return {
|
|
127
|
+
...self,
|
|
128
|
+
stderr: output
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
// For piped commands it only makes sense to provide `stderr` for the
|
|
132
|
+
// right-most command as the rest will be piped in.
|
|
133
|
+
case "PipedCommand":
|
|
134
|
+
{
|
|
135
|
+
return {
|
|
136
|
+
...self,
|
|
137
|
+
right: stderr$1(self.right, output)
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
/** @internal */
|
|
144
|
+
const stdin$1 = /*#__PURE__*/Function.dual(2, (self, input) => {
|
|
145
|
+
switch (self._tag) {
|
|
146
|
+
case "StandardCommand":
|
|
147
|
+
{
|
|
148
|
+
return {
|
|
149
|
+
...self,
|
|
150
|
+
stdin: Option__namespace.some(input)
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
// For piped commands it only makes sense to provide `stdin` for the
|
|
154
|
+
// left-most command as the rest will be piped in.
|
|
155
|
+
case "PipedCommand":
|
|
156
|
+
{
|
|
157
|
+
return {
|
|
158
|
+
...self,
|
|
159
|
+
left: stdin$1(self.left, input)
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
/** @internal */
|
|
166
|
+
const stdout$1 = /*#__PURE__*/Function.dual(2, (self, output) => {
|
|
167
|
+
switch (self._tag) {
|
|
168
|
+
case "StandardCommand":
|
|
169
|
+
{
|
|
170
|
+
return {
|
|
171
|
+
...self,
|
|
172
|
+
stdout: output
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
// For piped commands it only makes sense to provide `stderr` for the
|
|
176
|
+
// right-most command as the rest will be piped in.
|
|
177
|
+
case "PipedCommand":
|
|
178
|
+
{
|
|
179
|
+
return {
|
|
180
|
+
...self,
|
|
181
|
+
right: stdout$1(self.right, output)
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
/** @internal */
|
|
188
|
+
const start$1 = command => Effect__namespace.flatMap(commandExecutor.CommandExecutor, executor => executor.start(command));
|
|
189
|
+
|
|
190
|
+
/** @internal */
|
|
191
|
+
const stream$1 = command => Stream__namespace.flatMap(commandExecutor.CommandExecutor, process => process.stream(command));
|
|
192
|
+
|
|
193
|
+
/** @internal */
|
|
194
|
+
const streamLines$1 = command => Stream__namespace.flatMap(commandExecutor.CommandExecutor, process => process.streamLines(command));
|
|
195
|
+
|
|
196
|
+
/** @internal */
|
|
197
|
+
const string$1 = /*#__PURE__*/Function.dual(args => isCommand$1(args[0]), (command, encoding) => Effect__namespace.flatMap(commandExecutor.CommandExecutor, executor => executor.string(command, encoding)));
|
|
198
|
+
|
|
199
|
+
/** @internal */
|
|
200
|
+
const workingDirectory$1 = /*#__PURE__*/Function.dual(2, (self, cwd) => {
|
|
201
|
+
switch (self._tag) {
|
|
202
|
+
case "StandardCommand":
|
|
203
|
+
{
|
|
204
|
+
return {
|
|
205
|
+
...self,
|
|
206
|
+
cwd: Option__namespace.some(cwd)
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
case "PipedCommand":
|
|
210
|
+
{
|
|
211
|
+
return pipeTo$1(workingDirectory$1(self.left, cwd), workingDirectory$1(self.right, cwd));
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* @since 1.0.0
|
|
218
|
+
*/
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* @since 1.0.0
|
|
222
|
+
*/
|
|
223
|
+
const CommandTypeId = CommandTypeId$1;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* @since 1.0.0
|
|
227
|
+
*/
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* @since 1.0.0
|
|
231
|
+
* @category models
|
|
232
|
+
*/
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* @since 1.0.0
|
|
236
|
+
*/
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Configures the pipe that is established between the parent and child
|
|
240
|
+
* processes' `stdin` stream.
|
|
241
|
+
*
|
|
242
|
+
* @since 1.0.0
|
|
243
|
+
* @category models
|
|
244
|
+
*/
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Configures the pipes that are established between the parent and child
|
|
248
|
+
* processes `stderr` and `stdout` streams.
|
|
249
|
+
*
|
|
250
|
+
* @since 1.0.0
|
|
251
|
+
* @category models
|
|
252
|
+
*/
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* @since 1.0.0
|
|
256
|
+
* @category models
|
|
257
|
+
*/
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* @since 1.0.0
|
|
261
|
+
* @category models
|
|
262
|
+
*/
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Returns `true` if the specified value is a `Command`, otherwise returns
|
|
266
|
+
* `false`.
|
|
267
|
+
*
|
|
268
|
+
* @since 1.0.0
|
|
269
|
+
* @category refinements
|
|
270
|
+
*/
|
|
271
|
+
const isCommand = isCommand$1;
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Specify the environment variables that will be used when running this command.
|
|
275
|
+
*
|
|
276
|
+
* @since 1.0.0
|
|
277
|
+
* @category combinators
|
|
278
|
+
*/
|
|
279
|
+
const env = env$1;
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Returns the exit code of the command after the process has completed
|
|
283
|
+
* execution.
|
|
284
|
+
*
|
|
285
|
+
* @since 1.0.0
|
|
286
|
+
* @category execution
|
|
287
|
+
*/
|
|
288
|
+
const exitCode = exitCode$1;
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Feed a string to standard input (default encoding of UTF-8).
|
|
292
|
+
*
|
|
293
|
+
* @since 1.0.0
|
|
294
|
+
* @category combinators
|
|
295
|
+
*/
|
|
296
|
+
const feed = feed$1;
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Flatten this command to a non-empty array of standard commands.
|
|
300
|
+
*
|
|
301
|
+
* * For a `StandardCommand`, this simply returns a `1` element array
|
|
302
|
+
* * For a `PipedCommand`, all commands in the pipe will be extracted out into
|
|
303
|
+
* a array from left to right
|
|
304
|
+
*
|
|
305
|
+
* @since 1.0.0
|
|
306
|
+
* @category combinators
|
|
307
|
+
*/
|
|
308
|
+
const flatten = flatten$1;
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Runs the command returning the output as an array of lines with the specified
|
|
312
|
+
* encoding.
|
|
313
|
+
*
|
|
314
|
+
* @since 1.0.0
|
|
315
|
+
* @category execution
|
|
316
|
+
*/
|
|
317
|
+
const lines = lines$1;
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Create a command with the specified process name and an optional list of
|
|
321
|
+
* arguments.
|
|
322
|
+
*
|
|
323
|
+
* @since 1.0.0
|
|
324
|
+
* @category constructors
|
|
325
|
+
*/
|
|
326
|
+
const make = make$1;
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Pipe one command to another command from left to right.
|
|
330
|
+
*
|
|
331
|
+
* Conceptually, the equivalent of piping one shell command to another:
|
|
332
|
+
*
|
|
333
|
+
* ```sh
|
|
334
|
+
* command1 | command2
|
|
335
|
+
* ```
|
|
336
|
+
*
|
|
337
|
+
* @since 1.0.0
|
|
338
|
+
* @category combinators
|
|
339
|
+
*/
|
|
340
|
+
const pipeTo = pipeTo$1;
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Start running the command and return a handle to the running process.
|
|
344
|
+
*
|
|
345
|
+
* @since 1.0.0
|
|
346
|
+
* @category execution
|
|
347
|
+
*/
|
|
348
|
+
const start = start$1;
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Start running the command and return the output as a `Stream`.
|
|
352
|
+
*
|
|
353
|
+
* @since 1.0.0
|
|
354
|
+
* @category execution
|
|
355
|
+
*/
|
|
356
|
+
const stream = stream$1;
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Runs the command returning the output as an stream of lines with the
|
|
360
|
+
* specified encoding.
|
|
361
|
+
*
|
|
362
|
+
* @since 1.0.0
|
|
363
|
+
* @category execution
|
|
364
|
+
*/
|
|
365
|
+
const streamLines = streamLines$1;
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Runs the command returning the entire output as a string with the
|
|
369
|
+
* specified encoding.
|
|
370
|
+
*
|
|
371
|
+
* If an encoding is not specified, the encoding will default to `utf-8`.
|
|
372
|
+
*
|
|
373
|
+
* @since 1.0.0
|
|
374
|
+
* @category execution
|
|
375
|
+
*/
|
|
376
|
+
const string = string$1;
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Specify the standard error stream for a command.
|
|
380
|
+
*
|
|
381
|
+
* @since 1.0.0
|
|
382
|
+
* @category combinators
|
|
383
|
+
*/
|
|
384
|
+
const stderr = stderr$1;
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* Specify the standard input stream for a command.
|
|
388
|
+
*
|
|
389
|
+
* @since 1.0.0
|
|
390
|
+
* @category combinators
|
|
391
|
+
*/
|
|
392
|
+
const stdin = stdin$1;
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* Specify the standard output stream for a command.
|
|
396
|
+
*
|
|
397
|
+
* @since 1.0.0
|
|
398
|
+
* @category combinators
|
|
399
|
+
*/
|
|
400
|
+
const stdout = stdout$1;
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Set the working directory that will be used when this command will be run.
|
|
404
|
+
*
|
|
405
|
+
* For piped commands, the working directory of each command will be set to the
|
|
406
|
+
* specified working directory.
|
|
407
|
+
*
|
|
408
|
+
* @since 1.0.0
|
|
409
|
+
* @category combinators
|
|
410
|
+
*/
|
|
411
|
+
const workingDirectory = workingDirectory$1;
|
|
412
|
+
|
|
413
|
+
exports.CommandTypeId = CommandTypeId;
|
|
414
|
+
exports.env = env;
|
|
415
|
+
exports.exitCode = exitCode;
|
|
416
|
+
exports.feed = feed;
|
|
417
|
+
exports.flatten = flatten;
|
|
418
|
+
exports.isCommand = isCommand;
|
|
419
|
+
exports.lines = lines;
|
|
420
|
+
exports.make = make;
|
|
421
|
+
exports.pipeTo = pipeTo;
|
|
422
|
+
exports.start = start;
|
|
423
|
+
exports.stderr = stderr;
|
|
424
|
+
exports.stdin = stdin;
|
|
425
|
+
exports.stdout = stdout;
|
|
426
|
+
exports.stream = stream;
|
|
427
|
+
exports.streamLines = streamLines;
|
|
428
|
+
exports.string = string;
|
|
429
|
+
exports.workingDirectory = workingDirectory;
|