Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions news/changelog-1.11.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/command/use/commands/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
93 changes: 54 additions & 39 deletions tests/smoke/use/template.test.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,46 @@
import { testQuartoCmd } from "../../test.ts";
import { directoryContainsOnlyAllowedPaths, fileExists, folderExists, 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";

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;
for (const ext of ["jasa", "acm"]) {
const templateFolder = `${ext}-article`;
const workingDir = join(tempDir, templateFolder);
const extensionDir = join(workingDir, "_extensions", "quarto-journals", ext);
ensureDirSync(workingDir);
testQuartoCmd(
"use",
["template", `quarto-journals/${ext}`, "--no-prompt"],
[
noErrorsOrWarnings,
fileExists(`${templateFolder}.qmd`),
folderExists(extensionDir),
],
{
setup: () => {
return Promise.resolve();
},
cwd: () => {
return workingDir;
},
teardown: () => {
try {
Deno.removeSync(workingDir, { recursive: true });
} catch {
}
return Promise.resolve();
},
},
teardown: () => {
try {
Deno.removeSync(workingDir, {recursive: true});
} catch {

}
return Promise.resolve();
}
}
)
);
}

const nonEmptyTemplateFolder = "notempty";
const nonEmptyFileName = `${nonEmptyTemplateFolder}.qmd`;
Expand All @@ -39,25 +50,30 @@ 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: () => {
return nonEmptyWorkingDir;
},
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);
Expand All @@ -75,11 +91,10 @@ testQuartoCmd(
},
teardown: () => {
try {
Deno.removeSync(starterWorkingDir, {recursive: true});
Deno.removeSync(starterWorkingDir, { recursive: true });
} catch {

}
return Promise.resolve();
}
}
)
return Promise.resolve();
},
},
);
Loading