Skip to content

chore: 同步 Quartz v5 并升级到 Node 26 - #40

Open
oldwinter wants to merge 58 commits into
v5from
codex/upgrade-latest-20260831
Open

chore: 同步 Quartz v5 并升级到 Node 26#40
oldwinter wants to merge 58 commits into
v5from
codex/upgrade-latest-20260831

Conversation

@oldwinter

@oldwinter oldwinter commented Aug 31, 2026

Copy link
Copy Markdown
Owner

构建了什么

  • 以独立 merge commit 同步 jackyzha0/quartzv5075afd3f712da0088a07f5284a7b3aba37dd61b6,保留本地主题切换器、中文内容和 vendored Obsidian Flavored Markdown 插件。
  • 根运行时升级到 Node 26.8.1、npm 12.0.2、TypeScript 7.0.2;升级全部可兼容的 npm 依赖并生成官方 npm registry 锁文件。
  • 把官方 Quartz 插件从 Git clone 来源迁到已发布的 @quartz-community/* 包;本地 OFM/theme 插件继续使用仓库内路径。
  • 将 vendored OFM 迁到 ESLint 10 flat config,并更新其构建产物;Docker、GitHub Actions、Pages/Cloudflare 构建入口同步升级并固定到发布 tag 对应的不可变 SHA。

为什么觉得它会很酷/值得合并

  • 上游同步与依赖升级分成两个提交,可分别审查和回滚。
  • 插件安装不再在每次构建时克隆 35 个官方仓库,减少失败面并让锁文件真正约束构建。
  • 本地、CI 和 Docker 使用同一 Node/npm 主版本;清洁安装、审计、类型检查和真实内容构建已经在该组合上跑通。

官方迁移来源

验证

  • Node 26.8.1 + npm 12.0.2:根 npm cinpm outdated 0 项、npm audit 0 漏洞、install scripts 0 pending。
  • 根测试 304/304;TypeScript 7 tsc --noEmit 通过。
  • theme-switcher:typecheck/build 通过,测试 23/23;OFM:typecheck、ESLint 10、Vitest(当前无测试文件)、tsup build 通过。
  • .quartz 目录安装结果为 2 个本地插件 + 35 个 npm 插件,无重复导出警告。
  • 完整 Quartz 构建两次通过:314 个输入,1912 个输出文件。
  • workflow YAML、actionlint、定向 Prettier、git diff --check 通过;完整 Docker build 通过,镜像 SHA 8d2be5459e721daaf7cf84c03d79ff9f28a3ef82d77aebd52a631c0037482f10

影响

  • CI/Docker 构建要求 Node >=26、npm >=12;依赖安装改为 npm ci
  • 根项目使用 TypeScript 7;两个本地插件暂留 TypeScript 5.9.3,因为当前 tsup 声明生成器和 typescript-eslint 8.68 的官方兼容范围尚未覆盖 TypeScript 7。
  • GitHub Actions 全部固定到当前正式发布版本的 commit SHA,后续升级需要显式更新。

回滚

  • 先 revert 依赖提交 cd7eeaf726a77890f20bc1293bb68e0be393d7ee
  • 如需同时撤销上游同步,再以 mainline 1 revert merge commit d8fa4d9794d739b1ffec8ad6c9bc705c6b59ac55

阻塞项

  • 残余风险:本 PR 不自动合并;兼容上限、外部 CI/运行环境限制及未覆盖场景以本节和“影响”中的记录为准。

  • 仓库全量 npm run check 的类型阶段通过,但 Prettier 会命中既有的 259 个内容、Canvas 和文档格式差异;本 PR 未批量改写知识库,只对本次源文件做了定向格式验证。

  • 内容构建保留两个非致命既有警告:foam.md 的非标准日期,以及 LXGW WenKai 400 weight 的 Google Fonts HTTP 400;构建仍完整产出 1912 个文件。

  • Netlify 为 exact SHA cd7eeaf7 创建的 deploy preview 在 10 秒内进入 state=errorpublished_at/deploy_time/error_message 均为空且预览 URL 返回 404;其 build log 需要 Netlify 登录,当前环境无法取得更具体原因。对应 4 个 Netlify 状态均失败。

  • 上游 GitHub Actions workflow 保留 github.repository == 'jackyzha0/quartz' 保护条件,因此 fork PR 没有标准 CI checks;本 PR 没有修改 runner、billing、Netlify 配置、secrets 或部署权限。

  • 未执行浏览器视觉回归或跨架构 Docker build;当前证据为 macOS arm64 本地构建、测试、内容生成与 arm64 Docker build。

saberzero1 and others added 30 commits June 9, 2026 02:24
The serve-mode watcher globs never matched quartz.config.yaml or
quartz.config.default.yaml, so config edits (theme colors, plugin
flags, footer links) silently required a server restart. This was a
regression from v4, where quartz.config.ts matched the **/*.ts glob.
Co-authored-by: Leo Schultheiß <leo.schultheiss@fau.de>
… updates (jackyzha0#2426)

Bumps the ci-dependencies group with 9 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `6` | `7` |
| [actions/download-artifact](https://github.com/actions/download-artifact) | `7` | `8` |
| [rlespinasse/github-slug-action](https://github.com/rlespinasse/github-slug-action) | `5.4.0` | `5.6.0` |
| [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) | `3` | `4` |
| [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) | `3` | `4` |
| [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) | `4.0.0` | `4.1.2` |
| [docker/login-action](https://github.com/docker/login-action) | `3` | `4` |
| [docker/metadata-action](https://github.com/docker/metadata-action) | `5` | `6` |
| [docker/build-push-action](https://github.com/docker/build-push-action) | `6` | `7` |



Updates `actions/upload-artifact` from 6 to 7
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v6...v7)

Updates `actions/download-artifact` from 7 to 8
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@v7...v8)

Updates `rlespinasse/github-slug-action` from 5.4.0 to 5.6.0
- [Release notes](https://github.com/rlespinasse/github-slug-action/releases)
- [Commits](rlespinasse/github-slug-action@v5.4.0...v5.6.0)

Updates `docker/setup-qemu-action` from 3 to 4
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](docker/setup-qemu-action@v3...v4)

Updates `docker/setup-buildx-action` from 3 to 4
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](docker/setup-buildx-action@v3...v4)

Updates `sigstore/cosign-installer` from 4.0.0 to 4.1.2
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](sigstore/cosign-installer@v4.0.0...v4.1.2)

Updates `docker/login-action` from 3 to 4
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](docker/login-action@v3...v4)

Updates `docker/metadata-action` from 5 to 6
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Commits](docker/metadata-action@v5...v6)

Updates `docker/build-push-action` from 6 to 7
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](docker/build-push-action@v6...v7)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci-dependencies
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci-dependencies
- dependency-name: docker/build-push-action
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci-dependencies
- dependency-name: docker/login-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci-dependencies
- dependency-name: docker/metadata-action
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci-dependencies
- dependency-name: docker/setup-buildx-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci-dependencies
- dependency-name: docker/setup-qemu-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci-dependencies
- dependency-name: rlespinasse/github-slug-action
  dependency-version: 5.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci-dependencies
- dependency-name: sigstore/cosign-installer
  dependency-version: 4.1.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: ci-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Plugins can now be referenced as "@quartz-community/<name>" in
quartz.config.yaml and via 'quartz plugin add'. The npm path skips
git installation and resolves from node_modules.

Changes:
- gitLoader.ts: detect @scope/name as npm package in parsePluginSource()
- config-loader.ts: skip git install for npm packages, read manifests
  from node_modules via createRequire
- install-plugins.ts: filter npm packages from prebuild, fallback to
  YAML config parsing to avoid loading full quartz.ts
- plugin-data.js: npm detection in CLI parseGitSource()
- plugin-git-handlers.js: npm install path in handlePluginAdd()
- package.json: add missing hast-util-from-html dependency
- quartz.config.default.yaml: all 44 plugins use @quartz-community/* npm specifiers
- cli/templates/*.yaml: all 4 templates updated (default, blog, obsidian, ttrpg)
- bootstrap-cli.mjs: updated help text
- package.json: devDeps use npm semver ranges instead of github: specifiers
- gitLoader.ts: regeneratePluginIndex scans npm packages from node_modules
- install-plugins.ts: generates plugin index for npm packages
- Removed quartz.lock.json (only relevant for git-installed plugins)
With npm specifiers, quartz.lock.json may not exist.
The glob pattern makes the COPY conditional.
- Added all 44 default plugins as dependencies so npm ci installs them
- Fixed @quartz-community/fonts → @quartz-community/quartz-fonts (actual npm name)
- Regenerated package-lock.json with plugin dependencies
og-image requires sharp as a peer dep which conflicts with the
version installed by quartz core. legacy-peer-deps allows both
to coexist until the peer dep ranges are aligned.
The lockfile was generated on linux x86_64 but CI needs platform-
specific optional deps for all architectures. npm install resolves
them correctly while npm ci requires exact lockfile match.
The npm specifier path requires additional work in the esbuild
transpilation pipeline to mark npm imports as external. Reverting
to github: specifiers to restore the docs site immediately.

The npm loader code (parsePluginSource, config-loader, CLI) remains
in place for future use. Only the default config/templates are reverted.
- 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
saberzero1 and others added 28 commits July 23, 2026 02:23
…er ranges)

Multiple plugins declare incompatible peer dep ranges for shared packages
(sharp, @myriaddreamin/rehype-typst, etc). These are optional peers that
work correctly at runtime. legacy-peer-deps is the appropriate setting
for a host application consuming many plugins.
Remove unconditional import of CustomOgImagesEmitterName from
.quartz/plugins in Head.tsx. This caused builds to fail when the
og-image plugin was not listed in quartz.config.yaml, violating the
plugin system's opt-in contract.

The fix inlines the emitter name string constant at the usage site.

Also convert the ContentDetails import in fileTrie.ts to
`import type` since it is only used in a type position.
Add @quartz-themes/core to dependencies and @quartz-themes/ to shared
scopes so theme packages are treated as externals by the plugin bundler.
Add disabled theme entry to default config and default/blog templates.
Migrate obsidian and ttrpg templates from git-based quartz-themes source
to npm @quartz-themes/core package.
…e positions, footer as array, add defaultPosition fallback, add tests, update docs
…20260831

# Conflicts:
#	quartz/plugins/loader/install-plugins.ts
@netlify

netlify Bot commented Aug 31, 2026

Copy link
Copy Markdown

Deploy Preview for aquamarine-salamander-b041fe failed. Why did it fail? →

Name Link
🔨 Latest commit cd7eeaf
🔍 Latest deploy log https://app.netlify.com/projects/aquamarine-salamander-b041fe/deploys/6a9579a47fa14500083e58e0

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants