@oclif/plugin-test-esbuild 0.1.6 → 0.1.7

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/README.md CHANGED
@@ -18,7 +18,7 @@ $ npm install -g @oclif/plugin-test-esbuild
18
18
  $ bundle COMMAND
19
19
  running command...
20
20
  $ bundle (--version)
21
- @oclif/plugin-test-esbuild/0.1.6 linux-x64 node-v20.11.0
21
+ @oclif/plugin-test-esbuild/0.1.7 linux-x64 node-v20.11.0
22
22
  $ bundle --help [COMMAND]
23
23
  USAGE
24
24
  $ bundle COMMAND
package/dist/index.js CHANGED
@@ -2280,7 +2280,7 @@ var require_package = __commonJS({
2280
2280
  module2.exports = {
2281
2281
  name: "@oclif/core",
2282
2282
  description: "base library for oclif CLIs",
2283
- version: "3.19.2-dev.0",
2283
+ version: "3.19.3-dev.0",
2284
2284
  author: "Salesforce",
2285
2285
  bugs: "https://github.com/oclif/core/issues",
2286
2286
  dependencies: {
@@ -2317,7 +2317,7 @@ var require_package = __commonJS({
2317
2317
  "@oclif/plugin-help": "^6",
2318
2318
  "@oclif/plugin-plugins": "^4",
2319
2319
  "@oclif/prettier-config": "^0.2.1",
2320
- "@oclif/test": "^3.1.12",
2320
+ "@oclif/test": "^3.1.14",
2321
2321
  "@types/ansi-styles": "^3.2.1",
2322
2322
  "@types/benchmark": "^2.1.5",
2323
2323
  "@types/chai": "^4.3.11",
@@ -2351,9 +2351,9 @@ var require_package = __commonJS({
2351
2351
  husky: "^8",
2352
2352
  "lint-staged": "^14.0.1",
2353
2353
  madge: "^6.1.0",
2354
- mocha: "^10.2.0",
2354
+ mocha: "^10.3.0",
2355
2355
  nyc: "^15.1.0",
2356
- prettier: "^3.2.4",
2356
+ prettier: "^3.2.5",
2357
2357
  shx: "^0.3.4",
2358
2358
  sinon: "^16.1.3",
2359
2359
  "ts-node": "^10.9.2",
@@ -4528,34 +4528,34 @@ var require_prompt = __commonJS({
4528
4528
  Object.defineProperty(exports2, "__esModule", { value: true });
4529
4529
  exports2.anykey = exports2.confirm = exports2.prompt = void 0;
4530
4530
  var chalk_1 = __importDefault(require_source());
4531
+ var node_readline_1 = __importDefault(require("node:readline"));
4531
4532
  var Errors = __importStar(require_errors());
4532
4533
  var config_1 = require_config2();
4533
4534
  function normal(options, retries = 100) {
4534
4535
  if (retries < 0)
4535
4536
  throw new Error("no input");
4537
+ const ac = new AbortController();
4538
+ const { signal } = ac;
4536
4539
  return new Promise((resolve, reject) => {
4537
- let timer;
4538
- if (options.timeout) {
4539
- timer = setTimeout(() => {
4540
- process.stdin.pause();
4541
- reject(new Error("Prompt timeout"));
4542
- }, options.timeout);
4543
- timer.unref();
4544
- }
4545
- process.stdin.setEncoding("utf8");
4546
- process.stderr.write(options.prompt);
4547
- process.stdin.resume();
4548
- process.stdin.once("data", (b) => {
4549
- if (timer)
4550
- clearTimeout(timer);
4551
- process.stdin.pause();
4552
- const data = (typeof b === "string" ? b : b.toString()).trim();
4540
+ const rl = node_readline_1.default.createInterface({
4541
+ input: process.stdin,
4542
+ output: process.stdout
4543
+ });
4544
+ rl.question(options.prompt, { signal }, (answer) => {
4545
+ rl.close();
4546
+ const data = answer.trim();
4553
4547
  if (!options.default && options.required && data === "") {
4554
4548
  resolve(normal(options, retries - 1));
4555
4549
  } else {
4556
4550
  resolve(data || options.default);
4557
4551
  }
4558
4552
  });
4553
+ if (options.timeout) {
4554
+ signal.addEventListener("abort", () => {
4555
+ reject(new Error("Prompt timeout"));
4556
+ }, { once: true });
4557
+ setTimeout(() => ac.abort(), options.timeout);
4558
+ }
4559
4559
  });
4560
4560
  }
4561
4561
  function getPrompt(name, type, defaultValue) {
@@ -228813,7 +228813,7 @@ var require_config3 = __commonJS({
228813
228813
  };
228814
228814
  const hooks = p.hooks[event] || [];
228815
228815
  for (const hook2 of hooks) {
228816
- const marker2 = performance_1.Performance.mark(performance_1.OCLIF_MARKER_OWNER, `config.runHook#${p.name}(${hook2})`);
228816
+ const marker2 = performance_1.Performance.mark(performance_1.OCLIF_MARKER_OWNER, `config.runHook#${p.name}(${hook2.target})`);
228817
228817
  try {
228818
228818
  const { filePath, isESM, module: module3 } = await (0, module_loader_1.loadWithData)(p, await (0, ts_node_1.tsPath)(p.root, hook2.target, p));
228819
228819
  debug2("start", isESM ? "(import)" : "(require)", filePath);
@@ -68,5 +68,5 @@
68
68
  "enableJsonFlag": false
69
69
  }
70
70
  },
71
- "version": "0.1.6"
71
+ "version": "0.1.7"
72
72
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oclif/plugin-test-esbuild",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Bundled plugin for testing",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/plugin-test-esbuild/issues",
@@ -11,7 +11,7 @@
11
11
  "bundle": "./bin/run.js"
12
12
  },
13
13
  "dependencies": {
14
- "@oclif/core": "3.19.2-dev.0",
14
+ "@oclif/core": "3.19.3-dev.0",
15
15
  "@oclif/plugin-help": "^6",
16
16
  "@oclif/plugin-plugins": "^4"
17
17
  },
@@ -34,7 +34,7 @@
34
34
  "typescript": "^5"
35
35
  },
36
36
  "resolutions": {
37
- "@oclif/core": "3.19.2-dev.0"
37
+ "@oclif/core": "3.19.3-dev.0"
38
38
  },
39
39
  "engines": {
40
40
  "node": ">=18.0.0"
@@ -74,13 +74,12 @@
74
74
  },
75
75
  "repository": "oclif/plugin-test-esbuild",
76
76
  "scripts": {
77
- "build": "shx rm -rf dist && tsc -b",
78
- "bundle": "shx rm -rf dist && esbuild src/index.ts --bundle --platform=node --outfile=dist/index.js",
77
+ "build": "shx rm -rf dist && esbuild src/index.ts --bundle --platform=node --outfile=dist/index.js",
79
78
  "lint": "eslint . --ext .ts",
80
79
  "postpack": "shx rm -f oclif.manifest.json",
81
80
  "posttest": "yarn lint",
82
- "prepack": "yarn bundle && oclif manifest && oclif readme",
83
- "prepare": "yarn bundle",
81
+ "prepack": "yarn build && oclif manifest && oclif readme",
82
+ "prepare": "yarn build",
84
83
  "test": "mocha --forbid-only \"test/**/*.test.ts\"",
85
84
  "version": "oclif readme && git add README.md"
86
85
  }