From 960699f851ab3e73637e736b1bea0c7e09f48754 Mon Sep 17 00:00:00 2001 From: Ryan Lee Date: Mon, 17 Jul 2023 16:53:24 -0400 Subject: [PATCH] fix: resolves nets ts diagnostic error handling --- cli/resolveNets.ts | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/cli/resolveNets.ts b/cli/resolveNets.ts index 1d6b85b09..fa9eb84de 100644 --- a/cli/resolveNets.ts +++ b/cli/resolveNets.ts @@ -3,7 +3,11 @@ import { register } from "../deps/shims/register-ts-node.ts" import * as path from "../deps/std/path.ts" import { NetSpec } from "../nets/mod.ts" +const TS_MODULE_HAS_NO_EXPORTED_MEMBER = 2305 +const TS_CANNOT_FIND_MODULE_OR_ITS_CORRESPONDING_TYPE_DECLARATIONS = 2307 + const $nets = $.record($.instance(NetSpec as new() => NetSpec, $.tuple(), (_: NetSpec) => [])) +const $tsDiagnostics = $.field("diagnosticCodes", $.array($.u32)) export async function resolveNets(maybeNetsPath?: string): Promise> { const resolvedNetsPath = await resolveNetsPath(maybeNetsPath) @@ -11,13 +15,40 @@ export async function resolveNets(maybeNetsPath?: string): Promise { if (maybeNetsPath) return path.resolve(maybeNetsPath) for (const p of ["nets.ts", "nets.js"]) {