From aebbea14b74bb9d777aca387e04a847aa35e59da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Canouil?= <8896044+mcanouil@users.noreply.github.com> Date: Sun, 8 Feb 2026 20:43:56 +0100 Subject: [PATCH 1/6] fix: `quarto use template` creates empty `_extensions` folder and fails to copy extensions Fixes #14008 --- src/command/use/commands/template.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/command/use/commands/template.ts b/src/command/use/commands/template.ts index 3bd1c40b6b8..9ee7ab185d6 100644 --- a/src/command/use/commands/template.ts +++ b/src/command/use/commands/template.ts @@ -157,7 +157,7 @@ async function useTemplate( // Copy the extensions into a substaging directory // this will ensure that they are namespaced properly const subStagedDir = tempContext.createDir(); - await copyExtensions(source, stagedDir, subStagedDir); + await copyExtensions(source, extDir, subStagedDir); // Now complete installation from this sub-staged directory await completeInstallation(subStagedDir, outputDirectory); From 41b5a908ef584b90948bfef09f9ae0ae0854ab38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Canouil?= <8896044+mcanouil@users.noreply.github.com> Date: Sun, 8 Feb 2026 20:44:06 +0100 Subject: [PATCH 2/6] test: Refactor template tests to iterate over extensions Update the template tests to dynamically handle multiple extensions. This change improves test coverage and ensures that both 'jasa' and 'acm' templates are validated correctly. --- tests/smoke/use/template.test.ts | 50 +++++++++++++++++--------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/tests/smoke/use/template.test.ts b/tests/smoke/use/template.test.ts index b1c17a47da8..9fe96efb9fe 100644 --- a/tests/smoke/use/template.test.ts +++ b/tests/smoke/use/template.test.ts @@ -1,35 +1,37 @@ import { testQuartoCmd } from "../../test.ts"; -import { directoryContainsOnlyAllowedPaths, fileExists, folderExists, noErrorsOrWarnings, printsMessage } from "../../verify.ts"; +import { directoryContainsOnlyAllowedPaths, fileExists, noErrorsOrWarnings, printsMessage } from "../../verify.ts"; import { join } from "../../../src/deno_ral/path.ts"; import { ensureDirSync } from "../../../src/deno_ral/fs.ts"; const tempDir = Deno.makeTempDirSync(); -const templateFolder = "article"; -const workingDir = join(tempDir, templateFolder); -const extensionsDir = join(workingDir, "_extensions"); -ensureDirSync(workingDir); -testQuartoCmd( - "use", - ["template", "quarto-journals/jasa", "--no-prompt"], - [noErrorsOrWarnings, fileExists(`${templateFolder}.qmd`), folderExists(extensionsDir)], - { - setup: () => { - return Promise.resolve(); - }, - cwd: () => { - return workingDir; - }, - teardown: () => { - try { - Deno.removeSync(workingDir, {recursive: true}); - } catch { +for (const ext of ["jasa", "acm"]) { + const templateFolder = `${ext}-article`; + const workingDir = join(tempDir, templateFolder); + const extensionYml = join(workingDir, "_extensions", "quarto-journals", ext, "_extension.yml"); + ensureDirSync(workingDir); + testQuartoCmd( + "use", + ["template", `quarto-journals/${ext}`, "--no-prompt"], + [noErrorsOrWarnings, fileExists(`${templateFolder}.qmd`), fileExists(extensionYml)], + { + setup: () => { + return Promise.resolve(); + }, + cwd: () => { + return workingDir; + }, + teardown: () => { + try { + Deno.removeSync(workingDir, {recursive: true}); + } catch { + } + return Promise.resolve(); } - return Promise.resolve(); } - } -) + ) +} const nonEmptyTemplateFolder = "notempty"; const nonEmptyFileName = `${nonEmptyTemplateFolder}.qmd`; @@ -52,7 +54,7 @@ testQuartoCmd( try { Deno.removeSync(nonEmptyWorkingDir, {recursive: true}); } catch { - + } return Promise.resolve(); } From 861ef318208410ab78d13f55e65aa3a096664577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Canouil?= <8896044+mcanouil@users.noreply.github.com> Date: Sun, 8 Feb 2026 20:46:53 +0100 Subject: [PATCH 3/6] chore: update changelog --- news/changelog-1.9.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/news/changelog-1.9.md b/news/changelog-1.9.md index fb86c640009..7a0039e4e3b 100644 --- a/news/changelog-1.9.md +++ b/news/changelog-1.9.md @@ -172,6 +172,10 @@ All changes included in 1.9: ## Commands +### `use template` + +- ([#14008](https://github.com/quarto-dev/quarto-cli/issues/14008)): Fix `quarto use template` failing to install extensions from GitHub organisation repositories (e.g., `quarto-journals/acm`). (author: @mcanouil) + ### `use brand` - ([#13828](https://github.com/quarto-dev/quarto-cli/pull/13828)): New `quarto use brand` command copies and synchronizes the `_brand/` directory from a repo, directory, or ZIP file. See [the prerelease documentation](https://prerelease.quarto.org/docs/authoring/brand.html#quarto-use-brand) for details. From dfbd0639618f49ae77d1eab734b70099e2c59a8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Canouil?= <8896044+mcanouil@users.noreply.github.com> Date: Sun, 8 Feb 2026 20:51:20 +0100 Subject: [PATCH 4/6] chore: update changelog entry --- news/changelog-1.9.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/changelog-1.9.md b/news/changelog-1.9.md index 7a0039e4e3b..f758484c963 100644 --- a/news/changelog-1.9.md +++ b/news/changelog-1.9.md @@ -174,7 +174,7 @@ All changes included in 1.9: ### `use template` -- ([#14008](https://github.com/quarto-dev/quarto-cli/issues/14008)): Fix `quarto use template` failing to install extensions from GitHub organisation repositories (e.g., `quarto-journals/acm`). (author: @mcanouil) +- ([#14008](https://github.com/quarto-dev/quarto-cli/issues/14008)): Fix `quarto use template` failing to install extensions from GitHub organisation repositories when the extension was scoped with the organisation (e.g., `quarto-journals/acm`). (author: @mcanouil) ### `use brand` From 6fd18cffceeb4372815a8264f4e38388835fe0c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Canouil?= <8896044+mcanouil@users.noreply.github.com> Date: Sun, 18 Oct 2026 21:04:17 +0200 Subject: [PATCH 5/6] test: assert the scoped extension folder in use template tests --- tests/smoke/use/template.test.ts | 59 +++++++++++++++++++------------- 1 file changed, 36 insertions(+), 23 deletions(-) diff --git a/tests/smoke/use/template.test.ts b/tests/smoke/use/template.test.ts index 9fe96efb9fe..80f11195abf 100644 --- a/tests/smoke/use/template.test.ts +++ b/tests/smoke/use/template.test.ts @@ -1,5 +1,11 @@ import { testQuartoCmd } from "../../test.ts"; -import { directoryContainsOnlyAllowedPaths, fileExists, noErrorsOrWarnings, printsMessage } from "../../verify.ts"; +import { + directoryContainsOnlyAllowedPaths, + fileExists, + folderExists, + noErrorsOrWarnings, + printsMessage, +} from "../../verify.ts"; import { join } from "../../../src/deno_ral/path.ts"; import { ensureDirSync } from "../../../src/deno_ral/fs.ts"; @@ -8,12 +14,16 @@ const tempDir = Deno.makeTempDirSync(); for (const ext of ["jasa", "acm"]) { const templateFolder = `${ext}-article`; const workingDir = join(tempDir, templateFolder); - const extensionYml = join(workingDir, "_extensions", "quarto-journals", ext, "_extension.yml"); + const extensionDir = join(workingDir, "_extensions", "quarto-journals", ext); ensureDirSync(workingDir); testQuartoCmd( "use", ["template", `quarto-journals/${ext}`, "--no-prompt"], - [noErrorsOrWarnings, fileExists(`${templateFolder}.qmd`), fileExists(extensionYml)], + [ + noErrorsOrWarnings, + fileExists(`${templateFolder}.qmd`), + folderExists(extensionDir), + ], { setup: () => { return Promise.resolve(); @@ -23,14 +33,13 @@ for (const ext of ["jasa", "acm"]) { }, teardown: () => { try { - Deno.removeSync(workingDir, {recursive: true}); + Deno.removeSync(workingDir, { recursive: true }); } catch { - } - return Promise.resolve(); - } - } - ) + return Promise.resolve(); + }, + }, + ); } const nonEmptyTemplateFolder = "notempty"; @@ -41,10 +50,16 @@ ensureDirSync(nonEmptyWorkingDir); testQuartoCmd( "use", ["template", "quarto-journals/jasa", "--no-prompt"], - [printsMessage({level: "ERROR", regex: /directory isn't empty/}), directoryContainsOnlyAllowedPaths(nonEmptyWorkingDir, [nonEmptyFileName])], + [ + printsMessage({ level: "ERROR", regex: /directory isn't empty/ }), + directoryContainsOnlyAllowedPaths(nonEmptyWorkingDir, [nonEmptyFileName]), + ], { setup: () => { - Deno.writeTextFileSync(join(nonEmptyWorkingDir, nonEmptyFileName), "Just making a non-empty file!"); + Deno.writeTextFileSync( + join(nonEmptyWorkingDir, nonEmptyFileName), + "Just making a non-empty file!", + ); return Promise.resolve(); }, cwd: () => { @@ -52,14 +67,13 @@ testQuartoCmd( }, teardown: () => { try { - Deno.removeSync(nonEmptyWorkingDir, {recursive: true}); + Deno.removeSync(nonEmptyWorkingDir, { recursive: true }); } catch { - } - return Promise.resolve(); - } - } -) + return Promise.resolve(); + }, + }, +); const starterFolder = "starterFolder"; const starterWorkingDir = join(tempDir, starterFolder); @@ -77,11 +91,10 @@ testQuartoCmd( }, teardown: () => { try { - Deno.removeSync(starterWorkingDir, {recursive: true}); + Deno.removeSync(starterWorkingDir, { recursive: true }); } catch { - } - return Promise.resolve(); - } - } -) + return Promise.resolve(); + }, + }, +); From 9e586033aa14f207ad7e674e898fb44f574624d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Canouil?= <8896044+mcanouil@users.noreply.github.com> Date: Sun, 18 Oct 2026 21:04:43 +0200 Subject: [PATCH 6/6] docs: move use template changelog entry to 1.11 --- news/changelog-1.11.md | 4 ++++ news/changelog-1.9.md | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/news/changelog-1.11.md b/news/changelog-1.11.md index 839d7ca3606..02d4ec1238d 100644 --- a/news/changelog-1.11.md +++ b/news/changelog-1.11.md @@ -120,6 +120,10 @@ All changes included in 1.11: - ([#14960](https://github.com/quarto-dev/quarto-cli/issues/14960)): Fix `quarto check` failing when the project contains a directory it cannot read, for example when a stray `_quarto.yml` in the home directory makes the home directory a project. `quarto check` now reads only the project configuration, without scanning input files or creating a `.quarto` directory in the project root. `quarto check info` reports the project root and the `_quarto.yml` that set it (`info.project` in `--output` JSON), and warns when the project root is the home directory or a filesystem root. `quarto render` and `quarto preview` now report an unreadable directory in the project as one error naming the directory, the project root and its `_quarto.yml`, instead of a raw `readdir` error with a stack trace. +### `use template` + +- ([#14008](https://github.com/quarto-dev/quarto-cli/issues/14008)): Fix `quarto use template` not installing the template's extensions when they are scoped by organisation, such as `quarto-journals/acm`. (author: @mcanouil) + ## Extensions - ([#14936](https://github.com/quarto-dev/quarto-cli/pull/14936)): Accept and ignore static engine declaration keys (`name`, `claims`, `file-extensions`, `claims-files` — including an optional `processor` on `claims-files` entries) in the `external-engine` schema, so extensions can declare them for Quarto 2's engine resolution without breaking Quarto 1 validation. No Quarto 1 behavior change. (author: @gordonwoodhull) diff --git a/news/changelog-1.9.md b/news/changelog-1.9.md index f758484c963..fb86c640009 100644 --- a/news/changelog-1.9.md +++ b/news/changelog-1.9.md @@ -172,10 +172,6 @@ All changes included in 1.9: ## Commands -### `use template` - -- ([#14008](https://github.com/quarto-dev/quarto-cli/issues/14008)): Fix `quarto use template` failing to install extensions from GitHub organisation repositories when the extension was scoped with the organisation (e.g., `quarto-journals/acm`). (author: @mcanouil) - ### `use brand` - ([#13828](https://github.com/quarto-dev/quarto-cli/pull/13828)): New `quarto use brand` command copies and synchronizes the `_brand/` directory from a repo, directory, or ZIP file. See [the prerelease documentation](https://prerelease.quarto.org/docs/authoring/brand.html#quarto-use-brand) for details.