Skip to content

Commit 532a9b8

Browse files
claude: Rename quartoExtension to bundle in deno.json config
Renamed the deno.json configuration section from "quartoExtension" to "bundle" for better semantic alignment with the underlying deno bundle command. Mapping to deno bundle CLI options: - bundle.entryPoint → [file] positional argument - bundle.outputFile → --output <output> (✅) - bundle.minify → --minify (✅) - bundle.sourcemap → --sourcemap[=<sourcemap>] (✅) The "bundle" name is more intuitive and accurately reflects that these are bundling configuration options that map to deno bundle CLI flags. Updated all references: - Interface definition: DenoConfig.bundle - All config.bundle references throughout - Documentation strings - Error messages with example JSON Example deno.json: { "bundle": { "entryPoint": "src/main.ts", "outputFile": "_extensions/my-ext/main.js", "minify": true, "sourcemap": "linked" } } 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 8461d72 commit 532a9b8

File tree

1 file changed

+11
-11
lines changed
  • src/command/dev-call/build-ts-extension

1 file changed

+11
-11
lines changed

src/command/dev-call/build-ts-extension/cmd.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ interface DenoConfig {
2121
compilerOptions?: Record<string, unknown>;
2222
importMap?: string;
2323
imports?: Record<string, string>;
24-
quartoExtension?: {
24+
bundle?: {
2525
entryPoint?: string;
2626
outputFile?: string;
2727
minify?: boolean;
@@ -96,7 +96,7 @@ async function autoDetectEntryPoint(
9696
error(" quarto dev-call build-ts-extension src/my-engine.ts");
9797
error(" OR in deno.json:");
9898
error(" {");
99-
error(' "quartoExtension": {');
99+
error(' "bundle": {');
100100
error(' "entryPoint": "path/to/file.ts"');
101101
error(" }");
102102
error(" }");
@@ -146,7 +146,7 @@ async function autoDetectEntryPoint(
146146
error(" quarto dev-call build-ts-extension src/my-engine.ts");
147147
error(" OR in deno.json:");
148148
error(" {");
149-
error(' "quartoExtension": {');
149+
error(' "bundle": {');
150150
error(' "entryPoint": "src/my-engine.ts"');
151151
error(" }");
152152
error(" }");
@@ -203,7 +203,7 @@ function inferOutputPath(entryPoint: string): string {
203203
error("");
204204
error("Specify the output path in deno.json:");
205205
error(" {");
206-
error(' "quartoExtension": {');
206+
error(' "bundle": {');
207207
error(
208208
` "outputFile": "${extensionYmlFiles[0]}/${fileName}.js"`,
209209
);
@@ -227,7 +227,7 @@ async function bundle(
227227
architectureToolsPath("deno");
228228

229229
// Determine output path
230-
const outputPath = config.quartoExtension?.outputFile ||
230+
const outputPath = config.bundle?.outputFile ||
231231
inferOutputPath(entryPoint);
232232

233233
// Ensure output directory exists
@@ -245,12 +245,12 @@ async function bundle(
245245
];
246246

247247
// Add optional flags
248-
if (config.quartoExtension?.minify) {
248+
if (config.bundle?.minify) {
249249
args.push("--minify");
250250
}
251251

252-
if (config.quartoExtension?.sourcemap) {
253-
const sourcemapValue = config.quartoExtension.sourcemap;
252+
if (config.bundle?.sourcemap) {
253+
const sourcemapValue = config.bundle.sourcemap;
254254
if (typeof sourcemapValue === "string") {
255255
args.push(`--sourcemap=${sourcemapValue}`);
256256
} else {
@@ -350,7 +350,7 @@ async function initializeConfig(): Promise<void> {
350350
info(` Import map: ${importMapPath}`);
351351
info("");
352352
info("Customize as needed:");
353-
info(' - Add "quartoExtension" section for build options:');
353+
info(' - Add "bundle" section for build options:');
354354
info(' "entryPoint": "src/my-engine.ts"');
355355
info(' "outputFile": "_extensions/my-engine/my-engine.js"');
356356
info(' "minify": true');
@@ -368,7 +368,7 @@ export const buildTsExtensionCommand = new Command()
368368
"into single JavaScript files using Quarto's bundled deno bundle.\n\n" +
369369
"The entry point is determined by:\n" +
370370
" 1. [entry-point] command-line argument (if specified)\n" +
371-
" 2. quartoExtension.entryPoint in deno.json (if specified)\n" +
371+
" 2. bundle.entryPoint in deno.json (if specified)\n" +
372372
" 3. Single .ts file in src/ directory\n" +
373373
" 4. src/mod.ts (if multiple .ts files exist)",
374374
)
@@ -391,7 +391,7 @@ export const buildTsExtensionCommand = new Command()
391391
// 2. Resolve entry point (CLI arg takes precedence)
392392
const entryPoint = entryPointArg ||
393393
await autoDetectEntryPoint(
394-
config.quartoExtension?.entryPoint,
394+
config.bundle?.entryPoint,
395395
);
396396
info(`Entry point: ${entryPoint}`);
397397

0 commit comments

Comments
 (0)