Compare commits

...
Author SHA1 Message Date
saberzero1 ea4b07518c chore(deps): og-image 1.2.0 (social images from the content folder) 2026-11-28 13:12:04 +01:00
Emile Bangma afebc38b3b Merge pull request #2723 from jackyzha0/dev-mode/remove-legacy-tag-job
ci: remove the legacy publish-tag job, which made every release tag unverified
2026-11-28 00:58:29 +01:00
saberzero1 c7131c909f ci: remove the legacy publish-tag job, which made every release tag unverified 2026-11-28 00:52:51 +01:00
Emile Bangma 5a740b3ae0 Merge pull request #2717 from jackyzha0/changeset-release/v5
chore: release Quartz
2026-11-28 00:47:01 +01:00
github-actions[bot] 6f67702b3e chore: release Quartz 2026-11-27 22:58:40 +00:00
Emile Bangma 685a5c3461 Merge pull request #2721 from jackyzha0/dev-mode/release-notes-5-3-1
docs: changes you may notice in 5.3.1
2026-11-27 23:58:13 +01:00
Emile Bangma 114923ac6a Merge pull request #2720 from jackyzha0/dev-mode/locale-fallback
fix(i18n): a locale without a translation falls back instead of crashing the build
2026-11-27 23:58:07 +01:00
Emile Bangma a7d7389f57 Merge pull request #2719 from jackyzha0/dev-mode/update-disabled-plugin-failure
fix(cli): a disabled plugin that can't be updated warns instead of failing the update
2026-11-27 23:58:01 +01:00
Emile Bangma 699c668cba Merge pull request #2722 from jackyzha0/dev-mode/deps-5-3-1-fixes
chore(deps): plugin fixes for 5.3.1
2026-11-27 23:57:54 +01:00
saberzero1 9889d3fb04 chore(deps): folder-page 1.1.5, canvas-page 1.1.7, search 1.1.5, graph 1.0.10, stacked-pages 1.0.5, remark-obsidian 2.2.6 2026-11-27 23:47:25 +01:00
saberzero1 c68a4945ab docs: changes you may notice in 5.3.1 2026-11-27 23:23:44 +01:00
saberzero1 57b3b5d0af fix(cli): a disabled plugin that can't be updated warns instead of failing the update 2026-11-27 23:20:59 +01:00
14 changed files with 176 additions and 97 deletions

No files matched your search

-5
View File
@@ -1,5 +0,0 @@
---
"@jackyzha0/quartz": patch
---
A plugin that depends on a plugin of another pipeline stage (an emitter or component on a transformer) no longer fails the build because of their `order`: order is checked only between plugins of the same stage.
-5
View File
@@ -1,5 +0,0 @@
---
"@jackyzha0/quartz": patch
---
A `locale` that Quartz has no translation for (such as `sv-SE`, `da-DK` or `es-MX`) no longer crashes the build. Quartz uses a translation of the same language (`es-MX` uses `es-ES`), else English, and prints one warning; dates still use the configured locale.
+5
View File
@@ -0,0 +1,5 @@
---
"@jackyzha0/quartz": patch
---
Plugin update: og-image 1.2.0. A page's social image (`socialImage`, or Obsidian's `image` / `cover` property) can be an image in the content folder, written as a wikilink (`[[cover.png]]`), a path from the content folder, a path relative to the note, or a bare file name. Before, every value that was not a URL was read as a path in `quartz/static/`.
-17
View File
@@ -1,17 +0,0 @@
---
"@jackyzha0/quartz": patch
---
Plugin updates with the fixes from a test audit:
- note-properties: an empty `tags:` or `aliases:` no longer fails the build.
- bases-page: sorting, filters, formulas and group headings work as in Obsidian.
- encrypted-pages: a numeric `password` encrypts the page, and a custom `outputPath` works.
- darkmode, reader-mode, syntax-highlighting and comments: no double handlers after a page is unlocked.
- stacked-pages: links work under a base path.
- breadcrumbs: `resolveFrontmatterTitle` is honoured.
- canvas-page: a `#View` link selects that view.
- search: fields left out of `fieldPriority` are searched, and excerpts keep their last word.
- explorer: a note next to a folder of the same name stays listed, and folder options apply.
- folder-page, og-image, description, table-of-contents, graph, obsidian-flavored-markdown and utils: smaller fixes.
- latex: `customMacros` work with MathJax. ox-hugo: figure parameters in backticks.
-5
View File
@@ -1,5 +0,0 @@
---
"@jackyzha0/quartz": patch
---
Relative links and embeds keep their query string after SPA navigation and in popovers (`./viewer.html?file=a.pdf` no longer loses `?file=a.pdf`).
-5
View File
@@ -1,5 +0,0 @@
---
"@jackyzha0/quartz": patch
---
utils 1.3.4: inline `#tag` links from notes two or more folders deep stay under the site's base path. They went to `/tags/…` instead of `/<base>/tags/…`, a 404 on sites served under a sub-path such as GitHub Pages project sites.
-24
View File
@@ -64,27 +64,3 @@ jobs:
run: |
npx changeset status --since=origin/v5 >/dev/null 2>&1 \
|| echo "::warning::No changeset in this PR. If it changes how Quartz behaves, run 'npx changeset' (see .changeset/README.md)."
publish-tag:
if: ${{ github.repository == 'jackyzha0/quartz' && github.ref == 'refs/heads/v5' }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v7
with:
node-version: 24
- name: Get package version
run: node -p -e '`PACKAGE_VERSION=${require("./package.json").version}`' >> $GITHUB_ENV
- name: Create release tag
uses: pkgdeps/git-tag-action@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_repo: ${{ github.repository }}
version: ${{ env.PACKAGE_VERSION }}
git_commit_sha: ${{ github.sha }}
git_tag_prefix: "v"
+2
View File
@@ -85,6 +85,8 @@ jobs:
# Letting `gh release create` make the tag instead gives an unsigned annotated tag
# object (tagger: whoever merged the release PR), which GitHub marks "Unverified"
# (jackyzha0/quartz#2455). `git describe --tags` reads lightweight tags as well.
# This is the only place that tags a release: ci.yaml's old `publish-tag` job (an annotated
# tag through pkgdeps/git-tag-action) ran first and kept every release tag unverified.
if [ -z "$EXISTING" ]; then
gh api "repos/$GITHUB_REPOSITORY/git/refs" -f ref="refs/tags/$TAG" -f sha="$GITHUB_SHA" >/dev/null
else
+26
View File
@@ -1,5 +1,31 @@
# @jackyzha0/quartz
## 5.3.1
### Patch Changes
- f285e12: A plugin that depends on a plugin of another pipeline stage (an emitter or component on a transformer) no longer fails the build because of their `order`: order is checked only between plugins of the same stage.
- ce108c8: A `locale` that Quartz has no translation for (such as `sv-SE`, `da-DK` or `es-MX`) no longer crashes the build. Quartz uses a translation of the same language (`es-MX` uses `es-ES`), else English, and prints one warning; dates still use the configured locale.
- 9889d3f: Plugin updates: folder-page 1.1.5 (a folder's unlisted `index.md` is no longer replaced by a generated folder page), canvas-page 1.1.7 (edges drawn as in Obsidian), search 1.1.5 (Escape with tag suggestions open closes only the suggestions), graph 1.0.10 (the local graph is drawn once per page), stacked-pages 1.0.5 (unused template exports removed) and remark-obsidian 2.2.6.
- 37a61cf: Plugin updates with the fixes from a test audit:
- note-properties: an empty `tags:` or `aliases:` no longer fails the build.
- bases-page: sorting, filters, formulas and group headings work as in Obsidian.
- encrypted-pages: a numeric `password` encrypts the page, and a custom `outputPath` works.
- darkmode, reader-mode, syntax-highlighting and comments: no double handlers after a page is unlocked.
- stacked-pages: links work under a base path.
- breadcrumbs: `resolveFrontmatterTitle` is honoured.
- canvas-page: a `#View` link selects that view.
- search: fields left out of `fieldPriority` are searched, and excerpts keep their last word.
- explorer: a note next to a folder of the same name stays listed, and folder options apply.
- folder-page, og-image, description, table-of-contents, graph, obsidian-flavored-markdown and utils: smaller fixes.
- latex: `customMacros` work with MathJax. ox-hugo: figure parameters in backticks.
- 6729a1e: Relative links and embeds keep their query string after SPA navigation and in popovers (`./viewer.html?file=a.pdf` no longer loses `?file=a.pdf`).
- c68a494: Some fixes in this release change how existing pages look, mostly to match Obsidian: Bases sorting (natural text order, empty values last, mixed types), Bases `not:` filters and `== null`, Bases group headings, canvas edges, and folders with an unlisted `index.md`. See [Upgrading from 5.3.0 to 5.3.1](https://quartz.jzhao.xyz/getting-started/upgrading#upgrading-from-530-to-531).
- 57b3b5d: `npx quartz plugin install --latest` (and `plugin update`) no longer fails because a disabled plugin can't be updated, for example an old `quartz-themes` entry whose repository moved its plugin. The build doesn't load disabled plugins, so this is now a warning that says how to remove the entry. A failing enabled plugin still fails the command.
- 1e1a356: utils 1.3.4: inline `#tag` links from notes two or more folders deep stay under the site's base path. They went to `/tags/…` instead of `/<base>/tags/…`, a 404 on sites served under a sub-path such as GitHub Pages project sites.
## 5.3.0
### Minor Changes
+26
View File
@@ -28,6 +28,32 @@ npx quartz plugin install --latest
See the [[upgrade|CLI reference for upgrade]] for more details on available flags.
## Upgrading from 5.3.0 to 5.3.1
5.3.1 is a patch release: fixes from a test audit of Quartz and its plugins, many checked against Obsidian. Upgrade as usual:
```bash
npx quartz upgrade
npx quartz plugin install --latest
```
### Changes you may notice
Most of these make a page look the way Obsidian shows it, so an existing site can look different after the upgrade.
- **[[Bases]] sorting**: text sorts naturally ("Chapter 2" before "Chapter 10") and ignores case, also for the default order by file name. Empty values come last in both directions, including descending sorts. A column that mixes types sorts numbers, dates and durations by value and everything else as text. Group order follows the same rules.
- **[[Bases]] filters and formulas**, as in Obsidian:
- `not:` leaves out a note that matches _any_ of its conditions (it left out only notes matching all of them).
- `status == null` matches notes without `status`, and `status != null` no longer keeps them.
- `"5" == 5` and `1 == true` are true, two strings compare as text (`"10" > "9"` is false), and an empty list counts as false.
- A formula can use a formula defined after it. `x / 0` shows ∞. `sum()`, `mean()`, `min()` and `max()` skip text and booleans, and are empty without numbers. `number("abc")` is an error.
- **[[Bases]] group headings** show their value as a cell does: dates in the local format (not an ISO timestamp, sometimes of the previous day), durations as "4 days", links as the note's name, booleans as a checkbox.
- **[[CanvasPage|Canvas]] edges** leave and enter each card through the side they name, with Obsidian's curve, and the arrow points into that side. An edge without sides joins the sides that face each other (it joined the cards' centres).
- **Folder pages**: a folder whose own `index.md` is unlisted shows that note, with the folder listing below it. A generated folder page used to replace it.
- **Tag links under a base path**: inline `#tag` links from notes two or more folders deep stay on the site. On a site served under a sub-path, such as a GitHub Pages project site, they went to `/tags/…` and returned 404.
- **Locales without a translation** (such as `sv-SE`) no longer crash the build: Quartz uses a translation of the same language, else English, and prints a warning. Dates still use your locale.
- **`npx quartz plugin install --latest`** no longer fails because a _disabled_ plugin can't be updated (for example an old `quartz-themes` entry). It prints a warning with the command to remove the entry.
## Upgrading from 5.2 to 5.3
Quartz 5.3 needs **Node.js 22.22 or later**. Then upgrade as usual:
+29 -29
View File
@@ -1,12 +1,12 @@
{
"name": "@jackyzha0/quartz",
"version": "5.3.0",
"version": "5.3.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@jackyzha0/quartz",
"version": "5.3.0",
"version": "5.3.1",
"license": "MIT",
"dependencies": {
"@clack/prompts": "^1.8.0",
@@ -18,7 +18,7 @@
"@quartz-community/backlinks": "^1.0.4",
"@quartz-community/bases-page": "^1.5.6",
"@quartz-community/breadcrumbs": "^1.0.6",
"@quartz-community/canvas-page": "^1.1.6",
"@quartz-community/canvas-page": "^1.1.7",
"@quartz-community/citations": "^1.0.1",
"@quartz-community/cname": "^1.0.1",
"@quartz-community/comments": "^1.0.3",
@@ -31,23 +31,23 @@
"@quartz-community/explicit-publish": "^1.2.0",
"@quartz-community/explorer": "^1.2.5",
"@quartz-community/favicon": "^1.0.1",
"@quartz-community/folder-page": "^1.1.4",
"@quartz-community/folder-page": "^1.1.5",
"@quartz-community/footer": "^1.1.2",
"@quartz-community/github-flavored-markdown": "^2.2.2",
"@quartz-community/graph": "^1.0.9",
"@quartz-community/graph": "^1.0.10",
"@quartz-community/hard-line-breaks": "^1.1.0",
"@quartz-community/latex": "^1.1.3",
"@quartz-community/note-properties": "^1.2.4",
"@quartz-community/obsidian-flavored-markdown": "^2.5.4",
"@quartz-community/og-image": "^1.1.4",
"@quartz-community/og-image": "^1.2.0",
"@quartz-community/ox-hugo": "^1.0.4",
"@quartz-community/page-title": "^1.0.2",
"@quartz-community/reader-mode": "^1.0.3",
"@quartz-community/recent-notes": "^1.0.3",
"@quartz-community/roam": "^1.1.0",
"@quartz-community/search": "^1.1.4",
"@quartz-community/search": "^1.1.5",
"@quartz-community/spacer": "^1.0.2",
"@quartz-community/stacked-pages": "^1.0.4",
"@quartz-community/stacked-pages": "^1.0.5",
"@quartz-community/syntax-highlighting": "^1.0.5",
"@quartz-community/table-of-contents": "^1.0.6",
"@quartz-community/tag-list": "^1.0.3",
@@ -2383,9 +2383,9 @@
}
},
"node_modules/@quartz-community/canvas-page": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/@quartz-community/canvas-page/-/canvas-page-1.1.6.tgz",
"integrity": "sha512-Cuu3xxC1PCKM5+ixO58cnNmK0So9RHnE1bxVLPW619b0tCL2ZyuN4QQK4yCN7ia8N6uiLyI+jqAALMS1+tl9fA==",
"version": "1.1.7",
"resolved": "https://registry.npmjs.org/@quartz-community/canvas-page/-/canvas-page-1.1.7.tgz",
"integrity": "sha512-I2I5JqqJ6PGnnwq57KI27Z643o/yUrxl654uwV8m+hFPmaN1iG8OQD7597JDHYXrwWCKWnNi23Wy3HXFu0yPUg==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
@@ -2664,9 +2664,9 @@
}
},
"node_modules/@quartz-community/folder-page": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/@quartz-community/folder-page/-/folder-page-1.1.4.tgz",
"integrity": "sha512-aEaXi5qJdWPMMvtBakaVw/wDU/iVf5ujW1hMnBxDJyCDXF9FRdk1njeFi+Op299y5SWnF7+ruLjhraqeaYLnCA==",
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/@quartz-community/folder-page/-/folder-page-1.1.5.tgz",
"integrity": "sha512-Uxlno9jMCDzlKbF5HkrvUDzg0zxqabUhIfANsfC1RlfSq6cNmuXUYwe45vhkEp/KDOM8bBcfuHKARO3OqABzGA==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
@@ -2734,9 +2734,9 @@
}
},
"node_modules/@quartz-community/graph": {
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/@quartz-community/graph/-/graph-1.0.9.tgz",
"integrity": "sha512-7t6v0i9dPr8JIWRQEalszHk25pmhapns/mD18zyt0P1EwbZrU8Kbc5l6nXFM7jSq/pfigDvo9GmcNFFtTMYK1Q==",
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/@quartz-community/graph/-/graph-1.0.10.tgz",
"integrity": "sha512-UkqWEI48wmxLQPS+HNW4Pm0GnuUpcn7IfZ3ufcg1S4/lVqrdrofj7SioXDm7djuwr/wsLPDsdC1YBCwct/Eu5w==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
@@ -2853,9 +2853,9 @@
}
},
"node_modules/@quartz-community/og-image": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/@quartz-community/og-image/-/og-image-1.1.4.tgz",
"integrity": "sha512-aJyXYMjIPrj3M3jFoYyqW/YODKmSoJP+bbQ5LyH0FnpuWGIGDBPVRqYmx5qUuiVjc5SMiVMMf8AyWuH63nCbUQ==",
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/@quartz-community/og-image/-/og-image-1.2.0.tgz",
"integrity": "sha512-fVvrOwog7QTGf7X0iNPFAmM5nRvK4Mdh9XQqpE8PDQ3X9fbHcnCq++H1H+a0xXjiB1BADKuT2146pjNmOkPEaw==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
@@ -2979,9 +2979,9 @@
}
},
"node_modules/@quartz-community/remark-obsidian": {
"version": "2.2.5",
"resolved": "https://registry.npmjs.org/@quartz-community/remark-obsidian/-/remark-obsidian-2.2.5.tgz",
"integrity": "sha512-xlJX+6XIWEBCPnJ4Mg8Xnrxeh2+pq0XAKUWXGOEY0kHNf2uDsiM5VRTd15/4jR1J2FN2KmOAB7jV+8J0xSlnqg==",
"version": "2.2.6",
"resolved": "https://registry.npmjs.org/@quartz-community/remark-obsidian/-/remark-obsidian-2.2.6.tgz",
"integrity": "sha512-hDxyFiA5SYIcsO1i3vnlMQEryoev2RtFy9UZ9MGNfANxiWypxCG/uWUjA+uiISMJgHSRk/CpWcn7lTGGvMVT3A==",
"license": "MIT",
"dependencies": {
"@types/mdast": "^4.0.0",
@@ -3019,9 +3019,9 @@
}
},
"node_modules/@quartz-community/search": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/@quartz-community/search/-/search-1.1.4.tgz",
"integrity": "sha512-s02rNbjLkg4rVNdA0Pr2LHlGK1zn0PcS2+mBoyWqhZ4vZraGKgLpbAUiDgXD740GU630vcpEwmtT0FNWbgzl9g==",
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/@quartz-community/search/-/search-1.1.5.tgz",
"integrity": "sha512-9qgJsfOlqBPP41ICDOmmHOYiJbjlIMYm6EduvjS4t32YWglRJpO5l0Dle6A8VYmt7PW6qrAkh2EU7TvwCUU2Aw==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
@@ -3062,9 +3062,9 @@
}
},
"node_modules/@quartz-community/stacked-pages": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@quartz-community/stacked-pages/-/stacked-pages-1.0.4.tgz",
"integrity": "sha512-XQsi9CwReWxr7c6e1uWHpYYegQfpaL+sPPASkM+RVX0pw21V9aYpMy0HRFWpbyJnpIM847rVPfZ6W3IH3Db/mw==",
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/@quartz-community/stacked-pages/-/stacked-pages-1.0.5.tgz",
"integrity": "sha512-sUDlcgREgWyttDg4A6Xp6i3s0jjLzO0g/pvP2a5KSYfNtsN9djbvwaPaewV9e/dn92VyTWrKsXd7K05yTCcFQw==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
+7 -7
View File
@@ -2,7 +2,7 @@
"name": "@jackyzha0/quartz",
"description": "🌱 publish your digital garden and notes as a website",
"private": true,
"version": "5.3.0",
"version": "5.3.1",
"type": "module",
"author": "jackyzha0 <j.zhao2k19@gmail.com>",
"license": "MIT",
@@ -48,7 +48,7 @@
"@quartz-community/backlinks": "^1.0.4",
"@quartz-community/bases-page": "^1.5.6",
"@quartz-community/breadcrumbs": "^1.0.6",
"@quartz-community/canvas-page": "^1.1.6",
"@quartz-community/canvas-page": "^1.1.7",
"@quartz-community/citations": "^1.0.1",
"@quartz-community/cname": "^1.0.1",
"@quartz-community/comments": "^1.0.3",
@@ -61,23 +61,23 @@
"@quartz-community/explicit-publish": "^1.2.0",
"@quartz-community/explorer": "^1.2.5",
"@quartz-community/favicon": "^1.0.1",
"@quartz-community/folder-page": "^1.1.4",
"@quartz-community/folder-page": "^1.1.5",
"@quartz-community/footer": "^1.1.2",
"@quartz-community/github-flavored-markdown": "^2.2.2",
"@quartz-community/graph": "^1.0.9",
"@quartz-community/graph": "^1.0.10",
"@quartz-community/hard-line-breaks": "^1.1.0",
"@quartz-community/latex": "^1.1.3",
"@quartz-community/note-properties": "^1.2.4",
"@quartz-community/obsidian-flavored-markdown": "^2.5.4",
"@quartz-community/og-image": "^1.1.4",
"@quartz-community/og-image": "^1.2.0",
"@quartz-community/ox-hugo": "^1.0.4",
"@quartz-community/page-title": "^1.0.2",
"@quartz-community/reader-mode": "^1.0.3",
"@quartz-community/recent-notes": "^1.0.3",
"@quartz-community/roam": "^1.1.0",
"@quartz-community/search": "^1.1.4",
"@quartz-community/search": "^1.1.5",
"@quartz-community/spacer": "^1.0.2",
"@quartz-community/stacked-pages": "^1.0.4",
"@quartz-community/stacked-pages": "^1.0.5",
"@quartz-community/syntax-highlighting": "^1.0.5",
"@quartz-community/table-of-contents": "^1.0.6",
"@quartz-community/tag-list": "^1.0.3",
+17
View File
@@ -1160,6 +1160,13 @@ export async function handlePluginInstallUnified({
const pluginsToUpdate = nameFilter ? Array.from(nameFilter) : Object.keys(lockfile.plugins)
const updatedPlugins = []
let lockfileChanged = false
// Disabled in the config: the build never loads them, so failing to update one is a warning,
// not a failed update (an old entry whose repository changed layout failed every update).
const disabledNames = new Set(
(pluginsJson?.plugins ?? [])
.filter((entry) => entry.enabled === false)
.map((entry) => extractPluginName(entry.source)),
)
// Phase 1: Validate and categorize plugins (fast, sequential)
const validPlugins = []
@@ -1244,6 +1251,16 @@ export async function handlePluginInstallUnified({
}
}
} catch (error) {
if (disabledNames.has(name)) {
console.log(
styleText(
"yellow",
`⚠ Could not update ${name} (disabled, so the build does not load it): ${describeCommandError(error)}\n` +
` Remove it with \`npx quartz plugin remove ${name}\` or fix its source.`,
),
)
return
}
console.log(
styleText("red", `✗ Failed to update ${name}: ${describeCommandError(error)}`),
)
+64
View File
@@ -294,3 +294,67 @@ describe("plugin commands with an extending config", () => {
assert.doesNotMatch(read(dir), /comments/)
})
})
describe("plugin install --latest with a plugin that can't be updated", () => {
const cli = path.resolve(import.meta.dirname, "..", "bootstrap-cli.mjs")
// A Git plugin whose repository no longer has the configured subdirectory (an old
// quartz-themes entry: the repository moved its plugin out of `plugin/`).
const site = (enabled) => {
const repo = path.join(root, "repo")
fs.mkdirSync(repo, { recursive: true })
fs.writeFileSync(path.join(repo, "README.md"), "no plugin/ here\n")
const git = (args) => execSync(`git ${args}`, { cwd: repo, stdio: "ignore", timeout: 30_000 })
git("init -q -b main")
git("-c user.name=t -c user.email=t@t add .")
git("-c user.name=t -c user.email=t@t commit -q -m init")
const url = pathToFileURL(repo).href
const dir = path.join(root, "site")
fs.mkdirSync(path.join(dir, ".quartz", "plugins", "old-theme"), { recursive: true })
fs.writeFileSync(path.join(dir, "package.json"), `{ "name": "site", "version": "5.3.1" }`)
fs.writeFileSync(
path.join(dir, "quartz.config.yaml"),
YAML.stringify({
configuration: { pageTitle: "t" },
plugins: [{ source: { name: "old-theme", repo: url, subdir: "plugin" }, enabled }],
}),
)
fs.writeFileSync(
path.join(dir, "quartz.lock.json"),
JSON.stringify({
version: "1.0.0",
plugins: {
"old-theme": {
source: url,
resolved: url,
subdir: "plugin",
commit: "0000000000000000000000000000000000000000",
installedAt: "2026-01-01T00:00:00.000Z",
},
},
}),
)
return dir
}
const run = (dir) => {
const result = spawnSync(process.execPath, [cli, "plugin", "install", "--latest"], {
cwd: dir,
encoding: "utf-8",
timeout: 60_000,
env: { ...process.env, QUARTZ_CONFIG_PATH: "" },
})
return { output: result.stdout + result.stderr, status: result.status }
}
test("a disabled plugin only warns: the build doesn't load it", () => {
const { output, status } = run(site(false))
assert.match(output, /Could not update old-theme \(disabled/)
assert.match(output, /npx quartz plugin remove old-theme/)
assert.strictEqual(status, 0)
})
test("an enabled plugin fails the update", () => {
const { output, status } = run(site(true))
assert.match(output, /Failed to update old-theme/)
assert.strictEqual(status, 1)
})
})