Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
8132c37
Initial architecture refactoring and Quarto API foundation
gordonwoodhull Sep 22, 2025
63d0fb7
Port Julia engine to Discovery pattern and expand Quarto API
gordonwoodhull Oct 28, 2025
2855316
Port Jupyter and Knitr engines and complete Quarto API
gordonwoodhull Oct 30, 2025
71656db
Move Julia to extension, remove legacy patterns, make check extensible
gordonwoodhull Nov 3, 2025
7a9d374
Add git subtree infrastructure and move Julia to bundled extension
gordonwoodhull Nov 5, 2025
dcb6987
Polish architecture and improve Julia tests
gordonwoodhull Nov 10, 2025
ee9a26f
Merge extension metadata and engines for single-file project context
gordonwoodhull Aug 8, 2025
7970b68
Add engine template, organize subtree extensions, and final fixes
gordonwoodhull Nov 13, 2025
b9fae13
simplify imports to quarto api
gordonwoodhull Nov 18, 2025
ec45315
simplify incorrect import
gordonwoodhull Nov 18, 2025
49ad9a0
enable experimental regexp engine
gordonwoodhull Nov 18, 2025
6e4272c
move target index cache metrics to own module
gordonwoodhull Nov 18, 2025
9ed73ba
Accept cell language as command-line argument for engine extensions
gordonwoodhull Nov 18, 2025
b5a58d4
claude: Add build-ts-extension command for TypeScript engine extensions
gordonwoodhull Nov 19, 2025
c73377d
claude: Fix extension-build import-map to work in both dev and dist m…
gordonwoodhull Nov 19, 2025
f16389c
claude: Add --init-config flag to build-ts-extension command
gordonwoodhull Nov 19, 2025
1f1c2db
claude: Align engine template with build-ts-extension system
gordonwoodhull Nov 19, 2025
2488db0
claude: Use glob pattern to find _extension.yml at any depth
gordonwoodhull Nov 19, 2025
a3dd533
claude: Simplify import map and add external dependencies support
gordonwoodhull Nov 19, 2025
fe39afd
claude: Replace esbuild with deno bundle for extension building
gordonwoodhull Nov 19, 2025
8461d72
claude: Add optional entry-point argument to build-ts-extension
gordonwoodhull Nov 19, 2025
532a9b8
claude: Rename quartoExtension to bundle in deno.json config
gordonwoodhull Nov 19, 2025
8f3485b
claude: Allow bundle.outputFile to be just a filename
gordonwoodhull Nov 19, 2025
6598b19
update test deno.json
gordonwoodhull Nov 19, 2025
fd33143
claude: idiomatic errors and warnings
gordonwoodhull Nov 19, 2025
b560f6b
artifacts
gordonwoodhull Nov 20, 2025
9aedc82
Merge commit '491ea7006d37ae49821cc7c96e0a6ff5e4cd1229' as 'src/resou…
gordonwoodhull Nov 20, 2025
491ea70
Squashed 'src/resources/extension-subtrees/julia-engine/' content fro…
gordonwoodhull Nov 20, 2025
d24eadd
claude: Move build-ts-extension from dev-call to call command
gordonwoodhull Nov 20, 2025
8ca3c7f
Merge commit 'fe9616518629c470c17e53ec41587b15e7690150' into feature/…
gordonwoodhull Nov 20, 2025
fe96165
Squashed 'src/resources/extension-subtrees/julia-engine/' changes fro…
gordonwoodhull Nov 20, 2025
ca0575b
claude: Fix quarto check julia by loading bundled engines in zero-fil…
gordonwoodhull Nov 20, 2025
3115a37
claude: Improve build-ts-extension error messages
gordonwoodhull Nov 20, 2025
27d381e
claude: Add Quarto API and error message documentation
gordonwoodhull Nov 20, 2025
ac01323
claude: Fix engine extension test by adding build step
gordonwoodhull Nov 20, 2025
a036936
claude: Make Windows smoke tests fail-fast like Linux
gordonwoodhull Nov 20, 2025
a8ea020
claude: add error,info,warning to quarto console api
gordonwoodhull Nov 21, 2025
7db0746
Squashed 'src/resources/extension-subtrees/julia-engine/' changes fro…
gordonwoodhull Nov 21, 2025
0760a61
Merge commit '7db0746426b9b828b2c43b9b5050c6f70cd57ed6' into feature/…
gordonwoodhull Nov 21, 2025
50f874f
Squashed 'src/resources/extension-subtrees/julia-engine/' changes fro…
gordonwoodhull Nov 21, 2025
6a95d70
Merge commit '50f874f8bb92fde4118dd0b88fb12dc455decee5' into feature/…
gordonwoodhull Nov 21, 2025
26dd252
claude: Fix build-ts-extension to respect deno.json entryPoint and im…
gordonwoodhull Nov 21, 2025
8b1af04
claude: Add smoke test for build-ts-extension
gordonwoodhull Nov 21, 2025
5fbbf59
claude: Fix bundler top-level await issue with log functions
gordonwoodhull Nov 21, 2025
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
16 changes: 4 additions & 12 deletions .github/workflows/test-smokes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -276,23 +276,15 @@ jobs:
# Useful as TinyTeX latest release is checked in run-test.sh
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$haserror=$false
foreach ($file in ('${{ inputs.buckets }}' | ConvertFrom-Json)) {
Write-Host ">>> ./run-tests.ps1 ${file}"
./run-tests.ps1 $file
$status=$LASTEXITCODE
if ($status -eq 1) {
Write-Host ">>> Error found in test file"
$haserror=$true
} else {
Write-Host ">>> No error in this test file"
if ($LASTEXITCODE -ne 0) {
Exit 1
}
Write-Host ">>> No error in this test file"
}
if ($haserror) {
Exit 1
} else {
Write-Host ">>> All tests have passed"
}
Write-Host ">>> All tests have passed"
working-directory: tests
shell: pwsh

Expand Down
41 changes: 41 additions & 0 deletions dev-docs/subtree-extensions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Subtree extensions

Subtree extensions live in `src/resources/subtree-extensions`.

Each is the complete git repository of a Quarto extension, e.g. the directory tree for the Julia engine looks like

```
src/resources/extension-subtrees/
julia-engine/
_extensions/
julia-engine/
_extension.yml
julia-engine.ts
...
```

The command to add or update a subtree is

```
quarto dev-call pull-git-subtree subtree-name
```

Omit _subtree-name_ to add/update all.

The code in `src/command/dev-call/pull-git-subtree/cmd.ts` contains a table of subtree

- `name`
- `prefix` (subdirectory)
- `remoteUrl`
- `remoteBranch`

If the command is successful, it will add two commits, one the squashed changes from the remote repo and one a merge commit.

The commits have subtree status information in the message and metadata, so don't change them.

The commits can't be rebased -- you'll get weird errors indicating it tried to merge changes at the root of the repo.

So you must either

- run the command when ready to merge to main, or
- remove the commits when rebasing, and run the `dev-call` command again
103 changes: 103 additions & 0 deletions llm-docs/error-messages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Writing Error Messages in Quarto

## The Rule

Each `error()`, `warning()`, or `info()` call should be **exactly one line**.

- ✅ End messages with `\n` to add blank lines after
- ❌ Never start messages with `\n`
- ❌ Never use empty `error("")` calls

## Why This Matters

Quarto's logging prefixes each call with `ERROR:` / `WARNING:` / `INFO:`. Starting a message with `\n` or using empty calls creates confusing output:

```
ERROR: Multiple files found
ERROR:
Or specify entry point: ← Empty "ERROR:" line from \n at start
```

## Adding Blank Lines

To add a blank line between sections, end the **previous** message with `\n`:

### ✅ Good

```typescript
error("Multiple .ts files found in src/\n"); // \n at END
error("Specify entry point as argument:");
error(" quarto call build-ts-extension src/my-engine.ts");
```

Output:
```
ERROR: Multiple .ts files found in src/
ERROR:
ERROR: Specify entry point as argument:
ERROR: quarto call build-ts-extension src/my-engine.ts
```

### ❌ Bad

```typescript
error("Multiple .ts files found in src/");
error("\nSpecify entry point as argument:"); // \n at START
error(" quarto call build-ts-extension src/my-engine.ts");
```

Output:
```
ERROR: Multiple .ts files found in src/
ERROR:
ERROR: Specify entry point as argument: ← Blank "ERROR:" line before
ERROR: quarto call build-ts-extension src/my-engine.ts
```

### ❌ Also Bad

```typescript
error("Multiple .ts files found in src/");
error(""); // Empty call to add spacing
error("Specify entry point as argument:");
```

Output:
```
ERROR: Multiple .ts files found in src/
ERROR: ← Empty "ERROR:" line
ERROR: Specify entry point as argument:
```

## Complete Example

Here's a real example from `build-ts-extension` showing proper formatting:

### ✅ Good

```typescript
error("No src/ directory found.\n");
error("Create a TypeScript file in src/:");
error(" mkdir -p src");
error(" touch src/my-engine.ts\n");
error("Or specify entry point as argument:");
error(" quarto call build-ts-extension src/my-engine.ts");
```

Output:
```
ERROR: No src/ directory found.
ERROR:
ERROR: Create a TypeScript file in src/:
ERROR: mkdir -p src
ERROR: touch src/my-engine.ts
ERROR:
ERROR: Or specify entry point as argument:
ERROR: quarto call build-ts-extension src/my-engine.ts
```

Notice:
- Each `error()` call is one complete line
- Blank lines are created by ending the previous message with `\n`
- Indentation (with spaces) is preserved within each message
- Message flow is clear and readable
188 changes: 188 additions & 0 deletions llm-docs/quarto-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
# Quarto API and @quarto/types

## Building @quarto/types

To build the @quarto/types package:

```
cd packages/quarto-types
npm run build
```

This runs typecheck and then bundles all type definitions into `dist/index.d.ts`.

---

## Updating the Quarto API

The Quarto API is how external execution engines access Quarto's core functionality. The API exists in two places:

1. **Type definitions** in `packages/quarto-types/` - consumed by external engines (TypeScript)
2. **Implementation** in `src/core/quarto-api.ts` - used within quarto-cli

### Step-by-step: Adding to the Quarto API

Follow these steps in order when adding new functionality to the API:

#### 1. Update quarto-types type definitions

**Add auxiliary types** (if needed):

- Types belong in `packages/quarto-types/src/`
- Follow the existing file organization:
- `system.ts` - System/process types (ProcessResult, TempContext, etc.)
- `console.ts` - Console/UI types (SpinnerOptions, etc.)
- `jupyter.ts` - Jupyter-specific types
- `check.ts` - Check command types
- `execution.ts` - Execution engine types
- etc.
- Create new files if needed for logical grouping

**Export types from index.ts:**

```typescript
// In packages/quarto-types/src/index.ts
export type * from "./your-new-file.ts";
```

**Add to QuartoAPI interface:**

```typescript
// In packages/quarto-types/src/quarto-api.ts

// 1. Import any new types at the top
import type { YourNewType } from "./your-file.ts";

// 2. Add to the QuartoAPI interface
export interface QuartoAPI {
// ... existing namespaces

yourNamespace: {
yourMethod: (param: YourNewType) => ReturnType;
};
}
```

#### 2. Test the type definitions

```bash
cd packages/quarto-types
npm run build
```

This will:

- Run `tsc --noEmit` to typecheck
- Bundle types into `dist/index.d.ts`
- Show any type errors

Fix any errors before proceeding.

#### 3. Update the internal QuartoAPI interface

The file `src/core/quarto-api.ts` contains a **duplicate** QuartoAPI interface definition used for the internal implementation. Update it to match:

```typescript
// In src/core/quarto-api.ts (near top of file)
export interface QuartoAPI {
// ... existing namespaces

yourNamespace: {
yourMethod: (param: YourNewType) => ReturnType;
};
}
```

**Note:** This interface must match the one in quarto-types, but uses internal types.

#### 4. Wire up the implementation

Still in `src/core/quarto-api.ts`:

**Add imports** (near top):

```typescript
import { yourMethod } from "./your-module.ts";
```

**Add to quartoAPI object** (at bottom):

```typescript
export const quartoAPI: QuartoAPI = {
// ... existing namespaces

yourNamespace: {
yourMethod,
},
};
```

#### 5. Verify with typecheck

Run the quarto typecheck:

```bash
package/dist/bin/quarto
```

No output means success! Fix any type errors.

#### 6. Commit with built artifact

**Always commit the built `dist/index.d.ts` file** along with source changes:

```bash
git add packages/quarto-types/src/your-file.ts \
packages/quarto-types/src/index.ts \
packages/quarto-types/src/quarto-api.ts \
packages/quarto-types/dist/index.d.ts \
src/core/quarto-api.ts

git commit -m "Add yourNamespace to Quarto API"
```

### Using the Quarto API in source files

#### Inside quarto-cli (internal modules)

```typescript
// Import the quartoAPI instance
import { quartoAPI as quarto } from "../../core/quarto-api.ts";

// Use it
const caps = await quarto.jupyter.capabilities();
await quarto.console.withSpinner({ message: "Working..." }, async () => {
// do work
});
```

#### External engines

External engines receive the API via their `init()` method:

```typescript
let quarto: QuartoAPI;

export const myEngineDiscovery: ExecutionEngineDiscovery = {
init: (quartoAPI: QuartoAPI) => {
quarto = quartoAPI; // Store for later use
},

// ... other methods can now use quarto
};
```

#### Removing old imports

When moving functionality to the API, **remove direct imports** from internal modules:

```typescript
// ❌ OLD - direct import
import { withSpinner } from "../../core/console.ts";

// ✅ NEW - use API
import { quartoAPI as quarto } from "../../core/quarto-api.ts";
const result = await quarto.console.withSpinner(...);
```

This ensures external engines and internal code use the same interface.
Loading
Loading