mirror of
https://github.com/jackyzha0/quartz
synced 2026-11-30 22:44:41 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
483b7629e5 | ||
|
|
df7e0180da | ||
|
|
0787f97149 | ||
|
|
b29db43197 | ||
|
|
214f478389 | ||
|
|
66f2578e42 | ||
|
|
addf542511 | ||
|
|
01bc5c5c88 | ||
|
|
60c8318b34 | ||
|
|
e3e3d5f398 | ||
|
|
28fcb64720 | ||
|
|
99909ddb22 | ||
|
|
2ef60c6be5 | ||
|
|
f8b563867b |
No files matched your search
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@jackyzha0/quartz": patch
|
||||
---
|
||||
|
||||
More build errors caused by content are reported as content problems ("fix the file and build again") instead of "This is likely a Quartz bug": frontmatter that holds a single value or a list instead of properties, Markdown files and assets Quartz can't read (permission denied, a directory named like a note). Plugins can do the same by throwing an `Error` with `quartzContent = true` (see "Reporting problems in content" in Making plugins).
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@jackyzha0/quartz": patch
|
||||
---
|
||||
|
||||
When a build stops on an error, Quartz stops esbuild before exiting. esbuild runs as a child process that writes to the same terminal; left running, it could print "fatal error: all goroutines are asleep - deadlock!" and a long goroutine dump after Quartz's error message.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@jackyzha0/quartz": patch
|
||||
---
|
||||
|
||||
Embedding a section by the anchor Obsidian writes for its heading works when that anchor differs from the heading's id: `![[note#Colon unspaced]]` now embeds `## Colon:unspaced`. It needs GitHubFlavoredMarkdown 2.1.0 or later, which marks those anchors on the heading.
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
"@jackyzha0/quartz": minor
|
||||
---
|
||||
|
||||
Updated default plugins (see each plugin's changelog for details):
|
||||
|
||||
- **Changed heading ids:** with SmartyPants on (the default), a heading containing `--` now gets the same id as on GitHub: `## Range 1--2` → `range-1--2` (was `range-12`). Links that hard-code the old id need updating; `[[page#Range 1--2]]` keeps working. Links Obsidian writes to headings containing `:`, `|`, `^`, `#` or `\` now reach them, and heading ids, links and table-of-contents entries share one slug function (GitHubFlavoredMarkdown 2.1.0, TableOfContents, CrawlLinks, utils 1.1).
|
||||
- **Changed in Bases:** `file.name` includes the file's extension, as in Obsidian (`Note.md`, `Plan.canvas`); use `file.basename` for the name without it. Base views also list canvas and Excalidraw files with their real paths, `this` in a base embedded in a note is that note, `file.inFolder("")` matches the content root, and Quartz's generated pages (404, tags, folder listings) no longer appear as notes (BasesPage 1.1.0, CanvasPage, Excalidraw).
|
||||
- Folder pages list folders that hold only canvas, base or other generated pages (FolderPage).
|
||||
- A footnote referenced only from a table cell past the table's columns is rendered, as in Obsidian (ObsidianFlavoredMarkdown 2.1.1, with remark-obsidian 2.2.0: faster parsing and fixes for deeply nested notes and `\r\n` line endings).
|
||||
- A short wikilink to an Obsidian folder note (`[[Topic]]` for `Topic/Topic.md`) reaches the folder page (utils 1.1).
|
||||
- NoteProperties no longer bundles gray-matter's `eval`-based JavaScript frontmatter engine.
|
||||
@@ -583,6 +583,18 @@ Each view registration includes:
|
||||
|
||||
The `ViewRegistry` is a global singleton (via `Symbol.for`) ensuring all copies of the module share the same registry.
|
||||
|
||||
### Reporting problems in content
|
||||
|
||||
When your plugin fails because of a file's content rather than a bug in your code — a `.canvas` file that isn't valid JSON, a property with a value your plugin can't use, a file it can't read — throw an `Error` with `quartzContent` set to `true` and a message that names the problem:
|
||||
|
||||
```ts
|
||||
const err = new Error(`Invalid canvas: ${parseError.message}`)
|
||||
;(err as Error & { quartzContent?: boolean }).quartzContent = true
|
||||
throw err
|
||||
```
|
||||
|
||||
Quartz then reports it as a problem in the file's content ("fix it and build again") instead of asking the user to report a bug in your plugin, and leaves out the stack trace. Errors from transformers name the file being processed; from an emitter or a page type's `generate`, put the file's path in your message. Quartz checks the property, not the class, so plugins don't need to import anything from Quartz; it also finds the property on an error's `cause`. Only use it when the content is at fault — a wrong guess sends users looking for a problem in their notes that isn't there.
|
||||
|
||||
## Building and Distribution
|
||||
|
||||
Quartz v5 plugins ship pre-built `dist/` in their repositories. When a user installs your plugin, Quartz detects the pre-built output and skips the install/build cycle entirely — making installation near-instant.
|
||||
|
||||
@@ -7,6 +7,7 @@ Common issues and solutions when working with Quartz.
|
||||
## Reading build output
|
||||
|
||||
- **Errors from plugins** say which plugin failed (name, version, source), what it was doing ("while transforming the Markdown of `notes/x.md`", "component Backlinks while rendering `features/x`"), any problems Quartz already knew about that plugin, and where to report it. To confirm a plugin is the cause, disable it (`npx quartz plugin disable <name>`) and build again.
|
||||
- **Problems in a file's content** (frontmatter that isn't valid YAML/TOML, a file Quartz can't read) name the file and say "This is a problem in the file's content": fix the file and build again — it's not a bug in Quartz or a plugin.
|
||||
- **Plugins that fail to load** (can't be installed, their code throws on import, no plugin found in the package) are marked `✗` with the file and line where it failed. Locally the build continues without them so you can check the rest of the site; they are listed again at the top of the end-of-build summary. In CI (`CI` set, e.g. GitHub Actions, Netlify, Vercel, Cloudflare Pages) the build fails instead, so a site with a missing feature isn't deployed — set `QUARTZ_ALLOW_BROKEN_PLUGINS=1` to deploy anyway.
|
||||
- **Warnings** printed while loading the config (plugins that need a newer Quartz, plugins missing data they need, layout typos, plugin entries that are now built in) are repeated in a summary at the end of the build.
|
||||
- **Notes** in that summary point out links to pages that are not on your site — including links to [[RemoveDrafts|drafts]], which are the usual cause of "this link 404s". `npx quartz build --verbose` lists every such link, the order plugins run in, the built-ins and the layout of each page type.
|
||||
|
||||
Generated
+149
-167
@@ -13,53 +13,52 @@
|
||||
"@floating-ui/dom": "^1.7.4",
|
||||
"@myriaddreamin/rehype-typst": "^0.7.0",
|
||||
"@napi-rs/simple-git": "1.1.0",
|
||||
"@quartz-community/alias-redirects": "^1.0.0",
|
||||
"@quartz-community/article-title": "^1.0.0",
|
||||
"@quartz-community/backlinks": "^1.0.0",
|
||||
"@quartz-community/bases-page": "^1.0.0",
|
||||
"@quartz-community/breadcrumbs": "^1.0.0",
|
||||
"@quartz-community/canvas-page": "^1.0.0",
|
||||
"@quartz-community/citations": "^1.0.0",
|
||||
"@quartz-community/cname": "^1.0.0",
|
||||
"@quartz-community/comments": "^1.0.0",
|
||||
"@quartz-community/content-meta": "^1.0.0",
|
||||
"@quartz-community/content-page": "^1.0.0",
|
||||
"@quartz-community/created-modified-date": "^1.0.0",
|
||||
"@quartz-community/darkmode": "^1.0.0",
|
||||
"@quartz-community/description": "^1.0.0",
|
||||
"@quartz-community/encrypted-pages": "^1.0.0",
|
||||
"@quartz-community/explicit-publish": "^1.0.0",
|
||||
"@quartz-community/explorer": "^1.0.0",
|
||||
"@quartz-community/favicon": "^1.0.0",
|
||||
"@quartz-community/folder-page": "^1.0.0",
|
||||
"@quartz-community/footer": "^1.0.0",
|
||||
"@quartz-community/github-flavored-markdown": "^2.0.0",
|
||||
"@quartz-community/graph": "^1.0.0",
|
||||
"@quartz-community/hard-line-breaks": "^1.0.0",
|
||||
"@quartz-community/latex": "^1.0.0",
|
||||
"@quartz-community/note-properties": "^1.1.1",
|
||||
"@quartz-community/obsidian-flavored-markdown": "^2.0.0",
|
||||
"@quartz-community/og-image": "^1.0.0",
|
||||
"@quartz-community/ox-hugo": "^1.0.0",
|
||||
"@quartz-community/page-title": "^1.0.0",
|
||||
"@quartz-community/quartz-fonts": "^1.0.0",
|
||||
"@quartz-community/reader-mode": "^1.0.0",
|
||||
"@quartz-community/recent-notes": "^1.0.0",
|
||||
"@quartz-community/roam": "^1.0.0",
|
||||
"@quartz-community/search": "^1.0.0",
|
||||
"@quartz-community/spacer": "^1.0.0",
|
||||
"@quartz-community/stacked-pages": "^1.0.0",
|
||||
"@quartz-community/syntax-highlighting": "^1.0.1",
|
||||
"@quartz-community/table-of-contents": "^1.0.0",
|
||||
"@quartz-community/tag-list": "^1.0.0",
|
||||
"@quartz-community/tag-page": "^1.0.0",
|
||||
"@quartz-community/unlisted-pages": "^1.0.0",
|
||||
"@quartz-themes/core": "^2.0.0",
|
||||
"@quartz-community/alias-redirects": "^1.0.2",
|
||||
"@quartz-community/article-title": "^1.0.1",
|
||||
"@quartz-community/backlinks": "^1.0.2",
|
||||
"@quartz-community/bases-page": "^1.1.2",
|
||||
"@quartz-community/breadcrumbs": "^1.0.2",
|
||||
"@quartz-community/canvas-page": "^1.0.2",
|
||||
"@quartz-community/citations": "^1.0.1",
|
||||
"@quartz-community/cname": "^1.0.1",
|
||||
"@quartz-community/comments": "^1.0.1",
|
||||
"@quartz-community/content-meta": "^1.0.1",
|
||||
"@quartz-community/content-page": "^1.0.2",
|
||||
"@quartz-community/created-modified-date": "^1.0.2",
|
||||
"@quartz-community/darkmode": "^1.0.1",
|
||||
"@quartz-community/description": "^1.0.2",
|
||||
"@quartz-community/encrypted-pages": "^1.1.0",
|
||||
"@quartz-community/explicit-publish": "^1.1.0",
|
||||
"@quartz-community/explorer": "^1.0.2",
|
||||
"@quartz-community/favicon": "^1.0.1",
|
||||
"@quartz-community/folder-page": "^1.0.2",
|
||||
"@quartz-community/footer": "^1.1.0",
|
||||
"@quartz-community/github-flavored-markdown": "^2.1.0",
|
||||
"@quartz-community/graph": "^1.0.2",
|
||||
"@quartz-community/hard-line-breaks": "^1.1.0",
|
||||
"@quartz-community/latex": "^1.0.1",
|
||||
"@quartz-community/note-properties": "^1.1.3",
|
||||
"@quartz-community/obsidian-flavored-markdown": "^2.1.1",
|
||||
"@quartz-community/og-image": "^1.1.1",
|
||||
"@quartz-community/ox-hugo": "^1.0.1",
|
||||
"@quartz-community/page-title": "^1.0.1",
|
||||
"@quartz-community/quartz-fonts": "^1.0.2",
|
||||
"@quartz-community/reader-mode": "^1.0.1",
|
||||
"@quartz-community/recent-notes": "^1.0.2",
|
||||
"@quartz-community/roam": "^1.0.1",
|
||||
"@quartz-community/search": "^1.0.2",
|
||||
"@quartz-community/spacer": "^1.0.1",
|
||||
"@quartz-community/stacked-pages": "^1.0.2",
|
||||
"@quartz-community/syntax-highlighting": "^1.0.2",
|
||||
"@quartz-community/table-of-contents": "^1.0.2",
|
||||
"@quartz-community/tag-list": "^1.0.2",
|
||||
"@quartz-community/tag-page": "^1.0.2",
|
||||
"@quartz-community/unlisted-pages": "^1.1.0",
|
||||
"@quartz-themes/core": "^2.0.1",
|
||||
"ansi-truncate": "^1.4.0",
|
||||
"async-mutex": "^0.5.0",
|
||||
"chokidar": "^5.0.0",
|
||||
"esbuild-sass-plugin": "^3.6.0",
|
||||
"github-slugger": "^2.0.0",
|
||||
"globby": "^16.1.0",
|
||||
"gray-matter": "^4.0.3",
|
||||
"hast-util-from-html": "^2.0.0",
|
||||
@@ -98,8 +97,8 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@changesets/cli": "^2.29.2",
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.1",
|
||||
"@quartz-community/types": "^1.3.0",
|
||||
"@quartz-community/utils": "^1.1.1",
|
||||
"@types/hast": "^3.0.4",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/node": "^26.5.1",
|
||||
@@ -2355,13 +2354,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/alias-redirects": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/alias-redirects/-/alias-redirects-1.0.1.tgz",
|
||||
"integrity": "sha512-n7lI0gEWqb/9jkMO8G9JhBtRKqsxbED8MtfBC57pZYaoCOfBjVMY5MPgsH9/K5m7r18etFkSDpBV37t7tlBuzQ==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/alias-redirects/-/alias-redirects-1.0.2.tgz",
|
||||
"integrity": "sha512-QdcaorfE0UVqy4EnZel0minOHODybU+6v0ZlK4knFFV6QT8ISi8WlL79RnOV51jxRJkRBR3E7CED8kCa3l/RCA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -2399,13 +2398,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/backlinks": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/backlinks/-/backlinks-1.0.1.tgz",
|
||||
"integrity": "sha512-bdvEV3KDt7R87BHq9AmpBX8zmsFl9/IEPxS4Fm0Wjoiszv0NzS5qE9VA78dIqpAoOyOI8R2OZHsiihcoXSyLTQ==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/backlinks/-/backlinks-1.0.2.tgz",
|
||||
"integrity": "sha512-iZ016m+fH8FbW4J7uPYEHGrgvAvKDCmZvx5OmmeqL8Cv14PQG/xuhz3FvfTA2Djxq9/pFURvYTWxh+oDDL3N2Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -2421,13 +2420,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/bases-page": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/bases-page/-/bases-page-1.0.1.tgz",
|
||||
"integrity": "sha512-pqdiXt8T5nULTUs56k+VoiWw53svRyUDAty7s4uDHxcWdoNjV67AiYs7wOYuP5+ZcDQUA7THOGBWBoZ/WKbmsg==",
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/bases-page/-/bases-page-1.1.2.tgz",
|
||||
"integrity": "sha512-Uw45RwEjvhquTWEMuoZszG5oln4o6zMRMSWmLED1gxL4w/zl1zkHgpOIc4LFVyP+UR/lGL5Blh4rHsFAdq2Tyw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -2451,13 +2450,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/breadcrumbs": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/breadcrumbs/-/breadcrumbs-1.0.1.tgz",
|
||||
"integrity": "sha512-IlPB+cqQPkT7YlrCGg7ndEHjISvg9XzG8GAhIIQpXnrfAWwTkxJTVFAotI3K8pqATIGaGtvGxPhCmuVXmMAwyQ==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/breadcrumbs/-/breadcrumbs-1.0.2.tgz",
|
||||
"integrity": "sha512-ImEiYAFDcbayj9Yu7b7X6Yt7x9z4pAABZDwTUV5DBYfnQJmJWyuQpvqBgMHUBUgWbm9gyxT73tlXaHpLvsY56w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -2473,14 +2472,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/canvas-page": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/canvas-page/-/canvas-page-1.0.1.tgz",
|
||||
"integrity": "sha512-Onk4OC7yy6mrP8FRgku0o5+bd0bW3RCoX3UOoHtOS8G7Qp2NMuucC3JTuAYzYE4r0gPPUUStf28khPN6SIc9/g==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/canvas-page/-/canvas-page-1.0.2.tgz",
|
||||
"integrity": "sha512-F9kyp9PdSbUO2lKO1odINE29jA0aZw0XmIWW/p7zSGhRx4ZSvGjA+8thZHL6bIcyzjiG+09MndMebGSZiDmU1A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0",
|
||||
"github-slugger": "^2.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -2578,13 +2576,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/content-page": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/content-page/-/content-page-1.0.1.tgz",
|
||||
"integrity": "sha512-HqjPwTxUOC9cb1PrB01VgCVSLYWeMYfukf7Ti2I1OjGrIyxdtvcIpKQmnMQ2CDdlFzCCz7RciC9MzJVkxGZCMg==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/content-page/-/content-page-1.0.2.tgz",
|
||||
"integrity": "sha512-+kbVhussK5n7sPc/7P5sSzLm6pDblYO3BCZ8asTxuHX43Hzv9jlj3LigphIDz/dvmHkjZNBMSdKHlvO5CcZRcg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -2651,13 +2649,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/description": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/description/-/description-1.0.1.tgz",
|
||||
"integrity": "sha512-DX0bSNSIajBXRtXpvEsif2RvtCS8HSOPGRDwjSje0UlOnrtmWq5Tmd7oY5//2lnxzBWk7VMdJBmN1xI/gknMEg==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/description/-/description-1.0.2.tgz",
|
||||
"integrity": "sha512-Mb0VqNOqiY9UQLK0y7p2/LVJAUqH8ra3Pek0Gz8q35FxJXkv2RDyjNb49qMUM0dpIaLVUkv9GBuKxeoxbwt4Yg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -2673,9 +2671,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/encrypted-pages": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/encrypted-pages/-/encrypted-pages-1.0.1.tgz",
|
||||
"integrity": "sha512-KHBOEphODF5Lh+Ziv3jLar+k1DCU9Y7SRzBcDLWi/JJO99DQv29e6mwE2tZwcwom2cEUymOVjNpTJ7smEb/oTA==",
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/encrypted-pages/-/encrypted-pages-1.1.0.tgz",
|
||||
"integrity": "sha512-tx3yqqj0MwHWPRS56yebY+jeG3p7aF3OPVRZ46tVT+KdzkSkbElV0NaNXWD+jOOaDIiwEl9mw2t+6Ne1vblFpw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
@@ -2699,9 +2697,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/explicit-publish": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/explicit-publish/-/explicit-publish-1.0.1.tgz",
|
||||
"integrity": "sha512-tM8CrgpEXZfT0/35hOZGl7QmqrAGYmqYZE0JA76Mh/b90Q8ewGZRCFPwnj3AQqIAfheGeSmhFFXHwnuf7biPTg==",
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/explicit-publish/-/explicit-publish-1.1.0.tgz",
|
||||
"integrity": "sha512-Xdo69D2x/VufWQviPOuQp/OkLQ8XVGwyt3KO+DN9/ablMvWAXSlYIA11pcP1Y4UgxBMzMhpZ4+BLZqTGlz1SRg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0"
|
||||
@@ -2712,13 +2710,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/explorer": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/explorer/-/explorer-1.0.1.tgz",
|
||||
"integrity": "sha512-/eezCS0Ki7dSjclsPkHGoKtUxLIfneVAV022vMD8wlBSlo9Aq4Vy5KXcPuuc02iuHFMjFQvDvua0Yp3ZBGuZYQ==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/explorer/-/explorer-1.0.2.tgz",
|
||||
"integrity": "sha512-6u62zq/U28BBIbm9FHFheDCmfsqfCq+lEngd6JzhfBlXGn6n1I7q9vPIJ4qN/8DYLey556MjJMxh+QLPIDHuGg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -2755,13 +2753,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/folder-page": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/folder-page/-/folder-page-1.0.1.tgz",
|
||||
"integrity": "sha512-gXhwmRU/YocRGDQX+lUYFizVdzuCeAeT77jN2uXTP60wuBV6zZ5gtAi6HUYFp4YXeLZnm6QKyXFba/6ugYFlKg==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/folder-page/-/folder-page-1.0.2.tgz",
|
||||
"integrity": "sha512-+h/9QFo+wEtweYyKEe4CZxJVILfC0V70z7rkGIjN9unWyxOkIB3PJh9Fw8oRDuZw07yF3HwOvAg9/bBar8q9DA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -2803,12 +2801,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/github-flavored-markdown": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/github-flavored-markdown/-/github-flavored-markdown-2.0.0.tgz",
|
||||
"integrity": "sha512-nKOYqvesGiEeuENHEPtMPgKl/YsDK0SWeSNMGXse3S3OwvDGQ74ZeE9pvDvps33B2vQoemsxvbKIE5qMUllZfw==",
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/github-flavored-markdown/-/github-flavored-markdown-2.1.0.tgz",
|
||||
"integrity": "sha512-E2K09rOgmhHFtF/9AbnoVXrI3v0Ww82ZIVCHQUWWM7fsuktn3DYmmVs2YhJk77tSbeqGW76ZY+gl4UgJ/U9Rxg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0"
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -2824,13 +2823,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/graph": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/graph/-/graph-1.0.1.tgz",
|
||||
"integrity": "sha512-e9T4Zjp55H8HhuFsucjscuAOGHhz0/1LooMAH1cfE3ub9uBoSPXdeaKVmvixhtWz2TaM4rQFU1UUTN8/hbteyg==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/graph/-/graph-1.0.2.tgz",
|
||||
"integrity": "sha512-YmFoGizirmVkE9d66iLHgLrLgb7TYzCVaZT0kDwvh9J7/Kq8tUx/slIoFKuheJNr4gp7HGAxuNwx8WaLjqkXnQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -2892,13 +2891,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/note-properties": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/note-properties/-/note-properties-1.1.1.tgz",
|
||||
"integrity": "sha512-kURVT2PTQZTcRZxiT7o/gerI/8n0EhVogLaMznviJXYKSSvenE+8uKlPxJtZr1nbTJOn73UNBr5iNMhQIycQtg==",
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/note-properties/-/note-properties-1.1.3.tgz",
|
||||
"integrity": "sha512-ChzMZjvw47D+aTBDFOyaAJpfp/S+l25ndSoL8xJOf+DMgO5y+GioaEPmYRHjUOnbnZxc1/RcydSnyU68CU8yjA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -2918,15 +2917,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/obsidian-flavored-markdown": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/obsidian-flavored-markdown/-/obsidian-flavored-markdown-2.1.0.tgz",
|
||||
"integrity": "sha512-yOLBsYrJ5IVjxhl/ppZmXQAHianKkeIGMvDT7mwNOaalsah19p9luHrPYg0eEsn1o6IkHFP8h1LaY2WT+wIABw==",
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/obsidian-flavored-markdown/-/obsidian-flavored-markdown-2.1.1.tgz",
|
||||
"integrity": "sha512-6PvlLi1e3naAZwVRyKJ5lQW19/mHpbZIRFGN9wC+QMx+9gDiJzA/HP4uTwcPQxrH0OzyrwZ4qkR4AFizynr2Eg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/rehype-obsidian": "^1.2.0",
|
||||
"@quartz-community/remark-obsidian": "^2.1.0",
|
||||
"@quartz-community/remark-obsidian": "^2.2.0",
|
||||
"@quartz-community/types": "^1.1.0",
|
||||
"@quartz-community/utils": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.1.0",
|
||||
"pele": "^1.13.0"
|
||||
},
|
||||
"engines": {
|
||||
@@ -2943,13 +2942,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/og-image": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/og-image/-/og-image-1.1.0.tgz",
|
||||
"integrity": "sha512-s6kcPd9ddeaQ7gygqR3+hcbXjzYdTpv2kHG6vy/mPuE5941zm9icAzwLPcTf+gXur5DyYqNdpmu3zjoLAp5BMA==",
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/og-image/-/og-image-1.1.1.tgz",
|
||||
"integrity": "sha512-wZW6TgEFYUMLdQq+tF5v27tCtWySn+mTr6tzSdZTlGwcubBK2SA2E/ue8PwWXJnilfxteCwXGEF37xR1GFHqHg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -3016,13 +3015,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/quartz-fonts": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/quartz-fonts/-/quartz-fonts-1.0.1.tgz",
|
||||
"integrity": "sha512-EFiRcmnacmJe6yHIb3ZOouEpcSRvtPUdknkU5GLoBYZdZBNXj8/RJmhgyKo+M7rqogbI4Xiq6N09RiK3eJopSQ==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/quartz-fonts/-/quartz-fonts-1.0.2.tgz",
|
||||
"integrity": "sha512-Q0iPRAlTXNNnvCutYpF1FAPFvNlwfeXPipg1SIgD9M1vxHSyUzfAGHkLngafR/HgNMf9qREbvqQaCTjtp7grEQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -3068,13 +3067,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/recent-notes": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/recent-notes/-/recent-notes-1.0.1.tgz",
|
||||
"integrity": "sha512-5vJssnScCR1s/Kuv9CFG64QzBxgqU9+wkANUX/jzx5aAQ01LmoY5ueO7SjgKS0g6R8MCOuW/DkLXFEWM6PmDNg==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/recent-notes/-/recent-notes-1.0.2.tgz",
|
||||
"integrity": "sha512-CWYHOBULovmqX5rxSBeuinkEPzBcQ2xVRT96y+D8JKDHtUK6IJr3dllYbgNK8sOp/akmAm5IuGWxXvfqJ75aUw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -3099,9 +3098,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/remark-obsidian": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/remark-obsidian/-/remark-obsidian-2.1.1.tgz",
|
||||
"integrity": "sha512-JZxT1f/xm8iEQJJJoGHosSXWN7h+xuIds7IUXjsp7ZtdRDS7nd6wmv2uMjqyOdqp7x8F+d/DTp6FW50xL+9vMw==",
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/remark-obsidian/-/remark-obsidian-2.2.0.tgz",
|
||||
"integrity": "sha512-uSuUA3CA2ebAls7IXaevgQGqqbho1fR0lORKUTmhOTEUTYt8GBkl7ipaik4Y7x3q1LzUflejgFIGl/0XO83OGw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=22"
|
||||
@@ -3132,13 +3131,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/search": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/search/-/search-1.0.1.tgz",
|
||||
"integrity": "sha512-av1+wMoArfY8e0S9M1SNR3FYw7ZIg1PjU422Fm45Jz3K3FaVYJmfu9eAqqNbYAmbEzi43rqcnfOpqj8HAaRUeA==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/search/-/search-1.0.2.tgz",
|
||||
"integrity": "sha512-tZcFCkoOY7AdT0pDXUVkdhwEs5JLPuoVXy+TvdpUe2Mzy91fDKQQF0eN5UV4i2awZqLGka4vsQ4k33hZAZSi8A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -3175,13 +3174,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/stacked-pages": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/stacked-pages/-/stacked-pages-1.0.1.tgz",
|
||||
"integrity": "sha512-h3bWrQcL3nUG48rnVi3cdnx9h/VNxJa9pFDSr9NC6x5pPJgTaeoilkPeb8QrXasREpHRTRhfXE5NWxh4ngcE6Q==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/stacked-pages/-/stacked-pages-1.0.2.tgz",
|
||||
"integrity": "sha512-0QxMNeiF5AnZ0fnQxFLcqs8GJCVywIoGjK+YNhN1TOk3p6MIDO0I+AdTbJ+QlZ5JiqXnNZkNoAnQJNXVCEiIAg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -3226,13 +3225,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/table-of-contents": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/table-of-contents/-/table-of-contents-1.0.1.tgz",
|
||||
"integrity": "sha512-lorY0WzK57U97YOjlvUAwMDa8yZiXoWW1dPJ1Q9ope2dzZ70kilXUUvCx1lzN/AxolzbdmTDxyedTWcDHmL38Q==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/table-of-contents/-/table-of-contents-1.0.2.tgz",
|
||||
"integrity": "sha512-lOwx5MwrDfDuk6rzBZdyToAZOiV6raN8JJVveSxMik8+QjdGGYA1Ery/A/HTib2riDEJZU6EgShlrYlrGpNCzg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -3248,13 +3247,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/tag-list": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/tag-list/-/tag-list-1.0.1.tgz",
|
||||
"integrity": "sha512-owUIVpoAQ3WvHXeqbimO64fjthBj8J+iq3TQPPaccT7rC6NVPZleEKE2jgvWTy60bVh/rJBsAjRNKN8rjlVaYg==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/tag-list/-/tag-list-1.0.2.tgz",
|
||||
"integrity": "sha512-Dr4QhM/h7tV0oNjhAq7Gpto1aLiMPplwBQ6CGUs15qhW3p9je3t0qhUQQVboXMXlw1u5NZiKj/NqoDnoZSMG9w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -3270,13 +3269,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/tag-page": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/tag-page/-/tag-page-1.0.1.tgz",
|
||||
"integrity": "sha512-zmp/AW8RRQYGTJNF6sLmAY/Z77dg4MrYhW/iEPnyjFGdIxKwxmeIht5/gnz8IuzD1+7ZJpOjkC1wtM47EyNK8g==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/tag-page/-/tag-page-1.0.2.tgz",
|
||||
"integrity": "sha512-GkPItFn82SA6h6tW6AZ3EdavsgkLd38ado8Gi1lm0wMbtHIJCFLlgZqYoReLTg32VGGT2gAvzn+hLsuuTV/LTQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/utils": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -3296,9 +3295,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/types": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/types/-/types-1.2.0.tgz",
|
||||
"integrity": "sha512-82L+hallWn9LCMw9kFUWJhAGwlTd4rT2KxxL8B7IAWTEvj/20StWsuC01Mbfk5hLhd8jAHGgj1WHb0u/cdUXEA==",
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/types/-/types-1.3.0.tgz",
|
||||
"integrity": "sha512-tdLWSv+XWqHGiuo77etvXkd2XO1S12NlUUbiC9o+o9BWgW7E/lcNl6A+I8c9uKbAj9CrIn7suK7z9154rlSwlQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"unified": "^11.0.5",
|
||||
@@ -3322,13 +3321,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/unlisted-pages": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/unlisted-pages/-/unlisted-pages-1.0.1.tgz",
|
||||
"integrity": "sha512-X7hlz1/i0CJMp13Px3p6tsJYBsAOFAWyAKx9hvospPDUnpMVFcNbTILGqrGKepCcgq8TQQ8GEIZdvNccxWmsPQ==",
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/unlisted-pages/-/unlisted-pages-1.1.0.tgz",
|
||||
"integrity": "sha512-Gi67xF7AIC860/Glwbi+Ewbbnvox3A3MPsTi2Dz25xuaepZLfnQAwCT4ZgAsy55y4wyxxZG8DBHjkOgRyd9PXQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.0"
|
||||
"@quartz-community/types": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22",
|
||||
@@ -3344,9 +3342,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-community/utils": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/utils/-/utils-1.0.2.tgz",
|
||||
"integrity": "sha512-0yS+43ufTYT80+kGC0ZRsY5HQ3l7M62GVh20ukX06vh2zLrU/W1o7RcWLffzUIJfb256E169rlSWdn66EZF6vA==",
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@quartz-community/utils/-/utils-1.1.1.tgz",
|
||||
"integrity": "sha512-iHjEOlbpqznut9YkoflXxd2Bl5TaBcMFwIouRxp2HTBcbCQbmHtAsL3sdLheC1YeM9bMxeFLAN2b7rIBR2r/og==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "^1.0.0"
|
||||
@@ -3356,17 +3354,7 @@
|
||||
"npm": ">=10.9.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"github-slugger": "^2.0.0",
|
||||
"hast-util-to-jsx-runtime": "^2.3.6",
|
||||
"preact": "^10.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"github-slugger": {
|
||||
"optional": true
|
||||
},
|
||||
"hast-util-to-jsx-runtime": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@quartz-themes/core": {
|
||||
@@ -4468,12 +4456,6 @@
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/github-slugger": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-2.0.0.tgz",
|
||||
"integrity": "sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/glob-parent": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
|
||||
|
||||
+44
-45
@@ -43,53 +43,52 @@
|
||||
"@floating-ui/dom": "^1.7.4",
|
||||
"@myriaddreamin/rehype-typst": "^0.7.0",
|
||||
"@napi-rs/simple-git": "1.1.0",
|
||||
"@quartz-community/alias-redirects": "^1.0.0",
|
||||
"@quartz-community/article-title": "^1.0.0",
|
||||
"@quartz-community/backlinks": "^1.0.0",
|
||||
"@quartz-community/bases-page": "^1.0.0",
|
||||
"@quartz-community/breadcrumbs": "^1.0.0",
|
||||
"@quartz-community/canvas-page": "^1.0.0",
|
||||
"@quartz-community/citations": "^1.0.0",
|
||||
"@quartz-community/cname": "^1.0.0",
|
||||
"@quartz-community/comments": "^1.0.0",
|
||||
"@quartz-community/content-meta": "^1.0.0",
|
||||
"@quartz-community/content-page": "^1.0.0",
|
||||
"@quartz-community/created-modified-date": "^1.0.0",
|
||||
"@quartz-community/darkmode": "^1.0.0",
|
||||
"@quartz-community/description": "^1.0.0",
|
||||
"@quartz-community/encrypted-pages": "^1.0.0",
|
||||
"@quartz-community/explicit-publish": "^1.0.0",
|
||||
"@quartz-community/explorer": "^1.0.0",
|
||||
"@quartz-community/favicon": "^1.0.0",
|
||||
"@quartz-community/folder-page": "^1.0.0",
|
||||
"@quartz-community/footer": "^1.0.0",
|
||||
"@quartz-community/github-flavored-markdown": "^2.0.0",
|
||||
"@quartz-community/graph": "^1.0.0",
|
||||
"@quartz-community/hard-line-breaks": "^1.0.0",
|
||||
"@quartz-community/latex": "^1.0.0",
|
||||
"@quartz-community/note-properties": "^1.1.1",
|
||||
"@quartz-community/obsidian-flavored-markdown": "^2.0.0",
|
||||
"@quartz-community/og-image": "^1.0.0",
|
||||
"@quartz-community/ox-hugo": "^1.0.0",
|
||||
"@quartz-community/page-title": "^1.0.0",
|
||||
"@quartz-community/quartz-fonts": "^1.0.0",
|
||||
"@quartz-community/reader-mode": "^1.0.0",
|
||||
"@quartz-community/recent-notes": "^1.0.0",
|
||||
"@quartz-community/roam": "^1.0.0",
|
||||
"@quartz-community/search": "^1.0.0",
|
||||
"@quartz-community/spacer": "^1.0.0",
|
||||
"@quartz-community/stacked-pages": "^1.0.0",
|
||||
"@quartz-community/syntax-highlighting": "^1.0.1",
|
||||
"@quartz-community/table-of-contents": "^1.0.0",
|
||||
"@quartz-community/tag-list": "^1.0.0",
|
||||
"@quartz-community/tag-page": "^1.0.0",
|
||||
"@quartz-community/unlisted-pages": "^1.0.0",
|
||||
"@quartz-themes/core": "^2.0.0",
|
||||
"@quartz-community/alias-redirects": "^1.0.2",
|
||||
"@quartz-community/article-title": "^1.0.1",
|
||||
"@quartz-community/backlinks": "^1.0.2",
|
||||
"@quartz-community/bases-page": "^1.1.2",
|
||||
"@quartz-community/breadcrumbs": "^1.0.2",
|
||||
"@quartz-community/canvas-page": "^1.0.2",
|
||||
"@quartz-community/citations": "^1.0.1",
|
||||
"@quartz-community/cname": "^1.0.1",
|
||||
"@quartz-community/comments": "^1.0.1",
|
||||
"@quartz-community/content-meta": "^1.0.1",
|
||||
"@quartz-community/content-page": "^1.0.2",
|
||||
"@quartz-community/created-modified-date": "^1.0.2",
|
||||
"@quartz-community/darkmode": "^1.0.1",
|
||||
"@quartz-community/description": "^1.0.2",
|
||||
"@quartz-community/encrypted-pages": "^1.1.0",
|
||||
"@quartz-community/explicit-publish": "^1.1.0",
|
||||
"@quartz-community/explorer": "^1.0.2",
|
||||
"@quartz-community/favicon": "^1.0.1",
|
||||
"@quartz-community/folder-page": "^1.0.2",
|
||||
"@quartz-community/footer": "^1.1.0",
|
||||
"@quartz-community/github-flavored-markdown": "^2.1.0",
|
||||
"@quartz-community/graph": "^1.0.2",
|
||||
"@quartz-community/hard-line-breaks": "^1.1.0",
|
||||
"@quartz-community/latex": "^1.0.1",
|
||||
"@quartz-community/note-properties": "^1.1.3",
|
||||
"@quartz-community/obsidian-flavored-markdown": "^2.1.1",
|
||||
"@quartz-community/og-image": "^1.1.1",
|
||||
"@quartz-community/ox-hugo": "^1.0.1",
|
||||
"@quartz-community/page-title": "^1.0.1",
|
||||
"@quartz-community/quartz-fonts": "^1.0.2",
|
||||
"@quartz-community/reader-mode": "^1.0.1",
|
||||
"@quartz-community/recent-notes": "^1.0.2",
|
||||
"@quartz-community/roam": "^1.0.1",
|
||||
"@quartz-community/search": "^1.0.2",
|
||||
"@quartz-community/spacer": "^1.0.1",
|
||||
"@quartz-community/stacked-pages": "^1.0.2",
|
||||
"@quartz-community/syntax-highlighting": "^1.0.2",
|
||||
"@quartz-community/table-of-contents": "^1.0.2",
|
||||
"@quartz-community/tag-list": "^1.0.2",
|
||||
"@quartz-community/tag-page": "^1.0.2",
|
||||
"@quartz-community/unlisted-pages": "^1.1.0",
|
||||
"@quartz-themes/core": "^2.0.1",
|
||||
"ansi-truncate": "^1.4.0",
|
||||
"async-mutex": "^0.5.0",
|
||||
"chokidar": "^5.0.0",
|
||||
"esbuild-sass-plugin": "^3.6.0",
|
||||
"github-slugger": "^2.0.0",
|
||||
"globby": "^16.1.0",
|
||||
"gray-matter": "^4.0.3",
|
||||
"hast-util-from-html": "^2.0.0",
|
||||
@@ -125,8 +124,8 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@changesets/cli": "^2.29.2",
|
||||
"@quartz-community/types": "^1.0.0",
|
||||
"@quartz-community/utils": "^1.0.1",
|
||||
"@quartz-community/types": "^1.3.0",
|
||||
"@quartz-community/utils": "^1.1.1",
|
||||
"@types/hast": "^3.0.4",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/node": "^26.5.1",
|
||||
|
||||
+6
-1
@@ -46,7 +46,12 @@ function updateSlugs(ctx: BuildCtx, allFiles: string[]): void {
|
||||
? collectPermalinks({
|
||||
files: allFiles.filter((fp) => fp.endsWith(".md")),
|
||||
permalinkOf: (fp) => {
|
||||
const source = fs.readFileSync(path.join(ctx.argv.directory, fp))
|
||||
let source: Buffer
|
||||
try {
|
||||
source = fs.readFileSync(path.join(ctx.argv.directory, fp))
|
||||
} catch {
|
||||
return undefined // an unreadable file is reported when the file is parsed
|
||||
}
|
||||
if (!source.includes("permalink")) return undefined
|
||||
try {
|
||||
return readFrontmatterData(source, options).permalink
|
||||
|
||||
@@ -428,6 +428,8 @@ export async function handleBuild(argv) {
|
||||
`${styleText("red", "Failed to build Quartz.")} Check for syntax errors in your configuration or plugins.`,
|
||||
)
|
||||
console.log(`Reason: ${styleText("gray", err.message ?? String(err))}`)
|
||||
// stop esbuild's child process first: it shares our stderr and outlives us otherwise
|
||||
void esbuild.stop()
|
||||
process.exit(1)
|
||||
})
|
||||
release()
|
||||
|
||||
@@ -183,6 +183,46 @@ describe("renderTranscludes", () => {
|
||||
assert.ok(!secondText.includes("Circular transclusion"), "should not show circular warning")
|
||||
})
|
||||
|
||||
test("a header transclusion matches a heading's Obsidian-anchor alias", () => {
|
||||
const root: Root = {
|
||||
type: "root",
|
||||
children: [makeTranscludeBlockquote("target", "#colon-unspaced")],
|
||||
}
|
||||
const targetHtml: Root = {
|
||||
type: "root",
|
||||
children: [
|
||||
{
|
||||
type: "element",
|
||||
tagName: "h2",
|
||||
properties: { id: "colonunspaced" },
|
||||
children: [
|
||||
{
|
||||
type: "element",
|
||||
tagName: "span",
|
||||
properties: { id: "colon-unspaced", className: ["heading-alias"] },
|
||||
children: [],
|
||||
},
|
||||
{ type: "text", value: "Colon:unspaced" },
|
||||
],
|
||||
},
|
||||
{
|
||||
type: "element",
|
||||
tagName: "p",
|
||||
properties: {},
|
||||
children: [{ type: "text", value: "Section text" }],
|
||||
},
|
||||
],
|
||||
}
|
||||
renderTranscludes(
|
||||
root,
|
||||
cfg,
|
||||
"current" as FullSlug,
|
||||
makeComponentData([makePageData("target", targetHtml)]) as QuartzComponentProps,
|
||||
new Set<FullSlug>(["current" as FullSlug]),
|
||||
)
|
||||
assert.ok(JSON.stringify((root.children[0] as Element).children).includes("Section text"))
|
||||
})
|
||||
|
||||
test("detects actual circular transclusion (A -> B -> A)", () => {
|
||||
// Page A embeds B, and B's htmlAst contains a transclusion of A
|
||||
const bTranscludesA = makeTranscludeBlockquote("pageA")
|
||||
|
||||
@@ -31,6 +31,25 @@ interface RenderComponents {
|
||||
}
|
||||
|
||||
const headerRegex = new RegExp(/h[1-6]/)
|
||||
|
||||
/**
|
||||
* Whether a heading answers to `id`: its own id, or the id of a `span.heading-alias` inside it.
|
||||
* GitHubFlavoredMarkdown adds that alias when the anchor Obsidian writes for a heading (`:`, `|`,
|
||||
* `^`, `#` and `\` become spaces) slugs differently, e.g. `![[note#Colon unspaced]]` for
|
||||
* `## Colon:unspaced`.
|
||||
*/
|
||||
function headingHasId(heading: Element, id: string): boolean {
|
||||
if (heading.properties?.id === id) return true
|
||||
const hasAlias = (el: Element): boolean =>
|
||||
el.children.some(
|
||||
(child) =>
|
||||
child.type === "element" &&
|
||||
((child.properties?.id === id &&
|
||||
([] as unknown[]).concat(child.properties?.className ?? []).includes("heading-alias")) ||
|
||||
hasAlias(child)),
|
||||
)
|
||||
return hasAlias(heading)
|
||||
}
|
||||
export function pageResources(
|
||||
baseDir: FullSlug | RelativeURL,
|
||||
staticResources: StaticResources,
|
||||
@@ -231,7 +250,7 @@ export function renderTranscludes(
|
||||
const depth = Number(htmlEl.tagName.substring(1))
|
||||
|
||||
if (startIdx === undefined || startDepth === undefined) {
|
||||
if (htmlEl.properties?.id === blockRef) {
|
||||
if (headingHasId(htmlEl, blockRef)) {
|
||||
startIdx = i
|
||||
startDepth = depth
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ describe("frontmatter built-in", () => {
|
||||
readFrontmatterData(`---\n{ ran: (globalThis.__quartzFrontmatterRan = true) }\n---\n`, {
|
||||
language: lang as "yaml",
|
||||
}),
|
||||
/JavaScript frontmatter/,
|
||||
/unsupported `language` option/,
|
||||
)
|
||||
}
|
||||
assert.strictEqual(g.__quartzFrontmatterRan, undefined)
|
||||
@@ -242,6 +242,31 @@ describe("frontmatter built-in", () => {
|
||||
)
|
||||
})
|
||||
|
||||
test("an unsupported language option is a configuration error, not a content error", () => {
|
||||
assert.throws(
|
||||
() => readFrontmatterData("---\ntitle: a\n---\n", { language: "json" as "yaml" }),
|
||||
(err: Error) =>
|
||||
!isContentError(err) && /unsupported `language` option "json"/.test(err.message),
|
||||
)
|
||||
})
|
||||
|
||||
test("frontmatter holding a single value or a list instead of properties is a content error", () => {
|
||||
for (const source of [
|
||||
"---\nhello\n---\nbody\n",
|
||||
"---\n42\n---\n",
|
||||
"---\n- a\n- b\n---\nbody\n",
|
||||
]) {
|
||||
assert.throws(
|
||||
() => readFrontmatterData(source),
|
||||
(err: Error) => isContentError(err) && /expected properties/.test(err.message),
|
||||
)
|
||||
}
|
||||
// empty frontmatter keeps working
|
||||
assert.deepStrictEqual(readFrontmatterData("---\n---\nbody\n"), {})
|
||||
assert.deepStrictEqual(readFrontmatterData("---\n# just a comment\n---\nbody\n"), {})
|
||||
assert.deepStrictEqual(readFrontmatterData("---\nnull\n---\n"), {})
|
||||
})
|
||||
|
||||
test("a permalink is the page's address, not an alias (Obsidian Publish)", () => {
|
||||
const data: Record<string, unknown> = { permalink: "short", aliases: ["old-name"] }
|
||||
assert.deepStrictEqual(normalizeFrontmatter(data, "x").aliases, ["old-name"])
|
||||
|
||||
@@ -146,10 +146,17 @@ export function readFrontmatterData(
|
||||
source: Buffer | string,
|
||||
options: Pick<FrontmatterConfig, "delimiters" | "language"> = {},
|
||||
): Record<string, unknown> {
|
||||
const language = options.language ?? frontmatterDefaults.language
|
||||
if (language !== "yaml" && language !== "toml") {
|
||||
// a configuration mistake, not a problem in the file: no ContentError
|
||||
throw new Error(
|
||||
`Frontmatter: unsupported \`language\` option ${JSON.stringify(language)} (use "yaml" or "toml")`,
|
||||
)
|
||||
}
|
||||
try {
|
||||
const { data } = matter(Buffer.isBuffer(source) ? source : Buffer.from(source), {
|
||||
delimiters: options.delimiters ?? frontmatterDefaults.delimiters,
|
||||
language: options.language ?? frontmatterDefaults.language,
|
||||
language,
|
||||
engines: {
|
||||
yaml: (s) => yaml.load(s, { schema: yaml.JSON_SCHEMA }) as object,
|
||||
toml: (s) => toml.parse(s) as object,
|
||||
@@ -157,6 +164,14 @@ export function readFrontmatterData(
|
||||
js: refuseJavaScript,
|
||||
},
|
||||
})
|
||||
// YAML/TOML can hold a single value (`--- hello ---`) or a list (`- a`); properties are
|
||||
// key/value pairs
|
||||
if (typeof data !== "object" || data === null || Array.isArray(data)) {
|
||||
const kind = Array.isArray(data) ? "list" : typeof data
|
||||
throw new ContentError(
|
||||
`Invalid frontmatter: expected properties (\`key: value\` lines), got a ${kind} (${JSON.stringify(data)})`,
|
||||
)
|
||||
}
|
||||
return data
|
||||
} catch (err) {
|
||||
if (err instanceof ContentError) throw err
|
||||
|
||||
@@ -4,6 +4,7 @@ import fs from "node:fs"
|
||||
import os from "node:os"
|
||||
import path from "node:path"
|
||||
import { Assets } from "./assets"
|
||||
import { isContentError } from "../../util/pluginErrors"
|
||||
import type { StaticResources } from "../../util/resources"
|
||||
import type { BuildCtx } from "../../util/ctx"
|
||||
import type { ChangeEvent } from "../types"
|
||||
@@ -52,3 +53,53 @@ describe("Assets.partialEmit", () => {
|
||||
await assert.doesNotReject(consumeDelete(output, changeEvent))
|
||||
})
|
||||
})
|
||||
|
||||
describe("Assets.emit", () => {
|
||||
const emitAll = async (directory: string, output: string) => {
|
||||
const ctx = {
|
||||
argv: { directory, output },
|
||||
cfg: { configuration: { ignorePatterns: [] }, plugins: { pageTypes: [] } },
|
||||
} as unknown as BuildCtx
|
||||
const emitted = Assets().emit(ctx, [], {} as StaticResources)
|
||||
const files: unknown[] = []
|
||||
for await (const file of emitted as AsyncIterable<unknown>) files.push(file)
|
||||
return files
|
||||
}
|
||||
const tempDir = async () => {
|
||||
const dir = await fs.promises.mkdtemp(path.join(os.tmpdir(), "quartz-assets-"))
|
||||
tempDirs.push(dir)
|
||||
return dir
|
||||
}
|
||||
// chmod can't take read/write access away from root, and Windows ignores POSIX permission bits
|
||||
const noPermissions = process.getuid?.() === 0 || process.platform === "win32"
|
||||
|
||||
test("an unreadable asset is a content error", { skip: noPermissions }, async () => {
|
||||
const content = await tempDir()
|
||||
const output = await tempDir()
|
||||
const asset = path.join(content, "secret.png")
|
||||
await fs.promises.writeFile(asset, "x")
|
||||
await fs.promises.chmod(asset, 0o000)
|
||||
try {
|
||||
await assert.rejects(
|
||||
emitAll(content, output),
|
||||
(err: Error) =>
|
||||
isContentError(err) &&
|
||||
err.message === "Cannot read `secret.png`: permission denied (EACCES)",
|
||||
)
|
||||
} finally {
|
||||
await fs.promises.chmod(asset, 0o644)
|
||||
}
|
||||
})
|
||||
|
||||
test("an unwritable output is not a content error", { skip: noPermissions }, async () => {
|
||||
const content = await tempDir()
|
||||
const output = await tempDir()
|
||||
await fs.promises.writeFile(path.join(content, "image.png"), "x")
|
||||
await fs.promises.chmod(output, 0o555)
|
||||
try {
|
||||
await assert.rejects(emitAll(content, output), (err: Error) => !isContentError(err))
|
||||
} finally {
|
||||
await fs.promises.chmod(output, 0o755)
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -5,6 +5,7 @@ import path from "path"
|
||||
import fs from "fs"
|
||||
import { glob } from "../../util/glob"
|
||||
import { Argv, BuildCtx } from "../../util/ctx"
|
||||
import { unreadableFileError } from "../../util/pluginErrors"
|
||||
import { QuartzConfig } from "../../cfg"
|
||||
import { visit } from "unist-util-visit"
|
||||
import { Element } from "hast"
|
||||
@@ -99,10 +100,25 @@ const copyFile = async (argv: Argv, fp: FilePath) => {
|
||||
const dir = path.dirname(dest) as FilePath
|
||||
await fs.promises.mkdir(dir, { recursive: true })
|
||||
|
||||
await fs.promises.copyFile(src, dest)
|
||||
try {
|
||||
await fs.promises.copyFile(src, dest)
|
||||
} catch (err) {
|
||||
throw await unreadableSource(err, src, fp)
|
||||
}
|
||||
return dest
|
||||
}
|
||||
|
||||
/** A content file Quartz can't read (no permission, …) is a content problem, not a Quartz bug. */
|
||||
async function unreadableSource(err: unknown, src: FilePath, fp: FilePath): Promise<unknown> {
|
||||
if ((err as NodeJS.ErrnoException | null)?.code === "ENOENT") return err
|
||||
try {
|
||||
await fs.promises.access(src, fs.constants.R_OK)
|
||||
return err // the source is readable: the output side failed
|
||||
} catch {
|
||||
return unreadableFileError(err, fp) ?? err
|
||||
}
|
||||
}
|
||||
|
||||
export const Assets: QuartzEmitterPlugin = () => {
|
||||
return {
|
||||
name: "Assets",
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
import test, { describe } from "node:test"
|
||||
import assert from "node:assert"
|
||||
import fs from "node:fs"
|
||||
import os from "node:os"
|
||||
import path from "node:path"
|
||||
import { readContentFile } from "./parse"
|
||||
import { isContentError } from "../util/pluginErrors"
|
||||
import type { FilePath } from "../util/path"
|
||||
|
||||
describe("readContentFile", () => {
|
||||
test("reads a file", async () => {
|
||||
const dir = await fs.promises.mkdtemp(path.join(os.tmpdir(), "quartz-parse-"))
|
||||
try {
|
||||
const fp = path.join(dir, "note.md")
|
||||
await fs.promises.writeFile(fp, "# hi")
|
||||
assert.strictEqual((await readContentFile(fp as FilePath)).toString(), "# hi")
|
||||
} finally {
|
||||
await fs.promises.rm(dir, { recursive: true })
|
||||
}
|
||||
})
|
||||
|
||||
test("a file that can't be read is a content error", async () => {
|
||||
const dir = await fs.promises.mkdtemp(path.join(os.tmpdir(), "quartz-parse-"))
|
||||
try {
|
||||
// a directory named like a note, and a file that is gone
|
||||
await fs.promises.mkdir(path.join(dir, "folder.md"))
|
||||
for (const [name, reason] of [
|
||||
["folder.md", "it is a directory (EISDIR)"],
|
||||
["missing.md", "it no longer exists (ENOENT)"],
|
||||
]) {
|
||||
await assert.rejects(
|
||||
readContentFile(path.join(dir, name) as FilePath),
|
||||
(err: Error) =>
|
||||
isContentError(err) && err.message === `Cannot read \`${name}\`: ${reason}`,
|
||||
)
|
||||
}
|
||||
} finally {
|
||||
await fs.promises.rm(dir, { recursive: true })
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -15,7 +15,12 @@ import { QuartzLogger } from "../util/log"
|
||||
import { trace } from "../util/trace"
|
||||
import { BuildCtx, WorkerSerializableBuildCtx } from "../util/ctx"
|
||||
import { styleText } from "util"
|
||||
import { attributeError, attributePluggables, originOf } from "../util/pluginErrors"
|
||||
import {
|
||||
attributeError,
|
||||
attributePluggables,
|
||||
originOf,
|
||||
unreadableFileError,
|
||||
} from "../util/pluginErrors"
|
||||
|
||||
export type QuartzMdProcessor = Processor<MDRoot, MDRoot, MDRoot>
|
||||
export type QuartzHtmlProcessor = Processor<undefined, MDRoot, HTMLRoot>
|
||||
@@ -90,6 +95,19 @@ async function transpileWorkerScript() {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Read a content file. A file that can't be read (no permission, removed during the build, …) is a
|
||||
* problem with the content, not a Quartz bug.
|
||||
* @internal Exported for testing.
|
||||
*/
|
||||
export async function readContentFile(fp: FilePath) {
|
||||
try {
|
||||
return await read(fp)
|
||||
} catch (err) {
|
||||
throw unreadableFileError(err, path.basename(fp)) ?? err
|
||||
}
|
||||
}
|
||||
|
||||
export function createFileParser(ctx: BuildCtx, fps: FilePath[]) {
|
||||
const { argv, cfg } = ctx
|
||||
return async (processor: QuartzMdProcessor) => {
|
||||
@@ -97,7 +115,7 @@ export function createFileParser(ctx: BuildCtx, fps: FilePath[]) {
|
||||
for (const fp of fps) {
|
||||
try {
|
||||
const perf = new PerfTimer()
|
||||
const file = await read(fp)
|
||||
const file = await readContentFile(fp)
|
||||
|
||||
// strip leading and trailing whitespace
|
||||
file.value = file.value.toString().trim()
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
PluginError,
|
||||
ContentError,
|
||||
isContentError,
|
||||
unreadableFileError,
|
||||
} from "./pluginErrors"
|
||||
import {
|
||||
recordDiagnostic,
|
||||
@@ -238,3 +239,19 @@ describe("plugin load failures", () => {
|
||||
assert.ok(text.indexOf("failed to load") < text.indexOf("some warning"))
|
||||
})
|
||||
})
|
||||
|
||||
describe("unreadableFileError", () => {
|
||||
test("turns a file-system error into a content error naming the file", () => {
|
||||
const fsError = Object.assign(new Error("EACCES: permission denied, open 'x'"), {
|
||||
code: "EACCES",
|
||||
})
|
||||
const err = unreadableFileError(fsError, "notes/x.md")
|
||||
assert.ok(err && isContentError(err))
|
||||
assert.strictEqual(err.message, "Cannot read `notes/x.md`: permission denied (EACCES)")
|
||||
assert.strictEqual(err.cause, fsError)
|
||||
})
|
||||
|
||||
test("leaves other errors alone", () => {
|
||||
assert.strictEqual(unreadableFileError(new TypeError("boom"), "x.md"), undefined)
|
||||
})
|
||||
})
|
||||
@@ -50,6 +50,24 @@ export class ContentError extends Error {
|
||||
}
|
||||
}
|
||||
|
||||
const fileErrorReasons: Record<string, string> = {
|
||||
EACCES: "permission denied",
|
||||
EPERM: "permission denied",
|
||||
EISDIR: "it is a directory",
|
||||
ENOENT: "it no longer exists",
|
||||
}
|
||||
|
||||
/**
|
||||
* A {@link ContentError} for a content file that can't be read (`err` from `fs`), or `undefined`
|
||||
* when `err` is not a file-system error.
|
||||
*/
|
||||
export function unreadableFileError(err: unknown, file: string): ContentError | undefined {
|
||||
const code = (err as NodeJS.ErrnoException | null)?.code
|
||||
if (typeof code !== "string") return undefined
|
||||
const reason = fileErrorReasons[code] ?? (err as Error).message
|
||||
return new ContentError(`Cannot read \`${file}\`: ${reason} (${code})`, { cause: err })
|
||||
}
|
||||
|
||||
/** Whether `err` or one of its causes (e.g. inside a {@link PluginError}) is a {@link ContentError}. */
|
||||
export function isContentError(err: unknown): boolean {
|
||||
let e = err
|
||||
|
||||
+13
-1
@@ -1,5 +1,6 @@
|
||||
import { styleText } from "util"
|
||||
import process from "process"
|
||||
import esbuild from "esbuild"
|
||||
import { isMainThread } from "workerpool"
|
||||
import { isContentError, pluginErrorInfo, PluginErrorInfo } from "./pluginErrors"
|
||||
import { knownProblemsFor } from "./diagnostics"
|
||||
@@ -130,6 +131,17 @@ export function trace(msg: string, err: Error) {
|
||||
} else {
|
||||
// print and exit
|
||||
console.error(traceMsg)
|
||||
process.exit(1)
|
||||
exitBuild(1)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Exit the build process. esbuild's service is a child process that shares our stderr; exiting
|
||||
* while it has requests in flight (bundling component scripts, the CLI's build context) left it
|
||||
* running without its parent, and it printed "fatal error: all goroutines are asleep - deadlock!"
|
||||
* and a goroutine dump after Quartz's error. Stop it first.
|
||||
*/
|
||||
export function exitBuild(code: number): never {
|
||||
void esbuild.stop()
|
||||
process.exit(code)
|
||||
}
|
||||
Reference in new issue
Block a user