From 37002b8dc49737ddf636441ef30ec32bf4c21242 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Wed, 27 Dec 2023 02:29:38 +0100 Subject: [PATCH] fix: improve ata for bun --- frontend/src/lib/ata/index.ts | 9 ++++----- frontend/src/lib/components/Editor.svelte | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/lib/ata/index.ts b/frontend/src/lib/ata/index.ts index addb8c20c9..30d08dfc36 100644 --- a/frontend/src/lib/ata/index.ts +++ b/frontend/src/lib/ata/index.ts @@ -74,9 +74,9 @@ export const setupTypeAcquisition = (config: ATABootstrapConfig) => { } async function resolveDeps(initialSourceFile: string, depth: number) { - if (depth > 2) { - return - } + // if (depth > 2) { + // return + // } let depsToGet = config .depsParser(initialSourceFile) @@ -103,7 +103,6 @@ export const setupTypeAcquisition = (config: ATABootstrapConfig) => { ? '' : '/' + config.scriptPath + (f.raw.startsWith('../') ? '/../' : '/.') + f.raw let url = config.root + path - console.log('path', config.scriptPath, path, url) const res = await fetch(url) if (res.ok) { config.delegate.localFile?.(await res.text(), f.raw) @@ -156,7 +155,7 @@ export const setupTypeAcquisition = (config: ATABootstrapConfig) => { tree.version, '/package.json' ) - let prefix = `/node_modules/${tree.moduleName}` + let prefix = `/node_modules/${tree.raw}` if (dtTreesOnly.includes(tree)) prefix = `/node_modules/@types/${getDTName(tree.raw).replace('types__', '')}` const path = prefix + '/package.json' diff --git a/frontend/src/lib/components/Editor.svelte b/frontend/src/lib/components/Editor.svelte index 4e71820e3a..552315a28d 100644 --- a/frontend/src/lib/components/Editor.svelte +++ b/frontend/src/lib/components/Editor.svelte @@ -769,6 +769,7 @@ const addLibraryToRuntime = async (code: string, _path: string) => { const path = 'file://' + _path let uri = mUri.parse(path) + console.log('adding library to runtime', path) languages.typescript.javascriptDefaults.addExtraLib(code, path) try { await vscode.workspace.fs.writeFile(uri, new TextEncoder().encode(code))