@fulmenhq/tsfulmen 0.2.4 → 0.2.6

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.
@@ -7,8 +7,8 @@ import { dirname, extname, join, relative } from 'path';
7
7
  import { fileURLToPath } from 'url';
8
8
  import glob from 'fast-glob';
9
9
  import Ajv from 'ajv';
10
- import Ajv2019 from 'ajv/dist/2019';
11
- import Ajv2020 from 'ajv/dist/2020';
10
+ import Ajv2019 from 'ajv/dist/2019.js';
11
+ import Ajv2020 from 'ajv/dist/2020.js';
12
12
  import AjvDraft04 from 'ajv-draft-04';
13
13
  import { Readable } from 'stream';
14
14
  import picomatch from 'picomatch';
@@ -494,8 +494,18 @@ async function isGoneatAvailable(goneatPath) {
494
494
  }
495
495
  return new Promise((resolve) => {
496
496
  const proc = spawn(pathToTest, ["version"], { stdio: "ignore" });
497
- proc.on("close", (code) => resolve(code === 0));
498
- proc.on("error", () => resolve(false));
497
+ const timeout = setTimeout(() => {
498
+ proc.kill();
499
+ resolve(false);
500
+ }, 5e3);
501
+ proc.on("close", (code) => {
502
+ clearTimeout(timeout);
503
+ resolve(code === 0);
504
+ });
505
+ proc.on("error", () => {
506
+ clearTimeout(timeout);
507
+ resolve(false);
508
+ });
499
509
  });
500
510
  }
501
511
  async function runGoneatValidation(schemaPath, dataPath, goneatPath) {