@wdio/repl
Advanced tools
Comparing version 7.20.7 to 8.0.0-alpha.213
@@ -1,5 +0,2 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DEFAULT_CONFIG = exports.INTRO_MESSAGE = exports.STATIC_RETURNS = void 0; | ||
exports.STATIC_RETURNS = { | ||
export const STATIC_RETURNS = { | ||
driver: '[WebdriverIO REPL client]', | ||
@@ -10,3 +7,3 @@ browser: '[WebdriverIO REPL client]', | ||
}; | ||
exports.INTRO_MESSAGE = ` | ||
export const INTRO_MESSAGE = ` | ||
The execution has stopped! | ||
@@ -16,3 +13,3 @@ You can now go into the browser or use the command line as REPL | ||
`; | ||
exports.DEFAULT_CONFIG = { | ||
export const DEFAULT_CONFIG = { | ||
commandTimeout: 5000, | ||
@@ -19,0 +16,0 @@ prompt: '\u203A ', |
@@ -33,4 +33,4 @@ /** | ||
/// <reference types="node" /> | ||
import vm from 'vm'; | ||
import repl from 'repl'; | ||
import vm from 'node:vm'; | ||
import repl from 'node:repl'; | ||
export interface ReplConfig { | ||
@@ -50,3 +50,3 @@ commandTimeout: number; | ||
constructor(config?: ReplConfig); | ||
eval(cmd: string, context: vm.Context, filename: string | undefined, callback: ReplCallback): void | Promise<any>; | ||
eval(cmd: string, context: vm.Context, filename: string | undefined, callback: ReplCallback): void; | ||
private _runCmd; | ||
@@ -53,0 +53,0 @@ private _handleResult; |
@@ -1,2 +0,1 @@ | ||
"use strict"; | ||
/** | ||
@@ -32,14 +31,9 @@ * | ||
*/ | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const vm_1 = __importDefault(require("vm")); | ||
const repl_1 = __importDefault(require("repl")); | ||
const utils_1 = require("@wdio/utils"); | ||
const constants_1 = require("./constants"); | ||
class WDIORepl { | ||
import vm from 'node:vm'; | ||
import repl from 'node:repl'; | ||
import { STATIC_RETURNS, INTRO_MESSAGE, DEFAULT_CONFIG } from './constants.js'; | ||
export default class WDIORepl { | ||
constructor(config) { | ||
this._isCommandRunning = false; | ||
this._config = Object.assign(constants_1.DEFAULT_CONFIG, { eval: this.eval.bind(this) }, config); | ||
this._config = Object.assign(DEFAULT_CONFIG, { eval: this.eval.bind(this) }, config); | ||
} | ||
@@ -50,11 +44,7 @@ eval(cmd, context, filename, callback) { | ||
} | ||
if (cmd && constants_1.STATIC_RETURNS[cmd.trim()]) { | ||
return callback(null, constants_1.STATIC_RETURNS[cmd.trim()]); | ||
if (cmd && STATIC_RETURNS[cmd.trim()]) { | ||
return callback(null, STATIC_RETURNS[cmd.trim()]); | ||
} | ||
vm_1.default.createContext(context); | ||
vm.createContext(context); | ||
this._isCommandRunning = true; | ||
/* istanbul ignore if */ | ||
if (utils_1.hasWdioSyncSupport) { | ||
return (0, utils_1.runFnInFiberContext)(() => this._runCmd(cmd, context, callback))(); | ||
} | ||
return this._runCmd(cmd, context, callback); | ||
@@ -64,3 +54,3 @@ } | ||
try { | ||
const result = vm_1.default.runInContext(cmd, context); | ||
const result = vm.runInContext(cmd, context); | ||
return this._handleResult(result, callback); | ||
@@ -119,3 +109,3 @@ } | ||
} | ||
this._replServer = repl_1.default.start(this._config); | ||
this._replServer = repl.start(this._config); | ||
return new Promise((resolve) => { | ||
@@ -126,3 +116,2 @@ return this._replServer.on('exit', resolve); | ||
} | ||
exports.default = WDIORepl; | ||
WDIORepl.introMessage = constants_1.INTRO_MESSAGE; | ||
WDIORepl.introMessage = INTRO_MESSAGE; |
{ | ||
"name": "@wdio/repl", | ||
"version": "7.20.7", | ||
"version": "8.0.0-alpha.213+c5fb6d57e", | ||
"description": "A WDIO helper utility to provide a repl interface for WebdriverIO", | ||
@@ -8,5 +8,4 @@ "author": "Christian Bromann <mail@bromann.dev>", | ||
"license": "MIT", | ||
"main": "./build/index", | ||
"engines": { | ||
"node": ">=12.0.0" | ||
"node": "^16.13 || >=18" | ||
}, | ||
@@ -26,11 +25,10 @@ "repository": { | ||
}, | ||
"type": "module", | ||
"exports": "./build/index.js", | ||
"types": "./build/index.d.ts", | ||
"typeScriptVersion": "3.8.3", | ||
"dependencies": { | ||
"@wdio/utils": "7.20.7" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"gitHead": "21b8b61453f4749d87eca3e4d7d6e5e2cb60f043" | ||
"gitHead": "c5fb6d57e168d8bf939a5aa5c2ada5abaceec5eb" | ||
} |
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 2 instances in 1 package
0
0
Yes
10230
192
1
1
- Removed@wdio/utils@7.20.7
- Removed@sindresorhus/is@4.6.0(transitive)
- Removed@szmarczak/http-timer@4.0.6(transitive)
- Removed@types/cacheable-request@6.0.3(transitive)
- Removed@types/http-cache-semantics@4.0.4(transitive)
- Removed@types/keyv@3.1.4(transitive)
- Removed@types/node@18.19.71(transitive)
- Removed@types/responselike@1.0.3(transitive)
- Removed@wdio/logger@7.19.0(transitive)
- Removed@wdio/types@7.20.7(transitive)
- Removed@wdio/utils@7.20.7(transitive)
- Removedansi-regex@5.0.1(transitive)
- Removedansi-styles@4.3.0(transitive)
- Removedcacheable-lookup@5.0.4(transitive)
- Removedcacheable-request@7.0.4(transitive)
- Removedchalk@4.1.2(transitive)
- Removedclone-response@1.0.3(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removeddecompress-response@6.0.0(transitive)
- Removeddefer-to-connect@2.0.1(transitive)
- Removedend-of-stream@1.4.4(transitive)
- Removedget-stream@5.2.0(transitive)
- Removedgot@11.8.6(transitive)
- Removedhas-flag@4.0.0(transitive)
- Removedhttp-cache-semantics@4.1.1(transitive)
- Removedhttp2-wrapper@1.0.3(transitive)
- Removedjson-buffer@3.0.1(transitive)
- Removedkeyv@4.5.4(transitive)
- Removedloglevel@1.9.2(transitive)
- Removedloglevel-plugin-prefix@0.8.4(transitive)
- Removedlowercase-keys@2.0.0(transitive)
- Removedmimic-response@1.0.13.1.0(transitive)
- Removednormalize-url@6.1.0(transitive)
- Removedonce@1.4.0(transitive)
- Removedp-cancelable@2.1.1(transitive)
- Removedp-iteration@1.1.8(transitive)
- Removedpump@3.0.2(transitive)
- Removedquick-lru@5.1.1(transitive)
- Removedresolve-alpn@1.2.1(transitive)
- Removedresponselike@2.0.1(transitive)
- Removedstrip-ansi@6.0.1(transitive)
- Removedsupports-color@7.2.0(transitive)
- Removedtypescript@4.9.5(transitive)
- Removedundici-types@5.26.5(transitive)
- Removedwrappy@1.0.2(transitive)