@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.
@@ -6,8 +6,8 @@ import { spawn } from 'child_process';
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';
@@ -1122,8 +1122,18 @@ async function isGoneatAvailable(goneatPath) {
1122
1122
  }
1123
1123
  return new Promise((resolve) => {
1124
1124
  const proc = spawn(pathToTest, ["version"], { stdio: "ignore" });
1125
- proc.on("close", (code) => resolve(code === 0));
1126
- proc.on("error", () => resolve(false));
1125
+ const timeout = setTimeout(() => {
1126
+ proc.kill();
1127
+ resolve(false);
1128
+ }, 5e3);
1129
+ proc.on("close", (code) => {
1130
+ clearTimeout(timeout);
1131
+ resolve(code === 0);
1132
+ });
1133
+ proc.on("error", () => {
1134
+ clearTimeout(timeout);
1135
+ resolve(false);
1136
+ });
1127
1137
  });
1128
1138
  }
1129
1139
  async function runGoneatValidation(schemaPath, dataPath, goneatPath) {