diff --git a/apps/lsp/package.json b/apps/lsp/package.json index 752bcbf1..f1820d9e 100644 --- a/apps/lsp/package.json +++ b/apps/lsp/package.json @@ -21,6 +21,7 @@ "node-html-parser": "^6.1.5", "picomatch": "^2.3.1", "quarto-core": "*", + "quarto-utils": "*", "uuid": "^8.3.2", "vscode-languageserver": "^8.1.0", "vscode-languageserver-textdocument": "^1.0.4", diff --git a/apps/lsp/src/r-utils.ts b/apps/lsp/src/r-utils.ts index 3845186a..aaf3f271 100644 --- a/apps/lsp/src/r-utils.ts +++ b/apps/lsp/src/r-utils.ts @@ -13,7 +13,7 @@ * */ -import { isRPackage as isRPackageImpl } from "@utils/r-utils"; +import { isRPackage as isRPackageImpl } from "quarto-utils"; import { IWorkspace } from './service'; // Version that selects workspace folder diff --git a/apps/lsp/tsconfig.json b/apps/lsp/tsconfig.json index 18511316..035d6a58 100644 --- a/apps/lsp/tsconfig.json +++ b/apps/lsp/tsconfig.json @@ -4,10 +4,7 @@ "module": "CommonJS", "outDir": "./dist", "sourceMap": true, - "resolveJsonModule": true, - "paths": { - "@utils/*": ["../utils/*"] - } + "resolveJsonModule": true }, "exclude": ["node_modules"], "extends": "tsconfig/base.json", diff --git a/apps/quarto-utils/package.json b/apps/quarto-utils/package.json new file mode 100644 index 00000000..bc0191ff --- /dev/null +++ b/apps/quarto-utils/package.json @@ -0,0 +1,16 @@ +{ + "name": "quarto-utils", + "version": "0.0.0", + "private": true, + "license": "agpl-3.0", + "main": "./src/index.ts", + "types": "./src/index.ts", + "dependencies": { + "tsconfig": "*", + "typescript": "^4.5.2", + "vscode-uri": "^3.0.3" + }, + "devDependencies": { + "@types/node": "^20.10.6" + } +} diff --git a/apps/quarto-utils/src/index.ts b/apps/quarto-utils/src/index.ts new file mode 100644 index 00000000..ecd26f7f --- /dev/null +++ b/apps/quarto-utils/src/index.ts @@ -0,0 +1,16 @@ +/* + * index.ts + * + * Copyright (C) 2025 by Posit Software, PBC + * + * Unless you have received this program directly from Posit Software pursuant + * to the terms of a commercial license agreement with Posit Software, then + * this program is licensed to you under the terms of version 3 of the + * GNU Affero General Public License. This program is distributed WITHOUT + * ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT, + * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the + * AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details. + * + */ + +export * from './r-utils'; diff --git a/apps/utils/r-utils.ts b/apps/quarto-utils/src/r-utils.ts similarity index 100% rename from apps/utils/r-utils.ts rename to apps/quarto-utils/src/r-utils.ts diff --git a/apps/vscode/package.json b/apps/vscode/package.json index 906214ac..45d70986 100644 --- a/apps/vscode/package.json +++ b/apps/vscode/package.json @@ -1467,6 +1467,7 @@ "@posit-dev/positron": "^0.1.0", "quarto-core": "*", "quarto-lsp": "*", + "quarto-utils": "*", "quarto-vscode-editor": "*", "quarto-vscode-markdownit": "*", "semver": "^7.3.8", diff --git a/apps/vscode/src/r-utils.ts b/apps/vscode/src/r-utils.ts index 5067b5fe..d923e8f4 100644 --- a/apps/vscode/src/r-utils.ts +++ b/apps/vscode/src/r-utils.ts @@ -14,7 +14,7 @@ */ import * as vscode from 'vscode'; -import { isRPackage as isRPackageImpl } from "@utils/r-utils"; +import { isRPackage as isRPackageImpl } from "quarto-utils"; // Version that selects workspace folder export async function isRPackage(): Promise { diff --git a/apps/vscode/tsconfig.json b/apps/vscode/tsconfig.json index 99af7b45..a39e9c99 100644 --- a/apps/vscode/tsconfig.json +++ b/apps/vscode/tsconfig.json @@ -5,10 +5,7 @@ "outDir": "out", "lib": ["ES2021"], "sourceMap": true, - "strict": true, - "paths": { - "@utils/*": ["../utils/*"] - } + "strict": true /* enable all strict type-checking options */ /* Additional Checks */ // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */