New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

@effect/platform-node

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@effect/platform-node - npm Package Compare versions

Comparing version

to
0.31.8

@@ -43,4 +43,5 @@ "use strict";

const output = yield* _(Effect.sync(() => globalThis.process.stdout));
// Create a readline interface and force it to emit keypress events
yield* _(Effect.acquireRelease(Effect.sync(() => {
// Acquire a `readline` interface and use it to force `stdin` to emit
// keypress events
const acquireReadlineInterface = Effect.sync(() => {
const rl = readline.createInterface({

@@ -55,9 +56,5 @@ input,

return rl;
}), rl => Effect.sync(() => {
if (input.isTTY) {
input.setRawMode(false);
}
rl.close();
})));
const readInput = Effect.async(resume => {
});
// Handle the `"keypress"` event emitted by `stdin` forced by `readline`
const handleKeypressEvent = Effect.async(resume => {
const handleKeypress = (input, key) => {

@@ -84,2 +81,10 @@ const userInput = {

});
// Close the `readline` interface
const releaseReadlineInterface = rl => Effect.sync(() => {
if (input.isTTY) {
input.setRawMode(false);
}
rl.close();
});
const readInput = Effect.acquireUseRelease(acquireReadlineInterface, () => handleKeypressEvent, releaseReadlineInterface);
const display = prompt => Effect.uninterruptible(Effect.async(resume => {

@@ -86,0 +91,0 @@ output.write(prompt, err => {

@@ -12,2 +12,3 @@ "use strict";

var Path = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./Path.js"));
var Terminal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./Terminal.js"));
var Worker = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./Worker.js"));

@@ -47,3 +48,3 @@ function _getRequireWildcardCache(e) {

*/
const layer = exports.layer = /*#__PURE__*/(0, _Function.pipe)(FileSystem.layer, /*#__PURE__*/Layer.merge(Path.layer), /*#__PURE__*/Layer.merge( /*#__PURE__*/Layer.provideMerge(FileSystem.layer, CommandExecutor.layer)), /*#__PURE__*/Layer.merge(Worker.layerManager));
const layer = exports.layer = /*#__PURE__*/(0, _Function.pipe)(FileSystem.layer, /*#__PURE__*/Layer.merge(Path.layer), /*#__PURE__*/Layer.merge( /*#__PURE__*/Layer.provideMerge(FileSystem.layer, CommandExecutor.layer)), /*#__PURE__*/Layer.merge(Terminal.layer), /*#__PURE__*/Layer.merge(Worker.layerManager));
//# sourceMappingURL=NodeContext.js.map

@@ -5,2 +5,3 @@ import * as Layer from "effect/Layer";

import * as Path from "./Path.js";
import * as Terminal from "./Terminal.js";
import * as Worker from "./Worker.js";

@@ -11,3 +12,3 @@ /**

*/
export type NodeContext = CommandExecutor.CommandExecutor | FileSystem.FileSystem | Path.Path | Worker.WorkerManager;
export type NodeContext = CommandExecutor.CommandExecutor | FileSystem.FileSystem | Path.Path | Terminal.Terminal | Worker.WorkerManager;
/**

@@ -14,0 +15,0 @@ * @since 1.0.0

@@ -12,4 +12,5 @@ import * as Error from "@effect/platform/Error";

const output = yield* _(Effect.sync(() => globalThis.process.stdout));
// Create a readline interface and force it to emit keypress events
yield* _(Effect.acquireRelease(Effect.sync(() => {
// Acquire a `readline` interface and use it to force `stdin` to emit
// keypress events
const acquireReadlineInterface = Effect.sync(() => {
const rl = readline.createInterface({

@@ -24,9 +25,5 @@ input,

return rl;
}), rl => Effect.sync(() => {
if (input.isTTY) {
input.setRawMode(false);
}
rl.close();
})));
const readInput = Effect.async(resume => {
});
// Handle the `"keypress"` event emitted by `stdin` forced by `readline`
const handleKeypressEvent = Effect.async(resume => {
const handleKeypress = (input, key) => {

@@ -53,2 +50,10 @@ const userInput = {

});
// Close the `readline` interface
const releaseReadlineInterface = rl => Effect.sync(() => {
if (input.isTTY) {
input.setRawMode(false);
}
rl.close();
});
const readInput = Effect.acquireUseRelease(acquireReadlineInterface, () => handleKeypressEvent, releaseReadlineInterface);
const display = prompt => Effect.uninterruptible(Effect.async(resume => {

@@ -55,0 +60,0 @@ output.write(prompt, err => {

@@ -9,2 +9,3 @@ /**

import * as Path from "./Path.js";
import * as Terminal from "./Terminal.js";
import * as Worker from "./Worker.js";

@@ -15,3 +16,3 @@ /**

*/
export const layer = /*#__PURE__*/pipe(FileSystem.layer, /*#__PURE__*/Layer.merge(Path.layer), /*#__PURE__*/Layer.merge( /*#__PURE__*/Layer.provideMerge(FileSystem.layer, CommandExecutor.layer)), /*#__PURE__*/Layer.merge(Worker.layerManager));
export const layer = /*#__PURE__*/pipe(FileSystem.layer, /*#__PURE__*/Layer.merge(Path.layer), /*#__PURE__*/Layer.merge( /*#__PURE__*/Layer.provideMerge(FileSystem.layer, CommandExecutor.layer)), /*#__PURE__*/Layer.merge(Terminal.layer), /*#__PURE__*/Layer.merge(Worker.layerManager));
//# sourceMappingURL=NodeContext.js.map
{
"name": "@effect/platform-node",
"version": "0.31.7",
"version": "0.31.8",
"description": "Unified interfaces for common platform-specific services",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -19,22 +19,15 @@ import * as Error from "@effect/platform/Error"

// Create a readline interface and force it to emit keypress events
yield* _(Effect.acquireRelease(
Effect.sync(() => {
const rl = readline.createInterface({ input, escapeCodeTimeout: 50 })
readline.emitKeypressEvents(input, rl)
if (input.isTTY) {
input.setRawMode(true)
}
return rl
}),
(rl) =>
Effect.sync(() => {
if (input.isTTY) {
input.setRawMode(false)
}
rl.close()
})
))
// Acquire a `readline` interface and use it to force `stdin` to emit
// keypress events
const acquireReadlineInterface = Effect.sync(() => {
const rl = readline.createInterface({ input, escapeCodeTimeout: 50 })
readline.emitKeypressEvents(input, rl)
if (input.isTTY) {
input.setRawMode(true)
}
return rl
})
const readInput = Effect.async<never, Terminal.QuitException, Terminal.UserInput>((resume) => {
// Handle the `"keypress"` event emitted by `stdin` forced by `readline`
const handleKeypressEvent = Effect.async<never, Terminal.QuitException, Terminal.UserInput>((resume) => {
const handleKeypress = (input: string | undefined, key: readline.Key) => {

@@ -62,2 +55,17 @@ const userInput: Terminal.UserInput = {

// Close the `readline` interface
const releaseReadlineInterface = (rl: readline.Interface) =>
Effect.sync(() => {
if (input.isTTY) {
input.setRawMode(false)
}
rl.close()
})
const readInput = Effect.acquireUseRelease(
acquireReadlineInterface,
() => handleKeypressEvent,
releaseReadlineInterface
)
const display = (prompt: string): Effect.Effect<never, Error.PlatformError, void> =>

@@ -64,0 +72,0 @@ Effect.uninterruptible(

@@ -9,2 +9,3 @@ /**

import * as Path from "./Path.js"
import * as Terminal from "./Terminal.js"
import * as Worker from "./Worker.js"

@@ -20,2 +21,3 @@

| Path.Path
| Terminal.Terminal
| Worker.WorkerManager

@@ -31,3 +33,4 @@

Layer.merge(Layer.provideMerge(FileSystem.layer, CommandExecutor.layer)),
Layer.merge(Terminal.layer),
Layer.merge(Worker.layerManager)
)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet