Skip to content

Commit 9838c73

Browse files
authored
Extract utils into separate package and bundle it when building (#863)
* Extract `utils` into separate package and bundle it when building * Rename `vscode-quarto-utils` to `quarto-utils`
1 parent eac7ac2 commit 9838c73

File tree

9 files changed

+38
-10
lines changed

9 files changed

+38
-10
lines changed

apps/lsp/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"node-html-parser": "^6.1.5",
2222
"picomatch": "^2.3.1",
2323
"quarto-core": "*",
24+
"quarto-utils": "*",
2425
"uuid": "^8.3.2",
2526
"vscode-languageserver": "^8.1.0",
2627
"vscode-languageserver-textdocument": "^1.0.4",

apps/lsp/src/r-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
*/
1515

16-
import { isRPackage as isRPackageImpl } from "@utils/r-utils";
16+
import { isRPackage as isRPackageImpl } from "quarto-utils";
1717
import { IWorkspace } from './service';
1818

1919
// Version that selects workspace folder

apps/lsp/tsconfig.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
"module": "CommonJS",
55
"outDir": "./dist",
66
"sourceMap": true,
7-
"resolveJsonModule": true,
8-
"paths": {
9-
"@utils/*": ["../utils/*"]
10-
}
7+
"resolveJsonModule": true
118
},
129
"exclude": ["node_modules"],
1310
"extends": "tsconfig/base.json",

apps/quarto-utils/package.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "quarto-utils",
3+
"version": "0.0.0",
4+
"private": true,
5+
"license": "agpl-3.0",
6+
"main": "./src/index.ts",
7+
"types": "./src/index.ts",
8+
"dependencies": {
9+
"tsconfig": "*",
10+
"typescript": "^4.5.2",
11+
"vscode-uri": "^3.0.3"
12+
},
13+
"devDependencies": {
14+
"@types/node": "^20.10.6"
15+
}
16+
}

apps/quarto-utils/src/index.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* index.ts
3+
*
4+
* Copyright (C) 2025 by Posit Software, PBC
5+
*
6+
* Unless you have received this program directly from Posit Software pursuant
7+
* to the terms of a commercial license agreement with Posit Software, then
8+
* this program is licensed to you under the terms of version 3 of the
9+
* GNU Affero General Public License. This program is distributed WITHOUT
10+
* ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
11+
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
12+
* AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details.
13+
*
14+
*/
15+
16+
export * from './r-utils';
File renamed without changes.

apps/vscode/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,6 +1467,7 @@
14671467
"@posit-dev/positron": "^0.1.0",
14681468
"quarto-core": "*",
14691469
"quarto-lsp": "*",
1470+
"quarto-utils": "*",
14701471
"quarto-vscode-editor": "*",
14711472
"quarto-vscode-markdownit": "*",
14721473
"semver": "^7.3.8",

apps/vscode/src/r-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515

1616
import * as vscode from 'vscode';
17-
import { isRPackage as isRPackageImpl } from "@utils/r-utils";
17+
import { isRPackage as isRPackageImpl } from "quarto-utils";
1818

1919
// Version that selects workspace folder
2020
export async function isRPackage(): Promise<boolean> {

apps/vscode/tsconfig.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
"outDir": "out",
66
"lib": ["ES2021"],
77
"sourceMap": true,
8-
"strict": true,
9-
"paths": {
10-
"@utils/*": ["../utils/*"]
11-
}
8+
"strict": true
129
/* enable all strict type-checking options */
1310
/* Additional Checks */
1411
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */

0 commit comments

Comments
 (0)