feat: migrate to npm specifiers with type-safe plugin index

- Default config and all 4 templates use @quartz-community/* npm specifiers
- config-loader: npm packages imported directly (not via .quartz/plugins/ paths)
- gitLoader: regeneratePluginIndex cross-references .d.ts with .js to correctly
  classify type-only exports, preventing runtime 'does not provide export' errors
- All 44 default plugins added as dependencies
- Locally tested: 111 docs files → 374 output files, zero errors
This commit is contained in:
saberzero1
2026-07-23 02:19:17 +02:00
parent 4b7ecb96f0
commit 11b9960663
9 changed files with 368 additions and 232 deletions
+44
View File
@@ -13,6 +13,50 @@
"@floating-ui/dom": "^1.7.4", "@floating-ui/dom": "^1.7.4",
"@myriaddreamin/rehype-typst": "^0.6.0", "@myriaddreamin/rehype-typst": "^0.6.0",
"@napi-rs/simple-git": "0.1.22", "@napi-rs/simple-git": "0.1.22",
"@quartz-community/alias-redirects": "*",
"@quartz-community/article-title": "*",
"@quartz-community/backlinks": "*",
"@quartz-community/bases-page": "*",
"@quartz-community/breadcrumbs": "*",
"@quartz-community/canvas-page": "*",
"@quartz-community/citations": "*",
"@quartz-community/cname": "*",
"@quartz-community/comments": "*",
"@quartz-community/content-index": "*",
"@quartz-community/content-meta": "*",
"@quartz-community/content-page": "*",
"@quartz-community/crawl-links": "*",
"@quartz-community/created-modified-date": "*",
"@quartz-community/darkmode": "*",
"@quartz-community/description": "*",
"@quartz-community/encrypted-pages": "*",
"@quartz-community/explicit-publish": "*",
"@quartz-community/explorer": "*",
"@quartz-community/favicon": "*",
"@quartz-community/folder-page": "*",
"@quartz-community/footer": "*",
"@quartz-community/github-flavored-markdown": "*",
"@quartz-community/graph": "*",
"@quartz-community/hard-line-breaks": "*",
"@quartz-community/latex": "*",
"@quartz-community/note-properties": "*",
"@quartz-community/obsidian-flavored-markdown": "*",
"@quartz-community/og-image": "*",
"@quartz-community/ox-hugo": "*",
"@quartz-community/page-title": "*",
"@quartz-community/quartz-fonts": "*",
"@quartz-community/reader-mode": "*",
"@quartz-community/recent-notes": "*",
"@quartz-community/remove-draft": "*",
"@quartz-community/roam": "*",
"@quartz-community/search": "*",
"@quartz-community/spacer": "*",
"@quartz-community/stacked-pages": "*",
"@quartz-community/syntax-highlighting": "*",
"@quartz-community/table-of-contents": "*",
"@quartz-community/tag-list": "*",
"@quartz-community/tag-page": "*",
"@quartz-community/unlisted-pages": "*",
"ansi-truncate": "^1.4.0", "ansi-truncate": "^1.4.0",
"async-mutex": "^0.5.0", "async-mutex": "^0.5.0",
"chokidar": "^5.0.0", "chokidar": "^5.0.0",
+44
View File
@@ -41,6 +41,50 @@
"@floating-ui/dom": "^1.7.4", "@floating-ui/dom": "^1.7.4",
"@myriaddreamin/rehype-typst": "^0.6.0", "@myriaddreamin/rehype-typst": "^0.6.0",
"@napi-rs/simple-git": "0.1.22", "@napi-rs/simple-git": "0.1.22",
"@quartz-community/alias-redirects": "*",
"@quartz-community/article-title": "*",
"@quartz-community/backlinks": "*",
"@quartz-community/bases-page": "*",
"@quartz-community/breadcrumbs": "*",
"@quartz-community/canvas-page": "*",
"@quartz-community/citations": "*",
"@quartz-community/cname": "*",
"@quartz-community/comments": "*",
"@quartz-community/content-index": "*",
"@quartz-community/content-meta": "*",
"@quartz-community/content-page": "*",
"@quartz-community/crawl-links": "*",
"@quartz-community/created-modified-date": "*",
"@quartz-community/darkmode": "*",
"@quartz-community/description": "*",
"@quartz-community/encrypted-pages": "*",
"@quartz-community/explicit-publish": "*",
"@quartz-community/explorer": "*",
"@quartz-community/favicon": "*",
"@quartz-community/folder-page": "*",
"@quartz-community/footer": "*",
"@quartz-community/github-flavored-markdown": "*",
"@quartz-community/graph": "*",
"@quartz-community/hard-line-breaks": "*",
"@quartz-community/latex": "*",
"@quartz-community/note-properties": "*",
"@quartz-community/obsidian-flavored-markdown": "*",
"@quartz-community/og-image": "*",
"@quartz-community/ox-hugo": "*",
"@quartz-community/page-title": "*",
"@quartz-community/quartz-fonts": "*",
"@quartz-community/reader-mode": "*",
"@quartz-community/recent-notes": "*",
"@quartz-community/remove-draft": "*",
"@quartz-community/roam": "*",
"@quartz-community/search": "*",
"@quartz-community/spacer": "*",
"@quartz-community/stacked-pages": "*",
"@quartz-community/syntax-highlighting": "*",
"@quartz-community/table-of-contents": "*",
"@quartz-community/tag-list": "*",
"@quartz-community/tag-page": "*",
"@quartz-community/unlisted-pages": "*",
"ansi-truncate": "^1.4.0", "ansi-truncate": "^1.4.0",
"async-mutex": "^0.5.0", "async-mutex": "^0.5.0",
"chokidar": "^5.0.0", "chokidar": "^5.0.0",
+44 -44
View File
@@ -41,7 +41,7 @@ configuration:
highlight: rgba(143, 159, 169, 0.15) highlight: rgba(143, 159, 169, 0.15)
textHighlight: "#b3aa0288" textHighlight: "#b3aa0288"
plugins: plugins:
- source: github:quartz-community/created-modified-date - source: "@quartz-community/created-modified-date"
enabled: true enabled: true
options: options:
defaultDateType: modified defaultDateType: modified
@@ -50,7 +50,7 @@ plugins:
- git - git
- filesystem - filesystem
order: 10 order: 10
- source: github:quartz-community/syntax-highlighting - source: "@quartz-community/syntax-highlighting"
enabled: true enabled: true
options: options:
theme: theme:
@@ -58,84 +58,84 @@ plugins:
dark: github-dark dark: github-dark
keepBackground: false keepBackground: false
order: 20 order: 20
- source: github:quartz-community/obsidian-flavored-markdown - source: "@quartz-community/obsidian-flavored-markdown"
enabled: true enabled: true
options: options:
enableInHtmlEmbed: false enableInHtmlEmbed: false
enableCheckbox: true enableCheckbox: true
order: 30 order: 30
- source: github:quartz-community/github-flavored-markdown - source: "@quartz-community/github-flavored-markdown"
enabled: true enabled: true
order: 40 order: 40
- source: github:quartz-community/table-of-contents - source: "@quartz-community/table-of-contents"
enabled: true enabled: true
order: 50 order: 50
layout: layout:
position: right position: right
priority: 30 priority: 30
- source: github:quartz-community/crawl-links - source: "@quartz-community/crawl-links"
enabled: true enabled: true
options: options:
markdownLinkResolution: shortest markdownLinkResolution: shortest
order: 60 order: 60
- source: github:quartz-community/description - source: "@quartz-community/description"
enabled: true enabled: true
order: 70 order: 70
- source: github:quartz-community/latex - source: "@quartz-community/latex"
enabled: true enabled: true
options: options:
renderEngine: katex renderEngine: katex
order: 80 order: 80
- source: github:quartz-community/citations - source: "@quartz-community/citations"
enabled: false enabled: false
order: 85 order: 85
- source: github:quartz-community/hard-line-breaks - source: "@quartz-community/hard-line-breaks"
enabled: false enabled: false
order: 90 order: 90
- source: github:quartz-community/ox-hugo - source: "@quartz-community/ox-hugo"
enabled: false enabled: false
order: 91 order: 91
- source: github:quartz-community/roam - source: "@quartz-community/roam"
enabled: false enabled: false
order: 92 order: 92
- source: github:quartz-community/fonts - source: "@quartz-community/quartz-fonts"
enabled: true enabled: true
- source: github:quartz-community/remove-draft - source: "@quartz-community/remove-draft"
enabled: true enabled: true
- source: github:quartz-community/explicit-publish - source: "@quartz-community/explicit-publish"
enabled: false enabled: false
- source: github:quartz-community/alias-redirects - source: "@quartz-community/alias-redirects"
enabled: true enabled: true
- source: github:quartz-community/content-index - source: "@quartz-community/content-index"
enabled: true enabled: true
options: options:
enableSiteMap: true enableSiteMap: true
enableRSS: true enableRSS: true
- source: github:quartz-community/favicon - source: "@quartz-community/favicon"
enabled: true enabled: true
- source: github:quartz-community/og-image - source: "@quartz-community/og-image"
enabled: true enabled: true
- source: github:quartz-community/cname - source: "@quartz-community/cname"
enabled: true enabled: true
- source: github:quartz-community/canvas-page - source: "@quartz-community/canvas-page"
enabled: true enabled: true
- source: github:quartz-community/content-page - source: "@quartz-community/content-page"
enabled: true enabled: true
- source: github:quartz-community/folder-page - source: "@quartz-community/folder-page"
enabled: true enabled: true
- source: github:quartz-community/tag-page - source: "@quartz-community/tag-page"
enabled: true enabled: true
- source: github:quartz-community/explorer - source: "@quartz-community/explorer"
enabled: true enabled: true
layout: layout:
position: left position: left
priority: 50 priority: 50
- source: github:quartz-community/graph - source: "@quartz-community/graph"
enabled: true enabled: true
layout: layout:
position: right position: right
priority: 10 priority: 10
- source: github:quartz-community/search - source: "@quartz-community/search"
enabled: true enabled: true
layout: layout:
position: left position: left
@@ -143,50 +143,50 @@ plugins:
group: toolbar group: toolbar
groupOptions: groupOptions:
grow: true grow: true
- source: github:quartz-community/backlinks - source: "@quartz-community/backlinks"
enabled: true enabled: true
layout: layout:
position: right position: right
priority: 50 priority: 50
- source: github:quartz-community/article-title - source: "@quartz-community/article-title"
enabled: true enabled: true
layout: layout:
position: beforeBody position: beforeBody
priority: 10 priority: 10
- source: github:quartz-community/content-meta - source: "@quartz-community/content-meta"
enabled: true enabled: true
layout: layout:
position: beforeBody position: beforeBody
priority: 20 priority: 20
- source: github:quartz-community/tag-list - source: "@quartz-community/tag-list"
enabled: false enabled: false
layout: layout:
position: beforeBody position: beforeBody
priority: 30 priority: 30
- source: github:quartz-community/page-title - source: "@quartz-community/page-title"
enabled: true enabled: true
layout: layout:
position: left position: left
priority: 10 priority: 10
- source: github:quartz-community/darkmode - source: "@quartz-community/darkmode"
enabled: true enabled: true
layout: layout:
position: left position: left
priority: 30 priority: 30
group: toolbar group: toolbar
- source: github:quartz-community/reader-mode - source: "@quartz-community/reader-mode"
enabled: true enabled: true
layout: layout:
position: left position: left
priority: 35 priority: 35
group: toolbar group: toolbar
- source: github:quartz-community/breadcrumbs - source: "@quartz-community/breadcrumbs"
enabled: true enabled: true
layout: layout:
position: beforeBody position: beforeBody
priority: 5 priority: 5
condition: not-index condition: not-index
- source: github:quartz-community/comments - source: "@quartz-community/comments"
enabled: false enabled: false
options: options:
provider: giscus provider: giscus
@@ -194,15 +194,15 @@ plugins:
layout: layout:
position: afterBody position: afterBody
priority: 10 priority: 10
- source: github:quartz-community/footer - source: "@quartz-community/footer"
enabled: true enabled: true
options: options:
links: links:
GitHub: https://github.com/jackyzha0/quartz GitHub: https://github.com/jackyzha0/quartz
Discord Community: https://discord.gg/cRFFHYye7t Discord Community: https://discord.gg/cRFFHYye7t
- source: github:quartz-community/recent-notes - source: "@quartz-community/recent-notes"
enabled: false enabled: false
- source: github:quartz-community/spacer - source: "@quartz-community/spacer"
enabled: true enabled: true
options: {} options: {}
order: 25 order: 25
@@ -210,11 +210,11 @@ plugins:
position: left position: left
priority: 25 priority: 25
display: mobile-only display: mobile-only
- source: github:quartz-community/bases-page - source: "@quartz-community/bases-page"
enabled: true enabled: true
options: {} options: {}
order: 50 order: 50
- source: github:quartz-community/note-properties - source: "@quartz-community/note-properties"
enabled: true enabled: true
options: options:
includeAll: false includeAll: false
@@ -231,11 +231,11 @@ plugins:
position: beforeBody position: beforeBody
priority: 15 priority: 15
display: all display: all
- source: github:quartz-community/unlisted-pages - source: "@quartz-community/unlisted-pages"
enabled: true enabled: true
options: {} options: {}
order: 45 order: 45
- source: github:quartz-community/encrypted-pages - source: "@quartz-community/encrypted-pages"
enabled: true enabled: true
options: options:
iterations: 600000 iterations: 600000
@@ -247,7 +247,7 @@ plugins:
position: body position: body
priority: 100 priority: 100
display: all display: all
- source: github:quartz-community/stacked-pages - source: "@quartz-community/stacked-pages"
enabled: false enabled: false
layout: layout:
position: afterBody position: afterBody
+44 -44
View File
@@ -43,7 +43,7 @@ configuration:
highlight: rgba(143, 159, 169, 0.15) highlight: rgba(143, 159, 169, 0.15)
textHighlight: "#b3aa0288" textHighlight: "#b3aa0288"
plugins: plugins:
- source: github:quartz-community/created-modified-date - source: "@quartz-community/created-modified-date"
enabled: true enabled: true
options: options:
defaultDateType: modified defaultDateType: modified
@@ -52,7 +52,7 @@ plugins:
- git - git
- filesystem - filesystem
order: 10 order: 10
- source: github:quartz-community/syntax-highlighting - source: "@quartz-community/syntax-highlighting"
enabled: true enabled: true
options: options:
theme: theme:
@@ -60,96 +60,96 @@ plugins:
dark: github-dark dark: github-dark
keepBackground: false keepBackground: false
order: 20 order: 20
- source: github:quartz-community/obsidian-flavored-markdown - source: "@quartz-community/obsidian-flavored-markdown"
enabled: true enabled: true
options: options:
enableInHtmlEmbed: false enableInHtmlEmbed: false
enableCheckbox: true enableCheckbox: true
order: 30 order: 30
- source: github:quartz-community/github-flavored-markdown - source: "@quartz-community/github-flavored-markdown"
enabled: true enabled: true
order: 40 order: 40
- source: github:quartz-community/table-of-contents - source: "@quartz-community/table-of-contents"
enabled: true enabled: true
order: 50 order: 50
layout: layout:
position: right position: right
priority: 30 priority: 30
- source: github:quartz-community/crawl-links - source: "@quartz-community/crawl-links"
enabled: true enabled: true
options: options:
markdownLinkResolution: shortest markdownLinkResolution: shortest
order: 60 order: 60
- source: github:quartz-community/description - source: "@quartz-community/description"
enabled: true enabled: true
order: 70 order: 70
- source: github:quartz-community/latex - source: "@quartz-community/latex"
enabled: true enabled: true
options: options:
renderEngine: katex renderEngine: katex
order: 80 order: 80
- source: github:quartz-community/citations - source: "@quartz-community/citations"
enabled: false enabled: false
order: 85 order: 85
- source: github:quartz-community/hard-line-breaks - source: "@quartz-community/hard-line-breaks"
enabled: false enabled: false
order: 90 order: 90
- source: github:quartz-community/ox-hugo - source: "@quartz-community/ox-hugo"
enabled: false enabled: false
order: 91 order: 91
- source: github:quartz-community/roam - source: "@quartz-community/roam"
enabled: false enabled: false
order: 92 order: 92
- source: github:quartz-community/fonts - source: "@quartz-community/quartz-fonts"
enabled: true enabled: true
- source: github:quartz-community/remove-draft - source: "@quartz-community/remove-draft"
enabled: true enabled: true
- source: github:quartz-community/explicit-publish - source: "@quartz-community/explicit-publish"
enabled: false enabled: false
- source: github:quartz-community/unlisted-pages - source: "@quartz-community/unlisted-pages"
enabled: true enabled: true
options: {} options: {}
order: 45 order: 45
- source: github:quartz-community/encrypted-pages - source: "@quartz-community/encrypted-pages"
enabled: false enabled: false
- source: github:quartz-community/stacked-pages - source: "@quartz-community/stacked-pages"
enabled: false enabled: false
layout: layout:
position: afterBody position: afterBody
priority: 50 priority: 50
display: all display: all
- source: github:quartz-community/alias-redirects - source: "@quartz-community/alias-redirects"
enabled: true enabled: true
- source: github:quartz-community/content-index - source: "@quartz-community/content-index"
enabled: true enabled: true
options: options:
enableSiteMap: true enableSiteMap: true
enableRSS: true enableRSS: true
- source: github:quartz-community/favicon - source: "@quartz-community/favicon"
enabled: true enabled: true
- source: github:quartz-community/og-image - source: "@quartz-community/og-image"
enabled: true enabled: true
- source: github:quartz-community/cname - source: "@quartz-community/cname"
enabled: true enabled: true
- source: github:quartz-community/canvas-page - source: "@quartz-community/canvas-page"
enabled: true enabled: true
- source: github:quartz-community/content-page - source: "@quartz-community/content-page"
enabled: true enabled: true
- source: github:quartz-community/folder-page - source: "@quartz-community/folder-page"
enabled: true enabled: true
- source: github:quartz-community/tag-page - source: "@quartz-community/tag-page"
enabled: true enabled: true
- source: github:quartz-community/explorer - source: "@quartz-community/explorer"
enabled: true enabled: true
layout: layout:
position: left position: left
priority: 50 priority: 50
- source: github:quartz-community/graph - source: "@quartz-community/graph"
enabled: true enabled: true
layout: layout:
position: right position: right
priority: 10 priority: 10
- source: github:quartz-community/search - source: "@quartz-community/search"
enabled: true enabled: true
layout: layout:
position: left position: left
@@ -157,50 +157,50 @@ plugins:
group: toolbar group: toolbar
groupOptions: groupOptions:
grow: true grow: true
- source: github:quartz-community/backlinks - source: "@quartz-community/backlinks"
enabled: true enabled: true
layout: layout:
position: right position: right
priority: 50 priority: 50
- source: github:quartz-community/article-title - source: "@quartz-community/article-title"
enabled: true enabled: true
layout: layout:
position: beforeBody position: beforeBody
priority: 10 priority: 10
- source: github:quartz-community/content-meta - source: "@quartz-community/content-meta"
enabled: true enabled: true
layout: layout:
position: beforeBody position: beforeBody
priority: 20 priority: 20
- source: github:quartz-community/tag-list - source: "@quartz-community/tag-list"
enabled: false enabled: false
layout: layout:
position: beforeBody position: beforeBody
priority: 30 priority: 30
- source: github:quartz-community/page-title - source: "@quartz-community/page-title"
enabled: true enabled: true
layout: layout:
position: left position: left
priority: 10 priority: 10
- source: github:quartz-community/darkmode - source: "@quartz-community/darkmode"
enabled: true enabled: true
layout: layout:
position: left position: left
priority: 30 priority: 30
group: toolbar group: toolbar
- source: github:quartz-community/reader-mode - source: "@quartz-community/reader-mode"
enabled: true enabled: true
layout: layout:
position: left position: left
priority: 35 priority: 35
group: toolbar group: toolbar
- source: github:quartz-community/breadcrumbs - source: "@quartz-community/breadcrumbs"
enabled: true enabled: true
layout: layout:
position: beforeBody position: beforeBody
priority: 5 priority: 5
condition: not-index condition: not-index
- source: github:quartz-community/comments - source: "@quartz-community/comments"
enabled: true enabled: true
options: options:
provider: giscus provider: giscus
@@ -219,13 +219,13 @@ plugins:
layout: layout:
position: afterBody position: afterBody
priority: 10 priority: 10
- source: github:quartz-community/footer - source: "@quartz-community/footer"
enabled: true enabled: true
options: options:
links: links:
GitHub: https://github.com/jackyzha0/quartz GitHub: https://github.com/jackyzha0/quartz
Discord Community: https://discord.gg/cRFFHYye7t Discord Community: https://discord.gg/cRFFHYye7t
- source: github:quartz-community/recent-notes - source: "@quartz-community/recent-notes"
enabled: true enabled: true
options: options:
title: Recent Notes title: Recent Notes
@@ -235,7 +235,7 @@ plugins:
layout: layout:
position: left position: left
priority: 25 priority: 25
- source: github:quartz-community/spacer - source: "@quartz-community/spacer"
enabled: true enabled: true
options: {} options: {}
order: 25 order: 25
@@ -243,11 +243,11 @@ plugins:
position: left position: left
priority: 25 priority: 25
display: mobile-only display: mobile-only
- source: github:quartz-community/bases-page - source: "@quartz-community/bases-page"
enabled: true enabled: true
options: {} options: {}
order: 50 order: 50
- source: github:quartz-community/note-properties - source: "@quartz-community/note-properties"
enabled: true enabled: true
options: options:
includeAll: false includeAll: false
+44 -44
View File
@@ -43,7 +43,7 @@ configuration:
highlight: rgba(143, 159, 169, 0.15) highlight: rgba(143, 159, 169, 0.15)
textHighlight: "#b3aa0288" textHighlight: "#b3aa0288"
plugins: plugins:
- source: github:quartz-community/created-modified-date - source: "@quartz-community/created-modified-date"
enabled: true enabled: true
options: options:
defaultDateType: modified defaultDateType: modified
@@ -52,7 +52,7 @@ plugins:
- git - git
- filesystem - filesystem
order: 10 order: 10
- source: github:quartz-community/syntax-highlighting - source: "@quartz-community/syntax-highlighting"
enabled: true enabled: true
options: options:
theme: theme:
@@ -60,101 +60,101 @@ plugins:
dark: github-dark dark: github-dark
keepBackground: false keepBackground: false
order: 20 order: 20
- source: github:quartz-community/obsidian-flavored-markdown - source: "@quartz-community/obsidian-flavored-markdown"
enabled: true enabled: true
options: options:
enableInHtmlEmbed: false enableInHtmlEmbed: false
enableCheckbox: true enableCheckbox: true
order: 30 order: 30
- source: github:quartz-community/github-flavored-markdown - source: "@quartz-community/github-flavored-markdown"
enabled: true enabled: true
order: 40 order: 40
- source: github:quartz-community/table-of-contents - source: "@quartz-community/table-of-contents"
enabled: true enabled: true
order: 50 order: 50
layout: layout:
position: right position: right
priority: 30 priority: 30
- source: github:quartz-community/crawl-links - source: "@quartz-community/crawl-links"
enabled: true enabled: true
options: options:
markdownLinkResolution: shortest markdownLinkResolution: shortest
order: 60 order: 60
- source: github:quartz-community/description - source: "@quartz-community/description"
enabled: true enabled: true
order: 70 order: 70
- source: github:quartz-community/latex - source: "@quartz-community/latex"
enabled: true enabled: true
options: options:
renderEngine: katex renderEngine: katex
order: 80 order: 80
- source: github:quartz-community/citations - source: "@quartz-community/citations"
enabled: false enabled: false
order: 85 order: 85
- source: github:quartz-community/hard-line-breaks - source: "@quartz-community/hard-line-breaks"
enabled: false enabled: false
order: 90 order: 90
- source: github:quartz-community/ox-hugo - source: "@quartz-community/ox-hugo"
enabled: false enabled: false
order: 91 order: 91
- source: github:quartz-community/roam - source: "@quartz-community/roam"
enabled: false enabled: false
order: 92 order: 92
- source: github:quartz-community/fonts - source: "@quartz-community/quartz-fonts"
enabled: true enabled: true
- source: github:quartz-community/remove-draft - source: "@quartz-community/remove-draft"
enabled: true enabled: true
- source: github:quartz-community/explicit-publish - source: "@quartz-community/explicit-publish"
enabled: false enabled: false
- source: github:quartz-community/unlisted-pages - source: "@quartz-community/unlisted-pages"
enabled: true enabled: true
options: {} options: {}
order: 45 order: 45
- source: github:quartz-community/encrypted-pages - source: "@quartz-community/encrypted-pages"
enabled: true enabled: true
options: options:
iterations: 600000 iterations: 600000
passwordField: password passwordField: password
unlistWhenEncrypted: false unlistWhenEncrypted: false
outputPath: static/encryptedContentIndex.json outputPath: static/encryptedContentIndex.json
- source: github:quartz-community/stacked-pages - source: "@quartz-community/stacked-pages"
enabled: false enabled: false
layout: layout:
position: afterBody position: afterBody
priority: 50 priority: 50
display: all display: all
- source: github:quartz-community/alias-redirects - source: "@quartz-community/alias-redirects"
enabled: true enabled: true
- source: github:quartz-community/content-index - source: "@quartz-community/content-index"
enabled: true enabled: true
options: options:
enableSiteMap: true enableSiteMap: true
enableRSS: true enableRSS: true
- source: github:quartz-community/favicon - source: "@quartz-community/favicon"
enabled: true enabled: true
- source: github:quartz-community/og-image - source: "@quartz-community/og-image"
enabled: true enabled: true
- source: github:quartz-community/cname - source: "@quartz-community/cname"
enabled: true enabled: true
- source: github:quartz-community/canvas-page - source: "@quartz-community/canvas-page"
enabled: true enabled: true
- source: github:quartz-community/content-page - source: "@quartz-community/content-page"
enabled: true enabled: true
- source: github:quartz-community/folder-page - source: "@quartz-community/folder-page"
enabled: true enabled: true
- source: github:quartz-community/tag-page - source: "@quartz-community/tag-page"
enabled: true enabled: true
- source: github:quartz-community/explorer - source: "@quartz-community/explorer"
enabled: true enabled: true
layout: layout:
position: left position: left
priority: 50 priority: 50
- source: github:quartz-community/graph - source: "@quartz-community/graph"
enabled: true enabled: true
layout: layout:
position: right position: right
priority: 10 priority: 10
- source: github:quartz-community/search - source: "@quartz-community/search"
enabled: true enabled: true
layout: layout:
position: left position: left
@@ -162,50 +162,50 @@ plugins:
group: toolbar group: toolbar
groupOptions: groupOptions:
grow: true grow: true
- source: github:quartz-community/backlinks - source: "@quartz-community/backlinks"
enabled: true enabled: true
layout: layout:
position: right position: right
priority: 50 priority: 50
- source: github:quartz-community/article-title - source: "@quartz-community/article-title"
enabled: true enabled: true
layout: layout:
position: beforeBody position: beforeBody
priority: 10 priority: 10
- source: github:quartz-community/content-meta - source: "@quartz-community/content-meta"
enabled: true enabled: true
layout: layout:
position: beforeBody position: beforeBody
priority: 20 priority: 20
- source: github:quartz-community/tag-list - source: "@quartz-community/tag-list"
enabled: false enabled: false
layout: layout:
position: beforeBody position: beforeBody
priority: 30 priority: 30
- source: github:quartz-community/page-title - source: "@quartz-community/page-title"
enabled: true enabled: true
layout: layout:
position: left position: left
priority: 10 priority: 10
- source: github:quartz-community/darkmode - source: "@quartz-community/darkmode"
enabled: true enabled: true
layout: layout:
position: left position: left
priority: 30 priority: 30
group: toolbar group: toolbar
- source: github:quartz-community/reader-mode - source: "@quartz-community/reader-mode"
enabled: true enabled: true
layout: layout:
position: left position: left
priority: 35 priority: 35
group: toolbar group: toolbar
- source: github:quartz-community/breadcrumbs - source: "@quartz-community/breadcrumbs"
enabled: true enabled: true
layout: layout:
position: beforeBody position: beforeBody
priority: 5 priority: 5
condition: not-index condition: not-index
- source: github:quartz-community/comments - source: "@quartz-community/comments"
enabled: false enabled: false
options: options:
provider: giscus provider: giscus
@@ -213,15 +213,15 @@ plugins:
layout: layout:
position: afterBody position: afterBody
priority: 10 priority: 10
- source: github:quartz-community/footer - source: "@quartz-community/footer"
enabled: true enabled: true
options: options:
links: links:
GitHub: https://github.com/jackyzha0/quartz GitHub: https://github.com/jackyzha0/quartz
Discord Community: https://discord.gg/cRFFHYye7t Discord Community: https://discord.gg/cRFFHYye7t
- source: github:quartz-community/recent-notes - source: "@quartz-community/recent-notes"
enabled: false enabled: false
- source: github:quartz-community/spacer - source: "@quartz-community/spacer"
enabled: true enabled: true
options: {} options: {}
order: 25 order: 25
@@ -229,11 +229,11 @@ plugins:
position: left position: left
priority: 25 priority: 25
display: mobile-only display: mobile-only
- source: github:quartz-community/bases-page - source: "@quartz-community/bases-page"
enabled: true enabled: true
options: {} options: {}
order: 50 order: 50
- source: github:quartz-community/note-properties - source: "@quartz-community/note-properties"
enabled: true enabled: true
options: options:
includeAll: false includeAll: false
+45 -45
View File
@@ -43,7 +43,7 @@ configuration:
highlight: rgba(143, 159, 169, 0.15) highlight: rgba(143, 159, 169, 0.15)
textHighlight: "#b3aa0288" textHighlight: "#b3aa0288"
plugins: plugins:
- source: github:quartz-community/created-modified-date - source: "@quartz-community/created-modified-date"
enabled: true enabled: true
options: options:
defaultDateType: modified defaultDateType: modified
@@ -52,7 +52,7 @@ plugins:
- git - git
- filesystem - filesystem
order: 10 order: 10
- source: github:quartz-community/syntax-highlighting - source: "@quartz-community/syntax-highlighting"
enabled: true enabled: true
options: options:
theme: theme:
@@ -60,7 +60,7 @@ plugins:
dark: github-dark dark: github-dark
keepBackground: false keepBackground: false
order: 20 order: 20
- source: github:quartz-community/obsidian-flavored-markdown - source: "@quartz-community/obsidian-flavored-markdown"
enabled: true enabled: true
options: options:
comments: true comments: true
@@ -76,96 +76,96 @@ plugins:
enableVideoEmbed: true enableVideoEmbed: true
enableCheckbox: true enableCheckbox: true
order: 30 order: 30
- source: github:quartz-community/github-flavored-markdown - source: "@quartz-community/github-flavored-markdown"
enabled: true enabled: true
order: 40 order: 40
- source: github:quartz-community/table-of-contents - source: "@quartz-community/table-of-contents"
enabled: true enabled: true
order: 50 order: 50
layout: layout:
position: right position: right
priority: 30 priority: 30
- source: github:quartz-community/crawl-links - source: "@quartz-community/crawl-links"
enabled: true enabled: true
options: options:
markdownLinkResolution: shortest markdownLinkResolution: shortest
# disableBrokenWikilinks: false # Set true to add a "broken" CSS class to internal links whose target is not in ctx.allSlugs. # disableBrokenWikilinks: false # Set true to add a "broken" CSS class to internal links whose target is not in ctx.allSlugs.
order: 60 order: 60
- source: github:quartz-community/description - source: "@quartz-community/description"
enabled: true enabled: true
order: 70 order: 70
- source: github:quartz-community/latex - source: "@quartz-community/latex"
enabled: true enabled: true
options: options:
renderEngine: katex renderEngine: katex
order: 80 order: 80
- source: github:quartz-community/citations - source: "@quartz-community/citations"
enabled: false enabled: false
order: 85 order: 85
- source: github:quartz-community/hard-line-breaks - source: "@quartz-community/hard-line-breaks"
enabled: true enabled: true
order: 90 order: 90
- source: github:quartz-community/ox-hugo - source: "@quartz-community/ox-hugo"
enabled: false enabled: false
order: 91 order: 91
- source: github:quartz-community/roam - source: "@quartz-community/roam"
enabled: false enabled: false
order: 92 order: 92
- source: github:quartz-community/fonts - source: "@quartz-community/quartz-fonts"
enabled: true enabled: true
- source: github:quartz-community/remove-draft - source: "@quartz-community/remove-draft"
enabled: true enabled: true
- source: github:quartz-community/explicit-publish - source: "@quartz-community/explicit-publish"
enabled: false enabled: false
- source: github:quartz-community/unlisted-pages - source: "@quartz-community/unlisted-pages"
enabled: true enabled: true
options: {} options: {}
order: 45 order: 45
- source: github:quartz-community/encrypted-pages - source: "@quartz-community/encrypted-pages"
enabled: true enabled: true
options: options:
iterations: 600000 iterations: 600000
passwordField: password passwordField: password
unlistWhenEncrypted: false unlistWhenEncrypted: false
outputPath: static/encryptedContentIndex.json outputPath: static/encryptedContentIndex.json
- source: github:quartz-community/stacked-pages - source: "@quartz-community/stacked-pages"
enabled: false enabled: false
layout: layout:
position: afterBody position: afterBody
priority: 50 priority: 50
display: all display: all
- source: github:quartz-community/alias-redirects - source: "@quartz-community/alias-redirects"
enabled: true enabled: true
- source: github:quartz-community/content-index - source: "@quartz-community/content-index"
enabled: true enabled: true
options: options:
enableSiteMap: true enableSiteMap: true
enableRSS: true enableRSS: true
- source: github:quartz-community/favicon - source: "@quartz-community/favicon"
enabled: true enabled: true
- source: github:quartz-community/og-image - source: "@quartz-community/og-image"
enabled: true enabled: true
- source: github:quartz-community/cname - source: "@quartz-community/cname"
enabled: true enabled: true
- source: github:quartz-community/canvas-page - source: "@quartz-community/canvas-page"
enabled: true enabled: true
- source: github:quartz-community/content-page - source: "@quartz-community/content-page"
enabled: true enabled: true
- source: github:quartz-community/folder-page - source: "@quartz-community/folder-page"
enabled: true enabled: true
- source: github:quartz-community/tag-page - source: "@quartz-community/tag-page"
enabled: true enabled: true
- source: github:quartz-community/explorer - source: "@quartz-community/explorer"
enabled: true enabled: true
layout: layout:
position: left position: left
priority: 50 priority: 50
- source: github:quartz-community/graph - source: "@quartz-community/graph"
enabled: true enabled: true
layout: layout:
position: right position: right
priority: 10 priority: 10
- source: github:quartz-community/search - source: "@quartz-community/search"
enabled: true enabled: true
layout: layout:
position: left position: left
@@ -173,50 +173,50 @@ plugins:
group: toolbar group: toolbar
groupOptions: groupOptions:
grow: true grow: true
- source: github:quartz-community/backlinks - source: "@quartz-community/backlinks"
enabled: true enabled: true
layout: layout:
position: right position: right
priority: 50 priority: 50
- source: github:quartz-community/article-title - source: "@quartz-community/article-title"
enabled: true enabled: true
layout: layout:
position: beforeBody position: beforeBody
priority: 10 priority: 10
- source: github:quartz-community/content-meta - source: "@quartz-community/content-meta"
enabled: true enabled: true
layout: layout:
position: beforeBody position: beforeBody
priority: 20 priority: 20
- source: github:quartz-community/tag-list - source: "@quartz-community/tag-list"
enabled: false enabled: false
layout: layout:
position: beforeBody position: beforeBody
priority: 30 priority: 30
- source: github:quartz-community/page-title - source: "@quartz-community/page-title"
enabled: true enabled: true
layout: layout:
position: left position: left
priority: 10 priority: 10
- source: github:quartz-community/darkmode - source: "@quartz-community/darkmode"
enabled: true enabled: true
layout: layout:
position: left position: left
priority: 30 priority: 30
group: toolbar group: toolbar
- source: github:quartz-community/reader-mode - source: "@quartz-community/reader-mode"
enabled: true enabled: true
layout: layout:
position: left position: left
priority: 35 priority: 35
group: toolbar group: toolbar
- source: github:quartz-community/breadcrumbs - source: "@quartz-community/breadcrumbs"
enabled: true enabled: true
layout: layout:
position: beforeBody position: beforeBody
priority: 5 priority: 5
condition: not-index condition: not-index
- source: github:quartz-community/comments - source: "@quartz-community/comments"
enabled: false enabled: false
options: options:
provider: giscus provider: giscus
@@ -224,15 +224,15 @@ plugins:
layout: layout:
position: afterBody position: afterBody
priority: 10 priority: 10
- source: github:quartz-community/footer - source: "@quartz-community/footer"
enabled: true enabled: true
options: options:
links: links:
GitHub: https://github.com/jackyzha0/quartz GitHub: https://github.com/jackyzha0/quartz
Discord Community: https://discord.gg/cRFFHYye7t Discord Community: https://discord.gg/cRFFHYye7t
- source: github:quartz-community/recent-notes - source: "@quartz-community/recent-notes"
enabled: false enabled: false
- source: github:quartz-community/spacer - source: "@quartz-community/spacer"
enabled: true enabled: true
options: {} options: {}
order: 25 order: 25
@@ -240,11 +240,11 @@ plugins:
position: left position: left
priority: 25 priority: 25
display: mobile-only display: mobile-only
- source: github:quartz-community/bases-page - source: "@quartz-community/bases-page"
enabled: true enabled: true
options: {} options: {}
order: 50 order: 50
- source: github:quartz-community/note-properties - source: "@quartz-community/note-properties"
enabled: true enabled: true
options: options:
includeAll: false includeAll: false
@@ -268,7 +268,7 @@ plugins:
enabled: true enabled: true
options: options:
theme: default theme: default
- source: github:quartz-community/obsidian-plugin-excalidraw - source: "@quartz-community/obsidian-plugin-excalidraw"
enabled: true enabled: true
options: options:
enableInteraction: true enableInteraction: true
+45 -45
View File
@@ -43,7 +43,7 @@ configuration:
highlight: rgba(143, 159, 169, 0.15) highlight: rgba(143, 159, 169, 0.15)
textHighlight: "#b3aa0288" textHighlight: "#b3aa0288"
plugins: plugins:
- source: github:quartz-community/created-modified-date - source: "@quartz-community/created-modified-date"
enabled: true enabled: true
options: options:
defaultDateType: modified defaultDateType: modified
@@ -52,7 +52,7 @@ plugins:
- git - git
- filesystem - filesystem
order: 10 order: 10
- source: github:quartz-community/syntax-highlighting - source: "@quartz-community/syntax-highlighting"
enabled: true enabled: true
options: options:
theme: theme:
@@ -60,7 +60,7 @@ plugins:
dark: github-dark dark: github-dark
keepBackground: false keepBackground: false
order: 20 order: 20
- source: github:quartz-community/obsidian-flavored-markdown - source: "@quartz-community/obsidian-flavored-markdown"
enabled: true enabled: true
options: options:
comments: true comments: true
@@ -76,96 +76,96 @@ plugins:
enableVideoEmbed: true enableVideoEmbed: true
enableCheckbox: true enableCheckbox: true
order: 30 order: 30
- source: github:quartz-community/github-flavored-markdown - source: "@quartz-community/github-flavored-markdown"
enabled: true enabled: true
order: 40 order: 40
- source: github:quartz-community/table-of-contents - source: "@quartz-community/table-of-contents"
enabled: true enabled: true
order: 50 order: 50
layout: layout:
position: right position: right
priority: 30 priority: 30
- source: github:quartz-community/crawl-links - source: "@quartz-community/crawl-links"
enabled: true enabled: true
options: options:
markdownLinkResolution: shortest markdownLinkResolution: shortest
# disableBrokenWikilinks: false # Set true to add a "broken" CSS class to internal links whose target is not in ctx.allSlugs. # disableBrokenWikilinks: false # Set true to add a "broken" CSS class to internal links whose target is not in ctx.allSlugs.
order: 60 order: 60
- source: github:quartz-community/description - source: "@quartz-community/description"
enabled: true enabled: true
order: 70 order: 70
- source: github:quartz-community/latex - source: "@quartz-community/latex"
enabled: true enabled: true
options: options:
renderEngine: katex renderEngine: katex
order: 80 order: 80
- source: github:quartz-community/citations - source: "@quartz-community/citations"
enabled: false enabled: false
order: 85 order: 85
- source: github:quartz-community/hard-line-breaks - source: "@quartz-community/hard-line-breaks"
enabled: true enabled: true
order: 90 order: 90
- source: github:quartz-community/ox-hugo - source: "@quartz-community/ox-hugo"
enabled: false enabled: false
order: 91 order: 91
- source: github:quartz-community/roam - source: "@quartz-community/roam"
enabled: false enabled: false
order: 92 order: 92
- source: github:quartz-community/fonts - source: "@quartz-community/quartz-fonts"
enabled: true enabled: true
- source: github:quartz-community/remove-draft - source: "@quartz-community/remove-draft"
enabled: true enabled: true
- source: github:quartz-community/explicit-publish - source: "@quartz-community/explicit-publish"
enabled: false enabled: false
- source: github:quartz-community/unlisted-pages - source: "@quartz-community/unlisted-pages"
enabled: true enabled: true
options: {} options: {}
order: 45 order: 45
- source: github:quartz-community/encrypted-pages - source: "@quartz-community/encrypted-pages"
enabled: true enabled: true
options: options:
iterations: 600000 iterations: 600000
passwordField: password passwordField: password
unlistWhenEncrypted: false unlistWhenEncrypted: false
outputPath: static/encryptedContentIndex.json outputPath: static/encryptedContentIndex.json
- source: github:quartz-community/stacked-pages - source: "@quartz-community/stacked-pages"
enabled: false enabled: false
layout: layout:
position: afterBody position: afterBody
priority: 50 priority: 50
display: all display: all
- source: github:quartz-community/alias-redirects - source: "@quartz-community/alias-redirects"
enabled: true enabled: true
- source: github:quartz-community/content-index - source: "@quartz-community/content-index"
enabled: true enabled: true
options: options:
enableSiteMap: true enableSiteMap: true
enableRSS: true enableRSS: true
- source: github:quartz-community/favicon - source: "@quartz-community/favicon"
enabled: true enabled: true
- source: github:quartz-community/og-image - source: "@quartz-community/og-image"
enabled: true enabled: true
- source: github:quartz-community/cname - source: "@quartz-community/cname"
enabled: true enabled: true
- source: github:quartz-community/canvas-page - source: "@quartz-community/canvas-page"
enabled: true enabled: true
- source: github:quartz-community/content-page - source: "@quartz-community/content-page"
enabled: true enabled: true
- source: github:quartz-community/folder-page - source: "@quartz-community/folder-page"
enabled: true enabled: true
- source: github:quartz-community/tag-page - source: "@quartz-community/tag-page"
enabled: true enabled: true
- source: github:quartz-community/explorer - source: "@quartz-community/explorer"
enabled: true enabled: true
layout: layout:
position: left position: left
priority: 50 priority: 50
- source: github:quartz-community/graph - source: "@quartz-community/graph"
enabled: true enabled: true
layout: layout:
position: right position: right
priority: 10 priority: 10
- source: github:quartz-community/search - source: "@quartz-community/search"
enabled: true enabled: true
layout: layout:
position: left position: left
@@ -173,50 +173,50 @@ plugins:
group: toolbar group: toolbar
groupOptions: groupOptions:
grow: true grow: true
- source: github:quartz-community/backlinks - source: "@quartz-community/backlinks"
enabled: true enabled: true
layout: layout:
position: right position: right
priority: 50 priority: 50
- source: github:quartz-community/article-title - source: "@quartz-community/article-title"
enabled: true enabled: true
layout: layout:
position: beforeBody position: beforeBody
priority: 10 priority: 10
- source: github:quartz-community/content-meta - source: "@quartz-community/content-meta"
enabled: true enabled: true
layout: layout:
position: beforeBody position: beforeBody
priority: 20 priority: 20
- source: github:quartz-community/tag-list - source: "@quartz-community/tag-list"
enabled: false enabled: false
layout: layout:
position: beforeBody position: beforeBody
priority: 30 priority: 30
- source: github:quartz-community/page-title - source: "@quartz-community/page-title"
enabled: true enabled: true
layout: layout:
position: left position: left
priority: 10 priority: 10
- source: github:quartz-community/darkmode - source: "@quartz-community/darkmode"
enabled: true enabled: true
layout: layout:
position: left position: left
priority: 30 priority: 30
group: toolbar group: toolbar
- source: github:quartz-community/reader-mode - source: "@quartz-community/reader-mode"
enabled: true enabled: true
layout: layout:
position: left position: left
priority: 35 priority: 35
group: toolbar group: toolbar
- source: github:quartz-community/breadcrumbs - source: "@quartz-community/breadcrumbs"
enabled: true enabled: true
layout: layout:
position: beforeBody position: beforeBody
priority: 5 priority: 5
condition: not-index condition: not-index
- source: github:quartz-community/comments - source: "@quartz-community/comments"
enabled: false enabled: false
options: options:
provider: giscus provider: giscus
@@ -224,15 +224,15 @@ plugins:
layout: layout:
position: afterBody position: afterBody
priority: 10 priority: 10
- source: github:quartz-community/footer - source: "@quartz-community/footer"
enabled: true enabled: true
options: options:
links: links:
GitHub: https://github.com/jackyzha0/quartz GitHub: https://github.com/jackyzha0/quartz
Discord Community: https://discord.gg/cRFFHYye7t Discord Community: https://discord.gg/cRFFHYye7t
- source: github:quartz-community/recent-notes - source: "@quartz-community/recent-notes"
enabled: false enabled: false
- source: github:quartz-community/spacer - source: "@quartz-community/spacer"
enabled: true enabled: true
options: {} options: {}
order: 25 order: 25
@@ -240,11 +240,11 @@ plugins:
position: left position: left
priority: 25 priority: 25
display: mobile-only display: mobile-only
- source: github:quartz-community/bases-page - source: "@quartz-community/bases-page"
enabled: true enabled: true
options: {} options: {}
order: 50 order: 50
- source: github:quartz-community/note-properties - source: "@quartz-community/note-properties"
enabled: true enabled: true
options: options:
includeAll: false includeAll: false
@@ -274,7 +274,7 @@ plugins:
options: options:
theme: its-theme theme: its-theme
variation: ttrpg-dnd variation: ttrpg-dnd
- source: github:quartz-community/obsidian-plugin-excalidraw - source: "@quartz-community/obsidian-plugin-excalidraw"
enabled: true enabled: true
options: options:
enableInteraction: true enableInteraction: true
+12 -6
View File
@@ -433,14 +433,20 @@ export async function loadQuartzConfig(
const instances = [] const instances = []
for (const { entry, manifest } of items) { for (const { entry, manifest } of items) {
try { try {
const gitSpec = parsePluginSource(entry.source) const spec = parsePluginSource(entry.source)
const entryPoint = getPluginEntryPoint(gitSpec.name) let module
const module = await import(toFileUrl(entryPoint)) if (spec.npmPackage) {
module = await import(spec.name)
} else {
const entryPoint = getPluginEntryPoint(spec.name)
module = await import(toFileUrl(entryPoint))
}
const pluginName = spec.npmPackage ? spec.name : spec.name
if (manifest?.components && Object.keys(manifest.components).length > 0) { if (manifest?.components && Object.keys(manifest.components).length > 0) {
await loadComponentsFromPackage(gitSpec.name, manifest) await loadComponentsFromPackage(pluginName, manifest)
} }
if (manifest?.frames && Object.keys(manifest.frames).length > 0) { if (manifest?.frames && Object.keys(manifest.frames).length > 0) {
await loadFramesFromPackage(gitSpec.name, manifest) await loadFramesFromPackage(pluginName, manifest)
} }
const factory = findFactory(module, expectedCategory) const factory = findFactory(module, expectedCategory)
@@ -452,7 +458,7 @@ export async function loadQuartzConfig(
) )
continue continue
} }
const pluginOverrides = componentRegistry.getOptionOverrides(gitSpec.name) const pluginOverrides = componentRegistry.getOptionOverrides(spec.name)
const options = { ...manifest?.defaultOptions, ...entry.options, ...pluginOverrides } const options = { ...manifest?.defaultOptions, ...entry.options, ...pluginOverrides }
const instance = factory(Object.keys(options).length > 0 ? options : undefined) const instance = factory(Object.keys(options).length > 0 ? options : undefined)
if (!instance || typeof instance !== "object") { if (!instance || typeof instance !== "object") {
+46 -4
View File
@@ -951,8 +951,29 @@ export async function regeneratePluginIndex(
const dtsContent = fs.readFileSync(distIndex, "utf-8") const dtsContent = fs.readFileSync(distIndex, "utf-8")
const exportedNames = parseExportsFromDts(dtsContent) const exportedNames = parseExportsFromDts(dtsContent)
const named = exportedNames.filter((e) => !e.startsWith("type ")) const dtsTypes = exportedNames.filter((e) => e.startsWith("type ")).map((e) => e.slice(5))
const types = exportedNames.filter((e) => e.startsWith("type ")).map((e) => e.slice(5)) const dtsNamed = exportedNames.filter((e) => !e.startsWith("type "))
const jsIndex = path.join(pluginDir, "dist", "index.js")
let jsExports = new Set<string>()
if (fs.existsSync(jsIndex)) {
const jsContent = fs.readFileSync(jsIndex, "utf-8")
const jsExportMatches = jsContent.matchAll(/export\s*{\s*([^}]+)\s*}/g)
for (const m of jsExportMatches) {
for (const n of m[1].split(",")) {
const clean = n
.trim()
.split(/\s+as\s+/)
.pop()
?.trim()
if (clean) jsExports.add(clean)
}
}
}
const named = jsExports.size > 0 ? dtsNamed.filter((n) => jsExports.has(n)) : dtsNamed
const extraTypes = jsExports.size > 0 ? dtsNamed.filter((n) => !jsExports.has(n)) : []
const types = [...dtsTypes, ...extraTypes]
const overridable = named.filter((n) => isOverridableExport(n, dtsContent)) const overridable = named.filter((n) => isOverridableExport(n, dtsContent))
const passthrough = named.filter((n) => !isOverridableExport(n, dtsContent)) const passthrough = named.filter((n) => !isOverridableExport(n, dtsContent))
@@ -988,8 +1009,29 @@ export async function regeneratePluginIndex(
const dtsContent = fs.readFileSync(distIndex, "utf-8") const dtsContent = fs.readFileSync(distIndex, "utf-8")
const exportedNames = parseExportsFromDts(dtsContent) const exportedNames = parseExportsFromDts(dtsContent)
const named = exportedNames.filter((e) => !e.startsWith("type ")) const dtsTypes = exportedNames.filter((e) => e.startsWith("type ")).map((e) => e.slice(5))
const types = exportedNames.filter((e) => e.startsWith("type ")).map((e) => e.slice(5)) const dtsNamed = exportedNames.filter((e) => !e.startsWith("type "))
const jsIndex = path.join(path.dirname(distIndex), "index.js")
let jsExports = new Set<string>()
if (fs.existsSync(jsIndex)) {
const jsContent = fs.readFileSync(jsIndex, "utf-8")
const jsExportMatches = jsContent.matchAll(/export\s*{\s*([^}]+)\s*}/g)
for (const m of jsExportMatches) {
for (const n of m[1].split(",")) {
const clean = n
.trim()
.split(/\s+as\s+/)
.pop()
?.trim()
if (clean) jsExports.add(clean)
}
}
}
const named = jsExports.size > 0 ? dtsNamed.filter((n) => jsExports.has(n)) : dtsNamed
const extraTypes = jsExports.size > 0 ? dtsNamed.filter((n) => !jsExports.has(n)) : []
const types = [...dtsTypes, ...extraTypes]
const overridable = named.filter((n) => isOverridableExport(n, dtsContent)) const overridable = named.filter((n) => isOverridableExport(n, dtsContent))
const passthrough = named.filter((n) => !isOverridableExport(n, dtsContent)) const passthrough = named.filter((n) => !isOverridableExport(n, dtsContent))