Skip to content

Commit fbadcc2

Browse files
claude: Add archiveOnly flag for optional dependencies
Add `archiveOnly` boolean flag to Dependency interface. When true, the dependency is uploaded to S3 via archive-bin-deps but skipped during configure.sh. This enables optional dependencies that are installed separately via `quarto install`. Add verapdf as first archive-only dependency. VeraPDF requires Java and is only needed for PDF/A validation, so it shouldn't be bundled with every quarto installation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent def760f commit fbadcc2

2 files changed

Lines changed: 60 additions & 2 deletions

File tree

‎package/src/common/dependencies/dependencies.ts‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,26 @@ import { esBuild } from "./esbuild.ts";
1515
import { pandoc } from "./pandoc.ts";
1616
import { archiveUrl } from "../archive-binary-dependencies.ts";
1717
import { typst } from "./typst.ts";
18+
import { verapdf } from "./verapdf.ts";
1819

1920
// The list of binary dependencies for Quarto
2021
export const kDependencies = [
2122
deno_dom(version("DENO_DOM")),
2223
pandoc(version("PANDOC")),
2324
dartSass(version("DARTSASS")),
2425
esBuild(version("ESBUILD")),
25-
typst(version("TYPST"))
26+
typst(version("TYPST")),
27+
verapdf(version("VERAPDF")),
2628
];
2729

2830
// Defines a binary dependency for Quarto
2931
export interface Dependency {
3032
name: string;
3133
bucket: string;
3234
version: string;
35+
// If true, this dependency is only archived to S3 but not downloaded during configure.
36+
// Use for optional dependencies installed separately via `quarto install`.
37+
archiveOnly?: boolean;
3338
architectureDependencies: Record<
3439
string,
3540
ArchitectureDependency
@@ -66,8 +71,14 @@ export async function configureDependency(
6671
targetDir: string,
6772
config: PlatformConfiguration,
6873
) {
74+
// Skip archive-only dependencies (installed separately via `quarto install`)
75+
if (dependency.archiveOnly) {
76+
info(`Skipping ${dependency.name} (archive-only)`);
77+
return;
78+
}
79+
6980
info(`Preparing ${dependency.name} (${config.os} - ${config.arch})`);
70-
let archDep = dependency.architectureDependencies[config.arch];
81+
const archDep = dependency.architectureDependencies[config.arch];
7182

7283
if (archDep) {
7384
const platformDep = archDep[config.os];
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* verapdf.ts
3+
*
4+
* Copyright (C) 2020-2022 Posit Software, PBC
5+
*/
6+
7+
import { Dependency } from "./dependencies.ts";
8+
9+
export function verapdf(version: string): Dependency {
10+
// VeraPDF is a Java application distributed as an installer ZIP.
11+
// The same artifact works on all platforms.
12+
const filename = `verapdf-greenfield-${version}-installer.zip`;
13+
// Version format is X.Y.Z, but releases are organized under X.Y directories
14+
const majorMinor = version.substring(0, version.lastIndexOf("."));
15+
const url =
16+
`https://software.verapdf.org/releases/${majorMinor}/${filename}`;
17+
18+
// VeraPDF is an archive-only dependency - it's uploaded to S3 for
19+
// `quarto install verapdf` but not automatically installed during configure.
20+
// This is because it requires Java and is only needed for PDF/A validation.
21+
const release = {
22+
filename,
23+
url,
24+
configure: async () => {
25+
// No-op: verapdf is installed via `quarto install verapdf`, not configure.sh
26+
},
27+
};
28+
29+
return {
30+
name: "VeraPDF",
31+
bucket: "verapdf",
32+
version,
33+
archiveOnly: true,
34+
// Same artifact for all platforms since it's Java
35+
architectureDependencies: {
36+
"x86_64": {
37+
"darwin": release,
38+
"linux": release,
39+
"windows": release,
40+
},
41+
"aarch64": {
42+
"darwin": release,
43+
"linux": release,
44+
},
45+
},
46+
};
47+
}

0 commit comments

Comments
 (0)