From 7cd3f9e926c8a4a3d036d5055d0371eee672eab9 Mon Sep 17 00:00:00 2001 From: Cameron Little Date: Thu, 8 Oct 2020 22:23:12 +0200 Subject: [PATCH] Use correct internal installation when local ts not found (#97) * Use correct internal installation when local ts not found Fixes #96 * lint --- src/tsLibPath.test.ts | 4 +++- src/tsLibPath.ts | 4 +++- typescript.novaextension/CHANGELOG.md | 6 ++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/tsLibPath.test.ts b/src/tsLibPath.test.ts index 03b29828..1b636dc1 100644 --- a/src/tsLibPath.test.ts +++ b/src/tsLibPath.test.ts @@ -74,7 +74,9 @@ describe("tsLibPath", () => { it("uses the extension installation if workspace hasn't been saved", () => { (nova.workspace.path as any) = ""; - expect(getTsLibPath()).toBe("/extension/node_modules/typescript/lib"); + expect(getTsLibPath()).toBe( + "/dependencyManagement/node_modules/typescript/lib" + ); }); it("uses the workspace config", () => { diff --git a/src/tsLibPath.ts b/src/tsLibPath.ts index e8f2a9d7..cc0e1ae9 100644 --- a/src/tsLibPath.ts +++ b/src/tsLibPath.ts @@ -1,3 +1,5 @@ +import { dependencyManagement } from "nova-extension-utils"; + function reload() { nova.commands.invoke("apexskier.typescript.reload"); } @@ -43,7 +45,7 @@ export function getTsLibPath(): string | null { ); } else { tslibPath = nova.path.join( - nova.extension.path, + dependencyManagement.getDependencyDirectory(), "node_modules/typescript/lib" ); } diff --git a/typescript.novaextension/CHANGELOG.md b/typescript.novaextension/CHANGELOG.md index 419294b7..f20cf0fe 100644 --- a/typescript.novaextension/CHANGELOG.md +++ b/typescript.novaextension/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## future + +### Fixed + +- Fix not using dependency installation correctly + ## v1.8.1 ### Fixed