@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.
@@ -8,8 +8,8 @@ import glob from 'fast-glob';
8
8
  import 'crypto';
9
9
  import { Command } from 'commander';
10
10
  import Ajv from 'ajv';
11
- import Ajv2019 from 'ajv/dist/2019';
12
- import Ajv2020 from 'ajv/dist/2020';
11
+ import Ajv2019 from 'ajv/dist/2019.js';
12
+ import Ajv2020 from 'ajv/dist/2020.js';
13
13
  import AjvDraft04 from 'ajv-draft-04';
14
14
  import { Readable } from 'stream';
15
15
  import picomatch from 'picomatch';
@@ -1050,8 +1050,18 @@ async function isGoneatAvailable(goneatPath) {
1050
1050
  }
1051
1051
  return new Promise((resolve) => {
1052
1052
  const proc = spawn(pathToTest, ["version"], { stdio: "ignore" });
1053
- proc.on("close", (code) => resolve(code === 0));
1054
- proc.on("error", () => resolve(false));
1053
+ const timeout = setTimeout(() => {
1054
+ proc.kill();
1055
+ resolve(false);
1056
+ }, 5e3);
1057
+ proc.on("close", (code) => {
1058
+ clearTimeout(timeout);
1059
+ resolve(code === 0);
1060
+ });
1061
+ proc.on("error", () => {
1062
+ clearTimeout(timeout);
1063
+ resolve(false);
1064
+ });
1055
1065
  });
1056
1066
  }
1057
1067
  async function runGoneatValidation(schemaPath, dataPath, goneatPath) {