diff --git a/news/changelog-1.8.md b/news/changelog-1.8.md index 25a2f738b6a..9b0fb66634f 100644 --- a/news/changelog-1.8.md +++ b/news/changelog-1.8.md @@ -1,4 +1,10 @@ -All changes included in 1.8: +# v1.9 backports + +## In this release + +- ([#13396](https://github.com/quarto-dev/quarto-cli/issues/13396)): Fix `quarto publish connect` regression. + +# v1.8 changes ## Regression fixes diff --git a/src/deno_ral/tar.ts b/src/deno_ral/tar.ts index f9065c3a445..522d9577c7c 100644 --- a/src/deno_ral/tar.ts +++ b/src/deno_ral/tar.ts @@ -6,36 +6,47 @@ * Abstraction layer over Deno's `tar` utilities. */ -import { TarStream, type TarStreamInput } from "jsr:@std/tar/tar-stream"; +import { TarStream, type TarStreamInput } from "tar/tar-stream"; +import { join } from "../deno_ral/path.ts"; +import { pathWithForwardSlashes } from "../core/path.ts"; /** * Creates a tar archive from the specified files and directories. * @param outputPath The path where the tar archive will be created. - * @param filePaths An array of file and directory paths to include in the tar archive. Paths are relative to outputPath. + * @param filePaths An array of file and directory paths to include in the tar archive. + * @param options Optional configuration for tar creation. + * @param options.baseDir Base directory for resolving relative paths in the archive. * @returns A promise that resolves when the tar archive is created. */ export async function createTarFromFiles( outputPath: string, filePaths: string[], + options?: { baseDir?: string }, ) { + const baseDir = options?.baseDir; + // Create array of TarStreamInput objects from file paths const inputs: TarStreamInput[] = await Promise.all( filePaths.map(async (path) => { - const stat = await Deno.stat(path); + const fullPath = baseDir ? join(baseDir, path) : path; + const stat = await Deno.stat(fullPath); + + // Use original path for archive, full path for reading + const archivePath = pathWithForwardSlashes(path); if (stat.isDirectory) { // Handle directory return { type: "directory", - path: path + (path.endsWith("/") ? "" : "/"), + path: archivePath + (archivePath.endsWith("/") ? "" : "/"), }; } else { // Handle file return { type: "file", - path: path, + path: archivePath, size: stat.size, - readable: (await Deno.open(path)).readable, + readable: (await Deno.open(fullPath)).readable, }; } }), diff --git a/src/publish/common/bundle.ts b/src/publish/common/bundle.ts index b3d2f70c80e..5d8c7c20a7a 100644 --- a/src/publish/common/bundle.ts +++ b/src/publish/common/bundle.ts @@ -10,10 +10,7 @@ import { ensureDirSync } from "../../deno_ral/fs.ts"; import { PublishFiles } from "../provider-types.ts"; import { TempContext } from "../../core/temp-types.ts"; import { md5HashBytes } from "../../core/hash.ts"; -import { pathWithForwardSlashes } from "../../core/path.ts"; -import { copy } from "io/copy"; -import { TarStream, type TarStreamInput } from "tar/tar-stream"; import { createTarFromFiles } from "../../deno_ral/tar.ts"; interface ManifestMetadata { @@ -110,7 +107,7 @@ export async function createBundle( // await copy(tar.getReader(), writer); // writer.close(); - await createTarFromFiles(tarFile, tarFiles); + await createTarFromFiles(tarFile, tarFiles, { baseDir: stageDir }); // compress to tar.gz const targzFile = `${tarFile}.gz`;