@ark/attest 0.44.6 → 0.44.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.
@@ -1 +1 @@
1
- export declare const baseDiagnosticTscCmd = "npm exec -- tsc --noEmit --extendedDiagnostics --incremental false --tsBuildInfoFile null";
1
+ export declare const baseDiagnosticTscCmd = "npx --package=typescript --no-install tsc --noEmit --extendedDiagnostics --incremental false --tsBuildInfoFile null";
package/out/cli/shared.js CHANGED
@@ -1 +1 @@
1
- export const baseDiagnosticTscCmd = "npm exec -- tsc --noEmit --extendedDiagnostics --incremental false --tsBuildInfoFile null";
1
+ export const baseDiagnosticTscCmd = "npx --package=typescript --no-install tsc --noEmit --extendedDiagnostics --incremental false --tsBuildInfoFile null";
package/out/cli/trace.js CHANGED
@@ -1,5 +1,4 @@
1
- import { ensureDir, readJson, writeFile } from "@ark/fs";
2
- import { execSync } from "child_process";
1
+ import { ensureDir, getShellOutput, readJson, writeFile } from "@ark/fs";
3
2
  import { existsSync } from "node:fs";
4
3
  import { basename, join, relative } from "node:path";
5
4
  import { resolve } from "path";
@@ -36,6 +35,11 @@ export const trace = async (args) => {
36
35
  outputCapture.clear();
37
36
  outputCapture.write(`⏳ Gathering type trace data for ${packageDir}...`);
38
37
  tracingOutput = generateTraceData(traceDir, config.tsconfig, packageDir);
38
+ const traceFile = join(traceDir, "trace.json");
39
+ if (!existsSync(traceFile)) {
40
+ outputCapture.write(`❌ No trace data found (expected a file at ${join(traceDir, "trace.json")})`);
41
+ return;
42
+ }
39
43
  outputCapture.write(`⏳ Analyzing type trace data for ${packageDir}...`);
40
44
  analyzeTypeInstantiations(traceDir);
41
45
  // Write summary file containing our messages followed by compiler output
@@ -49,15 +53,24 @@ export const trace = async (args) => {
49
53
  writeFile(summaryPath, summaryContent);
50
54
  };
51
55
  const generateTraceData = (traceDir, tsconfigPath, packageDir) => {
52
- // Capture the output instead of just displaying it
53
- const output = execSync(`${baseDiagnosticTscCmd} --project ${tsconfigPath} --generateTrace ${traceDir}`, {
54
- cwd: packageDir,
55
- stdio: "pipe", // Capture output instead of inheriting
56
- encoding: "utf-8" // Return as string
57
- });
58
- // Display the output to the console as before
59
- process.stdout.write(output);
60
- return output;
56
+ try {
57
+ // Capture the output instead of just displaying it
58
+ const output = getShellOutput(`${baseDiagnosticTscCmd} --project ${tsconfigPath} --generateTrace ${traceDir}`, { cwd: packageDir });
59
+ // Display the output to the console as before
60
+ process.stdout.write(output);
61
+ return output;
62
+ }
63
+ catch (_) {
64
+ // even if tsc returns a non-zero exit code,
65
+ // we can still proceed as long as the trace.json
66
+ // file was generated
67
+ const e = _;
68
+ const output = e.stdout ?? "";
69
+ const errorOutput = e.stderr ?? "";
70
+ process.stdout.write(output);
71
+ process.stderr.write(errorOutput);
72
+ return `${output}\n${errorOutput}`;
73
+ }
61
74
  };
62
75
  const initializeAnalysisContext = (traceDir) => {
63
76
  const tsServer = TsServer.instance;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ark/attest",
3
- "version": "0.44.6",
3
+ "version": "0.44.7",
4
4
  "license": "MIT",
5
5
  "author": {
6
6
  "name": "David Blass",
@@ -37,8 +37,8 @@
37
37
  "@typescript/vfs": "1.6.0",
38
38
  "prettier": "3.4.2",
39
39
  "@ark/fs": "0.44.5",
40
- "arktype": "2.1.9",
41
- "@ark/util": "0.44.5"
40
+ "@ark/util": "0.44.5",
41
+ "arktype": "2.1.9"
42
42
  },
43
43
  "devDependencies": {
44
44
  "typescript": "5.8.2"