@fulmenhq/tsfulmen 0.2.5 → 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.
@@ -6,8 +6,8 @@ import { dirname, join, relative, extname } from 'path';
6
6
  import { fileURLToPath } from 'url';
7
7
  import glob from 'fast-glob';
8
8
  import Ajv from 'ajv';
9
- import Ajv2019 from 'ajv/dist/2019';
10
- import Ajv2020 from 'ajv/dist/2020';
9
+ import Ajv2019 from 'ajv/dist/2019.js';
10
+ import Ajv2020 from 'ajv/dist/2020.js';
11
11
  import AjvDraft04 from 'ajv-draft-04';
12
12
  import { Readable } from 'stream';
13
13
  import picomatch from 'picomatch';
@@ -357,8 +357,18 @@ async function isGoneatAvailable(goneatPath) {
357
357
  }
358
358
  return new Promise((resolve) => {
359
359
  const proc = spawn(pathToTest, ["version"], { stdio: "ignore" });
360
- proc.on("close", (code) => resolve(code === 0));
361
- proc.on("error", () => resolve(false));
360
+ const timeout = setTimeout(() => {
361
+ proc.kill();
362
+ resolve(false);
363
+ }, 5e3);
364
+ proc.on("close", (code) => {
365
+ clearTimeout(timeout);
366
+ resolve(code === 0);
367
+ });
368
+ proc.on("error", () => {
369
+ clearTimeout(timeout);
370
+ resolve(false);
371
+ });
362
372
  });
363
373
  }
364
374
  async function runGoneatValidation(schemaPath, dataPath, goneatPath) {