@confect/cli 1.0.0-next.1 → 1.0.0-next.2
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/CHANGELOG.md +10 -0
- package/dist/FunctionPaths.mjs +3 -3
- package/dist/FunctionPaths.mjs.map +1 -1
- package/dist/cliApp.mjs +1 -1
- package/dist/confect/dev.mjs.map +1 -1
- package/dist/index.mjs +2 -3
- package/dist/index.mjs.map +1 -1
- package/dist/package.mjs +6 -0
- package/dist/package.mjs.map +1 -0
- package/dist/services/ProjectRoot.mjs +2 -2
- package/dist/services/ProjectRoot.mjs.map +1 -1
- package/dist/utils.mjs +7 -7
- package/dist/utils.mjs.map +1 -1
- package/package.json +21 -18
- package/dist/_virtual/rolldown_runtime.mjs +0 -28
- package/dist/node_modules/.pnpm/@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/NodeCommandExecutor.mjs +0 -12
- package/dist/node_modules/.pnpm/@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/NodeCommandExecutor.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/NodeFileSystem.mjs +0 -15
- package/dist/node_modules/.pnpm/@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/NodeFileSystem.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/NodePath.mjs +0 -25
- package/dist/node_modules/.pnpm/@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/NodePath.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/NodeRuntime.mjs +0 -12
- package/dist/node_modules/.pnpm/@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/NodeRuntime.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/NodeTerminal.mjs +0 -17
- package/dist/node_modules/.pnpm/@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/NodeTerminal.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/internal/commandExecutor.mjs +0 -129
- package/dist/node_modules/.pnpm/@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/internal/commandExecutor.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/internal/error.mjs +0 -43
- package/dist/node_modules/.pnpm/@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/internal/error.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/internal/fileSystem.mjs +0 -329
- package/dist/node_modules/.pnpm/@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/internal/fileSystem.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/internal/path.mjs +0 -51
- package/dist/node_modules/.pnpm/@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/internal/path.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/internal/runtime.mjs +0 -31
- package/dist/node_modules/.pnpm/@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/internal/runtime.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/internal/sink.mjs +0 -24
- package/dist/node_modules/.pnpm/@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/internal/sink.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/internal/stream.mjs +0 -91
- package/dist/node_modules/.pnpm/@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/internal/stream.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/internal/terminal.mjs +0 -75
- package/dist/node_modules/.pnpm/@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/internal/terminal.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@effect_platform-node@0.100.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effect@3.1_a15ca1802d939cd85cc564105ef862ac/node_modules/@effect/platform-node/dist/esm/NodeContext.mjs +0 -21
- package/dist/node_modules/.pnpm/@effect_platform-node@0.100.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effect@3.1_a15ca1802d939cd85cc564105ef862ac/node_modules/@effect/platform-node/dist/esm/NodeContext.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@effect_platform-node@0.100.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effect@3.1_a15ca1802d939cd85cc564105ef862ac/node_modules/@effect/platform-node/dist/esm/NodeFileSystem.mjs +0 -15
- package/dist/node_modules/.pnpm/@effect_platform-node@0.100.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effect@3.1_a15ca1802d939cd85cc564105ef862ac/node_modules/@effect/platform-node/dist/esm/NodeFileSystem.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@effect_platform-node@0.100.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effect@3.1_a15ca1802d939cd85cc564105ef862ac/node_modules/@effect/platform-node/dist/esm/NodeRuntime.mjs +0 -15
- package/dist/node_modules/.pnpm/@effect_platform-node@0.100.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effect@3.1_a15ca1802d939cd85cc564105ef862ac/node_modules/@effect/platform-node/dist/esm/NodeRuntime.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@effect_platform-node@0.100.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effect@3.1_a15ca1802d939cd85cc564105ef862ac/node_modules/@effect/platform-node/dist/esm/NodeWorker.mjs +0 -27
- package/dist/node_modules/.pnpm/@effect_platform-node@0.100.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effect@3.1_a15ca1802d939cd85cc564105ef862ac/node_modules/@effect/platform-node/dist/esm/NodeWorker.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@effect_platform-node@0.100.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effect@3.1_a15ca1802d939cd85cc564105ef862ac/node_modules/@effect/platform-node/dist/esm/internal/worker.mjs +0 -71
- package/dist/node_modules/.pnpm/@effect_platform-node@0.100.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effect@3.1_a15ca1802d939cd85cc564105ef862ac/node_modules/@effect/platform-node/dist/esm/internal/worker.mjs.map +0 -1
- package/dist/packages/cli/package.mjs +0 -6
- package/dist/packages/cli/package.mjs.map +0 -1
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import * as Effect from "effect/Effect";
|
|
2
|
-
import * as Layer from "effect/Layer";
|
|
3
|
-
import { BadArgument } from "@effect/platform/Error";
|
|
4
|
-
import * as NodePath from "node:path";
|
|
5
|
-
import * as NodeUrl from "node:url";
|
|
6
|
-
import { Path, TypeId } from "@effect/platform/Path";
|
|
7
|
-
|
|
8
|
-
//#region ../../node_modules/.pnpm/@effect+platform-node-shared@0.53.0_@effect+cluster@0.52.9_@effect+platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/internal/path.js
|
|
9
|
-
const fromFileUrl = (url) => Effect.try({
|
|
10
|
-
try: () => NodeUrl.fileURLToPath(url),
|
|
11
|
-
catch: (error) => new BadArgument({
|
|
12
|
-
module: "Path",
|
|
13
|
-
method: "fromFileUrl",
|
|
14
|
-
description: `Invalid file URL: ${url}`,
|
|
15
|
-
cause: error
|
|
16
|
-
})
|
|
17
|
-
});
|
|
18
|
-
const toFileUrl = (path) => Effect.try({
|
|
19
|
-
try: () => NodeUrl.pathToFileURL(path),
|
|
20
|
-
catch: (error) => new BadArgument({
|
|
21
|
-
module: "Path",
|
|
22
|
-
method: "toFileUrl",
|
|
23
|
-
description: `Invalid path: ${path}`,
|
|
24
|
-
cause: error
|
|
25
|
-
})
|
|
26
|
-
});
|
|
27
|
-
/** @internal */
|
|
28
|
-
const layerPosix = /* @__PURE__ */ Layer.succeed(Path, /* @__PURE__ */ Path.of({
|
|
29
|
-
[TypeId]: TypeId,
|
|
30
|
-
...NodePath.posix,
|
|
31
|
-
fromFileUrl,
|
|
32
|
-
toFileUrl
|
|
33
|
-
}));
|
|
34
|
-
/** @internal */
|
|
35
|
-
const layerWin32 = /* @__PURE__ */ Layer.succeed(Path, /* @__PURE__ */ Path.of({
|
|
36
|
-
[TypeId]: TypeId,
|
|
37
|
-
...NodePath.win32,
|
|
38
|
-
fromFileUrl,
|
|
39
|
-
toFileUrl
|
|
40
|
-
}));
|
|
41
|
-
/** @internal */
|
|
42
|
-
const layer = /* @__PURE__ */ Layer.succeed(Path, /* @__PURE__ */ Path.of({
|
|
43
|
-
[TypeId]: TypeId,
|
|
44
|
-
...NodePath,
|
|
45
|
-
fromFileUrl,
|
|
46
|
-
toFileUrl
|
|
47
|
-
}));
|
|
48
|
-
|
|
49
|
-
//#endregion
|
|
50
|
-
export { layer, layerPosix, layerWin32 };
|
|
51
|
-
//# sourceMappingURL=path.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"path.mjs","names":[],"sources":["../../../../../../../../../../../../node_modules/.pnpm/@effect+platform-node-shared@0.53.0_@effect+cluster@0.52.9_@effect+platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/internal/path.js"],"sourcesContent":["import { BadArgument } from \"@effect/platform/Error\";\nimport { Path, TypeId } from \"@effect/platform/Path\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as NodePath from \"node:path\";\nimport * as NodeUrl from \"node:url\";\nconst fromFileUrl = url => Effect.try({\n try: () => NodeUrl.fileURLToPath(url),\n catch: error => new BadArgument({\n module: \"Path\",\n method: \"fromFileUrl\",\n description: `Invalid file URL: ${url}`,\n cause: error\n })\n});\nconst toFileUrl = path => Effect.try({\n try: () => NodeUrl.pathToFileURL(path),\n catch: error => new BadArgument({\n module: \"Path\",\n method: \"toFileUrl\",\n description: `Invalid path: ${path}`,\n cause: error\n })\n});\n/** @internal */\nexport const layerPosix = /*#__PURE__*/Layer.succeed(Path, /*#__PURE__*/Path.of({\n [TypeId]: TypeId,\n ...NodePath.posix,\n fromFileUrl,\n toFileUrl\n}));\n/** @internal */\nexport const layerWin32 = /*#__PURE__*/Layer.succeed(Path, /*#__PURE__*/Path.of({\n [TypeId]: TypeId,\n ...NodePath.win32,\n fromFileUrl,\n toFileUrl\n}));\n/** @internal */\nexport const layer = /*#__PURE__*/Layer.succeed(Path, /*#__PURE__*/Path.of({\n [TypeId]: TypeId,\n ...NodePath,\n fromFileUrl,\n toFileUrl\n}));\n//# sourceMappingURL=path.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;AAMA,MAAM,eAAc,QAAO,OAAO,IAAI;CACpC,WAAW,QAAQ,cAAc,IAAI;CACrC,QAAO,UAAS,IAAI,YAAY;EAC9B,QAAQ;EACR,QAAQ;EACR,aAAa,qBAAqB;EAClC,OAAO;EACR,CAAC;CACH,CAAC;AACF,MAAM,aAAY,SAAQ,OAAO,IAAI;CACnC,WAAW,QAAQ,cAAc,KAAK;CACtC,QAAO,UAAS,IAAI,YAAY;EAC9B,QAAQ;EACR,QAAQ;EACR,aAAa,iBAAiB;EAC9B,OAAO;EACR,CAAC;CACH,CAAC;;AAEF,MAAa,aAA0B,sBAAM,QAAQ,MAAmB,qBAAK,GAAG;EAC7E,SAAS;CACV,GAAG,SAAS;CACZ;CACA;CACD,CAAC,CAAC;;AAEH,MAAa,aAA0B,sBAAM,QAAQ,MAAmB,qBAAK,GAAG;EAC7E,SAAS;CACV,GAAG,SAAS;CACZ;CACA;CACD,CAAC,CAAC;;AAEH,MAAa,QAAqB,sBAAM,QAAQ,MAAmB,qBAAK,GAAG;EACxE,SAAS;CACV,GAAG;CACH;CACA;CACD,CAAC,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { constVoid } from "effect/Function";
|
|
2
|
-
import { makeRunMain } from "@effect/platform/Runtime";
|
|
3
|
-
|
|
4
|
-
//#region ../../node_modules/.pnpm/@effect+platform-node-shared@0.53.0_@effect+cluster@0.52.9_@effect+platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/internal/runtime.js
|
|
5
|
-
/** @internal */
|
|
6
|
-
const runMain = /* @__PURE__ */ makeRunMain(({ fiber, teardown }) => {
|
|
7
|
-
const keepAlive = setInterval(constVoid, 2 ** 31 - 1);
|
|
8
|
-
let receivedSignal = false;
|
|
9
|
-
fiber.addObserver((exit) => {
|
|
10
|
-
if (!receivedSignal) {
|
|
11
|
-
process.removeListener("SIGINT", onSigint);
|
|
12
|
-
process.removeListener("SIGTERM", onSigint);
|
|
13
|
-
}
|
|
14
|
-
clearInterval(keepAlive);
|
|
15
|
-
teardown(exit, (code) => {
|
|
16
|
-
if (receivedSignal || code !== 0) process.exit(code);
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
function onSigint() {
|
|
20
|
-
receivedSignal = true;
|
|
21
|
-
process.removeListener("SIGINT", onSigint);
|
|
22
|
-
process.removeListener("SIGTERM", onSigint);
|
|
23
|
-
fiber.unsafeInterruptAsFork(fiber.id());
|
|
24
|
-
}
|
|
25
|
-
process.on("SIGINT", onSigint);
|
|
26
|
-
process.on("SIGTERM", onSigint);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
//#endregion
|
|
30
|
-
export { runMain };
|
|
31
|
-
//# sourceMappingURL=runtime.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.mjs","names":[],"sources":["../../../../../../../../../../../../node_modules/.pnpm/@effect+platform-node-shared@0.53.0_@effect+cluster@0.52.9_@effect+platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/internal/runtime.js"],"sourcesContent":["import { makeRunMain } from \"@effect/platform/Runtime\";\nimport { constVoid } from \"effect/Function\";\n/** @internal */\nexport const runMain = /*#__PURE__*/makeRunMain(({\n fiber,\n teardown\n}) => {\n const keepAlive = setInterval(constVoid, 2 ** 31 - 1);\n let receivedSignal = false;\n fiber.addObserver(exit => {\n if (!receivedSignal) {\n process.removeListener(\"SIGINT\", onSigint);\n process.removeListener(\"SIGTERM\", onSigint);\n }\n clearInterval(keepAlive);\n teardown(exit, code => {\n if (receivedSignal || code !== 0) {\n process.exit(code);\n }\n });\n });\n function onSigint() {\n receivedSignal = true;\n process.removeListener(\"SIGINT\", onSigint);\n process.removeListener(\"SIGTERM\", onSigint);\n fiber.unsafeInterruptAsFork(fiber.id());\n }\n process.on(\"SIGINT\", onSigint);\n process.on(\"SIGTERM\", onSigint);\n});\n//# sourceMappingURL=runtime.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;AAGA,MAAa,UAAuB,6BAAa,EAC/C,OACA,eACI;CACJ,MAAM,YAAY,YAAY,WAAW,KAAK,KAAK,EAAE;CACrD,IAAI,iBAAiB;AACrB,OAAM,aAAY,SAAQ;AACxB,MAAI,CAAC,gBAAgB;AACnB,WAAQ,eAAe,UAAU,SAAS;AAC1C,WAAQ,eAAe,WAAW,SAAS;;AAE7C,gBAAc,UAAU;AACxB,WAAS,OAAM,SAAQ;AACrB,OAAI,kBAAkB,SAAS,EAC7B,SAAQ,KAAK,KAAK;IAEpB;GACF;CACF,SAAS,WAAW;AAClB,mBAAiB;AACjB,UAAQ,eAAe,UAAU,SAAS;AAC1C,UAAQ,eAAe,WAAW,SAAS;AAC3C,QAAM,sBAAsB,MAAM,IAAI,CAAC;;AAEzC,SAAQ,GAAG,UAAU,SAAS;AAC9B,SAAQ,GAAG,WAAW,SAAS;EAC/B"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { writeInput } from "./stream.mjs";
|
|
2
|
-
import * as Effect from "effect/Effect";
|
|
3
|
-
import * as Deferred from "effect/Deferred";
|
|
4
|
-
import * as Channel from "effect/Channel";
|
|
5
|
-
import * as Sink from "effect/Sink";
|
|
6
|
-
|
|
7
|
-
//#region ../../node_modules/.pnpm/@effect+platform-node-shared@0.53.0_@effect+cluster@0.52.9_@effect+platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/internal/sink.js
|
|
8
|
-
/** @internal */
|
|
9
|
-
const fromWritable = (evaluate, onError, options) => Sink.fromChannel(fromWritableChannel(evaluate, onError, options));
|
|
10
|
-
/** @internal */
|
|
11
|
-
const fromWritableChannel = (writable, onError, options) => Channel.flatMap(Effect.zip(Effect.sync(() => writable()), Deferred.make()), ([writable$1, deferred]) => Channel.embedInput(writableOutput(writable$1, deferred, onError), writeInput(writable$1, (cause) => Deferred.failCause(deferred, cause), options, Deferred.complete(deferred, Effect.void))));
|
|
12
|
-
const writableOutput = (writable, deferred, onError) => Effect.suspend(() => {
|
|
13
|
-
function handleError(err) {
|
|
14
|
-
Deferred.unsafeDone(deferred, Effect.fail(onError(err)));
|
|
15
|
-
}
|
|
16
|
-
writable.on("error", handleError);
|
|
17
|
-
return Effect.ensuring(Deferred.await(deferred), Effect.sync(() => {
|
|
18
|
-
writable.removeListener("error", handleError);
|
|
19
|
-
}));
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
//#endregion
|
|
23
|
-
export { fromWritable };
|
|
24
|
-
//# sourceMappingURL=sink.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sink.mjs","names":["writable"],"sources":["../../../../../../../../../../../../node_modules/.pnpm/@effect+platform-node-shared@0.53.0_@effect+cluster@0.52.9_@effect+platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/internal/sink.js"],"sourcesContent":["import * as Channel from \"effect/Channel\";\nimport * as Deferred from \"effect/Deferred\";\nimport * as Effect from \"effect/Effect\";\nimport * as Sink from \"effect/Sink\";\nimport { writeInput } from \"./stream.js\";\n/** @internal */\nexport const fromWritable = (evaluate, onError, options) => Sink.fromChannel(fromWritableChannel(evaluate, onError, options));\n/** @internal */\nexport const fromWritableChannel = (writable, onError, options) => Channel.flatMap(Effect.zip(Effect.sync(() => writable()), Deferred.make()), ([writable, deferred]) => Channel.embedInput(writableOutput(writable, deferred, onError), writeInput(writable, cause => Deferred.failCause(deferred, cause), options, Deferred.complete(deferred, Effect.void))));\nconst writableOutput = (writable, deferred, onError) => Effect.suspend(() => {\n function handleError(err) {\n Deferred.unsafeDone(deferred, Effect.fail(onError(err)));\n }\n writable.on(\"error\", handleError);\n return Effect.ensuring(Deferred.await(deferred), Effect.sync(() => {\n writable.removeListener(\"error\", handleError);\n }));\n});\n//# sourceMappingURL=sink.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;AAMA,MAAa,gBAAgB,UAAU,SAAS,YAAY,KAAK,YAAY,oBAAoB,UAAU,SAAS,QAAQ,CAAC;;AAE7H,MAAa,uBAAuB,UAAU,SAAS,YAAY,QAAQ,QAAQ,OAAO,IAAI,OAAO,WAAW,UAAU,CAAC,EAAE,SAAS,MAAM,CAAC,GAAG,CAACA,YAAU,cAAc,QAAQ,WAAW,eAAeA,YAAU,UAAU,QAAQ,EAAE,WAAWA,aAAU,UAAS,SAAS,UAAU,UAAU,MAAM,EAAE,SAAS,SAAS,SAAS,UAAU,OAAO,KAAK,CAAC,CAAC,CAAC;AAChW,MAAM,kBAAkB,UAAU,UAAU,YAAY,OAAO,cAAc;CAC3E,SAAS,YAAY,KAAK;AACxB,WAAS,WAAW,UAAU,OAAO,KAAK,QAAQ,IAAI,CAAC,CAAC;;AAE1D,UAAS,GAAG,SAAS,YAAY;AACjC,QAAO,OAAO,SAAS,SAAS,MAAM,SAAS,EAAE,OAAO,WAAW;AACjE,WAAS,eAAe,SAAS,YAAY;GAC7C,CAAC;EACH"}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import "effect/Cause";
|
|
2
|
-
import * as Chunk from "effect/Chunk";
|
|
3
|
-
import * as Effect from "effect/Effect";
|
|
4
|
-
import * as Exit from "effect/Exit";
|
|
5
|
-
import "effect/Fiber";
|
|
6
|
-
import "effect/Function";
|
|
7
|
-
import "effect/Runtime";
|
|
8
|
-
import * as Stream from "effect/Stream";
|
|
9
|
-
import * as MutableRef from "effect/MutableRef";
|
|
10
|
-
import * as Channel from "effect/Channel";
|
|
11
|
-
import { SystemError } from "@effect/platform/Error";
|
|
12
|
-
|
|
13
|
-
//#region ../../node_modules/.pnpm/@effect+platform-node-shared@0.53.0_@effect+cluster@0.52.9_@effect+platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/internal/stream.js
|
|
14
|
-
/** @internal */
|
|
15
|
-
const fromReadable = (evaluate, onError, options) => Stream.fromChannel(fromReadableChannel(evaluate, onError, options));
|
|
16
|
-
/** @internal */
|
|
17
|
-
const fromReadableChannel = (evaluate, onError, options) => Channel.suspend(() => unsafeReadableRead(evaluate(), onError, MutableRef.make(void 0), options));
|
|
18
|
-
/** @internal */
|
|
19
|
-
const writeInput = (writable, onFailure, { encoding, endOnDone = true } = {}, onDone = Effect.void) => {
|
|
20
|
-
const write = writeEffect(writable, encoding);
|
|
21
|
-
const close = endOnDone ? Effect.async((resume) => {
|
|
22
|
-
if ("closed" in writable && writable.closed) resume(Effect.void);
|
|
23
|
-
else {
|
|
24
|
-
writable.once("finish", () => resume(Effect.void));
|
|
25
|
-
writable.end();
|
|
26
|
-
}
|
|
27
|
-
}) : Effect.void;
|
|
28
|
-
return {
|
|
29
|
-
awaitRead: () => Effect.void,
|
|
30
|
-
emit: write,
|
|
31
|
-
error: (cause) => Effect.zipRight(close, onFailure(cause)),
|
|
32
|
-
done: (_) => Effect.zipRight(close, onDone)
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
/** @internal */
|
|
36
|
-
const writeEffect = (writable, encoding) => (chunk) => chunk.length === 0 ? Effect.void : Effect.async((resume) => {
|
|
37
|
-
const iterator = chunk[Symbol.iterator]();
|
|
38
|
-
let next = iterator.next();
|
|
39
|
-
function loop() {
|
|
40
|
-
const item = next;
|
|
41
|
-
next = iterator.next();
|
|
42
|
-
const success = writable.write(item.value, encoding);
|
|
43
|
-
if (next.done) resume(Effect.void);
|
|
44
|
-
else if (success) loop();
|
|
45
|
-
else writable.once("drain", loop);
|
|
46
|
-
}
|
|
47
|
-
loop();
|
|
48
|
-
});
|
|
49
|
-
const unsafeReadableRead = (readable, onError, exit, options) => {
|
|
50
|
-
if (!readable.readable) return Channel.void;
|
|
51
|
-
const latch = Effect.unsafeMakeLatch(false);
|
|
52
|
-
function onReadable() {
|
|
53
|
-
latch.unsafeOpen();
|
|
54
|
-
}
|
|
55
|
-
function onErr(err) {
|
|
56
|
-
exit.current = Exit.fail(onError(err));
|
|
57
|
-
latch.unsafeOpen();
|
|
58
|
-
}
|
|
59
|
-
function onEnd() {
|
|
60
|
-
exit.current = Exit.void;
|
|
61
|
-
latch.unsafeOpen();
|
|
62
|
-
}
|
|
63
|
-
readable.on("readable", onReadable);
|
|
64
|
-
readable.on("error", onErr);
|
|
65
|
-
readable.on("end", onEnd);
|
|
66
|
-
const chunkSize = options?.chunkSize ? Number(options.chunkSize) : void 0;
|
|
67
|
-
const read = Channel.suspend(function loop() {
|
|
68
|
-
let item = readable.read(chunkSize);
|
|
69
|
-
if (item === null) {
|
|
70
|
-
if (exit.current) return Channel.fromEffect(exit.current);
|
|
71
|
-
latch.unsafeClose();
|
|
72
|
-
return Channel.flatMap(latch.await, loop);
|
|
73
|
-
}
|
|
74
|
-
const arr = [item];
|
|
75
|
-
while (true) {
|
|
76
|
-
item = readable.read(chunkSize);
|
|
77
|
-
if (item === null) return Channel.flatMap(Channel.write(Chunk.unsafeFromArray(arr)), loop);
|
|
78
|
-
arr.push(item);
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
return Channel.ensuring(read, Effect.sync(() => {
|
|
82
|
-
readable.off("readable", onReadable);
|
|
83
|
-
readable.off("error", onErr);
|
|
84
|
-
readable.off("end", onEnd);
|
|
85
|
-
if (options?.closeOnDone !== false && "closed" in readable && !readable.closed) readable.destroy();
|
|
86
|
-
}));
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
//#endregion
|
|
90
|
-
export { fromReadable, writeInput };
|
|
91
|
-
//# sourceMappingURL=stream.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stream.mjs","names":[],"sources":["../../../../../../../../../../../../node_modules/.pnpm/@effect+platform-node-shared@0.53.0_@effect+cluster@0.52.9_@effect+platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/internal/stream.js"],"sourcesContent":["import { SystemError } from \"@effect/platform/Error\";\nimport * as Cause from \"effect/Cause\";\nimport * as Channel from \"effect/Channel\";\nimport * as Chunk from \"effect/Chunk\";\nimport * as Effect from \"effect/Effect\";\nimport * as Exit from \"effect/Exit\";\nimport * as Fiber from \"effect/Fiber\";\nimport { dual } from \"effect/Function\";\nimport * as MutableRef from \"effect/MutableRef\";\nimport * as Runtime from \"effect/Runtime\";\nimport * as Stream from \"effect/Stream\";\nimport { Readable } from \"node:stream\";\n/** @internal */\nexport const fromReadable = (evaluate, onError, options) => Stream.fromChannel(fromReadableChannel(evaluate, onError, options));\n/** @internal */\nexport const toString = (readable, options) => {\n const maxBytesNumber = options.maxBytes ? Number(options.maxBytes) : undefined;\n return Effect.acquireUseRelease(Effect.sync(() => {\n const stream = readable();\n stream.setEncoding(options.encoding ?? \"utf8\");\n return stream;\n }), stream => Effect.async(resume => {\n let string = \"\";\n let bytes = 0;\n stream.once(\"error\", err => {\n resume(Effect.fail(options.onFailure(err)));\n });\n stream.once(\"end\", () => {\n resume(Effect.succeed(string));\n });\n stream.on(\"data\", chunk => {\n string += chunk;\n bytes += Buffer.byteLength(chunk);\n if (maxBytesNumber && bytes > maxBytesNumber) {\n resume(Effect.fail(options.onFailure(new Error(\"maxBytes exceeded\"))));\n }\n });\n }), stream => Effect.sync(() => {\n if (\"closed\" in stream && !stream.closed) {\n stream.destroy();\n }\n }));\n};\n/** @internal */\nexport const toUint8Array = (readable, options) => {\n const maxBytesNumber = options.maxBytes ? Number(options.maxBytes) : undefined;\n return Effect.acquireUseRelease(Effect.sync(readable), stream => Effect.async(resume => {\n let buffer = Buffer.alloc(0);\n let bytes = 0;\n stream.once(\"error\", err => {\n resume(Effect.fail(options.onFailure(err)));\n });\n stream.once(\"end\", () => {\n resume(Effect.succeed(buffer));\n });\n stream.on(\"data\", chunk => {\n buffer = Buffer.concat([buffer, chunk]);\n bytes += chunk.length;\n if (maxBytesNumber && bytes > maxBytesNumber) {\n resume(Effect.fail(options.onFailure(new Error(\"maxBytes exceeded\"))));\n }\n });\n }), stream => Effect.sync(() => {\n if (\"closed\" in stream && !stream.closed) {\n stream.destroy();\n }\n }));\n};\n/** @internal */\nexport const fromDuplex = (evaluate, onError, options) => Channel.suspend(() => {\n const duplex = evaluate();\n if (!duplex.readable) {\n return Channel.void;\n }\n const exit = MutableRef.make(undefined);\n return Channel.embedInput(unsafeReadableRead(duplex, onError, exit, options), writeInput(duplex, cause => Effect.sync(() => MutableRef.set(exit, Exit.failCause(cause))), options));\n});\n/** @internal */\nexport const pipeThroughDuplex = /*#__PURE__*/dual(args => Stream.StreamTypeId in args[0], (self, duplex, onError, options) => Stream.pipeThroughChannelOrFail(self, fromDuplex(duplex, onError, options)));\n/** @internal */\nexport const pipeThroughSimple = /*#__PURE__*/dual(2, (self, duplex) => Stream.pipeThroughChannelOrFail(self, fromDuplex(duplex, cause => new SystemError({\n module: \"Stream\",\n method: \"pipeThroughSimple\",\n reason: \"Unknown\",\n cause\n}))));\n/** @internal */\nexport const fromReadableChannel = (evaluate, onError, options) => Channel.suspend(() => unsafeReadableRead(evaluate(), onError, MutableRef.make(undefined), options));\n/** @internal */\nexport const writeInput = (writable, onFailure, {\n encoding,\n endOnDone = true\n} = {}, onDone = Effect.void) => {\n const write = writeEffect(writable, encoding);\n const close = endOnDone ? Effect.async(resume => {\n if (\"closed\" in writable && writable.closed) {\n resume(Effect.void);\n } else {\n writable.once(\"finish\", () => resume(Effect.void));\n writable.end();\n }\n }) : Effect.void;\n return {\n awaitRead: () => Effect.void,\n emit: write,\n error: cause => Effect.zipRight(close, onFailure(cause)),\n done: _ => Effect.zipRight(close, onDone)\n };\n};\n/** @internal */\nexport const writeEffect = (writable, encoding) => chunk => chunk.length === 0 ? Effect.void : Effect.async(resume => {\n const iterator = chunk[Symbol.iterator]();\n let next = iterator.next();\n function loop() {\n const item = next;\n next = iterator.next();\n const success = writable.write(item.value, encoding);\n if (next.done) {\n resume(Effect.void);\n } else if (success) {\n loop();\n } else {\n writable.once(\"drain\", loop);\n }\n }\n loop();\n});\nconst unsafeReadableRead = (readable, onError, exit, options) => {\n if (!readable.readable) {\n return Channel.void;\n }\n const latch = Effect.unsafeMakeLatch(false);\n function onReadable() {\n latch.unsafeOpen();\n }\n function onErr(err) {\n exit.current = Exit.fail(onError(err));\n latch.unsafeOpen();\n }\n function onEnd() {\n exit.current = Exit.void;\n latch.unsafeOpen();\n }\n readable.on(\"readable\", onReadable);\n readable.on(\"error\", onErr);\n readable.on(\"end\", onEnd);\n const chunkSize = options?.chunkSize ? Number(options.chunkSize) : undefined;\n const read = Channel.suspend(function loop() {\n let item = readable.read(chunkSize);\n if (item === null) {\n if (exit.current) {\n return Channel.fromEffect(exit.current);\n }\n latch.unsafeClose();\n return Channel.flatMap(latch.await, loop);\n }\n const arr = [item];\n while (true) {\n item = readable.read(chunkSize);\n if (item === null) {\n return Channel.flatMap(Channel.write(Chunk.unsafeFromArray(arr)), loop);\n }\n arr.push(item);\n }\n });\n return Channel.ensuring(read, Effect.sync(() => {\n readable.off(\"readable\", onReadable);\n readable.off(\"error\", onErr);\n readable.off(\"end\", onEnd);\n if (options?.closeOnDone !== false && \"closed\" in readable && !readable.closed) {\n readable.destroy();\n }\n }));\n};\nclass StreamAdapter extends Readable {\n readLatch;\n fiber = undefined;\n constructor(runtime, stream) {\n super({});\n this.readLatch = Effect.unsafeMakeLatch(false);\n this.fiber = Runtime.runFork(runtime)(this.readLatch.whenOpen(Stream.runForEachChunk(stream, chunk => this.readLatch.whenOpen(Effect.sync(() => {\n if (chunk.length === 0) return;\n this.readLatch.unsafeClose();\n for (const item of chunk) {\n if (typeof item === \"string\") {\n this.push(item, \"utf8\");\n } else {\n this.push(item);\n }\n }\n })))));\n this.fiber.addObserver(exit => {\n this.fiber = undefined;\n if (Exit.isSuccess(exit)) {\n this.push(null);\n } else {\n this.destroy(Cause.squash(exit.cause));\n }\n });\n }\n _read(_size) {\n this.readLatch.unsafeOpen();\n }\n _destroy(error, callback) {\n if (!this.fiber) {\n return callback(error);\n }\n Effect.runFork(Fiber.interrupt(this.fiber)).addObserver(exit => {\n callback(exit._tag === \"Failure\" ? Cause.squash(exit.cause) : error);\n });\n }\n}\n/** @internal */\nexport const toReadable = stream => Effect.map(Effect.runtime(), runtime => new StreamAdapter(runtime, stream));\n/** @internal */\nexport const toReadableNever = stream => new StreamAdapter(Runtime.defaultRuntime, stream);\n//# sourceMappingURL=stream.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;AAaA,MAAa,gBAAgB,UAAU,SAAS,YAAY,OAAO,YAAY,oBAAoB,UAAU,SAAS,QAAQ,CAAC;;AA0E/H,MAAa,uBAAuB,UAAU,SAAS,YAAY,QAAQ,cAAc,mBAAmB,UAAU,EAAE,SAAS,WAAW,KAAK,OAAU,EAAE,QAAQ,CAAC;;AAEtK,MAAa,cAAc,UAAU,WAAW,EAC9C,UACA,YAAY,SACV,EAAE,EAAE,SAAS,OAAO,SAAS;CAC/B,MAAM,QAAQ,YAAY,UAAU,SAAS;CAC7C,MAAM,QAAQ,YAAY,OAAO,OAAM,WAAU;AAC/C,MAAI,YAAY,YAAY,SAAS,OACnC,QAAO,OAAO,KAAK;OACd;AACL,YAAS,KAAK,gBAAgB,OAAO,OAAO,KAAK,CAAC;AAClD,YAAS,KAAK;;GAEhB,GAAG,OAAO;AACZ,QAAO;EACL,iBAAiB,OAAO;EACxB,MAAM;EACN,QAAO,UAAS,OAAO,SAAS,OAAO,UAAU,MAAM,CAAC;EACxD,OAAM,MAAK,OAAO,SAAS,OAAO,OAAO;EAC1C;;;AAGH,MAAa,eAAe,UAAU,cAAa,UAAS,MAAM,WAAW,IAAI,OAAO,OAAO,OAAO,OAAM,WAAU;CACpH,MAAM,WAAW,MAAM,OAAO,WAAW;CACzC,IAAI,OAAO,SAAS,MAAM;CAC1B,SAAS,OAAO;EACd,MAAM,OAAO;AACb,SAAO,SAAS,MAAM;EACtB,MAAM,UAAU,SAAS,MAAM,KAAK,OAAO,SAAS;AACpD,MAAI,KAAK,KACP,QAAO,OAAO,KAAK;WACV,QACT,OAAM;MAEN,UAAS,KAAK,SAAS,KAAK;;AAGhC,OAAM;EACN;AACF,MAAM,sBAAsB,UAAU,SAAS,MAAM,YAAY;AAC/D,KAAI,CAAC,SAAS,SACZ,QAAO,QAAQ;CAEjB,MAAM,QAAQ,OAAO,gBAAgB,MAAM;CAC3C,SAAS,aAAa;AACpB,QAAM,YAAY;;CAEpB,SAAS,MAAM,KAAK;AAClB,OAAK,UAAU,KAAK,KAAK,QAAQ,IAAI,CAAC;AACtC,QAAM,YAAY;;CAEpB,SAAS,QAAQ;AACf,OAAK,UAAU,KAAK;AACpB,QAAM,YAAY;;AAEpB,UAAS,GAAG,YAAY,WAAW;AACnC,UAAS,GAAG,SAAS,MAAM;AAC3B,UAAS,GAAG,OAAO,MAAM;CACzB,MAAM,YAAY,SAAS,YAAY,OAAO,QAAQ,UAAU,GAAG;CACnE,MAAM,OAAO,QAAQ,QAAQ,SAAS,OAAO;EAC3C,IAAI,OAAO,SAAS,KAAK,UAAU;AACnC,MAAI,SAAS,MAAM;AACjB,OAAI,KAAK,QACP,QAAO,QAAQ,WAAW,KAAK,QAAQ;AAEzC,SAAM,aAAa;AACnB,UAAO,QAAQ,QAAQ,MAAM,OAAO,KAAK;;EAE3C,MAAM,MAAM,CAAC,KAAK;AAClB,SAAO,MAAM;AACX,UAAO,SAAS,KAAK,UAAU;AAC/B,OAAI,SAAS,KACX,QAAO,QAAQ,QAAQ,QAAQ,MAAM,MAAM,gBAAgB,IAAI,CAAC,EAAE,KAAK;AAEzE,OAAI,KAAK,KAAK;;GAEhB;AACF,QAAO,QAAQ,SAAS,MAAM,OAAO,WAAW;AAC9C,WAAS,IAAI,YAAY,WAAW;AACpC,WAAS,IAAI,SAAS,MAAM;AAC5B,WAAS,IAAI,OAAO,MAAM;AAC1B,MAAI,SAAS,gBAAgB,SAAS,YAAY,YAAY,CAAC,SAAS,OACtE,UAAS,SAAS;GAEpB,CAAC"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import * as Effect from "effect/Effect";
|
|
2
|
-
import * as Exit from "effect/Exit";
|
|
3
|
-
import * as Layer from "effect/Layer";
|
|
4
|
-
import * as Mailbox from "effect/Mailbox";
|
|
5
|
-
import * as Option from "effect/Option";
|
|
6
|
-
import * as Error from "@effect/platform/Error";
|
|
7
|
-
import * as Terminal from "@effect/platform/Terminal";
|
|
8
|
-
import * as RcRef from "effect/RcRef";
|
|
9
|
-
import * as readline from "node:readline";
|
|
10
|
-
|
|
11
|
-
//#region ../../node_modules/.pnpm/@effect+platform-node-shared@0.53.0_@effect+cluster@0.52.9_@effect+platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/internal/terminal.js
|
|
12
|
-
const defaultShouldQuit = (input) => input.key.ctrl && (input.key.name === "c" || input.key.name === "d");
|
|
13
|
-
/** @internal */
|
|
14
|
-
const make = /* @__PURE__ */ Effect.fnUntraced(function* (shouldQuit = defaultShouldQuit) {
|
|
15
|
-
const stdin = process.stdin;
|
|
16
|
-
const stdout = process.stdout;
|
|
17
|
-
const rlRef = yield* RcRef.make({ acquire: Effect.acquireRelease(Effect.sync(() => {
|
|
18
|
-
const rl = readline.createInterface({
|
|
19
|
-
input: stdin,
|
|
20
|
-
escapeCodeTimeout: 50
|
|
21
|
-
});
|
|
22
|
-
readline.emitKeypressEvents(stdin, rl);
|
|
23
|
-
if (stdin.isTTY) stdin.setRawMode(true);
|
|
24
|
-
return rl;
|
|
25
|
-
}), (rl) => Effect.sync(() => {
|
|
26
|
-
if (stdin.isTTY) stdin.setRawMode(false);
|
|
27
|
-
rl.close();
|
|
28
|
-
})) });
|
|
29
|
-
const columns = Effect.sync(() => stdout.columns ?? 0);
|
|
30
|
-
const readInput = Effect.gen(function* () {
|
|
31
|
-
yield* RcRef.get(rlRef);
|
|
32
|
-
const mailbox = yield* Mailbox.make();
|
|
33
|
-
const handleKeypress = (s, k) => {
|
|
34
|
-
const userInput = {
|
|
35
|
-
input: Option.fromNullable(s),
|
|
36
|
-
key: {
|
|
37
|
-
name: k.name ?? "",
|
|
38
|
-
ctrl: !!k.ctrl,
|
|
39
|
-
meta: !!k.meta,
|
|
40
|
-
shift: !!k.shift
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
mailbox.unsafeOffer(userInput);
|
|
44
|
-
if (shouldQuit(userInput)) mailbox.unsafeDone(Exit.void);
|
|
45
|
-
};
|
|
46
|
-
yield* Effect.addFinalizer(() => Effect.sync(() => stdin.off("keypress", handleKeypress)));
|
|
47
|
-
stdin.on("keypress", handleKeypress);
|
|
48
|
-
return mailbox;
|
|
49
|
-
});
|
|
50
|
-
const readLine = RcRef.get(rlRef).pipe(Effect.flatMap((readlineInterface) => Effect.async((resume) => {
|
|
51
|
-
const onLine = (line) => resume(Effect.succeed(line));
|
|
52
|
-
readlineInterface.once("line", onLine);
|
|
53
|
-
return Effect.sync(() => readlineInterface.off("line", onLine));
|
|
54
|
-
})), Effect.scoped);
|
|
55
|
-
const display = (prompt) => Effect.uninterruptible(Effect.async((resume) => {
|
|
56
|
-
stdout.write(prompt, (err) => err ? resume(Effect.fail(new Error.BadArgument({
|
|
57
|
-
module: "Terminal",
|
|
58
|
-
method: "display",
|
|
59
|
-
description: "Failed to write prompt to stdout",
|
|
60
|
-
cause: err
|
|
61
|
-
}))) : resume(Effect.void));
|
|
62
|
-
}));
|
|
63
|
-
return Terminal.Terminal.of({
|
|
64
|
-
columns,
|
|
65
|
-
readInput,
|
|
66
|
-
readLine,
|
|
67
|
-
display
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
/** @internal */
|
|
71
|
-
const layer = /* @__PURE__ */ Layer.scoped(Terminal.Terminal, /* @__PURE__ */ make(defaultShouldQuit));
|
|
72
|
-
|
|
73
|
-
//#endregion
|
|
74
|
-
export { layer, make };
|
|
75
|
-
//# sourceMappingURL=terminal.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"terminal.mjs","names":[],"sources":["../../../../../../../../../../../../node_modules/.pnpm/@effect+platform-node-shared@0.53.0_@effect+cluster@0.52.9_@effect+platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/internal/terminal.js"],"sourcesContent":["import * as Error from \"@effect/platform/Error\";\nimport * as Terminal from \"@effect/platform/Terminal\";\nimport * as Effect from \"effect/Effect\";\nimport * as Exit from \"effect/Exit\";\nimport * as Layer from \"effect/Layer\";\nimport * as Mailbox from \"effect/Mailbox\";\nimport * as Option from \"effect/Option\";\nimport * as RcRef from \"effect/RcRef\";\nimport * as readline from \"node:readline\";\nconst defaultShouldQuit = input => input.key.ctrl && (input.key.name === \"c\" || input.key.name === \"d\");\n/** @internal */\nexport const make = /*#__PURE__*/Effect.fnUntraced(function* (shouldQuit = defaultShouldQuit) {\n const stdin = process.stdin;\n const stdout = process.stdout;\n // Acquire readline interface with TTY setup/cleanup inside the scope\n const rlRef = yield* RcRef.make({\n acquire: Effect.acquireRelease(Effect.sync(() => {\n const rl = readline.createInterface({\n input: stdin,\n escapeCodeTimeout: 50\n });\n readline.emitKeypressEvents(stdin, rl);\n if (stdin.isTTY) {\n stdin.setRawMode(true);\n }\n return rl;\n }), rl => Effect.sync(() => {\n if (stdin.isTTY) {\n stdin.setRawMode(false);\n }\n rl.close();\n }))\n });\n const columns = Effect.sync(() => stdout.columns ?? 0);\n const readInput = Effect.gen(function* () {\n yield* RcRef.get(rlRef);\n const mailbox = yield* Mailbox.make();\n const handleKeypress = (s, k) => {\n const userInput = {\n input: Option.fromNullable(s),\n key: {\n name: k.name ?? \"\",\n ctrl: !!k.ctrl,\n meta: !!k.meta,\n shift: !!k.shift\n }\n };\n mailbox.unsafeOffer(userInput);\n if (shouldQuit(userInput)) {\n mailbox.unsafeDone(Exit.void);\n }\n };\n yield* Effect.addFinalizer(() => Effect.sync(() => stdin.off(\"keypress\", handleKeypress)));\n stdin.on(\"keypress\", handleKeypress);\n return mailbox;\n });\n const readLine = RcRef.get(rlRef).pipe(Effect.flatMap(readlineInterface => Effect.async(resume => {\n const onLine = line => resume(Effect.succeed(line));\n readlineInterface.once(\"line\", onLine);\n return Effect.sync(() => readlineInterface.off(\"line\", onLine));\n })), Effect.scoped);\n const display = prompt => Effect.uninterruptible(Effect.async(resume => {\n stdout.write(prompt, err => err ? resume(Effect.fail(new Error.BadArgument({\n module: \"Terminal\",\n method: \"display\",\n description: \"Failed to write prompt to stdout\",\n cause: err\n }))) : resume(Effect.void));\n }));\n return Terminal.Terminal.of({\n columns,\n readInput,\n readLine,\n display\n });\n});\n/** @internal */\nexport const layer = /*#__PURE__*/Layer.scoped(Terminal.Terminal, /*#__PURE__*/make(defaultShouldQuit));\n//# sourceMappingURL=terminal.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;AASA,MAAM,qBAAoB,UAAS,MAAM,IAAI,SAAS,MAAM,IAAI,SAAS,OAAO,MAAM,IAAI,SAAS;;AAEnG,MAAa,OAAoB,uBAAO,WAAW,WAAW,aAAa,mBAAmB;CAC5F,MAAM,QAAQ,QAAQ;CACtB,MAAM,SAAS,QAAQ;CAEvB,MAAM,QAAQ,OAAO,MAAM,KAAK,EAC9B,SAAS,OAAO,eAAe,OAAO,WAAW;EAC/C,MAAM,KAAK,SAAS,gBAAgB;GAClC,OAAO;GACP,mBAAmB;GACpB,CAAC;AACF,WAAS,mBAAmB,OAAO,GAAG;AACtC,MAAI,MAAM,MACR,OAAM,WAAW,KAAK;AAExB,SAAO;GACP,GAAE,OAAM,OAAO,WAAW;AAC1B,MAAI,MAAM,MACR,OAAM,WAAW,MAAM;AAEzB,KAAG,OAAO;GACV,CAAC,EACJ,CAAC;CACF,MAAM,UAAU,OAAO,WAAW,OAAO,WAAW,EAAE;CACtD,MAAM,YAAY,OAAO,IAAI,aAAa;AACxC,SAAO,MAAM,IAAI,MAAM;EACvB,MAAM,UAAU,OAAO,QAAQ,MAAM;EACrC,MAAM,kBAAkB,GAAG,MAAM;GAC/B,MAAM,YAAY;IAChB,OAAO,OAAO,aAAa,EAAE;IAC7B,KAAK;KACH,MAAM,EAAE,QAAQ;KAChB,MAAM,CAAC,CAAC,EAAE;KACV,MAAM,CAAC,CAAC,EAAE;KACV,OAAO,CAAC,CAAC,EAAE;KACZ;IACF;AACD,WAAQ,YAAY,UAAU;AAC9B,OAAI,WAAW,UAAU,CACvB,SAAQ,WAAW,KAAK,KAAK;;AAGjC,SAAO,OAAO,mBAAmB,OAAO,WAAW,MAAM,IAAI,YAAY,eAAe,CAAC,CAAC;AAC1F,QAAM,GAAG,YAAY,eAAe;AACpC,SAAO;GACP;CACF,MAAM,WAAW,MAAM,IAAI,MAAM,CAAC,KAAK,OAAO,SAAQ,sBAAqB,OAAO,OAAM,WAAU;EAChG,MAAM,UAAS,SAAQ,OAAO,OAAO,QAAQ,KAAK,CAAC;AACnD,oBAAkB,KAAK,QAAQ,OAAO;AACtC,SAAO,OAAO,WAAW,kBAAkB,IAAI,QAAQ,OAAO,CAAC;GAC/D,CAAC,EAAE,OAAO,OAAO;CACnB,MAAM,WAAU,WAAU,OAAO,gBAAgB,OAAO,OAAM,WAAU;AACtE,SAAO,MAAM,SAAQ,QAAO,MAAM,OAAO,OAAO,KAAK,IAAI,MAAM,YAAY;GACzE,QAAQ;GACR,QAAQ;GACR,aAAa;GACb,OAAO;GACR,CAAC,CAAC,CAAC,GAAG,OAAO,OAAO,KAAK,CAAC;GAC3B,CAAC;AACH,QAAO,SAAS,SAAS,GAAG;EAC1B;EACA;EACA;EACA;EACD,CAAC;EACF;;AAEF,MAAa,QAAqB,sBAAM,OAAO,SAAS,UAAuB,qBAAK,kBAAkB,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { layer as layer$1 } from "../../../../../../@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/NodeFileSystem.mjs";
|
|
2
|
-
import { layer as layer$2 } from "../../../../../../@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/NodeCommandExecutor.mjs";
|
|
3
|
-
import { layer as layer$3 } from "../../../../../../@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/NodePath.mjs";
|
|
4
|
-
import { layer as layer$4 } from "../../../../../../@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/NodeTerminal.mjs";
|
|
5
|
-
import { layerManager } from "./NodeWorker.mjs";
|
|
6
|
-
import { pipe } from "effect/Function";
|
|
7
|
-
import * as Layer from "effect/Layer";
|
|
8
|
-
|
|
9
|
-
//#region ../../node_modules/.pnpm/@effect+platform-node@0.100.0_@effect+cluster@0.52.9_@effect+platform@0.93.2_effect@3.1_a15ca1802d939cd85cc564105ef862ac/node_modules/@effect/platform-node/dist/esm/NodeContext.js
|
|
10
|
-
/**
|
|
11
|
-
* @since 1.0.0
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* @since 1.0.0
|
|
15
|
-
* @category layer
|
|
16
|
-
*/
|
|
17
|
-
const layer = /* @__PURE__ */ pipe(/* @__PURE__ */ Layer.mergeAll(layer$3, layer$2, layer$4, layerManager), /* @__PURE__ */ Layer.provideMerge(layer$1));
|
|
18
|
-
|
|
19
|
-
//#endregion
|
|
20
|
-
export { layer };
|
|
21
|
-
//# sourceMappingURL=NodeContext.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NodeContext.mjs","names":["NodePath.layer","NodeCommandExecutor.layer","NodeTerminal.layer","NodeWorker.layerManager","NodeFileSystem.layer"],"sources":["../../../../../../../../../../../node_modules/.pnpm/@effect+platform-node@0.100.0_@effect+cluster@0.52.9_@effect+platform@0.93.2_effect@3.1_a15ca1802d939cd85cc564105ef862ac/node_modules/@effect/platform-node/dist/esm/NodeContext.js"],"sourcesContent":["/**\n * @since 1.0.0\n */\nimport * as NodeCommandExecutor from \"@effect/platform-node-shared/NodeCommandExecutor\";\nimport * as NodeFileSystem from \"@effect/platform-node-shared/NodeFileSystem\";\nimport * as NodePath from \"@effect/platform-node-shared/NodePath\";\nimport * as NodeTerminal from \"@effect/platform-node-shared/NodeTerminal\";\nimport { pipe } from \"effect/Function\";\nimport * as Layer from \"effect/Layer\";\nimport * as NodeWorker from \"./NodeWorker.js\";\n/**\n * @since 1.0.0\n * @category layer\n */\nexport const layer = /*#__PURE__*/pipe(/*#__PURE__*/Layer.mergeAll(NodePath.layer, NodeCommandExecutor.layer, NodeTerminal.layer, NodeWorker.layerManager), /*#__PURE__*/Layer.provideMerge(NodeFileSystem.layer));\n//# sourceMappingURL=NodeContext.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;AAcA,MAAa,QAAqB,qBAAkB,sBAAM,SAASA,SAAgBC,SAA2BC,SAAoBC,aAAwB,EAAe,sBAAM,aAAaC,QAAqB,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { layer as layer$1 } from "../../../../../../@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/NodeFileSystem.mjs";
|
|
2
|
-
|
|
3
|
-
//#region ../../node_modules/.pnpm/@effect+platform-node@0.100.0_@effect+cluster@0.52.9_@effect+platform@0.93.2_effect@3.1_a15ca1802d939cd85cc564105ef862ac/node_modules/@effect/platform-node/dist/esm/NodeFileSystem.js
|
|
4
|
-
/**
|
|
5
|
-
* @since 1.0.0
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* @since 1.0.0
|
|
9
|
-
* @category layer
|
|
10
|
-
*/
|
|
11
|
-
const layer = layer$1;
|
|
12
|
-
|
|
13
|
-
//#endregion
|
|
14
|
-
export { layer };
|
|
15
|
-
//# sourceMappingURL=NodeFileSystem.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NodeFileSystem.mjs","names":["NodeFileSystem.layer"],"sources":["../../../../../../../../../../../node_modules/.pnpm/@effect+platform-node@0.100.0_@effect+cluster@0.52.9_@effect+platform@0.93.2_effect@3.1_a15ca1802d939cd85cc564105ef862ac/node_modules/@effect/platform-node/dist/esm/NodeFileSystem.js"],"sourcesContent":["/**\n * @since 1.0.0\n */\nimport * as NodeFileSystem from \"@effect/platform-node-shared/NodeFileSystem\";\n/**\n * @since 1.0.0\n * @category layer\n */\nexport const layer = NodeFileSystem.layer;\n//# sourceMappingURL=NodeFileSystem.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;AAQA,MAAa,QAAQA"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { runMain as runMain$1 } from "../../../../../../@effect_platform-node-shared@0.53.0_@effect_cluster@0.52.9_@effect_platform@0.93.2_effe_e0eeb3aae5ffec3060feb87d17ffb17c/node_modules/@effect/platform-node-shared/dist/esm/NodeRuntime.mjs";
|
|
2
|
-
|
|
3
|
-
//#region ../../node_modules/.pnpm/@effect+platform-node@0.100.0_@effect+cluster@0.52.9_@effect+platform@0.93.2_effect@3.1_a15ca1802d939cd85cc564105ef862ac/node_modules/@effect/platform-node/dist/esm/NodeRuntime.js
|
|
4
|
-
/**
|
|
5
|
-
* @since 1.0.0
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* @since 1.0.0
|
|
9
|
-
* @category runtime
|
|
10
|
-
*/
|
|
11
|
-
const runMain = runMain$1;
|
|
12
|
-
|
|
13
|
-
//#endregion
|
|
14
|
-
export { runMain };
|
|
15
|
-
//# sourceMappingURL=NodeRuntime.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NodeRuntime.mjs","names":["NodeRuntime.runMain"],"sources":["../../../../../../../../../../../node_modules/.pnpm/@effect+platform-node@0.100.0_@effect+cluster@0.52.9_@effect+platform@0.93.2_effect@3.1_a15ca1802d939cd85cc564105ef862ac/node_modules/@effect/platform-node/dist/esm/NodeRuntime.js"],"sourcesContent":["/**\n * @since 1.0.0\n */\nimport * as NodeRuntime from \"@effect/platform-node-shared/NodeRuntime\";\n/**\n * @since 1.0.0\n * @category runtime\n */\nexport const runMain = NodeRuntime.runMain;\n//# sourceMappingURL=NodeRuntime.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;AAQA,MAAa,UAAUA"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { layer as layer$1, layerManager as layerManager$1, layerPlatform as layerPlatform$1, layerWorker as layerWorker$1 } from "./internal/worker.mjs";
|
|
2
|
-
|
|
3
|
-
//#region ../../node_modules/.pnpm/@effect+platform-node@0.100.0_@effect+cluster@0.52.9_@effect+platform@0.93.2_effect@3.1_a15ca1802d939cd85cc564105ef862ac/node_modules/@effect/platform-node/dist/esm/NodeWorker.js
|
|
4
|
-
/**
|
|
5
|
-
* @since 1.0.0
|
|
6
|
-
* @category layers
|
|
7
|
-
*/
|
|
8
|
-
const layerManager = layerManager$1;
|
|
9
|
-
/**
|
|
10
|
-
* @since 1.0.0
|
|
11
|
-
* @category layers
|
|
12
|
-
*/
|
|
13
|
-
const layerWorker = layerWorker$1;
|
|
14
|
-
/**
|
|
15
|
-
* @since 1.0.0
|
|
16
|
-
* @category layers
|
|
17
|
-
*/
|
|
18
|
-
const layer = layer$1;
|
|
19
|
-
/**
|
|
20
|
-
* @since 1.0.0
|
|
21
|
-
* @category layers
|
|
22
|
-
*/
|
|
23
|
-
const layerPlatform = layerPlatform$1;
|
|
24
|
-
|
|
25
|
-
//#endregion
|
|
26
|
-
export { layerManager };
|
|
27
|
-
//# sourceMappingURL=NodeWorker.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NodeWorker.mjs","names":["internal.layerManager","internal.layerWorker","internal.layer","internal.layerPlatform"],"sources":["../../../../../../../../../../../node_modules/.pnpm/@effect+platform-node@0.100.0_@effect+cluster@0.52.9_@effect+platform@0.93.2_effect@3.1_a15ca1802d939cd85cc564105ef862ac/node_modules/@effect/platform-node/dist/esm/NodeWorker.js"],"sourcesContent":["import * as internal from \"./internal/worker.js\";\n/**\n * @since 1.0.0\n * @category layers\n */\nexport const layerManager = internal.layerManager;\n/**\n * @since 1.0.0\n * @category layers\n */\nexport const layerWorker = internal.layerWorker;\n/**\n * @since 1.0.0\n * @category layers\n */\nexport const layer = internal.layer;\n/**\n * @since 1.0.0\n * @category layers\n */\nexport const layerPlatform = internal.layerPlatform;\n//# sourceMappingURL=NodeWorker.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;AAKA,MAAa,eAAeA;;;;;AAK5B,MAAa,cAAcC;;;;;AAK3B,MAAa,QAAQC;;;;;AAKrB,MAAa,gBAAgBC"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import * as Worker from "@effect/platform/Worker";
|
|
2
|
-
import * as Effect from "effect/Effect";
|
|
3
|
-
import * as Exit from "effect/Exit";
|
|
4
|
-
import * as Layer from "effect/Layer";
|
|
5
|
-
import * as Scope from "effect/Scope";
|
|
6
|
-
import * as Deferred from "effect/Deferred";
|
|
7
|
-
import { WorkerError } from "@effect/platform/WorkerError";
|
|
8
|
-
|
|
9
|
-
//#region ../../node_modules/.pnpm/@effect+platform-node@0.100.0_@effect+cluster@0.52.9_@effect+platform@0.93.2_effect@3.1_a15ca1802d939cd85cc564105ef862ac/node_modules/@effect/platform-node/dist/esm/internal/worker.js
|
|
10
|
-
const platformWorkerImpl = /* @__PURE__ */ Worker.makePlatform()({
|
|
11
|
-
setup({ scope, worker }) {
|
|
12
|
-
return Effect.flatMap(Deferred.make(), (exitDeferred) => {
|
|
13
|
-
const thing = "postMessage" in worker ? {
|
|
14
|
-
postMessage(msg, t) {
|
|
15
|
-
worker.postMessage(msg, t);
|
|
16
|
-
},
|
|
17
|
-
kill: () => worker.terminate(),
|
|
18
|
-
worker
|
|
19
|
-
} : {
|
|
20
|
-
postMessage(msg, _) {
|
|
21
|
-
worker.send(msg);
|
|
22
|
-
},
|
|
23
|
-
kill: () => worker.kill("SIGKILL"),
|
|
24
|
-
worker
|
|
25
|
-
};
|
|
26
|
-
worker.on("exit", () => {
|
|
27
|
-
Deferred.unsafeDone(exitDeferred, Exit.void);
|
|
28
|
-
});
|
|
29
|
-
return Effect.as(Scope.addFinalizer(scope, Effect.suspend(() => {
|
|
30
|
-
thing.postMessage([1]);
|
|
31
|
-
return Deferred.await(exitDeferred);
|
|
32
|
-
}).pipe(Effect.interruptible, Effect.timeout(5e3), Effect.catchAllCause(() => Effect.sync(() => thing.kill())))), thing);
|
|
33
|
-
});
|
|
34
|
-
},
|
|
35
|
-
listen({ deferred, emit, port }) {
|
|
36
|
-
port.worker.on("message", (message) => {
|
|
37
|
-
emit(message);
|
|
38
|
-
});
|
|
39
|
-
port.worker.on("messageerror", (cause) => {
|
|
40
|
-
Deferred.unsafeDone(deferred, new WorkerError({
|
|
41
|
-
reason: "decode",
|
|
42
|
-
cause
|
|
43
|
-
}));
|
|
44
|
-
});
|
|
45
|
-
port.worker.on("error", (cause) => {
|
|
46
|
-
Deferred.unsafeDone(deferred, new WorkerError({
|
|
47
|
-
reason: "unknown",
|
|
48
|
-
cause
|
|
49
|
-
}));
|
|
50
|
-
});
|
|
51
|
-
port.worker.on("exit", (code) => {
|
|
52
|
-
Deferred.unsafeDone(deferred, new WorkerError({
|
|
53
|
-
reason: "unknown",
|
|
54
|
-
cause: /* @__PURE__ */ new Error(`exited with code ${code}`)
|
|
55
|
-
}));
|
|
56
|
-
});
|
|
57
|
-
return Effect.void;
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
/** @internal */
|
|
61
|
-
const layerWorker = /* @__PURE__ */ Layer.succeed(Worker.PlatformWorker, platformWorkerImpl);
|
|
62
|
-
/** @internal */
|
|
63
|
-
const layerManager = /* @__PURE__ */ Layer.provide(Worker.layerManager, layerWorker);
|
|
64
|
-
/** @internal */
|
|
65
|
-
const layer = (spawn) => Layer.merge(layerManager, Worker.layerSpawner(spawn));
|
|
66
|
-
/** @internal */
|
|
67
|
-
const layerPlatform = (spawn) => Layer.merge(layerWorker, Worker.layerSpawner(spawn));
|
|
68
|
-
|
|
69
|
-
//#endregion
|
|
70
|
-
export { layer, layerManager, layerPlatform, layerWorker };
|
|
71
|
-
//# sourceMappingURL=worker.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"worker.mjs","names":[],"sources":["../../../../../../../../../../../../node_modules/.pnpm/@effect+platform-node@0.100.0_@effect+cluster@0.52.9_@effect+platform@0.93.2_effect@3.1_a15ca1802d939cd85cc564105ef862ac/node_modules/@effect/platform-node/dist/esm/internal/worker.js"],"sourcesContent":["import * as Worker from \"@effect/platform/Worker\";\nimport { WorkerError } from \"@effect/platform/WorkerError\";\nimport * as Deferred from \"effect/Deferred\";\nimport * as Effect from \"effect/Effect\";\nimport * as Exit from \"effect/Exit\";\nimport * as Layer from \"effect/Layer\";\nimport * as Scope from \"effect/Scope\";\nconst platformWorkerImpl = /*#__PURE__*/Worker.makePlatform()({\n setup({\n scope,\n worker\n }) {\n return Effect.flatMap(Deferred.make(), exitDeferred => {\n const thing = \"postMessage\" in worker ? {\n postMessage(msg, t) {\n worker.postMessage(msg, t);\n },\n kill: () => worker.terminate(),\n worker\n } : {\n postMessage(msg, _) {\n worker.send(msg);\n },\n kill: () => worker.kill(\"SIGKILL\"),\n worker\n };\n worker.on(\"exit\", () => {\n Deferred.unsafeDone(exitDeferred, Exit.void);\n });\n return Effect.as(Scope.addFinalizer(scope, Effect.suspend(() => {\n thing.postMessage([1]);\n return Deferred.await(exitDeferred);\n }).pipe(Effect.interruptible, Effect.timeout(5000), Effect.catchAllCause(() => Effect.sync(() => thing.kill())))), thing);\n });\n },\n listen({\n deferred,\n emit,\n port\n }) {\n port.worker.on(\"message\", message => {\n emit(message);\n });\n port.worker.on(\"messageerror\", cause => {\n Deferred.unsafeDone(deferred, new WorkerError({\n reason: \"decode\",\n cause\n }));\n });\n port.worker.on(\"error\", cause => {\n Deferred.unsafeDone(deferred, new WorkerError({\n reason: \"unknown\",\n cause\n }));\n });\n port.worker.on(\"exit\", code => {\n Deferred.unsafeDone(deferred, new WorkerError({\n reason: \"unknown\",\n cause: new Error(`exited with code ${code}`)\n }));\n });\n return Effect.void;\n }\n});\n/** @internal */\nexport const layerWorker = /*#__PURE__*/Layer.succeed(Worker.PlatformWorker, platformWorkerImpl);\n/** @internal */\nexport const layerManager = /*#__PURE__*/Layer.provide(Worker.layerManager, layerWorker);\n/** @internal */\nexport const layer = spawn => Layer.merge(layerManager, Worker.layerSpawner(spawn));\n/** @internal */\nexport const layerPlatform = spawn => Layer.merge(layerWorker, Worker.layerSpawner(spawn));\n//# sourceMappingURL=worker.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;AAOA,MAAM,qBAAkC,uBAAO,cAAc,CAAC;CAC5D,MAAM,EACJ,OACA,UACC;AACD,SAAO,OAAO,QAAQ,SAAS,MAAM,GAAE,iBAAgB;GACrD,MAAM,QAAQ,iBAAiB,SAAS;IACtC,YAAY,KAAK,GAAG;AAClB,YAAO,YAAY,KAAK,EAAE;;IAE5B,YAAY,OAAO,WAAW;IAC9B;IACD,GAAG;IACF,YAAY,KAAK,GAAG;AAClB,YAAO,KAAK,IAAI;;IAElB,YAAY,OAAO,KAAK,UAAU;IAClC;IACD;AACD,UAAO,GAAG,cAAc;AACtB,aAAS,WAAW,cAAc,KAAK,KAAK;KAC5C;AACF,UAAO,OAAO,GAAG,MAAM,aAAa,OAAO,OAAO,cAAc;AAC9D,UAAM,YAAY,CAAC,EAAE,CAAC;AACtB,WAAO,SAAS,MAAM,aAAa;KACnC,CAAC,KAAK,OAAO,eAAe,OAAO,QAAQ,IAAK,EAAE,OAAO,oBAAoB,OAAO,WAAW,MAAM,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM;IACzH;;CAEJ,OAAO,EACL,UACA,MACA,QACC;AACD,OAAK,OAAO,GAAG,YAAW,YAAW;AACnC,QAAK,QAAQ;IACb;AACF,OAAK,OAAO,GAAG,iBAAgB,UAAS;AACtC,YAAS,WAAW,UAAU,IAAI,YAAY;IAC5C,QAAQ;IACR;IACD,CAAC,CAAC;IACH;AACF,OAAK,OAAO,GAAG,UAAS,UAAS;AAC/B,YAAS,WAAW,UAAU,IAAI,YAAY;IAC5C,QAAQ;IACR;IACD,CAAC,CAAC;IACH;AACF,OAAK,OAAO,GAAG,SAAQ,SAAQ;AAC7B,YAAS,WAAW,UAAU,IAAI,YAAY;IAC5C,QAAQ;IACR,uBAAO,IAAI,MAAM,oBAAoB,OAAO;IAC7C,CAAC,CAAC;IACH;AACF,SAAO,OAAO;;CAEjB,CAAC;;AAEF,MAAa,cAA2B,sBAAM,QAAQ,OAAO,gBAAgB,mBAAmB;;AAEhG,MAAa,eAA4B,sBAAM,QAAQ,OAAO,cAAc,YAAY;;AAExF,MAAa,SAAQ,UAAS,MAAM,MAAM,cAAc,OAAO,aAAa,MAAM,CAAC;;AAEnF,MAAa,iBAAgB,UAAS,MAAM,MAAM,aAAa,OAAO,aAAa,MAAM,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"package.mjs","names":[],"sources":["../../../package.json"],"sourcesContent":["{\n \"name\": \"@confect/cli\",\n \"version\": \"1.0.0-next.1\",\n \"description\": \"Developer tooling for codegen and sync\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/rjdellecese/confect.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/rjdellecese/confect/issues\"\n },\n \"homepage\": \"https://confect.dev\",\n \"sideEffects\": false,\n \"type\": \"module\",\n \"bin\": {\n \"confect\": \"./dist/index.mjs\"\n },\n \"files\": [\n \"CHANGELOG.md\",\n \"LICENSE\",\n \"README.md\",\n \"dist\",\n \"package.json\",\n \"src\"\n ],\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"default\": \"./dist/index.js\"\n },\n \"./package.json\": \"./package.json\"\n },\n \"scripts\": {\n \"build\": \"tsdown --config-loader unrun\",\n \"dev\": \"tsdown --watch\",\n \"test\": \"vitest run\",\n \"typecheck\": \"tsc --noEmit --project tsconfig.json\",\n \"fix\": \"prettier --write . && eslint --fix . --max-warnings=0\",\n \"format\": \"prettier --check .\",\n \"lint\": \"eslint . --max-warnings=0\",\n \"clean\": \"rm -rf dist coverage node_modules\"\n },\n \"keywords\": [\n \"effect\",\n \"convex\",\n \"cli\"\n ],\n \"author\": \"RJ Dellecese\",\n \"license\": \"ISC\",\n \"dependencies\": {\n \"@effect/cli\": \"^0.72.1\",\n \"@effect/printer\": \"^0.47.0\",\n \"@effect/printer-ansi\": \"^0.47.0\",\n \"code-block-writer\": \"^13.0.3\",\n \"esbuild\": \"^0.25.0\",\n \"tsx\": \"^4.19.2\"\n },\n \"devDependencies\": {\n \"@effect/language-service\": \"0.56.0\",\n \"@effect/platform-node\": \"0.100.0\",\n \"@effect/vitest\": \"0.27.0\",\n \"@eslint/js\": \"9.39.1\",\n \"@types/node\": \"24.10.1\",\n \"@vitest/coverage-v8\": \"3.2.4\",\n \"eslint\": \"9.39.1\",\n \"prettier\": \"3.6.2\",\n \"tsdown\": \"0.16.4\",\n \"typescript\": \"5.9.3\",\n \"typescript-eslint\": \"8.46.4\",\n \"vite\": \"7.2.2\",\n \"vite-tsconfig-paths\": \"5.1.4\",\n \"vitest\": \"3.2.4\"\n },\n \"peerDependencies\": {\n \"@confect/core\": \"workspace:*\",\n \"@confect/server\": \"workspace:*\",\n \"@effect/platform\": \"^0.93.2\",\n \"effect\": \"^3.19.3\"\n },\n \"engines\": {\n \"node\": \">=22\",\n \"pnpm\": \">=10\"\n },\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\"\n}\n"],"mappings":";cAEa"}
|