Skip to content

Commit 0cadc5e

Browse files
committed
Fix typst package staging to use input directory instead of file path
stageTypstPackages and collectPackageSources received the execution target input path (which is the transient .quarto_ipynb for Jupyter targets). These functions only need the directory for extension discovery via inputExtensionDirs. Using the file path caused a NotFound error when the transient notebook was already cleaned up. Pass inputDir (already computed by dirAndStem) instead of input.
1 parent 465bd81 commit 0cadc5e

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/command/render/output-typst.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export interface NeededPackage {
6262

6363
// Collect all package source directories (built-in + extensions)
6464
async function collectPackageSources(
65-
input: string,
65+
inputDir: string,
6666
projectDir: string,
6767
): Promise<string[]> {
6868
const sources: string[] = [];
@@ -74,7 +74,7 @@ async function collectPackageSources(
7474
}
7575

7676
// 2. Extension packages
77-
const extensionDirs = inputExtensionDirs(input, projectDir);
77+
const extensionDirs = inputExtensionDirs(inputDir, projectDir);
7878
const subtreePath = builtinSubtreeExtensions();
7979
for (const extDir of extensionDirs) {
8080
const extensions = extDir === subtreePath
@@ -173,15 +173,15 @@ export function stageAllPackages(sources: string[], cacheDir: string): void {
173173
// Stage typst packages to .quarto/typst-packages/
174174
// First stages built-in packages, then extension packages (which can override)
175175
async function stageTypstPackages(
176-
input: string,
176+
inputDir: string,
177177
typstInput: string,
178178
projectDir?: string,
179179
): Promise<string | undefined> {
180180
if (!projectDir) {
181181
return undefined;
182182
}
183183

184-
const packageSources = await collectPackageSources(input, projectDir);
184+
const packageSources = await collectPackageSources(inputDir, projectDir);
185185
if (packageSources.length === 0) {
186186
return undefined;
187187
}
@@ -249,7 +249,7 @@ export function typstPdfOutputRecipe(
249249

250250
// Stage extension typst packages
251251
const packagePath = await stageTypstPackages(
252-
input,
252+
inputDir,
253253
typstInput,
254254
project.dir,
255255
);

0 commit comments

Comments
 (0)