@effect/platform 0.1.0 → 0.2.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.
@@ -0,0 +1,184 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.workingDirectory = exports.string = exports.streamLines = exports.stream = exports.stdout = exports.stdin = exports.stderr = exports.start = exports.pipeTo = exports.make = exports.lines = exports.isCommand = exports.flatten = exports.feed = exports.exitCode = exports.env = exports.CommandTypeId = void 0;
7
+ var Chunk = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/Chunk"));
8
+ var _Function = /*#__PURE__*/require("@effect/data/Function");
9
+ var HashMap = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/HashMap"));
10
+ var Option = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/Option"));
11
+ var Effect = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/Effect"));
12
+ var commandExecutor = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/internal/commandExecutor"));
13
+ var Stream = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/stream/Stream"));
14
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
+ /** @internal */
17
+ const CommandTypeId = /*#__PURE__*/Symbol.for("@effect/platform/Command");
18
+ /** @internal */
19
+ exports.CommandTypeId = CommandTypeId;
20
+ const isCommand = u => typeof u === "object" && u != null && CommandTypeId in u;
21
+ /** @internal */
22
+ exports.isCommand = isCommand;
23
+ const env = /*#__PURE__*/(0, _Function.dual)(2, (self, environment) => {
24
+ switch (self._tag) {
25
+ case "StandardCommand":
26
+ {
27
+ return {
28
+ ...self,
29
+ env: HashMap.union(self.env, HashMap.fromIterable(Object.entries(environment)))
30
+ };
31
+ }
32
+ case "PipedCommand":
33
+ {
34
+ return pipeTo(env(self.left, environment), env(self.right, environment));
35
+ }
36
+ }
37
+ });
38
+ /** @internal */
39
+ exports.env = env;
40
+ const exitCode = self => Effect.flatMap(commandExecutor.CommandExecutor, executor => executor.exitCode(self));
41
+ /** @internal */
42
+ exports.exitCode = exitCode;
43
+ const feed = /*#__PURE__*/(0, _Function.dual)(2, (self, input) => stdin(self, Stream.fromChunk(Chunk.of(new TextEncoder().encode(input)))));
44
+ /** @internal */
45
+ exports.feed = feed;
46
+ const flatten = self => Array.from(flattenLoop(self));
47
+ /** @internal */
48
+ exports.flatten = flatten;
49
+ const flattenLoop = self => {
50
+ switch (self._tag) {
51
+ case "StandardCommand":
52
+ {
53
+ return Chunk.of(self);
54
+ }
55
+ case "PipedCommand":
56
+ {
57
+ return Chunk.appendAll(flattenLoop(self.left), flattenLoop(self.right));
58
+ }
59
+ }
60
+ };
61
+ /** @internal */
62
+ const lines = (command, encoding = "utf-8") => Effect.flatMap(commandExecutor.CommandExecutor, executor => executor.lines(command, encoding));
63
+ /** @internal */
64
+ exports.lines = lines;
65
+ const make = (command, ...args) => ({
66
+ [CommandTypeId]: CommandTypeId,
67
+ _tag: "StandardCommand",
68
+ command,
69
+ args,
70
+ env: HashMap.empty(),
71
+ cwd: Option.none(),
72
+ // The initial process input here does not matter, we just want the child
73
+ // process to default to `"pipe"` for the stdin stream.
74
+ stdin: Option.some(Stream.empty),
75
+ stdout: "pipe",
76
+ stderr: "pipe",
77
+ gid: Option.none(),
78
+ uid: Option.none()
79
+ });
80
+ /** @internal */
81
+ exports.make = make;
82
+ const pipeTo = /*#__PURE__*/(0, _Function.dual)(2, (self, into) => ({
83
+ [CommandTypeId]: CommandTypeId,
84
+ _tag: "PipedCommand",
85
+ left: self,
86
+ right: into
87
+ }));
88
+ /** @internal */
89
+ exports.pipeTo = pipeTo;
90
+ const stderr = /*#__PURE__*/(0, _Function.dual)(2, (self, output) => {
91
+ switch (self._tag) {
92
+ case "StandardCommand":
93
+ {
94
+ return {
95
+ ...self,
96
+ stderr: output
97
+ };
98
+ }
99
+ // For piped commands it only makes sense to provide `stderr` for the
100
+ // right-most command as the rest will be piped in.
101
+ case "PipedCommand":
102
+ {
103
+ return {
104
+ ...self,
105
+ right: stderr(self.right, output)
106
+ };
107
+ }
108
+ }
109
+ });
110
+ /** @internal */
111
+ exports.stderr = stderr;
112
+ const stdin = /*#__PURE__*/(0, _Function.dual)(2, (self, input) => {
113
+ switch (self._tag) {
114
+ case "StandardCommand":
115
+ {
116
+ return {
117
+ ...self,
118
+ stdin: Option.some(input)
119
+ };
120
+ }
121
+ // For piped commands it only makes sense to provide `stdin` for the
122
+ // left-most command as the rest will be piped in.
123
+ case "PipedCommand":
124
+ {
125
+ return {
126
+ ...self,
127
+ left: stdin(self.left, input)
128
+ };
129
+ }
130
+ }
131
+ });
132
+ /** @internal */
133
+ exports.stdin = stdin;
134
+ const stdout = /*#__PURE__*/(0, _Function.dual)(2, (self, output) => {
135
+ switch (self._tag) {
136
+ case "StandardCommand":
137
+ {
138
+ return {
139
+ ...self,
140
+ stdout: output
141
+ };
142
+ }
143
+ // For piped commands it only makes sense to provide `stderr` for the
144
+ // right-most command as the rest will be piped in.
145
+ case "PipedCommand":
146
+ {
147
+ return {
148
+ ...self,
149
+ right: stdout(self.right, output)
150
+ };
151
+ }
152
+ }
153
+ });
154
+ /** @internal */
155
+ exports.stdout = stdout;
156
+ const start = command => Effect.flatMap(commandExecutor.CommandExecutor, executor => executor.start(command));
157
+ /** @internal */
158
+ exports.start = start;
159
+ const stream = command => Stream.flatMap(commandExecutor.CommandExecutor, process => process.stream(command));
160
+ /** @internal */
161
+ exports.stream = stream;
162
+ const streamLines = command => Stream.flatMap(commandExecutor.CommandExecutor, process => process.streamLines(command));
163
+ /** @internal */
164
+ exports.streamLines = streamLines;
165
+ const string = /*#__PURE__*/(0, _Function.dual)(args => isCommand(args[0]), (command, encoding) => Effect.flatMap(commandExecutor.CommandExecutor, executor => executor.string(command, encoding)));
166
+ /** @internal */
167
+ exports.string = string;
168
+ const workingDirectory = /*#__PURE__*/(0, _Function.dual)(2, (self, cwd) => {
169
+ switch (self._tag) {
170
+ case "StandardCommand":
171
+ {
172
+ return {
173
+ ...self,
174
+ cwd: Option.some(cwd)
175
+ };
176
+ }
177
+ case "PipedCommand":
178
+ {
179
+ return pipeTo(workingDirectory(self.left, cwd), workingDirectory(self.right, cwd));
180
+ }
181
+ }
182
+ });
183
+ exports.workingDirectory = workingDirectory;
184
+ //# sourceMappingURL=command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.js","names":["Chunk","_interopRequireWildcard","require","_Function","HashMap","Option","Effect","commandExecutor","Stream","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","CommandTypeId","Symbol","for","exports","isCommand","u","env","dual","self","environment","_tag","union","fromIterable","entries","pipeTo","left","right","exitCode","flatMap","CommandExecutor","executor","feed","input","stdin","fromChunk","of","TextEncoder","encode","flatten","Array","from","flattenLoop","appendAll","lines","command","encoding","make","args","empty","cwd","none","some","stdout","stderr","gid","uid","into","output","start","stream","process","streamLines","string","workingDirectory"],"sources":["../src/internal/command.ts"],"sourcesContent":[null],"mappings":";;;;;;AAAA,IAAAA,KAAA,gBAAAC,uBAAA,eAAAC,OAAA;AACA,IAAAC,SAAA,gBAAAD,OAAA;AACA,IAAAE,OAAA,gBAAAH,uBAAA,eAAAC,OAAA;AACA,IAAAG,MAAA,gBAAAJ,uBAAA,eAAAC,OAAA;AAEA,IAAAI,MAAA,gBAAAL,uBAAA,eAAAC,OAAA;AAIA,IAAAK,eAAA,gBAAAN,uBAAA,eAAAC,OAAA;AACA,IAAAM,MAAA,gBAAAP,uBAAA,eAAAC,OAAA;AAA+C,SAAAO,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAT,wBAAAa,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,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O,MAAME,WAAW,GACtBjB,OAAwB,IAExBzD,MAAM,CAACyC,OAAO,CAAC1C,eAAe,CAAC2C,eAAe,EAAG+B,OAAO,IAAKA,OAAO,CAACC,WAAW,CAACjB,OAAO,CAAC,CAAC;AAE5F;AAAA/B,OAAA,CAAAgD,WAAA,GAAAA,WAAA;AACO,MAAMC,MAAM,gBAAG,IAAA7C,cAAI,EAMvB8B,IAAI,IAAKjC,SAAS,CAACiC,IAAI,CAAC,CAAC,CAAC,CAAC,EAC5B,CAACH,OAAO,EAAEC,QAAQ,KAChB5D,MAAM,CAAC2C,OAAO,CAAC1C,eAAe,CAAC2C,eAAe,EAAGC,QAAQ,IAAKA,QAAQ,CAACgC,MAAM,CAAClB,OAAO,EAAEC,QAAQ,CAAC,CAAC,CACpG;AAED;AAAAhC,OAAA,CAAAiD,MAAA,GAAAA,MAAA;AACO,MAAMC,gBAAgB,gBAGzB,IAAA9C,cAAI,EAGN,CAAC,EAAE,CAACC,IAAI,EAAE+B,GAAG,KAAI;EACjB,QAAQ/B,IAAI,CAACE,IAAI;IACf,KAAK,iBAAiB;MAAE;QACtB,OAAO;UAAE,GAAGF,IAAI;UAAE+B,GAAG,EAAEjE,MAAM,CAACmE,IAAI,CAACF,GAAG;QAAC,CAAE;;IAE3C,KAAK,cAAc;MAAE;QACnB,OAAOzB,MAAM,CAACuC,gBAAgB,CAAC7C,IAAI,CAACO,IAAI,EAAEwB,GAAG,CAAC,EAAEc,gBAAgB,CAAC7C,IAAI,CAACQ,KAAK,EAAEuB,GAAG,CAAC,CAAC;;;AAGxF,CAAC,CAAC;AAAApC,OAAA,CAAAkD,gBAAA,GAAAA,gBAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=commandExecutor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commandExecutor.d.ts","sourceRoot":"","sources":["../src/internal/commandExecutor.ts"],"names":[],"mappings":""}
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.makeExecutor = exports.ProcessTypeId = exports.ProcessId = exports.ExitCode = exports.CommandExecutor = void 0;
7
+ var Brand = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/Brand"));
8
+ var Chunk = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/Chunk"));
9
+ var _Context = /*#__PURE__*/require("@effect/data/Context");
10
+ var Effect = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/io/Effect"));
11
+ var Sink = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/stream/Sink"));
12
+ var Stream = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/stream/Stream"));
13
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
14
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
+ /** @internal */
16
+ const ProcessTypeId = /*#__PURE__*/Symbol.for("@effect/platform/Process");
17
+ /** @internal */
18
+ exports.ProcessTypeId = ProcessTypeId;
19
+ const ExitCode = /*#__PURE__*/Brand.nominal();
20
+ /** @internal */
21
+ exports.ExitCode = ExitCode;
22
+ const ProcessId = /*#__PURE__*/Brand.nominal();
23
+ /** @internal */
24
+ exports.ProcessId = ProcessId;
25
+ const CommandExecutor = /*#__PURE__*/(0, _Context.Tag)();
26
+ /** @internal */
27
+ exports.CommandExecutor = CommandExecutor;
28
+ const makeExecutor = start => {
29
+ const stream = command => Stream.flatMap(process => process.stdout)(Stream.fromEffect(start(command)));
30
+ const streamLines = (command, encoding) => {
31
+ const decoder = new TextDecoder(encoding);
32
+ return Stream.splitLines(Stream.mapChunks(stream(command), Chunk.map(bytes => decoder.decode(bytes))));
33
+ };
34
+ return {
35
+ start,
36
+ exitCode: command => Effect.flatMap(start(command), process => process.exitCode),
37
+ stream,
38
+ string: (command, encoding = "utf-8") => {
39
+ const decoder = new TextDecoder(encoding);
40
+ return Effect.map(bytes => decoder.decode(bytes))(Effect.flatMap(process => Stream.run(process.stdout, collectUint8Array))(start(command)));
41
+ },
42
+ lines: (command, encoding = "utf-8") => {
43
+ return Effect.map(Chunk.toReadonlyArray)(Stream.runCollect(streamLines(command, encoding)));
44
+ },
45
+ streamLines
46
+ };
47
+ };
48
+ exports.makeExecutor = makeExecutor;
49
+ const collectUint8Array = /*#__PURE__*/Sink.foldLeftChunks( /*#__PURE__*/new Uint8Array(), (bytes, chunk) => Chunk.reduce(chunk, bytes, (acc, curr) => {
50
+ const newArray = new Uint8Array(acc.length + curr.length);
51
+ newArray.set(acc);
52
+ newArray.set(curr, acc.length);
53
+ return newArray;
54
+ }));
55
+ //# sourceMappingURL=commandExecutor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commandExecutor.js","names":["Brand","_interopRequireWildcard","require","Chunk","_Context","Effect","Sink","Stream","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ProcessTypeId","Symbol","for","exports","ExitCode","nominal","ProcessId","CommandExecutor","Tag","makeExecutor","start","stream","command","flatMap","process","stdout","fromEffect","streamLines","encoding","decoder","TextDecoder","splitLines","mapChunks","map","bytes","decode","exitCode","string","run","collectUint8Array","lines","toReadonlyArray","runCollect","foldLeftChunks","Uint8Array","chunk","reduce","acc","curr","newArray","length"],"sources":["../src/internal/commandExecutor.ts"],"sourcesContent":[null],"mappings":";;;;;;AAAA,IAAAA,KAAA,gBAAAC,uBAAA,eAAAC,OAAA;AACA,IAAAC,KAAA,gBAAAF,uBAAA,eAAAC,OAAA;AACA,IAAAE,QAAA,gBAAAF,OAAA;AAEA,IAAAG,MAAA,gBAAAJ,uBAAA,eAAAC,OAAA;AAEA,IAAAI,IAAA,gBAAAL,uBAAA,eAAAC,OAAA;AACA,IAAAK,MAAA,gBAAAN,uBAAA,eAAAC,OAAA;AAA+C,SAAAM,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAR,wBAAAY,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAA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,IAAI,CAACE,MAAM,CAAC;EACzDD,QAAQ,CAACxC,GAAG,CAACsC,GAAG,CAAC;EACjBE,QAAQ,CAACxC,GAAG,CAACuC,IAAI,EAAED,GAAG,CAACG,MAAM,CAAC;EAC9B,OAAOD,QAAQ;AACjB,CAAC,CAAC,CACL"}
@@ -39,7 +39,7 @@ const stream = (file, {
39
39
  offset = Size(0)
40
40
  } = {}) => Stream.bufferChunks(Stream.unfoldEffect(offset, position => {
41
41
  if (bytesToRead !== undefined && bytesToRead <= position - offset) {
42
- return Effect.succeedNone();
42
+ return Effect.succeed(Option.none());
43
43
  }
44
44
  const toRead = bytesToRead !== undefined && bytesToRead - (position - offset) < chunkSize ? bytesToRead - (position - offset) : chunkSize;
45
45
  return Effect.map(Option.map(buf => [buf, Size(position + BigInt(buf.length))]))(file.readAlloc(toRead, {
@@ -1 +1 @@
1
- {"version":3,"file":"fileSystem.js","names":["_Context","require","Option","_interopRequireWildcard","Effect","Sink","Stream","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","tag","Tag","exports","Size","bytes","BigInt","make","impl","of","stream","path","options","unwrapScoped","map","file","open","flag","sink","forEach","_","writeAll","bufferSize","bytesToRead","chunkSize","offset","bufferChunks","unfoldEffect","position","undefined","succeedNone","toRead","buf","length","readAlloc"],"sources":["../src/internal/fileSystem.ts"],"sourcesContent":[null],"mappings":";;;;;;AAAA,IAAAA,QAAA,gBAAAC,OAAA;AAEA,IAAAC,MAAA,gBAAAC,uBAAA,eAAAF,OAAA;AACA,IAAAG,MAAA,gBAAAD,uBAAA,eAAAF,OAAA;AAEA,IAAAI,IAAA,gBAAAF,uBAAA,eAAAF,OAAA;AACA,IAAAK,MAAA,gBAAAH,uBAAA,eAAAF,OAAA;AAA+C,SAAAM,yBAAAC,WAAA,eAAAC,OAAA,kCAA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M,GAAGR,WAAW,KAAKM,SAAS,IAAIN,WAAW,IAAIK,QAAQ,GAAGH,MAAM,CAAC,GAAGD,SAAS,GACrFD,WAAW,IAAIK,QAAQ,GAAGH,MAAM,CAAC,GACjCD,SAAS;EAEb,OAEEhD,MAAM,CAACsC,GAAG,CACRxC,MAAM,CAACwC,GAAG,CAAEkB,GAAG,IAAK,CAACA,GAAG,EAAE5B,IAAI,CAACwB,QAAQ,GAAGtB,MAAM,CAAC0B,GAAG,CAACC,MAAM,CAAC,CAAC,CAAU,CAAC,CACzE,CAHDlB,IAAI,CAACmB,SAAS,CAACH,MAAe,EAAE;IAAEN,MAAM,EAAEG;EAAQ,CAAE,CAAC;AAKzD,CAAC,CAAC,EACFN,UAAU,CACX"}
1
+ {"version":3,"file":"fileSystem.js","names":["_Context","require","Option","_interopRequireWildcard","Effect","Sink","Stream","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","tag","Tag","exports","Size","bytes","BigInt","make","impl","of","stream","path","options","unwrapScoped","map","file","open","flag","sink","forEach","_","writeAll","bufferSize","bytesToRead","chunkSize","offset","bufferChunks","unfoldEffect","position","undefined","succeed","none","toRead","buf","length","readAlloc"],"sources":["../src/internal/fileSystem.ts"],"sourcesContent":[null],"mappings":";;;;;;AAAA,IAAAA,QAAA,gBAAAC,OAAA;AAEA,IAAAC,MAAA,gBAAAC,uBAAA,eAAAF,OAAA;AACA,IAAAG,MAAA,gBAAAD,uBAAA,eAAAF,OAAA;AAEA,IAAAI,IAAA,gBAAAF,uBAAA,eAAAF,OAAA;AACA,IAAAK,MAAA,gBAAAH,uBAAA,eAAAF,OAAA;AAA+C,SAAAM,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YA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WAAW,IAAIK,QAAQ,GAAGH,MAAM,CAAC,GAAGD,SAAS,GACrFD,WAAW,IAAIK,QAAQ,GAAGH,MAAM,CAAC,GACjCD,SAAS;EAEb,OAEEhD,MAAM,CAACsC,GAAG,CACRxC,MAAM,CAACwC,GAAG,CAAEmB,GAAG,IAAK,CAACA,GAAG,EAAE7B,IAAI,CAACwB,QAAQ,GAAGtB,MAAM,CAAC2B,GAAG,CAACC,MAAM,CAAC,CAAC,CAAU,CAAC,CACzE,CAHDnB,IAAI,CAACoB,SAAS,CAACH,MAAe,EAAE;IAAEP,MAAM,EAAEG;EAAQ,CAAE,CAAC;AAKzD,CAAC,CAAC,EACFN,UAAU,CACX"}
@@ -0,0 +1,139 @@
1
+ import * as internal from "@effect/platform/internal/command";
2
+ /**
3
+ * @since 1.0.0
4
+ */
5
+ export const CommandTypeId = internal.CommandTypeId;
6
+ /**
7
+ * Returns `true` if the specified value is a `Command`, otherwise returns
8
+ * `false`.
9
+ *
10
+ * @since 1.0.0
11
+ * @category refinements
12
+ */
13
+ export const isCommand = internal.isCommand;
14
+ /**
15
+ * Specify the environment variables that will be used when running this command.
16
+ *
17
+ * @since 1.0.0
18
+ * @category combinators
19
+ */
20
+ export const env = internal.env;
21
+ /**
22
+ * Returns the exit code of the command after the process has completed
23
+ * execution.
24
+ *
25
+ * @since 1.0.0
26
+ * @category execution
27
+ */
28
+ export const exitCode = internal.exitCode;
29
+ /**
30
+ * Feed a string to standard input (default encoding of UTF-8).
31
+ *
32
+ * @since 1.0.0
33
+ * @category combinators
34
+ */
35
+ export const feed = internal.feed;
36
+ /**
37
+ * Flatten this command to a non-empty array of standard commands.
38
+ *
39
+ * * For a `StandardCommand`, this simply returns a `1` element array
40
+ * * For a `PipedCommand`, all commands in the pipe will be extracted out into
41
+ * a array from left to right
42
+ *
43
+ * @since 1.0.0
44
+ * @category combinators
45
+ */
46
+ export const flatten = internal.flatten;
47
+ /**
48
+ * Runs the command returning the output as an array of lines with the specified
49
+ * encoding.
50
+ *
51
+ * @since 1.0.0
52
+ * @category execution
53
+ */
54
+ export const lines = internal.lines;
55
+ /**
56
+ * Create a command with the specified process name and an optional list of
57
+ * arguments.
58
+ *
59
+ * @since 1.0.0
60
+ * @category constructors
61
+ */
62
+ export const make = internal.make;
63
+ /**
64
+ * Pipe one command to another command from left to right.
65
+ *
66
+ * Conceptually, the equivalent of piping one shell command to another:
67
+ *
68
+ * ```sh
69
+ * command1 | command2
70
+ * ```
71
+ *
72
+ * @since 1.0.0
73
+ * @category combinators
74
+ */
75
+ export const pipeTo = internal.pipeTo;
76
+ /**
77
+ * Start running the command and return a handle to the running process.
78
+ *
79
+ * @since 1.0.0
80
+ * @category execution
81
+ */
82
+ export const start = internal.start;
83
+ /**
84
+ * Start running the command and return the output as a `Stream`.
85
+ *
86
+ * @since 1.0.0
87
+ * @category execution
88
+ */
89
+ export const stream = internal.stream;
90
+ /**
91
+ * Runs the command returning the output as an stream of lines with the
92
+ * specified encoding.
93
+ *
94
+ * @since 1.0.0
95
+ * @category execution
96
+ */
97
+ export const streamLines = internal.streamLines;
98
+ /**
99
+ * Runs the command returning the entire output as a string with the
100
+ * specified encoding.
101
+ *
102
+ * If an encoding is not specified, the encoding will default to `utf-8`.
103
+ *
104
+ * @since 1.0.0
105
+ * @category execution
106
+ */
107
+ export const string = internal.string;
108
+ /**
109
+ * Specify the standard error stream for a command.
110
+ *
111
+ * @since 1.0.0
112
+ * @category combinators
113
+ */
114
+ export const stderr = internal.stderr;
115
+ /**
116
+ * Specify the standard input stream for a command.
117
+ *
118
+ * @since 1.0.0
119
+ * @category combinators
120
+ */
121
+ export const stdin = internal.stdin;
122
+ /**
123
+ * Specify the standard output stream for a command.
124
+ *
125
+ * @since 1.0.0
126
+ * @category combinators
127
+ */
128
+ export const stdout = internal.stdout;
129
+ /**
130
+ * Set the working directory that will be used when this command will be run.
131
+ *
132
+ * For piped commands, the working directory of each command will be set to the
133
+ * specified working directory.
134
+ *
135
+ * @since 1.0.0
136
+ * @category combinators
137
+ */
138
+ export const workingDirectory = internal.workingDirectory;
139
+ //# sourceMappingURL=Command.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Command.mjs","names":["internal","CommandTypeId","isCommand","env","exitCode","feed","flatten","lines","make","pipeTo","start","stream","streamLines","string","stderr","stdin","stdout","workingDirectory"],"sources":["../src/Command.ts"],"sourcesContent":[null],"mappings":"AASA,OAAO,KAAKA,QAAQ,MAAM,mCAAmC;AAI7D;;;AAGA,OAAO,MAAMC,aAAa,GAAkBD,QAAQ,CAACC,aAAa;AAuFlE;;;;;;;AAOA,OAAO,MAAMC,SAAS,GAAiCF,QAAQ,CAACE,SAAS;AAEzE;;;;;;AAMA,OAAO,MAAMC,GAAG,GAGZH,QAAQ,CAACG,GAAG;AAEhB;;;;;;;AAOA,OAAO,MAAMC,QAAQ,GAAwEJ,QAAQ,CAACI,QAAQ;AAE9G;;;;;;AAMA,OAAO,MAAMC,IAAI,GAGbL,QAAQ,CAACK,IAAI;AAEjB;;;;;;;;;;AAUA,OAAO,MAAMC,OAAO,GAA8DN,QAAQ,CAACM,OAAO;AAElG;;;;;;;AAOA,OAAO,MAAMC,KAAK,GAGmDP,QAAQ,CAACO,KAAK;AAEnF;;;;;;;AAOA,OAAO,MAAMC,IAAI,GAAyDR,QAAQ,CAACQ,IAAI;AAEvF;;;;;;;;;;;;AAYA,OAAO,MAAMC,MAAM,GAGfT,QAAQ,CAACS,MAAM;AAEnB;;;;;;AAMA,OAAO,MAAMC,KAAK,GAA0EV,QAAQ,CAACU,KAAK;AAE1G;;;;;;AAMA,OAAO,MAAMC,MAAM,GAA6EX,QAAQ,CAACW,MAAM;AAE/G;;;;;;;AAOA,OAAO,MAAMC,WAAW,GAAyEZ,QAAQ,CAACY,WAAW;AAErH;;;;;;;;;AASA,OAAO,MAAMC,MAAM,GAGfb,QAAQ,CAACa,MAAM;AAEnB;;;;;;AAMA,OAAO,MAAMC,MAAM,GAGfd,QAAQ,CAACc,MAAM;AAEnB;;;;;;AAMA,OAAO,MAAMC,KAAK,GAGdf,QAAQ,CAACe,KAAK;AAElB;;;;;;AAMA,OAAO,MAAMC,MAAM,GAGfhB,QAAQ,CAACgB,MAAM;AAEnB;;;;;;;;;AASA,OAAO,MAAMC,gBAAgB,GAGzBjB,QAAQ,CAACiB,gBAAgB"}
@@ -0,0 +1,27 @@
1
+ import * as internal from "@effect/platform/internal/commandExecutor";
2
+ /**
3
+ * @since 1.0.0
4
+ * @category tags
5
+ */
6
+ export const CommandExecutor = internal.CommandExecutor;
7
+ /**
8
+ * @since 1.0.0
9
+ * @category symbols
10
+ */
11
+ export const ProcessTypeId = internal.ProcessTypeId;
12
+ /**
13
+ * @since 1.0.0
14
+ * @category constructors
15
+ */
16
+ export const ExitCode = internal.ExitCode;
17
+ /**
18
+ * @since 1.0.0
19
+ * @category constructors
20
+ */
21
+ export const ProcessId = internal.ProcessId;
22
+ /**
23
+ * @since 1.0.0
24
+ * @category constructors
25
+ */
26
+ export const makeExecutor = internal.makeExecutor;
27
+ //# sourceMappingURL=CommandExecutor.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandExecutor.mjs","names":["internal","CommandExecutor","ProcessTypeId","ExitCode","ProcessId","makeExecutor"],"sources":["../src/CommandExecutor.ts"],"sourcesContent":[null],"mappings":"AAQA,OAAO,KAAKA,QAAQ,MAAM,2CAA2C;AAyCrE;;;;AAIA,OAAO,MAAMC,eAAe,GAA0CD,QAAQ,CAACC,eAAe;AAE9F;;;;AAIA,OAAO,MAAMC,aAAa,GAAkBF,QAAQ,CAACE,aAAa;AAiHlE;;;;AAIA,OAAO,MAAMC,QAAQ,GAAsCH,QAAQ,CAACG,QAAQ;AAE5E;;;;AAIA,OAAO,MAAMC,SAAS,GAAwCJ,QAAQ,CAACI,SAAS;AAEhF;;;;AAIA,OAAO,MAAMC,YAAY,GAEFL,QAAQ,CAACK,YAAY"}
@@ -0,0 +1,159 @@
1
+ import * as Chunk from "@effect/data/Chunk";
2
+ import { dual } from "@effect/data/Function";
3
+ import * as HashMap from "@effect/data/HashMap";
4
+ import * as Option from "@effect/data/Option";
5
+ import * as Effect from "@effect/io/Effect";
6
+ import * as commandExecutor from "@effect/platform/internal/commandExecutor";
7
+ import * as Stream from "@effect/stream/Stream";
8
+ /** @internal */
9
+ export const CommandTypeId = /*#__PURE__*/Symbol.for("@effect/platform/Command");
10
+ /** @internal */
11
+ export const isCommand = u => typeof u === "object" && u != null && CommandTypeId in u;
12
+ /** @internal */
13
+ export const env = /*#__PURE__*/dual(2, (self, environment) => {
14
+ switch (self._tag) {
15
+ case "StandardCommand":
16
+ {
17
+ return {
18
+ ...self,
19
+ env: HashMap.union(self.env, HashMap.fromIterable(Object.entries(environment)))
20
+ };
21
+ }
22
+ case "PipedCommand":
23
+ {
24
+ return pipeTo(env(self.left, environment), env(self.right, environment));
25
+ }
26
+ }
27
+ });
28
+ /** @internal */
29
+ export const exitCode = self => Effect.flatMap(commandExecutor.CommandExecutor, executor => executor.exitCode(self));
30
+ /** @internal */
31
+ export const feed = /*#__PURE__*/dual(2, (self, input) => stdin(self, Stream.fromChunk(Chunk.of(new TextEncoder().encode(input)))));
32
+ /** @internal */
33
+ export const flatten = self => Array.from(flattenLoop(self));
34
+ /** @internal */
35
+ const flattenLoop = self => {
36
+ switch (self._tag) {
37
+ case "StandardCommand":
38
+ {
39
+ return Chunk.of(self);
40
+ }
41
+ case "PipedCommand":
42
+ {
43
+ return Chunk.appendAll(flattenLoop(self.left), flattenLoop(self.right));
44
+ }
45
+ }
46
+ };
47
+ /** @internal */
48
+ export const lines = (command, encoding = "utf-8") => Effect.flatMap(commandExecutor.CommandExecutor, executor => executor.lines(command, encoding));
49
+ /** @internal */
50
+ export const make = (command, ...args) => ({
51
+ [CommandTypeId]: CommandTypeId,
52
+ _tag: "StandardCommand",
53
+ command,
54
+ args,
55
+ env: HashMap.empty(),
56
+ cwd: Option.none(),
57
+ // The initial process input here does not matter, we just want the child
58
+ // process to default to `"pipe"` for the stdin stream.
59
+ stdin: Option.some(Stream.empty),
60
+ stdout: "pipe",
61
+ stderr: "pipe",
62
+ gid: Option.none(),
63
+ uid: Option.none()
64
+ });
65
+ /** @internal */
66
+ export const pipeTo = /*#__PURE__*/dual(2, (self, into) => ({
67
+ [CommandTypeId]: CommandTypeId,
68
+ _tag: "PipedCommand",
69
+ left: self,
70
+ right: into
71
+ }));
72
+ /** @internal */
73
+ export const stderr = /*#__PURE__*/dual(2, (self, output) => {
74
+ switch (self._tag) {
75
+ case "StandardCommand":
76
+ {
77
+ return {
78
+ ...self,
79
+ stderr: output
80
+ };
81
+ }
82
+ // For piped commands it only makes sense to provide `stderr` for the
83
+ // right-most command as the rest will be piped in.
84
+ case "PipedCommand":
85
+ {
86
+ return {
87
+ ...self,
88
+ right: stderr(self.right, output)
89
+ };
90
+ }
91
+ }
92
+ });
93
+ /** @internal */
94
+ export const stdin = /*#__PURE__*/dual(2, (self, input) => {
95
+ switch (self._tag) {
96
+ case "StandardCommand":
97
+ {
98
+ return {
99
+ ...self,
100
+ stdin: Option.some(input)
101
+ };
102
+ }
103
+ // For piped commands it only makes sense to provide `stdin` for the
104
+ // left-most command as the rest will be piped in.
105
+ case "PipedCommand":
106
+ {
107
+ return {
108
+ ...self,
109
+ left: stdin(self.left, input)
110
+ };
111
+ }
112
+ }
113
+ });
114
+ /** @internal */
115
+ export const stdout = /*#__PURE__*/dual(2, (self, output) => {
116
+ switch (self._tag) {
117
+ case "StandardCommand":
118
+ {
119
+ return {
120
+ ...self,
121
+ stdout: output
122
+ };
123
+ }
124
+ // For piped commands it only makes sense to provide `stderr` for the
125
+ // right-most command as the rest will be piped in.
126
+ case "PipedCommand":
127
+ {
128
+ return {
129
+ ...self,
130
+ right: stdout(self.right, output)
131
+ };
132
+ }
133
+ }
134
+ });
135
+ /** @internal */
136
+ export const start = command => Effect.flatMap(commandExecutor.CommandExecutor, executor => executor.start(command));
137
+ /** @internal */
138
+ export const stream = command => Stream.flatMap(commandExecutor.CommandExecutor, process => process.stream(command));
139
+ /** @internal */
140
+ export const streamLines = command => Stream.flatMap(commandExecutor.CommandExecutor, process => process.streamLines(command));
141
+ /** @internal */
142
+ export const string = /*#__PURE__*/dual(args => isCommand(args[0]), (command, encoding) => Effect.flatMap(commandExecutor.CommandExecutor, executor => executor.string(command, encoding)));
143
+ /** @internal */
144
+ export const workingDirectory = /*#__PURE__*/dual(2, (self, cwd) => {
145
+ switch (self._tag) {
146
+ case "StandardCommand":
147
+ {
148
+ return {
149
+ ...self,
150
+ cwd: Option.some(cwd)
151
+ };
152
+ }
153
+ case "PipedCommand":
154
+ {
155
+ return pipeTo(workingDirectory(self.left, cwd), workingDirectory(self.right, cwd));
156
+ }
157
+ }
158
+ });
159
+ //# sourceMappingURL=command.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.mjs","names":["Chunk","dual","HashMap","Option","Effect","commandExecutor","Stream","CommandTypeId","Symbol","for","isCommand","u","env","self","environment","_tag","union","fromIterable","Object","entries","pipeTo","left","right","exitCode","flatMap","CommandExecutor","executor","feed","input","stdin","fromChunk","of","TextEncoder","encode","flatten","Array","from","flattenLoop","appendAll","lines","command","encoding","make","args","empty","cwd","none","some","stdout","stderr","gid","uid","into","output","start","stream","process","streamLines","string","workingDirectory"],"sources":["../../src/internal/command.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,oBAAoB;AAC3C,SAASC,IAAI,QAAQ,uBAAuB;AAC5C,OAAO,KAAKC,OAAO,MAAM,sBAAsB;AAC/C,OAAO,KAAKC,MAAM,MAAM,qBAAqB;AAE7C,OAAO,KAAKC,MAAM,MAAM,mBAAmB;AAI3C,OAAO,KAAKC,eAAe,MAAM,2CAA2C;AAC5E,OAAO,KAAKC,MAAM,MAAM,uBAAuB;AAE/C;AACA,OAAO,MAAMC,aAAa,gBAA0BC,MAAM,CAACC,GAAG,CAAC,0BAA0B,CAA0B;AAEnH;AACA,OAAO,MAAMC,SAAS,GAAIC,CAA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